diff --git a/about.po b/about.po index 34c5041570..a95b16de88 100644 --- a/about.po +++ b/about.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -14,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-05 00:19+0000\n" +"POT-Creation-Date: 2025-01-01 00:15+0000\n" "PO-Revision-Date: 2022-05-12 00:11+0800\n" "Last-Translator: hsiao yi \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,18 +26,19 @@ msgstr "" "X-Generator: Poedit 3.0.1\n" #: ../../about.rst:3 -msgid "About these documents" -msgstr "關於這些說明文件" +msgid "About this documentation" +msgstr "關於這份說明文件" #: ../../about.rst:6 msgid "" -"These documents are generated from `reStructuredText`_ sources by `Sphinx`_, " -"a document processor specifically written for the Python documentation." +"Python's documentation is generated from `reStructuredText`_ sources using " +"`Sphinx`_, a documentation generator originally created for Python and now " +"maintained as an independent project." msgstr "" -"這些說明文件是透過 `Sphinx`_ (一個專為 Python 說明文件所撰寫的文件處理器)將" -"使用 `reStructuredText`_ 撰寫的原始檔轉換而成。" +"Python 說明文件是透過使用 `Sphinx`_\\ (一個原為 Python 而生的文件產生器、目" +"前是以獨立專案形式來維護)將使用 `reStructuredText`_ 撰寫的原始檔轉換而成。" -#: ../../about.rst:15 +#: ../../about.rst:16 msgid "" "Development of the documentation and its toolchain is an entirely volunteer " "effort, just like Python itself. If you want to contribute, please take a " @@ -49,26 +49,26 @@ msgstr "" "報臭蟲,請見 :ref:`reporting-bugs` 頁面,內含相關資訊。我們永遠歡迎新的自願者" "加入!" -#: ../../about.rst:20 +#: ../../about.rst:21 msgid "Many thanks go to:" msgstr "致謝:" -#: ../../about.rst:22 +#: ../../about.rst:23 msgid "" "Fred L. Drake, Jr., the creator of the original Python documentation toolset " -"and writer of much of the content;" +"and author of much of the content;" msgstr "" "Fred L. Drake, Jr.,原始 Python 文件工具集的創造者以及一大部份內容的作者;" -#: ../../about.rst:24 +#: ../../about.rst:25 msgid "" "the `Docutils `_ project for creating " "reStructuredText and the Docutils suite;" msgstr "" -"創造 reStructuredText 和 Docutils 工具組的 `Docutils `_ 專案;" +"創造 reStructuredText 和 Docutils 工具組的 `Docutils `_ 專案;" -#: ../../about.rst:26 +#: ../../about.rst:27 msgid "" "Fredrik Lundh for his Alternative Python Reference project from which Sphinx " "got many good ideas." @@ -76,11 +76,11 @@ msgstr "" "Fredrik Lundh 先生,Sphinx 從他的 Alternative Python Reference 計劃中獲得許多" "的好主意。" -#: ../../about.rst:31 -msgid "Contributors to the Python Documentation" +#: ../../about.rst:32 +msgid "Contributors to the Python documentation" msgstr "Python 文件的貢獻者們" -#: ../../about.rst:33 +#: ../../about.rst:34 msgid "" "Many people have contributed to the Python language, the Python standard " "library, and the Python documentation. See :source:`Misc/ACKS` in the " @@ -89,7 +89,7 @@ msgstr "" "許多人都曾為 Python 這門語言、Python 標準函式庫和 Python 說明文件貢獻過。" "Python 所發佈的原始碼中含有部份貢獻者的清單,請見 :source:`Misc/ACKS` 。" -#: ../../about.rst:37 +#: ../../about.rst:38 msgid "" "It is only with the input and contributions of the Python community that " "Python has such wonderful documentation -- Thank You!" diff --git a/c-api/arg.po b/c-api/arg.po index 6e8339452f..7d0ae25460 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-01-07 00:14+0000\n" "PO-Revision-Date: 2022-10-16 03:21+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,22 +25,22 @@ msgstr "剖析引數與建置數值" #: ../../c-api/arg.rst:8 msgid "" "These functions are useful when creating your own extensions functions and " -"methods. Additional information and examples are available in :ref:" -"`extending-index`." +"methods. Additional information and examples are available " +"in :ref:`extending-index`." msgstr "" #: ../../c-api/arg.rst:12 msgid "" -"The first three of these functions described, :c:func:`PyArg_ParseTuple`, :c:" -"func:`PyArg_ParseTupleAndKeywords`, and :c:func:`PyArg_Parse`, all use " -"*format strings* which are used to tell the function about the expected " -"arguments. The format strings use the same syntax for each of these " -"functions." +"The first three of these functions " +"described, :c:func:`PyArg_ParseTuple`, :c:func:`PyArg_ParseTupleAndKeywords`, " +"and :c:func:`PyArg_Parse`, all use *format strings* which are used to tell " +"the function about the expected arguments. The format strings use the same " +"syntax for each of these functions." msgstr "" #: ../../c-api/arg.rst:19 msgid "Parsing arguments" -msgstr "" +msgstr "剖析引數" #: ../../c-api/arg.rst:21 msgid "" @@ -109,10 +108,10 @@ msgstr "" #: ../../c-api/arg.rst:70 msgid "" -"To ensure that the underlying buffer may be safely borrowed, the object's :c:" -"member:`PyBufferProcs.bf_releasebuffer` field must be ``NULL``. This " -"disallows common mutable objects such as :class:`bytearray`, but also some " -"read-only objects such as :class:`memoryview` of :class:`bytes`." +"To ensure that the underlying buffer may be safely borrowed, the " +"object's :c:member:`PyBufferProcs.bf_releasebuffer` field must be ``NULL``. " +"This disallows common mutable objects such as :class:`bytearray`, but also " +"some read-only objects such as :class:`memoryview` of :class:`bytes`." msgstr "" #: ../../c-api/arg.rst:76 @@ -140,8 +139,8 @@ msgstr "" msgid "" "This format does not accept :term:`bytes-like objects `. " "If you want to accept filesystem paths and convert them to C character " -"strings, it is preferable to use the ``O&`` format with :c:func:" -"`PyUnicode_FSConverter` as *converter*." +"strings, it is preferable to use the ``O&`` format " +"with :c:func:`PyUnicode_FSConverter` as *converter*." msgstr "" #: ../../c-api/arg.rst:96 @@ -152,7 +151,7 @@ msgstr "" #: ../../c-api/arg.rst:100 msgid "``s*`` (:class:`str` or :term:`bytes-like object`) [Py_buffer]" -msgstr "``s*``\\ (:class:`str` 或 :term:`bytes-like object`)[Py_buffer]" +msgstr "``s*`` (:class:`str` 或 :term:`bytes-like object`) [Py_buffer]" #: ../../c-api/arg.rst:101 msgid "" @@ -164,9 +163,11 @@ msgstr "" #: ../../c-api/arg.rst:106 msgid "" -"``s#`` (:class:`str`, read-only :term:`bytes-like object`) [const char \\*, :" -"c:type:`Py_ssize_t`]" +"``s#`` (:class:`str`, read-only :term:`bytes-like object`) [const char " +"\\*, :c:type:`Py_ssize_t`]" msgstr "" +"``s#`` (:class:`str`、唯讀的 :term:`bytes-like object`) [const char " +"\\*, :c:type:`Py_ssize_t`]" #: ../../c-api/arg.rst:107 msgid "" @@ -177,9 +178,9 @@ msgid "" "encoding." msgstr "" -#: ../../c-api/arg.rst:113 ../../c-api/arg.rst:581 +#: ../../c-api/arg.rst:113 ../../c-api/arg.rst:593 msgid "``z`` (:class:`str` or ``None``) [const char \\*]" -msgstr "``z``\\ (:class:`str` 或 ``None``)[const char \\*]" +msgstr "``z`` (:class:`str` 或 ``None``) [const char \\*]" #: ../../c-api/arg.rst:114 msgid "" @@ -191,7 +192,7 @@ msgstr "" msgid "" "``z*`` (:class:`str`, :term:`bytes-like object` or ``None``) [Py_buffer]" msgstr "" -"``z*``\\ (:class:`str`、:term:`bytes-like object` 或 ``None``)[Py_buffer]" +"``z*`` (:class:`str`、:term:`bytes-like object` 或 ``None``) [Py_buffer]" #: ../../c-api/arg.rst:118 msgid "" @@ -204,6 +205,8 @@ msgid "" "``z#`` (:class:`str`, read-only :term:`bytes-like object` or ``None``) " "[const char \\*, :c:type:`Py_ssize_t`]" msgstr "" +"``z#`` (:class:`str`、唯讀的 :term:`bytes-like object` 或 ``None``) [const " +"char \\*, :c:type:`Py_ssize_t`]" #: ../../c-api/arg.rst:122 msgid "" @@ -213,7 +216,7 @@ msgstr "" #: ../../c-api/arg.rst:125 msgid "``y`` (read-only :term:`bytes-like object`) [const char \\*]" -msgstr "``y``\\ (唯讀 :term:`bytes-like object`)[const char \\*]" +msgstr "``y`` (唯讀的 :term:`bytes-like object`) [const char \\*]" #: ../../c-api/arg.rst:126 msgid "" @@ -241,9 +244,11 @@ msgstr "" #: ../../c-api/arg.rst:141 msgid "" -"``y#`` (read-only :term:`bytes-like object`) [const char \\*, :c:type:" -"`Py_ssize_t`]" +"``y#`` (read-only :term:`bytes-like object`) [const char " +"\\*, :c:type:`Py_ssize_t`]" msgstr "" +"``y#`` (唯讀的 :term:`bytes-like object`) [const char " +"\\*, :c:type:`Py_ssize_t`]" #: ../../c-api/arg.rst:142 msgid "" @@ -269,9 +274,9 @@ msgstr "``Y`` (:class:`bytearray`) [PyByteArrayObject \\*]" #: ../../c-api/arg.rst:151 msgid "" "Requires that the Python object is a :class:`bytearray` object, without " -"attempting any conversion. Raises :exc:`TypeError` if the object is not a :" -"class:`bytearray` object. The C variable may also be declared as :c:expr:" -"`PyObject*`." +"attempting any conversion. Raises :exc:`TypeError` if the object is not " +"a :class:`bytearray` object. The C variable may also be declared " +"as :c:expr:`PyObject*`." msgstr "" #: ../../c-api/arg.rst:155 @@ -287,14 +292,14 @@ msgstr "" #: ../../c-api/arg.rst:160 msgid "``w*`` (read-write :term:`bytes-like object`) [Py_buffer]" -msgstr "``w*`` (可讀寫 :term:`bytes-like object`) [Py_buffer]" +msgstr "``w*`` (可讀寫 :term:`bytes-like object`) [Py_buffer]" #: ../../c-api/arg.rst:161 msgid "" "This format accepts any object which implements the read-write buffer " "interface. It fills a :c:type:`Py_buffer` structure provided by the caller. " -"The buffer may contain embedded null bytes. The caller have to call :c:func:" -"`PyBuffer_Release` when it is done with the buffer." +"The buffer may contain embedded null bytes. The caller have to " +"call :c:func:`PyBuffer_Release` when it is done with the buffer." msgstr "" #: ../../c-api/arg.rst:166 @@ -322,8 +327,8 @@ msgstr "" msgid "" ":c:func:`PyArg_ParseTuple` will allocate a buffer of the needed size, copy " "the encoded data into this buffer and adjust *\\*buffer* to reference the " -"newly allocated storage. The caller is responsible for calling :c:func:" -"`PyMem_Free` to free the allocated buffer after use." +"newly allocated storage. The caller is responsible for " +"calling :c:func:`PyMem_Free` to free the allocated buffer after use." msgstr "" #: ../../c-api/arg.rst:183 @@ -331,6 +336,8 @@ msgid "" "``et`` (:class:`str`, :class:`bytes` or :class:`bytearray`) [const char " "\\*encoding, char \\*\\*buffer]" msgstr "" +"``et`` (:class:`str`、:class:`bytes` 或 :class:`bytearray`) [const char " +"\\*encoding, char \\*\\*buffer]" #: ../../c-api/arg.rst:184 msgid "" @@ -341,9 +348,11 @@ msgstr "" #: ../../c-api/arg.rst:188 msgid "" -"``es#`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer, :c:type:" -"`Py_ssize_t` \\*buffer_length]" +"``es#`` (:class:`str`) [const char \\*encoding, char " +"\\*\\*buffer, :c:type:`Py_ssize_t` \\*buffer_length]" msgstr "" +"``es#`` (:class:`str`) [const char \\*encoding, char " +"\\*\\*buffer, :c:type:`Py_ssize_t` \\*buffer_length]" #: ../../c-api/arg.rst:189 msgid "" @@ -367,7 +376,7 @@ msgstr "" #: ../../c-api/arg.rst:203 msgid "There are two modes of operation:" -msgstr "" +msgstr "有兩個操作模式:" #: ../../c-api/arg.rst:205 msgid "" @@ -417,38 +426,60 @@ msgid "Numbers" msgstr "數字" #: ../../c-api/arg.rst:232 +msgid "" +"These formats allow representing Python numbers or single characters as C " +"numbers. Formats that require :class:`int`, :class:`float` " +"or :class:`complex` can also use the corresponding special " +"methods :meth:`~object.__index__`, :meth:`~object.__float__` " +"or :meth:`~object.__complex__` to convert the Python object to the required " +"type." +msgstr "" + +#: ../../c-api/arg.rst:238 +msgid "" +"For signed integer formats, :exc:`OverflowError` is raised if the value is " +"out of range for the C type. For unsigned integer formats, no range checking " +"is done --- the most significant bits are silently truncated when the " +"receiving field is too small to receive the value." +msgstr "" + +#: ../../c-api/arg.rst:244 msgid "``b`` (:class:`int`) [unsigned char]" msgstr "``b`` (:class:`int`) [unsigned char]" -#: ../../c-api/arg.rst:233 +#: ../../c-api/arg.rst:245 msgid "" -"Convert a nonnegative Python integer to an unsigned tiny int, stored in a C :" -"c:expr:`unsigned char`." +"Convert a nonnegative Python integer to an unsigned tiny integer, stored in " +"a C :c:expr:`unsigned char`." msgstr "" +"將一個 Python 非負整數轉換成無符號 tiny integer(小整數),儲存在 C " +"的 :c:expr:`unsigned`" -#: ../../c-api/arg.rst:236 ../../c-api/arg.rst:615 +#: ../../c-api/arg.rst:248 ../../c-api/arg.rst:627 msgid "``B`` (:class:`int`) [unsigned char]" msgstr "``B`` (:class:`int`) [unsigned char]" -#: ../../c-api/arg.rst:237 +#: ../../c-api/arg.rst:249 msgid "" -"Convert a Python integer to a tiny int without overflow checking, stored in " -"a C :c:expr:`unsigned char`." +"Convert a Python integer to a tiny integer without overflow checking, stored " +"in a C :c:expr:`unsigned char`." msgstr "" +"將一個 Python 整數轉換成 tiny integer,轉換過程無溢位檢查,儲存在 C " +"的 :c:expr:`unsigned char`。" -#: ../../c-api/arg.rst:240 ../../c-api/arg.rst:609 +#: ../../c-api/arg.rst:252 ../../c-api/arg.rst:621 msgid "``h`` (:class:`int`) [short int]" msgstr "``h`` (:class:`int`) [short int]" -#: ../../c-api/arg.rst:241 +#: ../../c-api/arg.rst:253 msgid "Convert a Python integer to a C :c:expr:`short int`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`short int`。" -#: ../../c-api/arg.rst:243 ../../c-api/arg.rst:618 +#: ../../c-api/arg.rst:255 ../../c-api/arg.rst:630 msgid "``H`` (:class:`int`) [unsigned short int]" msgstr "``H`` (:class:`int`) [unsigned short int]" -#: ../../c-api/arg.rst:244 +#: ../../c-api/arg.rst:256 msgid "" "Convert a Python integer to a C :c:expr:`unsigned short int`, without " "overflow checking." @@ -456,57 +487,57 @@ msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned short int`,轉換過程無溢位檢" "查。" -#: ../../c-api/arg.rst:247 ../../c-api/arg.rst:603 +#: ../../c-api/arg.rst:259 ../../c-api/arg.rst:615 msgid "``i`` (:class:`int`) [int]" msgstr "``i`` (:class:`int`) [int]" -#: ../../c-api/arg.rst:248 +#: ../../c-api/arg.rst:260 msgid "Convert a Python integer to a plain C :c:expr:`int`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`int`。" -#: ../../c-api/arg.rst:250 ../../c-api/arg.rst:621 +#: ../../c-api/arg.rst:262 ../../c-api/arg.rst:633 msgid "``I`` (:class:`int`) [unsigned int]" msgstr "``I`` (:class:`int`) [unsigned int]" -#: ../../c-api/arg.rst:251 +#: ../../c-api/arg.rst:263 msgid "" "Convert a Python integer to a C :c:expr:`unsigned int`, without overflow " "checking." msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned int`,轉換過程無溢位檢查。" -#: ../../c-api/arg.rst:254 ../../c-api/arg.rst:612 +#: ../../c-api/arg.rst:266 ../../c-api/arg.rst:624 msgid "``l`` (:class:`int`) [long int]" msgstr "``l`` (:class:`int`) [long int]" -#: ../../c-api/arg.rst:255 +#: ../../c-api/arg.rst:267 msgid "Convert a Python integer to a C :c:expr:`long int`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`long int`。" -#: ../../c-api/arg.rst:257 ../../c-api/arg.rst:624 +#: ../../c-api/arg.rst:269 ../../c-api/arg.rst:636 msgid "``k`` (:class:`int`) [unsigned long]" msgstr "``k`` (:class:`int`) [unsigned long]" -#: ../../c-api/arg.rst:258 +#: ../../c-api/arg.rst:270 msgid "" "Convert a Python integer to a C :c:expr:`unsigned long` without overflow " "checking." msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned long`,轉換過程無溢位檢查。" -#: ../../c-api/arg.rst:261 ../../c-api/arg.rst:627 +#: ../../c-api/arg.rst:273 ../../c-api/arg.rst:639 msgid "``L`` (:class:`int`) [long long]" msgstr "``L`` (:class:`int`) [long long]" -#: ../../c-api/arg.rst:262 +#: ../../c-api/arg.rst:274 msgid "Convert a Python integer to a C :c:expr:`long long`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`long long`。" -#: ../../c-api/arg.rst:264 ../../c-api/arg.rst:630 +#: ../../c-api/arg.rst:276 ../../c-api/arg.rst:642 msgid "``K`` (:class:`int`) [unsigned long long]" msgstr "``K`` (:class:`int`) [unsigned long long]" -#: ../../c-api/arg.rst:265 +#: ../../c-api/arg.rst:277 msgid "" "Convert a Python integer to a C :c:expr:`unsigned long long` without " "overflow checking." @@ -514,83 +545,83 @@ msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned long long`,轉換過程無溢位檢" "查。" -#: ../../c-api/arg.rst:268 ../../c-api/arg.rst:633 +#: ../../c-api/arg.rst:280 ../../c-api/arg.rst:645 msgid "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" msgstr "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:269 +#: ../../c-api/arg.rst:281 msgid "Convert a Python integer to a C :c:type:`Py_ssize_t`." msgstr "將一個 Python 整數轉換成 C 的 :c:type:`Py_ssize_t`。" -#: ../../c-api/arg.rst:271 +#: ../../c-api/arg.rst:283 msgid "``c`` (:class:`bytes` or :class:`bytearray` of length 1) [char]" -msgstr "``c``\\ (:class:`bytes` 或長度為 1 的 :class:`bytearray`)[char]" +msgstr "``c`` (:class:`bytes` 或長度為 1 的 :class:`bytearray`) [char]" -#: ../../c-api/arg.rst:272 +#: ../../c-api/arg.rst:284 msgid "" "Convert a Python byte, represented as a :class:`bytes` or :class:`bytearray` " "object of length 1, to a C :c:expr:`char`." msgstr "" -#: ../../c-api/arg.rst:275 +#: ../../c-api/arg.rst:287 msgid "Allow :class:`bytearray` objects." msgstr "允許 :class:`bytearray` 物件。" -#: ../../c-api/arg.rst:278 ../../c-api/arg.rst:640 +#: ../../c-api/arg.rst:290 ../../c-api/arg.rst:652 msgid "``C`` (:class:`str` of length 1) [int]" -msgstr "``C``\\ (長度為 1 的 :class:`str`)[int]" +msgstr "``C`` (長度為 1 的 :class:`str`) [int]" -#: ../../c-api/arg.rst:279 +#: ../../c-api/arg.rst:291 msgid "" "Convert a Python character, represented as a :class:`str` object of length " "1, to a C :c:expr:`int`." msgstr "" -#: ../../c-api/arg.rst:282 ../../c-api/arg.rst:647 +#: ../../c-api/arg.rst:294 ../../c-api/arg.rst:659 msgid "``f`` (:class:`float`) [float]" msgstr "``f`` (:class:`float`) [float]" -#: ../../c-api/arg.rst:283 +#: ../../c-api/arg.rst:295 msgid "Convert a Python floating-point number to a C :c:expr:`float`." msgstr "將一個 Python 浮點數轉換成 C 的 :c:type::c:expr:`float`。" -#: ../../c-api/arg.rst:285 ../../c-api/arg.rst:644 +#: ../../c-api/arg.rst:297 ../../c-api/arg.rst:656 msgid "``d`` (:class:`float`) [double]" msgstr "``d`` (:class:`float`) [double]" -#: ../../c-api/arg.rst:286 +#: ../../c-api/arg.rst:298 msgid "Convert a Python floating-point number to a C :c:expr:`double`." msgstr "將一個 Python 浮點數轉換成 C 的 :c:type::c:expr:`double`。" -#: ../../c-api/arg.rst:288 +#: ../../c-api/arg.rst:300 msgid "``D`` (:class:`complex`) [Py_complex]" msgstr "``D`` (:class:`complex`) [Py_complex]" -#: ../../c-api/arg.rst:289 +#: ../../c-api/arg.rst:301 msgid "Convert a Python complex number to a C :c:type:`Py_complex` structure." msgstr "將一個 Python 複數轉換成 C 的 :c:type:`Py_complex` 結構。" -#: ../../c-api/arg.rst:292 +#: ../../c-api/arg.rst:304 msgid "Other objects" msgstr "其他物件" -#: ../../c-api/arg.rst:294 ../../c-api/arg.rst:653 +#: ../../c-api/arg.rst:306 ../../c-api/arg.rst:665 msgid "``O`` (object) [PyObject \\*]" -msgstr "``O``\\ (物件)[PyObject \\*]" +msgstr "``O`` (object) [PyObject \\*]" -#: ../../c-api/arg.rst:295 +#: ../../c-api/arg.rst:307 msgid "" "Store a Python object (without any conversion) in a C object pointer. The C " -"program thus receives the actual object that was passed. A new :term:" -"`strong reference` to the object is not created (i.e. its reference count is " -"not increased). The pointer stored is not ``NULL``." +"program thus receives the actual object that was passed. A " +"new :term:`strong reference` to the object is not created (i.e. its " +"reference count is not increased). The pointer stored is not ``NULL``." msgstr "" -#: ../../c-api/arg.rst:301 +#: ../../c-api/arg.rst:313 msgid "``O!`` (object) [*typeobject*, PyObject \\*]" -msgstr "``O!``\\ (物件)[*typeobject*, PyObject \\*]" +msgstr "``O!`` (object) [*typeobject*, PyObject \\*]" -#: ../../c-api/arg.rst:302 +#: ../../c-api/arg.rst:314 msgid "" "Store a Python object in a C object pointer. This is similar to ``O``, but " "takes two C arguments: the first is the address of a Python type object, the " @@ -599,11 +630,11 @@ msgid "" "required type, :exc:`TypeError` is raised." msgstr "" -#: ../../c-api/arg.rst:310 ../../c-api/arg.rst:671 -msgid "``O&`` (object) [*converter*, *anything*]" -msgstr "``O&``\\ (物件)[*converter*, *anything*]" +#: ../../c-api/arg.rst:322 +msgid "``O&`` (object) [*converter*, *address*]" +msgstr "``O&`` (object) [*converter*, *address*]" -#: ../../c-api/arg.rst:311 +#: ../../c-api/arg.rst:323 msgid "" "Convert a Python object to a C variable through a *converter* function. " "This takes two arguments: the first is a function, the second is the address " @@ -611,38 +642,44 @@ msgid "" "*converter* function in turn is called as follows::" msgstr "" -#: ../../c-api/arg.rst:316 +#: ../../c-api/arg.rst:328 msgid "status = converter(object, address);" msgstr "status = converter(object, address);" -#: ../../c-api/arg.rst:318 +#: ../../c-api/arg.rst:330 msgid "" -"where *object* is the Python object to be converted and *address* is the :c:" -"expr:`void*` argument that was passed to the ``PyArg_Parse*`` function. The " -"returned *status* should be ``1`` for a successful conversion and ``0`` if " -"the conversion has failed. When the conversion fails, the *converter* " -"function should raise an exception and leave the content of *address* " -"unmodified." +"where *object* is the Python object to be converted and *address* is " +"the :c:expr:`void*` argument that was passed to the ``PyArg_Parse*`` " +"function. The returned *status* should be ``1`` for a successful conversion " +"and ``0`` if the conversion has failed. When the conversion fails, the " +"*converter* function should raise an exception and leave the content of " +"*address* unmodified." msgstr "" -#: ../../c-api/arg.rst:324 +#: ../../c-api/arg.rst:339 msgid "" -"If the *converter* returns ``Py_CLEANUP_SUPPORTED``, it may get called a " -"second time if the argument parsing eventually fails, giving the converter a " -"chance to release any memory that it had already allocated. In this second " -"call, the *object* parameter will be ``NULL``; *address* will have the same " -"value as in the original call." +"If the *converter* returns :c:macro:`!Py_CLEANUP_SUPPORTED`, it may get " +"called a second time if the argument parsing eventually fails, giving the " +"converter a chance to release any memory that it had already allocated. In " +"this second call, the *object* parameter will be ``NULL``; *address* will " +"have the same value as in the original call." msgstr "" -#: ../../c-api/arg.rst:330 -msgid "``Py_CLEANUP_SUPPORTED`` was added." -msgstr "加入 ``Py_CLEANUP_SUPPORTED``。" +#: ../../c-api/arg.rst:345 +msgid "" +"Examples of converters: :c:func:`PyUnicode_FSConverter` " +"and :c:func:`PyUnicode_FSDecoder`." +msgstr "" + +#: ../../c-api/arg.rst:348 +msgid ":c:macro:`!Py_CLEANUP_SUPPORTED` was added." +msgstr "新增 :c:macro:`!Py_CLEANUP_SUPPORTED`。" -#: ../../c-api/arg.rst:333 +#: ../../c-api/arg.rst:351 msgid "``p`` (:class:`bool`) [int]" msgstr "``p`` (:class:`bool`) [int]" -#: ../../c-api/arg.rst:334 +#: ../../c-api/arg.rst:352 msgid "" "Tests the value passed in for truth (a boolean **p**\\ redicate) and " "converts the result to its equivalent C true/false integer value. Sets the " @@ -651,37 +688,28 @@ msgid "" "how Python tests values for truth." msgstr "" -#: ../../c-api/arg.rst:342 ../../c-api/arg.rst:677 +#: ../../c-api/arg.rst:360 ../../c-api/arg.rst:689 msgid "``(items)`` (:class:`tuple`) [*matching-items*]" msgstr "``(items)`` (:class:`tuple`) [*matching-items*]" -#: ../../c-api/arg.rst:343 +#: ../../c-api/arg.rst:361 msgid "" "The object must be a Python sequence whose length is the number of format " "units in *items*. The C arguments must correspond to the individual format " "units in *items*. Format units for sequences may be nested." msgstr "" -#: ../../c-api/arg.rst:347 -msgid "" -"It is possible to pass \"long\" integers (integers whose value exceeds the " -"platform's :c:macro:`LONG_MAX`) however no proper range checking is done --- " -"the most significant bits are silently truncated when the receiving field is " -"too small to receive the value (actually, the semantics are inherited from " -"downcasts in C --- your mileage may vary)." -msgstr "" - -#: ../../c-api/arg.rst:353 +#: ../../c-api/arg.rst:365 msgid "" "A few other characters have a meaning in a format string. These may not " "occur inside nested parentheses. They are:" msgstr "" -#: ../../c-api/arg.rst:356 +#: ../../c-api/arg.rst:368 msgid "``|``" msgstr "``|``" -#: ../../c-api/arg.rst:357 +#: ../../c-api/arg.rst:369 msgid "" "Indicates that the remaining arguments in the Python argument list are " "optional. The C variables corresponding to optional arguments should be " @@ -690,11 +718,11 @@ msgid "" "corresponding C variable(s)." msgstr "" -#: ../../c-api/arg.rst:363 +#: ../../c-api/arg.rst:375 msgid "``$``" msgstr "``$``" -#: ../../c-api/arg.rst:364 +#: ../../c-api/arg.rst:376 msgid "" ":c:func:`PyArg_ParseTupleAndKeywords` only: Indicates that the remaining " "arguments in the Python argument list are keyword-only. Currently, all " @@ -702,36 +730,36 @@ msgid "" "be specified before ``$`` in the format string." msgstr "" -#: ../../c-api/arg.rst:372 +#: ../../c-api/arg.rst:384 msgid "``:``" msgstr "``:``" -#: ../../c-api/arg.rst:373 +#: ../../c-api/arg.rst:385 msgid "" "The list of format units ends here; the string after the colon is used as " "the function name in error messages (the \"associated value\" of the " "exception that :c:func:`PyArg_ParseTuple` raises)." msgstr "" -#: ../../c-api/arg.rst:377 +#: ../../c-api/arg.rst:389 msgid "``;``" msgstr "``;``" -#: ../../c-api/arg.rst:378 +#: ../../c-api/arg.rst:390 msgid "" "The list of format units ends here; the string after the semicolon is used " -"as the error message *instead* of the default error message. ``:`` and ``;" -"`` mutually exclude each other." +"as the error message *instead* of the default error message. ``:`` and " +"``;`` mutually exclude each other." msgstr "" -#: ../../c-api/arg.rst:382 +#: ../../c-api/arg.rst:394 msgid "" "Note that any Python object references which are provided to the caller are " "*borrowed* references; do not release them (i.e. do not decrement their " "reference count)!" msgstr "" -#: ../../c-api/arg.rst:386 +#: ../../c-api/arg.rst:398 msgid "" "Additional arguments passed to these functions must be addresses of " "variables whose type is determined by the format string; these are used to " @@ -741,7 +769,7 @@ msgid "" "unit in that case." msgstr "" -#: ../../c-api/arg.rst:392 +#: ../../c-api/arg.rst:404 msgid "" "For the conversion to succeed, the *arg* object must match the format and " "the format must be exhausted. On success, the ``PyArg_Parse*`` functions " @@ -751,24 +779,24 @@ msgid "" "the following format units are left untouched." msgstr "" -#: ../../c-api/arg.rst:401 +#: ../../c-api/arg.rst:413 msgid "API Functions" msgstr "API 函式" -#: ../../c-api/arg.rst:405 +#: ../../c-api/arg.rst:417 msgid "" "Parse the parameters of a function that takes only positional parameters " "into local variables. Returns true on success; on failure, it returns false " "and raises the appropriate exception." msgstr "" -#: ../../c-api/arg.rst:412 +#: ../../c-api/arg.rst:424 msgid "" "Identical to :c:func:`PyArg_ParseTuple`, except that it accepts a va_list " "rather than a variable number of arguments." msgstr "" -#: ../../c-api/arg.rst:418 +#: ../../c-api/arg.rst:430 msgid "" "Parse the parameters of a function that takes both positional and keyword " "parameters into local variables. The *keywords* argument is a ``NULL``-" @@ -778,51 +806,51 @@ msgid "" "failure, it returns false and raises the appropriate exception." msgstr "" -#: ../../c-api/arg.rst:429 +#: ../../c-api/arg.rst:441 msgid "" -"The *keywords* parameter declaration is :c:expr:`char * const *` in C and :c:" -"expr:`const char * const *` in C++. This can be overridden with the :c:macro:" -"`PY_CXX_CONST` macro." +"The *keywords* parameter declaration is :c:expr:`char * const *` in C " +"and :c:expr:`const char * const *` in C++. This can be overridden with " +"the :c:macro:`PY_CXX_CONST` macro." msgstr "" -#: ../../c-api/arg.rst:433 +#: ../../c-api/arg.rst:445 msgid "" "Added support for :ref:`positional-only parameters `." -msgstr "" +msgstr "新增對\\ :ref:`僅限位置參數 `\\ 的支援。" -#: ../../c-api/arg.rst:437 +#: ../../c-api/arg.rst:449 msgid "" -"The *keywords* parameter has now type :c:expr:`char * const *` in C and :c:" -"expr:`const char * const *` in C++, instead of :c:expr:`char **`. Added " -"support for non-ASCII keyword parameter names." +"The *keywords* parameter has now type :c:expr:`char * const *` in C " +"and :c:expr:`const char * const *` in C++, instead of :c:expr:`char **`. " +"Added support for non-ASCII keyword parameter names." msgstr "" -#: ../../c-api/arg.rst:446 +#: ../../c-api/arg.rst:458 msgid "" "Identical to :c:func:`PyArg_ParseTupleAndKeywords`, except that it accepts a " "va_list rather than a variable number of arguments." msgstr "" -#: ../../c-api/arg.rst:452 +#: ../../c-api/arg.rst:464 msgid "" "Ensure that the keys in the keywords argument dictionary are strings. This " "is only needed if :c:func:`PyArg_ParseTupleAndKeywords` is not used, since " "the latter already does this check." msgstr "" -#: ../../c-api/arg.rst:461 +#: ../../c-api/arg.rst:473 msgid "" "Parse the parameter of a function that takes a single positional parameter " "into a local variable. Returns true on success; on failure, it returns " "false and raises the appropriate exception." msgstr "" -#: ../../c-api/arg.rst:465 +#: ../../c-api/arg.rst:477 msgid "Example::" msgstr "舉例來說: ::" -#: ../../c-api/arg.rst:467 +#: ../../c-api/arg.rst:479 msgid "" "// Function using METH_O calling convention\n" "static PyObject*\n" @@ -836,7 +864,7 @@ msgid "" "}" msgstr "" -#: ../../c-api/arg.rst:481 +#: ../../c-api/arg.rst:493 msgid "" "A simpler form of parameter retrieval which does not use a format string to " "specify the types of the arguments. Functions which use this method to " @@ -854,13 +882,13 @@ msgid "" "if there was a failure." msgstr "" -#: ../../c-api/arg.rst:496 +#: ../../c-api/arg.rst:508 msgid "" "This is an example of the use of this function, taken from the sources for " "the :mod:`!_weakref` helper module for weak references::" msgstr "" -#: ../../c-api/arg.rst:499 +#: ../../c-api/arg.rst:511 msgid "" "static PyObject *\n" "weakref_ref(PyObject *self, PyObject *args)\n" @@ -888,17 +916,17 @@ msgstr "" " return result;\n" "}" -#: ../../c-api/arg.rst:512 +#: ../../c-api/arg.rst:524 msgid "" "The call to :c:func:`PyArg_UnpackTuple` in this example is entirely " "equivalent to this call to :c:func:`PyArg_ParseTuple`::" msgstr "" -#: ../../c-api/arg.rst:515 +#: ../../c-api/arg.rst:527 msgid "PyArg_ParseTuple(args, \"O|O:ref\", &object, &callback)" msgstr "PyArg_ParseTuple(args, \"O|O:ref\", &object, &callback)" -#: ../../c-api/arg.rst:519 +#: ../../c-api/arg.rst:531 msgid "" "The value to be inserted, if any, before :c:expr:`char * const *` in the " "*keywords* parameter declaration of :c:func:`PyArg_ParseTupleAndKeywords` " @@ -907,11 +935,11 @@ msgid "" "to the desired value before including :file:`Python.h`." msgstr "" -#: ../../c-api/arg.rst:533 +#: ../../c-api/arg.rst:545 msgid "Building values" -msgstr "" +msgstr "建置數值" -#: ../../c-api/arg.rst:537 +#: ../../c-api/arg.rst:549 msgid "" "Create a new value based on a format string similar to those accepted by the " "``PyArg_Parse*`` family of functions and a sequence of values. Returns the " @@ -919,7 +947,7 @@ msgid "" "``NULL`` is returned." msgstr "" -#: ../../c-api/arg.rst:542 +#: ../../c-api/arg.rst:554 msgid "" ":c:func:`Py_BuildValue` does not always build a tuple. It builds a tuple " "only if its format string contains two or more format units. If the format " @@ -928,18 +956,18 @@ msgid "" "it to return a tuple of size 0 or one, parenthesize the format string." msgstr "" -#: ../../c-api/arg.rst:548 +#: ../../c-api/arg.rst:560 msgid "" "When memory buffers are passed as parameters to supply data to build " "objects, as for the ``s`` and ``s#`` formats, the required data is copied. " "Buffers provided by the caller are never referenced by the objects created " -"by :c:func:`Py_BuildValue`. In other words, if your code invokes :c:func:" -"`malloc` and passes the allocated memory to :c:func:`Py_BuildValue`, your " -"code is responsible for calling :c:func:`free` for that memory once :c:func:" -"`Py_BuildValue` returns." +"by :c:func:`Py_BuildValue`. In other words, if your code " +"invokes :c:func:`malloc` and passes the allocated memory " +"to :c:func:`Py_BuildValue`, your code is responsible for " +"calling :c:func:`free` for that memory once :c:func:`Py_BuildValue` returns." msgstr "" -#: ../../c-api/arg.rst:556 +#: ../../c-api/arg.rst:568 msgid "" "In the following description, the quoted form is the format unit; the entry " "in (round) parentheses is the Python object type that the format unit will " @@ -947,257 +975,261 @@ msgid "" "be passed." msgstr "" -#: ../../c-api/arg.rst:560 +#: ../../c-api/arg.rst:572 msgid "" "The characters space, tab, colon and comma are ignored in format strings " "(but not within format units such as ``s#``). This can be used to make long " "format strings a tad more readable." msgstr "" -#: ../../c-api/arg.rst:564 +#: ../../c-api/arg.rst:576 msgid "``s`` (:class:`str` or ``None``) [const char \\*]" -msgstr "``s``\\ (:class:`str` 或 ``None``)[const char \\*]" +msgstr "``s`` (:class:`str` 或 ``None``) [const char \\*]" -#: ../../c-api/arg.rst:565 +#: ../../c-api/arg.rst:577 msgid "" "Convert a null-terminated C string to a Python :class:`str` object using " "``'utf-8'`` encoding. If the C string pointer is ``NULL``, ``None`` is used." msgstr "" -#: ../../c-api/arg.rst:568 +#: ../../c-api/arg.rst:580 msgid "" "``s#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" -"``s#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]" +"``s#`` (:class:`str` 或 ``None``) [const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:569 +#: ../../c-api/arg.rst:581 msgid "" "Convert a C string and its length to a Python :class:`str` object using " "``'utf-8'`` encoding. If the C string pointer is ``NULL``, the length is " "ignored and ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:573 +#: ../../c-api/arg.rst:585 msgid "``y`` (:class:`bytes`) [const char \\*]" msgstr "``y`` (:class:`bytes`) [const char \\*]" -#: ../../c-api/arg.rst:574 +#: ../../c-api/arg.rst:586 msgid "" "This converts a C string to a Python :class:`bytes` object. If the C string " "pointer is ``NULL``, ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:577 +#: ../../c-api/arg.rst:589 msgid "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:578 +#: ../../c-api/arg.rst:590 msgid "" "This converts a C string and its lengths to a Python object. If the C " "string pointer is ``NULL``, ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:582 ../../c-api/arg.rst:598 +#: ../../c-api/arg.rst:594 ../../c-api/arg.rst:610 msgid "Same as ``s``." msgstr "和 ``s`` 相同。" -#: ../../c-api/arg.rst:584 +#: ../../c-api/arg.rst:596 msgid "" "``z#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" -"``z#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]" +"``z#`` (:class:`str` 或 ``None``) [const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:585 ../../c-api/arg.rst:601 +#: ../../c-api/arg.rst:597 ../../c-api/arg.rst:613 msgid "Same as ``s#``." msgstr "和 ``s#`` 相同。" -#: ../../c-api/arg.rst:587 +#: ../../c-api/arg.rst:599 msgid "``u`` (:class:`str`) [const wchar_t \\*]" msgstr "``u`` (:class:`str`) [const wchar_t \\*]" -#: ../../c-api/arg.rst:588 +#: ../../c-api/arg.rst:600 msgid "" "Convert a null-terminated :c:type:`wchar_t` buffer of Unicode (UTF-16 or " "UCS-4) data to a Python Unicode object. If the Unicode buffer pointer is " "``NULL``, ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:592 +#: ../../c-api/arg.rst:604 msgid "``u#`` (:class:`str`) [const wchar_t \\*, :c:type:`Py_ssize_t`]" msgstr "``u#`` (:class:`str`) [const wchar_t \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:593 +#: ../../c-api/arg.rst:605 msgid "" "Convert a Unicode (UTF-16 or UCS-4) data buffer and its length to a Python " "Unicode object. If the Unicode buffer pointer is ``NULL``, the length is " "ignored and ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:597 +#: ../../c-api/arg.rst:609 msgid "``U`` (:class:`str` or ``None``) [const char \\*]" -msgstr "``U``\\ (:class:`str` 或 ``None``)[const char \\*]" +msgstr "``U`` (:class:`str` 或 ``None``) [const char \\*]" -#: ../../c-api/arg.rst:600 +#: ../../c-api/arg.rst:612 msgid "" "``U#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" -"``U#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]" +"``U#`` (:class:`str` 或 ``None``) [const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:604 +#: ../../c-api/arg.rst:616 msgid "Convert a plain C :c:expr:`int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:606 +#: ../../c-api/arg.rst:618 msgid "``b`` (:class:`int`) [char]" msgstr "``b`` (:class:`int`) [char]" -#: ../../c-api/arg.rst:607 +#: ../../c-api/arg.rst:619 msgid "Convert a plain C :c:expr:`char` to a Python integer object." msgstr "將一個 C 的 :c:expr:`char` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:610 +#: ../../c-api/arg.rst:622 msgid "Convert a plain C :c:expr:`short int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`short int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:613 +#: ../../c-api/arg.rst:625 msgid "Convert a C :c:expr:`long int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`long int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:616 +#: ../../c-api/arg.rst:628 msgid "Convert a C :c:expr:`unsigned char` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned char` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:619 +#: ../../c-api/arg.rst:631 msgid "Convert a C :c:expr:`unsigned short int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned short int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:622 +#: ../../c-api/arg.rst:634 msgid "Convert a C :c:expr:`unsigned int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:625 +#: ../../c-api/arg.rst:637 msgid "Convert a C :c:expr:`unsigned long` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned long` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:628 +#: ../../c-api/arg.rst:640 msgid "Convert a C :c:expr:`long long` to a Python integer object." msgstr "將一個 C 的 :c:expr:`long long` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:631 +#: ../../c-api/arg.rst:643 msgid "Convert a C :c:expr:`unsigned long long` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned long long` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:634 +#: ../../c-api/arg.rst:646 msgid "Convert a C :c:type:`Py_ssize_t` to a Python integer." msgstr "將一個 C 的 :c:type:`Py_ssize_t` 轉換成 Python 整數。" -#: ../../c-api/arg.rst:636 +#: ../../c-api/arg.rst:648 msgid "``c`` (:class:`bytes` of length 1) [char]" -msgstr "``c``\\ (長度為 1 的 :class:`bytes`)[char]" +msgstr "``c`` (長度為 1 的 :class:`bytes`) [char]" -#: ../../c-api/arg.rst:637 +#: ../../c-api/arg.rst:649 msgid "" "Convert a C :c:expr:`int` representing a byte to a Python :class:`bytes` " "object of length 1." msgstr "" -"將一個 C 中代表一個位元組的 :c:expr:`int` 轉換成 Python 中長度為一的 :class:" -"`bytes`。" +"將一個 C 中代表一個位元組的 :c:expr:`int` 轉換成 Python 中長度為一" +"的 :class:`bytes`。" -#: ../../c-api/arg.rst:641 +#: ../../c-api/arg.rst:653 msgid "" "Convert a C :c:expr:`int` representing a character to Python :class:`str` " "object of length 1." msgstr "" -"將一個 C 中代表一個字元的 :c:expr:`int` 轉換成 Python 中長度為一的 :class:" -"`str`。" +"將一個 C 中代表一個字元的 :c:expr:`int` 轉換成 Python 中長度為一" +"的 :class:`str`。" -#: ../../c-api/arg.rst:645 +#: ../../c-api/arg.rst:657 msgid "Convert a C :c:expr:`double` to a Python floating-point number." msgstr "將一個 C 的 :c:expr:`double` 轉換成 Python 浮點數。" -#: ../../c-api/arg.rst:648 +#: ../../c-api/arg.rst:660 msgid "Convert a C :c:expr:`float` to a Python floating-point number." msgstr "將一個 C 的 :c:expr:`float` 轉換成 Python 浮點數。" -#: ../../c-api/arg.rst:650 +#: ../../c-api/arg.rst:662 msgid "``D`` (:class:`complex`) [Py_complex \\*]" msgstr "``D`` (:class:`complex`) [Py_complex \\*]" -#: ../../c-api/arg.rst:651 +#: ../../c-api/arg.rst:663 msgid "Convert a C :c:type:`Py_complex` structure to a Python complex number." msgstr "將一個 C 的 :c:type:`Py_complex` 結構轉換成 Python 複數。" -#: ../../c-api/arg.rst:654 +#: ../../c-api/arg.rst:666 msgid "" "Pass a Python object untouched but create a new :term:`strong reference` to " "it (i.e. its reference count is incremented by one). If the object passed in " "is a ``NULL`` pointer, it is assumed that this was caused because the call " -"producing the argument found an error and set an exception. Therefore, :c:" -"func:`Py_BuildValue` will return ``NULL`` but won't raise an exception. If " -"no exception has been raised yet, :exc:`SystemError` is set." +"producing the argument found an error and set an exception. " +"Therefore, :c:func:`Py_BuildValue` will return ``NULL`` but won't raise an " +"exception. If no exception has been raised yet, :exc:`SystemError` is set." msgstr "" -#: ../../c-api/arg.rst:663 +#: ../../c-api/arg.rst:675 msgid "``S`` (object) [PyObject \\*]" -msgstr "``S``\\ (物件)[PyObject \\*]" +msgstr "``S`` (object) [PyObject \\*]" -#: ../../c-api/arg.rst:664 +#: ../../c-api/arg.rst:676 msgid "Same as ``O``." msgstr "和 ``O`` 相同。" -#: ../../c-api/arg.rst:666 +#: ../../c-api/arg.rst:678 msgid "``N`` (object) [PyObject \\*]" -msgstr "``N``\\ (物件)[PyObject \\*]" +msgstr "``N`` (object) [PyObject \\*]" -#: ../../c-api/arg.rst:667 +#: ../../c-api/arg.rst:679 msgid "" "Same as ``O``, except it doesn't create a new :term:`strong reference`. " "Useful when the object is created by a call to an object constructor in the " "argument list." msgstr "" -#: ../../c-api/arg.rst:672 +#: ../../c-api/arg.rst:683 +msgid "``O&`` (object) [*converter*, *anything*]" +msgstr "``O&`` (object) [*converter*, *anything*]" + +#: ../../c-api/arg.rst:684 msgid "" "Convert *anything* to a Python object through a *converter* function. The " -"function is called with *anything* (which should be compatible with :c:expr:" -"`void*`) as its argument and should return a \"new\" Python object, or " -"``NULL`` if an error occurred." +"function is called with *anything* (which should be compatible " +"with :c:expr:`void*`) as its argument and should return a \"new\" Python " +"object, or ``NULL`` if an error occurred." msgstr "" -#: ../../c-api/arg.rst:678 +#: ../../c-api/arg.rst:690 msgid "" "Convert a sequence of C values to a Python tuple with the same number of " "items." msgstr "" -#: ../../c-api/arg.rst:680 +#: ../../c-api/arg.rst:692 msgid "``[items]`` (:class:`list`) [*matching-items*]" msgstr "``[items]`` (:class:`list`) [*matching-items*]" -#: ../../c-api/arg.rst:681 +#: ../../c-api/arg.rst:693 msgid "" "Convert a sequence of C values to a Python list with the same number of " "items." msgstr "" -#: ../../c-api/arg.rst:683 +#: ../../c-api/arg.rst:695 msgid "``{items}`` (:class:`dict`) [*matching-items*]" msgstr "``{items}`` (:class:`dict`) [*matching-items*]" -#: ../../c-api/arg.rst:684 +#: ../../c-api/arg.rst:696 msgid "" "Convert a sequence of C values to a Python dictionary. Each pair of " "consecutive C values adds one item to the dictionary, serving as key and " "value, respectively." msgstr "" -#: ../../c-api/arg.rst:688 +#: ../../c-api/arg.rst:700 msgid "" "If there is an error in the format string, the :exc:`SystemError` exception " "is set and ``NULL`` returned." msgstr "" -#: ../../c-api/arg.rst:693 +#: ../../c-api/arg.rst:705 msgid "" "Identical to :c:func:`Py_BuildValue`, except that it accepts a va_list " "rather than a variable number of arguments." diff --git a/c-api/init.po b/c-api/init.po index e1c8407423..a4bc79d1a8 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-12 00:15+0000\n" +"POT-Creation-Date: 2025-02-07 00:13+0000\n" "PO-Revision-Date: 2023-04-24 20:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -205,10 +205,8 @@ msgstr ":c:func:`PyMutex_Unlock`" msgid "" "Despite their apparent similarity to some of the functions listed above, the " "following functions **should not be called** before the interpreter has been " -"initialized: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`, :c:func:" -"`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:func:" -"`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`, :c:func:" -"`Py_GetProgramName`, :c:func:`PyEval_InitThreads`, and :c:func:`Py_RunMain`." +"initialized: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`, :c:func:`Py_GetProgramName`, :c:func:`PyEval_InitThreads`, " +"and :c:func:`Py_RunMain`." msgstr "" #: ../../c-api/init.rst:90 @@ -218,30 +216,30 @@ msgstr "" #: ../../c-api/init.rst:92 msgid "" "Python has variables for the global configuration to control different " -"features and options. By default, these flags are controlled by :ref:" -"`command line options `." +"features and options. By default, these flags are controlled " +"by :ref:`command line options `." msgstr "" #: ../../c-api/init.rst:96 msgid "" "When a flag is set by an option, the value of the flag is the number of " -"times that the option was set. For example, ``-b`` sets :c:data:" -"`Py_BytesWarningFlag` to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to " -"2." +"times that the option was set. For example, ``-b`` " +"sets :c:data:`Py_BytesWarningFlag` to 1 and ``-bb`` " +"sets :c:data:`Py_BytesWarningFlag` to 2." msgstr "" #: ../../c-api/init.rst:102 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"bytes_warning` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.bytes_warning` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:106 msgid "" -"Issue a warning when comparing :class:`bytes` or :class:`bytearray` with :" -"class:`str` or :class:`bytes` with :class:`int`. Issue an error if greater " -"or equal to ``2``." +"Issue a warning when comparing :class:`bytes` or :class:`bytearray` " +"with :class:`str` or :class:`bytes` with :class:`int`. Issue an error if " +"greater or equal to ``2``." msgstr "" #: ../../c-api/init.rst:110 @@ -250,9 +248,9 @@ msgstr "由 :option:`-b` 選項設定。" #: ../../c-api/init.rst:116 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"parser_debug` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.parser_debug` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:120 @@ -269,9 +267,9 @@ msgstr "由 :option:`-d` 選項與 :envvar:`PYTHONDEBUG` 環境變數設定。" #: ../../c-api/init.rst:130 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"write_bytecode` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.write_bytecode` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:134 @@ -289,15 +287,15 @@ msgstr "" #: ../../c-api/init.rst:144 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"pathconfig_warnings` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.pathconfig_warnings` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:148 msgid "" -"Suppress error messages when calculating the module search path in :c:func:" -"`Py_GetPath`." +"Suppress error messages when calculating the module search path " +"in :c:func:`Py_GetPath`." msgstr "" #: ../../c-api/init.rst:151 @@ -306,8 +304,9 @@ msgstr "" #: ../../c-api/init.rst:157 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"hash_seed` and :c:member:`PyConfig.use_hash_seed` should be used instead, " +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.hash_seed` " +"and :c:member:`PyConfig.use_hash_seed` should be used instead, " "see :ref:`Python Initialization Configuration `." msgstr "" @@ -326,15 +325,15 @@ msgstr "" #: ../../c-api/init.rst:172 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"use_environment` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.use_environment` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:176 msgid "" -"Ignore all :envvar:`!PYTHON*` environment variables, e.g. :envvar:" -"`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." +"Ignore all :envvar:`!PYTHON*` environment variables, " +"e.g. :envvar:`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." msgstr "" "忽略所有可能被設定的 :envvar:`!PYTHON*` 環境變數,例如 :envvar:`PYTHONPATH` " "與 :envvar:`PYTHONHOME`。" @@ -345,9 +344,9 @@ msgstr "由 :option:`-E` 與 :option:`-I` 選項設定。" #: ../../c-api/init.rst:185 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"inspect` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.inspect` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:189 @@ -365,9 +364,9 @@ msgstr "由 :option:`-i` 選項與 :envvar:`PYTHONINSPECT` 環境變數設定。 #: ../../c-api/init.rst:200 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"interactive` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.interactive` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:204 @@ -376,9 +375,9 @@ msgstr "由 :option:`-i` 選項設定。" #: ../../c-api/init.rst:210 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"isolated` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.isolated` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:214 @@ -393,9 +392,9 @@ msgstr "由 :option:`-i` 選項設定。" #: ../../c-api/init.rst:225 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyPreConfig." -"legacy_windows_fs_encoding` should be used instead, see :ref:`Python " -"Initialization Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyPreConfig.legacy_windows_fs_encoding` should be used " +"instead, see :ref:`Python Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:229 @@ -423,15 +422,15 @@ msgstr "" #: ../../c-api/init.rst:244 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"legacy_windows_stdio` should be used instead, see :ref:`Python " -"Initialization Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.legacy_windows_stdio` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:248 msgid "" -"If the flag is non-zero, use :class:`io.FileIO` instead of :class:`!io." -"_WindowsConsoleIO` for :mod:`sys` standard streams." +"If the flag is non-zero, use :class:`io.FileIO` instead of :class:`!" +"io._WindowsConsoleIO` for :mod:`sys` standard streams." msgstr "" #: ../../c-api/init.rst:251 @@ -446,17 +445,17 @@ msgstr "更多詳情請見 :pep:`528`。" #: ../../c-api/init.rst:262 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"site_import` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.site_import` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:266 msgid "" "Disable the import of the module :mod:`site` and the site-dependent " "manipulations of :data:`sys.path` that it entails. Also disable these " -"manipulations if :mod:`site` is explicitly imported later (call :func:`site." -"main` if you want them to be triggered)." +"manipulations if :mod:`site` is explicitly imported later " +"(call :func:`site.main` if you want them to be triggered)." msgstr "" #: ../../c-api/init.rst:271 @@ -465,30 +464,30 @@ msgstr "由 :option:`-S` 選項設定。" #: ../../c-api/init.rst:277 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"user_site_directory` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.user_site_directory` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:281 msgid "" -"Don't add the :data:`user site-packages directory ` to :data:" -"`sys.path`." +"Don't add the :data:`user site-packages directory ` " +"to :data:`sys.path`." msgstr "" #: ../../c-api/init.rst:284 msgid "" -"Set by the :option:`-s` and :option:`-I` options, and the :envvar:" -"`PYTHONNOUSERSITE` environment variable." +"Set by the :option:`-s` and :option:`-I` options, and " +"the :envvar:`PYTHONNOUSERSITE` environment variable." msgstr "" "由 :option:`-s` 選項、:option:`-I` 選項與 :envvar:`PYTHONNOUSERSITE` 環境變數" "設定。" #: ../../c-api/init.rst:291 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"optimization_level` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.optimization_level` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:295 @@ -499,9 +498,9 @@ msgstr "由 :option:`-O` 選項與 :envvar:`PYTHONOPTIMIZE` 環境變數設定 #: ../../c-api/init.rst:302 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"quiet` should be used instead, see :ref:`Python Initialization Configuration " -"`." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.quiet` should be used instead, see :ref:`Python " +"Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:306 @@ -515,9 +514,9 @@ msgstr "由 :option:`-q` 選項設定。" #: ../../c-api/init.rst:316 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"buffered_stdio` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.buffered_stdio` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:320 @@ -532,9 +531,9 @@ msgstr "由 :option:`-u` 選項與 :envvar:`PYTHONUNBUFFERED` 環境變數設定 #: ../../c-api/init.rst:329 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"verbose` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.verbose` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:333 @@ -558,8 +557,9 @@ msgstr "" #: ../../c-api/init.rst:360 msgid "" "Initialize the Python interpreter. In an application embedding Python, " -"this should be called before using any other Python/C API functions; see :" -"ref:`Before Python Initialization ` for the few exceptions." +"this should be called before using any other Python/C API functions; " +"see :ref:`Before Python Initialization ` for the few " +"exceptions." msgstr "" #: ../../c-api/init.rst:364 @@ -622,19 +622,20 @@ msgstr "" #: ../../c-api/init.rst:417 msgid "" "Undo all initializations made by :c:func:`Py_Initialize` and subsequent use " -"of Python/C API functions, and destroy all sub-interpreters (see :c:func:" -"`Py_NewInterpreter` below) that were created and not yet destroyed since the " -"last call to :c:func:`Py_Initialize`. Ideally, this frees all memory " -"allocated by the Python interpreter. This is a no-op when called for a " -"second time (without calling :c:func:`Py_Initialize` again first)." +"of Python/C API functions, and destroy all sub-interpreters " +"(see :c:func:`Py_NewInterpreter` below) that were created and not yet " +"destroyed since the last call to :c:func:`Py_Initialize`. Ideally, this " +"frees all memory allocated by the Python interpreter. This is a no-op when " +"called for a second time (without calling :c:func:`Py_Initialize` again " +"first)." msgstr "" #: ../../c-api/init.rst:424 msgid "" "Since this is the reverse of :c:func:`Py_Initialize`, it should be called in " "the same thread with the same interpreter active. That means the main " -"thread and the main interpreter. This should never be called while :c:func:" -"`Py_RunMain` is running." +"thread and the main interpreter. This should never be called " +"while :c:func:`Py_RunMain` is running." msgstr "" #: ../../c-api/init.rst:429 @@ -671,11 +672,11 @@ msgstr "" #: ../../c-api/init.rst:452 msgid "" -"Raises an :ref:`auditing event ` ``cpython." -"_PySys_ClearAuditHooks`` with no arguments." +"Raises an :ref:`auditing event ` " +"``cpython._PySys_ClearAuditHooks`` with no arguments." msgstr "" -"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." -"_PySys_ClearAuditHooks``。" +"引發一個不附帶引數的\\ :ref:`稽核事件 ` " +"``cpython._PySys_ClearAuditHooks``。" #: ../../c-api/init.rst:459 msgid "" @@ -735,9 +736,9 @@ msgstr "" #: ../../c-api/init.rst:503 msgid "" -"In terms of the CPython runtime configuration APIs documented in the :ref:" -"`runtime configuration ` section (and without accounting for " -"error handling), ``Py_Main`` is approximately equivalent to::" +"In terms of the CPython runtime configuration APIs documented in " +"the :ref:`runtime configuration ` section (and without " +"accounting for error handling), ``Py_Main`` is approximately equivalent to::" msgstr "" #: ../../c-api/init.rst:507 @@ -754,14 +755,14 @@ msgstr "" #: ../../c-api/init.rst:515 msgid "" "In normal usage, an embedding application will call this function *instead* " -"of calling :c:func:`Py_Initialize`, :c:func:`Py_InitializeEx` or :c:func:" -"`Py_InitializeFromConfig` directly, and all settings will be applied as " -"described elsewhere in this documentation. If this function is instead " -"called *after* a preceding runtime initialization API call, then exactly " -"which environmental and command line configuration settings will be updated " -"is version dependent (as it depends on which settings correctly support " -"being modified after they have already been set once when the runtime was " -"first initialized)." +"of calling :c:func:`Py_Initialize`, :c:func:`Py_InitializeEx` " +"or :c:func:`Py_InitializeFromConfig` directly, and all settings will be " +"applied as described elsewhere in this documentation. If this function is " +"instead called *after* a preceding runtime initialization API call, then " +"exactly which environmental and command line configuration settings will be " +"updated is version dependent (as it depends on which settings correctly " +"support being modified after they have already been set once when the " +"runtime was first initialized)." msgstr "" #: ../../c-api/init.rst:528 @@ -770,11 +771,11 @@ msgstr "" #: ../../c-api/init.rst:530 msgid "" -"Executes the command (:c:member:`PyConfig.run_command`), the script (:c:" -"member:`PyConfig.run_filename`) or the module (:c:member:`PyConfig." -"run_module`) specified on the command line or in the configuration. If none " -"of these values are set, runs the interactive Python prompt (REPL) using the " -"``__main__`` module's global namespace." +"Executes the command (:c:member:`PyConfig.run_command`), the script " +"(:c:member:`PyConfig.run_filename`) or the module " +"(:c:member:`PyConfig.run_module`) specified on the command line or in the " +"configuration. If none of these values are set, runs the interactive Python " +"prompt (REPL) using the ``__main__`` module's global namespace." msgstr "" #: ../../c-api/init.rst:536 @@ -802,15 +803,15 @@ msgstr "" #: ../../c-api/init.rst:552 msgid "" "This function always finalizes the Python interpreter regardless of whether " -"it returns a value or immediately exits the process due to an unhandled :exc:" -"`SystemExit` exception." +"it returns a value or immediately exits the process due to an " +"unhandled :exc:`SystemExit` exception." msgstr "" #: ../../c-api/init.rst:556 msgid "" "See :ref:`Python Configuration ` for an example of a " -"customized Python that always runs in isolated mode using :c:func:" -"`Py_RunMain`." +"customized Python that always runs in isolated mode " +"using :c:func:`Py_RunMain`." msgstr "" #: ../../c-api/init.rst:562 @@ -830,9 +831,9 @@ msgstr "" #: ../../c-api/init.rst:581 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"program_name` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.program_name` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:585 @@ -852,8 +853,8 @@ msgstr "" #: ../../c-api/init.rst:596 ../../c-api/init.rst:838 ../../c-api/init.rst:874 #: ../../c-api/init.rst:900 msgid "" -"Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:" -"`wchar_*` string." +"Use :c:func:`Py_DecodeLocale` to decode a bytes string to get " +"a :c:expr:`wchar_*` string." msgstr "" #: ../../c-api/init.rst:604 @@ -906,11 +907,11 @@ msgid "" "with :c:member:`PyConfig.program_name` and some environment variables; for " "example, if the program name is ``'/usr/local/bin/python'``, the exec-prefix " "is ``'/usr/local'``. The returned string points into static storage; the " -"caller should not modify its value. This corresponds to the :makevar:" -"`exec_prefix` variable in the top-level :file:`Makefile` and the ``--exec-" -"prefix`` argument to the :program:`configure` script at build time. The " -"value is available to Python code as ``sys.base_exec_prefix``. It is only " -"useful on Unix." +"caller should not modify its value. This corresponds to " +"the :makevar:`exec_prefix` variable in the top-level :file:`Makefile` and " +"the ``--exec-prefix`` argument to the :program:`configure` script at build " +"time. The value is available to Python code as ``sys.base_exec_prefix``. " +"It is only useful on Unix." msgstr "" #: ../../c-api/init.rst:654 @@ -938,16 +939,16 @@ msgstr "" #: ../../c-api/init.rst:671 msgid "" -"System administrators will know how to configure the :program:`mount` or :" -"program:`automount` programs to share :file:`/usr/local` between platforms " -"while having :file:`/usr/local/plat` be a different filesystem for each " -"platform." +"System administrators will know how to configure the :program:`mount` " +"or :program:`automount` programs to share :file:`/usr/local` between " +"platforms while having :file:`/usr/local/plat` be a different filesystem for " +"each platform." msgstr "" #: ../../c-api/init.rst:682 msgid "" -"Get :data:`sys.base_exec_prefix` instead, or :data:`sys.exec_prefix` if :ref:" -"`virtual environments ` need to be handled." +"Get :data:`sys.base_exec_prefix` instead, or :data:`sys.exec_prefix` " +"if :ref:`virtual environments ` need to be handled." msgstr "" #: ../../c-api/init.rst:692 @@ -991,8 +992,8 @@ msgid "" "The first word (up to the first space character) is the current Python " "version; the first characters are the major and minor version separated by a " "period. The returned string points into static storage; the caller should " -"not modify its value. The value is available to Python code as :data:`sys." -"version`." +"not modify its value. The value is available to Python code " +"as :data:`sys.version`." msgstr "" #: ../../c-api/init.rst:750 @@ -1055,10 +1056,10 @@ msgstr "\"#67, Aug 1 1997, 22:34:28\"" #: ../../c-api/init.rst:813 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"argv`, :c:member:`PyConfig.parse_argv` and :c:member:`PyConfig.safe_path` " -"should be used instead, see :ref:`Python Initialization Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.argv`, :c:member:`PyConfig.parse_argv` " +"and :c:member:`PyConfig.safe_path` should be used instead, see :ref:`Python " +"Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:818 @@ -1082,8 +1083,8 @@ msgstr "" #: ../../c-api/init.rst:830 msgid "" "If the name of an existing script is passed in ``argv[0]``, the absolute " -"path of the directory where the script is located is prepended to :data:`sys." -"path`." +"path of the directory where the script is located is prepended " +"to :data:`sys.path`." msgstr "" #: ../../c-api/init.rst:833 @@ -1109,8 +1110,8 @@ msgstr "" #: ../../c-api/init.rst:850 msgid "" "On versions before 3.1.3, you can achieve the same effect by manually " -"popping the first :data:`sys.path` element after having called :c:func:" -"`PySys_SetArgv`, for example using::" +"popping the first :data:`sys.path` element after having " +"called :c:func:`PySys_SetArgv`, for example using::" msgstr "" #: ../../c-api/init.rst:854 @@ -1119,16 +1120,17 @@ msgstr "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");" #: ../../c-api/init.rst:866 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"argv` and :c:member:`PyConfig.parse_argv` should be used instead, see :ref:" -"`Python Initialization Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.argv` and :c:member:`PyConfig.parse_argv` should " +"be used instead, see :ref:`Python Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:870 msgid "" "This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set to " -"``1`` unless the :program:`python` interpreter was started with the :option:" -"`-I`." +"``1`` unless the :program:`python` interpreter was started with " +"the :option:`-I`." msgstr "" #: ../../c-api/init.rst:880 @@ -1137,9 +1139,9 @@ msgstr "" #: ../../c-api/init.rst:887 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"home` should be used instead, see :ref:`Python Initialization Configuration " -"`." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.home` should be used instead, see :ref:`Python " +"Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:891 @@ -1159,9 +1161,9 @@ msgstr "" #: ../../c-api/init.rst:908 msgid "" -"Return the default \"home\", that is, the value set by :c:member:`PyConfig." -"home`, or the value of the :envvar:`PYTHONHOME` environment variable if it " -"is set." +"Return the default \"home\", that is, the value set " +"by :c:member:`PyConfig.home`, or the value of the :envvar:`PYTHONHOME` " +"environment variable if it is set." msgstr "" #: ../../c-api/init.rst:918 @@ -1188,12 +1190,13 @@ msgstr "" #: ../../c-api/init.rst:943 msgid "" -"Therefore, the rule exists that only the thread that has acquired the :term:" -"`GIL` may operate on Python objects or call Python/C API functions. In order " -"to emulate concurrency of execution, the interpreter regularly tries to " -"switch threads (see :func:`sys.setswitchinterval`). The lock is also " -"released around potentially blocking I/O operations like reading or writing " -"a file, so that other Python threads can run in the meantime." +"Therefore, the rule exists that only the thread that has acquired " +"the :term:`GIL` may operate on Python objects or call Python/C API " +"functions. In order to emulate concurrency of execution, the interpreter " +"regularly tries to switch threads (see :func:`sys.setswitchinterval`). The " +"lock is also released around potentially blocking I/O operations like " +"reading or writing a file, so that other Python threads can run in the " +"meantime." msgstr "" #: ../../c-api/init.rst:953 @@ -1281,10 +1284,10 @@ msgstr "" #: ../../c-api/init.rst:1018 msgid "" -"When threads are created using the dedicated Python APIs (such as the :mod:" -"`threading` module), a thread state is automatically associated to them and " -"the code showed above is therefore correct. However, when threads are " -"created from C (for example by a third-party library with its own thread " +"When threads are created using the dedicated Python APIs (such as " +"the :mod:`threading` module), a thread state is automatically associated to " +"them and the code showed above is therefore correct. However, when threads " +"are created from C (for example by a third-party library with its own thread " "management), they don't hold the GIL, nor is there a thread state structure " "for them." msgstr "" @@ -1324,9 +1327,9 @@ msgstr "" msgid "" "Note that the ``PyGILState_*`` functions assume there is only one global " "interpreter (created automatically by :c:func:`Py_Initialize`). Python " -"supports the creation of additional interpreters (using :c:func:" -"`Py_NewInterpreter`), but mixing multiple interpreters and the " -"``PyGILState_*`` API is unsupported." +"supports the creation of additional interpreters " +"(using :c:func:`Py_NewInterpreter`), but mixing multiple interpreters and " +"the ``PyGILState_*`` API is unsupported." msgstr "" #: ../../c-api/init.rst:1057 @@ -1352,11 +1355,11 @@ msgid "" "of additional (non-Python) locks that need to be acquired before or reset " "after a fork. OS facilities such as :c:func:`!pthread_atfork` would need to " "be used to accomplish the same thing. Additionally, when extending or " -"embedding Python, calling :c:func:`fork` directly rather than through :func:" -"`os.fork` (and returning to or calling into Python) may result in a deadlock " -"by one of Python's internal locks being held by a thread that is defunct " -"after the fork. :c:func:`PyOS_AfterFork_Child` tries to reset the necessary " -"locks, but is not always able to." +"embedding Python, calling :c:func:`fork` directly rather than " +"through :func:`os.fork` (and returning to or calling into Python) may result " +"in a deadlock by one of Python's internal locks being held by a thread that " +"is defunct after the fork. :c:func:`PyOS_AfterFork_Child` tries to reset the " +"necessary locks, but is not always able to." msgstr "" #: ../../c-api/init.rst:1080 @@ -1449,7 +1452,7 @@ msgid "" msgstr "" #: ../../c-api/init.rst:1164 ../../c-api/init.rst:1223 -#: ../../c-api/init.rst:1508 +#: ../../c-api/init.rst:1519 msgid "" "Calling this function from a thread when the runtime is finalizing will " "terminate the thread, even if the thread was not created by Python. You can " @@ -1501,21 +1504,21 @@ msgid "" "of the current state of Python, or of the global interpreter lock. This may " "be called as many times as desired by a thread as long as each call is " "matched with a call to :c:func:`PyGILState_Release`. In general, other " -"thread-related APIs may be used between :c:func:`PyGILState_Ensure` and :c:" -"func:`PyGILState_Release` calls as long as the thread state is restored to " -"its previous state before the Release(). For example, normal usage of the :" -"c:macro:`Py_BEGIN_ALLOW_THREADS` and :c:macro:`Py_END_ALLOW_THREADS` macros " -"is acceptable." +"thread-related APIs may be used between :c:func:`PyGILState_Ensure` " +"and :c:func:`PyGILState_Release` calls as long as the thread state is " +"restored to its previous state before the Release(). For example, normal " +"usage of the :c:macro:`Py_BEGIN_ALLOW_THREADS` " +"and :c:macro:`Py_END_ALLOW_THREADS` macros is acceptable." msgstr "" #: ../../c-api/init.rst:1212 msgid "" -"The return value is an opaque \"handle\" to the thread state when :c:func:" -"`PyGILState_Ensure` was called, and must be passed to :c:func:" -"`PyGILState_Release` to ensure Python is left in the same state. Even though " -"recursive calls are allowed, these handles *cannot* be shared - each unique " -"call to :c:func:`PyGILState_Ensure` must save the handle for its call to :c:" -"func:`PyGILState_Release`." +"The return value is an opaque \"handle\" to the thread state " +"when :c:func:`PyGILState_Ensure` was called, and must be passed " +"to :c:func:`PyGILState_Release` to ensure Python is left in the same state. " +"Even though recursive calls are allowed, these handles *cannot* be shared - " +"each unique call to :c:func:`PyGILState_Ensure` must save the handle for its " +"call to :c:func:`PyGILState_Release`." msgstr "" #: ../../c-api/init.rst:1219 @@ -1527,15 +1530,15 @@ msgstr "" #: ../../c-api/init.rst:1231 msgid "" "Release any resources previously acquired. After this call, Python's state " -"will be the same as it was prior to the corresponding :c:func:" -"`PyGILState_Ensure` call (but generally this state will be unknown to the " -"caller, hence the use of the GILState API)." +"will be the same as it was prior to the " +"corresponding :c:func:`PyGILState_Ensure` call (but generally this state " +"will be unknown to the caller, hence the use of the GILState API)." msgstr "" #: ../../c-api/init.rst:1236 msgid "" -"Every call to :c:func:`PyGILState_Ensure` must be matched by a call to :c:" -"func:`PyGILState_Release` on the same thread." +"Every call to :c:func:`PyGILState_Ensure` must be matched by a call " +"to :c:func:`PyGILState_Release` on the same thread." msgstr "" #: ../../c-api/init.rst:1242 @@ -1565,30 +1568,30 @@ msgstr "" #: ../../c-api/init.rst:1268 msgid "" -"This macro expands to ``{ PyThreadState *_save; _save = PyEval_SaveThread();" -"``. Note that it contains an opening brace; it must be matched with a " -"following :c:macro:`Py_END_ALLOW_THREADS` macro. See above for further " -"discussion of this macro." +"This macro expands to ``{ PyThreadState *_save; _save = " +"PyEval_SaveThread();``. Note that it contains an opening brace; it must be " +"matched with a following :c:macro:`Py_END_ALLOW_THREADS` macro. See above " +"for further discussion of this macro." msgstr "" #: ../../c-api/init.rst:1276 msgid "" "This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it " -"contains a closing brace; it must be matched with an earlier :c:macro:" -"`Py_BEGIN_ALLOW_THREADS` macro. See above for further discussion of this " -"macro." +"contains a closing brace; it must be matched with an " +"earlier :c:macro:`Py_BEGIN_ALLOW_THREADS` macro. See above for further " +"discussion of this macro." msgstr "" #: ../../c-api/init.rst:1284 msgid "" -"This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to :" -"c:macro:`Py_END_ALLOW_THREADS` without the closing brace." +"This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent " +"to :c:macro:`Py_END_ALLOW_THREADS` without the closing brace." msgstr "" #: ../../c-api/init.rst:1290 msgid "" -"This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent to :" -"c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable " +"This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent " +"to :c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable " "declaration." msgstr "" @@ -1614,11 +1617,11 @@ msgstr "" #: ../../c-api/init.rst:1310 msgid "" -"Raises an :ref:`auditing event ` ``cpython." -"PyInterpreterState_New`` with no arguments." +"Raises an :ref:`auditing event ` " +"``cpython.PyInterpreterState_New`` with no arguments." msgstr "" -"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." -"PyInterpreterState_New``。" +"引發一個不附帶引數的\\ :ref:`稽核事件 ` " +"``cpython.PyInterpreterState_New``。" #: ../../c-api/init.rst:1315 msgid "" @@ -1628,11 +1631,11 @@ msgstr "" #: ../../c-api/init.rst:1318 msgid "" -"Raises an :ref:`auditing event ` ``cpython." -"PyInterpreterState_Clear`` with no arguments." +"Raises an :ref:`auditing event ` " +"``cpython.PyInterpreterState_Clear`` with no arguments." msgstr "" -"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." -"PyInterpreterState_Clear``。" +"引發一個不附帶引數的\\ :ref:`稽核事件 ` " +"``cpython.PyInterpreterState_Clear``。" #: ../../c-api/init.rst:1323 msgid "" @@ -1667,16 +1670,16 @@ msgstr ":c:member:`PyThreadState.on_delete` 回呼已被移除。" #: ../../c-api/init.rst:1350 msgid "" "Destroy a thread state object. The global interpreter lock need not be " -"held. The thread state must have been reset with a previous call to :c:func:" -"`PyThreadState_Clear`." +"held. The thread state must have been reset with a previous call " +"to :c:func:`PyThreadState_Clear`." msgstr "" #: ../../c-api/init.rst:1357 msgid "" "Destroy the current thread state and release the global interpreter lock. " "Like :c:func:`PyThreadState_Delete`, the global interpreter lock must be " -"held. The thread state must have been reset with a previous call to :c:func:" -"`PyThreadState_Clear`." +"held. The thread state must have been reset with a previous call " +"to :c:func:`PyThreadState_Clear`." msgstr "" #: ../../c-api/init.rst:1365 @@ -1737,6 +1740,7 @@ msgid "" msgstr "" #: ../../c-api/init.rst:1422 ../../c-api/init.rst:1432 +#: ../../c-api/init.rst:1454 msgid "The caller must hold the GIL." msgstr "" @@ -1759,39 +1763,45 @@ msgid "" "extensions should use to store interpreter-specific state information." msgstr "" -#: ../../c-api/init.rst:1450 +#: ../../c-api/init.rst:1451 +msgid "" +"Return a :term:`strong reference` to the ``__main__`` :ref:`module object " +"` for the given interpreter." +msgstr "" + +#: ../../c-api/init.rst:1461 msgid "Type of a frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1452 +#: ../../c-api/init.rst:1463 msgid "" "The *throwflag* parameter is used by the ``throw()`` method of generators: " "if non-zero, handle the current exception." msgstr "" -#: ../../c-api/init.rst:1455 +#: ../../c-api/init.rst:1466 msgid "The function now takes a *tstate* parameter." msgstr "" -#: ../../c-api/init.rst:1458 +#: ../../c-api/init.rst:1469 msgid "" "The *frame* parameter changed from ``PyFrameObject*`` to " "``_PyInterpreterFrame*``." msgstr "" -#: ../../c-api/init.rst:1463 +#: ../../c-api/init.rst:1474 msgid "Get the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1465 ../../c-api/init.rst:1473 +#: ../../c-api/init.rst:1476 ../../c-api/init.rst:1484 msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." msgstr "" -#: ../../c-api/init.rst:1471 +#: ../../c-api/init.rst:1482 msgid "Set the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1480 +#: ../../c-api/init.rst:1491 msgid "" "Return a dictionary in which extensions can store thread-specific state " "information. Each extension should use a unique key to use to store state " @@ -1800,7 +1810,7 @@ msgid "" "raised and the caller should assume no current thread state is available." msgstr "" -#: ../../c-api/init.rst:1489 +#: ../../c-api/init.rst:1500 msgid "" "Asynchronously raise an exception in a thread. The *id* argument is the " "thread id of the target thread; *exc* is the exception object to be raised. " @@ -1812,33 +1822,34 @@ msgid "" "raises no exceptions." msgstr "" -#: ../../c-api/init.rst:1497 +#: ../../c-api/init.rst:1508 msgid "" -"The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" -"`unsigned long`." +"The type of the *id* parameter changed from :c:expr:`long` " +"to :c:expr:`unsigned long`." msgstr "" -#: ../../c-api/init.rst:1503 +#: ../../c-api/init.rst:1514 msgid "" "Acquire the global interpreter lock and set the current thread state to " "*tstate*, which must not be ``NULL``. The lock must have been created " "earlier. If this thread already has the lock, deadlock ensues." msgstr "" -#: ../../c-api/init.rst:1514 +#: ../../c-api/init.rst:1525 msgid "" -"Updated to be consistent with :c:func:`PyEval_RestoreThread`, :c:func:" -"`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`, and terminate the " -"current thread if called while the interpreter is finalizing." +"Updated to be consistent " +"with :c:func:`PyEval_RestoreThread`, :c:func:`Py_END_ALLOW_THREADS`, " +"and :c:func:`PyGILState_Ensure`, and terminate the current thread if called " +"while the interpreter is finalizing." msgstr "" -#: ../../c-api/init.rst:1519 +#: ../../c-api/init.rst:1530 msgid "" ":c:func:`PyEval_RestoreThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1525 +#: ../../c-api/init.rst:1536 msgid "" "Reset the current thread state to ``NULL`` and release the global " "interpreter lock. The lock must have been created earlier and must be held " @@ -1847,17 +1858,17 @@ msgid "" "isn't, a fatal error is reported." msgstr "" -#: ../../c-api/init.rst:1531 +#: ../../c-api/init.rst:1542 msgid "" ":c:func:`PyEval_SaveThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1538 +#: ../../c-api/init.rst:1549 msgid "Sub-interpreter support" msgstr "" -#: ../../c-api/init.rst:1540 +#: ../../c-api/init.rst:1551 msgid "" "While in most uses, you will only embed a single Python interpreter, there " "are cases where you need to create several independent interpreters in the " @@ -1865,7 +1876,7 @@ msgid "" "to do that." msgstr "" -#: ../../c-api/init.rst:1545 +#: ../../c-api/init.rst:1556 msgid "" "The \"main\" interpreter is the first one created when the runtime " "initializes. It is usually the only Python interpreter in a process. Unlike " @@ -1876,134 +1887,134 @@ msgid "" "returns a pointer to its state." msgstr "" -#: ../../c-api/init.rst:1552 +#: ../../c-api/init.rst:1563 msgid "" -"You can switch between sub-interpreters using the :c:func:" -"`PyThreadState_Swap` function. You can create and destroy them using the " -"following functions:" +"You can switch between sub-interpreters using " +"the :c:func:`PyThreadState_Swap` function. You can create and destroy them " +"using the following functions:" msgstr "" -#: ../../c-api/init.rst:1558 +#: ../../c-api/init.rst:1569 msgid "" "Structure containing most parameters to configure a sub-interpreter. Its " "values are used only in :c:func:`Py_NewInterpreterFromConfig` and never " "modified by the runtime." msgstr "" -#: ../../c-api/init.rst:1564 +#: ../../c-api/init.rst:1575 msgid "Structure fields:" msgstr "" -#: ../../c-api/init.rst:1568 +#: ../../c-api/init.rst:1579 msgid "" "If this is ``0`` then the sub-interpreter will use its own \"object\" " "allocator state. Otherwise it will use (share) the main interpreter's." msgstr "" -#: ../../c-api/init.rst:1572 +#: ../../c-api/init.rst:1583 msgid "" -"If this is ``0`` then :c:member:`~PyInterpreterConfig." -"check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` " -"then :c:member:`~PyInterpreterConfig.gil` must not be :c:macro:" -"`PyInterpreterConfig_OWN_GIL`." +"If this is ``0`` " +"then :c:member:`~PyInterpreterConfig.check_multi_interp_extensions` must be " +"``1`` (non-zero). If this is ``1`` then :c:member:`~PyInterpreterConfig.gil` " +"must not be :c:macro:`PyInterpreterConfig_OWN_GIL`." msgstr "" -#: ../../c-api/init.rst:1580 +#: ../../c-api/init.rst:1591 msgid "" "If this is ``0`` then the runtime will not support forking the process in " "any thread where the sub-interpreter is currently active. Otherwise fork is " "unrestricted." msgstr "" -#: ../../c-api/init.rst:1584 +#: ../../c-api/init.rst:1595 msgid "" "Note that the :mod:`subprocess` module still works when fork is disallowed." msgstr "" -#: ../../c-api/init.rst:1589 +#: ../../c-api/init.rst:1600 msgid "" "If this is ``0`` then the runtime will not support replacing the current " "process via exec (e.g. :func:`os.execv`) in any thread where the sub-" "interpreter is currently active. Otherwise exec is unrestricted." msgstr "" -#: ../../c-api/init.rst:1594 +#: ../../c-api/init.rst:1605 msgid "" "Note that the :mod:`subprocess` module still works when exec is disallowed." msgstr "" -#: ../../c-api/init.rst:1599 +#: ../../c-api/init.rst:1610 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create threads. Otherwise threads are allowed." msgstr "" -#: ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:1616 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " -"create daemon threads. Otherwise daemon threads are allowed (as long as :c:" -"member:`~PyInterpreterConfig.allow_threads` is non-zero)." +"create daemon threads. Otherwise daemon threads are allowed (as long " +"as :c:member:`~PyInterpreterConfig.allow_threads` is non-zero)." msgstr "" -#: ../../c-api/init.rst:1612 +#: ../../c-api/init.rst:1623 msgid "" "If this is ``0`` then all extension modules may be imported, including " "legacy (single-phase init) modules, in any thread where the sub-interpreter " -"is currently active. Otherwise only multi-phase init extension modules (see :" -"pep:`489`) may be imported. (Also see :c:macro:" -"`Py_mod_multiple_interpreters`.)" +"is currently active. Otherwise only multi-phase init extension modules " +"(see :pep:`489`) may be imported. (Also " +"see :c:macro:`Py_mod_multiple_interpreters`.)" msgstr "" -#: ../../c-api/init.rst:1619 +#: ../../c-api/init.rst:1630 msgid "" -"This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." -"use_main_obmalloc` is ``0``." +"This must be ``1`` (non-zero) " +"if :c:member:`~PyInterpreterConfig.use_main_obmalloc` is ``0``." msgstr "" -#: ../../c-api/init.rst:1624 +#: ../../c-api/init.rst:1635 msgid "" "This determines the operation of the GIL for the sub-interpreter. It may be " "one of the following:" msgstr "" -#: ../../c-api/init.rst:1631 +#: ../../c-api/init.rst:1642 msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." msgstr "" -#: ../../c-api/init.rst:1635 +#: ../../c-api/init.rst:1646 msgid "Use (share) the main interpreter's GIL." msgstr "" -#: ../../c-api/init.rst:1639 +#: ../../c-api/init.rst:1650 msgid "Use the sub-interpreter's own GIL." msgstr "" -#: ../../c-api/init.rst:1641 +#: ../../c-api/init.rst:1652 msgid "" -"If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" -"`PyInterpreterConfig.use_main_obmalloc` must be ``0``." +"If this is :c:macro:`PyInterpreterConfig_OWN_GIL` " +"then :c:member:`PyInterpreterConfig.use_main_obmalloc` must be ``0``." msgstr "" -#: ../../c-api/init.rst:1655 +#: ../../c-api/init.rst:1666 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " "interpreter has separate, independent versions of all imported modules, " -"including the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:" -"`sys`. The table of loaded modules (``sys.modules``) and the module search " -"path (``sys.path``) are also separate. The new environment has no ``sys." -"argv`` variable. It has new standard I/O stream file objects ``sys.stdin``, " -"``sys.stdout`` and ``sys.stderr`` (however these refer to the same " -"underlying file descriptors)." +"including the fundamental modules :mod:`builtins`, :mod:`__main__` " +"and :mod:`sys`. The table of loaded modules (``sys.modules``) and the " +"module search path (``sys.path``) are also separate. The new environment " +"has no ``sys.argv`` variable. It has new standard I/O stream file objects " +"``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` (however these refer to the " +"same underlying file descriptors)." msgstr "" -#: ../../c-api/init.rst:1665 +#: ../../c-api/init.rst:1676 msgid "" "The given *config* controls the options with which the interpreter is " "initialized." msgstr "" -#: ../../c-api/init.rst:1668 +#: ../../c-api/init.rst:1679 msgid "" "Upon success, *tstate_p* will be set to the first thread state created in " "the new sub-interpreter. This thread state is made in the current thread " @@ -2014,7 +2025,7 @@ msgid "" "state." msgstr "" -#: ../../c-api/init.rst:1677 +#: ../../c-api/init.rst:1688 msgid "" "Like all other Python/C API functions, the global interpreter lock must be " "held before calling this function and is still held when it returns. " @@ -2026,13 +2037,13 @@ msgid "" "released here." msgstr "" -#: ../../c-api/init.rst:1688 +#: ../../c-api/init.rst:1699 msgid "" "Sub-interpreters are most effective when isolated from each other, with " "certain functionality restricted::" msgstr "" -#: ../../c-api/init.rst:1691 +#: ../../c-api/init.rst:1702 msgid "" "PyInterpreterConfig config = {\n" " .use_main_obmalloc = 0,\n" @@ -2064,58 +2075,59 @@ msgstr "" " Py_ExitStatusException(status);\n" "}" -#: ../../c-api/init.rst:1706 +#: ../../c-api/init.rst:1717 msgid "" "Note that the config is used only briefly and does not get modified. During " -"initialization the config's values are converted into various :c:type:" -"`PyInterpreterState` values. A read-only copy of the config may be stored " -"internally on the :c:type:`PyInterpreterState`." +"initialization the config's values are converted into " +"various :c:type:`PyInterpreterState` values. A read-only copy of the config " +"may be stored internally on the :c:type:`PyInterpreterState`." msgstr "" -#: ../../c-api/init.rst:1715 +#: ../../c-api/init.rst:1726 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1717 +#: ../../c-api/init.rst:1728 msgid "" -"For modules using multi-phase initialization, e.g. :c:func:" -"`PyModule_FromDefAndSpec`, a separate module object is created and " -"initialized for each interpreter. Only C-level static and global variables " -"are shared between these module objects." +"For modules using multi-phase initialization, " +"e.g. :c:func:`PyModule_FromDefAndSpec`, a separate module object is created " +"and initialized for each interpreter. Only C-level static and global " +"variables are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1723 +#: ../../c-api/init.rst:1734 msgid "" -"For modules using single-phase initialization, e.g. :c:func:" -"`PyModule_Create`, the first time a particular extension is imported, it is " -"initialized normally, and a (shallow) copy of its module's dictionary is " -"squirreled away. When the same extension is imported by another " -"(sub-)interpreter, a new module is initialized and filled with the contents " -"of this copy; the extension's ``init`` function is not called. Objects in " -"the module's dictionary thus end up shared across (sub-)interpreters, which " -"might cause unwanted behavior (see `Bugs and caveats`_ below)." +"For modules using single-phase initialization, " +"e.g. :c:func:`PyModule_Create`, the first time a particular extension is " +"imported, it is initialized normally, and a (shallow) copy of its module's " +"dictionary is squirreled away. When the same extension is imported by " +"another (sub-)interpreter, a new module is initialized and filled with the " +"contents of this copy; the extension's ``init`` function is not called. " +"Objects in the module's dictionary thus end up shared across " +"(sub-)interpreters, which might cause unwanted behavior (see `Bugs and " +"caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1734 +#: ../../c-api/init.rst:1745 msgid "" "Note that this is different from what happens when an extension is imported " -"after the interpreter has been completely re-initialized by calling :c:func:" -"`Py_FinalizeEx` and :c:func:`Py_Initialize`; in that case, the extension's " -"``initmodule`` function *is* called again. As with multi-phase " -"initialization, this means that only C-level static and global variables are " -"shared between these modules." +"after the interpreter has been completely re-initialized by " +"calling :c:func:`Py_FinalizeEx` and :c:func:`Py_Initialize`; in that case, " +"the extension's ``initmodule`` function *is* called again. As with multi-" +"phase initialization, this means that only C-level static and global " +"variables are shared between these modules." msgstr "" -#: ../../c-api/init.rst:1754 +#: ../../c-api/init.rst:1765 msgid "" -"Create a new sub-interpreter. This is essentially just a wrapper around :c:" -"func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " -"behavior. The result is an unisolated sub-interpreter that shares the main " -"interpreter's GIL, allows fork/exec, allows daemon threads, and allows " -"single-phase init modules." +"Create a new sub-interpreter. This is essentially just a wrapper " +"around :c:func:`Py_NewInterpreterFromConfig` with a config that preserves " +"the existing behavior. The result is an unisolated sub-interpreter that " +"shares the main interpreter's GIL, allows fork/exec, allows daemon threads, " +"and allows single-phase init modules." msgstr "" -#: ../../c-api/init.rst:1766 +#: ../../c-api/init.rst:1777 msgid "" "Destroy the (sub-)interpreter represented by the given thread state. The " "given thread state must be the current thread state. See the discussion of " @@ -2125,17 +2137,17 @@ msgid "" "be held before calling this function. No GIL is held when it returns." msgstr "" -#: ../../c-api/init.rst:1774 +#: ../../c-api/init.rst:1785 msgid "" ":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " "explicitly destroyed at that point." msgstr "" -#: ../../c-api/init.rst:1779 +#: ../../c-api/init.rst:1790 msgid "A Per-Interpreter GIL" msgstr "" -#: ../../c-api/init.rst:1781 +#: ../../c-api/init.rst:1792 msgid "" "Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " "that is completely isolated from other interpreters, including having its " @@ -2147,7 +2159,7 @@ msgid "" "just using threads. (See :pep:`554`.)" msgstr "" -#: ../../c-api/init.rst:1791 +#: ../../c-api/init.rst:1802 msgid "" "Using an isolated interpreter requires vigilance in preserving that " "isolation. That especially means not sharing any objects or mutable state " @@ -2161,7 +2173,7 @@ msgid "" "builtin objects." msgstr "" -#: ../../c-api/init.rst:1802 +#: ../../c-api/init.rst:1813 msgid "" "If you preserve isolation then you will have access to proper multi-core " "computing without the complications that come with free-threading. Failure " @@ -2169,7 +2181,7 @@ msgid "" "threading, including races and hard-to-debug crashes." msgstr "" -#: ../../c-api/init.rst:1807 +#: ../../c-api/init.rst:1818 msgid "" "Aside from that, one of the main challenges of using multiple isolated " "interpreters is how to communicate between them safely (not break isolation) " @@ -2179,11 +2191,11 @@ msgid "" "sharing) data between interpreters." msgstr "" -#: ../../c-api/init.rst:1818 +#: ../../c-api/init.rst:1829 msgid "Bugs and caveats" msgstr "" -#: ../../c-api/init.rst:1820 +#: ../../c-api/init.rst:1831 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -2196,7 +2208,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1830 +#: ../../c-api/init.rst:1841 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -2205,37 +2217,37 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1836 +#: ../../c-api/init.rst:1847 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " "and OS-level threads, an assumption broken by the presence of sub-" "interpreters. It is highly recommended that you don't switch sub-" -"interpreters between a pair of matching :c:func:`PyGILState_Ensure` and :c:" -"func:`PyGILState_Release` calls. Furthermore, extensions (such as :mod:" -"`ctypes`) using these APIs to allow calling of Python code from non-Python " -"created threads will probably be broken when using sub-interpreters." +"interpreters between a pair of matching :c:func:`PyGILState_Ensure` " +"and :c:func:`PyGILState_Release` calls. Furthermore, extensions (such " +"as :mod:`ctypes`) using these APIs to allow calling of Python code from non-" +"Python created threads will probably be broken when using sub-interpreters." msgstr "" -#: ../../c-api/init.rst:1847 +#: ../../c-api/init.rst:1858 msgid "Asynchronous Notifications" msgstr "" -#: ../../c-api/init.rst:1849 +#: ../../c-api/init.rst:1860 msgid "" "A mechanism is provided to make asynchronous notifications to the main " "interpreter thread. These notifications take the form of a function pointer " "and a void pointer argument." msgstr "" -#: ../../c-api/init.rst:1856 +#: ../../c-api/init.rst:1867 msgid "" "Schedule a function to be called from the main interpreter thread. On " "success, ``0`` is returned and *func* is queued for being called in the main " "thread. On failure, ``-1`` is returned without setting any exception." msgstr "" -#: ../../c-api/init.rst:1860 +#: ../../c-api/init.rst:1871 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -2243,17 +2255,17 @@ msgid "" "these conditions met:" msgstr "" -#: ../../c-api/init.rst:1865 +#: ../../c-api/init.rst:1876 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: ../../c-api/init.rst:1866 +#: ../../c-api/init.rst:1877 msgid "" "with the main thread holding the :term:`global interpreter lock` (*func* can " "therefore use the full C API)." msgstr "" -#: ../../c-api/init.rst:1869 +#: ../../c-api/init.rst:1880 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -2261,30 +2273,30 @@ msgid "" "if the global interpreter lock is released." msgstr "" -#: ../../c-api/init.rst:1874 +#: ../../c-api/init.rst:1885 msgid "" "This function doesn't need a current thread state to run, and it doesn't " "need the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:1877 +#: ../../c-api/init.rst:1888 msgid "" "To call this function in a subinterpreter, the caller must hold the GIL. " "Otherwise, the function *func* can be scheduled to be called from the wrong " "interpreter." msgstr "" -#: ../../c-api/init.rst:1882 +#: ../../c-api/init.rst:1893 msgid "" "This is a low-level function, only useful for very special cases. There is " "no guarantee that *func* will be called as quick as possible. If the main " "thread is busy executing a system call, *func* won't be called before the " "system call returns. This function is generally **not** suitable for " -"calling Python code from arbitrary C threads. Instead, use the :ref:" -"`PyGILState API`." +"calling Python code from arbitrary C threads. Instead, use " +"the :ref:`PyGILState API`." msgstr "" -#: ../../c-api/init.rst:1891 +#: ../../c-api/init.rst:1902 msgid "" "If this function is called in a subinterpreter, the function *func* is now " "scheduled to be called from the subinterpreter, rather than being called " @@ -2292,18 +2304,18 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:1900 +#: ../../c-api/init.rst:1911 msgid "Profiling and Tracing" msgstr "" -#: ../../c-api/init.rst:1905 +#: ../../c-api/init.rst:1916 msgid "" "The Python interpreter provides some low-level support for attaching " "profiling and execution tracing facilities. These are used for profiling, " "debugging, and coverage analysis tools." msgstr "" -#: ../../c-api/init.rst:1909 +#: ../../c-api/init.rst:1920 msgid "" "This C interface allows the profiling or tracing code to avoid the overhead " "of calling through Python-level callable objects, making a direct C function " @@ -2313,78 +2325,76 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: ../../c-api/init.rst:1919 +#: ../../c-api/init.rst:1930 msgid "" "The type of the trace function registered using :c:func:`PyEval_SetProfile` " "and :c:func:`PyEval_SetTrace`. The first parameter is the object passed to " "the registration function as *obj*, *frame* is the frame object to which the " -"event pertains, *what* is one of the constants :c:data:`PyTrace_CALL`, :c:" -"data:`PyTrace_EXCEPTION`, :c:data:`PyTrace_LINE`, :c:data:`PyTrace_RETURN`, :" -"c:data:`PyTrace_C_CALL`, :c:data:`PyTrace_C_EXCEPTION`, :c:data:" -"`PyTrace_C_RETURN`, or :c:data:`PyTrace_OPCODE`, and *arg* depends on the " -"value of *what*:" +"event pertains, *what* is one of the " +"constants :c:data:`PyTrace_CALL`, :c:data:`PyTrace_EXCEPTION`, :c:data:`PyTrace_LINE`, :c:data:`PyTrace_RETURN`, :c:data:`PyTrace_C_CALL`, :c:data:`PyTrace_C_EXCEPTION`, :c:data:`PyTrace_C_RETURN`, " +"or :c:data:`PyTrace_OPCODE`, and *arg* depends on the value of *what*:" msgstr "" -#: ../../c-api/init.rst:1928 +#: ../../c-api/init.rst:1939 msgid "Value of *what*" msgstr "" -#: ../../c-api/init.rst:1928 +#: ../../c-api/init.rst:1939 msgid "Meaning of *arg*" msgstr "*arg* 的含義" -#: ../../c-api/init.rst:1930 +#: ../../c-api/init.rst:1941 msgid ":c:data:`PyTrace_CALL`" msgstr ":c:data:`PyTrace_CALL`" -#: ../../c-api/init.rst:1930 ../../c-api/init.rst:1935 -#: ../../c-api/init.rst:1946 +#: ../../c-api/init.rst:1941 ../../c-api/init.rst:1946 +#: ../../c-api/init.rst:1957 msgid "Always :c:data:`Py_None`." msgstr "" -#: ../../c-api/init.rst:1932 +#: ../../c-api/init.rst:1943 msgid ":c:data:`PyTrace_EXCEPTION`" msgstr ":c:data:`PyTrace_EXCEPTION`" -#: ../../c-api/init.rst:1932 +#: ../../c-api/init.rst:1943 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: ../../c-api/init.rst:1935 +#: ../../c-api/init.rst:1946 msgid ":c:data:`PyTrace_LINE`" msgstr ":c:data:`PyTrace_LINE`" -#: ../../c-api/init.rst:1937 +#: ../../c-api/init.rst:1948 msgid ":c:data:`PyTrace_RETURN`" msgstr ":c:data:`PyTrace_RETURN`" -#: ../../c-api/init.rst:1937 +#: ../../c-api/init.rst:1948 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: ../../c-api/init.rst:1940 +#: ../../c-api/init.rst:1951 msgid ":c:data:`PyTrace_C_CALL`" msgstr ":c:data:`PyTrace_C_CALL`" -#: ../../c-api/init.rst:1940 ../../c-api/init.rst:1942 -#: ../../c-api/init.rst:1944 +#: ../../c-api/init.rst:1951 ../../c-api/init.rst:1953 +#: ../../c-api/init.rst:1955 msgid "Function object being called." msgstr "被呼叫的函式物件。" -#: ../../c-api/init.rst:1942 +#: ../../c-api/init.rst:1953 msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr ":c:data:`PyTrace_C_EXCEPTION`" -#: ../../c-api/init.rst:1944 +#: ../../c-api/init.rst:1955 msgid ":c:data:`PyTrace_C_RETURN`" msgstr ":c:data:`PyTrace_C_RETURN`" -#: ../../c-api/init.rst:1946 +#: ../../c-api/init.rst:1957 msgid ":c:data:`PyTrace_OPCODE`" msgstr ":c:data:`PyTrace_OPCODE`" -#: ../../c-api/init.rst:1951 +#: ../../c-api/init.rst:1962 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "a new call to a function or method is being reported, or a new entry into a " @@ -2393,7 +2403,7 @@ msgid "" "the corresponding frame." msgstr "" -#: ../../c-api/init.rst:1960 +#: ../../c-api/init.rst:1971 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "an exception has been raised. The callback function is called with this " @@ -2405,133 +2415,134 @@ msgid "" "profiler." msgstr "" -#: ../../c-api/init.rst:1971 +#: ../../c-api/init.rst:1982 msgid "" "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " "function (but not a profiling function) when a line-number event is being " -"reported. It may be disabled for a frame by setting :attr:`~frame." -"f_trace_lines` to *0* on that frame." +"reported. It may be disabled for a frame by " +"setting :attr:`~frame.f_trace_lines` to *0* on that frame." msgstr "" -#: ../../c-api/init.rst:1979 +#: ../../c-api/init.rst:1990 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." msgstr "" -#: ../../c-api/init.rst:1985 +#: ../../c-api/init.rst:1996 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." msgstr "" -#: ../../c-api/init.rst:1991 +#: ../../c-api/init.rst:2002 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." msgstr "" -#: ../../c-api/init.rst:1997 +#: ../../c-api/init.rst:2008 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:2003 +#: ../../c-api/init.rst:2014 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " "not profiling functions) when a new opcode is about to be executed. This " -"event is not emitted by default: it must be explicitly requested by setting :" -"attr:`~frame.f_trace_opcodes` to *1* on the frame." +"event is not emitted by default: it must be explicitly requested by " +"setting :attr:`~frame.f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:2011 +#: ../../c-api/init.rst:2022 msgid "" "Set the profiler function to *func*. The *obj* parameter is passed to the " "function as its first parameter, and may be any Python object, or ``NULL``. " "If the profile function needs to maintain state, using a different value for " "*obj* for each thread provides a convenient and thread-safe place to store " -"it. The profile function is called for all monitored events except :c:data:" -"`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." +"it. The profile function is called for all monitored events " +"except :c:data:`PyTrace_LINE` :c:data:`PyTrace_OPCODE` " +"and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:2018 +#: ../../c-api/init.rst:2029 msgid "See also the :func:`sys.setprofile` function." msgstr "" -#: ../../c-api/init.rst:2020 ../../c-api/init.rst:2027 -#: ../../c-api/init.rst:2046 ../../c-api/init.rst:2053 +#: ../../c-api/init.rst:2031 ../../c-api/init.rst:2038 +#: ../../c-api/init.rst:2057 ../../c-api/init.rst:2064 msgid "The caller must hold the :term:`GIL`." msgstr "呼叫者必須持有 :term:`GIL`。" -#: ../../c-api/init.rst:2024 +#: ../../c-api/init.rst:2035 msgid "" "Like :c:func:`PyEval_SetProfile` but sets the profile function in all " "running threads belonging to the current interpreter instead of the setting " "it only on the current thread." msgstr "" -#: ../../c-api/init.rst:2029 +#: ../../c-api/init.rst:2040 msgid "" "As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised " "while setting the profile functions in all threads." msgstr "" -#: ../../c-api/init.rst:2037 +#: ../../c-api/init.rst:2048 msgid "" -"Set the tracing function to *func*. This is similar to :c:func:" -"`PyEval_SetProfile`, except the tracing function does receive line-number " -"events and per-opcode events, but does not receive any event related to C " -"function objects being called. Any trace function registered using :c:func:" -"`PyEval_SetTrace` will not receive :c:data:`PyTrace_C_CALL`, :c:data:" -"`PyTrace_C_EXCEPTION` or :c:data:`PyTrace_C_RETURN` as a value for the " -"*what* parameter." +"Set the tracing function to *func*. This is similar " +"to :c:func:`PyEval_SetProfile`, except the tracing function does receive " +"line-number events and per-opcode events, but does not receive any event " +"related to C function objects being called. Any trace function registered " +"using :c:func:`PyEval_SetTrace` will not " +"receive :c:data:`PyTrace_C_CALL`, :c:data:`PyTrace_C_EXCEPTION` " +"or :c:data:`PyTrace_C_RETURN` as a value for the *what* parameter." msgstr "" -#: ../../c-api/init.rst:2044 +#: ../../c-api/init.rst:2055 msgid "See also the :func:`sys.settrace` function." msgstr "也請見 :func:`sys.settrace` 函式。" -#: ../../c-api/init.rst:2050 +#: ../../c-api/init.rst:2061 msgid "" "Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running " "threads belonging to the current interpreter instead of the setting it only " "on the current thread." msgstr "" -#: ../../c-api/init.rst:2055 +#: ../../c-api/init.rst:2066 msgid "" "As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised " "while setting the trace functions in all threads." msgstr "" -#: ../../c-api/init.rst:2061 +#: ../../c-api/init.rst:2072 msgid "Reference tracing" msgstr "" -#: ../../c-api/init.rst:2067 +#: ../../c-api/init.rst:2078 msgid "" -"The type of the trace function registered using :c:func:" -"`PyRefTracer_SetTracer`. The first parameter is a Python object that has " -"been just created (when **event** is set to :c:data:`PyRefTracer_CREATE`) or " -"about to be destroyed (when **event** is set to :c:data:" -"`PyRefTracer_DESTROY`). The **data** argument is the opaque pointer that was " -"provided when :c:func:`PyRefTracer_SetTracer` was called." +"The type of the trace function registered " +"using :c:func:`PyRefTracer_SetTracer`. The first parameter is a Python " +"object that has been just created (when **event** is set " +"to :c:data:`PyRefTracer_CREATE`) or about to be destroyed (when **event** is " +"set to :c:data:`PyRefTracer_DESTROY`). The **data** argument is the opaque " +"pointer that was provided when :c:func:`PyRefTracer_SetTracer` was called." msgstr "" -#: ../../c-api/init.rst:2077 +#: ../../c-api/init.rst:2088 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been created." msgstr "" -#: ../../c-api/init.rst:2082 +#: ../../c-api/init.rst:2093 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been destroyed." msgstr "" -#: ../../c-api/init.rst:2087 +#: ../../c-api/init.rst:2098 msgid "" "Register a reference tracer function. The function will be called when a new " "Python has been created or when an object is going to be destroyed. If " @@ -2540,7 +2551,7 @@ msgid "" "return ``-1`` on error." msgstr "" -#: ../../c-api/init.rst:2093 +#: ../../c-api/init.rst:2104 msgid "" "Not that tracer functions **must not** create Python objects inside or " "otherwise the call will be re-entrant. The tracer also **must not** clear " @@ -2548,11 +2559,11 @@ msgid "" "the tracer function is called." msgstr "" -#: ../../c-api/init.rst:2098 ../../c-api/init.rst:2109 +#: ../../c-api/init.rst:2109 ../../c-api/init.rst:2120 msgid "The GIL must be held when calling this function." msgstr "" -#: ../../c-api/init.rst:2104 +#: ../../c-api/init.rst:2115 msgid "" "Get the registered reference tracer function and the value of the opaque " "data pointer that was registered when :c:func:`PyRefTracer_SetTracer` was " @@ -2560,48 +2571,48 @@ msgid "" "set the **data** pointer to NULL." msgstr "" -#: ../../c-api/init.rst:2116 +#: ../../c-api/init.rst:2127 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:2121 +#: ../../c-api/init.rst:2132 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:2126 +#: ../../c-api/init.rst:2137 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:2131 +#: ../../c-api/init.rst:2142 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:2136 +#: ../../c-api/init.rst:2147 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:2142 +#: ../../c-api/init.rst:2153 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." msgstr "" -#: ../../c-api/init.rst:2148 +#: ../../c-api/init.rst:2159 msgid "" "Return the next thread state object after *tstate* from the list of all such " "objects belonging to the same :c:type:`PyInterpreterState` object." msgstr "" -#: ../../c-api/init.rst:2155 +#: ../../c-api/init.rst:2166 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:2159 +#: ../../c-api/init.rst:2170 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2611,42 +2622,42 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:2166 +#: ../../c-api/init.rst:2177 msgid "" "The GIL does *not* need to be held when calling these functions; they supply " "their own locking." msgstr "" -#: ../../c-api/init.rst:2169 +#: ../../c-api/init.rst:2180 msgid "" "Note that :file:`Python.h` does not include the declaration of the TLS APIs, " "you need to include :file:`pythread.h` to use thread-local storage." msgstr "" -#: ../../c-api/init.rst:2173 +#: ../../c-api/init.rst:2184 msgid "" -"None of these API functions handle memory management on behalf of the :c:" -"expr:`void*` values. You need to allocate and deallocate them yourself. If " -"the :c:expr:`void*` values happen to be :c:expr:`PyObject*`, these functions " -"don't do refcount operations on them either." +"None of these API functions handle memory management on behalf of " +"the :c:expr:`void*` values. You need to allocate and deallocate them " +"yourself. If the :c:expr:`void*` values happen to be :c:expr:`PyObject*`, " +"these functions don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:2181 +#: ../../c-api/init.rst:2192 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:2183 +#: ../../c-api/init.rst:2194 msgid "" "TSS API is introduced to supersede the use of the existing TLS API within " "the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` " "instead of :c:expr:`int` to represent thread keys." msgstr "" -#: ../../c-api/init.rst:2189 +#: ../../c-api/init.rst:2200 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:2194 +#: ../../c-api/init.rst:2205 msgid "" "This data structure represents the state of a thread key, the definition of " "which may depend on the underlying TLS implementation, and it has an " @@ -2654,66 +2665,67 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:2199 +#: ../../c-api/init.rst:2210 msgid "" "When :ref:`Py_LIMITED_API ` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." msgstr "" -#: ../../c-api/init.rst:2205 +#: ../../c-api/init.rst:2216 msgid "" "This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note " "that this macro won't be defined with :ref:`Py_LIMITED_API `." msgstr "" -#: ../../c-api/init.rst:2210 +#: ../../c-api/init.rst:2221 msgid "Dynamic Allocation" msgstr "" -#: ../../c-api/init.rst:2212 +#: ../../c-api/init.rst:2223 msgid "" "Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules " "built with :ref:`Py_LIMITED_API `, where static allocation of this " "type is not possible due to its implementation being opaque at build time." msgstr "" -#: ../../c-api/init.rst:2219 +#: ../../c-api/init.rst:2230 msgid "" -"Return a value which is the same state as a value initialized with :c:macro:" -"`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." +"Return a value which is the same state as a value initialized " +"with :c:macro:`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic " +"allocation failure." msgstr "" -#: ../../c-api/init.rst:2226 +#: ../../c-api/init.rst:2237 msgid "" "Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first " "calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals " "have been unassigned. This is a no-op if the *key* argument is ``NULL``." msgstr "" -#: ../../c-api/init.rst:2232 +#: ../../c-api/init.rst:2243 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:2237 +#: ../../c-api/init.rst:2248 msgid "Methods" msgstr "方法" -#: ../../c-api/init.rst:2239 +#: ../../c-api/init.rst:2250 msgid "" "The parameter *key* of these functions must not be ``NULL``. Moreover, the " "behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are " -"undefined if the given :c:type:`Py_tss_t` has not been initialized by :c:" -"func:`PyThread_tss_create`." +"undefined if the given :c:type:`Py_tss_t` has not been initialized " +"by :c:func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2247 +#: ../../c-api/init.rst:2258 msgid "" "Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized " "by :c:func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2253 +#: ../../c-api/init.rst:2264 msgid "" "Return a zero value on successful initialization of a TSS key. The behavior " "is undefined if the value pointed to by the *key* argument is not " @@ -2722,40 +2734,40 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: ../../c-api/init.rst:2262 +#: ../../c-api/init.rst:2273 msgid "" "Destroy a TSS key to forget the values associated with the key across all " "threads, and change the key's initialization state to uninitialized. A " -"destroyed key is able to be initialized again by :c:func:" -"`PyThread_tss_create`. This function can be called repeatedly on the same " -"key -- calling it on an already destroyed key is a no-op." +"destroyed key is able to be initialized again " +"by :c:func:`PyThread_tss_create`. This function can be called repeatedly on " +"the same key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:2271 +#: ../../c-api/init.rst:2282 msgid "" "Return a zero value to indicate successfully associating a :c:expr:`void*` " "value with a TSS key in the current thread. Each thread has a distinct " "mapping of the key to a :c:expr:`void*` value." msgstr "" -#: ../../c-api/init.rst:2278 +#: ../../c-api/init.rst:2289 msgid "" "Return the :c:expr:`void*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" -#: ../../c-api/init.rst:2286 +#: ../../c-api/init.rst:2297 msgid "Thread Local Storage (TLS) API" msgstr "執行緒局部儲存 (Thread Local Storage, TLS) API:" -#: ../../c-api/init.rst:2288 +#: ../../c-api/init.rst:2299 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: ../../c-api/init.rst:2293 +#: ../../c-api/init.rst:2304 msgid "" "This version of the API does not support platforms where the native TLS key " "is defined in a way that cannot be safely cast to ``int``. On such " @@ -2764,62 +2776,62 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2298 +#: ../../c-api/init.rst:2309 msgid "" "Due to the compatibility problem noted above, this version of the API should " "not be used in new code." msgstr "" -#: ../../c-api/init.rst:2309 +#: ../../c-api/init.rst:2320 msgid "Synchronization Primitives" msgstr "" -#: ../../c-api/init.rst:2311 +#: ../../c-api/init.rst:2322 msgid "The C-API provides a basic mutual exclusion lock." msgstr "" -#: ../../c-api/init.rst:2315 +#: ../../c-api/init.rst:2326 msgid "" "A mutual exclusion lock. The :c:type:`!PyMutex` should be initialized to " "zero to represent the unlocked state. For example::" msgstr "" -#: ../../c-api/init.rst:2318 +#: ../../c-api/init.rst:2329 msgid "PyMutex mutex = {0};" msgstr "" -#: ../../c-api/init.rst:2320 +#: ../../c-api/init.rst:2331 msgid "" "Instances of :c:type:`!PyMutex` should not be copied or moved. Both the " "contents and address of a :c:type:`!PyMutex` are meaningful, and it must " "remain at a fixed, writable location in memory." msgstr "" -#: ../../c-api/init.rst:2326 +#: ../../c-api/init.rst:2337 msgid "" "A :c:type:`!PyMutex` currently occupies one byte, but the size should be " "considered unstable. The size may change in future Python releases without " "a deprecation period." msgstr "" -#: ../../c-api/init.rst:2334 +#: ../../c-api/init.rst:2345 msgid "" "Lock mutex *m*. If another thread has already locked it, the calling thread " "will block until the mutex is unlocked. While blocked, the thread will " "temporarily release the :term:`GIL` if it is held." msgstr "" -#: ../../c-api/init.rst:2342 +#: ../../c-api/init.rst:2353 msgid "" "Unlock mutex *m*. The mutex must be locked --- otherwise, the function will " "issue a fatal error." msgstr "" -#: ../../c-api/init.rst:2350 +#: ../../c-api/init.rst:2361 msgid "Python Critical Section API" msgstr "" -#: ../../c-api/init.rst:2352 +#: ../../c-api/init.rst:2363 msgid "" "The critical section API provides a deadlock avoidance layer on top of per-" "object locks for :term:`free-threaded ` CPython. They are " @@ -2827,17 +2839,18 @@ msgid "" "no-ops in versions of Python with the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:2357 +#: ../../c-api/init.rst:2368 msgid "" "Critical sections avoid deadlocks by implicitly suspending active critical " -"sections and releasing the locks during calls to :c:func:" -"`PyEval_SaveThread`. When :c:func:`PyEval_RestoreThread` is called, the most " -"recent critical section is resumed, and its locks reacquired. This means " -"the critical section API provides weaker guarantees than traditional locks " -"-- they are useful because their behavior is similar to the :term:`GIL`." +"sections and releasing the locks during calls " +"to :c:func:`PyEval_SaveThread`. When :c:func:`PyEval_RestoreThread` is " +"called, the most recent critical section is resumed, and its locks " +"reacquired. This means the critical section API provides weaker guarantees " +"than traditional locks -- they are useful because their behavior is similar " +"to the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:2364 +#: ../../c-api/init.rst:2375 msgid "" "The functions and structs used by the macros are exposed for cases where C " "macros are not available. They should only be used as in the given macro " @@ -2845,20 +2858,20 @@ msgid "" "future Python versions." msgstr "" -#: ../../c-api/init.rst:2371 +#: ../../c-api/init.rst:2382 msgid "" -"Operations that need to lock two objects at once must use :c:macro:" -"`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical sections to " -"lock more than one object at once, because the inner critical section may " -"suspend the outer critical sections. This API does not provide a way to " -"lock more than two objects at once." +"Operations that need to lock two objects at once must " +"use :c:macro:`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical " +"sections to lock more than one object at once, because the inner critical " +"section may suspend the outer critical sections. This API does not provide " +"a way to lock more than two objects at once." msgstr "" -#: ../../c-api/init.rst:2377 +#: ../../c-api/init.rst:2388 msgid "Example usage::" msgstr "" -#: ../../c-api/init.rst:2379 +#: ../../c-api/init.rst:2390 msgid "" "static PyObject *\n" "set_field(MyObject *self, PyObject *value)\n" @@ -2870,71 +2883,71 @@ msgid "" "}" msgstr "" -#: ../../c-api/init.rst:2388 +#: ../../c-api/init.rst:2399 msgid "" "In the above example, :c:macro:`Py_SETREF` calls :c:macro:`Py_DECREF`, which " "can call arbitrary code through an object's deallocation function. The " "critical section API avoids potential deadlocks due to reentrancy and lock " "ordering by allowing the runtime to temporarily suspend the critical section " -"if the code triggered by the finalizer blocks and calls :c:func:" -"`PyEval_SaveThread`." +"if the code triggered by the finalizer blocks and " +"calls :c:func:`PyEval_SaveThread`." msgstr "" -#: ../../c-api/init.rst:2396 +#: ../../c-api/init.rst:2407 msgid "" "Acquires the per-object lock for the object *op* and begins a critical " "section." msgstr "" -#: ../../c-api/init.rst:2399 ../../c-api/init.rst:2413 -#: ../../c-api/init.rst:2428 ../../c-api/init.rst:2442 +#: ../../c-api/init.rst:2410 ../../c-api/init.rst:2424 +#: ../../c-api/init.rst:2439 ../../c-api/init.rst:2453 msgid "In the free-threaded build, this macro expands to::" msgstr "" -#: ../../c-api/init.rst:2401 +#: ../../c-api/init.rst:2412 msgid "" "{\n" " PyCriticalSection _py_cs;\n" " PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))" msgstr "" -#: ../../c-api/init.rst:2405 ../../c-api/init.rst:2434 +#: ../../c-api/init.rst:2416 ../../c-api/init.rst:2445 msgid "In the default build, this macro expands to ``{``." msgstr "" -#: ../../c-api/init.rst:2411 +#: ../../c-api/init.rst:2422 msgid "Ends the critical section and releases the per-object lock." msgstr "" -#: ../../c-api/init.rst:2415 +#: ../../c-api/init.rst:2426 msgid "" " PyCriticalSection_End(&_py_cs);\n" "}" msgstr "" -#: ../../c-api/init.rst:2418 ../../c-api/init.rst:2447 +#: ../../c-api/init.rst:2429 ../../c-api/init.rst:2458 msgid "In the default build, this macro expands to ``}``." msgstr "" -#: ../../c-api/init.rst:2424 +#: ../../c-api/init.rst:2435 msgid "" "Acquires the per-objects locks for the objects *a* and *b* and begins a " "critical section. The locks are acquired in a consistent order (lowest " "address first) to avoid lock ordering deadlocks." msgstr "" -#: ../../c-api/init.rst:2430 +#: ../../c-api/init.rst:2441 msgid "" "{\n" " PyCriticalSection2 _py_cs2;\n" " PyCriticalSection2_Begin(&_py_cs2, (PyObject*)(a), (PyObject*)(b))" msgstr "" -#: ../../c-api/init.rst:2440 +#: ../../c-api/init.rst:2451 msgid "Ends the critical section and releases the per-object locks." msgstr "" -#: ../../c-api/init.rst:2444 +#: ../../c-api/init.rst:2455 msgid "" " PyCriticalSection2_End(&_py_cs2);\n" "}" @@ -2953,19 +2966,19 @@ msgid "path (in module sys)" msgstr "path(sys 模組中)" #: ../../c-api/init.rst:350 ../../c-api/init.rst:710 ../../c-api/init.rst:1145 -#: ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 +#: ../../c-api/init.rst:1658 ../../c-api/init.rst:1757 msgid "module" msgstr "模組" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1658 ../../c-api/init.rst:1757 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1658 ../../c-api/init.rst:1757 msgid "__main__" msgstr "__main__" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1658 ../../c-api/init.rst:1757 msgid "sys" msgstr "sys" @@ -2977,7 +2990,7 @@ msgstr "search(搜尋)" msgid "path" msgstr "path(路徑)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1711 ../../c-api/init.rst:1764 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1722 ../../c-api/init.rst:1775 msgid "Py_FinalizeEx (C function)" msgstr "Py_FinalizeEx(C 函式)" @@ -3073,22 +3086,22 @@ msgstr "PyEval_RestoreThread()" msgid "_thread" msgstr "_thread" -#: ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 +#: ../../c-api/init.rst:1658 ../../c-api/init.rst:1757 msgid "stdout (in module sys)" msgstr "stdout(sys 模組中)" -#: ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 +#: ../../c-api/init.rst:1658 ../../c-api/init.rst:1757 msgid "stderr (in module sys)" msgstr "stderr(sys 模組中)" -#: ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 +#: ../../c-api/init.rst:1658 ../../c-api/init.rst:1757 msgid "stdin (in module sys)" msgstr "stdin(sys 模組中)" -#: ../../c-api/init.rst:1711 +#: ../../c-api/init.rst:1722 msgid "Py_Initialize (C function)" msgstr "Py_Initialize(C 函式)" -#: ../../c-api/init.rst:1741 +#: ../../c-api/init.rst:1752 msgid "close (in module os)" msgstr "close(os 模組中)" diff --git a/c-api/module.po b/c-api/module.po index bfd8be22ed..7ebac731fe 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-10 00:13+0000\n" +"POT-Creation-Date: 2025-02-04 00:13+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -584,18 +584,12 @@ msgid "" "On success, return ``0``. On error, raise an exception and return ``-1``." msgstr "" -#: ../../c-api/module.rst:526 -msgid "" -"Return ``-1`` if *value* is ``NULL``. It must be called with an exception " -"raised in this case." -msgstr "" - -#: ../../c-api/module.rst:529 ../../c-api/module.rst:576 -#: ../../c-api/module.rst:603 +#: ../../c-api/module.rst:526 ../../c-api/module.rst:577 +#: ../../c-api/module.rst:604 msgid "Example usage::" msgstr "用法範例: ::" -#: ../../c-api/module.rst:531 +#: ../../c-api/module.rst:528 msgid "" "static int\n" "add_spam(PyObject *module, int value)\n" @@ -621,13 +615,20 @@ msgstr "" " return res;\n" " }" -#: ../../c-api/module.rst:543 +#: ../../c-api/module.rst:540 +msgid "" +"To be convenient, the function accepts ``NULL`` *value* with an exception " +"set. In this case, return ``-1`` and just leave the raised exception " +"unchanged." +msgstr "" + +#: ../../c-api/module.rst:544 msgid "" "The example can also be written without checking explicitly if *obj* is " "``NULL``::" msgstr "" -#: ../../c-api/module.rst:546 +#: ../../c-api/module.rst:547 msgid "" "static int\n" "add_spam(PyObject *module, int value)\n" @@ -647,13 +648,13 @@ msgstr "" " return res;\n" " }" -#: ../../c-api/module.rst:555 +#: ../../c-api/module.rst:556 msgid "" "Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this " "case, since *obj* can be ``NULL``." msgstr "" -#: ../../c-api/module.rst:558 +#: ../../c-api/module.rst:559 msgid "" "The number of different *name* strings passed to this function should be " "kept small, usually by only using statically allocated strings as *name*. " @@ -663,7 +664,7 @@ msgid "" "internally to create a key object." msgstr "" -#: ../../c-api/module.rst:571 +#: ../../c-api/module.rst:572 msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but \"steals\" a reference to " "*value*. It can be called with a result of function that returns a new " @@ -671,39 +672,39 @@ msgid "" "variable." msgstr "" -#: ../../c-api/module.rst:578 +#: ../../c-api/module.rst:579 msgid "" "if (PyModule_Add(module, \"spam\", PyBytes_FromString(value)) < 0) {\n" " goto error;\n" "}" msgstr "" -#: ../../c-api/module.rst:587 +#: ../../c-api/module.rst:588 msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but steals a reference to " "*value* on success (if it returns ``0``)." msgstr "" -#: ../../c-api/module.rst:590 +#: ../../c-api/module.rst:591 msgid "" "The new :c:func:`PyModule_Add` or :c:func:`PyModule_AddObjectRef` functions " "are recommended, since it is easy to introduce reference leaks by misusing " "the :c:func:`PyModule_AddObject` function." msgstr "" -#: ../../c-api/module.rst:597 +#: ../../c-api/module.rst:598 msgid "" "Unlike other functions that steal references, ``PyModule_AddObject()`` only " "releases the reference to *value* **on success**." msgstr "" -#: ../../c-api/module.rst:600 +#: ../../c-api/module.rst:601 msgid "" "This means that its return value must be checked, and calling code must :c:" "func:`Py_XDECREF` *value* manually on error." msgstr "" -#: ../../c-api/module.rst:605 +#: ../../c-api/module.rst:606 msgid "" "PyObject *obj = PyBytes_FromString(value);\n" "if (PyModule_AddObject(module, \"spam\", obj) < 0) {\n" @@ -717,24 +718,24 @@ msgid "" "// Py_XDECREF(obj) is not needed here." msgstr "" -#: ../../c-api/module.rst:618 +#: ../../c-api/module.rst:619 msgid ":c:func:`PyModule_AddObject` is :term:`soft deprecated`." msgstr "" -#: ../../c-api/module.rst:623 +#: ../../c-api/module.rst:624 msgid "" "Add an integer constant to *module* as *name*. This convenience function " "can be used from the module's initialization function. Return ``-1`` with an " "exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:627 +#: ../../c-api/module.rst:628 msgid "" "This is a convenience function that calls :c:func:`PyLong_FromLong` and :c:" "func:`PyModule_AddObjectRef`; see their documentation for details." msgstr "" -#: ../../c-api/module.rst:633 +#: ../../c-api/module.rst:634 msgid "" "Add a string constant to *module* as *name*. This convenience function can " "be used from the module's initialization function. The string *value* must " @@ -742,14 +743,14 @@ msgid "" "on success." msgstr "" -#: ../../c-api/module.rst:638 +#: ../../c-api/module.rst:639 msgid "" "This is a convenience function that calls :c:func:" "`PyUnicode_InternFromString` and :c:func:`PyModule_AddObjectRef`; see their " "documentation for details." msgstr "" -#: ../../c-api/module.rst:645 +#: ../../c-api/module.rst:646 msgid "" "Add an int constant to *module*. The name and the value are taken from " "*macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int " @@ -757,11 +758,11 @@ msgid "" "with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:653 +#: ../../c-api/module.rst:654 msgid "Add a string constant to *module*." msgstr "" -#: ../../c-api/module.rst:657 +#: ../../c-api/module.rst:658 msgid "" "Add a type object to *module*. The type object is finalized by calling " "internally :c:func:`PyType_Ready`. The name of the type object is taken from " @@ -769,7 +770,7 @@ msgid "" "``-1`` with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:667 +#: ../../c-api/module.rst:668 msgid "" "Indicate that *module* does or does not support running without the global " "interpreter lock (GIL), using one of the values from :c:macro:`Py_mod_gil`. " @@ -780,25 +781,25 @@ msgid "" "Return ``-1`` with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:680 +#: ../../c-api/module.rst:681 msgid "Module lookup" msgstr "模組查找" -#: ../../c-api/module.rst:682 +#: ../../c-api/module.rst:683 msgid "" "Single-phase initialization creates singleton modules that can be looked up " "in the context of the current interpreter. This allows the module object to " "be retrieved later with only a reference to the module definition." msgstr "" -#: ../../c-api/module.rst:686 +#: ../../c-api/module.rst:687 msgid "" "These functions will not work on modules created using multi-phase " "initialization, since multiple such modules can be created from a single " "definition." msgstr "" -#: ../../c-api/module.rst:691 +#: ../../c-api/module.rst:692 msgid "" "Returns the module object that was created from *def* for the current " "interpreter. This method requires that the module object has been attached " @@ -807,18 +808,18 @@ msgid "" "to the interpreter state yet, it returns ``NULL``." msgstr "" -#: ../../c-api/module.rst:698 +#: ../../c-api/module.rst:699 msgid "" "Attaches the module object passed to the function to the interpreter state. " "This allows the module object to be accessible via :c:func:" "`PyState_FindModule`." msgstr "" -#: ../../c-api/module.rst:701 +#: ../../c-api/module.rst:702 msgid "Only effective on modules created using single-phase initialization." msgstr "" -#: ../../c-api/module.rst:703 +#: ../../c-api/module.rst:704 msgid "" "Python calls ``PyState_AddModule`` automatically after importing a module, " "so it is unnecessary (but harmless) to call it from module initialization " @@ -829,15 +830,15 @@ msgid "" "state updates)." msgstr "" -#: ../../c-api/module.rst:711 ../../c-api/module.rst:722 +#: ../../c-api/module.rst:712 ../../c-api/module.rst:723 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/module.rst:713 +#: ../../c-api/module.rst:714 msgid "Return ``-1`` with an exception set on error, ``0`` on success." msgstr "成功時回傳 ``0``,在失敗時回傳 ``-1`` 並設定例外。" -#: ../../c-api/module.rst:719 +#: ../../c-api/module.rst:720 msgid "" "Removes the module object created from *def* from the interpreter state. " "Return ``-1`` with an exception set on error, ``0`` on success." diff --git a/c-api/object.po b/c-api/object.po index a2be5438c2..661f6905da 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-29 11:18+0000\n" +"POT-Creation-Date: 2025-01-05 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -606,6 +606,13 @@ msgstr "" #: ../../c-api/object.rst:498 msgid "" +"This is the same as :c:func:`PyObject_DelItem`, but *key* is specified as a :" +"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + +#: ../../c-api/object.rst:505 +msgid "" "This is equivalent to the Python expression ``dir(o)``, returning a " "(possibly empty) list of strings appropriate for the object argument, or " "``NULL`` if there was an error. If the argument is ``NULL``, this is like " @@ -614,7 +621,7 @@ msgid "" "`PyErr_Occurred` will return false." msgstr "" -#: ../../c-api/object.rst:507 +#: ../../c-api/object.rst:514 msgid "" "This is equivalent to the Python expression ``iter(o)``. It returns a new " "iterator for the object argument, or the object itself if the object is " @@ -622,14 +629,14 @@ msgid "" "object cannot be iterated." msgstr "" -#: ../../c-api/object.rst:515 +#: ../../c-api/object.rst:522 msgid "" "This is equivalent to the Python ``__iter__(self): return self`` method. It " "is intended for :term:`iterator` types, to be used in the :c:member:" "`PyTypeObject.tp_iter` slot." msgstr "" -#: ../../c-api/object.rst:521 +#: ../../c-api/object.rst:528 msgid "" "This is the equivalent to the Python expression ``aiter(o)``. Takes an :" "class:`AsyncIterable` object and returns an :class:`AsyncIterator` for it. " @@ -638,67 +645,67 @@ msgid "" "``NULL`` if the object cannot be iterated." msgstr "" -#: ../../c-api/object.rst:531 +#: ../../c-api/object.rst:538 msgid "Get a pointer to subclass-specific data reserved for *cls*." msgstr "" -#: ../../c-api/object.rst:533 +#: ../../c-api/object.rst:540 msgid "" "The object *o* must be an instance of *cls*, and *cls* must have been " "created using negative :c:member:`PyType_Spec.basicsize`. Python does not " "check this." msgstr "" -#: ../../c-api/object.rst:537 +#: ../../c-api/object.rst:544 msgid "On error, set an exception and return ``NULL``." msgstr "" -#: ../../c-api/object.rst:543 +#: ../../c-api/object.rst:550 msgid "" "Return the size of the instance memory space reserved for *cls*, i.e. the " "size of the memory :c:func:`PyObject_GetTypeData` returns." msgstr "" -#: ../../c-api/object.rst:546 +#: ../../c-api/object.rst:553 msgid "" "This may be larger than requested using :c:member:`-PyType_Spec.basicsize " "`; it is safe to use this larger size (e.g. with :c:" "func:`!memset`)." msgstr "" -#: ../../c-api/object.rst:549 +#: ../../c-api/object.rst:556 msgid "" "The type *cls* **must** have been created using negative :c:member:" "`PyType_Spec.basicsize`. Python does not check this." msgstr "" -#: ../../c-api/object.rst:553 +#: ../../c-api/object.rst:560 msgid "On error, set an exception and return a negative value." msgstr "" -#: ../../c-api/object.rst:559 +#: ../../c-api/object.rst:566 msgid "" "Get a pointer to per-item data for a class with :c:macro:" "`Py_TPFLAGS_ITEMS_AT_END`." msgstr "" -#: ../../c-api/object.rst:562 +#: ../../c-api/object.rst:569 msgid "" "On error, set an exception and return ``NULL``. :py:exc:`TypeError` is " "raised if *o* does not have :c:macro:`Py_TPFLAGS_ITEMS_AT_END` set." msgstr "" -#: ../../c-api/object.rst:570 +#: ../../c-api/object.rst:577 msgid "Visit the managed dictionary of *obj*." msgstr "" -#: ../../c-api/object.rst:572 ../../c-api/object.rst:581 +#: ../../c-api/object.rst:579 ../../c-api/object.rst:588 msgid "" "This function must only be called in a traverse function of the type which " "has the :c:macro:`Py_TPFLAGS_MANAGED_DICT` flag set." msgstr "" -#: ../../c-api/object.rst:579 +#: ../../c-api/object.rst:586 msgid "Clear the managed dictionary of *obj*." msgstr "" diff --git a/c-api/unicode.po b/c-api/unicode.po index 8ebbcebe8f..6049c55176 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-28 00:13+0000\n" +"POT-Creation-Date: 2025-01-21 00:13+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -128,8 +128,8 @@ msgstr "" msgid "" "Return a pointer to the canonical representation cast to UCS1, UCS2 or UCS4 " "integer types for direct character access. No checks are performed if the " -"canonical representation has the correct character size; use :c:func:" -"`PyUnicode_KIND` to select the right function." +"canonical representation has the correct character size; " +"use :c:func:`PyUnicode_KIND` to select the right function." msgstr "" #: ../../c-api/unicode.rst:124 @@ -156,25 +156,25 @@ msgstr "" #: ../../c-api/unicode.rst:152 msgid "" -"Write into a canonical representation *data* (as obtained with :c:func:" -"`PyUnicode_DATA`). This function performs no sanity checks, and is intended " -"for usage in loops. The caller should cache the *kind* value and *data* " -"pointer as obtained from other calls. *index* is the index in the string " -"(starts at 0) and *value* is the new code point value which should be " -"written to that location." +"Write into a canonical representation *data* (as obtained " +"with :c:func:`PyUnicode_DATA`). This function performs no sanity checks, " +"and is intended for usage in loops. The caller should cache the *kind* " +"value and *data* pointer as obtained from other calls. *index* is the index " +"in the string (starts at 0) and *value* is the new code point value which " +"should be written to that location." msgstr "" #: ../../c-api/unicode.rst:165 msgid "" -"Read a code point from a canonical representation *data* (as obtained with :" -"c:func:`PyUnicode_DATA`). No checks or ready calls are performed." +"Read a code point from a canonical representation *data* (as obtained " +"with :c:func:`PyUnicode_DATA`). No checks or ready calls are performed." msgstr "" #: ../../c-api/unicode.rst:173 msgid "" "Read a character from a Unicode object *unicode*, which must be in the " -"\"canonical\" representation. This is less efficient than :c:func:" -"`PyUnicode_READ` if you do multiple consecutive reads." +"\"canonical\" representation. This is less efficient " +"than :c:func:`PyUnicode_READ` if you do multiple consecutive reads." msgstr "" #: ../../c-api/unicode.rst:182 @@ -210,49 +210,49 @@ msgstr "" #: ../../c-api/unicode.rst:209 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a whitespace character." -msgstr "" +msgstr "根據 *ch* 是否為空白字元來回傳 ``1`` 或 ``0``。" #: ../../c-api/unicode.rst:214 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a lowercase character." -msgstr "" +msgstr "根據 *ch* 是否為小寫字元來回傳 ``1`` 或 ``0``。" #: ../../c-api/unicode.rst:219 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is an uppercase character." -msgstr "" +msgstr "根據 *ch* 是否為大寫字元來回傳 ``1`` 或 ``0``。" #: ../../c-api/unicode.rst:224 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a titlecase character." -msgstr "" +msgstr "根據 *ch* 是否為首字大寫字元來回傳 ``1`` 或 ``0``。" #: ../../c-api/unicode.rst:229 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a linebreak character." -msgstr "" +msgstr "根據 *ch* 是否為換行字元來回傳 ``1`` 或 ``0``。" #: ../../c-api/unicode.rst:234 msgid "Return ``1`` or ``0`` depending on whether *ch* is a decimal character." -msgstr "" +msgstr "根據 *ch* 是否為十進位字元來回傳 ``1`` 或 ``0``。" #: ../../c-api/unicode.rst:239 msgid "Return ``1`` or ``0`` depending on whether *ch* is a digit character." -msgstr "" +msgstr "根據 *ch* 是否為數字 (digit) 字元來回傳 ``1`` 或 ``0``。" #: ../../c-api/unicode.rst:244 msgid "Return ``1`` or ``0`` depending on whether *ch* is a numeric character." -msgstr "" +msgstr "根據 *ch* 是否為數值 (numeric) 字元來回傳 ``1`` 或 ``0``。" #: ../../c-api/unicode.rst:249 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is an alphabetic character." -msgstr "" +msgstr "根據 *ch* 是否為字母字元來回傳 ``1`` 或 ``0``。" #: ../../c-api/unicode.rst:254 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is an alphanumeric character." -msgstr "" +msgstr "根據 *ch* 是否為字母數字 (alphanumeric) 字元來回傳 ``1`` 或 ``0``。" #: ../../c-api/unicode.rst:259 msgid "" @@ -271,49 +271,57 @@ msgstr "" #: ../../c-api/unicode.rst:273 msgid "Return the character *ch* converted to lower case." -msgstr "" +msgstr "回傳轉換為小寫的 *ch* 字元。" #: ../../c-api/unicode.rst:278 msgid "Return the character *ch* converted to upper case." -msgstr "" +msgstr "回傳轉換為大寫的 *ch* 字元。" #: ../../c-api/unicode.rst:283 msgid "Return the character *ch* converted to title case." -msgstr "" +msgstr "回傳轉換為首字大寫的 *ch* 字元。" #: ../../c-api/unicode.rst:288 msgid "" "Return the character *ch* converted to a decimal positive integer. Return " "``-1`` if this is not possible. This function does not raise exceptions." msgstr "" +"回傳轉換為十進位正整數的 *ch* 字元,若無法轉換則回傳 ``-1``。此函式不會引發例" +"外。" #: ../../c-api/unicode.rst:294 msgid "" "Return the character *ch* converted to a single digit integer. Return ``-1`` " "if this is not possible. This function does not raise exceptions." msgstr "" +"回傳轉換為單一數字整數的 *ch* 字元,若無法轉換則回傳 ``-1``。此函式不會引發例" +"外。" #: ../../c-api/unicode.rst:300 msgid "" "Return the character *ch* converted to a double. Return ``-1.0`` if this is " "not possible. This function does not raise exceptions." msgstr "" +"回傳轉換為雙精度浮點數 (double) 的 *ch* 字元,若無法轉換則回傳 ``-1.0``。此函" +"式不會引發例外。" #: ../../c-api/unicode.rst:304 msgid "These APIs can be used to work with surrogates:" -msgstr "" +msgstr "這些 API 可用於處理代理字元:" #: ../../c-api/unicode.rst:308 msgid "Check if *ch* is a surrogate (``0xD800 <= ch <= 0xDFFF``)." -msgstr "" +msgstr "檢查 *ch* 是否為代理字元 (surrogate, ``0xD800 <= ch <= 0xDFFF``)。" #: ../../c-api/unicode.rst:312 msgid "Check if *ch* is a high surrogate (``0xD800 <= ch <= 0xDBFF``)." msgstr "" +"檢查 *ch* 是否為高代理字元 (high surrogate, ``0xD800 <= ch <= 0xDBFF``)。" #: ../../c-api/unicode.rst:316 msgid "Check if *ch* is a low surrogate (``0xDC00 <= ch <= 0xDFFF``)." msgstr "" +"檢查 *ch* 是否為低代理字元 (low surrogate, ``0xDC00 <= ch <= 0xDFFF``)。" #: ../../c-api/unicode.rst:320 msgid "" @@ -352,18 +360,19 @@ msgstr "" #: ../../c-api/unicode.rst:349 msgid "" -"Create a new Unicode object with the given *kind* (possible values are :c:" -"macro:`PyUnicode_1BYTE_KIND` etc., as returned by :c:func:" -"`PyUnicode_KIND`). The *buffer* must point to an array of *size* units of " -"1, 2 or 4 bytes per character, as given by the kind." +"Create a new Unicode object with the given *kind* (possible values " +"are :c:macro:`PyUnicode_1BYTE_KIND` etc., as returned " +"by :c:func:`PyUnicode_KIND`). The *buffer* must point to an array of *size* " +"units of 1, 2 or 4 bytes per character, as given by the kind." msgstr "" #: ../../c-api/unicode.rst:354 msgid "" "If necessary, the input *buffer* is copied and transformed into the " -"canonical representation. For example, if the *buffer* is a UCS4 string (:c:" -"macro:`PyUnicode_4BYTE_KIND`) and it consists only of codepoints in the UCS1 " -"range, it will be transformed into UCS1 (:c:macro:`PyUnicode_1BYTE_KIND`)." +"canonical representation. For example, if the *buffer* is a UCS4 string " +"(:c:macro:`PyUnicode_4BYTE_KIND`) and it consists only of codepoints in the " +"UCS1 range, it will be transformed into UCS1 " +"(:c:macro:`PyUnicode_1BYTE_KIND`)." msgstr "" #: ../../c-api/unicode.rst:365 @@ -424,9 +433,9 @@ msgstr "" #: ../../c-api/unicode.rst:402 msgid "" "Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " -"actual width is given in the next argument, which must be of type :c:expr:" -"`int`, and the object to convert comes after the minimum field width and " -"optional precision." +"actual width is given in the next argument, which must be of " +"type :c:expr:`int`, and the object to convert comes after the minimum field " +"width and optional precision." msgstr "" #: ../../c-api/unicode.rst:407 @@ -562,7 +571,7 @@ msgstr "*n/a*" #: ../../c-api/unicode.rst:464 msgid "The literal ``%`` character." -msgstr "" +msgstr "字面 ``%`` 字元。" #: ../../c-api/unicode.rst:466 msgid "``d``, ``i``" @@ -576,7 +585,7 @@ msgstr "" #: ../../c-api/unicode.rst:468 msgid "The decimal representation of a signed C integer." -msgstr "" +msgstr "一個有符號 C 整數的十進位表示法。" #: ../../c-api/unicode.rst:470 msgid "``u``" @@ -584,7 +593,7 @@ msgstr "``u``" #: ../../c-api/unicode.rst:472 msgid "The decimal representation of an unsigned C integer." -msgstr "" +msgstr "一個無符號 C 整數的十進位表示法。" #: ../../c-api/unicode.rst:474 msgid "``o``" @@ -592,7 +601,7 @@ msgstr "``o``" #: ../../c-api/unicode.rst:476 msgid "The octal representation of an unsigned C integer." -msgstr "" +msgstr "一個無符號 C 整數的八進位表示法。" #: ../../c-api/unicode.rst:478 msgid "``x``" @@ -600,7 +609,7 @@ msgstr "``x``" #: ../../c-api/unicode.rst:480 msgid "The hexadecimal representation of an unsigned C integer (lowercase)." -msgstr "" +msgstr "一個無符號 C 整數的十六進位表示法(小寫)。" #: ../../c-api/unicode.rst:482 msgid "``X``" @@ -608,7 +617,7 @@ msgstr "``X``" #: ../../c-api/unicode.rst:484 msgid "The hexadecimal representation of an unsigned C integer (uppercase)." -msgstr "" +msgstr "一個無符號 C 整數的十六進位表示法(大寫)。" #: ../../c-api/unicode.rst:486 msgid "``c``" @@ -620,7 +629,7 @@ msgstr ":c:expr:`int`" #: ../../c-api/unicode.rst:488 msgid "A single character." -msgstr "" +msgstr "一個單一字元。" #: ../../c-api/unicode.rst:490 msgid "``s``" @@ -632,7 +641,7 @@ msgstr ":c:expr:`const char*` 或 :c:expr:`const wchar_t*`" #: ../../c-api/unicode.rst:492 msgid "A null-terminated C character array." -msgstr "" +msgstr "一個以 null 結尾的 C 字元陣列。" #: ../../c-api/unicode.rst:494 msgid "``p``" @@ -661,7 +670,7 @@ msgstr ":c:expr:`PyObject*`" #: ../../c-api/unicode.rst:503 msgid "The result of calling :func:`ascii`." -msgstr "" +msgstr "呼叫 :func:`ascii` 的結果。" #: ../../c-api/unicode.rst:505 msgid "``U``" @@ -669,7 +678,7 @@ msgstr "``U``" #: ../../c-api/unicode.rst:507 msgid "A Unicode object." -msgstr "一 Unicode 物件。" +msgstr "一個 Unicode 物件。" #: ../../c-api/unicode.rst:509 msgid "``V``" @@ -692,7 +701,7 @@ msgstr "``S``" #: ../../c-api/unicode.rst:517 msgid "The result of calling :c:func:`PyObject_Str`." -msgstr "" +msgstr "呼叫 :c:func:`PyObject_Str` 的結果。" #: ../../c-api/unicode.rst:519 msgid "``R``" @@ -700,7 +709,7 @@ msgstr "``R``" #: ../../c-api/unicode.rst:521 msgid "The result of calling :c:func:`PyObject_Repr`." -msgstr "" +msgstr "呼叫 :c:func:`PyObject_Repr` 的結果。" #: ../../c-api/unicode.rst:523 msgid "``T``" @@ -708,8 +717,8 @@ msgstr "``T``" #: ../../c-api/unicode.rst:525 msgid "" -"Get the fully qualified name of an object type; call :c:func:" -"`PyType_GetFullyQualifiedName`." +"Get the fully qualified name of an object type; " +"call :c:func:`PyType_GetFullyQualifiedName`." msgstr "" #: ../../c-api/unicode.rst:528 @@ -732,8 +741,8 @@ msgstr ":c:expr:`PyTypeObject*`" #: ../../c-api/unicode.rst:535 msgid "" -"Get the fully qualified name of a type; call :c:func:" -"`PyType_GetFullyQualifiedName`." +"Get the fully qualified name of a type; " +"call :c:func:`PyType_GetFullyQualifiedName`." msgstr "" #: ../../c-api/unicode.rst:538 @@ -765,17 +774,19 @@ msgstr "" #: ../../c-api/unicode.rst:556 msgid "Support for ``\"%lld\"`` and ``\"%llu\"`` added." -msgstr "" +msgstr "新增對 ``\"%lld\"`` 和 ``\"%llu\"`` 的支援。" #: ../../c-api/unicode.rst:559 msgid "Support for ``\"%li\"``, ``\"%lli\"`` and ``\"%zi\"`` added." -msgstr "" +msgstr "新增對 ``\"%li\"``、``\"%lli\"`` 和 ``\"%zi\"`` 的支援。" #: ../../c-api/unicode.rst:562 msgid "" "Support width and precision formatter for ``\"%s\"``, ``\"%A\"``, " "``\"%U\"``, ``\"%V\"``, ``\"%S\"``, ``\"%R\"`` added." msgstr "" +"新增對 ``\"%s\"``、``\"%A\"``、``\"%U\"``、``\"%V\"``、``\"%S\"``、" +"``\"%R\"`` 的寬度和精確度格式化支援。" #: ../../c-api/unicode.rst:566 msgid "" @@ -795,7 +806,7 @@ msgstr "" #: ../../c-api/unicode.rst:578 msgid "Support for ``%T``, ``%#T``, ``%N`` and ``%#N`` formats added." -msgstr "" +msgstr "新增對 ``%T``、``%#T``、``%N`` 和 ``%#N`` 格式的支援。" #: ../../c-api/unicode.rst:584 msgid "" @@ -845,7 +856,7 @@ msgstr "" #: ../../c-api/unicode.rst:619 msgid "On error, set an exception and return ``-1``." -msgstr "" +msgstr "發生錯誤時,設定例外並回傳 ``-1``。" #: ../../c-api/unicode.rst:630 msgid "" @@ -857,8 +868,8 @@ msgstr "" #: ../../c-api/unicode.rst:641 msgid "" -"Fill a string with a character: write *fill_char* into ``unicode[start:" -"start+length]``." +"Fill a string with a character: write *fill_char* into " +"``unicode[start:start+length]``." msgstr "" #: ../../c-api/unicode.rst:644 @@ -875,9 +886,9 @@ msgstr "" #: ../../c-api/unicode.rst:656 msgid "" -"Write a character to a string. The string must have been created through :c:" -"func:`PyUnicode_New`. Since Unicode strings are supposed to be immutable, " -"the string must not be shared, or have been hashed yet." +"Write a character to a string. The string must have been created " +"through :c:func:`PyUnicode_New`. Since Unicode strings are supposed to be " +"immutable, the string must not be shared, or have been hashed yet." msgstr "" #: ../../c-api/unicode.rst:660 @@ -889,18 +900,18 @@ msgstr "" #: ../../c-api/unicode.rst:664 msgid "Return ``0`` on success, ``-1`` on error with an exception set." -msgstr "" +msgstr "成功時回傳 ``0``,發生錯誤時設定例外並回傳 ``-1``。" #: ../../c-api/unicode.rst:671 msgid "" "Read a character from a string. This function checks that *unicode* is a " -"Unicode object and the index is not out of bounds, in contrast to :c:func:" -"`PyUnicode_READ_CHAR`, which performs no error checking." +"Unicode object and the index is not out of bounds, in contrast " +"to :c:func:`PyUnicode_READ_CHAR`, which performs no error checking." msgstr "" #: ../../c-api/unicode.rst:675 msgid "Return character on success, ``-1`` on error with an exception set." -msgstr "" +msgstr "成功時回傳字元,發生錯誤時設定例外並回傳 ``-1``。" #: ../../c-api/unicode.rst:683 msgid "" @@ -919,10 +930,10 @@ msgstr "" #: ../../c-api/unicode.rst:703 msgid "" -"Copy the string *unicode* into a new UCS4 buffer that is allocated using :c:" -"func:`PyMem_Malloc`. If this fails, ``NULL`` is returned with a :exc:" -"`MemoryError` set. The returned buffer always has an extra null code point " -"appended." +"Copy the string *unicode* into a new UCS4 buffer that is allocated " +"using :c:func:`PyMem_Malloc`. If this fails, ``NULL`` is returned with " +"a :exc:`MemoryError` set. The returned buffer always has an extra null code " +"point appended." msgstr "" #: ../../c-api/unicode.rst:712 @@ -946,24 +957,24 @@ msgstr "" #: ../../c-api/unicode.rst:728 msgid "" -"Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` to decode a string from the :" -"term:`filesystem encoding and error handler`." +"Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` to decode a string from " +"the :term:`filesystem encoding and error handler`." msgstr "" #: ../../c-api/unicode.rst:731 ../../c-api/unicode.rst:766 msgid "This function ignores the :ref:`Python UTF-8 Mode `." -msgstr "" +msgstr "此函式會忽略 :ref:`Python UTF-8 模式 `。" -#: ../../c-api/unicode.rst:735 ../../c-api/unicode.rst:832 +#: ../../c-api/unicode.rst:735 ../../c-api/unicode.rst:851 msgid "The :c:func:`Py_DecodeLocale` function." msgstr ":c:func:`Py_DecodeLocale` 函式。" #: ../../c-api/unicode.rst:739 msgid "" "The function now also uses the current locale encoding for the " -"``surrogateescape`` error handler, except on Android. Previously, :c:func:" -"`Py_DecodeLocale` was used for the ``surrogateescape``, and the current " -"locale encoding was used for ``strict``." +"``surrogateescape`` error handler, except on Android. " +"Previously, :c:func:`Py_DecodeLocale` was used for the ``surrogateescape``, " +"and the current locale encoding was used for ``strict``." msgstr "" #: ../../c-api/unicode.rst:748 @@ -971,37 +982,39 @@ msgid "" "Similar to :c:func:`PyUnicode_DecodeLocaleAndSize`, but compute the string " "length using :c:func:`!strlen`." msgstr "" +"類似於 :c:func:`PyUnicode_DecodeLocaleAndSize`,但使用 :c:func:`!strlen` 計算" +"字串長度。" #: ../../c-api/unicode.rst:756 msgid "" "Encode a Unicode object to UTF-8 on Android and VxWorks, or to the current " "locale encoding on other platforms. The supported error handlers are " "``\"strict\"`` and ``\"surrogateescape\"`` (:pep:`383`). The encoder uses " -"``\"strict\"`` error handler if *errors* is ``NULL``. Return a :class:" -"`bytes` object. *unicode* cannot contain embedded null characters." +"``\"strict\"`` error handler if *errors* is ``NULL``. Return " +"a :class:`bytes` object. *unicode* cannot contain embedded null characters." msgstr "" #: ../../c-api/unicode.rst:763 msgid "" -"Use :c:func:`PyUnicode_EncodeFSDefault` to encode a string to the :term:" -"`filesystem encoding and error handler`." +"Use :c:func:`PyUnicode_EncodeFSDefault` to encode a string to " +"the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/unicode.rst:770 ../../c-api/unicode.rst:863 +#: ../../c-api/unicode.rst:770 ../../c-api/unicode.rst:882 msgid "The :c:func:`Py_EncodeLocale` function." msgstr ":c:func:`Py_EncodeLocale` 函式。" #: ../../c-api/unicode.rst:774 msgid "" "The function now also uses the current locale encoding for the " -"``surrogateescape`` error handler, except on Android. Previously, :c:func:" -"`Py_EncodeLocale` was used for the ``surrogateescape``, and the current " -"locale encoding was used for ``strict``." +"``surrogateescape`` error handler, except on Android. " +"Previously, :c:func:`Py_EncodeLocale` was used for the ``surrogateescape``, " +"and the current locale encoding was used for ``strict``." msgstr "" #: ../../c-api/unicode.rst:783 msgid "File System Encoding" -msgstr "" +msgstr "檔案系統編碼" #: ../../c-api/unicode.rst:785 msgid "" @@ -1012,90 +1025,112 @@ msgstr "" #: ../../c-api/unicode.rst:788 msgid "" "To encode file names to :class:`bytes` during argument parsing, the " -"``\"O&\"`` converter should be used, passing :c:func:`PyUnicode_FSConverter` " -"as the conversion function:" +"``\"O&\"`` converter should be used, passing :c:func:`!" +"PyUnicode_FSConverter` as the conversion function:" msgstr "" #: ../../c-api/unicode.rst:794 msgid "" -"ParseTuple converter: encode :class:`str` objects -- obtained directly or " -"through the :class:`os.PathLike` interface -- to :class:`bytes` using :c:" -"func:`PyUnicode_EncodeFSDefault`; :class:`bytes` objects are output as-is. " -"*result* must be a :c:expr:`PyBytesObject*` which must be released when it " -"is no longer used." +":ref:`PyArg_Parse\\* converter `: encode :class:`str` objects " +"-- obtained directly or through the :class:`os.PathLike` interface -- " +"to :class:`bytes` using :c:func:`PyUnicode_EncodeFSDefault`; :class:`bytes` " +"objects are output as-is. *result* must be an address of a C variable of " +"type :c:expr:`PyObject*` (or :c:expr:`PyBytesObject*`). On success, set the " +"variable to a new :term:`strong reference` to a :ref:`bytes object " +"` which must be released when it is no longer used and return " +"a non-zero value (:c:macro:`Py_CLEANUP_SUPPORTED`). Embedded null bytes are " +"not allowed in the result. On failure, return ``0`` with an exception set." msgstr "" -#: ../../c-api/unicode.rst:802 ../../c-api/unicode.rst:819 -msgid "Accepts a :term:`path-like object`." +#: ../../c-api/unicode.rst:806 +msgid "" +"If *obj* is ``NULL``, the function releases a strong reference stored in the " +"variable referred by *result* and returns ``1``." msgstr "" -#: ../../c-api/unicode.rst:805 +#: ../../c-api/unicode.rst:811 ../../c-api/unicode.rst:838 +msgid "Accepts a :term:`path-like object`." +msgstr "接受一個 :term:`path-like object`。" + +#: ../../c-api/unicode.rst:814 msgid "" "To decode file names to :class:`str` during argument parsing, the ``\"O&\"`` " -"converter should be used, passing :c:func:`PyUnicode_FSDecoder` as the " +"converter should be used, passing :c:func:`!PyUnicode_FSDecoder` as the " "conversion function:" msgstr "" -#: ../../c-api/unicode.rst:811 +#: ../../c-api/unicode.rst:820 msgid "" -"ParseTuple converter: decode :class:`bytes` objects -- obtained either " -"directly or indirectly through the :class:`os.PathLike` interface -- to :" -"class:`str` using :c:func:`PyUnicode_DecodeFSDefaultAndSize`; :class:`str` " -"objects are output as-is. *result* must be a :c:expr:`PyUnicodeObject*` " -"which must be released when it is no longer used." +":ref:`PyArg_Parse\\* converter `: decode :class:`bytes` objects " +"-- obtained either directly or indirectly through the :class:`os.PathLike` " +"interface -- to :class:`str` " +"using :c:func:`PyUnicode_DecodeFSDefaultAndSize`; :class:`str` objects are " +"output as-is. *result* must be an address of a C variable of " +"type :c:expr:`PyObject*` (or :c:expr:`PyUnicodeObject*`). On success, set " +"the variable to a new :term:`strong reference` to a :ref:`Unicode object " +"` which must be released when it is no longer used and " +"return a non-zero value (:c:macro:`Py_CLEANUP_SUPPORTED`). Embedded null " +"characters are not allowed in the result. On failure, return ``0`` with an " +"exception set." msgstr "" -#: ../../c-api/unicode.rst:825 +#: ../../c-api/unicode.rst:833 +msgid "" +"If *obj* is ``NULL``, release the strong reference to the object referred to " +"by *result* and return ``1``." +msgstr "" + +#: ../../c-api/unicode.rst:844 msgid "Decode a string from the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/unicode.rst:827 +#: ../../c-api/unicode.rst:846 msgid "" -"If you need to decode a string from the current locale encoding, use :c:func:" -"`PyUnicode_DecodeLocaleAndSize`." +"If you need to decode a string from the current locale encoding, " +"use :c:func:`PyUnicode_DecodeLocaleAndSize`." msgstr "" -#: ../../c-api/unicode.rst:834 ../../c-api/unicode.rst:847 -#: ../../c-api/unicode.rst:867 +#: ../../c-api/unicode.rst:853 ../../c-api/unicode.rst:866 +#: ../../c-api/unicode.rst:886 msgid "" "The :term:`filesystem error handler ` " "is now used." msgstr "" -#: ../../c-api/unicode.rst:841 +#: ../../c-api/unicode.rst:860 msgid "" "Decode a null-terminated string from the :term:`filesystem encoding and " "error handler`." msgstr "" -#: ../../c-api/unicode.rst:844 +#: ../../c-api/unicode.rst:863 msgid "" -"If the string length is known, use :c:func:" -"`PyUnicode_DecodeFSDefaultAndSize`." -msgstr "" +"If the string length is known, " +"use :c:func:`PyUnicode_DecodeFSDefaultAndSize`." +msgstr "如果字串長度已知,請使用 :c:func:`PyUnicode_DecodeFSDefaultAndSize`。" -#: ../../c-api/unicode.rst:854 +#: ../../c-api/unicode.rst:873 msgid "" "Encode a Unicode object to the :term:`filesystem encoding and error " "handler`, and return :class:`bytes`. Note that the resulting :class:`bytes` " "object can contain null bytes." msgstr "" -#: ../../c-api/unicode.rst:858 +#: ../../c-api/unicode.rst:877 msgid "" -"If you need to encode a string to the current locale encoding, use :c:func:" -"`PyUnicode_EncodeLocale`." +"If you need to encode a string to the current locale encoding, " +"use :c:func:`PyUnicode_EncodeLocale`." msgstr "" -#: ../../c-api/unicode.rst:872 +#: ../../c-api/unicode.rst:891 msgid "wchar_t Support" msgstr "wchar_t 支援" -#: ../../c-api/unicode.rst:874 +#: ../../c-api/unicode.rst:893 msgid ":c:type:`wchar_t` support for platforms which support it:" -msgstr "" +msgstr "對支援 :c:type:`wchar_t` 的平台提供支援:" -#: ../../c-api/unicode.rst:878 +#: ../../c-api/unicode.rst:897 msgid "" "Create a Unicode object from the :c:type:`wchar_t` buffer *wstr* of the " "given *size*. Passing ``-1`` as the *size* indicates that the function must " @@ -1103,72 +1138,73 @@ msgid "" "failure." msgstr "" -#: ../../c-api/unicode.rst:886 +#: ../../c-api/unicode.rst:905 msgid "" "Copy the Unicode object contents into the :c:type:`wchar_t` buffer *wstr*. " "At most *size* :c:type:`wchar_t` characters are copied (excluding a possibly " -"trailing null termination character). Return the number of :c:type:" -"`wchar_t` characters copied or ``-1`` in case of an error." +"trailing null termination character). Return the number " +"of :c:type:`wchar_t` characters copied or ``-1`` in case of an error." msgstr "" -#: ../../c-api/unicode.rst:891 +#: ../../c-api/unicode.rst:910 msgid "" "When *wstr* is ``NULL``, instead return the *size* that would be required to " "store all of *unicode* including a terminating null." msgstr "" -#: ../../c-api/unicode.rst:894 +#: ../../c-api/unicode.rst:913 msgid "" "Note that the resulting :c:expr:`wchar_t*` string may or may not be null-" -"terminated. It is the responsibility of the caller to make sure that the :c:" -"expr:`wchar_t*` string is null-terminated in case this is required by the " -"application. Also, note that the :c:expr:`wchar_t*` string might contain " +"terminated. It is the responsibility of the caller to make sure that " +"the :c:expr:`wchar_t*` string is null-terminated in case this is required by " +"the application. Also, note that the :c:expr:`wchar_t*` string might contain " "null characters, which would cause the string to be truncated when used with " "most C functions." msgstr "" -#: ../../c-api/unicode.rst:904 +#: ../../c-api/unicode.rst:923 msgid "" "Convert the Unicode object to a wide character string. The output string " "always ends with a null character. If *size* is not ``NULL``, write the " "number of wide characters (excluding the trailing null termination " "character) into *\\*size*. Note that the resulting :c:type:`wchar_t` string " "might contain null characters, which would cause the string to be truncated " -"when used with most C functions. If *size* is ``NULL`` and the :c:expr:" -"`wchar_t*` string contains null characters a :exc:`ValueError` is raised." +"when used with most C functions. If *size* is ``NULL`` and " +"the :c:expr:`wchar_t*` string contains null characters a :exc:`ValueError` " +"is raised." msgstr "" -#: ../../c-api/unicode.rst:912 +#: ../../c-api/unicode.rst:931 msgid "" "Returns a buffer allocated by :c:macro:`PyMem_New` (use :c:func:`PyMem_Free` " "to free it) on success. On error, returns ``NULL`` and *\\*size* is " "undefined. Raises a :exc:`MemoryError` if memory allocation is failed." msgstr "" -#: ../../c-api/unicode.rst:919 +#: ../../c-api/unicode.rst:938 msgid "" "Raises a :exc:`ValueError` if *size* is ``NULL`` and the :c:expr:`wchar_t*` " "string contains null characters." msgstr "" -#: ../../c-api/unicode.rst:927 +#: ../../c-api/unicode.rst:946 msgid "Built-in Codecs" -msgstr "" +msgstr "內建編解碼器" -#: ../../c-api/unicode.rst:929 +#: ../../c-api/unicode.rst:948 msgid "" "Python provides a set of built-in codecs which are written in C for speed. " "All of these codecs are directly usable via the following functions." msgstr "" -#: ../../c-api/unicode.rst:932 +#: ../../c-api/unicode.rst:951 msgid "" "Many of the following APIs take two arguments encoding and errors, and they " "have the same semantics as the ones of the built-in :func:`str` string " "object constructor." msgstr "" -#: ../../c-api/unicode.rst:936 +#: ../../c-api/unicode.rst:955 msgid "" "Setting encoding to ``NULL`` causes the default encoding to be used which is " "UTF-8. The file system calls should use :c:func:`PyUnicode_FSConverter` for " @@ -1176,28 +1212,28 @@ msgid "" "handler` internally." msgstr "" -#: ../../c-api/unicode.rst:941 +#: ../../c-api/unicode.rst:960 msgid "" "Error handling is set by errors which may also be set to ``NULL`` meaning to " "use the default handling defined for the codec. Default error handling for " "all built-in codecs is \"strict\" (:exc:`ValueError` is raised)." msgstr "" -#: ../../c-api/unicode.rst:945 +#: ../../c-api/unicode.rst:964 msgid "" "The codecs all use a similar interface. Only deviations from the following " "generic ones are documented for simplicity." msgstr "" -#: ../../c-api/unicode.rst:950 +#: ../../c-api/unicode.rst:969 msgid "Generic Codecs" -msgstr "" +msgstr "泛用編解碼器" -#: ../../c-api/unicode.rst:952 +#: ../../c-api/unicode.rst:971 msgid "These are the generic codec APIs:" -msgstr "" +msgstr "這些是泛用編解碼器的 API:" -#: ../../c-api/unicode.rst:958 +#: ../../c-api/unicode.rst:977 msgid "" "Create a Unicode object by decoding *size* bytes of the encoded string " "*str*. *encoding* and *errors* have the same meaning as the parameters of " @@ -1206,7 +1242,7 @@ msgid "" "was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:968 +#: ../../c-api/unicode.rst:987 msgid "" "Encode a Unicode object and return the result as Python bytes object. " "*encoding* and *errors* have the same meaning as the parameters of the same " @@ -1215,21 +1251,21 @@ msgid "" "was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:976 +#: ../../c-api/unicode.rst:995 msgid "UTF-8 Codecs" msgstr "UTF-8 編解碼器" -#: ../../c-api/unicode.rst:978 +#: ../../c-api/unicode.rst:997 msgid "These are the UTF-8 codec APIs:" -msgstr "" +msgstr "這些是 UTF-8 編解碼器的 API:" -#: ../../c-api/unicode.rst:983 +#: ../../c-api/unicode.rst:1002 msgid "" "Create a Unicode object by decoding *size* bytes of the UTF-8 encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:990 +#: ../../c-api/unicode.rst:1009 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF8`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-8 byte sequences will " @@ -1237,20 +1273,20 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:998 +#: ../../c-api/unicode.rst:1017 msgid "" "Encode a Unicode object using UTF-8 and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1002 ../../c-api/unicode.rst:1017 +#: ../../c-api/unicode.rst:1021 ../../c-api/unicode.rst:1036 msgid "" "The function fails if the string contains surrogate code points (``U+D800`` " "- ``U+DFFF``)." msgstr "" -#: ../../c-api/unicode.rst:1008 +#: ../../c-api/unicode.rst:1027 msgid "" "Return a pointer to the UTF-8 encoding of the Unicode object, and store the " "size of the encoded representation (in bytes) in *size*. The *size* " @@ -1259,13 +1295,15 @@ msgid "" "regardless of whether there are any other null code points." msgstr "" -#: ../../c-api/unicode.rst:1014 +#: ../../c-api/unicode.rst:1033 msgid "" "On error, set an exception, set *size* to ``-1`` (if it's not NULL) and " "return ``NULL``." msgstr "" +"發生錯誤時,設定例外並將 *size* 設為 ``-1``\\ (如果不是 NULL),並回傳 " +"``NULL``。" -#: ../../c-api/unicode.rst:1020 +#: ../../c-api/unicode.rst:1039 msgid "" "This caches the UTF-8 representation of the string in the Unicode object, " "and subsequent calls will return a pointer to the same buffer. The caller " @@ -1274,47 +1312,57 @@ msgid "" "collected." msgstr "" -#: ../../c-api/unicode.rst:1027 ../../c-api/unicode.rst:1040 +#: ../../c-api/unicode.rst:1046 ../../c-api/unicode.rst:1068 msgid "The return type is now ``const char *`` rather of ``char *``." -msgstr "" +msgstr "回傳型別現在是 ``const char *`` 而不是 ``char *``。" -#: ../../c-api/unicode.rst:1030 +#: ../../c-api/unicode.rst:1049 msgid "This function is a part of the :ref:`limited API `." msgstr "" -#: ../../c-api/unicode.rst:1036 +#: ../../c-api/unicode.rst:1055 msgid "As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size." +msgstr "與 :c:func:`PyUnicode_AsUTF8AndSize` 類似,但不儲存大小。" + +#: ../../c-api/unicode.rst:1059 +msgid "" +"This function does not have any special behavior for `null characters " +"`_ embedded within *unicode*. " +"As a result, strings containing null characters will remain in the returned " +"string, which some C functions might interpret as the end of the string, " +"leading to truncation. If truncation is an issue, it is recommended to " +"use :c:func:`PyUnicode_AsUTF8AndSize` instead." msgstr "" -#: ../../c-api/unicode.rst:1045 +#: ../../c-api/unicode.rst:1073 msgid "UTF-32 Codecs" msgstr "UTF-32 編解碼器" -#: ../../c-api/unicode.rst:1047 +#: ../../c-api/unicode.rst:1075 msgid "These are the UTF-32 codec APIs:" -msgstr "" +msgstr "這些是 UTF-32 編解碼器的 API:" -#: ../../c-api/unicode.rst:1053 +#: ../../c-api/unicode.rst:1081 msgid "" "Decode *size* bytes from a UTF-32 encoded buffer string and return the " "corresponding Unicode object. *errors* (if non-``NULL``) defines the error " "handling. It defaults to \"strict\"." msgstr "" -#: ../../c-api/unicode.rst:1057 ../../c-api/unicode.rst:1107 +#: ../../c-api/unicode.rst:1085 ../../c-api/unicode.rst:1135 msgid "" "If *byteorder* is non-``NULL``, the decoder starts decoding using the given " "byte order::" msgstr "" -#: ../../c-api/unicode.rst:1060 ../../c-api/unicode.rst:1110 +#: ../../c-api/unicode.rst:1088 ../../c-api/unicode.rst:1138 msgid "" "*byteorder == -1: little endian\n" "*byteorder == 0: native order\n" "*byteorder == 1: big endian" msgstr "" -#: ../../c-api/unicode.rst:1064 +#: ../../c-api/unicode.rst:1092 msgid "" "If ``*byteorder`` is zero, and the first four bytes of the input data are a " "byte order mark (BOM), the decoder switches to this byte order and the BOM " @@ -1322,21 +1370,21 @@ msgid "" "``-1`` or ``1``, any byte order mark is copied to the output." msgstr "" -#: ../../c-api/unicode.rst:1069 +#: ../../c-api/unicode.rst:1097 msgid "" "After completion, *\\*byteorder* is set to the current byte order at the end " "of input data." msgstr "" -#: ../../c-api/unicode.rst:1072 ../../c-api/unicode.rst:1123 +#: ../../c-api/unicode.rst:1100 ../../c-api/unicode.rst:1151 msgid "If *byteorder* is ``NULL``, the codec starts in native order mode." msgstr "" -#: ../../c-api/unicode.rst:1074 ../../c-api/unicode.rst:1125 +#: ../../c-api/unicode.rst:1102 ../../c-api/unicode.rst:1153 msgid "Return ``NULL`` if an exception was raised by the codec." -msgstr "" +msgstr "如果編解碼器引發例外則回傳 ``NULL``。" -#: ../../c-api/unicode.rst:1080 +#: ../../c-api/unicode.rst:1108 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF32`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF32Stateful` will not " @@ -1345,29 +1393,29 @@ msgid "" "number of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1089 +#: ../../c-api/unicode.rst:1117 msgid "" "Return a Python byte string using the UTF-32 encoding in native byte order. " "The string always starts with a BOM mark. Error handling is \"strict\". " "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1095 +#: ../../c-api/unicode.rst:1123 msgid "UTF-16 Codecs" msgstr "UTF-16 編解碼器" -#: ../../c-api/unicode.rst:1097 +#: ../../c-api/unicode.rst:1125 msgid "These are the UTF-16 codec APIs:" -msgstr "" +msgstr "這些是 UTF-16 編解碼器的 API:" -#: ../../c-api/unicode.rst:1103 +#: ../../c-api/unicode.rst:1131 msgid "" "Decode *size* bytes from a UTF-16 encoded buffer string and return the " "corresponding Unicode object. *errors* (if non-``NULL``) defines the error " "handling. It defaults to \"strict\"." msgstr "" -#: ../../c-api/unicode.rst:1114 +#: ../../c-api/unicode.rst:1142 msgid "" "If ``*byteorder`` is zero, and the first two bytes of the input data are a " "byte order mark (BOM), the decoder switches to this byte order and the BOM " @@ -1376,13 +1424,13 @@ msgid "" "result in either a ``\\ufeff`` or a ``\\ufffe`` character)." msgstr "" -#: ../../c-api/unicode.rst:1120 +#: ../../c-api/unicode.rst:1148 msgid "" "After completion, ``*byteorder`` is set to the current byte order at the end " "of input data." msgstr "" -#: ../../c-api/unicode.rst:1131 +#: ../../c-api/unicode.rst:1159 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF16`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF16Stateful` will not " @@ -1392,28 +1440,28 @@ msgid "" "*consumed*." msgstr "" -#: ../../c-api/unicode.rst:1140 +#: ../../c-api/unicode.rst:1168 msgid "" "Return a Python byte string using the UTF-16 encoding in native byte order. " "The string always starts with a BOM mark. Error handling is \"strict\". " "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1146 +#: ../../c-api/unicode.rst:1174 msgid "UTF-7 Codecs" msgstr "UTF-7 編解碼器" -#: ../../c-api/unicode.rst:1148 +#: ../../c-api/unicode.rst:1176 msgid "These are the UTF-7 codec APIs:" -msgstr "" +msgstr "這些是 UTF-7 編解碼器的 API:" -#: ../../c-api/unicode.rst:1153 +#: ../../c-api/unicode.rst:1181 msgid "" "Create a Unicode object by decoding *size* bytes of the UTF-7 encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1160 +#: ../../c-api/unicode.rst:1188 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF7`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-7 base-64 sections will " @@ -1421,101 +1469,101 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1167 +#: ../../c-api/unicode.rst:1195 msgid "Unicode-Escape Codecs" msgstr "" -#: ../../c-api/unicode.rst:1169 +#: ../../c-api/unicode.rst:1197 msgid "These are the \"Unicode Escape\" codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1175 +#: ../../c-api/unicode.rst:1203 msgid "" "Create a Unicode object by decoding *size* bytes of the Unicode-Escape " "encoded string *str*. Return ``NULL`` if an exception was raised by the " "codec." msgstr "" -#: ../../c-api/unicode.rst:1181 +#: ../../c-api/unicode.rst:1209 msgid "" "Encode a Unicode object using Unicode-Escape and return the result as a " "bytes object. Error handling is \"strict\". Return ``NULL`` if an " "exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1187 +#: ../../c-api/unicode.rst:1215 msgid "Raw-Unicode-Escape Codecs" msgstr "" -#: ../../c-api/unicode.rst:1189 +#: ../../c-api/unicode.rst:1217 msgid "These are the \"Raw Unicode Escape\" codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1195 +#: ../../c-api/unicode.rst:1223 msgid "" "Create a Unicode object by decoding *size* bytes of the Raw-Unicode-Escape " "encoded string *str*. Return ``NULL`` if an exception was raised by the " "codec." msgstr "" -#: ../../c-api/unicode.rst:1201 +#: ../../c-api/unicode.rst:1229 msgid "" "Encode a Unicode object using Raw-Unicode-Escape and return the result as a " "bytes object. Error handling is \"strict\". Return ``NULL`` if an " "exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1207 +#: ../../c-api/unicode.rst:1235 msgid "Latin-1 Codecs" msgstr "Latin-1 編解碼器" -#: ../../c-api/unicode.rst:1209 +#: ../../c-api/unicode.rst:1237 msgid "" "These are the Latin-1 codec APIs: Latin-1 corresponds to the first 256 " "Unicode ordinals and only these are accepted by the codecs during encoding." msgstr "" -#: ../../c-api/unicode.rst:1215 +#: ../../c-api/unicode.rst:1243 msgid "" "Create a Unicode object by decoding *size* bytes of the Latin-1 encoded " "string *str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1221 +#: ../../c-api/unicode.rst:1249 msgid "" "Encode a Unicode object using Latin-1 and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1227 +#: ../../c-api/unicode.rst:1255 msgid "ASCII Codecs" msgstr "ASCII 編解碼器" -#: ../../c-api/unicode.rst:1229 +#: ../../c-api/unicode.rst:1257 msgid "" "These are the ASCII codec APIs. Only 7-bit ASCII data is accepted. All " "other codes generate errors." msgstr "" -#: ../../c-api/unicode.rst:1235 +#: ../../c-api/unicode.rst:1263 msgid "" "Create a Unicode object by decoding *size* bytes of the ASCII encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1241 +#: ../../c-api/unicode.rst:1269 msgid "" "Encode a Unicode object using ASCII and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1247 +#: ../../c-api/unicode.rst:1275 msgid "Character Map Codecs" msgstr "" -#: ../../c-api/unicode.rst:1249 +#: ../../c-api/unicode.rst:1277 msgid "" "This codec is special in that it can be used to implement many different " "codecs (and this is in fact what was done to obtain most of the standard " @@ -1525,18 +1573,18 @@ msgid "" "sequences work well." msgstr "" -#: ../../c-api/unicode.rst:1255 +#: ../../c-api/unicode.rst:1283 msgid "These are the mapping codec APIs:" -msgstr "" +msgstr "這些是對映編解碼器的 API:" -#: ../../c-api/unicode.rst:1260 +#: ../../c-api/unicode.rst:1288 msgid "" "Create a Unicode object by decoding *size* bytes of the encoded string *str* " "using the given *mapping* object. Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1264 +#: ../../c-api/unicode.rst:1292 msgid "" "If *mapping* is ``NULL``, Latin-1 decoding will be applied. Else *mapping* " "must map bytes ordinals (integers in the range from 0 to 255) to Unicode " @@ -1546,14 +1594,14 @@ msgid "" "treated as undefined mappings and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1275 +#: ../../c-api/unicode.rst:1303 msgid "" "Encode a Unicode object using the given *mapping* object and return the " "result as a bytes object. Error handling is \"strict\". Return ``NULL`` if " "an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1279 +#: ../../c-api/unicode.rst:1307 msgid "" "The *mapping* object must map Unicode ordinal integers to bytes objects, " "integers in the range from 0 to 255 or ``None``. Unmapped character " @@ -1561,41 +1609,41 @@ msgid "" "``None`` are treated as \"undefined mapping\" and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1285 +#: ../../c-api/unicode.rst:1313 msgid "The following codec API is special in that maps Unicode to Unicode." msgstr "" -#: ../../c-api/unicode.rst:1289 +#: ../../c-api/unicode.rst:1317 msgid "" "Translate a string by applying a character mapping table to it and return " "the resulting Unicode object. Return ``NULL`` if an exception was raised by " "the codec." msgstr "" -#: ../../c-api/unicode.rst:1293 +#: ../../c-api/unicode.rst:1321 msgid "" "The mapping table must map Unicode ordinal integers to Unicode ordinal " "integers or ``None`` (causing deletion of the character)." msgstr "" -#: ../../c-api/unicode.rst:1296 +#: ../../c-api/unicode.rst:1324 msgid "" "Mapping tables need only provide the :meth:`~object.__getitem__` interface; " "dictionaries and sequences work well. Unmapped character ordinals (ones " "which cause a :exc:`LookupError`) are left untouched and are copied as-is." msgstr "" -#: ../../c-api/unicode.rst:1300 +#: ../../c-api/unicode.rst:1328 msgid "" "*errors* has the usual meaning for codecs. It may be ``NULL`` which " "indicates to use the default error handling." msgstr "" -#: ../../c-api/unicode.rst:1305 +#: ../../c-api/unicode.rst:1333 msgid "MBCS codecs for Windows" -msgstr "" +msgstr "Windows 的 MBCS 編解碼器" -#: ../../c-api/unicode.rst:1307 +#: ../../c-api/unicode.rst:1335 msgid "" "These are the MBCS codec APIs. They are currently only available on Windows " "and use the Win32 MBCS converters to implement the conversions. Note that " @@ -1603,13 +1651,13 @@ msgid "" "is defined by the user settings on the machine running the codec." msgstr "" -#: ../../c-api/unicode.rst:1314 +#: ../../c-api/unicode.rst:1342 msgid "" "Create a Unicode object by decoding *size* bytes of the MBCS encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1321 +#: ../../c-api/unicode.rst:1349 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeMBCS`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeMBCSStateful` will not " @@ -1617,44 +1665,44 @@ msgid "" "will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1329 +#: ../../c-api/unicode.rst:1357 msgid "" "Encode a Unicode object using MBCS and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1336 +#: ../../c-api/unicode.rst:1364 msgid "" "Encode the Unicode object using the specified code page and return a Python " -"bytes object. Return ``NULL`` if an exception was raised by the codec. Use :" -"c:macro:`!CP_ACP` code page to get the MBCS encoder." +"bytes object. Return ``NULL`` if an exception was raised by the codec. " +"Use :c:macro:`!CP_ACP` code page to get the MBCS encoder." msgstr "" -#: ../../c-api/unicode.rst:1344 +#: ../../c-api/unicode.rst:1372 msgid "Methods & Slots" msgstr "" -#: ../../c-api/unicode.rst:1350 +#: ../../c-api/unicode.rst:1378 msgid "Methods and Slot Functions" msgstr "" -#: ../../c-api/unicode.rst:1352 +#: ../../c-api/unicode.rst:1380 msgid "" "The following APIs are capable of handling Unicode objects and strings on " "input (we refer to them as strings in the descriptions) and return Unicode " "objects or integers as appropriate." msgstr "" -#: ../../c-api/unicode.rst:1356 +#: ../../c-api/unicode.rst:1384 msgid "They all return ``NULL`` or ``-1`` if an exception occurs." msgstr "" -#: ../../c-api/unicode.rst:1361 +#: ../../c-api/unicode.rst:1389 msgid "Concat two strings giving a new Unicode string." msgstr "" -#: ../../c-api/unicode.rst:1366 +#: ../../c-api/unicode.rst:1394 msgid "" "Split a string giving a list of Unicode strings. If *sep* is ``NULL``, " "splitting will be done at all whitespace substrings. Otherwise, splits " @@ -1663,27 +1711,27 @@ msgid "" "list." msgstr "" -#: ../../c-api/unicode.rst:1374 +#: ../../c-api/unicode.rst:1402 msgid "" "Split a Unicode string at line breaks, returning a list of Unicode strings. " "CRLF is considered to be one line break. If *keepends* is ``0``, the Line " "break characters are not included in the resulting strings." msgstr "" -#: ../../c-api/unicode.rst:1381 +#: ../../c-api/unicode.rst:1409 msgid "" "Join a sequence of strings using the given *separator* and return the " "resulting Unicode string." msgstr "" -#: ../../c-api/unicode.rst:1388 +#: ../../c-api/unicode.rst:1416 msgid "" "Return ``1`` if *substr* matches ``unicode[start:end]`` at the given tail " "end (*direction* == ``-1`` means to do a prefix match, *direction* == ``1`` " "a suffix match), ``0`` otherwise. Return ``-1`` if an error occurred." msgstr "" -#: ../../c-api/unicode.rst:1396 +#: ../../c-api/unicode.rst:1424 msgid "" "Return the first position of *substr* in ``unicode[start:end]`` using the " "given *direction* (*direction* == ``1`` means to do a forward search, " @@ -1692,7 +1740,7 @@ msgid "" "``-2`` indicates that an error occurred and an exception has been set." msgstr "" -#: ../../c-api/unicode.rst:1406 +#: ../../c-api/unicode.rst:1434 msgid "" "Return the first position of the character *ch* in ``unicode[start:end]`` " "using the given *direction* (*direction* == ``1`` means to do a forward " @@ -1702,37 +1750,37 @@ msgid "" "set." msgstr "" -#: ../../c-api/unicode.rst:1414 +#: ../../c-api/unicode.rst:1442 msgid "" "*start* and *end* are now adjusted to behave like ``unicode[start:end]``." msgstr "" -#: ../../c-api/unicode.rst:1421 +#: ../../c-api/unicode.rst:1449 msgid "" "Return the number of non-overlapping occurrences of *substr* in " "``unicode[start:end]``. Return ``-1`` if an error occurred." msgstr "" -#: ../../c-api/unicode.rst:1428 +#: ../../c-api/unicode.rst:1456 msgid "" "Replace at most *maxcount* occurrences of *substr* in *unicode* with " "*replstr* and return the resulting Unicode object. *maxcount* == ``-1`` " "means replace all occurrences." msgstr "" -#: ../../c-api/unicode.rst:1435 +#: ../../c-api/unicode.rst:1463 msgid "" "Compare two strings and return ``-1``, ``0``, ``1`` for less than, equal, " "and greater than, respectively." msgstr "" -#: ../../c-api/unicode.rst:1438 +#: ../../c-api/unicode.rst:1466 msgid "" -"This function returns ``-1`` upon failure, so one should call :c:func:" -"`PyErr_Occurred` to check for errors." +"This function returns ``-1`` upon failure, so one should " +"call :c:func:`PyErr_Occurred` to check for errors." msgstr "" -#: ../../c-api/unicode.rst:1444 +#: ../../c-api/unicode.rst:1472 msgid "" "Compare a Unicode object with a char buffer which is interpreted as being " "UTF-8 or ASCII encoded and return true (``1``) if they are equal, or false " @@ -1741,18 +1789,18 @@ msgid "" "is returned." msgstr "" -#: ../../c-api/unicode.rst:1451 ../../c-api/unicode.rst:1472 +#: ../../c-api/unicode.rst:1479 ../../c-api/unicode.rst:1500 msgid "This function does not raise exceptions." -msgstr "" +msgstr "此函式不會引發例外。" -#: ../../c-api/unicode.rst:1458 +#: ../../c-api/unicode.rst:1486 msgid "" "Similar to :c:func:`PyUnicode_EqualToUTF8AndSize`, but compute *string* " "length using :c:func:`!strlen`. If the Unicode object contains null " "characters, false (``0``) is returned." msgstr "" -#: ../../c-api/unicode.rst:1467 +#: ../../c-api/unicode.rst:1495 msgid "" "Compare a Unicode object, *unicode*, with *string* and return ``-1``, ``0``, " "``1`` for less than, equal, and greater than, respectively. It is best to " @@ -1760,58 +1808,59 @@ msgid "" "string as ISO-8859-1 if it contains non-ASCII characters." msgstr "" -#: ../../c-api/unicode.rst:1477 +#: ../../c-api/unicode.rst:1505 msgid "Rich compare two Unicode strings and return one of the following:" msgstr "" -#: ../../c-api/unicode.rst:1479 +#: ../../c-api/unicode.rst:1507 msgid "``NULL`` in case an exception was raised" msgstr "" -#: ../../c-api/unicode.rst:1480 +#: ../../c-api/unicode.rst:1508 msgid ":c:data:`Py_True` or :c:data:`Py_False` for successful comparisons" msgstr "" -#: ../../c-api/unicode.rst:1481 +#: ../../c-api/unicode.rst:1509 msgid ":c:data:`Py_NotImplemented` in case the type combination is unknown" msgstr "" -#: ../../c-api/unicode.rst:1483 +#: ../../c-api/unicode.rst:1511 msgid "" -"Possible values for *op* are :c:macro:`Py_GT`, :c:macro:`Py_GE`, :c:macro:" -"`Py_EQ`, :c:macro:`Py_NE`, :c:macro:`Py_LT`, and :c:macro:`Py_LE`." +"Possible values for *op* " +"are :c:macro:`Py_GT`, :c:macro:`Py_GE`, :c:macro:`Py_EQ`, :c:macro:`Py_NE`, :c:macro:`Py_LT`, " +"and :c:macro:`Py_LE`." msgstr "" -#: ../../c-api/unicode.rst:1489 +#: ../../c-api/unicode.rst:1517 msgid "" "Return a new string object from *format* and *args*; this is analogous to " "``format % args``." msgstr "" -#: ../../c-api/unicode.rst:1495 +#: ../../c-api/unicode.rst:1523 msgid "" "Check whether *substr* is contained in *unicode* and return true or false " "accordingly." msgstr "" -#: ../../c-api/unicode.rst:1498 +#: ../../c-api/unicode.rst:1526 msgid "" "*substr* has to coerce to a one element Unicode string. ``-1`` is returned " "if there was an error." msgstr "" -#: ../../c-api/unicode.rst:1504 +#: ../../c-api/unicode.rst:1532 msgid "" "Intern the argument :c:expr:`*p_unicode` in place. The argument must be the " "address of a pointer variable pointing to a Python Unicode string object. " -"If there is an existing interned string that is the same as :c:expr:" -"`*p_unicode`, it sets :c:expr:`*p_unicode` to it (releasing the reference to " -"the old string object and creating a new :term:`strong reference` to the " -"interned string object), otherwise it leaves :c:expr:`*p_unicode` alone and " -"interns it." +"If there is an existing interned string that is the same " +"as :c:expr:`*p_unicode`, it sets :c:expr:`*p_unicode` to it (releasing the " +"reference to the old string object and creating a new :term:`strong " +"reference` to the interned string object), otherwise it " +"leaves :c:expr:`*p_unicode` alone and interns it." msgstr "" -#: ../../c-api/unicode.rst:1511 +#: ../../c-api/unicode.rst:1539 msgid "" "(Clarification: even though there is a lot of talk about references, think " "of this function as reference-neutral. You must own the object you pass in; " @@ -1819,47 +1868,48 @@ msgid "" "the result.)" msgstr "" -#: ../../c-api/unicode.rst:1516 +#: ../../c-api/unicode.rst:1544 msgid "" "This function never raises an exception. On error, it leaves its argument " "unchanged without interning it." msgstr "" -#: ../../c-api/unicode.rst:1519 +#: ../../c-api/unicode.rst:1547 msgid "" -"Instances of subclasses of :py:class:`str` may not be interned, that is, :c:" -"expr:`PyUnicode_CheckExact(*p_unicode)` must be true. If it is not, then -- " -"as with any other error -- the argument is left unchanged." +"Instances of subclasses of :py:class:`str` may not be interned, that " +"is, :c:expr:`PyUnicode_CheckExact(*p_unicode)` must be true. If it is not, " +"then -- as with any other error -- the argument is left unchanged." msgstr "" -#: ../../c-api/unicode.rst:1523 +#: ../../c-api/unicode.rst:1551 msgid "" "Note that interned strings are not “immortal”. You must keep a reference to " "the result to benefit from interning." msgstr "" -#: ../../c-api/unicode.rst:1529 +#: ../../c-api/unicode.rst:1557 msgid "" -"A combination of :c:func:`PyUnicode_FromString` and :c:func:" -"`PyUnicode_InternInPlace`, meant for statically allocated strings." +"A combination of :c:func:`PyUnicode_FromString` " +"and :c:func:`PyUnicode_InternInPlace`, meant for statically allocated " +"strings." msgstr "" -#: ../../c-api/unicode.rst:1532 +#: ../../c-api/unicode.rst:1560 msgid "" "Return a new (\"owned\") reference to either a new Unicode string object " "that has been interned, or an earlier interned string object with the same " "value." msgstr "" -#: ../../c-api/unicode.rst:1536 +#: ../../c-api/unicode.rst:1564 msgid "" "Python may keep a reference to the result, or make it :term:`immortal`, " "preventing it from being garbage-collected promptly. For interning an " "unbounded number of different strings, such as ones coming from user input, " -"prefer calling :c:func:`PyUnicode_FromString` and :c:func:" -"`PyUnicode_InternInPlace` directly." +"prefer calling :c:func:`PyUnicode_FromString` " +"and :c:func:`PyUnicode_InternInPlace` directly." msgstr "" -#: ../../c-api/unicode.rst:1544 +#: ../../c-api/unicode.rst:1572 msgid "Strings interned this way are made :term:`immortal`." msgstr "" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 468bb4f7bf..80cabb8b50 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-09 00:13+0000\n" +"POT-Creation-Date: 2025-01-22 00:13+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -390,7 +390,17 @@ msgstr "" msgid "Added *cf_feature_version* field." msgstr "新增 *cf_feature_version* 欄位。" -#: ../../c-api/veryhigh.rst:354 +#: ../../c-api/veryhigh.rst:351 +msgid "The available compiler flags are accessible as macros:" +msgstr "" + +#: ../../c-api/veryhigh.rst:360 +msgid "" +"See :ref:`compiler flags ` in documentation of the :py:" +"mod:`!ast` Python module, which exports these constants under the same names." +msgstr "" + +#: ../../c-api/veryhigh.rst:366 msgid "" "This bit can be set in *flags* to cause division operator ``/`` to be " "interpreted as \"true division\" according to :pep:`238`." diff --git a/faq/programming.po b/faq/programming.po index 1d9f44ebb3..f2df420db1 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2025-01-19 00:15+0000\n" "PO-Revision-Date: 2024-04-25 14:17+0800\n" "Last-Translator: KNChiu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -45,8 +45,8 @@ msgstr "有的。" #: ../../faq/programming.rst:19 msgid "" -"Several debuggers for Python are described below, and the built-in function :" -"func:`breakpoint` allows you to drop into any of them." +"Several debuggers for Python are described below, and the built-in " +"function :func:`breakpoint` allows you to drop into any of them." msgstr "" "下面描述了幾個 Python 除錯器,內建函式 :func:`breakpoint` 允許你進入其中任何" "一個。" @@ -296,7 +296,7 @@ msgstr "" msgid "" "In the example above you can access the outer scope variable by declaring it " "global:" -msgstr "在上面的示例中,你可以透過將其聲明為全域變數來存取外部範圍變數:" +msgstr "在上面的範例中,你可以透過將其聲明為全域變數來存取外部範圍變數:" #: ../../faq/programming.rst:167 #, fuzzy @@ -309,11 +309,10 @@ msgstr "" "在外部範圍內修改變數的值:" #: ../../faq/programming.rst:174 -#, fuzzy msgid "" "You can do a similar thing in a nested scope using the :keyword:`nonlocal` " "keyword:" -msgstr "你可以使用 :keyword:`nonlocal` 關鍵字在嵌套範圍內做類似的事情:" +msgstr "你可以使用 :keyword:`nonlocal` 關鍵字在巢狀作用域內做類似的事情:" #: ../../faq/programming.rst:192 msgid "What are the rules for local and global variables in Python?" @@ -341,17 +340,17 @@ msgid "" "a component of an imported module. This clutter would defeat the usefulness " "of the ``global`` declaration for identifying side-effects." msgstr "" -"雖然起初有點令人驚訝,但稍加考慮就可以解釋這一點。一方面,要求 :keyword:" -"`global` 分配的變數可以防止意外的副作用。另一方面,如果所有全域參照都需要 " -"``global``,那麼你將一直使用 ``global``。你必須將對內建函式或引入模組的組件的" -"每個參照聲明為全域。這種混亂會破壞用於識別副作用的 ``global`` 聲明的有用性。" +"雖然起初有點令人驚訝,但稍加考慮就可以解釋這一點。一方面,要" +"求 :keyword:`global` 分配的變數可以防止意外的副作用。另一方面,如果所有全域參" +"照都需要 ``global``,那麼你將一直使用 ``global``。你必須將對內建函式或引入模" +"組的組件的每個參照聲明為全域。這種混亂會破壞用於識別副作用的 ``global`` 聲明" +"的有用性。" #: ../../faq/programming.rst:208 -#, fuzzy msgid "" "Why do lambdas defined in a loop with different values all return the same " "result?" -msgstr "為什麼在具有不同值的迴圈中定義的 lambda 都回傳相同的結果?" +msgstr "為什麼以不同的值在迴圈中定義的 lambda 都回傳相同的結果?" #: ../../faq/programming.rst:210 msgid "" @@ -371,16 +370,15 @@ msgstr "" "... squares.append(lambda: x**2)" #: ../../faq/programming.rst:217 -#, fuzzy msgid "" "This gives you a list that contains 5 lambdas that calculate ``x**2``. You " "might expect that, when called, they would return, respectively, ``0``, " "``1``, ``4``, ``9``, and ``16``. However, when you actually try you will " "see that they all return ``16``::" msgstr "" -"這為你提供了一個包含 5 個計算 ``x**2`` 的 lambda 的list。你可能期望,當被呼叫" -"時,它們會分別回傳 ``0``、``1``、``4``、``9`` 和 ``16``。然而,當你實際嘗試" -"時,你會發現它們都回傳 ``16``: ::" +"這會提供一個包含五個計算 ``x**2`` 的 lambda 串列。你可能會預期在呼叫它時,它" +"們會分別回傳 ``0``、``1``、``4``、``9`` 和 ``16``,然而當你實際嘗試你會發現它" +"們都回傳 ``16``: ::" #: ../../faq/programming.rst:222 msgid "" @@ -395,7 +393,6 @@ msgstr "" "16" #: ../../faq/programming.rst:227 -#, fuzzy msgid "" "This happens because ``x`` is not local to the lambdas, but is defined in " "the outer scope, and it is accessed when the lambda is called --- not when " @@ -403,9 +400,9 @@ msgid "" "the functions now return ``4**2``, i.e. ``16``. You can also verify this by " "changing the value of ``x`` and see how the results of the lambdas change::" msgstr "" -"發生這種情況是因為 ``x`` 不是 lambda 的局部變數,而是在外部作用域中定義的,並" -"且在呼叫 lambda 時存取它——而不是在定義時存取它。在迴圈結束時,``x`` 的值為 " -"``4``,因此所有函式現在都回傳 ``4**2``,即 ``16``。你還可以透過更改 ``x`` 的" +"發生這種情況是因為 ``x`` 不是 lambda 的局部變數,而是在外部作用域中定義的,且" +"是在呼叫 lambda 時才會存取它,並非於定義時就會存取。在迴圈結束時,``x`` 的值" +"為 ``4``,因此所有函式都回傳 ``4**2``,即為 ``16``。你還可以透過更改 ``x`` 的" "值來驗證這一點,並查看 lambda 運算式的結果如何變化: ::" #: ../../faq/programming.rst:233 @@ -419,7 +416,6 @@ msgstr "" "64" #: ../../faq/programming.rst:237 -#, fuzzy msgid "" "In order to avoid this, you need to save the values in variables local to " "the lambdas, so that they don't rely on the value of the global ``x``::" @@ -494,7 +490,7 @@ msgstr "config.py: ::" #: ../../faq/programming.rst:270 msgid "x = 0 # Default value of the 'x' configuration setting" -msgstr "" +msgstr "x = 0 # 'x' 配置設定的預設值" #: ../../faq/programming.rst:272 msgid "mod.py::" @@ -523,16 +519,14 @@ msgstr "" "print(config.x)" #: ../../faq/programming.rst:283 -#, fuzzy msgid "" "Note that using a module is also the basis for implementing the singleton " "design pattern, for the same reason." msgstr "請注意,出於同樣的原因,使用模組也是實作單例設計模式的基礎。" #: ../../faq/programming.rst:288 -#, fuzzy msgid "What are the \"best practices\" for using import in a module?" -msgstr "在模組中使用 import 的「最佳實踐」是什麼?" +msgstr "在模組中使用 import 的「最佳實踐」有哪些?" #: ../../faq/programming.rst:290 #, fuzzy @@ -563,8 +557,8 @@ msgstr "如果你按以下順序引入模組,這是一個很好的做法:" #: ../../faq/programming.rst:301 msgid "" -"standard library modules -- e.g. :mod:`sys`, :mod:`os`, :mod:`argparse`, :" -"mod:`re`" +"standard library modules -- " +"e.g. :mod:`sys`, :mod:`os`, :mod:`argparse`, :mod:`re`" msgstr "" "標準函式庫模組 —— 例如 :mod:`sys`、:mod:`os`、:mod:`argparse`、:mod:`re`" @@ -645,8 +639,8 @@ msgstr "" "入移動到局部範圍內,例如在函式定義內。如果根據程式的執行方式,許多引入是不必" "要的,則此技術特別有用。如果模組僅在該函式中使用,你可能還想將引入移動到該函" "式中。請注意,由於模組的一次性初始化,第一次載入模組可能很昂貴,但多次載入模" -"組實際上是免費的,只需幾次字典查詢。即使模組名稱超出範圍,該模組也可能在 :" -"data:`sys.modules` 中可用。" +"組實際上是免費的,只需幾次字典查詢。即使模組名稱超出範圍,該模組也可能" +"在 :data:`sys.modules` 中可用。" #: ../../faq/programming.rst:338 #, fuzzy @@ -731,6 +725,9 @@ msgid "" " if mydict is None:\n" " mydict = {} # create a new dict for local namespace" msgstr "" +"def foo(mydict=None):\n" +" if mydict is None:\n" +" mydict = {} # 為區域命名空間建立一個新字典" #: ../../faq/programming.rst:374 #, fuzzy @@ -760,11 +757,10 @@ msgid "" msgstr "" #: ../../faq/programming.rst:389 -#, fuzzy msgid "" "You could use a global variable containing a dictionary instead of the " "default value; it's a matter of taste." -msgstr "你可以使用包含字典的全域變數而不是預設值;這是一個品味問題。" +msgstr "你可以使用包含字典的全域變數而不是預設值;這取決於喜好。" #: ../../faq/programming.rst:394 #, fuzzy @@ -803,17 +799,16 @@ msgid "What is the difference between arguments and parameters?" msgstr "引數 (arguments) 和參數 (parameters) 有什麼區別?" #: ../../faq/programming.rst:417 -#, fuzzy msgid "" ":term:`Parameters ` are defined by the names that appear in a " "function definition, whereas :term:`arguments ` are the values " -"actually passed to a function when calling it. Parameters define what :term:" -"`kind of arguments ` a function can accept. For example, given " -"the function definition::" +"actually passed to a function when calling it. Parameters define " +"what :term:`kind of arguments ` a function can accept. For " +"example, given the function definition::" msgstr "" ":term:`參數 `\\ 由出現在函式定義中的名稱定義,而\\ :term:`引數 " -"`\\ 是呼叫函式時實際傳遞給函式的值。參數定義函式可以接受的\\ :term:" -"引數種類 `。例如,給定函式定義: ::" +"`\\ 是呼叫函式時實際傳遞給函式的值。參數定義函式可以接受的" +"\\ :term:`引數種類 `。例如,給定以下函式定義: ::" #: ../../faq/programming.rst:423 msgid "" @@ -828,7 +823,7 @@ msgid "" "*foo*, *bar* and *kwargs* are parameters of ``func``. However, when calling " "``func``, for example::" msgstr "" -"*foo*、*bar* 和 *kwargs* 是 ``func`` 的參數。然而,當呼叫 ``func`` 時,例" +"*foo*、*bar* 和 *kwargs* 是 ``func`` 的參數。然而當呼叫 ``func`` 時,例" "如: ::" #: ../../faq/programming.rst:429 @@ -837,7 +832,7 @@ msgstr "func(42, bar=314, extra=somevar)" #: ../../faq/programming.rst:431 msgid "the values ``42``, ``314``, and ``somevar`` are arguments." -msgstr "``42`` 、 ``314`` 和 ``somevar`` 是引數。" +msgstr "``42``、``314`` 和 ``somevar`` 是引數。" #: ../../faq/programming.rst:435 msgid "Why did changing list 'y' also change list 'x'?" @@ -892,19 +887,17 @@ msgid "" msgstr "list 是 :term:`mutable`,這意味著你可以變更它們的內容。" #: ../../faq/programming.rst:457 -#, fuzzy msgid "" "After the call to :meth:`!append`, the content of the mutable object has " "changed from ``[]`` to ``[10]``. Since both the variables refer to the same " "object, using either name accesses the modified value ``[10]``." msgstr "" "在呼叫 :meth:`!append` 之後,可變物件的內容從 ``[]`` 變成了 ``[10]``。由於這" -"兩個變數都參照同一個物件,因此使用任一名稱都可以存取修改後的值 ``[10]`` 。" +"兩個變數都參照同一個物件,因此使用任一名稱都可以存取修改後的值 ``[10]``。" #: ../../faq/programming.rst:461 -#, fuzzy msgid "If we instead assign an immutable object to ``x``::" -msgstr "如果我們改為將不可變物件分配給 ``x``: ::" +msgstr "如果我們改為賦予一個不可變物件給 ``x``: ::" #: ../../faq/programming.rst:463 msgid "" @@ -916,6 +909,13 @@ msgid "" ">>> y\n" "5" msgstr "" +">>> x = 5 # 整數為不可變的\n" +">>> y = x\n" +">>> x = x + 1 # 5 不可變,在這邊會建立一個新物件\n" +">>> x\n" +"6\n" +">>> y\n" +"5" #: ../../faq/programming.rst:471 #, fuzzy @@ -949,9 +949,9 @@ msgstr "" "一些操作(例如 ``y.append(10)`` 和 ``y.sort()``)會改變物件,而表面上相似的操" "作(例如 ``y = y + [10]`` 和: func:`sorted(y) `) 建立一個新物件。通" "常在 Python 中(以及在標準函式庫中的所有情況下)改變物件的方法將回傳 " -"``None`` 以幫助避免混淆這兩種型別的操作。因此,如果你錯誤地編寫了 ``y." -"sort()``,認為它會為你提供 ``y`` 的排序副本,那麼你最終會得到 ``None``,這可" -"能會導致你的程式生成一個容易診斷的錯誤。" +"``None`` 以幫助避免混淆這兩種型別的操作。因此,如果你錯誤地編寫了 " +"``y.sort()``,認為它會為你提供 ``y`` 的排序副本,那麼你最終會得到 ``None``," +"這可能會導致你的程式生成一個容易診斷的錯誤。" #: ../../faq/programming.rst:488 #, fuzzy @@ -1004,12 +1004,10 @@ msgstr "" "置函式 :func:`id`。" #: ../../faq/programming.rst:510 -#, fuzzy msgid "How do I write a function with output parameters (call by reference)?" -msgstr "如何編寫帶有輸出參數的函式(透過參照呼叫)?" +msgstr "如何編寫帶有輸出參數的函式(透過傳參照呼叫 (call by reference))?" #: ../../faq/programming.rst:512 -#, fuzzy msgid "" "Remember that arguments are passed by assignment in Python. Since " "assignment just creates references to objects, there's no alias between an " @@ -1017,7 +1015,7 @@ msgid "" "You can achieve the desired effect in a number of ways." msgstr "" "請記住,在 Python 中引數是透過賦值傳遞的。由於賦值只是建立對物件的參照,因此" -"呼叫者和被呼叫者的引數名稱之間沒有別名,因此本身沒有按參照呼叫。你可以透過多" +"呼叫者和被呼叫者的引數名稱之間沒有別名,因此本身沒有傳參照呼叫。你可以透過多" "種方式實作所需的效果。" #: ../../faq/programming.rst:517 @@ -1035,11 +1033,18 @@ msgid "" ">>> func1(x, y)\n" "('new-value', 100)" msgstr "" +">>> def func1(a, b):\n" +"... a = 'new-value' # a 和 b 為區域名稱\n" +"... b = b + 1 # 賦值到新物件\n" +"... return a, b # 回傳新值\n" +"...\n" +">>> x, y = 'old-value', 99\n" +">>> func1(x, y)\n" +"('new-value', 100)" #: ../../faq/programming.rst:528 -#, fuzzy msgid "This is almost always the clearest solution." -msgstr "這幾乎總是最清晰的解決方案。" +msgstr "這幾乎都會是最清楚的方案。" #: ../../faq/programming.rst:530 #, fuzzy @@ -1048,9 +1053,8 @@ msgid "" msgstr "透過使用全域變數。這不是執行緒安全的,不推薦。" #: ../../faq/programming.rst:532 -#, fuzzy msgid "By passing a mutable (changeable in-place) object::" -msgstr "透過傳遞一個可變的(原地可變的)物件: ::" +msgstr "透過傳遞一個可變的(可於原地 (in-place) 改變的)物件: ::" #: ../../faq/programming.rst:534 msgid "" @@ -1063,6 +1067,14 @@ msgid "" ">>> args\n" "['new-value', 100]" msgstr "" +">>> def func2(a):\n" +"... a[0] = 'new-value' # 'a' 參照一個可變的串列\n" +"... a[1] = a[1] + 1 # 改變共享的物件\n" +"...\n" +">>> args = ['old-value', 99]\n" +">>> func2(args)\n" +">>> args\n" +"['new-value', 100]" #: ../../faq/programming.rst:543 #, fuzzy @@ -1164,7 +1176,6 @@ msgstr "" " return self.a * x + self.b" #: ../../faq/programming.rst:598 -#, fuzzy msgid "In both cases, ::" msgstr "在這兩種情況下: ::" @@ -1260,8 +1271,8 @@ msgstr "" #: ../../faq/programming.rst:641 #, fuzzy msgid "" -"Some objects can be copied more easily. Dictionaries have a :meth:`~dict." -"copy` method::" +"Some objects can be copied more easily. Dictionaries have " +"a :meth:`~dict.copy` method::" msgstr "可以更輕鬆地複製某些物件。字典有一個 :meth:`~dict.copy` 方法: ::" #: ../../faq/programming.rst:644 @@ -1379,9 +1390,8 @@ msgid "" msgstr "....如果你發現它有很多名字,或者根本沒有名字,請不要感到驚訝!" #: ../../faq/programming.rst:701 -#, fuzzy msgid "What's up with the comma operator's precedence?" -msgstr "逗號運算子的優先級是怎麼回事?" +msgstr "逗號運算子的優先級是什麼?" #: ../../faq/programming.rst:703 #, fuzzy @@ -1482,7 +1492,7 @@ msgid "" "Bartelt::" msgstr "" "是的。通常這是透過在 :keyword:`!lambda` 中嵌套 :keyword:`lambda` 來完成的。請" -"參閱以下三個示例,稍微改編自 Ulf Bartelt: ::" +"參閱以下三個範例,稍微改編自 Ulf Bartelt: ::" #: ../../faq/programming.rst:747 msgid "" @@ -1518,7 +1528,7 @@ msgstr "孩子們,不要在家裡嘗試這個!" #: ../../faq/programming.rst:777 msgid "What does the slash(/) in the parameter list of a function mean?" -msgstr "函式參數串列中的斜槓 (/) 是什麼意思?" +msgstr "函式參數串列中的斜線 (/) 是什麼意思?" #: ../../faq/programming.rst:779 #, fuzzy @@ -1530,9 +1540,9 @@ msgid "" "position. For example, :func:`divmod` is a function that accepts positional-" "only parameters. Its documentation looks like this::" msgstr "" -"函式引數list中的斜杠表示它前面的參數是位置參數。僅位置參數是沒有外部可用名稱" -"的參數。在呼叫接受僅位置參數的函式時,參數僅根據其位置對映到參數。例如,:" -"func:`divmod` 是一個只接受位置參數的函式。它的文件看起來像這樣: ::" +"函式引數list中的斜線表示它前面的參數是位置參數。僅位置參數是沒有外部可用名稱" +"的參數。在呼叫接受僅位置參數的函式時,參數僅根據其位置對映到參數。例" +"如,:func:`divmod` 是一個只接受位置參數的函式。它的文件看起來像這樣: ::" #: ../../faq/programming.rst:786 msgid "" @@ -1549,14 +1559,13 @@ msgstr "" " Return the tuple (x//y, x%y). Invariant: div*y + mod == x." #: ../../faq/programming.rst:792 -#, fuzzy msgid "" "The slash at the end of the parameter list means that both parameters are " "positional-only. Thus, calling :func:`divmod` with keyword arguments would " "lead to an error::" msgstr "" -"參數list末尾的斜杠表示兩個參數都是位置參數。因此,使用關鍵字引數呼叫 :func:" -"`divmod` 會導致錯誤: ::" +"參數串列最後的斜線表示兩個參數都是僅限位置參數。因此使用關鍵字引數呼" +"叫 :func:`divmod` 會導致錯誤: ::" #: ../../faq/programming.rst:796 msgid "" @@ -1670,13 +1679,12 @@ msgid "How do I get int literal attribute instead of SyntaxError?" msgstr "如何取得 int 文字屬性而不是 SyntaxError?" #: ../../faq/programming.rst:850 -#, fuzzy msgid "" -"Trying to lookup an ``int`` literal attribute in the normal manner gives a :" -"exc:`SyntaxError` because the period is seen as a decimal point::" +"Trying to lookup an ``int`` literal attribute in the normal manner gives " +"a :exc:`SyntaxError` because the period is seen as a decimal point::" msgstr "" -"嘗試以正常方式查詢 ``int`` 文字屬性會給出一個 SyntaxError ,因為句點被視為小" -"數點: ::" +"嘗試以正常方式查找 ``int`` 字面值屬性會給出一個 :exc:`SyntaxError`,因為句點" +"被視為小數點: ::" #: ../../faq/programming.rst:853 msgid "" @@ -1693,11 +1701,10 @@ msgstr "" "SyntaxError: invalid decimal literal" #: ../../faq/programming.rst:859 -#, fuzzy msgid "" "The solution is to separate the literal from the period with either a space " "or parentheses." -msgstr "解決方案是用空格或圓括號將文字與句點分開。" +msgstr "解決方式是用空格或圓括號將字面值與句點分開。" #: ../../faq/programming.rst:869 msgid "How do I convert a string to a number?" @@ -1710,8 +1717,8 @@ msgid "" "``int('144') == 144``. Similarly, :func:`float` converts to a floating-" "point number, e.g. ``float('144') == 144.0``." msgstr "" -"對於整數,使用內建的 int 型別構造函式,例如``int('144') == 144``。同樣,:" -"func:`float` 轉換為浮點數,例如``浮動('144')== 144.0``。" +"對於整數,使用內建的 int 型別建構函式,例如``int('144') == 144``。同" +"樣,:func:`float` 轉換為浮點數,例如``浮動('144')== 144.0``。" #: ../../faq/programming.rst:875 #, fuzzy @@ -1765,22 +1772,20 @@ msgid "" "in type constructor :func:`str`. If you want a hexadecimal or octal " "representation, use the built-in functions :func:`hex` or :func:`oct`. For " "fancy formatting, see the :ref:`f-strings` and :ref:`formatstrings` " -"sections, e.g. ``\"{:04d}\".format(144)`` yields ``'0144'`` and ``\"{:.3f}\"." -"format(1.0/3.0)`` yields ``'0.333'``." +"sections, e.g. ``\"{:04d}\".format(144)`` yields ``'0144'`` and ``\"{:.3f}" +"\".format(1.0/3.0)`` yields ``'0.333'``." msgstr "" -"例如,要將數字 ``144`` 轉換為字串 ``'144'``,請使用內建型別構造函式 :func:" -"`str`。如果你想要十六進製或八進製表示,請使用內建函式 :func:`hex` 或 :func:" -"`oct`。對於精美的格式,請參閱:ref:`f-strings` 和:ref:`formatstrings` 部分,例" -"如``\"{:04d}\".format(144)`` 產生 ``'0144'`` 和 ``\"{:.3f}\"." -"format(1.0/3.0)`` 產生 ``'0.333'`` ." +"例如,要將數字 ``144`` 轉換為字串 ``'144'``,請使用內建型別建構函" +"式 :func:`str`。如果你想要十六進製或八進製表示,請使用內建函式 :func:`hex` " +"或 :func:`oct`。對於精美的格式,請參閱:ref:`f-strings` " +"和:ref:`formatstrings` 部分,例如``\"{:04d}\".format(144)`` 產生 ``'0144'`` " +"和 ``\"{:.3f}\".format(1.0/3.0)`` 產生 ``'0.333'`` ." #: ../../faq/programming.rst:906 -#, fuzzy msgid "How do I modify a string in place?" msgstr "如何原地修改字串?" #: ../../faq/programming.rst:908 -#, fuzzy msgid "" "You can't, because strings are immutable. In most situations, you should " "simply construct a new string from the various parts you want to assemble it " @@ -1788,12 +1793,11 @@ msgid "" "unicode data, try using an :class:`io.StringIO` object or the :mod:`array` " "module::" msgstr "" -"你不能,因為字串是不可變的。在大多數情況下,你應該簡單地從要組裝的各個部分構" -"造一個新字串。但是,如果你需要一個能夠修改原地 unicode 資料的物件,請嘗試使" +"這沒辦法做到,因為字串是不可變的。在大多數情況下,你應以要拿來組裝的各個部分" +"建構出一個新字串。但是如果你需要一個能夠原地修改 unicode 資料的物件,請嘗試使" "用 :class:`io.StringIO` 物件或 :mod:`array` 模組: ::" #: ../../faq/programming.rst:914 -#, fuzzy msgid "" ">>> import io\n" ">>> s = \"Hello, world\"\n" @@ -1830,24 +1834,22 @@ msgstr "" "'Hello, there!'\n" "\n" ">>> import array\n" -">>> a = array.array('u', s)\n" +">>> a = array.array('w', s)\n" ">>> print(a)\n" -"array('u', 'Hello, world')\n" +"array('w', 'Hello, world')\n" ">>> a[0] = 'y'\n" ">>> print(a)\n" -"array('u', 'yello, world')\n" +"array('w', 'yello, world')\n" ">>> a.tounicode()\n" "'yello, world'" #: ../../faq/programming.rst:938 -#, fuzzy msgid "How do I use strings to call functions/methods?" msgstr "如何使用字串呼叫函式/方法?" #: ../../faq/programming.rst:940 -#, fuzzy msgid "There are various techniques." -msgstr "有各種各樣的技術。" +msgstr "有各式各樣的技法。" #: ../../faq/programming.rst:942 #, fuzzy @@ -1858,7 +1860,7 @@ msgid "" "a case construct::" msgstr "" "最好的方法是使用將字串對映到函式的字典。這種技術的主要優點是字串不需要與函式" -"名稱相匹配。這也是用於模擬案例構造的主要技術: ::" +"名稱相匹配。這也是用於模擬案例建構的主要技術: ::" #: ../../faq/programming.rst:947 msgid "" @@ -1886,7 +1888,6 @@ msgstr "" "getattr(foo, 'bar')()" #: ../../faq/programming.rst:962 -#, fuzzy msgid "" "Note that :func:`getattr` works on any object, including classes, class " "instances, modules, and so on." @@ -1942,11 +1943,11 @@ msgstr "" "f()" #: ../../faq/programming.rst:990 -#, fuzzy msgid "" "Is there an equivalent to Perl's chomp() for removing trailing newlines from " "strings?" -msgstr "是否有與 Perl 的 chomp() 等效的方法用於從字串中刪除尾隨換行符?" +msgstr "" +"是否有與 Perl 的 chomp() 等效的方法,能用於從字串中刪除後綴的換行符號?" #: ../../faq/programming.rst:992 msgid "" @@ -1981,9 +1982,8 @@ msgstr "" "很好。" #: ../../faq/programming.rst:1009 -#, fuzzy msgid "Is there a scanf() or sscanf() equivalent?" -msgstr "是否有 scanf() 或 sscanf() 等價物?" +msgstr "是否有 scanf() 或 sscanf() 的等效方法?" #: ../../faq/programming.rst:1011 #, fuzzy @@ -1995,15 +1995,15 @@ msgstr "不是這樣的。" msgid "" "For simple input parsing, the easiest approach is usually to split the line " "into whitespace-delimited words using the :meth:`~str.split` method of " -"string objects and then convert decimal strings to numeric values using :" -"func:`int` or :func:`float`. :meth:`!split` supports an optional \"sep\" " -"parameter which is useful if the line uses something other than whitespace " -"as a separator." +"string objects and then convert decimal strings to numeric values " +"using :func:`int` or :func:`float`. :meth:`!split` supports an optional " +"\"sep\" parameter which is useful if the line uses something other than " +"whitespace as a separator." msgstr "" "對於簡單的輸入解析,最簡單的方法通常是使用字串物件的 :meth:`~str.split` 方法" -"將行拆分為以空格分隔的單詞,然後使用 :func:`int` 或將十進製字串轉換為數值:" -"func:`浮動`。 :meth:`!split` 支援可選的 \"sep\" 參數,如果該行使用空格以外的" -"其他內容作為分隔符,該參數很有用。" +"將行拆分為以空格分隔的單詞,然後使用 :func:`int` 或將十進製字串轉換為數" +"值:func:`浮動`。 :meth:`!split` 支援可選的 \"sep\" 參數,如果該行使用空格以外" +"的其他內容作為分隔符,該參數很有用。" #: ../../faq/programming.rst:1019 #, fuzzy @@ -2024,14 +2024,14 @@ msgstr "請參閱 :ref:`unicode-howto`。" #: ../../faq/programming.rst:1032 #, fuzzy msgid "Can I end a raw string with an odd number of backslashes?" -msgstr "我可以用奇數個反斜杠結束原始字串嗎?" +msgstr "我可以用奇數個反斜線結束原始字串嗎?" #: ../../faq/programming.rst:1034 #, fuzzy msgid "" "A raw string ending with an odd number of backslashes will escape the " "string's quote::" -msgstr "以奇數個反斜杠結尾的原始字串將轉義字串的引號: ::" +msgstr "以奇數個反斜線結尾的原始字串將轉義字串的引號: ::" #: ../../faq/programming.rst:1036 msgid "" @@ -2052,7 +2052,7 @@ msgstr "" msgid "" "There are several workarounds for this. One is to use regular strings and " "double the backslashes::" -msgstr "有幾種解決方法。一種是使用常規字串並加倍反斜杠: ::" +msgstr "有幾種解決方法。一種是使用常規字串並加倍反斜線: ::" #: ../../faq/programming.rst:1045 msgid "" @@ -2067,7 +2067,7 @@ msgstr "" msgid "" "Another is to concatenate a regular string containing an escaped backslash " "to the raw string::" -msgstr "另一種方法是將包含轉義反斜杠的常規字串連接到原始字串: ::" +msgstr "另一種方法是將包含轉義反斜線的常規字串連接到原始字串: ::" #: ../../faq/programming.rst:1051 msgid "" @@ -2082,7 +2082,7 @@ msgstr "" msgid "" "It is also possible to use :func:`os.path.join` to append a backslash on " "Windows::" -msgstr "也可以使用 :func:`os.path.join` 在 Windows 上附加反斜杠: ::" +msgstr "也可以使用 :func:`os.path.join` 在 Windows 上附加反斜線: ::" #: ../../faq/programming.rst:1056 msgid "" @@ -2100,8 +2100,8 @@ msgid "" "the value of the raw string. That is, the backslash remains present in the " "value of the raw string::" msgstr "" -"請注意,雖然為了確定原始字串的結束位置而使用反斜杠「跳脫」引號,但在解釋原始" -"字串的值時不會發生轉義。也就是說,反斜杠仍然存在於原始字串的值中: ::" +"請注意,雖然為了確定原始字串的結束位置而使用反斜線「跳脫」引號,但在解釋原始" +"字串的值時不會發生轉義。也就是說,反斜線仍然存在於原始字串的值中: ::" #: ../../faq/programming.rst:1064 msgid "" @@ -2152,8 +2152,8 @@ msgid "" "You should always find the hot spots in your program *before* attempting to " "optimize any code (see the :mod:`profile` module)." msgstr "" -"在嘗試最佳化任何程式碼\\ *之前*,你應該始終找到程式中的熱點(請參閱 :mod:" -"`profile` 模組)。" +"在嘗試最佳化任何程式碼\\ *之前*,你應該始終找到程式中的熱點(請參" +"閱 :mod:`profile` 模組)。" #: ../../faq/programming.rst:1084 #, fuzzy @@ -2208,15 +2208,15 @@ msgid "" "When the standard library provides a primitive for doing something, it is " "likely (although not guaranteed) to be faster than any alternative you may " "come up with. This is doubly true for primitives written in C, such as " -"builtins and some extension types. For example, be sure to use either the :" -"meth:`list.sort` built-in method or the related :func:`sorted` function to " -"do sorting (and see the :ref:`sortinghowto` for examples of moderately " +"builtins and some extension types. For example, be sure to use either " +"the :meth:`list.sort` built-in method or the related :func:`sorted` function " +"to do sorting (and see the :ref:`sortinghowto` for examples of moderately " "advanced usage)." msgstr "" "當標準函式庫提供用於執行某些操作的原語時,它很可能(儘管不能保證)比你可能想" "出的任何替代方法都更快。對於用 C 編寫的原語,例如內建函式和一些擴充型別,情況" "更是如此。例如,請務必使用 :meth:`list.sort` 內建方法或相關的 :func:`sorted` " -"函式進行排序(有關高階用法的示例,請參閱 :ref:`sortinghowto` )." +"函式進行排序(有關高階用法的範例,請參閱 :ref:`sortinghowto` )." #: ../../faq/programming.rst:1109 #, fuzzy @@ -2280,8 +2280,8 @@ msgid "" "To accumulate many :class:`str` objects, the recommended idiom is to place " "them into a list and call :meth:`str.join` at the end::" msgstr "" -"要累積許多 :class:`str` 物件,推薦的習慣用法是將它們放入list中並在末尾呼叫 :" -"meth:`str.join`: ::" +"要累積許多 :class:`str` 物件,推薦的習慣用法是將它們放入list中並在末尾呼" +"叫 :meth:`str.join`: ::" #: ../../faq/programming.rst:1141 msgid "" @@ -2324,13 +2324,12 @@ msgid "How do I convert between tuples and lists?" msgstr "如何在元組和list之間進行轉換?" #: ../../faq/programming.rst:1162 -#, fuzzy msgid "" "The type constructor ``tuple(seq)`` converts any sequence (actually, any " "iterable) into a tuple with the same items in the same order." msgstr "" -"型別構造器 ``tuple(seq)`` 將任何序列(實際上是任何可疊代物件)轉換為具有相同" -"順序的相同項的元組。" +"型別建構函式 ``tuple(seq)`` 將任何序列(實際上是任何可疊代物件)轉換為具有相" +"同順序的相同項的元組。" #: ../../faq/programming.rst:1165 #, fuzzy @@ -2352,7 +2351,7 @@ msgid "" "3))`` yields ``[1, 2, 3]`` and ``list('abc')`` yields ``['a', 'b', 'c']``. " "If the argument is a list, it makes a copy just like ``seq[:]`` would." msgstr "" -"型別構造函式 ``list(seq)`` 將任何序列或可疊代物件轉換為具有相同順序的相同項目" +"型別建構函式 ``list(seq)`` 將任何序列或可疊代物件轉換為具有相同順序的相同項目" "的list。例如,``list((1, 2, 3))`` 產生``[1, 2, 3]`` 和``list('abc')`` 產生" "``['a', 'b ', 'c']``。如果引數是一個list,它會像 ``seq[:]`` 那樣製作一個副" "本。" @@ -2446,8 +2445,8 @@ msgstr "" #: ../../faq/programming.rst:1220 #, fuzzy msgid "" -"If all elements of the list may be used as set keys (i.e. they are all :term:" -"`hashable`) this is often faster ::" +"If all elements of the list may be used as set keys (i.e. they are " +"all :term:`hashable`) this is often faster ::" msgstr "" "如果list的所有元素都可以用作集合鍵(即它們都是 :term:`hashable`),這通常會更" "快: ::" @@ -2644,8 +2643,8 @@ msgstr "如何將方法或函式應用於一系列物件?" #: ../../faq/programming.rst:1327 #, fuzzy msgid "" -"To call a method or function and accumulate the return values is a list, a :" -"term:`list comprehension` is an elegant solution::" +"To call a method or function and accumulate the return values is a list, " +"a :term:`list comprehension` is an elegant solution::" msgstr "" "呼叫一個方法或函式並累積回傳值是一個list,一個 :term:`list comprehension` 是" "一個優雅的解決方案: ::" @@ -2697,7 +2696,7 @@ msgid "" "a ``list`` and ``+=`` as our exemplar." msgstr "" "當擴充賦值運算子應用於指向可變物件的元組元素時,此討論通常適用,但我們將使用 " -"``list`` 和 ``+=\" 作為示例。" +"``list`` 和 ``+=\" 作為範例。" #: ../../faq/programming.rst:1356 #, fuzzy @@ -2788,11 +2787,11 @@ msgid "" "to calling :meth:`!extend` on the list and returning the list. That's why " "we say that for lists, ``+=`` is a \"shorthand\" for :meth:`!list.extend`::" msgstr "" -"要了解為什麼會發生這種情況,你需要知道 (a) 如果一個物件實作了一個 :meth:" -"`~object.__iadd__` 魔術方法,它會在執行 ``+=`` 增廣賦值時被呼叫,並且它的回傳" -"value 是賦值陳述式中使用的值; (b) 對於list,:meth:`!__iadd__` 相當於在list上" -"呼叫 :meth:`!extend` 並回傳list。這就是為什麼我們說對於list,``+=`` 是 :meth:" -"`!list.extend` 的「簡寫」: ::" +"要了解為什麼會發生這種情況,你需要知道 (a) 如果一個物件實作了一" +"個 :meth:`~object.__iadd__` 魔術方法,它會在執行 ``+=`` 增廣賦值時被呼叫,並" +"且它的回傳value 是賦值陳述式中使用的值; (b) 對於list,:meth:`!__iadd__` 相當" +"於在list上呼叫 :meth:`!extend` 並回傳list。這就是為什麼我們說對於list," +"``+=`` 是 :meth:`!list.extend` 的「簡寫」: ::" #: ../../faq/programming.rst:1404 msgid "" @@ -2831,9 +2830,8 @@ msgstr "" "賦值仍然發生。" #: ../../faq/programming.rst:1419 -#, fuzzy msgid "Thus, in our tuple example what is happening is equivalent to::" -msgstr "因此,在我們的元組示例中,發生的事情等同於: ::" +msgstr "因此,在我們的元組範例中,發生的事情等同於: ::" #: ../../faq/programming.rst:1421 msgid "" @@ -2843,6 +2841,11 @@ msgid "" " ...\n" "TypeError: 'tuple' object does not support item assignment" msgstr "" +">>> result = a_tuple[0].__iadd__(['item'])\n" +">>> a_tuple[0] = result\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: 'tuple' object does not support item assignment" #: ../../faq/programming.rst:1427 #, fuzzy @@ -2857,7 +2860,6 @@ msgstr "" "可變的。" #: ../../faq/programming.rst:1433 -#, fuzzy msgid "" "I want to do a complicated sort: can you do a Schwartzian Transform in " "Python?" @@ -2872,7 +2874,7 @@ msgid "" "method::" msgstr "" "該技術歸功於 Perl 社區的 Randal Schwartz,它透過將每個元素對映到其「排序值」" -"的度量對list的元素進行排序。在 Python 中,對 :meth:`list.sort` 方法使用 " +"的度量對串列的元素進行排序。在 Python 中,對 :meth:`list.sort` 方法使用 " "``key`` 引數: ::" #: ../../faq/programming.rst:1439 @@ -2884,18 +2886,16 @@ msgstr "" "Isorted.sort(key=lambda s: int(s[10:15]))" #: ../../faq/programming.rst:1444 -#, fuzzy msgid "How can I sort one list by values from another list?" -msgstr "如何根據另一個list中的值對一個list進行排序?" +msgstr "如何根據另一個串列中的值對一個串列進行排序?" #: ../../faq/programming.rst:1446 -#, fuzzy msgid "" "Merge them into an iterator of tuples, sort the resulting list, and then " "pick out the element you want. ::" msgstr "" -"將它們合併到一個元組疊代器中,對結果list進行排序,然後挑選出你想要的元" -"素。: ::" +"將它們合併到一個元組疊代器中,對結果的串列進行排序,然後挑選出你想要的元" +"素。 ::" #: ../../faq/programming.rst:1449 msgid "" @@ -2962,8 +2962,8 @@ msgstr "什麼是方法 (method)?" #: ../../faq/programming.rst:1481 #, fuzzy msgid "" -"A method is a function on some object ``x`` that you normally call as ``x." -"name(arguments...)``. Methods are defined as functions inside the class " +"A method is a function on some object ``x`` that you normally call as " +"``x.name(arguments...)``. Methods are defined as functions inside the class " "definition::" msgstr "" "方法是一些物件 ``x`` 上的函式,你通常將其稱為 ``x.name(arguments...)`` 。方法" @@ -2980,21 +2980,19 @@ msgstr "" " return arg * 2 + self.attribute" #: ../../faq/programming.rst:1491 -#, fuzzy msgid "What is self?" -msgstr "什麼是自我?" +msgstr "什麼是 self?" #: ../../faq/programming.rst:1493 -#, fuzzy msgid "" "Self is merely a conventional name for the first argument of a method. A " "method defined as ``meth(self, a, b, c)`` should be called as ``x.meth(a, b, " "c)`` for some instance ``x`` of the class in which the definition occurs; " "the called method will think it is called as ``meth(x, a, b, c)``." msgstr "" -"Self 只是方法第一個引數的約定名稱。一個定義為 ``meth(self, a, b, c)`` 的方法" -"應該被呼叫為 ``x.meth(a, b, c)`` 對於其中類別的某個實例 ``x``定義發生;被呼叫" -"的方法會認為它被稱為 ``meth(x, a, b, c)`` 。" +"Self 只是方法第一個引數的約定名稱。對於所定義類別的某個實例 ``x``,一個定義" +"為 ``meth(self, a, b, c)`` 的方法應該以 ``x.meth(a, b, c)`` 形式來呼叫;被呼" +"叫的方法會認為它是以 ``meth(x, a, b, c)`` 來呼叫的。" #: ../../faq/programming.rst:1498 msgid "See also :ref:`why-self`." @@ -3024,16 +3022,16 @@ msgstr "" "complex))``。" #: ../../faq/programming.rst:1511 -#, fuzzy msgid "" -"Note that :func:`isinstance` also checks for virtual inheritance from an :" -"term:`abstract base class`. So, the test will return ``True`` for a " +"Note that :func:`isinstance` also checks for virtual inheritance from " +"an :term:`abstract base class`. So, the test will return ``True`` for a " "registered class even if hasn't directly or indirectly inherited from it. " "To test for \"true inheritance\", scan the :term:`MRO` of the class:" msgstr "" -"請注意:func:`isinstance` 還檢查來自:term:`抽象基底類別` 的虛擬繼承。因此,測" -"試將為已註冊的類別回傳 ``True``,即使沒有直接或間接繼承自它。要測試「真正的繼" -"承」,請掃描該類別的 MRO:" +"請注意,:func:`isinstance` 還會檢查來自\\ :term:`抽象基底類別 (abstract base " +"class) ` 的虛擬繼承。因此對已註冊類別的檢驗會回傳 " +"``True``,即使沒有直接或間接繼承自它。要測試「真正繼承」,請掃描該類別" +"的 :term:`MRO`:" #: ../../faq/programming.rst:1516 msgid "" @@ -3075,6 +3073,21 @@ msgid "" ">>> Mapping in type(c).__mro__\n" "False" msgstr "" +">>> c = C()\n" +">>> isinstance(c, C) # 直接\n" +"True\n" +">>> isinstance(c, P) # 間接\n" +"True\n" +">>> isinstance(c, Mapping) # 虛擬\n" +"True\n" +"\n" +"# 實際的繼承鏈結\n" +">>> type(c).__mro__\n" +"(, , )\n" +"\n" +"# 「真正繼承」的檢驗\n" +">>> Mapping in type(c).__mro__\n" +"False" #: ../../faq/programming.rst:1546 #, fuzzy @@ -3101,17 +3114,16 @@ msgid "" msgstr "" "def search(obj):\n" " if isinstance(obj, Mailbox):\n" -" ... # code to search a mailbox\n" +" ... # 搜尋信箱的程式碼\n" " elif isinstance(obj, Document):\n" -" ... # code to search a document\n" +" ... # 搜尋文件的程式碼\n" " elif ..." #: ../../faq/programming.rst:1560 -#, fuzzy msgid "" "A better approach is to define a ``search()`` method on all the classes and " "just call it::" -msgstr "更好的方法是在所有類別上定義一個 ``search()`` 方法,然後呼叫它: ::" +msgstr "更好的方法是在所有類別上定義一個 ``search()`` 方法然後呼叫它: ::" #: ../../faq/programming.rst:1563 msgid "" @@ -3125,6 +3137,15 @@ msgid "" "\n" "obj.search()" msgstr "" +"class Mailbox:\n" +" def search(self):\n" +" ... # 搜尋信箱的程式碼\n" +"\n" +"class Document:\n" +" def search(self):\n" +" ... # 搜尋文件的程式碼\n" +"\n" +"obj.search()" #: ../../faq/programming.rst:1575 #, fuzzy @@ -3151,8 +3172,8 @@ msgid "" "following class implements a class that behaves like a file but converts all " "written data to uppercase::" msgstr "" -"Python 程式員可以輕鬆實作委託。例如,下面的類別實作了一個行為類似於檔案但將所" -"有寫入資料轉換為大寫的類別: ::" +"Python 程式設計師可以輕鬆實作委託。例如,下面的類別實作了一個行為類似於檔案但" +"將所有寫入資料轉換為大寫的類別: ::" #: ../../faq/programming.rst:1587 msgid "" @@ -3182,29 +3203,29 @@ msgstr "" #, fuzzy msgid "" "Here the ``UpperOut`` class redefines the ``write()`` method to convert the " -"argument string to uppercase before calling the underlying ``self._outfile." -"write()`` method. All other methods are delegated to the underlying ``self." -"_outfile`` object. The delegation is accomplished via the :meth:`~object." -"__getattr__` method; consult :ref:`the language reference ` for more information about controlling attribute access." +"argument string to uppercase before calling the underlying " +"``self._outfile.write()`` method. All other methods are delegated to the " +"underlying ``self._outfile`` object. The delegation is accomplished via " +"the :meth:`~object.__getattr__` method; consult :ref:`the language reference " +"` for more information about controlling attribute access." msgstr "" -"這裡的 ``UpperOut`` 類別重新定義了``write()`` 方法,在呼叫底層的``self." -"_outfile.write()`` 方法之前將引數字串轉換為大寫。所有其他方法都委託給底層的 " -"``self._outfile`` 物件。委託是透過 :meth:`~object.__getattr__` 方法完成的;有" -"關控制屬性存取的更多資訊,請參閱語言參考 。" +"這裡的 ``UpperOut`` 類別重新定義了``write()`` 方法,在呼叫底層的" +"``self._outfile.write()`` 方法之前將引數字串轉換為大寫。所有其他方法都委託給" +"底層的 ``self._outfile`` 物件。委託是透過 :meth:`~object.__getattr__` 方法完" +"成的;有關控制屬性存取的更多資訊,請參閱語言參考 。" #: ../../faq/programming.rst:1605 #, fuzzy msgid "" "Note that for more general cases delegation can get trickier. When " -"attributes must be set as well as retrieved, the class must define a :meth:" -"`~object.__setattr__` method too, and it must do so carefully. The basic " -"implementation of :meth:`!__setattr__` is roughly equivalent to the " +"attributes must be set as well as retrieved, the class must define " +"a :meth:`~object.__setattr__` method too, and it must do so carefully. The " +"basic implementation of :meth:`!__setattr__` is roughly equivalent to the " "following::" msgstr "" "請注意,對於更一般的情況,委託可能會變得更加棘手。當必須設定和檢索屬性時,該" -"類別也必須定義一個 :meth:`~object.__setattr__` 方法,而且必須小心謹慎。 :" -"meth:`!__setattr__` 的基本實作大致等同於以下: ::" +"類別也必須定義一個 :meth:`~object.__setattr__` 方法,而且必須小心謹" +"慎。 :meth:`!__setattr__` 的基本實作大致等同於以下: ::" #: ../../faq/programming.rst:1610 msgid "" @@ -3221,16 +3242,15 @@ msgstr "" " ..." #: ../../faq/programming.rst:1616 -#, fuzzy msgid "" -"Many :meth:`~object.__setattr__` implementations call :meth:`!object." -"__setattr__` to set an attribute on self without causing infinite recursion::" +"Many :meth:`~object.__setattr__` implementations call :meth:`!" +"object.__setattr__` to set an attribute on self without causing infinite " +"recursion::" msgstr "" -"大多數 :meth:`!__setattr__` 實作必須修改 :meth:`self.__dict__ ` 以存儲 self 的本地狀態,而不會導致無限遞迴。" +"許多 :meth:`~object.__setattr__` 的實作會呼叫 :meth:`!object.__setattr__` 以" +"設定 self 的屬性,而不會導致無限遞迴。" #: ../../faq/programming.rst:1619 -#, fuzzy msgid "" "class X:\n" " def __setattr__(self, name, value):\n" @@ -3238,15 +3258,14 @@ msgid "" " object.__setattr__(self, name, value)" msgstr "" "class X:\n" -" ...\n" " def __setattr__(self, name, value):\n" -" self.__dict__[name] = value\n" -" ..." +" # 自訂邏輯放在這裡...\n" +" object.__setattr__(self, name, value)" #: ../../faq/programming.rst:1624 msgid "" -"Alternatively, it is possible to set attributes by inserting entries into :" -"attr:`self.__dict__ ` directly." +"Alternatively, it is possible to set attributes by inserting entries " +"into :attr:`self.__dict__ ` directly." msgstr "" #: ../../faq/programming.rst:1629 @@ -3268,18 +3287,15 @@ msgid "" msgstr "" "class Derived(Base):\n" " def meth(self):\n" -" super().meth() # calls Base.meth" +" super().meth() # 呼叫 Base.meth" #: ../../faq/programming.rst:1637 -#, fuzzy msgid "" "In the example, :func:`super` will automatically determine the instance from " "which it was called (the ``self`` value), look up the :term:`method " "resolution order` (MRO) with ``type(self).__mro__``, and return the next in " "line after ``Derived`` in the MRO: ``Base``." msgstr "" -"在示例中,:func:`super` 將自動確定呼叫它的實例(``self`` 值),使用 " -"``type(self ).__mro__``,並回傳 MRO 中``Derived`` 之後的下一行:``Base``。" #: ../../faq/programming.rst:1644 #, fuzzy @@ -3348,6 +3364,14 @@ msgid "" " def getcount(self):\n" " return C.count # or return self.count" msgstr "" +"class C:\n" +" count = 0 # C.__init__ 被呼叫的次數\n" +"\n" +" def __init__(self):\n" +" C.count = C.count + 1\n" +"\n" +" def getcount(self):\n" +" return C.count # 或回傳 self.count" #: ../../faq/programming.rst:1678 #, fuzzy @@ -3422,15 +3446,14 @@ msgstr "" #: ../../faq/programming.rst:1708 #, fuzzy msgid "How can I overload constructors (or methods) in Python?" -msgstr "如何在 Python 中重載構造函式(或方法)?" +msgstr "如何在 Python 中重載建構函式(或方法)?" #: ../../faq/programming.rst:1710 -#, fuzzy msgid "" "This answer actually applies to all methods, but the question usually comes " "up first in the context of constructors." msgstr "" -"這個答案實際上適用於所有方法,但這個問題通常首先出現在構造函式的上下文中。" +"這個答案實際上適用於所有方法,但這個問題通常會先出現在建構函式的情境中。" #: ../../faq/programming.rst:1713 msgid "In C++ you'd write" @@ -3449,12 +3472,11 @@ msgstr "" "}" #: ../../faq/programming.rst:1722 -#, fuzzy msgid "" "In Python you have to write a single constructor that catches all cases " "using default arguments. For example::" msgstr "" -"在 Python 中,你必須編寫一個構造函式來捕獲所有使用預設引數的情況。例如: ::" +"在 Python 中,你必須編寫一個建構函式來捕獲所有使用預設引數的情況。例如: ::" #: ../../faq/programming.rst:1725 msgid "" @@ -3473,14 +3495,12 @@ msgstr "" " print(\"Argument is\", i)" #: ../../faq/programming.rst:1732 -#, fuzzy msgid "This is not entirely equivalent, but close enough in practice." -msgstr "這並不完全等價,但在實踐中足夠接近。" +msgstr "這並不完全等價,但在實際情況中已夠接近。" #: ../../faq/programming.rst:1734 -#, fuzzy msgid "You could also try a variable-length argument list, e.g. ::" -msgstr "你也可以嘗試可變長度引數 list,例如: ::" +msgstr "你也可以嘗試長度可變的引數串列,例如: ::" #: ../../faq/programming.rst:1736 msgid "" @@ -3491,12 +3511,10 @@ msgstr "" " ..." #: ../../faq/programming.rst:1739 -#, fuzzy msgid "The same approach works for all method definitions." -msgstr "相同的方法適用於所有方法定義。" +msgstr "相同的手段適用於所有方法的定義。" #: ../../faq/programming.rst:1743 -#, fuzzy msgid "I try to use __spam and I get an error about _SomeClassName__spam." msgstr "我嘗試使用 __spam,但收到有關 _SomeClassName__spam 的錯誤。" @@ -3564,21 +3582,19 @@ msgid "" msgstr "" #: ../../faq/programming.rst:1778 -#, fuzzy msgid "My class defines __del__ but it is not called when I delete the object." msgstr "我的類別定義了 __del__ 但是當我刪除物件時它沒有被呼叫。" #: ../../faq/programming.rst:1780 -#, fuzzy msgid "There are several possible reasons for this." msgstr "這有幾個可能的原因。" #: ../../faq/programming.rst:1782 #, fuzzy msgid "" -"The :keyword:`del` statement does not necessarily call :meth:`~object." -"__del__` -- it simply decrements the object's reference count, and if this " -"reaches zero :meth:`!__del__` is called." +"The :keyword:`del` statement does not necessarily " +"call :meth:`~object.__del__` -- it simply decrements the object's reference " +"count, and if this reaches zero :meth:`!__del__` is called." msgstr "" ":keyword:`del` 陳述式不一定呼叫 :meth:`~object.__del__` -- 它只是減少物件的引" "用計數,如果達到零,則呼叫 :meth:`!__del__`。" @@ -3637,8 +3653,8 @@ msgid "" "Finally, if your :meth:`!__del__` method raises an exception, a warning " "message is printed to :data:`sys.stderr`." msgstr "" -"最後,如果你的 :meth:`!__del__` 方法引發例外,則會將一條警告訊息印出到 :data:" -"`sys.stderr`。" +"最後,如果你的 :meth:`!__del__` 方法引發例外,則會將一條警告訊息印出" +"到 :data:`sys.stderr`。" #: ../../faq/programming.rst:1822 #, fuzzy @@ -3652,8 +3668,8 @@ msgid "" "type). You can program the class's constructor to keep track of all " "instances by keeping a list of weak references to each instance." msgstr "" -"Python 不會跟踪類別(或內建型別)的所有實例。你可以對類別的構造函式進行編程," -"以透過保留對每個實例的弱參照list來跟踪所有實例。" +"Python 不會追蹤類別(或內建型別)的所有實例。你可以對類別的建構函式進行編程," +"以透過保留對每個實例的弱參照串列來追蹤所有實例。" #: ../../faq/programming.rst:1830 msgid "Why does the result of ``id()`` appear to be not unique?" @@ -3801,25 +3817,24 @@ msgstr "在標準函式庫程式碼中,你將看到幾種正確使用識別性 #: ../../faq/programming.rst:1908 msgid "" -"1) As recommended by :pep:`8`, an identity test is the preferred way to " -"check for ``None``. This reads like plain English in code and avoids " -"confusion with other objects that may have boolean values that evaluate to " -"false." +"As recommended by :pep:`8`, an identity test is the preferred way to check " +"for ``None``. This reads like plain English in code and avoids confusion " +"with other objects that may have boolean values that evaluate to false." msgstr "" -"1) 正如 :pep:`8` 所推薦的,識別性測試是檢查 ``None`` 的首選方法。這在程式碼中" -"讀起來像簡單的英語,並避免與其他可能具有評估為 false 的布林值的物件混淆。" +"正如 :pep:`8` 所推薦的,識別性測試是檢查 ``None`` 的首選方法。這在程式碼中讀" +"起來像簡單的英語,並避免與其他可能具有評估為 false 的布林值的物件混淆。" #: ../../faq/programming.rst:1912 #, fuzzy msgid "" -"2) Detecting optional arguments can be tricky when ``None`` is a valid input " +"Detecting optional arguments can be tricky when ``None`` is a valid input " "value. In those situations, you can create a singleton sentinel object " "guaranteed to be distinct from other objects. For example, here is how to " -"implement a method that behaves like :meth:`dict.pop`::" +"implement a method that behaves like :meth:`dict.pop`:" msgstr "" -"2)當 ``None`` 是有效輸入值時,檢測可選引數可能會很棘手。在這些情況下,你可以" -"建立一個保證與其他物件不同的單例哨兵物件。例如,這裡是如何實作一個行為類似" -"於 :meth:`dict.pop` 的方法: ::" +"當 ``None`` 是有效輸入值時,檢測可選引數可能會很棘手。在這些情況下,你可以建" +"立一個保證與其他物件不同的單例哨兵物件。例如,這裡是如何實作一個行為類似" +"於 :meth:`dict.pop` 的方法:" #: ../../faq/programming.rst:1917 msgid "" @@ -3845,23 +3860,23 @@ msgstr "" " raise KeyError(key)\n" " return default" -#: ../../faq/programming.rst:1928 +#: ../../faq/programming.rst:1930 msgid "" -"3) Container implementations sometimes need to augment equality tests with " +"Container implementations sometimes need to augment equality tests with " "identity tests. This prevents the code from being confused by objects such " "as ``float('NaN')`` that are not equal to themselves." msgstr "" -"3) 容器實作有時需要透過識別性測試來增強相等性測試。這可以防止程式碼被諸如 " +"容器實作有時需要透過識別性測試來增強相等性測試。這可以防止程式碼被諸如 " "float('NaN') 之類的不等於自身的物件所混淆。" -#: ../../faq/programming.rst:1932 +#: ../../faq/programming.rst:1934 msgid "" -"For example, here is the implementation of :meth:`!collections.abc.Sequence." -"__contains__`::" +"For example, here is the implementation of :meth:`!" +"collections.abc.Sequence.__contains__`::" msgstr "" "例如,以下是 :meth:`!collections.abc.Sequence.__contains__` 的實作: ::" -#: ../../faq/programming.rst:1935 +#: ../../faq/programming.rst:1937 msgid "" "def __contains__(self, value):\n" " for v in self:\n" @@ -3875,12 +3890,12 @@ msgstr "" " return True\n" " return False" -#: ../../faq/programming.rst:1943 +#: ../../faq/programming.rst:1945 msgid "" "How can a subclass control what data is stored in an immutable instance?" msgstr "子類別如何控制不可變實例中存儲的資料?" -#: ../../faq/programming.rst:1945 +#: ../../faq/programming.rst:1947 #, fuzzy msgid "" "When subclassing an immutable type, override the :meth:`~object.__new__` " @@ -3888,18 +3903,17 @@ msgid "" "*after* an instance is created, which is too late to alter data in an " "immutable instance." msgstr "" -"當對不可變型別進行子類別化時,覆蓋 :meth:`~object.__new__` 方法而不是 :meth:" -"`~object.__init__` 方法。後者僅在*建立實例後*運行,這為時已晚,無法更改不可變" -"實例中的資料。" +"當對不可變型別進行子類別化時,覆蓋 :meth:`~object.__new__` 方法而不" +"是 :meth:`~object.__init__` 方法。後者僅在*建立實例後*運行,這為時已晚,無法" +"更改不可變實例中的資料。" -#: ../../faq/programming.rst:1950 -#, fuzzy +#: ../../faq/programming.rst:1952 msgid "" "All of these immutable classes have a different signature than their parent " "class:" msgstr "所有這些不可變類別都具有與其父類別不同的簽名:" -#: ../../faq/programming.rst:1953 +#: ../../faq/programming.rst:1955 msgid "" "from datetime import date\n" "\n" @@ -3922,12 +3936,32 @@ msgid "" " s = ''.join([c for c in s if c.isalnum() or c == '-'])\n" " return super().__new__(cls, s)" msgstr "" +"from datetime import date\n" +"\n" +"class FirstOfMonthDate(date):\n" +" \"總是選擇每個月的第一天\"\n" +" def __new__(cls, year, month, day):\n" +" return super().__new__(cls, year, month, 1)\n" +"\n" +"class NamedInt(int):\n" +" \"允許一些數字的文字名稱\"\n" +" xlat = {'zero': 0, 'one': 1, 'ten': 10}\n" +" def __new__(cls, value):\n" +" value = cls.xlat.get(value, value)\n" +" return super().__new__(cls, value)\n" +"\n" +"class TitleStr(str):\n" +" \"將 str 轉換成適合作為 URL 路徑的名稱\"\n" +" def __new__(cls, s):\n" +" s = s.lower().replace(' ', '-')\n" +" s = ''.join([c for c in s if c.isalnum() or c == '-'])\n" +" return super().__new__(cls, s)" -#: ../../faq/programming.rst:1976 +#: ../../faq/programming.rst:1978 msgid "The classes can be used like this:" msgstr "這些類別可以像這樣使用:" -#: ../../faq/programming.rst:1978 +#: ../../faq/programming.rst:1980 msgid "" ">>> FirstOfMonthDate(2012, 2, 14)\n" "FirstOfMonthDate(2012, 2, 1)\n" @@ -3947,31 +3981,33 @@ msgstr "" ">>> TitleStr('Blog: Why Python Rocks')\n" "'blog-why-python-rocks'" -#: ../../faq/programming.rst:1993 +#: ../../faq/programming.rst:1995 msgid "How do I cache method calls?" msgstr "如何快取方法呼叫?" -#: ../../faq/programming.rst:1995 +#: ../../faq/programming.rst:1997 #, fuzzy msgid "" -"The two principal tools for caching methods are :func:`functools." -"cached_property` and :func:`functools.lru_cache`. The former stores results " -"at the instance level and the latter at the class level." +"The two principal tools for caching methods " +"are :func:`functools.cached_property` and :func:`functools.lru_cache`. The " +"former stores results at the instance level and the latter at the class " +"level." msgstr "" -"快取方法的兩個主要工具是 func:`functools.cached_property` 和 :func:" -"`functools.lru_cache`。前者在實例級別存儲結果,後者在類別級別存儲結果。" +"快取方法的兩個主要工具是 func:`functools.cached_property` " +"和 :func:`functools.lru_cache`。前者在實例級別存儲結果,後者在類別級別存儲結" +"果。" -#: ../../faq/programming.rst:2000 +#: ../../faq/programming.rst:2002 #, fuzzy msgid "" "The *cached_property* approach only works with methods that do not take any " "arguments. It does not create a reference to the instance. The cached " "method result will be kept only as long as the instance is alive." msgstr "" -"*cached_property* 方法僅適用於不帶任何引數的方法。它不會建立對實例的參照。只" +"*cached_property* 方法僅適用於不帶任何引數的方法,它不會建立對實例的參照,只" "要實例還活著,快取的方法結果就會被保留。" -#: ../../faq/programming.rst:2004 +#: ../../faq/programming.rst:2006 #, fuzzy msgid "" "The advantage is that when an instance is no longer used, the cached method " @@ -3982,7 +4018,7 @@ msgstr "" "好處是當一個實例不再使用時,快取的方法結果會立即釋放。缺點是如果實例累積,累" "積的方法結果也會累積。他們可以不受限制地成長。" -#: ../../faq/programming.rst:2009 +#: ../../faq/programming.rst:2011 msgid "" "The *lru_cache* approach works with methods that have :term:`hashable` " "arguments. It creates a reference to the instance unless special efforts " @@ -3991,7 +4027,7 @@ msgstr "" "*lru_cache* 方法適用於具有\\ :term:`可雜湊 `\\ 引數的方法。除非特別" "努力傳遞弱參照,否則它會建立對實例的參照。" -#: ../../faq/programming.rst:2013 +#: ../../faq/programming.rst:2015 #, fuzzy msgid "" "The advantage of the least recently used algorithm is that the cache is " @@ -4001,11 +4037,11 @@ msgstr "" "最近最少使用演算法的優點是快取受指定的 *maxsize* 限制。缺點是實例會一直保持活" "動狀態,直到它們從快取中老化或快取被清除。" -#: ../../faq/programming.rst:2018 +#: ../../faq/programming.rst:2020 msgid "This example shows the various techniques::" msgstr "這個例子展示了各種技術: ::" -#: ../../faq/programming.rst:2020 +#: ../../faq/programming.rst:2022 msgid "" "class Weather:\n" " \"Lookup weather information on a government website\"\n" @@ -4030,7 +4066,7 @@ msgid "" " # Depends on the station_id, date, and units." msgstr "" -#: ../../faq/programming.rst:2042 +#: ../../faq/programming.rst:2044 #, fuzzy msgid "" "The above example assumes that the *station_id* never changes. If the " @@ -4040,18 +4076,19 @@ msgstr "" "上面的例子假設 *station_id* 永遠不會改變。如果相關的實例屬性是可變的,則 " "*cached_property* 方法無法工作,因為它無法檢測到屬性的更改。" -#: ../../faq/programming.rst:2047 +#: ../../faq/programming.rst:2049 #, fuzzy msgid "" "To make the *lru_cache* approach work when the *station_id* is mutable, the " -"class needs to define the :meth:`~object.__eq__` and :meth:`~object." -"__hash__` methods so that the cache can detect relevant attribute updates::" +"class needs to define the :meth:`~object.__eq__` " +"and :meth:`~object.__hash__` methods so that the cache can detect relevant " +"attribute updates::" msgstr "" -"要在 *station_id* 可變時使 *lru_cache* 方法起作用,該類別需要定義 :meth:" -"`~object.__eq__` 和 :meth:`~object.__hash__` 方法,以便快取可以檢測相關屬性更" -"新: ::" +"要在 *station_id* 可變時使 *lru_cache* 方法起作用,該類別需要定" +"義 :meth:`~object.__eq__` 和 :meth:`~object.__hash__` 方法,以便快取可以檢測" +"相關屬性更新: ::" -#: ../../faq/programming.rst:2051 +#: ../../faq/programming.rst:2053 msgid "" "class Weather:\n" " \"Example with a mutable station identifier\"\n" @@ -4074,15 +4111,15 @@ msgid "" " # Depends on the station_id, date, and units." msgstr "" -#: ../../faq/programming.rst:2073 +#: ../../faq/programming.rst:2075 msgid "Modules" msgstr "模組" -#: ../../faq/programming.rst:2076 +#: ../../faq/programming.rst:2078 msgid "How do I create a .pyc file?" msgstr "如何建立 .pyc 檔案?" -#: ../../faq/programming.rst:2078 +#: ../../faq/programming.rst:2080 #, fuzzy msgid "" "When a module is imported for the first time (or when the source file has " @@ -4096,10 +4133,10 @@ msgstr "" "第一次引入模組時(或者源檔案自建立當前編譯檔案後發生更改時)應在 " "``__pycache__`` 的子目錄中建立包含編譯程式碼的 ``.pyc`` 檔案包含 .py 檔案的目" "錄。 ``.pyc`` 檔案的檔案名以與``.py`` 檔案相同的名稱開頭,以``.pyc`` 結尾,中" -"間部分依賴於特定的``python `` 建立它的二進製檔案。(有關詳細資訊,請參閱 :" -"pep:`3147`。)" +"間部分依賴於特定的``python `` 建立它的二進製檔案。(有關詳細資訊,請參" +"閱 :pep:`3147`。)" -#: ../../faq/programming.rst:2086 +#: ../../faq/programming.rst:2088 #, fuzzy msgid "" "One reason that a ``.pyc`` file may not be created is a permissions problem " @@ -4112,7 +4149,7 @@ msgstr "" "__pycache__ 子目錄。例如,如果你以一個使用者的身份開發但以另一個使用者的身份" "運行,例如你正在使用 Web 服務器進行測試,就會發生這種情況。" -#: ../../faq/programming.rst:2091 +#: ../../faq/programming.rst:2093 #, fuzzy msgid "" "Unless the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable is set, " @@ -4125,13 +4162,13 @@ msgstr "" "組並且 Python 有能力(權限、空閒空間等)建立一個 .pyc 檔案是自動的建立一個" "``__pycache__ `` 子目錄並將編譯後的模組寫入該子目錄。" -#: ../../faq/programming.rst:2096 +#: ../../faq/programming.rst:2098 #, fuzzy msgid "" -"Running Python on a top level script is not considered an import and no ``." -"pyc`` will be created. For example, if you have a top-level module ``foo." -"py`` that imports another module ``xyz.py``, when you run ``foo`` (by typing " -"``python foo.py`` as a shell command), a ``.pyc`` will be created for " +"Running Python on a top level script is not considered an import and no " +"``.pyc`` will be created. For example, if you have a top-level module " +"``foo.py`` that imports another module ``xyz.py``, when you run ``foo`` (by " +"typing ``python foo.py`` as a shell command), a ``.pyc`` will be created for " "``xyz`` because ``xyz`` is imported, but no ``.pyc`` file will be created " "for ``foo`` since ``foo.py`` isn't being imported." msgstr "" @@ -4140,17 +4177,17 @@ msgstr "" "入 ``python foo.py`` 作為一個 shell 命令),將為 xyz 建立一個 .pyc 因為引入" "了 xyz,但是不會為 foo 建立 .pyc 檔案,因為 ` `foo.py`` 沒有被引入。" -#: ../../faq/programming.rst:2103 +#: ../../faq/programming.rst:2105 msgid "" -"If you need to create a ``.pyc`` file for ``foo`` -- that is, to create a ``." -"pyc`` file for a module that is not imported -- you can, using the :mod:" -"`py_compile` and :mod:`compileall` modules." +"If you need to create a ``.pyc`` file for ``foo`` -- that is, to create a " +"``.pyc`` file for a module that is not imported -- you can, using " +"the :mod:`py_compile` and :mod:`compileall` modules." msgstr "" "如果你需要為 ``foo`` 建立一個 ``.pyc`` 檔案 —— 也就是說,要為一個未引入的模組" "建立一個 ``.pyc`` 檔案 —— 你可以使用 :mod:`py_compile` 和 :mod:`compileall` " "模組。" -#: ../../faq/programming.rst:2107 +#: ../../faq/programming.rst:2109 msgid "" "The :mod:`py_compile` module can manually compile any module. One way is to " "use the ``compile()`` function in that module interactively::" @@ -4158,7 +4195,7 @@ msgstr "" ":mod:`py_compile` 模組允許手動編譯任何模組。其中一種方法是在該模組中以交互方" "式使用 ``compile()`` 函式: ::" -#: ../../faq/programming.rst:2110 +#: ../../faq/programming.rst:2112 msgid "" ">>> import py_compile\n" ">>> py_compile.compile('foo.py') " @@ -4166,7 +4203,7 @@ msgstr "" ">>> import py_compile\n" ">>> py_compile.compile('foo.py') " -#: ../../faq/programming.rst:2113 +#: ../../faq/programming.rst:2115 msgid "" "This will write the ``.pyc`` to a ``__pycache__`` subdirectory in the same " "location as ``foo.py`` (or you can override that with the optional parameter " @@ -4175,7 +4212,7 @@ msgstr "" "這會將 ``.pyc`` 寫入與 ``foo.py`` 相同位置的 ``__pycache__`` 子目錄(或者你可" "以使用可選參數 ``cfile`` 覆蓋它)。" -#: ../../faq/programming.rst:2117 +#: ../../faq/programming.rst:2119 #, fuzzy msgid "" "You can also automatically compile all files in a directory or directories " @@ -4186,15 +4223,15 @@ msgstr "" "你還可以使用 :mod:`compileall` 模組自動編譯目錄中的所有檔案。你可以在 shell " "提示符下運行 ``compileall.py`` 並提供包含要編譯的 Python 檔案的目錄路徑: ::" -#: ../../faq/programming.rst:2122 +#: ../../faq/programming.rst:2124 msgid "python -m compileall ." msgstr "python -m compileall ." -#: ../../faq/programming.rst:2126 +#: ../../faq/programming.rst:2128 msgid "How do I find the current module name?" msgstr "如何找到當前模組名稱?" -#: ../../faq/programming.rst:2128 +#: ../../faq/programming.rst:2130 #, fuzzy msgid "" "A module can find out its own module name by looking at the predefined " @@ -4207,7 +4244,7 @@ msgstr "" "值為``'__main__'``,則該程式作為腳本運行。許多通常透過引入使用的模組還提供命" "令行介面或自檢,只有在檢查 ``__name__`` 後才執行此程式碼: ::" -#: ../../faq/programming.rst:2134 +#: ../../faq/programming.rst:2136 msgid "" "def main():\n" " print('Running test...')\n" @@ -4223,19 +4260,19 @@ msgstr "" "if __name__ == '__main__':\n" " main()" -#: ../../faq/programming.rst:2143 +#: ../../faq/programming.rst:2145 msgid "How can I have modules that mutually import each other?" msgstr "要怎樣才能擁有相互引入的模組?" -#: ../../faq/programming.rst:2145 +#: ../../faq/programming.rst:2147 msgid "Suppose you have the following modules:" msgstr "假設你有以下模組:" -#: ../../faq/programming.rst:2147 +#: ../../faq/programming.rst:2149 msgid ":file:`foo.py`::" msgstr ":file:`foo.py`: ::" -#: ../../faq/programming.rst:2149 +#: ../../faq/programming.rst:2151 msgid "" "from bar import bar_var\n" "foo_var = 1" @@ -4243,11 +4280,11 @@ msgstr "" "from bar import bar_var\n" "foo_var = 1" -#: ../../faq/programming.rst:2152 +#: ../../faq/programming.rst:2154 msgid ":file:`bar.py`::" msgstr ":file:`bar.py`: ::" -#: ../../faq/programming.rst:2154 +#: ../../faq/programming.rst:2156 msgid "" "from foo import foo_var\n" "bar_var = 2" @@ -4255,42 +4292,42 @@ msgstr "" "from foo import foo_var\n" "bar_var = 2" -#: ../../faq/programming.rst:2157 +#: ../../faq/programming.rst:2159 msgid "The problem is that the interpreter will perform the following steps:" msgstr "問題是直譯器將執行以下步驟:" -#: ../../faq/programming.rst:2159 +#: ../../faq/programming.rst:2161 msgid "main imports ``foo``" msgstr "主要引入 ``foo``" -#: ../../faq/programming.rst:2160 +#: ../../faq/programming.rst:2162 msgid "Empty globals for ``foo`` are created" msgstr "建立了 ``foo`` 的空全域變數" -#: ../../faq/programming.rst:2161 +#: ../../faq/programming.rst:2163 msgid "``foo`` is compiled and starts executing" msgstr "``foo`` 被編譯並開始執行" -#: ../../faq/programming.rst:2162 +#: ../../faq/programming.rst:2164 msgid "``foo`` imports ``bar``" msgstr "``foo`` 引入 ``bar``" -#: ../../faq/programming.rst:2163 +#: ../../faq/programming.rst:2165 msgid "Empty globals for ``bar`` are created" msgstr "建立了 ``bar`` 的空全域變數" -#: ../../faq/programming.rst:2164 +#: ../../faq/programming.rst:2166 msgid "``bar`` is compiled and starts executing" msgstr "``bar`` 已被編譯並開始執行" -#: ../../faq/programming.rst:2165 +#: ../../faq/programming.rst:2167 msgid "" "``bar`` imports ``foo`` (which is a no-op since there already is a module " "named ``foo``)" msgstr "" "``bar`` 引入 ``foo``\\ (這是一個空操作,因為已經有一個名為 ``foo`` 的模組)" -#: ../../faq/programming.rst:2166 +#: ../../faq/programming.rst:2168 msgid "" "The import mechanism tries to read ``foo_var`` from ``foo`` globals, to set " "``bar.foo_var = foo.foo_var``" @@ -4298,8 +4335,7 @@ msgstr "" "引入機制嘗試從 ``foo`` 全域變數中讀取 ``foo_var``,以設定 ``bar.foo_var = " "foo.foo_var``" -#: ../../faq/programming.rst:2168 -#, fuzzy +#: ../../faq/programming.rst:2170 msgid "" "The last step fails, because Python isn't done with interpreting ``foo`` yet " "and the global symbol dictionary for ``foo`` is still empty." @@ -4307,7 +4343,7 @@ msgstr "" "最後一步失敗了,因為 Python 還沒有完成對 ``foo`` 的直譯,而 ``foo`` 的全域符" "號字典仍然是空的。" -#: ../../faq/programming.rst:2171 +#: ../../faq/programming.rst:2173 #, fuzzy msgid "" "The same thing happens when you use ``import foo``, and then try to access " @@ -4316,52 +4352,52 @@ msgstr "" "當你使用 ``import foo``,然後嘗試在全域程式碼中存取 ``foo.foo_var`` 時,也會" "發生同樣的事情。" -#: ../../faq/programming.rst:2174 +#: ../../faq/programming.rst:2176 msgid "There are (at least) three possible workarounds for this problem." msgstr "此問題有(至少)三種可能的解決方法。" -#: ../../faq/programming.rst:2176 +#: ../../faq/programming.rst:2178 #, fuzzy msgid "" -"Guido van Rossum recommends avoiding all uses of ``from import ..." -"``, and placing all code inside functions. Initializations of global " -"variables and class variables should use constants or built-in functions " -"only. This means everything from an imported module is referenced as " -"``.``." +"Guido van Rossum recommends avoiding all uses of ``from " +"import ...``, and placing all code inside functions. Initializations of " +"global variables and class variables should use constants or built-in " +"functions only. This means everything from an imported module is referenced " +"as ``.``." msgstr "" "Guido van Rossum 建議避免使用``from import ...``,並將所有程式碼放在" "函式中。全域變數和類別變數的初始化應該只使用常數或內建函式。這意味著來自引入" "模組的所有內容都被參照為 ``.``。" -#: ../../faq/programming.rst:2181 +#: ../../faq/programming.rst:2183 msgid "" "Jim Roskind suggests performing steps in the following order in each module:" msgstr "Jim Roskind 建議在每個模組中按以下順序執行各個步驟:" -#: ../../faq/programming.rst:2183 +#: ../../faq/programming.rst:2185 #, fuzzy msgid "" "exports (globals, functions, and classes that don't need imported base " "classes)" msgstr "匯出(不需要引入基底類別的全域變數、函式和類別)" -#: ../../faq/programming.rst:2185 +#: ../../faq/programming.rst:2187 msgid "``import`` statements" msgstr "``import`` 陳述式" -#: ../../faq/programming.rst:2186 +#: ../../faq/programming.rst:2188 msgid "" "active code (including globals that are initialized from imported values)." msgstr "活躍程式碼(包括從引入值初始化的全域變數)。" -#: ../../faq/programming.rst:2188 +#: ../../faq/programming.rst:2190 msgid "" "Van Rossum doesn't like this approach much because the imports appear in a " "strange place, but it does work." msgstr "" "Van Rossum 不太喜歡這種方法,因為引入出現在一個奇怪的地方,但它確實有效。" -#: ../../faq/programming.rst:2191 +#: ../../faq/programming.rst:2193 msgid "" "Matthias Urlichs recommends restructuring your code so that the recursive " "import is not necessary in the first place." @@ -4369,15 +4405,15 @@ msgstr "" "Matthias Urlichs 建議重組 (restructuring) 你的程式碼,以便打從一開始就不需要" "遞迴引入。" -#: ../../faq/programming.rst:2194 +#: ../../faq/programming.rst:2196 msgid "These solutions are not mutually exclusive." msgstr "這些方案並不衝突。" -#: ../../faq/programming.rst:2198 +#: ../../faq/programming.rst:2200 msgid "__import__('x.y.z') returns ; how do I get z?" msgstr "__import__('x.y.z') 回傳 ,那我怎麼得到 z?" -#: ../../faq/programming.rst:2200 +#: ../../faq/programming.rst:2202 #, fuzzy msgid "" "Consider using the convenience function :func:`~importlib.import_module` " @@ -4386,17 +4422,17 @@ msgstr "" "考慮使用來自 :mod:`importlib` 的便利函式 :func:`~importlib.import_module` 代" "替: ::" -#: ../../faq/programming.rst:2203 +#: ../../faq/programming.rst:2205 msgid "z = importlib.import_module('x.y.z')" msgstr "z = importlib.import_module('x.y.z')" -#: ../../faq/programming.rst:2207 +#: ../../faq/programming.rst:2209 msgid "" "When I edit an imported module and reimport it, the changes don't show up. " "Why does this happen?" msgstr "當我編輯需要引入的模組並重新引入它時,更動沒有反應出來。為什麼會這樣?" -#: ../../faq/programming.rst:2209 +#: ../../faq/programming.rst:2211 #, fuzzy msgid "" "For reasons of efficiency as well as consistency, Python only reads the " @@ -4409,7 +4445,7 @@ msgstr "" "一個由許多模組組成的程式中,每個模組都引入相同的基本模組,基本模組將被解析和" "重新解析很多次。要強制重新讀取已更改的模組,請執行以下操作: ::" -#: ../../faq/programming.rst:2215 +#: ../../faq/programming.rst:2217 msgid "" "import importlib\n" "import modname\n" @@ -4419,17 +4455,17 @@ msgstr "" "import modname\n" "importlib.reload(modname)" -#: ../../faq/programming.rst:2219 +#: ../../faq/programming.rst:2221 msgid "" "Warning: this technique is not 100% fool-proof. In particular, modules " "containing statements like ::" msgstr "警告:此技術並非 100% 萬無一失。尤其是包含像這樣陳述式的模組: ::" -#: ../../faq/programming.rst:2222 +#: ../../faq/programming.rst:2224 msgid "from modname import some_objects" msgstr "from modname import some_objects" -#: ../../faq/programming.rst:2224 +#: ../../faq/programming.rst:2226 #, fuzzy msgid "" "will continue to work with the old version of the imported objects. If the " @@ -4440,7 +4476,7 @@ msgstr "" "將繼續使用舊版本的引入物件。如果模組包含類別定義,現有的類別實例將*不會*更新" "為使用新的類別定義。這可能會導致以下自相矛盾的行為: ::" -#: ../../faq/programming.rst:2229 +#: ../../faq/programming.rst:2231 msgid "" ">>> import importlib\n" ">>> import cls\n" @@ -4450,14 +4486,21 @@ msgid "" ">>> isinstance(c, cls.C) # isinstance is false?!?\n" "False" msgstr "" +">>> import importlib\n" +">>> import cls\n" +">>> c = cls.C() # 建立一個 C 的實例\n" +">>> importlib.reload(cls)\n" +"\n" +">>> isinstance(c, cls.C) # isinstance 為 false?!?\n" +"False" -#: ../../faq/programming.rst:2237 +#: ../../faq/programming.rst:2239 msgid "" "The nature of the problem is made clear if you print out the \"identity\" of " "the class objects::" msgstr "如果印出類別物件的「識別性」,問題的本質就很清楚了: ::" -#: ../../faq/programming.rst:2240 +#: ../../faq/programming.rst:2242 msgid "" ">>> hex(id(c.__class__))\n" "'0x7352a0'\n" diff --git a/glossary.po b/glossary.po index 8c54be9e05..780dc58513 100644 --- a/glossary.po +++ b/glossary.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # Translators: # Steven Hsu , 2021-2022 @@ -8,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-31 00:13+0000\n" +"POT-Creation-Date: 2025-01-21 00:13+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-" @@ -69,22 +68,23 @@ msgid "" "define interfaces when other techniques like :func:`hasattr` would be clumsy " "or subtly wrong (for example with :ref:`magic methods `). " "ABCs introduce virtual subclasses, which are classes that don't inherit from " -"a class but are still recognized by :func:`isinstance` and :func:" -"`issubclass`; see the :mod:`abc` module documentation. Python comes with " -"many built-in ABCs for data structures (in the :mod:`collections.abc` " -"module), numbers (in the :mod:`numbers` module), streams (in the :mod:`io` " -"module), import finders and loaders (in the :mod:`importlib.abc` module). " -"You can create your own ABCs with the :mod:`abc` module." +"a class but are still recognized by :func:`isinstance` " +"and :func:`issubclass`; see the :mod:`abc` module documentation. Python " +"comes with many built-in ABCs for data structures (in " +"the :mod:`collections.abc` module), numbers (in the :mod:`numbers` module), " +"streams (in the :mod:`io` module), import finders and loaders (in " +"the :mod:`importlib.abc` module). You can create your own ABCs with " +"the :mod:`abc` module." msgstr "" "抽象基底類別(又稱為 ABC)提供了一種定義介面的方法,作為 :term:`duck-" "typing`\\ (鴨子型別)的補充。其他類似的技術,像是 :func:`hasattr`,則顯得笨" "拙或是帶有細微的錯誤(例如使用\\ :ref:`魔術方法 (magic method) `\\ )。ABC 採用虛擬的 subclass(子類別),它們並不繼承自另一個 class" -"(類別),但仍可被 :func:`isinstance` 及 :func:`issubclass` 辨識;請參閱 :" -"mod:`abc` 模組的說明文件。Python 有許多內建的 ABC,用於資料結構(在 :mod:" -"`collections.abc` 模組)、數字(在 :mod:`numbers` 模組)、串流(在 :mod:`io` " -"模組)及 import 尋檢器和載入器(在 :mod:`importlib.abc` 模組)。你可以使用 :" -"mod:`abc` 模組建立自己的 ABC。" +"(類別),但仍可被 :func:`isinstance` 及 :func:`issubclass` 辨識;請參" +"閱 :mod:`abc` 模組的說明文件。Python 有許多內建的 ABC,用於資料結構" +"(在 :mod:`collections.abc` 模組)、數字(在 :mod:`numbers` 模組)、串流" +"(在 :mod:`io` 模組)及 import 尋檢器和載入器(在 :mod:`importlib.abc` 模" +"組)。你可以使用 :mod:`abc` 模組建立自己的 ABC。" #: ../../glossary.rst:38 msgid "annotation" @@ -112,12 +112,12 @@ msgstr "" #: ../../glossary.rst:50 msgid "" "See :term:`variable annotation`, :term:`function annotation`, :pep:`484` " -"and :pep:`526`, which describe this functionality. Also see :ref:" -"`annotations-howto` for best practices on working with annotations." +"and :pep:`526`, which describe this functionality. Also " +"see :ref:`annotations-howto` for best practices on working with annotations." msgstr "" "請參閱 :term:`variable annotation`、:term:`function annotation`、:pep:`484` " -"和 :pep:`526`,這些章節皆有此功能的說明。關於註釋的最佳實踐方法也請參閱 :ref:" -"`annotations-howto`。" +"和 :pep:`526`,這些章節皆有此功能的說明。關於註釋的最佳實踐方法也請參" +"閱 :ref:`annotations-howto`。" #: ../../glossary.rst:54 msgid "argument" @@ -197,12 +197,12 @@ msgstr "asynchronous context manager(非同步情境管理器)" #: ../../glossary.rst:86 msgid "" "An object which controls the environment seen in an :keyword:`async with` " -"statement by defining :meth:`~object.__aenter__` and :meth:`~object." -"__aexit__` methods. Introduced by :pep:`492`." +"statement by defining :meth:`~object.__aenter__` " +"and :meth:`~object.__aexit__` methods. Introduced by :pep:`492`." msgstr "" -"一個可以控制 :keyword:`async with` 陳述式中所見環境的物件,而它是透過定義 :" -"meth:`~object.__aenter__` 和 :meth:`~object.__aexit__` method(方法)來控制" -"的。由 :pep:`492` 引入。" +"一個可以控制 :keyword:`async with` 陳述式中所見環境的物件,而它是透過定" +"義 :meth:`~object.__aenter__` 和 :meth:`~object.__aexit__` method(方法)來控" +"制的。由 :pep:`492` 引入。" #: ../../glossary.rst:89 msgid "asynchronous generator" @@ -217,8 +217,8 @@ msgid "" msgstr "" "一個會回傳 :term:`asynchronous generator iterator`\\ (非同步產生器疊代器)的" "函式。它看起來像一個以 :keyword:`async def` 定義的協程函式 (coroutine " -"function),但不同的是它包含了 :keyword:`yield` 運算式,能生成一系列可用於 :" -"keyword:`async for` 迴圈的值。" +"function),但不同的是它包含了 :keyword:`yield` 運算式,能生成一系列可用" +"於 :keyword:`async for` 迴圈的值。" #: ../../glossary.rst:96 msgid "" @@ -249,28 +249,28 @@ msgstr "" #: ../../glossary.rst:107 msgid "" -"This is an :term:`asynchronous iterator` which when called using the :meth:" -"`~object.__anext__` method returns an awaitable object which will execute " -"the body of the asynchronous generator function until the next :keyword:" -"`yield` expression." +"This is an :term:`asynchronous iterator` which when called using " +"the :meth:`~object.__anext__` method returns an awaitable object which will " +"execute the body of the asynchronous generator function until the " +"next :keyword:`yield` expression." msgstr "" -"這是一個 :term:`asynchronous iterator`\\ (非同步疊代器),當它以 :meth:" -"`~object.__anext__` method 被呼叫時,會回傳一個可等待物件 (awaitable " -"object),該物件將執行非同步產生器的函式主體,直到遇到下一個 :keyword:`yield` " -"運算式。" +"這是一個 :term:`asynchronous iterator`\\ (非同步疊代器),當它" +"以 :meth:`~object.__anext__` method 被呼叫時,會回傳一個可等待物件 " +"(awaitable object),該物件將執行非同步產生器的函式主體,直到遇到下一" +"個 :keyword:`yield` 運算式。" #: ../../glossary.rst:112 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " -"location execution state (including local variables and pending try-" -"statements). When the *asynchronous generator iterator* effectively resumes " -"with another awaitable returned by :meth:`~object.__anext__`, it picks up " -"where it left off. See :pep:`492` and :pep:`525`." +"execution state (including local variables and pending try-statements). " +"When the *asynchronous generator iterator* effectively resumes with another " +"awaitable returned by :meth:`~object.__anext__`, it picks up where it left " +"off. See :pep:`492` and :pep:`525`." msgstr "" -"每個 :keyword:`yield` 會暫停處理程序,並記住位置執行狀態(包括區域變數及擱置" -"中的 try 陳述式)。當\\ *非同步產生器疊代器*\\ 以另一個被 :meth:`~object." -"__anext__` 回傳的可等待物件有效地回復時,它會從停止的地方繼續執行。請參閱 :" -"pep:`492` 和 :pep:`525`。" +"每個 :keyword:`yield` 會暫停處理程序,並記住執行狀態(包括區域變數及擱置中的 " +"try 陳述式)。當\\ *非同步產生器疊代器*\\ 以另一個" +"被 :meth:`~object.__anext__` 回傳的可等待物件有效地回復時,它會從停止的地方繼" +"續執行。請參閱 :pep:`492` 和 :pep:`525`。" #: ../../glossary.rst:117 msgid "asynchronous iterable" @@ -282,9 +282,9 @@ msgid "" "return an :term:`asynchronous iterator` from its :meth:`~object.__aiter__` " "method. Introduced by :pep:`492`." msgstr "" -"一個物件,它可以在 :keyword:`async for` 陳述式中被使用。必須從它的 :meth:" -"`~object.__aiter__` method 回傳一個 :term:`asynchronous iterator`\\ (非同步" -"疊代器)。由 :pep:`492` 引入。" +"一個物件,它可以在 :keyword:`async for` 陳述式中被使用。必須從它" +"的 :meth:`~object.__aiter__` method 回傳一個 :term:`asynchronous iterator`\\ " +"(非同步疊代器)。由 :pep:`492` 引入。" #: ../../glossary.rst:122 msgid "asynchronous iterator" @@ -292,17 +292,18 @@ msgstr "asynchronous iterator(非同步疊代器)" #: ../../glossary.rst:124 msgid "" -"An object that implements the :meth:`~object.__aiter__` and :meth:`~object." -"__anext__` methods. :meth:`~object.__anext__` must return an :term:" -"`awaitable` object. :keyword:`async for` resolves the awaitables returned by " -"an asynchronous iterator's :meth:`~object.__anext__` method until it raises " -"a :exc:`StopAsyncIteration` exception. Introduced by :pep:`492`." +"An object that implements the :meth:`~object.__aiter__` " +"and :meth:`~object.__anext__` methods. :meth:`~object.__anext__` must " +"return an :term:`awaitable` object. :keyword:`async for` resolves the " +"awaitables returned by an asynchronous iterator's :meth:`~object.__anext__` " +"method until it raises a :exc:`StopAsyncIteration` exception. Introduced " +"by :pep:`492`." msgstr "" "一個實作 :meth:`~object.__aiter__` 和 :meth:`~object.__anext__` method 的物" "件。:meth:`~object.__anext__` 必須回傳一個 :term:`awaitable`\\ (可等待物" "件)。:keyword:`async for` 會解析非同步疊代器的 :meth:`~object.__anext__` " -"method 所回傳的可等待物件,直到它引發 :exc:`StopAsyncIteration` 例外。由 :" -"pep:`492` 引入。" +"method 所回傳的可等待物件,直到它引發 :exc:`StopAsyncIteration` 例外。" +"由 :pep:`492` 引入。" #: ../../glossary.rst:129 msgid "attribute" @@ -320,10 +321,10 @@ msgstr "" #: ../../glossary.rst:136 msgid "" "It is possible to give an object an attribute whose name is not an " -"identifier as defined by :ref:`identifiers`, for example using :func:" -"`setattr`, if the object allows it. Such an attribute will not be accessible " -"using a dotted expression, and would instead need to be retrieved with :func:" -"`getattr`." +"identifier as defined by :ref:`identifiers`, for example " +"using :func:`setattr`, if the object allows it. Such an attribute will not " +"be accessible using a dotted expression, and would instead need to be " +"retrieved with :func:`getattr`." msgstr "" "如果一個物件允許,給予該物件一個名稱不是由\\ :ref:`identifiers`\\ 所定義之識" "別符 (identifier) 的屬性是有可能的,例如使用 :func:`setattr`。像這樣的屬性將" @@ -335,13 +336,13 @@ msgstr "awaitable(可等待物件)" #: ../../glossary.rst:143 msgid "" -"An object that can be used in an :keyword:`await` expression. Can be a :" -"term:`coroutine` or an object with an :meth:`~object.__await__` method. See " -"also :pep:`492`." +"An object that can be used in an :keyword:`await` expression. Can be " +"a :term:`coroutine` or an object with an :meth:`~object.__await__` method. " +"See also :pep:`492`." msgstr "" -"一個可以在 :keyword:`await` 運算式中被使用的物件。它可以是一個 :term:" -"`coroutine`\\ (協程),或是一個有 :meth:`~object.__await__` method 的物件。" -"另請參閱 :pep:`492`。" +"一個可以在 :keyword:`await` 運算式中被使用的物件。它可以是一" +"個 :term:`coroutine`\\ (協程),或是一個有 :meth:`~object.__await__` method " +"的物件。另請參閱 :pep:`492`。" #: ../../glossary.rst:146 msgid "BDFL" @@ -349,8 +350,8 @@ msgstr "BDFL" #: ../../glossary.rst:148 msgid "" -"Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator." +"Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator." msgstr "" "Benevolent Dictator For Life(終身仁慈獨裁者),又名 `Guido van Rossum " "`_,Python 的創造者。" @@ -363,23 +364,23 @@ 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` 實例。" +"`、:data:`sys.stdout.buffer `,以" +"及 :class:`io.BytesIO` 和 :class:`gzip.GzipFile` 實例。" #: ../../glossary.rst:159 msgid "" -"See also :term:`text file` for a file object able to read and write :class:" -"`str` objects." +"See also :term:`text file` for a file object able to read and " +"write :class:`str` objects." msgstr "" -"另請參閱 :term:`text file`\\ (文字檔案),它是一個能夠讀取和寫入 :class:" -"`str` 物件的檔案物件。" +"另請參閱 :term:`text file`\\ (文字檔案),它是一個能夠讀取和寫" +"入 :class:`str` 物件的檔案物件。" #: ../../glossary.rst:161 msgid "borrowed reference" @@ -401,8 +402,8 @@ msgstr "" msgid "" "Calling :c:func:`Py_INCREF` on the :term:`borrowed reference` is recommended " "to convert it to a :term:`strong reference` in-place, except when the object " -"cannot be destroyed before the last usage of the borrowed reference. The :c:" -"func:`Py_NewRef` function can be used to create a new :term:`strong " +"cannot be destroyed before the last usage of the borrowed reference. " +"The :c:func:`Py_NewRef` function can be used to create a new :term:`strong " "reference`." msgstr "" "對 :term:`borrowed reference` 呼叫 :c:func:`Py_INCREF` 以將它原地 (in-place) " @@ -416,12 +417,12 @@ msgstr "bytes-like object(類位元組串物件)" #: ../../glossary.rst:176 msgid "" -"An object that supports the :ref:`bufferobjects` and can export a C-:term:" -"`contiguous` buffer. This includes all :class:`bytes`, :class:`bytearray`, " -"and :class:`array.array` objects, as well as many common :class:`memoryview` " -"objects. Bytes-like objects can be used for various operations that work " -"with binary data; these include compression, saving to a binary file, and " -"sending over a socket." +"An object that supports the :ref:`bufferobjects` and can export a " +"C-:term:`contiguous` buffer. This includes " +"all :class:`bytes`, :class:`bytearray`, and :class:`array.array` objects, as " +"well as many common :class:`memoryview` objects. Bytes-like objects can be " +"used for various operations that work with binary data; these include " +"compression, saving to a binary file, and sending over a socket." msgstr "" "一個支援\\ :ref:`bufferobjects`\\ 且能夠匯出 C-:term:`contiguous` 緩衝區的物" "件。這包括所有的 :class:`bytes`、:class:`bytearray` 和 :class:`array.array` " @@ -432,9 +433,9 @@ msgstr "" msgid "" "Some operations need the binary data to be mutable. The documentation often " "refers to these as \"read-write bytes-like objects\". Example mutable " -"buffer objects include :class:`bytearray` and a :class:`memoryview` of a :" -"class:`bytearray`. Other operations require the binary data to be stored in " -"immutable objects (\"read-only bytes-like objects\"); examples of these " +"buffer objects include :class:`bytearray` and a :class:`memoryview` of " +"a :class:`bytearray`. Other operations require the binary data to be stored " +"in immutable objects (\"read-only bytes-like objects\"); examples of these " "include :class:`bytes` and a :class:`memoryview` of a :class:`bytes` object." msgstr "" "有些運算需要二進位資料是可變的。說明文件通常會將這些物件稱為「可讀寫的類位元" @@ -468,8 +469,8 @@ msgstr "" #: ../../glossary.rst:203 msgid "" -"A list of bytecode instructions can be found in the documentation for :ref:" -"`the dis module `." +"A list of bytecode instructions can be found in the documentation " +"for :ref:`the dis module `." msgstr "" "位元組碼的指令列表可以在 :ref:`dis 模組 `\\ 的說明文件中找到。" @@ -482,8 +483,8 @@ msgid "" "A callable is an object that can be called, possibly with a set of arguments " "(see :term:`argument`), with the following syntax::" msgstr "" -"一個 callable 是可以被呼叫的物件,呼叫時可能以下列形式帶有一組引數(請見 :" -"term:`argument`): ::" +"一個 callable 是可以被呼叫的物件,呼叫時可能以下列形式帶有一組引數(請" +"見 :term:`argument`): ::" #: ../../glossary.rst:210 msgid "callable(argument1, argument2, argumentN)" @@ -495,8 +496,8 @@ msgid "" "instance of a class that implements the :meth:`~object.__call__` method is " "also a callable." msgstr "" -"一個 :term:`function` 與其延伸的 :term:`method` 都是 callable。一個有實作 :" -"meth:`~object.__call__` 方法的 class 之實例也是個 callable。" +"一個 :term:`function` 與其延伸的 :term:`method` 都是 callable。一個有實" +"作 :meth:`~object.__call__` 方法的 class 之實例也是個 callable。" #: ../../glossary.rst:215 msgid "callback" @@ -541,9 +542,9 @@ msgstr "closure variable(閉包變數)" msgid "" "A :term:`free variable` referenced from a :term:`nested scope` that is " "defined in an outer scope rather than being resolved at runtime from the " -"globals or builtin namespaces. May be explicitly defined with the :keyword:" -"`nonlocal` keyword to allow write access, or implicitly defined if the " -"variable is only being read." +"globals or builtin namespaces. May be explicitly defined with " +"the :keyword:`nonlocal` keyword to allow write access, or implicitly defined " +"if the variable is only being read." msgstr "" "從外部作用域中定義且從\\ :term:`巢狀作用域 `\\ 參照的\\ :term:`" "自由變數 `,不是於 runtime 從全域或內建命名空間解析。可以使" @@ -608,10 +609,10 @@ msgstr "" "一個我們熟悉的實數系統的擴充,在此所有數字都會被表示為一個實部和一個虛部之" "和。虛數就是虛數單位(``-1`` 的平方根)的實數倍,此單位通常在數學中被寫為 " "``i``,在工程學中被寫為 ``j``。Python 內建了對複數的支援,它是用後者的記法來" -"表示複數;虛部會帶著一個後綴的 ``j`` 被編寫,例如 ``3+1j``。若要將 :mod:" -"`math` 模組內的工具等效地用於複數,請使用 :mod:`cmath` 模組。複數的使用是一個" -"相當進階的數學功能。如果你沒有察覺到對它們的需求,那麼幾乎能確定你可以安全地" -"忽略它們。" +"表示複數;虛部會帶著一個後綴的 ``j`` 被編寫,例如 ``3+1j``。若要" +"將 :mod:`math` 模組內的工具等效地用於複數,請使用 :mod:`cmath` 模組。複數的使" +"用是一個相當進階的數學功能。如果你沒有察覺到對它們的需求,那麼幾乎能確定你可" +"以安全地忽略它們。" #: ../../glossary.rst:262 msgid "context" @@ -631,9 +632,10 @@ msgstr "" #: ../../glossary.rst:269 msgid "" -"The collection of key­value bindings associated with a particular :class:" -"`contextvars.Context` object and accessed via :class:`~contextvars." -"ContextVar` objects. Also see :term:`context variable`." +"The collection of key­value bindings associated with a " +"particular :class:`contextvars.Context` object and accessed " +"via :class:`~contextvars.ContextVar` objects. Also see :term:`context " +"variable`." msgstr "" #: ../../glossary.rst:273 @@ -651,8 +653,8 @@ msgid "" "The :meth:`~object.__enter__` and :meth:`~object.__exit__` methods called by " "the :keyword:`with` statement. See :pep:`343`." msgstr "" -"由 :keyword:`with` 陳述式所呼叫的 :meth:`~object.__enter__` 和 :meth:" -"`~object.__exit__` 方法。另請參閱 :pep:`343`。" +"由 :keyword:`with` 陳述式所呼叫的 :meth:`~object.__enter__` " +"和 :meth:`~object.__exit__` 方法。另請參閱 :pep:`343`。" #: ../../glossary.rst:279 msgid "context manager" @@ -661,8 +663,8 @@ msgstr "context manager(情境管理器)" #: ../../glossary.rst:281 msgid "" "An object which implements the :term:`context management protocol` and " -"controls the environment seen in a :keyword:`with` statement. See :pep:" -"`343`." +"controls the environment seen in a :keyword:`with` statement. " +"See :pep:`343`." msgstr "" #: ../../glossary.rst:284 @@ -720,13 +722,14 @@ msgstr "coroutine function(協程函式)" #: ../../glossary.rst:311 msgid "" "A function which returns a :term:`coroutine` object. A coroutine function " -"may be defined with the :keyword:`async def` statement, and may contain :" -"keyword:`await`, :keyword:`async for`, and :keyword:`async with` keywords. " -"These were introduced by :pep:`492`." +"may be defined with the :keyword:`async def` statement, and may " +"contain :keyword:`await`, :keyword:`async for`, and :keyword:`async with` " +"keywords. These were introduced by :pep:`492`." msgstr "" -"一個回傳 :term:`coroutine`\\ (協程)物件的函式。一個協程函式能以 :keyword:" -"`async def` 陳述式被定義,並可能會包含 :keyword:`await`、:keyword:`async " -"for` 和 :keyword:`async with` 關鍵字。這些關鍵字由 :pep:`492` 引入。" +"一個回傳 :term:`coroutine`\\ (協程)物件的函式。一個協程函式能" +"以 :keyword:`async def` 陳述式被定義,並可能會包" +"含 :keyword:`await`、:keyword:`async for` 和 :keyword:`async with` 關鍵字。這" +"些關鍵字由 :pep:`492` 引入。" #: ../../glossary.rst:316 msgid "CPython" @@ -752,9 +755,9 @@ msgid "" "The :term:`context` (:class:`contextvars.Context` object) that is currently " "used by :class:`~contextvars.ContextVar` objects to access (get or set) the " "values of :term:`context variables `. Each thread has its " -"own current context. Frameworks for executing asynchronous tasks (see :mod:" -"`asyncio`) associate each task with a context which becomes the current " -"context whenever the task starts or resumes execution." +"own current context. Frameworks for executing asynchronous tasks " +"(see :mod:`asyncio`) associate each task with a context which becomes the " +"current context whenever the task starts or resumes execution." msgstr "" #: ../../glossary.rst:330 @@ -801,8 +804,8 @@ msgid "" "the documentation for :ref:`function definitions ` and :ref:`class " "definitions ` for more about decorators." msgstr "" -"Class 也存在相同的概念,但在那裡比較不常用。關於裝飾器的更多內容,請參閱\\ :" -"ref:`函式定義 `\\ 和 :ref:`class 定義 `\\ 的說明文件。" +"Class 也存在相同的概念,但在那裡比較不常用。關於裝飾器的更多內容,請參閱" +"\\ :ref:`函式定義 `\\ 和 :ref:`class 定義 `\\ 的說明文件。" #: ../../glossary.rst:350 msgid "descriptor" @@ -810,23 +813,24 @@ msgstr "descriptor(描述器)" #: ../../glossary.rst:352 msgid "" -"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(父類別)的參照。" +"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:363 msgid "" @@ -871,11 +875,11 @@ msgstr "dictionary view(字典檢視)" #: ../../glossary.rst:379 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 " -"dictionary’s entries, which means that when the dictionary changes, the view " -"reflects these changes. To force the dictionary view to become a full list " -"use ``list(dictview)``. See :ref:`dict-views`." +"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 dictionary’s entries, which means that when the dictionary " +"changes, the view reflects these changes. To force the dictionary view to " +"become a full list use ``list(dictview)``. See :ref:`dict-views`." msgstr "" "從 :meth:`dict.keys`、:meth:`dict.values` 及 :meth:`dict.items` 回傳的物件被" "稱為字典檢視。它們提供了字典中項目的動態檢視,這表示當字典有變動時,該檢視會" @@ -895,9 +899,9 @@ msgid "" "introspection, it is the canonical place for documentation of the object." msgstr "" "一個在 class、函式或模組中,作為第一個運算式出現的字串文本。雖然它在套件執行" -"時會被忽略,但它會被編譯器辨識,並被放入所屬 class、函式或模組的 :attr:" -"`~definition.__doc__` 屬性中。由於說明字串可以透過內省 (introspection) 來瀏" -"覽,因此它是物件的說明文件存放的標準位置。" +"時會被忽略,但它會被編譯器辨識,並被放入所屬 class、函式或模組" +"的 :attr:`~definition.__doc__` 屬性中。由於說明字串可以透過內省 " +"(introspection) 來瀏覽,因此它是物件的說明文件存放的標準位置。" #: ../../glossary.rst:393 msgid "duck-typing" @@ -910,10 +914,10 @@ msgid "" "called or used (\"If it looks like a duck and quacks like a duck, it must be " "a duck.\") By emphasizing interfaces rather than specific types, well-" "designed code improves its flexibility by allowing polymorphic " -"substitution. Duck-typing avoids tests using :func:`type` or :func:" -"`isinstance`. (Note, however, that duck-typing can be complemented with :" -"term:`abstract base classes `.) Instead, it typically " -"employs :func:`hasattr` tests or :term:`EAFP` programming." +"substitution. Duck-typing avoids tests using :func:`type` " +"or :func:`isinstance`. (Note, however, that duck-typing can be complemented " +"with :term:`abstract base classes `.) Instead, it " +"typically employs :func:`hasattr` tests or :term:`EAFP` programming." msgstr "" "一種程式設計風格,它不是藉由檢查一個物件的型別來確定它是否具有正確的介面;取" "而代之的是,method 或屬性會單純地被呼叫或使用。(「如果它看起來像一隻鴨子而且" @@ -939,9 +943,9 @@ msgid "" msgstr "" "Easier to ask for forgiveness than permission.(請求寬恕比請求許可更容易。)" "這種常見的 Python 編碼風格會先假設有效的鍵或屬性的存在,並在該假設被推翻時再" -"捕獲例外。這種乾淨且快速的風格,其特色是存在許多的 :keyword:`try` 和 :" -"keyword:`except` 陳述式。該技術與許多其他語言(例如 C)常見的 :term:`LBYL` 風" -"格形成了對比。" +"捕獲例外。這種乾淨且快速的風格,其特色是存在許多的 :keyword:`try` " +"和 :keyword:`except` 陳述式。該技術與許多其他語言(例如 C)常見" +"的 :term:`LBYL` 風格形成了對比。" #: ../../glossary.rst:412 msgid "expression" @@ -1015,9 +1019,10 @@ msgid "" "The canonical way to create a file object is by using the :func:`open` " "function." msgstr "" -"實際上,有三種檔案物件:原始的\\ :term:`二進位檔案 `、緩衝的\\ :" -"term:`二進位檔案 `\\ 和\\ :term:`文字檔案 `。它們的介" -"面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:`open` 函式。" +"實際上,有三種檔案物件:原始的\\ :term:`二進位檔案 `、緩衝的" +"\\ :term:`二進位檔案 `\\ 和\\ :term:`文字檔案 `。它們" +"的介面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:`open` 函" +"式。" #: ../../glossary.rst:445 msgid "file-like object" @@ -1050,9 +1055,9 @@ msgstr "" #: ../../glossary.rst:457 msgid "" -"The :func:`sys.getfilesystemencoding` and :func:`sys." -"getfilesystemencodeerrors` functions can be used to get the filesystem " -"encoding and error handler." +"The :func:`sys.getfilesystemencoding` " +"and :func:`sys.getfilesystemencodeerrors` functions can be used to get the " +"filesystem encoding and error handler." msgstr "" ":func:`sys.getfilesystemencoding` 和 :func:`sys.getfilesystemencodeerrors` 函" "式可用於取得檔案系統編碼和錯誤處理函式。" @@ -1060,14 +1065,14 @@ msgstr "" #: ../../glossary.rst:461 msgid "" "The :term:`filesystem encoding and error handler` are configured at Python " -"startup by the :c:func:`PyConfig_Read` function: see :c:member:`~PyConfig." -"filesystem_encoding` and :c:member:`~PyConfig.filesystem_errors` members of :" -"c:type:`PyConfig`." +"startup by the :c:func:`PyConfig_Read` function: " +"see :c:member:`~PyConfig.filesystem_encoding` " +"and :c:member:`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." msgstr "" ":term:`filesystem encoding and error handler`\\ (檔案系統編碼和錯誤處理函" -"式)會在 Python 啟動時由 :c:func:`PyConfig_Read` 函式來配置:請參閱 :c:" -"member:`~PyConfig.filesystem_encoding`,以及 :c:type:`PyConfig` 的成員 :c:" -"member:`~PyConfig.filesystem_errors`。" +"式)會在 Python 啟動時由 :c:func:`PyConfig_Read` 函式來配置:請參" +"閱 :c:member:`~PyConfig.filesystem_encoding`,以及 :c:type:`PyConfig` 的成" +"員 :c:member:`~PyConfig.filesystem_errors`。" #: ../../glossary.rst:466 msgid "See also the :term:`locale encoding`." @@ -1123,8 +1128,8 @@ msgstr "free threading(自由執行緒)" #: ../../glossary.rst:486 msgid "" "A threading model where multiple threads can run Python bytecode " -"simultaneously within the same interpreter. This is in contrast to the :" -"term:`global interpreter lock` which allows only one thread to execute " +"simultaneously within the same interpreter. This is in contrast to " +"the :term:`global interpreter lock` which allows only one thread to execute " "Python bytecode at a time. See :pep:`703`." msgstr "" "為一種執行緒模型,多個執行緒可以在同一直譯器中同時運行 Python 位元組碼。這與" @@ -1153,13 +1158,13 @@ msgstr "function(函式)" 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 " -"execution of the body. See also :term:`parameter`, :term:`method`, and the :" -"ref:`function` section." +"execution of the body. See also :term:`parameter`, :term:`method`, and " +"the :ref:`function` section." msgstr "" "一連串的陳述式,它能夠向呼叫者回傳一些值。它也可以被傳遞零個或多個\\ :term:`" -"引數 `,這些引數可被使用於函式本體的執行。另請參閱 :term:" -"`parameter`\\ (參數)、:term:`method`\\ (方法),以及\\ :ref:`function`\\ " -"章節。" +"引數 `,這些引數可被使用於函式本體的執行。另請參" +"閱 :term:`parameter`\\ (參數)、:term:`method`\\ (方法),以及" +"\\ :ref:`function`\\ 章節。" #: ../../glossary.rst:503 msgid "function annotation" @@ -1207,8 +1212,8 @@ msgstr "__future__" msgid "" "A :ref:`future statement `, ``from __future__ import ``, " "directs the compiler to compile the current module using syntax or semantics " -"that will become standard in a future release of Python. The :mod:" -"`__future__` module documents the possible values of *feature*. By " +"that will become standard in a future release of Python. " +"The :mod:`__future__` module documents the possible values of *feature*. By " "importing this module and evaluating its variables, you can see when a new " "feature was first added to the language and when it will (or did) become the " "default::" @@ -1280,13 +1285,13 @@ msgstr "一個由 :term:`generator`\\ (產生器)函式所建立的物件。 #: ../../glossary.rst:556 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " -"location execution state (including local variables and pending try-" -"statements). When the *generator iterator* resumes, it picks up where it " -"left off (in contrast to functions which start fresh on every invocation)." +"execution state (including local variables and pending try-statements). " +"When the *generator iterator* resumes, it picks up where it left off (in " +"contrast to functions which start fresh on every invocation)." msgstr "" -"每個 :keyword:`yield` 會暫停處理程序,並記住位置執行狀態(包括區域變數及擱置" -"中的 try 陳述式)。當\\ *產生器疊代器*\\ 回復時,它會從停止的地方繼續執行(與" -"那些每次調用時都要重新開始的函式有所不同)。" +"每個 :keyword:`yield` 會暫停處理程序,並記住執行狀態(包括區域變數及擱置中的 " +"try 陳述式)。當\\ *產生器疊代器*\\ 回復時,它會從停止的地方繼續執行(與那些" +"每次調用時都要重新開始的函式有所不同)。" #: ../../glossary.rst:562 ../../glossary.rst:563 msgid "generator expression" @@ -1327,11 +1332,11 @@ msgstr "" #: ../../glossary.rst:578 msgid "" -"See also the :term:`single dispatch` glossary entry, the :func:`functools." -"singledispatch` decorator, and :pep:`443`." +"See also the :term:`single dispatch` glossary entry, " +"the :func:`functools.singledispatch` decorator, and :pep:`443`." msgstr "" -"另請參閱 :term:`single dispatch`\\ (單一調度)術語表條目、:func:`functools." -"singledispatch` 裝飾器和 :pep:`443`。" +"另請參閱 :term:`single dispatch`\\ (單一調度)術語表條" +"目、:func:`functools.singledispatch` 裝飾器和 :pep:`443`。" #: ../../glossary.rst:580 msgid "generic type" @@ -1340,20 +1345,21 @@ msgstr "generic type(泛型型別)" #: ../../glossary.rst:582 msgid "" "A :term:`type` that can be parameterized; typically a :ref:`container " -"class` such as :class:`list` or :class:`dict`. Used for :" -"term:`type hints ` and :term:`annotations `." +"class` such as :class:`list` or :class:`dict`. Used " +"for :term:`type hints ` and :term:`annotations `." msgstr "" -"一個能夠被參數化 (parameterized) 的 :term:`type`\\ (型別);通常是一個 :ref:" -"`容器型別 `,像是 :class:`list` 和 :class:`dict`。它被用於" -"\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `。" +"一個能夠被參數化 (parameterized) 的 :term:`type`\\ (型別);通常是一" +"個 :ref:`容器型別 `,像是 :class:`list` 和 :class:`dict`。它" +"被用於\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `。" #: ../../glossary.rst:587 msgid "" -"For more details, see :ref:`generic alias types`, :pep:" -"`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." +"For more details, see :ref:`generic alias types`, :pep:`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` " +"module." msgstr "" -"詳情請參閱\\ :ref:`泛型別名型別 `、:pep:`483`、:pep:" -"`484`、:pep:`585` 和 :mod:`typing` 模組。" +"詳情請參閱\\ :ref:`泛型別名型別 `、:pep:`483`、:pep:`484`、:pep:`585` 和 :mod:`typing` 模組。" #: ../../glossary.rst:589 msgid "GIL" @@ -1434,10 +1440,10 @@ msgid "" "compared to other objects (it needs an :meth:`~object.__eq__` method). " "Hashable objects which compare equal must have the same hash value." msgstr "" -"如果一個物件有一個雜湊值,該值在其生命週期中永不改變(它需要一個 :meth:" -"`~object.__hash__` method),且可與其他物件互相比較(它需要一個 :meth:" -"`~object.__eq__` method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結果為相等的" -"多個可雜湊物件,它們必須擁有相同的雜湊值。" +"如果一個物件有一個雜湊值,該值在其生命週期中永不改變(它需要一" +"個 :meth:`~object.__hash__` method),且可與其他物件互相比較(它需要一" +"個 :meth:`~object.__eq__` method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結" +"果為相等的多個可雜湊物件,它們必須擁有相同的雜湊值。" #: ../../glossary.rst:627 msgid "" @@ -1482,8 +1488,8 @@ msgstr "immortal(不滅)" #: ../../glossary.rst:644 msgid "" -"*Immortal objects* are a CPython implementation detail introduced in :pep:" -"`683`." +"*Immortal objects* are a CPython implementation detail introduced " +"in :pep:`683`." msgstr "*不滅物件 (Immortal objects)* 是 :pep:`683` 引入的 CPython 實作細節。" #: ../../glossary.rst:647 @@ -1493,8 +1499,8 @@ msgid "" "example, :const:`True` and :const:`None` are immortal in CPython." msgstr "" "如果一個物件是不滅的,它的\\ :term:`參照計數 `\\ 永遠不會被" -"修改,因此在直譯器運行時它永遠不會被釋放。例如,:const:`True` 和 :const:" -"`None` 在 CPython 中是不滅的。" +"修改,因此在直譯器運行時它永遠不會被釋放。例如,:const:`True` " +"和 :const:`None` 在 CPython 中是不滅的。" #: ../../glossary.rst:650 msgid "immutable" @@ -1546,11 +1552,11 @@ msgstr "importer(引入器)" #: ../../glossary.rst:670 msgid "" -"An object that both finds and loads a module; both a :term:`finder` and :" -"term:`loader` object." +"An object that both finds and loads a module; both a :term:`finder` " +"and :term:`loader` object." msgstr "" -"一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也是 :term:" -"`loader`\\ (載入器)物件。" +"一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也" +"是 :term:`loader`\\ (載入器)物件。" #: ../../glossary.rst:672 msgid "interactive" @@ -1596,12 +1602,12 @@ msgstr "interpreter shutdown(直譯器關閉)" 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 " -"critical internal structures. It also makes several calls to the :term:" -"`garbage collector `. This can trigger the execution of " -"code in user-defined destructors or weakref callbacks. Code executed during " -"the shutdown phase can encounter various exceptions as the resources it " -"relies on may not function anymore (common examples are library modules or " -"the warnings machinery)." +"critical internal structures. It also makes several calls to " +"the :term:`garbage collector `. This can trigger the " +"execution of code in user-defined destructors or weakref callbacks. Code " +"executed during the shutdown phase can encounter various exceptions as the " +"resources it relies on may not function anymore (common examples are library " +"modules or the warnings machinery)." msgstr "" "當 Python 直譯器被要求關閉時,它會進入一個特殊階段,在此它逐漸釋放所有被配置" "的資源,例如模組和各種關鍵內部結構。它也會多次呼叫\\ :term:`垃圾回收器 " @@ -1625,37 +1631,39 @@ msgstr "iterable(可疊代物件)" 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:`~iterator.__iter__` method or with a :meth:`~object.__getitem__` " -"method that implements :term:`sequence` semantics." +"and :class:`tuple`) and some non-sequence types " +"like :class:`dict`, :term:`file objects `, and objects of any " +"classes you define with an :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:`~iterator.__iter__` method 或是實作 :term:" -"`sequence`\\ (序列)語意的 :meth:`~object.__getitem__` method,該物件就是可" -"疊代物件。" +"是 :class:`list`、:class:`str` 和 :class:`tuple`\\ )和某些非序列型別,像" +"是 :class:`dict`、:term:`檔案物件 `,以及你所定義的任何 class 物" +"件,只要那些 class 有 :meth:`~iterator.__iter__` method 或是實" +"作 :term:`sequence`\\ (序列)語意的 :meth:`~object.__getitem__` method,該物" +"件就是可疊代物件。" #: ../../glossary.rst:713 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 :" -"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` 或自行處理疊代器物" -"件。:keyword:`for` 陳述式會自動地為你處理這些事,它會建立一個暫時性的未命名變" -"數,用於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、:" -"term:`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" +"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 :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` 或自行處理" +"疊代器物件。:keyword:`for` 陳述式會自動地為你處理這些事,它會建立一個暫時性的" +"未命名變數,用於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代" +"器)、:term:`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" #: ../../glossary.rst:723 msgid "iterator" @@ -1663,32 +1671,33 @@ msgstr "iterator(疊代器)" #: ../../glossary.rst:725 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:`~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." +"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:`~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:`~iterator.__iter__` method,它會回傳" -"疊代器物件本身,所以每個疊代器也都是可疊代物件,且可以用於大多數適用其他可疊" -"代物件的場合。一個明顯的例外,是嘗試多遍疊代 (multiple iteration passes) 的程" -"式碼。一個容器物件(像是 :class:`list`)在每次你將它傳遞給 :func:`iter` 函式" -"或在 :keyword:`for` 迴圈中使用它時,都會產生一個全新的疊代器。使用疊代器嘗試" -"此事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物" -"件,使其看起來就像一個空的容器。" +"任何對其 :meth:`!__next__` method 的進一步呼叫,都只會再次引" +"發 :exc:`StopIteration`。疊代器必須有一個 :meth:`~iterator.__iter__` method," +"它會回傳疊代器物件本身,所以每個疊代器也都是可疊代物件,且可以用於大多數適用" +"其他可疊代物件的場合。一個明顯的例外,是嘗試多遍疊代 (multiple iteration " +"passes) 的程式碼。一個容器物件(像是 :class:`list`)在每次你將它傳遞" +"給 :func:`iter` 函式或在 :keyword:`for` 迴圈中使用它時,都會產生一個全新的疊" +"代器。使用疊代器嘗試此事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一" +"個已被用盡的疊代器物件,使其看起來就像一個空的容器。" #: ../../glossary.rst:740 msgid "More information can be found in :ref:`typeiter`." @@ -1696,13 +1705,14 @@ msgstr "在\\ :ref:`typeiter`\\ 文中可以找到更多資訊。" #: ../../glossary.rst:744 msgid "" -"CPython does not consistently apply the requirement that an iterator define :" -"meth:`~iterator.__iter__`. And also please note that the free-threading " -"CPython does not guarantee the thread-safety of iterator operations." +"CPython does not consistently apply the requirement that an iterator " +"define :meth:`~iterator.__iter__`. And also please note that the free-" +"threading CPython does not guarantee the thread-safety of iterator " +"operations." msgstr "" -"CPython 並不是始終如一地都會檢查「疊代器有定義 :meth:`~iterator." -"__iter__`\\ 」這個規定。另請注意,free-threading(自由執行緒)CPython 不保證" -"疊代器操作的執行緒安全。" +"CPython 並不是始終如一地都會檢查「疊代器有定" +"義 :meth:`~iterator.__iter__`\\ 」這個規定。另請注意,free-threading(自由執" +"行緒)CPython 不保證疊代器操作的執行緒安全。" #: ../../glossary.rst:749 msgid "key function" @@ -1721,37 +1731,37 @@ msgstr "" #: ../../glossary.rst:756 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`, :" -"meth:`list.sort`, :func:`heapq.merge`, :func:`heapq.nsmallest`, :func:`heapq." -"nlargest`, and :func:`itertools.groupby`." +"ordered or grouped. They " +"include :func:`min`, :func:`max`, :func:`sorted`, :meth:`list.sort`, :func:`heapq.merge`, :func:`heapq.nsmallest`, :func:`heapq.nlargest`, " +"and :func:`itertools.groupby`." msgstr "" -"Python 中的許多工具,都接受以鍵函式來控制元素被定序或分組的方式。它們包括 :" -"func:`min`、:func:`max`、:func:`sorted`、:meth:`list.sort`、:func:`heapq." -"merge`、:func:`heapq.nsmallest`、:func:`heapq.nlargest` 和 :func:`itertools." -"groupby`。" +"Python 中的許多工具,都接受以鍵函式來控制元素被定序或分組的方式。它們包" +"括 :func:`min`、:func:`max`、:func:`sorted`、:meth:`list.sort`、:func:`heapq.merge`、:func:`heapq.nsmallest`、:func:`heapq.nlargest` " +"和 :func:`itertools.groupby`。" #: ../../glossary.rst:762 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. " -"Alternatively, a key function can be built from a :keyword:`lambda` " -"expression such as ``lambda r: (r[0], r[2])``. Also, :func:`operator." -"attrgetter`, :func:`operator.itemgetter`, and :func:`operator.methodcaller` " -"are three key function constructors. See the :ref:`Sorting HOW TO " -"` for examples of how to create and use key functions." +"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. Alternatively, a key function can be built from " +"a :keyword:`lambda` expression such as ``lambda r: (r[0], r[2])``. " +"Also, :func:`operator.attrgetter`, :func:`operator.itemgetter`, " +"and :func:`operator.methodcaller` are three key function constructors. See " +"the :ref:`Sorting HOW TO ` for examples of how to create and " +"use key functions." msgstr "" "有幾種方法可以建立一個鍵函式。例如,:meth:`str.lower` method 可以作為不分大小" "寫排序的鍵函式。或者,一個鍵函式也可以從 :keyword:`lambda` 運算式被建造,例" -"如 ``lambda r: (r[0], r[2])``。另外,:func:`operator.attrgetter`、:func:" -"`operator.itemgetter` 和 :func:`operator.methodcaller` 為三個鍵函式的建構函" -"式 (constructor)。關於如何建立和使用鍵函式的範例,請參閱\\ :ref:`如何排序 " -"`。" +"如 ``lambda r: (r[0], r[2])``。另" +"外,:func:`operator.attrgetter`、:func:`operator.itemgetter` " +"和 :func:`operator.methodcaller` 為三個鍵函式的建構函式 (constructor)。關於如" +"何建立和使用鍵函式的範例,請參閱\\ :ref:`如何排序 `。" #: ../../glossary.rst:769 msgid "keyword argument" msgstr "keyword argument(關鍵字引數)" -#: ../../glossary.rst:771 ../../glossary.rst:1075 +#: ../../glossary.rst:771 ../../glossary.rst:1077 msgid "See :term:`argument`." msgstr "請參閱 :term:`argument`\\ (引數)。" @@ -1781,8 +1791,8 @@ msgid "" "statements." msgstr "" "Look before you leap.(三思而後行。)這種編碼風格會在進行呼叫或查找之前,明確" -"地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許多 :" -"keyword:`if` 陳述式的存在。" +"地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許" +"多 :keyword:`if` 陳述式的存在。" #: ../../glossary.rst:784 msgid "" @@ -1826,9 +1836,9 @@ msgid "" msgstr "" "一種用來處理一個序列中的全部或部分元素,並將處理結果以一個 list 回傳的簡要方" "法。``result = ['{:#04x}'.format(x) for x in range(256) if x % 2 == 0]`` 會產" -"生一個字串 list,其中包含 0 到 255 範圍內,所有偶數的十六進位數 (0x..)。:" -"keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有元素都會被" -"處理。" +"生一個字串 list,其中包含 0 到 255 範圍內,所有偶數的十六進位數 " +"(0x..)。:keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有" +"元素都會被處理。" #: ../../glossary.rst:802 msgid "loader" @@ -1836,85 +1846,91 @@ msgstr "loader(載入器)" #: ../../glossary.rst:804 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 also:" +"An object that loads a module. It must define the :meth:`!exec_module` " +"and :meth:`!create_module` methods to implement " +"the :class:`~importlib.abc.Loader` interface. A loader is typically returned " +"by a :term:`finder`. See also:" msgstr "" -"一個能夠載入模組的物件。它必須定義一個名為 :meth:`load_module` 的 method(方" -"法)。載入器通常是被 :term:`finder`\\ (尋檢器)回傳。更多細節請參閱:" +"一個能夠載入模組的物件。它必須定義 :meth:`!exec_module` 和 :meth:`!" +"create_module` 方法以實作 :class:`~importlib.abc.Loader` 介面。載入器通常是" +"被 :term:`finder`\\ (尋檢器)回傳。更多細節請參閱:" -#: ../../glossary.rst:808 +#: ../../glossary.rst:810 msgid ":ref:`finders-and-loaders`" msgstr ":ref:`finders-and-loaders`" -#: ../../glossary.rst:809 +#: ../../glossary.rst:811 msgid ":class:`importlib.abc.Loader`" msgstr ":class:`importlib.abc.Loader`" -#: ../../glossary.rst:810 +#: ../../glossary.rst:812 msgid ":pep:`302`" msgstr ":pep:`302`" -#: ../../glossary.rst:811 +#: ../../glossary.rst:813 msgid "locale encoding" msgstr "locale encoding(區域編碼)" -#: ../../glossary.rst:813 +#: ../../glossary.rst:815 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) `." +"On Unix, it is the encoding of the LC_CTYPE locale. It can be set " +"with :func:`locale.setlocale(locale.LC_CTYPE, new_locale) " +"`." msgstr "" -"在 Unix 上,它是 LC_CTYPE 區域設定的編碼。它可以用 :func:`locale." -"setlocale(locale.LC_CTYPE, new_locale) ` 來設定。" +"在 Unix 上,它是 LC_CTYPE 區域設定的編碼。它可以" +"用 :func:`locale.setlocale(locale.LC_CTYPE, new_locale) ` " +"來設定。" -#: ../../glossary.rst:816 +#: ../../glossary.rst:818 msgid "On Windows, it is the ANSI code page (ex: ``\"cp1252\"``)." msgstr "在 Windows 上,它是 ANSI 代碼頁(code page,例如 ``\"cp1252\"``\\ )。" -#: ../../glossary.rst:818 +#: ../../glossary.rst:820 msgid "" "On Android and VxWorks, Python uses ``\"utf-8\"`` as the locale encoding." msgstr "在 Android 和 VxWorks 上,Python 使用 ``\"utf-8\"`` 作為區域編碼。" -#: ../../glossary.rst:820 +#: ../../glossary.rst:822 msgid ":func:`locale.getencoding` can be used to get the locale encoding." msgstr ":func:`locale.getencoding` 可以用來取得區域編碼。" -#: ../../glossary.rst:822 +#: ../../glossary.rst:824 msgid "See also the :term:`filesystem encoding and error handler`." msgstr "也請參考 :term:`filesystem encoding and error handler`。" -#: ../../glossary.rst:823 +#: ../../glossary.rst:825 msgid "magic method" msgstr "magic method(魔術方法)" -#: ../../glossary.rst:827 +#: ../../glossary.rst:829 msgid "An informal synonym for :term:`special method`." msgstr ":term:`special method`\\ (特殊方法)的一個非正式同義詞。" -#: ../../glossary.rst:828 +#: ../../glossary.rst:830 msgid "mapping" msgstr "mapping(對映)" -#: ../../glossary.rst:830 +#: ../../glossary.rst:832 msgid "" "A container object that supports arbitrary key lookups and implements the " -"methods specified in the :class:`collections.abc.Mapping` or :class:" -"`collections.abc.MutableMapping` :ref:`abstract base classes `. Examples include :class:`dict`, :class:" -"`collections.defaultdict`, :class:`collections.OrderedDict` and :class:" -"`collections.Counter`." +"methods specified in the :class:`collections.abc.Mapping` " +"or :class:`collections.abc.MutableMapping` :ref:`abstract base classes " +"`. Examples " +"include :class:`dict`, :class:`collections.defaultdict`, :class:`collections.OrderedDict` " +"and :class:`collections.Counter`." msgstr "" "一個容器物件,它支援任意鍵的查找,且能實作 :ref:`abstract base classes(抽象" -"基底類別) `\\ 中,:class:`collections." -"abc.Mapping` 或 :class:`collections.abc.MutableMapping` 所指定的 method。範例" -"包括 :class:`dict`、:class:`collections.defaultdict`、:class:`collections." -"OrderedDict` 和 :class:`collections.Counter`。" +"基底類別) `\\ " +"中,:class:`collections.abc.Mapping` " +"或 :class:`collections.abc.MutableMapping` 所指定的 method。範例包" +"括 :class:`dict`、:class:`collections.defaultdict`、:class:`collections.OrderedDict` " +"和 :class:`collections.Counter`。" -#: ../../glossary.rst:836 +#: ../../glossary.rst:838 msgid "meta path finder" msgstr "meta path finder(元路徑尋檢器)" -#: ../../glossary.rst:838 +#: ../../glossary.rst:840 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:842 +#: ../../glossary.rst:844 msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." msgstr "" "關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc.MetaPathFinder`。" -#: ../../glossary.rst:844 +#: ../../glossary.rst:846 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../glossary.rst:846 +#: ../../glossary.rst:848 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 " @@ -1955,31 +1971,31 @@ msgstr "" "性存取、增加執行緒安全性、追蹤物件建立、實作單例模式 (singleton),以及許多其" "他的任務。" -#: ../../glossary.rst:856 +#: ../../glossary.rst:858 msgid "More information can be found in :ref:`metaclasses`." msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" -#: ../../glossary.rst:825 ../../glossary.rst:857 ../../glossary.rst:1220 +#: ../../glossary.rst:827 ../../glossary.rst:859 ../../glossary.rst:1222 msgid "method" msgstr "method(方法)" -#: ../../glossary.rst:859 +#: ../../glossary.rst:861 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 " -"first :term:`argument` (which is usually called ``self``). See :term:" -"`function` and :term:`nested scope`." +"first :term:`argument` (which is usually called ``self``). " +"See :term:`function` and :term:`nested scope`." msgstr "" "一個在 class 本體內被定義的函式。如果 method 作為其 class 實例的一個屬性被呼" "叫,則它將會得到該實例物件成為它的第一個 :term:`argument`\\ (引數)(此引數" "通常被稱為 ``self``)。請參閱 :term:`function`\\ (函式)和 :term:`nested " "scope`\\ (巢狀作用域)。" -#: ../../glossary.rst:863 +#: ../../glossary.rst:865 msgid "method resolution order" msgstr "method resolution order(方法解析順序)" -#: ../../glossary.rst:865 +#: ../../glossary.rst:867 msgid "" "Method Resolution Order is the order in which base classes are searched for " "a member during lookup. See :ref:`python_2.3_mro` for details of the " @@ -1988,11 +2004,11 @@ msgstr "" "方法解析順序是在查找某個成員的過程中,base class(基底類別)被搜尋的順序。關" "於 Python 自 2.3 版直譯器所使用的演算法細節,請參閱 :ref:`python_2.3_mro`。" -#: ../../glossary.rst:868 +#: ../../glossary.rst:870 msgid "module" msgstr "module(模組)" -#: ../../glossary.rst:870 +#: ../../glossary.rst:872 msgid "" "An object that serves as an organizational unit of Python code. Modules " "have a namespace containing arbitrary Python objects. Modules are loaded " @@ -2002,51 +2018,51 @@ msgstr "" "空間,它包含任意的 Python 物件。模組是藉由 :term:`importing` 的過程,被載入" "至 Python。" -#: ../../glossary.rst:874 +#: ../../glossary.rst:876 msgid "See also :term:`package`." msgstr "另請參閱 :term:`package`\\ (套件)。" -#: ../../glossary.rst:875 +#: ../../glossary.rst:877 msgid "module spec" msgstr "module spec(模組規格)" -#: ../../glossary.rst:877 +#: ../../glossary.rst:879 msgid "" "A namespace containing the import-related information used to load a module. " "An instance of :class:`importlib.machinery.ModuleSpec`." msgstr "" -"一個命名空間,它包含用於載入模組的 import 相關資訊。它是 :class:`importlib." -"machinery.ModuleSpec` 的一個實例。" +"一個命名空間,它包含用於載入模組的 import 相關資訊。它" +"是 :class:`importlib.machinery.ModuleSpec` 的一個實例。" -#: ../../glossary.rst:880 +#: ../../glossary.rst:882 msgid "See also :ref:`module-specs`." msgstr "另請參閱 :ref:`module-specs`。" -#: ../../glossary.rst:881 +#: ../../glossary.rst:883 msgid "MRO" msgstr "MRO" -#: ../../glossary.rst:883 +#: ../../glossary.rst:885 msgid "See :term:`method resolution order`." msgstr "請參閱 :term:`method resolution order`\\ (方法解析順序)。" -#: ../../glossary.rst:884 +#: ../../glossary.rst:886 msgid "mutable" msgstr "mutable(可變物件)" -#: ../../glossary.rst:886 +#: ../../glossary.rst:888 msgid "" -"Mutable objects can change their value but keep their :func:`id`. See also :" -"term:`immutable`." +"Mutable objects can change their value but keep their :func:`id`. See " +"also :term:`immutable`." msgstr "" -"可變物件可以改變它們的值,但維持它們的 :func:`id`。另請參閱 :term:" -"`immutable`\\ (不可變物件)。" +"可變物件可以改變它們的值,但維持它們的 :func:`id`。另請參" +"閱 :term:`immutable`\\ (不可變物件)。" -#: ../../glossary.rst:888 +#: ../../glossary.rst:890 msgid "named tuple" msgstr "named tuple(附名元組)" -#: ../../glossary.rst:890 +#: ../../glossary.rst:892 msgid "" "The term \"named tuple\" applies to any type or class that inherits from " "tuple and whose indexable elements are also accessible using named " @@ -2056,16 +2072,16 @@ msgstr "" "索引 (indexable) 元素也可以用附名屬性來存取。這些型別或 class 也可以具有其他" "的特性。" -#: ../../glossary.rst:894 +#: ../../glossary.rst:896 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." -"float_info`::" +"Several built-in types are named tuples, including the values returned " +"by :func:`time.localtime` and :func:`os.stat`. Another example " +"is :data:`sys.float_info`::" msgstr "" "有些內建型別是 named tuple,包括由 :func:`time.localtime` 和 :func:`os.stat` " "回傳的值。另一個例子是 :data:`sys.float_info`: ::" -#: ../../glossary.rst:898 +#: ../../glossary.rst:900 msgid "" ">>> sys.float_info[1] # indexed access\n" "1024\n" @@ -2075,52 +2091,54 @@ msgid "" "True" msgstr "" -#: ../../glossary.rst:905 +#: ../../glossary.rst:907 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 " "that inherits from :class:`tuple` and that defines named fields. Such a " -"class can be written by hand, or it can be created by inheriting :class:" -"`typing.NamedTuple`, or with the factory function :func:`collections." -"namedtuple`. The latter techniques also add some extra methods that may not " -"be found in hand-written or built-in named tuples." +"class can be written by hand, or it can be created by " +"inheriting :class:`typing.NamedTuple`, or with the factory " +"function :func:`collections.namedtuple`. The latter techniques also add " +"some extra methods that may not be found in hand-written or built-in named " +"tuples." msgstr "" "有些 named tuple 是內建型別(如上例)。或者,一個 named tuple 也可以從一個正" "規的 class 定義來建立,只要該 class 是繼承自 :class:`tuple`,且定義了附名欄" -"位 (named field) 即可。這類的 class 可以手工編寫、可以繼承自 :class:`typing." -"NamedTuple` 來建立,也可以使用工廠函式 (factory function) :func:`collections." -"namedtuple` 來建立。後者技術也增加了一些額外的 method,這些 method 可能是在手" -"寫或內建的 named tuple 中,無法找到的。" +"位 (named field) 即可。這類的 class 可以手工編寫、可以繼承" +"自 :class:`typing.NamedTuple` 來建立,也可以使用工廠函式 (factory " +"function) :func:`collections.namedtuple` 來建立。後者技術也增加了一些額外的 " +"method,這些 method 可能是在手寫或內建的 named tuple 中,無法找到的。" -#: ../../glossary.rst:913 +#: ../../glossary.rst:915 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../glossary.rst:915 +#: ../../glossary.rst:917 msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " "as nested namespaces in objects (in methods). Namespaces support modularity " -"by preventing naming conflicts. For instance, the functions :func:`builtins." -"open <.open>` and :func:`os.open` are distinguished by their namespaces. " -"Namespaces also aid readability and maintainability by making it clear which " -"module implements a function. For instance, writing :func:`random.seed` or :" -"func:`itertools.islice` makes it clear that those functions are implemented " -"by the :mod:`random` and :mod:`itertools` modules, respectively." +"by preventing naming conflicts. For instance, the " +"functions :func:`builtins.open <.open>` and :func:`os.open` are " +"distinguished by their namespaces. Namespaces also aid readability and " +"maintainability by making it clear which module implements a function. For " +"instance, writing :func:`random.seed` or :func:`itertools.islice` makes it " +"clear that those functions are implemented by the :mod:`random` " +"and :mod:`itertools` modules, respectively." msgstr "" "變數被儲存的地方。命名空間是以 dictionary(字典)被實作。有區域的、全域的及內" "建的命名空間,而在物件中(在 method 中)也有巢狀的命名空間。命名空間藉由防止" -"命名衝突,來支援模組化。例如,函式 :func:`builtins.open <.open>` 和 :func:" -"`os.open` 是透過它們的命名空間來區分彼此。命名空間也藉由明確地區分是哪個模組" -"在實作一個函式,來增進可讀性及可維護性。例如,寫出 :func:`random.seed` 或 :" -"func:`itertools.islice` 明確地表示,這些函式分別是由 :mod:`random` 和 :mod:" -"`itertools` 模組在實作。" +"命名衝突,來支援模組化。例如,函式 :func:`builtins.open <.open>` " +"和 :func:`os.open` 是透過它們的命名空間來區分彼此。命名空間也藉由明確地區分是" +"哪個模組在實作一個函式,來增進可讀性及可維護性。例如,寫" +"出 :func:`random.seed` 或 :func:`itertools.islice` 明確地表示,這些函式分別是" +"由 :mod:`random` 和 :mod:`itertools` 模組在實作。" -#: ../../glossary.rst:925 +#: ../../glossary.rst:927 msgid "namespace package" msgstr "namespace package(命名空間套件)" -#: ../../glossary.rst:927 +#: ../../glossary.rst:929 msgid "" "A :pep:`420` :term:`package` which serves only as a container for " "subpackages. Namespace packages may have no physical representation, and " @@ -2128,18 +2146,19 @@ msgid "" "``__init__.py`` file." msgstr "" "一個 :pep:`420` :term:`package`\\ (套件),它只能作為子套件 (subpackage) 的" -"一個容器。命名空間套件可能沒有實體的表示法,而且具體來說它們不像是一個 :term:" -"`regular package`\\ (正規套件),因為它們並沒有 ``__init__.py`` 這個檔案。" +"一個容器。命名空間套件可能沒有實體的表示法,而且具體來說它們不像是一" +"個 :term:`regular package`\\ (正規套件),因為它們並沒有 ``__init__.py`` 這" +"個檔案。" -#: ../../glossary.rst:932 +#: ../../glossary.rst:934 msgid "See also :term:`module`." msgstr "另請參閱 :term:`module`\\ (模組)。" -#: ../../glossary.rst:933 +#: ../../glossary.rst:935 msgid "nested scope" msgstr "nested scope(巢狀作用域)" -#: ../../glossary.rst:935 +#: ../../glossary.rst:937 msgid "" "The ability to refer to a variable in an enclosing definition. For " "instance, a function defined inside another function can refer to variables " @@ -2154,39 +2173,41 @@ msgstr "" "寫入。同樣地,全域變數是在全域命名空間中讀取及寫入。:keyword:`nonlocal` 容許" "對外層作用域進行寫入。" -#: ../../glossary.rst:942 +#: ../../glossary.rst:944 msgid "new-style class" msgstr "new-style class(新式類別)" -#: ../../glossary.rst:944 +#: ../../glossary.rst:946 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:`~object.__getattribute__`, class methods, and static methods." +"versatile features like :attr:`~object.__slots__`, descriptors, " +"properties, :meth:`~object.__getattribute__`, class methods, and static " +"methods." msgstr "" "一個舊名,它是指現在所有的 class 物件所使用的 class 風格。在早期的 Python 版" -"本中,只有新式 class 才能使用 Python 較新的、多樣的功能,像是 :attr:`~object." -"__slots__`、描述器 (descriptor)、屬性 (property)、:meth:`~object." -"__getattribute__`、class method(類別方法)和 static method(靜態方法)。" +"本中,只有新式 class 才能使用 Python 較新的、多樣的功能,像" +"是 :attr:`~object.__slots__`、描述器 (descriptor)、屬性 " +"(property)、:meth:`~object.__getattribute__`、class method(類別方法)和 " +"static method(靜態方法)。" -#: ../../glossary.rst:949 +#: ../../glossary.rst:951 msgid "object" msgstr "object(物件)" -#: ../../glossary.rst:951 +#: ../../glossary.rst:953 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." msgstr "" -"具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任何 :term:" -"`new-style class`\\ (新式類別)的最終 base class(基底類別)。" +"具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任" +"何 :term:`new-style class`\\ (新式類別)的最終 base class(基底類別)。" -#: ../../glossary.rst:954 +#: ../../glossary.rst:956 msgid "optimized scope" msgstr "optimized scope(最佳化作用域)" -#: ../../glossary.rst:956 +#: ../../glossary.rst:958 msgid "" "A scope where target local variable names are reliably known to the compiler " "when the code is compiled, allowing optimization of read and write access to " @@ -2197,11 +2218,11 @@ msgid "" "to optimized scopes." msgstr "" -#: ../../glossary.rst:963 +#: ../../glossary.rst:965 msgid "package" msgstr "package(套件)" -#: ../../glossary.rst:965 +#: ../../glossary.rst:967 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with a ``__path__`` " @@ -2211,17 +2232,17 @@ msgstr "" "迴的子套件 (subpackage)。技術上而言,套件就是具有 ``__path__`` 屬性的一個 " "Python 模組。" -#: ../../glossary.rst:969 +#: ../../glossary.rst:971 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" "另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace " "package`\\ (命名空間套件)。" -#: ../../glossary.rst:970 +#: ../../glossary.rst:972 msgid "parameter" msgstr "parameter(參數)" -#: ../../glossary.rst:972 +#: ../../glossary.rst:974 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 " @@ -2231,7 +2252,7 @@ msgstr "" "它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況下指示多" "個引數。共有有五種不同的參數類型:" -#: ../../glossary.rst:976 +#: ../../glossary.rst:978 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally ` or as a :term:`keyword argument " @@ -2242,11 +2263,11 @@ msgstr "" "置 `\\ 或是作為\\ :term:`關鍵字引數 `\\ 被傳遞的引數。這" "是參數的預設類型,例如以下的 *foo* 和 *bar*: ::" -#: ../../glossary.rst:981 +#: ../../glossary.rst:983 msgid "def func(foo, bar=None): ..." msgstr "def func(foo, bar=None): ..." -#: ../../glossary.rst:985 +#: ../../glossary.rst:987 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -2257,11 +2278,11 @@ msgstr "" "式定義的參數列表中包含一個 ``/`` 字元,就可以在該字元前面定義僅限位置參數,例" "如以下的 *posonly1* 和 *posonly2*: ::" -#: ../../glossary.rst:990 +#: ../../glossary.rst:992 msgid "def func(posonly1, posonly2, /, positional_or_keyword): ..." msgstr "def func(posonly1, posonly2, /, positional_or_keyword): ..." -#: ../../glossary.rst:994 +#: ../../glossary.rst:996 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-" @@ -2274,11 +2295,11 @@ msgstr "" "單純的 ``*`` 字元,就可以在其後方定義僅限關鍵字參數,例如以下的 *kw_only1* " "和 *kw_only2*: ::" -#: ../../glossary.rst:1000 +#: ../../glossary.rst:1002 msgid "def func(arg, *, kw_only1, kw_only2): ..." msgstr "def func(arg, *, kw_only1, kw_only2): ..." -#: ../../glossary.rst:1002 +#: ../../glossary.rst:1004 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -2290,11 +2311,11 @@ msgstr "" "數(在已被其他參數接受的任何位置引數之外)。這類參數是透過在其參數名稱字首加" "上 ``*`` 來定義的,例如以下的 *args*: ::" -#: ../../glossary.rst:1008 +#: ../../glossary.rst:1010 msgid "def func(*args, **kwargs): ..." msgstr "def func(*args, **kwargs): ..." -#: ../../glossary.rst:1010 +#: ../../glossary.rst:1012 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " "provided (in addition to any keyword arguments already accepted by other " @@ -2305,29 +2326,29 @@ msgstr "" "已被其他參數接受的任何關鍵字引數之外)。這類參數是透過在其參數名稱字首加上 " "``**`` 來定義的,例如上面範例中的 *kwargs*。" -#: ../../glossary.rst:1016 +#: ../../glossary.rst:1018 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "" "參數可以指明引數是選擇性的或必需的,也可以為一些選擇性的引數指定預設值。" -#: ../../glossary.rst:1019 +#: ../../glossary.rst:1021 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " -"the :class:`inspect.Parameter` class, the :ref:`function` section, and :pep:" -"`362`." +"the :class:`inspect.Parameter` class, the :ref:`function` section, " +"and :pep:`362`." msgstr "" "另請參閱術語表的 :term:`argument`\\ (引數)條目、常見問題中的\\ :ref:`引數和" "參數之間的差異 `、:class:`inspect.Parameter` " "class、:ref:`function`\\ 章節,以及 :pep:`362`。" -#: ../../glossary.rst:1023 +#: ../../glossary.rst:1025 msgid "path entry" msgstr "path entry(路徑項目)" -#: ../../glossary.rst:1025 +#: ../../glossary.rst:1027 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." @@ -2335,33 +2356,33 @@ msgstr "" "在 :term:`import path`\\ (引入路徑)中的一個位置,而 :term:`path based " "finder` (基於路徑的尋檢器)會參考該位置來尋找要 import 的模組。" -#: ../../glossary.rst:1027 +#: ../../glossary.rst:1029 msgid "path entry finder" msgstr "path entry finder(路徑項目尋檢器)" -#: ../../glossary.rst:1029 +#: ../../glossary.rst:1031 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:" -"`path entry`." +"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:`path entry`." msgstr "" -"被 :data:`sys.path_hooks` 中的一個可呼叫物件 (callable)(意即一個 :term:" -"`path entry hook`\\ )所回傳的一種 :term:`finder`,它知道如何以一個 :term:" -"`path entry`\\ 定位模組。" +"被 :data:`sys.path_hooks` 中的一個可呼叫物件 (callable)(意即一" +"個 :term:`path entry hook`\\ )所回傳的一種 :term:`finder`,它知道如何以一" +"個 :term:`path entry`\\ 定位模組。" -#: ../../glossary.rst:1033 +#: ../../glossary.rst:1035 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." msgstr "" -"關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." -"PathEntryFinder`。" +"關於路徑項目尋檢器實作的 method,請參" +"閱 :class:`importlib.abc.PathEntryFinder`。" -#: ../../glossary.rst:1035 +#: ../../glossary.rst:1037 msgid "path entry hook" msgstr "path entry hook(路徑項目鉤)" -#: ../../glossary.rst:1037 +#: ../../glossary.rst:1039 msgid "" "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 " @@ -2371,11 +2392,11 @@ msgstr "" "個特定的 :term:`path entry` 中尋找模組,則會回傳一個 :term:`path entry " "finder`\\ (路徑項目尋檢器)。" -#: ../../glossary.rst:1040 +#: ../../glossary.rst:1042 msgid "path based finder" msgstr "path based finder(基於路徑的尋檢器)" -#: ../../glossary.rst:1042 +#: ../../glossary.rst:1044 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." @@ -2383,33 +2404,33 @@ msgstr "" "預設的\\ :term:`元路徑尋檢器 (meta path finder) ` 之一,它" "會在一個 :term:`import path` 中搜尋模組。" -#: ../../glossary.rst:1044 +#: ../../glossary.rst:1046 msgid "path-like object" msgstr "path-like object(類路徑物件)" -#: ../../glossary.rst:1046 +#: ../../glossary.rst:1048 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 " -"implementing the :class:`os.PathLike` protocol. An object that supports the :" -"class:`os.PathLike` protocol can be converted to a :class:`str` or :class:" -"`bytes` file system path by calling the :func:`os.fspath` function; :func:" -"`os.fsdecode` and :func:`os.fsencode` can be used to guarantee a :class:" -"`str` or :class:`bytes` result instead, respectively. Introduced by :pep:" -"`519`." -msgstr "" -"一個表示檔案系統路徑的物件。類路徑物件可以是一個表示路徑的 :class:`str` 或 :" -"class:`bytes` 物件,或是一個實作 :class:`os.PathLike` 協定的物件。透過呼叫 :" -"func:`os.fspath` 函式,一個支援 :class:`os.PathLike` 協定的物件可以被轉換為 :" -"class:`str` 或 :class:`bytes` 檔案系統路徑;而 :func:`os.fsdecode` 及 :func:" -"`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" -"pep:`519` 引入。" - -#: ../../glossary.rst:1054 +"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 " +"implementing the :class:`os.PathLike` protocol. An object that supports " +"the :class:`os.PathLike` protocol can be converted to a :class:`str` " +"or :class:`bytes` file system path by calling the :func:`os.fspath` " +"function; :func:`os.fsdecode` and :func:`os.fsencode` can be used to " +"guarantee a :class:`str` or :class:`bytes` result instead, respectively. " +"Introduced by :pep:`519`." +msgstr "" +"一個表示檔案系統路徑的物件。類路徑物件可以是一個表示路徑的 :class:`str` " +"或 :class:`bytes` 物件,或是一個實作 :class:`os.PathLike` 協定的物件。透過呼" +"叫 :func:`os.fspath` 函式,一個支援 :class:`os.PathLike` 協定的物件可以被轉換" +"為 :class:`str` 或 :class:`bytes` 檔案系統路徑;而 :func:`os.fsdecode` " +"及 :func:`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結" +"果。由 :pep:`519` 引入。" + +#: ../../glossary.rst:1056 msgid "PEP" msgstr "PEP" -#: ../../glossary.rst:1056 +#: ../../glossary.rst:1058 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " @@ -2420,7 +2441,7 @@ msgstr "" "為 Python 社群提供資訊,或是描述 Python 的一個新功能或該功能的程序和環境。" "PEP 應該要提供簡潔的技術規範以及被提案功能的運作原理。" -#: ../../glossary.rst:1062 +#: ../../glossary.rst:1064 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2432,15 +2453,15 @@ msgstr "" "已納入 Python 的設計決策的記錄,這些過程的主要機制。PEP 的作者要負責在社群內" "建立共識並記錄反對意見。" -#: ../../glossary.rst:1068 +#: ../../glossary.rst:1070 msgid "See :pep:`1`." msgstr "請參閱 :pep:`1`。" -#: ../../glossary.rst:1069 +#: ../../glossary.rst:1071 msgid "portion" msgstr "portion(部分)" -#: ../../glossary.rst:1071 +#: ../../glossary.rst:1073 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`." @@ -2448,15 +2469,15 @@ msgstr "" "在單一目錄中的一組檔案(也可能儲存在一個 zip 檔中),這些檔案能對一個命名空間" "套件 (namespace package) 有所貢獻,如同 :pep:`420` 中的定義。" -#: ../../glossary.rst:1073 +#: ../../glossary.rst:1075 msgid "positional argument" msgstr "positional argument(位置引數)" -#: ../../glossary.rst:1076 +#: ../../glossary.rst:1078 msgid "provisional API" msgstr "provisional API(暫行 API)" -#: ../../glossary.rst:1078 +#: ../../glossary.rst:1080 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " @@ -2472,7 +2493,7 @@ msgstr "" "該介面)。這種變更並不會無端地產生——只有 API 被納入之前未察覺的嚴重基本缺陷被" "揭露時,它們才會發生。" -#: ../../glossary.rst:1087 +#: ../../glossary.rst:1089 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 " @@ -2481,7 +2502,7 @@ msgstr "" "即使對於暫行 API,向後不相容的變更也會被視為「最後的解決方案」——對於任何被發" "現的問題,仍然會盡可能找出一個向後相容的解決方案。" -#: ../../glossary.rst:1091 +#: ../../glossary.rst:1093 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " @@ -2490,19 +2511,19 @@ msgstr "" "這個過程使得標準函式庫能隨著時間不斷進化,而避免耗費過長的時間去鎖定有問題的" "設計錯誤。請參閱 :pep:`411` 了解更多細節。" -#: ../../glossary.rst:1094 +#: ../../glossary.rst:1096 msgid "provisional package" msgstr "provisional package(暫行套件)" -#: ../../glossary.rst:1096 +#: ../../glossary.rst:1098 msgid "See :term:`provisional API`." msgstr "請參閱 :term:`provisional API`\\ (暫行 API)。" -#: ../../glossary.rst:1097 +#: ../../glossary.rst:1099 msgid "Python 3000" msgstr "Python 3000" -#: ../../glossary.rst:1099 +#: ../../glossary.rst:1101 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 " @@ -2511,11 +2532,11 @@ msgstr "" "Python 3.x 系列版本的暱稱(很久以前創造的,當時第 3 版的發布是在遙遠的未" "來。)也可以縮寫為「Py3k」。" -#: ../../glossary.rst:1102 +#: ../../glossary.rst:1104 msgid "Pythonic" msgstr "Pythonic(Python 風格的)" -#: ../../glossary.rst:1104 +#: ../../glossary.rst:1106 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 " @@ -2525,11 +2546,11 @@ msgid "" "Python sometimes use a numerical counter instead::" msgstr "" "一個想法或一段程式碼,它應用了 Python 語言最常見的慣用語,而不是使用其他語言" -"常見的概念來實作程式碼。例如,Python 中常見的一種習慣用法,是使用一個 :" -"keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並沒有" -"這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替: ::" +"常見的概念來實作程式碼。例如,Python 中常見的一種習慣用法,是使用一" +"個 :keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並" +"沒有這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替: ::" -#: ../../glossary.rst:1111 +#: ../../glossary.rst:1113 msgid "" "for i in range(len(food)):\n" " print(food[i])" @@ -2537,11 +2558,11 @@ msgstr "" "for i in range(len(food)):\n" " print(food[i])" -#: ../../glossary.rst:1114 +#: ../../glossary.rst:1116 msgid "As opposed to the cleaner, Pythonic method::" msgstr "相較之下,以下方法更簡潔、更具有 Python 風格: ::" -#: ../../glossary.rst:1116 +#: ../../glossary.rst:1118 msgid "" "for piece in food:\n" " print(piece)" @@ -2549,11 +2570,11 @@ msgstr "" "for piece in food:\n" " print(piece)" -#: ../../glossary.rst:1118 +#: ../../glossary.rst:1120 msgid "qualified name" msgstr "qualified name(限定名稱)" -#: ../../glossary.rst:1120 +#: ../../glossary.rst:1122 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 " @@ -2564,7 +2585,7 @@ msgstr "" "或 method 的「路徑」,如 :pep:`3155` 中的定義。對於頂層的函式和 class 而言," "限定名稱與其物件名稱相同: ::" -#: ../../glossary.rst:1125 +#: ../../glossary.rst:1127 msgid "" ">>> class C:\n" "... class D:\n" @@ -2590,16 +2611,16 @@ msgstr "" ">>> C.D.meth.__qualname__\n" "'C.D.meth'" -#: ../../glossary.rst:1137 +#: ../../glossary.rst:1139 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." -"text``::" +"dotted path to the module, including any parent packages, e.g. " +"``email.mime.text``::" msgstr "" "當用於引用模組時,*完全限定名稱 (fully qualified name)* 是表示該模組的完整點" "分隔路徑,包括任何的父套件,例如 ``email.mime.text``: ::" -#: ../../glossary.rst:1141 +#: ../../glossary.rst:1143 msgid "" ">>> import email.mime.text\n" ">>> email.mime.text.__name__\n" @@ -2609,11 +2630,11 @@ msgstr "" ">>> email.mime.text.__name__\n" "'email.mime.text'" -#: ../../glossary.rst:1144 +#: ../../glossary.rst:1146 msgid "reference count" msgstr "reference count(參照計數)" -#: ../../glossary.rst:1146 +#: ../../glossary.rst:1148 msgid "" "The number of references to an object. When the reference count of an " "object drops to zero, it is deallocated. Some objects are :term:`immortal` " @@ -2626,42 +2647,42 @@ msgstr "" "對於一個物件的參照次數。當一個物件的參照計數下降到零時,它會被解除配置 " "(deallocated)。有些物件是「\\ :term:`不滅的 ` (immortal)」並擁有不" "會被改變的參照計數,也因此永遠不會被解除配置。參照計數通常在 Python 程式碼中" -"看不到,但它卻是 :term:`CPython` 實作的一個關鍵元素。程式設計師可以呼叫 :" -"func:`~sys.getrefcount` 函式來回傳一個特定物件的參照計數。" +"看不到,但它卻是 :term:`CPython` 實作的一個關鍵元素。程式設計師可以呼" +"叫 :func:`~sys.getrefcount` 函式來回傳一個特定物件的參照計數。" -#: ../../glossary.rst:1154 +#: ../../glossary.rst:1156 msgid "regular package" msgstr "regular package(正規套件)" -#: ../../glossary.rst:1156 +#: ../../glossary.rst:1158 msgid "" -"A traditional :term:`package`, such as a directory containing an ``__init__." -"py`` file." +"A traditional :term:`package`, such as a directory containing an " +"``__init__.py`` file." msgstr "" "一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" "錄。" -#: ../../glossary.rst:1159 +#: ../../glossary.rst:1161 msgid "See also :term:`namespace package`." msgstr "另請參閱 :term:`namespace package`\\ (命名空間套件)。" -#: ../../glossary.rst:1160 +#: ../../glossary.rst:1162 msgid "REPL" msgstr "REPL" -#: ../../glossary.rst:1162 +#: ../../glossary.rst:1164 msgid "" -"An acronym for the \"read–eval–print loop\", another name for the :term:" -"`interactive` interpreter shell." +"An acronym for the \"read–eval–print loop\", another name for " +"the :term:`interactive` interpreter shell." msgstr "" "「read-eval-print 迴圈 (read–eval–print loop)」的縮寫,是\\ :term:`互動式 " "`\\ 直譯器 shell 的另一個名稱。" -#: ../../glossary.rst:1164 +#: ../../glossary.rst:1166 msgid "__slots__" msgstr "__slots__" -#: ../../glossary.rst:1166 +#: ../../glossary.rst:1168 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -2674,66 +2695,66 @@ msgstr "" "最好保留給那種在一個記憶體關鍵 (memory-critical) 的應用程式中存在大量實例的罕" "見情況。" -#: ../../glossary.rst:1171 +#: ../../glossary.rst:1173 msgid "sequence" msgstr "sequence(序列)" -#: ../../glossary.rst:1173 +#: ../../glossary.rst:1175 msgid "" "An :term:`iterable` which supports efficient element access using integer " -"indices via the :meth:`~object.__getitem__` special method and defines a :" -"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:`hashable` keys rather than " -"integers." +"indices via the :meth:`~object.__getitem__` special method and defines " +"a :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:`hashable` keys rather than integers." msgstr "" "一個 :term:`iterable`\\ (可疊代物件),它透過 :meth:`~object.__getitem__` " "special method(特殊方法),使用整數索引來支援高效率的元素存取,並定義了一" -"個 :meth:`~object.__len__` method 來回傳該序列的長度。一些內建序列型別包括 :" -"class:`list`、:class:`str`、:class:`tuple` 和 :class:`bytes`。請注意,雖然 :" -"class:`dict` 也支援 :meth:`~object.__getitem__` 和 :meth:`!__len__`,但它被視" -"為對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`hashable` 鍵," -"而不是整數。" +"個 :meth:`~object.__len__` method 來回傳該序列的長度。一些內建序列型別包" +"括 :class:`list`、:class:`str`、:class:`tuple` 和 :class:`bytes`。請注意,雖" +"然 :class:`dict` 也支援 :meth:`~object.__getitem__` 和 :meth:`!__len__`,但它" +"被視為對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`hashable` " +"鍵,而不是整數。" -#: ../../glossary.rst:1182 +#: ../../glossary.rst:1184 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " -"richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" -"`~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`. For more documentation on sequence methods generally, see :ref:" -"`Common Sequence Operations `." +"richer interface that goes beyond just :meth:`~object.__getitem__` " +"and :meth:`~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`. For more documentation on sequence " +"methods generally, see :ref:`Common Sequence Operations `." msgstr "" "抽象基底類別 (abstract base class) :class:`collections.abc.Sequence` 定義了一" -"個更加豐富的介面,並不僅止於 :meth:`~object.__getitem__` 和 :meth:`~object." -"__len__`,還增加了 :meth:`!count`、:meth:`!index`、:meth:`~object." -"__contains__` 和 :meth:`~object.__reversed__`。實作此擴充介面的型別,可以使" -"用 :func:`~abc.ABCMeta.register` 被明確地註冊。更多關於序列方法的文件,請見" -"\\ :ref:`常見序列操作 `。" +"個更加豐富的介面,並不僅止於 :meth:`~object.__getitem__` " +"和 :meth:`~object.__len__`,還增加了 :meth:`!count`、:meth:`!" +"index`、:meth:`~object.__contains__` 和 :meth:`~object.__reversed__`。實作此" +"擴充介面的型別,可以使用 :func:`~abc.ABCMeta.register` 被明確地註冊。更多關於" +"序列方法的文件,請見\\ :ref:`常見序列操作 `。" -#: ../../glossary.rst:1191 +#: ../../glossary.rst:1193 msgid "set comprehension" msgstr "set comprehension(集合綜合運算)" -#: ../../glossary.rst:1193 +#: ../../glossary.rst:1195 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 " -"not in 'abc'}`` generates the set of strings ``{'r', 'd'}``. See :ref:" -"`comprehensions`." +"not in 'abc'}`` generates the set of strings ``{'r', 'd'}``. " +"See :ref:`comprehensions`." msgstr "" "一種緊密的方法,用來處理一個可疊代物件中的全部或部分元素,並將處理結果以一個 " "set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" "個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:1197 +#: ../../glossary.rst:1199 msgid "single dispatch" msgstr "single dispatch(單一調度)" -#: ../../glossary.rst:1199 +#: ../../glossary.rst:1201 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." @@ -2741,11 +2762,11 @@ msgstr "" ":term:`generic function`\\ (泛型函式)調度的一種形式,在此,實作的選擇是基於" "單一引數的型別。" -#: ../../glossary.rst:1201 +#: ../../glossary.rst:1203 msgid "slice" msgstr "slice(切片)" -#: ../../glossary.rst:1203 +#: ../../glossary.rst:1205 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " @@ -2757,11 +2778,11 @@ msgstr "" "之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內部,會使" "用 :class:`slice` 物件。" -#: ../../glossary.rst:1207 +#: ../../glossary.rst:1209 msgid "soft deprecated" msgstr "soft deprecated(軟性棄用)" -#: ../../glossary.rst:1209 +#: ../../glossary.rst:1211 msgid "" "A soft deprecated API should not be used in new code, but it is safe for " "already existing code to use it. The API remains documented and tested, but " @@ -2770,13 +2791,13 @@ msgstr "" "被軟性棄用的 API 代表不應再用於新程式碼中,但在現有程式碼中繼續使用它仍會是安" "全的。API 仍會以文件記錄並會被測試,但不會被繼續改進。" -#: ../../glossary.rst:1213 +#: ../../glossary.rst:1215 msgid "" "Soft deprecation, unlike normal deprecation, does not plan on removing the " "API and will not emit warnings." msgstr "與正常棄用不同,軟性棄用沒有刪除 API 的規劃,也不會發出警告。" -#: ../../glossary.rst:1216 +#: ../../glossary.rst:1218 msgid "" "See `PEP 387: Soft Deprecation `_." @@ -2784,65 +2805,65 @@ msgstr "" "請參閱 `PEP 387:軟性棄用 `_。" -#: ../../glossary.rst:1218 +#: ../../glossary.rst:1220 msgid "special method" msgstr "special method(特殊方法)" -#: ../../glossary.rst:1222 +#: ../../glossary.rst:1224 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 " -"with double underscores. Special methods are documented in :ref:" -"`specialnames`." +"with double underscores. Special methods are documented " +"in :ref:`specialnames`." msgstr "" "一種會被 Python 自動呼叫的 method,用於對某種型別執行某種運算,例如加法。這" -"種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" -"`specialnames`\\ 中有詳細說明。" +"種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在" +"\\ :ref:`specialnames`\\ 中有詳細說明。" -#: ../../glossary.rst:1226 +#: ../../glossary.rst:1228 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1228 +#: ../../glossary.rst:1230 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 :" -"keyword:`if`, :keyword:`while` or :keyword:`for`." +"an :term:`expression` or one of several constructs with a keyword, such " +"as :keyword:`if`, :keyword:`while` or :keyword:`for`." msgstr "" -"陳述式是一個套組(suite,一個程式碼「區塊」)中的一部分。陳述式可以是一個 :" -"term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`、:keyword:" -"`while` 或 :keyword:`for`\\ )的多種結構之一。" +"陳述式是一個套組(suite,一個程式碼「區塊」)中的一部分。陳述式可以是一" +"個 :term:`expression`\\ (運算式),或是含有關鍵字(例" +"如 :keyword:`if`、:keyword:`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1231 +#: ../../glossary.rst:1233 msgid "static type checker" msgstr "static type checker(靜態型別檢查器)" -#: ../../glossary.rst:1233 +#: ../../glossary.rst:1235 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 :" -"mod:`typing` module." +"such as incorrect types. See also :term:`type hints ` and " +"the :mod:`typing` module." msgstr "" "會讀取 Python 程式碼並分析的外部工具,能夠找出錯誤,像是使用了不正確的型別。" "另請參閱\\ :term:`型別提示 (type hints) ` 以及 :mod:`typing` 模" "組。" -#: ../../glossary.rst:1236 +#: ../../glossary.rst:1238 msgid "strong reference" msgstr "strong reference(強參照)" -#: ../../glossary.rst:1238 +#: ../../glossary.rst:1240 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 " -"calling :c:func:`Py_INCREF` when the reference is created and released with :" -"c:func:`Py_DECREF` when the reference is deleted." +"calling :c:func:`Py_INCREF` when the reference is created and released " +"with :c:func:`Py_DECREF` when the reference is deleted." msgstr "" "在 Python 的 C API 中,強參照是對物件的參照,該物件為持有該參照的程式碼所擁" -"有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透過 :c:" -"func:`Py_DECREF` 釋放強參照。" +"有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透" +"過 :c:func:`Py_DECREF` 釋放強參照。" -#: ../../glossary.rst:1244 +#: ../../glossary.rst:1246 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 " @@ -2852,15 +2873,15 @@ msgstr "" ":c:func:`Py_NewRef` 函式可用於建立一個對物件的強參照。通常,在退出強參照的作" "用域之前,必須在該強參照上呼叫 :c:func:`Py_DECREF` 函式,以避免洩漏一個參照。" -#: ../../glossary.rst:1249 +#: ../../glossary.rst:1251 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ (借用參照)。" -#: ../../glossary.rst:1250 +#: ../../glossary.rst:1252 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1252 +#: ../../glossary.rst:1254 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 " @@ -2869,7 +2890,7 @@ msgstr "" "Python 中的字串是一個 Unicode 碼點 (code point) 的序列(範圍在 ``U+0000`` -- " "``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一個位元組序列。" -#: ../../glossary.rst:1256 +#: ../../glossary.rst:1258 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\"." @@ -2877,7 +2898,7 @@ msgstr "" "將一個字串序列化為位元組序列,稱為「編碼」,而從位元組序列重新建立該字串則稱" "為「解碼 (decoding)」。" -#: ../../glossary.rst:1259 +#: ../../glossary.rst:1261 msgid "" "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." @@ -2885,37 +2906,39 @@ msgstr "" "有多種不同的文字序列化編解碼器 (:ref:`codecs `),它們被統" "稱為「文字編碼」。" -#: ../../glossary.rst:1262 +#: ../../glossary.rst:1264 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1264 +#: ../../glossary.rst:1266 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:" -"`text encoding` automatically. Examples of text files are files opened in " -"text mode (``'r'`` or ``'w'``), :data:`sys.stdin`, :data:`sys.stdout`, and " -"instances of :class:`io.StringIO`." +"text file actually accesses a byte-oriented datastream and handles " +"the :term:`text encoding` automatically. Examples of text files are files " +"opened in text mode (``'r'`` or " +"``'w'``), :data:`sys.stdin`, :data:`sys.stdout`, and instances " +"of :class:`io.StringIO`." msgstr "" "一個能夠讀取和寫入 :class:`str` 物件的一個 :term:`file object`\\ (檔案物" "件)。通常,文字檔案實際上是存取位元組導向的資料流 (byte-oriented " "datastream) 並會自動處理 :term:`text encoding`\\ (文字編碼)。文字檔案的例子" -"有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、:data:`sys.stdin`、:data:" -"`sys.stdout` 以及 :class:`io.StringIO` 的實例。" +"有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔" +"案、:data:`sys.stdin`、:data:`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1271 +#: ../../glossary.rst:1273 msgid "" -"See also :term:`binary file` for a file object able to read and write :term:" -"`bytes-like objects `." +"See also :term:`binary file` for a file object able to read and " +"write :term:`bytes-like objects `." msgstr "" -"另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入\\ :" -"term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" +"另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入" +"\\ :term:`類位元組串物件 (bytes-like object) ` 的檔案物" +"件。" -#: ../../glossary.rst:1273 +#: ../../glossary.rst:1275 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1275 +#: ../../glossary.rst:1277 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 " @@ -2930,36 +2953,37 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1282 +#: ../../glossary.rst:1284 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1284 +#: ../../glossary.rst:1286 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:`~object." -"__class__` attribute or can be retrieved with ``type(obj)``." +"object has a type. An object's type is accessible as " +"its :attr:`~object.__class__` attribute or can be retrieved with " +"``type(obj)``." msgstr "" "一個 Python 物件的型別決定了它是什麼類型的物件;每個物件都有一個型別。一個物" "件的型別可以用它的 :attr:`~object.__class__` 屬性來存取,或以 ``type(obj)`` " "來檢索。" -#: ../../glossary.rst:1288 +#: ../../glossary.rst:1290 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1290 +#: ../../glossary.rst:1292 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1292 +#: ../../glossary.rst:1294 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" msgstr "" "型別別名對於簡化\\ :term:`型別提示 (type hint) ` 很有用。例如: ::" -#: ../../glossary.rst:1295 +#: ../../glossary.rst:1297 msgid "" "def remove_gray_shades(\n" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" @@ -2969,11 +2993,11 @@ msgstr "" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" " pass" -#: ../../glossary.rst:1299 +#: ../../glossary.rst:1301 msgid "could be made more readable like this::" msgstr "可以寫成這樣,更具有可讀性: ::" -#: ../../glossary.rst:1301 +#: ../../glossary.rst:1303 msgid "" "Color = tuple[int, int, int]\n" "\n" @@ -2985,15 +3009,15 @@ msgstr "" "def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" " pass" -#: ../../glossary.rst:1306 ../../glossary.rst:1320 +#: ../../glossary.rst:1308 ../../glossary.rst:1322 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`,有此功能的描述。" -#: ../../glossary.rst:1307 +#: ../../glossary.rst:1309 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1309 +#: ../../glossary.rst:1311 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -3001,7 +3025,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1312 +#: ../../glossary.rst:1314 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to :term:`static type checkers `. They can also aid " @@ -3011,45 +3035,45 @@ msgstr "" "(static type checkers) `\\ 很有用,並能協助 IDE 完成程式" "碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1316 +#: ../../glossary.rst:1318 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." msgstr "" -"全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" -"`typing.get_type_hints` 來存取。" +"全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使" +"用 :func:`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1321 +#: ../../glossary.rst:1323 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1323 +#: ../../glossary.rst:1325 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 " "Windows convention ``'\\r\\n'``, and the old Macintosh convention " -"``'\\r'``. See :pep:`278` and :pep:`3116`, as well as :func:`bytes." -"splitlines` for an additional use." +"``'\\r'``. See :pep:`278` and :pep:`3116`, as well " +"as :func:`bytes.splitlines` for an additional use." msgstr "" "一種解譯文字流 (text stream) 的方式,會將以下所有的情況識別為一行的結束:" "Unix 行尾慣例 ``'\\n'``、Windows 慣例 ``'\\r\\n'`` 和舊的 Macintosh 慣例 " -"``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用於 :func:`bytes." -"splitlines` 的附加用途。" +"``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用" +"於 :func:`bytes.splitlines` 的附加用途。" -#: ../../glossary.rst:1328 +#: ../../glossary.rst:1330 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1330 +#: ../../glossary.rst:1332 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1332 +#: ../../glossary.rst:1334 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "註釋變數或 class 屬性時,賦值是選擇性的: ::" -#: ../../glossary.rst:1334 +#: ../../glossary.rst:1336 msgid "" "class C:\n" " field: 'annotation'" @@ -3057,7 +3081,7 @@ msgstr "" "class C:\n" " field: 'annotation'" -#: ../../glossary.rst:1337 +#: ../../glossary.rst:1339 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" @@ -3065,15 +3089,15 @@ msgstr "" "變數註釋通常用於\\ :term:`型別提示 (type hint) `:例如,這個變數預" "期會取得 :class:`int`\\ (整數)值: ::" -#: ../../glossary.rst:1341 +#: ../../glossary.rst:1343 msgid "count: int = 0" msgstr "count: int = 0" -#: ../../glossary.rst:1343 +#: ../../glossary.rst:1345 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1345 +#: ../../glossary.rst:1347 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " @@ -3082,11 +3106,11 @@ msgstr "" "請參閱 :term:`function annotation`\\ (函式註釋)、:pep:`484` 和 :pep:`526`," "皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:1349 +#: ../../glossary.rst:1351 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1351 +#: ../../glossary.rst:1353 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -3097,27 +3121,27 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1356 +#: ../../glossary.rst:1358 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`。" -#: ../../glossary.rst:1357 +#: ../../glossary.rst:1359 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1359 +#: ../../glossary.rst:1361 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." msgstr "" -"一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" -"`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" +"一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行" +"由 :term:`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1361 +#: ../../glossary.rst:1363 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1363 +#: ../../glossary.rst:1365 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " @@ -3134,22 +3158,22 @@ msgstr "C-contiguous(C 連續的)" msgid "Fortran contiguous" msgstr "Fortran contiguous(Fortran 連續的)" -#: ../../glossary.rst:825 +#: ../../glossary.rst:827 msgid "magic" msgstr "magic" -#: ../../glossary.rst:1220 +#: ../../glossary.rst:1222 msgid "special" msgstr "special" #~ msgid "" #~ "An object which controls the environment seen in a :keyword:`with` " -#~ "statement by defining :meth:`~object.__enter__` and :meth:`~object." -#~ "__exit__` methods. See :pep:`343`." +#~ "statement by defining :meth:`~object.__enter__` " +#~ "and :meth:`~object.__exit__` methods. See :pep:`343`." #~ msgstr "" -#~ "一個可以控制 :keyword:`with` 陳述式中所見環境的物件,而它是透過定義 :meth:" -#~ "`~object.__enter__` 和 :meth:`~object.__exit__` method 來控制的。請參閱 :" -#~ "pep:`343`。" +#~ "一個可以控制 :keyword:`with` 陳述式中所見環境的物件,而它是透過定" +#~ "義 :meth:`~object.__enter__` 和 :meth:`~object.__exit__` method 來控制的。" +#~ "請參閱 :pep:`343`。" #~ msgid "" #~ "A variable which can have different values depending on its context. This " diff --git a/howto/free-threading-python.po b/howto/free-threading-python.po index fe26e49d23..2d43d4ae62 100644 --- a/howto/free-threading-python.po +++ b/howto/free-threading-python.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 00:13+0000\n" +"POT-Creation-Date: 2025-02-05 00:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -82,7 +82,7 @@ msgstr "" #: ../../howto/free-threading-python.rst:45 msgid "" "To check if the current interpreter supports free-threading, :option:`python " -"-VV <-V>` and :attr:`sys.version` contain \"experimental free-threading " +"-VV <-V>` and :data:`sys.version` contain \"experimental free-threading " "build\". The new :func:`sys._is_gil_enabled` function can be used to check " "whether the GIL is actually disabled in the running process." msgstr "" diff --git a/howto/mro.po b/howto/mro.po index 4b1860b886..1f107b45fd 100644 --- a/howto/mro.po +++ b/howto/mro.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2025-01-22 00:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -615,7 +615,7 @@ msgstr "" msgid "" "We see that class G inherits from F and E, with F *before* E: therefore we " "would expect the attribute *G.remember2buy* to be inherited by *F." -"rembermer2buy* and not by *E.remember2buy*: nevertheless Python 2.2 gives" +"remember2buy* and not by *E.remember2buy*: nevertheless Python 2.2 gives" msgstr "" #: ../../howto/mro.rst:407 diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index d668319414..5008415a77 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-12 00:13+0000\n" +"POT-Creation-Date: 2025-01-10 00:14+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -95,8 +94,8 @@ msgid "" "If there is no running event loop set, the function will return the result " "of the ``get_event_loop_policy().get_event_loop()`` call." msgstr "" -"如果沒有設定正在運行的事件迴圈,該函式將回傳 ``get_event_loop_policy()." -"get_event_loop()`` 呼叫的結果。" +"如果沒有設定正在運行的事件迴圈,該函式將回傳 " +"``get_event_loop_policy().get_event_loop()`` 呼叫的結果。" #: ../../library/asyncio-eventloop.rst:53 msgid "" @@ -105,8 +104,8 @@ msgid "" "is preferred to :func:`get_event_loop` in coroutines and callbacks." msgstr "" "由於此函式具有相當複雜的行為(尤其是在使用自訂事件迴圈策略時),在協程和回呼" -"函式中,建議使用 :func:`get_running_loop` 函式,而不是 :func:" -"`get_event_loop`。" +"函式中,建議使用 :func:`get_running_loop` 函式,而不" +"是 :func:`get_event_loop`。" #: ../../library/asyncio-eventloop.rst:58 msgid "" @@ -139,9 +138,9 @@ msgid "" "and :func:`new_event_loop` functions can be altered by :ref:`setting a " "custom event loop policy `." msgstr "" -"請注意 :func:`get_event_loop`、:func:`set_event_loop` 和 :func:" -"`new_event_loop` 函式的行為可以透過\\ :ref:`設定自訂事件迴圈策略 `\\ 進行調整。" +"請注意 :func:`get_event_loop`、:func:`set_event_loop` " +"和 :func:`new_event_loop` 函式的行為可以透過\\ :ref:`設定自訂事件迴圈策略 " +"`\\ 進行調整。" #: ../../library/asyncio-eventloop.rst:80 msgid "Contents" @@ -160,29 +159,29 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:86 msgid "" -"The `Callback Handles`_ section documents the :class:`Handle` and :class:" -"`TimerHandle` instances which are returned from scheduling methods such as :" -"meth:`loop.call_soon` and :meth:`loop.call_later`;" +"The `Callback Handles`_ section documents the :class:`Handle` " +"and :class:`TimerHandle` instances which are returned from scheduling " +"methods such as :meth:`loop.call_soon` and :meth:`loop.call_later`;" msgstr "" -"`回呼處理 `_\\ 章節記錄了從排程方法(如 :meth:`loop." -"call_soon` 和 :meth:`loop.call_later`)回傳的 :class:`Handle` 和 :class:" -"`TimerHandle` 實例;" +"`回呼處理 `_\\ 章節記錄了從排程方法" +"(如 :meth:`loop.call_soon` 和 :meth:`loop.call_later`)回傳" +"的 :class:`Handle` 和 :class:`TimerHandle` 實例;" #: ../../library/asyncio-eventloop.rst:90 msgid "" "The `Server Objects`_ section documents types returned from event loop " "methods like :meth:`loop.create_server`;" msgstr "" -"`Server 物件 `_\\ 章節記錄了從事件迴圈方法(如 :meth:`loop." -"create_server`)回傳的資料型別;" +"`Server 物件 `_\\ 章節記錄了從事件迴圈方法" +"(如 :meth:`loop.create_server`)回傳的資料型別;" #: ../../library/asyncio-eventloop.rst:93 msgid "" -"The `Event Loop Implementations`_ section documents the :class:" -"`SelectorEventLoop` and :class:`ProactorEventLoop` classes;" +"The `Event Loop Implementations`_ section documents " +"the :class:`SelectorEventLoop` and :class:`ProactorEventLoop` classes;" msgstr "" -"`事件迴圈實作 `_\\ 章節記錄了 :class:" -"`SelectorEventLoop` 和 :class:`ProactorEventLoop` 類別;" +"`事件迴圈實作 `_\\ 章節記錄" +"了 :class:`SelectorEventLoop` 和 :class:`ProactorEventLoop` 類別;" #: ../../library/asyncio-eventloop.rst:96 msgid "" @@ -210,8 +209,8 @@ msgid "" "If the argument is a :ref:`coroutine object ` it is implicitly " "scheduled to run as a :class:`asyncio.Task`." msgstr "" -"如果引數是\\ :ref:`協程物件 `,則它將被隱式排程為 :class:`asyncio." -"Task` 運行。" +"如果引數是\\ :ref:`協程物件 `,則它將被隱式排程" +"為 :class:`asyncio.Task` 運行。" #: ../../library/asyncio-eventloop.rst:123 msgid "Return the Future's result or raise its exception." @@ -296,8 +295,8 @@ msgid "" msgstr "請注意,使用 :func:`asyncio.run` 時不需要呼叫此函式。" #: ../../library/asyncio-eventloop.rst:176 -#: ../../library/asyncio-eventloop.rst:1269 -#: ../../library/asyncio-eventloop.rst:1712 +#: ../../library/asyncio-eventloop.rst:1278 +#: ../../library/asyncio-eventloop.rst:1721 msgid "Example::" msgstr "範例: ::" @@ -319,12 +318,13 @@ msgstr "" msgid "" "Schedule the closure of the default executor and wait for it to join all of " "the threads in the :class:`~concurrent.futures.ThreadPoolExecutor`. Once " -"this method has been called, using the default executor with :meth:`loop." -"run_in_executor` will raise a :exc:`RuntimeError`." +"this method has been called, using the default executor " +"with :meth:`loop.run_in_executor` will raise a :exc:`RuntimeError`." msgstr "" -"排程預設執行器的關閉,並等待它加入 :class:`~concurrent.futures." -"ThreadPoolExecutor` 中的所有執行緒。一旦呼叫了此方法,使用預設執行器與 :meth:" -"`loop.run_in_executor` 將引發 :exc:`RuntimeError`。" +"排程預設執行器的關閉,並等待它加" +"入 :class:`~concurrent.futures.ThreadPoolExecutor` 中的所有執行緒。一旦呼叫了" +"此方法,使用預設執行器與 :meth:`loop.run_in_executor` 將引" +"發 :exc:`RuntimeError`。" #: ../../library/asyncio-eventloop.rst:194 msgid "" @@ -381,12 +381,13 @@ msgstr "回呼函式按照其註冊的順序呼叫。每個回呼函式將被呼 #: ../../library/asyncio-eventloop.rst:227 msgid "" -"The optional keyword-only *context* argument specifies a custom :class:" -"`contextvars.Context` for the *callback* to run in. Callbacks use the " -"current context when no *context* is provided." +"The optional keyword-only *context* argument specifies a " +"custom :class:`contextvars.Context` for the *callback* to run in. Callbacks " +"use the current context when no *context* is provided." msgstr "" -"選用的僅限關鍵字引數 *context* 指定了要給 *callback* 執行的自定義 :class:" -"`contextvars.Context`。當未提供 *context* 時,回呼函式使用當前情境。" +"選用的僅限關鍵字引數 *context* 指定了要給 *callback* 執行的自定" +"義 :class:`contextvars.Context`。當未提供 *context* 時,回呼函式使用當前情" +"境。" #: ../../library/asyncio-eventloop.rst:231 msgid "Unlike :meth:`call_soon_threadsafe`, this method is not thread-safe." @@ -403,27 +404,34 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:239 msgid "" +"This function is safe to be called from a reentrant context or signal " +"handler, however, it is not safe or fruitful to use the returned handle in " +"such contexts." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:242 +msgid "" "Raises :exc:`RuntimeError` if called on a loop that's been closed. This can " "happen on a secondary thread when the main application is shutting down." msgstr "" "如果在已關閉的迴圈上呼叫,則引發 :exc:`RuntimeError`。在主應用程式關閉時,這" "可能發生在次要執行緒上。" -#: ../../library/asyncio-eventloop.rst:243 +#: ../../library/asyncio-eventloop.rst:246 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "請參閱文件的\\ :ref:`並行和多執行緒 `\\ 部分。" -#: ../../library/asyncio-eventloop.rst:246 -#: ../../library/asyncio-eventloop.rst:296 -#: ../../library/asyncio-eventloop.rst:316 +#: ../../library/asyncio-eventloop.rst:249 +#: ../../library/asyncio-eventloop.rst:299 +#: ../../library/asyncio-eventloop.rst:319 msgid "" "The *context* keyword-only parameter was added. See :pep:`567` for more " "details." msgstr "新增了 *context* 僅限關鍵字參數。詳細資訊請參閱 :pep:`567`。" -#: ../../library/asyncio-eventloop.rst:254 +#: ../../library/asyncio-eventloop.rst:257 msgid "" "Most :mod:`asyncio` scheduling functions don't allow passing keyword " "arguments. To do that, use :func:`functools.partial`::" @@ -431,14 +439,17 @@ msgstr "" "大多數 :mod:`asyncio` 排程函式不允許傳遞關鍵字引數。要傳遞關鍵字引數,請使" "用 :func:`functools.partial`: ::" -#: ../../library/asyncio-eventloop.rst:257 +#: ../../library/asyncio-eventloop.rst:260 msgid "" "# will schedule \"print(\"Hello\", flush=True)\"\n" "loop.call_soon(\n" " functools.partial(print, \"Hello\", flush=True))" msgstr "" +"# 將會排程 \"print(\"Hello\", flush=True)\"\n" +"loop.call_soon(\n" +" functools.partial(print, \"Hello\", flush=True))" -#: ../../library/asyncio-eventloop.rst:261 +#: ../../library/asyncio-eventloop.rst:264 msgid "" "Using partial objects is usually more convenient than using lambdas, as " "asyncio can render partial objects better in debug and error messages." @@ -446,11 +457,11 @@ msgstr "" "通常使用 partial 物件比使用 lambda 更方便,因為 asyncio 可以在除錯和錯誤訊息" "中更好地呈現 partial 物件。" -#: ../../library/asyncio-eventloop.rst:269 +#: ../../library/asyncio-eventloop.rst:272 msgid "Scheduling delayed callbacks" msgstr "排程延遲的回呼函式" -#: ../../library/asyncio-eventloop.rst:271 +#: ../../library/asyncio-eventloop.rst:274 msgid "" "Event loop provides mechanisms to schedule callback functions to be called " "at some point in the future. Event loop uses monotonic clocks to track time." @@ -458,20 +469,20 @@ msgstr "" "事件迴圈提供為回呼函式排程在將來某個時間點才呼叫的機制。事件迴圈使用了單調時" "鐘來追蹤時間。" -#: ../../library/asyncio-eventloop.rst:278 +#: ../../library/asyncio-eventloop.rst:281 msgid "" "Schedule *callback* to be called after the given *delay* number of seconds " "(can be either an int or a float)." msgstr "排程 *callback* 在給定的 *delay* 秒數後呼叫(可以是整數或浮點數)。" -#: ../../library/asyncio-eventloop.rst:281 -#: ../../library/asyncio-eventloop.rst:313 +#: ../../library/asyncio-eventloop.rst:284 +#: ../../library/asyncio-eventloop.rst:316 msgid "" "An instance of :class:`asyncio.TimerHandle` is returned which can be used to " "cancel the callback." msgstr "回傳 :class:`asyncio.TimerHandle` 的實例,可用於取消回呼函式。" -#: ../../library/asyncio-eventloop.rst:284 +#: ../../library/asyncio-eventloop.rst:287 msgid "" "*callback* will be called exactly once. If two callbacks are scheduled for " "exactly the same time, the order in which they are called is undefined." @@ -479,25 +490,26 @@ msgstr "" "*callback* 將只被呼叫恰好一次。如果有兩個回呼函式被排程在完全相同的時間,則其" "呼叫順序是不定的。" -#: ../../library/asyncio-eventloop.rst:288 +#: ../../library/asyncio-eventloop.rst:291 msgid "" "The optional positional *args* will be passed to the callback when it is " -"called. If you want the callback to be called with keyword arguments use :" -"func:`functools.partial`." +"called. If you want the callback to be called with keyword arguments " +"use :func:`functools.partial`." msgstr "" "可選的位置引數 *args* 將在呼叫回呼函式時傳遞。如果要使用關鍵字引數呼叫回呼函" "數,請使用 :func:`functools.partial`。" -#: ../../library/asyncio-eventloop.rst:292 +#: ../../library/asyncio-eventloop.rst:295 msgid "" -"An optional keyword-only *context* argument allows specifying a custom :" -"class:`contextvars.Context` for the *callback* to run in. The current " -"context is used when no *context* is provided." +"An optional keyword-only *context* argument allows specifying a " +"custom :class:`contextvars.Context` for the *callback* to run in. The " +"current context is used when no *context* is provided." msgstr "" -"可選的僅限關鍵字 *context* 引數允許為 *callback* 指定自定義的 :class:" -"`contextvars.Context` 以提供運行。當未提供 *context* 時,將使用當前情境。" +"可選的僅限關鍵字 *context* 引數允許為 *callback* 指定自定義" +"的 :class:`contextvars.Context` 以提供運行。當未提供 *context* 時,將使用當前" +"情境。" -#: ../../library/asyncio-eventloop.rst:300 +#: ../../library/asyncio-eventloop.rst:303 msgid "" "In Python 3.7 and earlier with the default event loop implementation, the " "*delay* could not exceed one day. This has been fixed in Python 3.8." @@ -505,19 +517,19 @@ msgstr "" "在 Python 3.7 及更早版本中,使用預設事件迴圈實作時,*delay* 不能超過一天。這" "在 Python 3.8 中已經修復。" -#: ../../library/asyncio-eventloop.rst:307 +#: ../../library/asyncio-eventloop.rst:310 msgid "" "Schedule *callback* to be called at the given absolute timestamp *when* (an " "int or a float), using the same time reference as :meth:`loop.time`." msgstr "" -"排程 *callback* 在給定的絕對時間戳 *when* (整數或浮點數)處呼叫,使用與 :" -"meth:`loop.time` 相同的時間參照。" +"排程 *callback* 在給定的絕對時間戳 *when* (整數或浮點數)處呼叫,使用" +"與 :meth:`loop.time` 相同的時間參照。" -#: ../../library/asyncio-eventloop.rst:311 +#: ../../library/asyncio-eventloop.rst:314 msgid "This method's behavior is the same as :meth:`call_later`." msgstr "此方法的行為與 :meth:`call_later` 相同。" -#: ../../library/asyncio-eventloop.rst:320 +#: ../../library/asyncio-eventloop.rst:323 msgid "" "In Python 3.7 and earlier with the default event loop implementation, the " "difference between *when* and the current time could not exceed one day. " @@ -526,13 +538,13 @@ msgstr "" "在 Python 3.7 及更早版本中,使用預設事件迴圈實作時,*when* 和當前時間之間的差" "值不能超過一天。這在 Python 3.8 中已經修復。" -#: ../../library/asyncio-eventloop.rst:327 +#: ../../library/asyncio-eventloop.rst:330 msgid "" "Return the current time, as a :class:`float` value, according to the event " "loop's internal monotonic clock." msgstr "根據事件迴圈的內部單調時鐘,回傳當前時間,以 :class:`float` 值表示。" -#: ../../library/asyncio-eventloop.rst:331 +#: ../../library/asyncio-eventloop.rst:334 msgid "" "In Python 3.7 and earlier timeouts (relative *delay* or absolute *when*) " "should not exceed one day. This has been fixed in Python 3.8." @@ -540,19 +552,19 @@ msgstr "" "在 Python 3.7 及更早版本中,超時(相對 *delay* 或絕對 *when*)不應超過一天。" "這在 Python 3.8 中已經修復。" -#: ../../library/asyncio-eventloop.rst:337 +#: ../../library/asyncio-eventloop.rst:340 msgid "The :func:`asyncio.sleep` function." msgstr "函式 :func:`asyncio.sleep`。" -#: ../../library/asyncio-eventloop.rst:341 +#: ../../library/asyncio-eventloop.rst:344 msgid "Creating Futures and Tasks" msgstr "建立 Futures 和 Tasks" -#: ../../library/asyncio-eventloop.rst:345 +#: ../../library/asyncio-eventloop.rst:348 msgid "Create an :class:`asyncio.Future` object attached to the event loop." msgstr "建立附加到事件迴圈的 :class:`asyncio.Future` 物件。" -#: ../../library/asyncio-eventloop.rst:347 +#: ../../library/asyncio-eventloop.rst:350 msgid "" "This is the preferred way to create Futures in asyncio. This lets third-" "party event loops provide alternative implementations of the Future object " @@ -561,94 +573,94 @@ msgstr "" "這是在 asyncio 中建立 Futures 的首選方式。這允許第三方事件迴圈提供 Future 物" "件的替代實作(具有更好的性能或儀器計測表現)。" -#: ../../library/asyncio-eventloop.rst:355 +#: ../../library/asyncio-eventloop.rst:358 msgid "" -"Schedule the execution of :ref:`coroutine ` *coro*. Return a :" -"class:`Task` object." +"Schedule the execution of :ref:`coroutine ` *coro*. Return " +"a :class:`Task` object." msgstr "排程執行\\ :ref:`協程 ` *coro*。回傳 :class:`Task` 物件。" -#: ../../library/asyncio-eventloop.rst:358 +#: ../../library/asyncio-eventloop.rst:361 msgid "" "Third-party event loops can use their own subclass of :class:`Task` for " -"interoperability. In this case, the result type is a subclass of :class:" -"`Task`." +"interoperability. In this case, the result type is a subclass " +"of :class:`Task`." msgstr "" "第三方事件迴圈可以使用其自己的 :class:`Task` 子類別以實現互操作性" "(interoperability)。在這種情況下,結果類型是 :class:`Task` 的子類別。" -#: ../../library/asyncio-eventloop.rst:362 +#: ../../library/asyncio-eventloop.rst:365 msgid "" "If the *name* argument is provided and not ``None``, it is set as the name " "of the task using :meth:`Task.set_name`." msgstr "" -"如果提供了 *name* 引數且不為 ``None``,則將其設置為任務的名稱,使用 :meth:" -"`Task.set_name`。" +"如果提供了 *name* 引數且不為 ``None``,則將其設置為任務的名稱,使" +"用 :meth:`Task.set_name`。" -#: ../../library/asyncio-eventloop.rst:365 +#: ../../library/asyncio-eventloop.rst:368 msgid "" -"An optional keyword-only *context* argument allows specifying a custom :" -"class:`contextvars.Context` for the *coro* to run in. The current context " -"copy is created when no *context* is provided." +"An optional keyword-only *context* argument allows specifying a " +"custom :class:`contextvars.Context` for the *coro* to run in. The current " +"context copy is created when no *context* is provided." msgstr "" -"可選的僅限關鍵字 *context* 引數允許為 *coro* 指定自定義的 :class:" -"`contextvars.Context` 以提供運行。當未提供 *context* 時,將建立當前情境的副" -"本。" +"可選的僅限關鍵字 *context* 引數允許為 *coro* 指定自定義" +"的 :class:`contextvars.Context` 以提供運行。當未提供 *context* 時,將建立當前" +"情境的副本。" -#: ../../library/asyncio-eventloop.rst:369 +#: ../../library/asyncio-eventloop.rst:372 msgid "Added the *name* parameter." msgstr "加入 *name* 參數。" -#: ../../library/asyncio-eventloop.rst:372 +#: ../../library/asyncio-eventloop.rst:375 msgid "Added the *context* parameter." msgstr "加入 *context* 參數。" -#: ../../library/asyncio-eventloop.rst:377 +#: ../../library/asyncio-eventloop.rst:380 msgid "Set a task factory that will be used by :meth:`loop.create_task`." msgstr "設置將由 :meth:`loop.create_task` 使用的任務工廠。" -#: ../../library/asyncio-eventloop.rst:380 +#: ../../library/asyncio-eventloop.rst:383 msgid "" "If *factory* is ``None`` the default task factory will be set. Otherwise, " "*factory* must be a *callable* with the signature matching ``(loop, coro, " "context=None)``, where *loop* is a reference to the active event loop, and " -"*coro* is a coroutine object. The callable must return a :class:`asyncio." -"Future`-compatible object." +"*coro* is a coroutine object. The callable must return " +"a :class:`asyncio.Future`-compatible object." msgstr "" "如果 *factory* 為 ``None``,將設置預設的任務工廠。否則,*factory* 必須是一個" "具有匹配簽名 ``(loop, coro, context=None)`` 的 *callable*,其中 *loop* 是有效" -"事件迴圈的參照,*coro* 是一個協程物件。該可呼叫物件必須回傳一個與 :class:" -"`asyncio.Future` 相容的物件。" +"事件迴圈的參照,*coro* 是一個協程物件。該可呼叫物件必須回傳一個" +"與 :class:`asyncio.Future` 相容的物件。" -#: ../../library/asyncio-eventloop.rst:388 +#: ../../library/asyncio-eventloop.rst:391 msgid "Return a task factory or ``None`` if the default one is in use." msgstr "回傳任務工廠,如果使用預設任務工廠則回傳 ``None``。" -#: ../../library/asyncio-eventloop.rst:392 +#: ../../library/asyncio-eventloop.rst:395 msgid "Opening network connections" msgstr "打開網路連線" -#: ../../library/asyncio-eventloop.rst:403 +#: ../../library/asyncio-eventloop.rst:406 msgid "" "Open a streaming transport connection to a given address specified by *host* " "and *port*." msgstr "打開以 *host* 和 *port* 指定之給定地址的串流傳輸連線。" -#: ../../library/asyncio-eventloop.rst:406 +#: ../../library/asyncio-eventloop.rst:409 msgid "" -"The socket family can be either :py:const:`~socket.AF_INET` or :py:const:" -"`~socket.AF_INET6` depending on *host* (or the *family* argument, if " -"provided)." +"The socket family can be either :py:const:`~socket.AF_INET` " +"or :py:const:`~socket.AF_INET6` depending on *host* (or the *family* " +"argument, if provided)." msgstr "" -"根據 *host*(或提供的 *family* 引數)的情況,socket 家族可以是 :py:const:" -"`~socket.AF_INET` 或 :py:const:`~socket.AF_INET6`。" +"根據 *host*(或提供的 *family* 引數)的情況,socket 家族可以" +"是 :py:const:`~socket.AF_INET` 或 :py:const:`~socket.AF_INET6`。" -#: ../../library/asyncio-eventloop.rst:410 +#: ../../library/asyncio-eventloop.rst:413 msgid "The socket type will be :py:const:`~socket.SOCK_STREAM`." msgstr "Socket 類型將為 :py:const:`~socket.SOCK_STREAM`。" -#: ../../library/asyncio-eventloop.rst:412 -#: ../../library/asyncio-eventloop.rst:1180 -#: ../../library/asyncio-eventloop.rst:1196 +#: ../../library/asyncio-eventloop.rst:415 +#: ../../library/asyncio-eventloop.rst:1189 +#: ../../library/asyncio-eventloop.rst:1205 msgid "" "*protocol_factory* must be a callable returning an :ref:`asyncio protocol " "` implementation." @@ -656,70 +668,70 @@ msgstr "" "*protocol_factory* 必須是一個回傳 :ref:`asyncio protocol ` " "實作的可呼叫函式。" -#: ../../library/asyncio-eventloop.rst:415 +#: ../../library/asyncio-eventloop.rst:418 msgid "" "This method will try to establish the connection in the background. When " "successful, it returns a ``(transport, protocol)`` pair." msgstr "" "此方法將嘗試在背景建立連線。成功時,它將回傳一對 ``(transport, protocol)``。" -#: ../../library/asyncio-eventloop.rst:418 +#: ../../library/asyncio-eventloop.rst:421 msgid "The chronological synopsis of the underlying operation is as follows:" msgstr "底層操作的時間軸簡介如下:" -#: ../../library/asyncio-eventloop.rst:420 +#: ../../library/asyncio-eventloop.rst:423 msgid "" "The connection is established and a :ref:`transport ` is " "created for it." msgstr "建立連線並為其建立\\ :ref:`傳輸 `。" -#: ../../library/asyncio-eventloop.rst:423 +#: ../../library/asyncio-eventloop.rst:426 msgid "" -"*protocol_factory* is called without arguments and is expected to return a :" -"ref:`protocol ` instance." +"*protocol_factory* is called without arguments and is expected to return " +"a :ref:`protocol ` instance." msgstr "" "*protocol_factory* 在無引數的情況下被呼叫,並且預計回傳一個 :ref:`協定 " "` 實例。" -#: ../../library/asyncio-eventloop.rst:426 +#: ../../library/asyncio-eventloop.rst:429 msgid "" -"The protocol instance is coupled with the transport by calling its :meth:" -"`~BaseProtocol.connection_made` method." +"The protocol instance is coupled with the transport by calling " +"its :meth:`~BaseProtocol.connection_made` method." msgstr "" "通過呼叫其 :meth:`~BaseProtocol.connection_made` 方法,將協議實例與傳輸連線在" "一起。" -#: ../../library/asyncio-eventloop.rst:429 +#: ../../library/asyncio-eventloop.rst:432 msgid "A ``(transport, protocol)`` tuple is returned on success." msgstr "成功時回傳一個 ``(transport, protocol)`` 元組。" -#: ../../library/asyncio-eventloop.rst:431 +#: ../../library/asyncio-eventloop.rst:434 msgid "" "The created transport is an implementation-dependent bidirectional stream." msgstr "建立的傳輸是一個依賴實作的雙向串流。" -#: ../../library/asyncio-eventloop.rst:434 -#: ../../library/asyncio-eventloop.rst:566 +#: ../../library/asyncio-eventloop.rst:437 +#: ../../library/asyncio-eventloop.rst:569 msgid "Other arguments:" msgstr "其他引數:" -#: ../../library/asyncio-eventloop.rst:436 +#: ../../library/asyncio-eventloop.rst:439 msgid "" "*ssl*: if given and not false, a SSL/TLS transport is created (by default a " "plain TCP transport is created). If *ssl* is a :class:`ssl.SSLContext` " -"object, this context is used to create the transport; if *ssl* is :const:" -"`True`, a default context returned from :func:`ssl.create_default_context` " -"is used." +"object, this context is used to create the transport; if *ssl* " +"is :const:`True`, a default context returned " +"from :func:`ssl.create_default_context` is used." msgstr "" "若有給定 *ssl* 且非 false,將建立 SSL/TLS 傳輸(預設建立普通 TCP 傳輸)。如" "果 *ssl* 為 :class:`ssl.SSLContext` 物件,則使用該情境來建立傳輸;如果 *ssl* " "為 :const:`True`,則使用 :func:`ssl.create_default_context` 回傳的預設情境。" -#: ../../library/asyncio-eventloop.rst:442 +#: ../../library/asyncio-eventloop.rst:445 msgid ":ref:`SSL/TLS security considerations `" msgstr ":ref:`SSL/TLS 安全考量 `" -#: ../../library/asyncio-eventloop.rst:444 +#: ../../library/asyncio-eventloop.rst:447 msgid "" "*server_hostname* sets or overrides the hostname that the target server's " "certificate will be matched against. Should only be passed if *ssl* is not " @@ -734,7 +746,7 @@ msgstr "" "預設值,必須傳遞 *server_hostname* 的值。若 *server_hostname* 為空字串,將停" "用主機名稱匹配(這是一個嚴重的安全風險,可能導致中間人攻擊)。" -#: ../../library/asyncio-eventloop.rst:452 +#: ../../library/asyncio-eventloop.rst:455 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to getaddrinfo() for *host* resolution. If given, " @@ -745,7 +757,7 @@ msgstr "" "getaddrinfo() 進行 *host* 解析。若有給定這些應該都是相應 :mod:`socket` 模組常" "數的整數。" -#: ../../library/asyncio-eventloop.rst:457 +#: ../../library/asyncio-eventloop.rst:460 msgid "" "*happy_eyeballs_delay*, if given, enables Happy Eyeballs for this " "connection. It should be a floating-point number representing the amount of " @@ -755,11 +767,11 @@ msgid "" "the RFC is ``0.25`` (250 milliseconds)." msgstr "" "若有給定,*happy_eyeballs_delay* 會啟用此連線的 Happy Eyeballs。它應該是一個" -"浮點數,表示等待連線嘗試完成的秒數,然後在並行啟動下一次嘗試。這是 :rfc:" -"`8305` 中定義的「連線嘗試延遲」。RFC 建議的合理預設值為 ``0.25`` 秒(250 毫" -"秒)。" +"浮點數,表示等待連線嘗試完成的秒數,然後在並行啟動下一次嘗試。這" +"是 :rfc:`8305` 中定義的「連線嘗試延遲」。RFC 建議的合理預設值為 ``0.25`` 秒" +"(250 毫秒)。" -#: ../../library/asyncio-eventloop.rst:465 +#: ../../library/asyncio-eventloop.rst:468 msgid "" "*interleave* controls address reordering when a host name resolves to " "multiple IP addresses. If ``0`` or unspecified, no reordering is done, and " @@ -775,29 +787,29 @@ msgstr "" "族計數」。如果未指定 *happy_eyeballs_delay*,則預設值為 ``0``,如果指定則為 " "``1``。" -#: ../../library/asyncio-eventloop.rst:474 +#: ../../library/asyncio-eventloop.rst:477 msgid "" -"*sock*, if given, should be an existing, already connected :class:`socket." -"socket` object to be used by the transport. If *sock* is given, none of " -"*host*, *port*, *family*, *proto*, *flags*, *happy_eyeballs_delay*, " -"*interleave* and *local_addr* should be specified." +"*sock*, if given, should be an existing, already " +"connected :class:`socket.socket` object to be used by the transport. If " +"*sock* is given, none of *host*, *port*, *family*, *proto*, *flags*, " +"*happy_eyeballs_delay*, *interleave* and *local_addr* should be specified." msgstr "" "若有給定 *sock* 則其應為已存在且已連線的 :class:`socket.socket` 物件,可供傳" "輸使用。如果提供了 *sock*,則不應指定 *host*、*port*、*family*、*proto*、" "*flags*、*happy_eyeballs_delay*、*interleave* 和 *local_addr* 中的任何一項。" -#: ../../library/asyncio-eventloop.rst:482 -#: ../../library/asyncio-eventloop.rst:597 -#: ../../library/asyncio-eventloop.rst:841 +#: ../../library/asyncio-eventloop.rst:485 +#: ../../library/asyncio-eventloop.rst:600 +#: ../../library/asyncio-eventloop.rst:844 msgid "" "The *sock* argument transfers ownership of the socket to the transport " -"created. To close the socket, call the transport's :meth:`~asyncio." -"BaseTransport.close` method." +"created. To close the socket, call the " +"transport's :meth:`~asyncio.BaseTransport.close` method." msgstr "" -"引數 *sock* 將 socket 所有權轉移給所建立的傳輸 socket,請呼叫傳輸的 :meth:" -"`~asyncio.BaseTransport.close` 方法。" +"引數 *sock* 將 socket 所有權轉移給所建立的傳輸 socket,請呼叫傳輸" +"的 :meth:`~asyncio.BaseTransport.close` 方法。" -#: ../../library/asyncio-eventloop.rst:486 +#: ../../library/asyncio-eventloop.rst:489 msgid "" "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " "the socket locally. The *local_host* and *local_port* are looked up using " @@ -807,8 +819,8 @@ msgstr "" "地綁定 socket。將使用 ``getaddrinfo()`` 查找 *local_host* 和 *local_port*,方" "式類似於 *host* 和 *port*。" -#: ../../library/asyncio-eventloop.rst:490 -#: ../../library/asyncio-eventloop.rst:935 +#: ../../library/asyncio-eventloop.rst:493 +#: ../../library/asyncio-eventloop.rst:938 msgid "" "*ssl_handshake_timeout* is (for a TLS connection) the time in seconds to " "wait for the TLS handshake to complete before aborting the connection. " @@ -818,10 +830,10 @@ msgstr "" "在那之前若未完成則會中斷連線。如果為 ``None`` (預設值),則會等待 ``60.0`` " "秒。" -#: ../../library/asyncio-eventloop.rst:494 -#: ../../library/asyncio-eventloop.rst:750 -#: ../../library/asyncio-eventloop.rst:852 -#: ../../library/asyncio-eventloop.rst:939 +#: ../../library/asyncio-eventloop.rst:497 +#: ../../library/asyncio-eventloop.rst:753 +#: ../../library/asyncio-eventloop.rst:855 +#: ../../library/asyncio-eventloop.rst:942 msgid "" "*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " "to complete before aborting the connection. ``30.0`` seconds if ``None`` " @@ -830,7 +842,7 @@ msgstr "" "*ssl_shutdown_timeout* 是等待 SSL 關閉完成以前中斷連線的時間,以秒為單位。如" "果為 ``None`` (預設值),則會等待 ``30.0`` 秒。" -#: ../../library/asyncio-eventloop.rst:498 +#: ../../library/asyncio-eventloop.rst:501 msgid "" "*all_errors* determines what exceptions are raised when a connection cannot " "be created. By default, only a single ``Exception`` is raised: the first " @@ -844,12 +856,12 @@ msgstr "" "包含所有錯誤訊息的單一 ``OSError``。當 ``all_errors`` 為 ``True`` 時,將引發" "包含所有例外的 ``ExceptionGroup`` (即使只有一個例外)。" -#: ../../library/asyncio-eventloop.rst:508 -#: ../../library/asyncio-eventloop.rst:762 +#: ../../library/asyncio-eventloop.rst:511 +#: ../../library/asyncio-eventloop.rst:765 msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." msgstr "新增 :class:`ProactorEventLoop` 中的 SSL/TLS 支援。" -#: ../../library/asyncio-eventloop.rst:512 +#: ../../library/asyncio-eventloop.rst:515 msgid "" "The socket option :ref:`socket.TCP_NODELAY ` is set " "by default for all TCP connections." @@ -857,16 +869,16 @@ msgstr "" "所有 TCP 連線都預設有 :ref:`socket.TCP_NODELAY ` " "socket 選項。" -#: ../../library/asyncio-eventloop.rst:517 -#: ../../library/asyncio-eventloop.rst:862 +#: ../../library/asyncio-eventloop.rst:520 +#: ../../library/asyncio-eventloop.rst:865 msgid "Added the *ssl_handshake_timeout* parameter." msgstr "增加 *ssl_handshake_timeout* 參數。" -#: ../../library/asyncio-eventloop.rst:521 +#: ../../library/asyncio-eventloop.rst:524 msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." msgstr "加入 *happy_eyeballs_delay* 和 *interleave* 參數。" -#: ../../library/asyncio-eventloop.rst:523 +#: ../../library/asyncio-eventloop.rst:526 msgid "" "Happy Eyeballs Algorithm: Success with Dual-Stack Hosts. When a server's " "IPv4 path and protocol are working, but the server's IPv6 path and protocol " @@ -882,53 +894,55 @@ msgstr "" "用戶端的使用者體驗變差。本文件具體說明了減少此用戶可見延遲的演算法要求並提供" "了一種演算法。" -#: ../../library/asyncio-eventloop.rst:532 +#: ../../library/asyncio-eventloop.rst:535 msgid "For more information: https://datatracker.ietf.org/doc/html/rfc6555" msgstr "更多資訊請見: https://datatracker.ietf.org/doc/html/rfc6555" -#: ../../library/asyncio-eventloop.rst:536 -#: ../../library/asyncio-eventloop.rst:660 -#: ../../library/asyncio-eventloop.rst:776 -#: ../../library/asyncio-eventloop.rst:815 -#: ../../library/asyncio-eventloop.rst:866 -#: ../../library/asyncio-eventloop.rst:947 +#: ../../library/asyncio-eventloop.rst:539 +#: ../../library/asyncio-eventloop.rst:663 +#: ../../library/asyncio-eventloop.rst:779 +#: ../../library/asyncio-eventloop.rst:818 +#: ../../library/asyncio-eventloop.rst:869 +#: ../../library/asyncio-eventloop.rst:950 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "增加 *ssl_shutdown_timeout* 參數。" -#: ../../library/asyncio-eventloop.rst:538 +#: ../../library/asyncio-eventloop.rst:541 msgid "*all_errors* was added." msgstr "已新增 *all_errors*。" -#: ../../library/asyncio-eventloop.rst:543 +#: ../../library/asyncio-eventloop.rst:546 msgid "" "The :func:`open_connection` function is a high-level alternative API. It " "returns a pair of (:class:`StreamReader`, :class:`StreamWriter`) that can be " "used directly in async/await code." msgstr "" -"函式 :func:`open_connection` 是高階的替代 API。它回傳一對 (:class:" -"`StreamReader`, :class:`StreamWriter`) 可直接在 async/await 程式碼中使用。" +"函式 :func:`open_connection` 是高階的替代 API。它回傳一對 " +"(:class:`StreamReader`, :class:`StreamWriter`) 可直接在 async/await 程式碼中" +"使用。" -#: ../../library/asyncio-eventloop.rst:553 +#: ../../library/asyncio-eventloop.rst:556 msgid "Create a datagram connection." msgstr "建立一個資料報連線。" -#: ../../library/asyncio-eventloop.rst:555 +#: ../../library/asyncio-eventloop.rst:558 msgid "" -"The socket family can be either :py:const:`~socket.AF_INET`, :py:const:" -"`~socket.AF_INET6`, or :py:const:`~socket.AF_UNIX`, depending on *host* (or " -"the *family* argument, if provided)." +"The socket family can be " +"either :py:const:`~socket.AF_INET`, :py:const:`~socket.AF_INET6`, " +"or :py:const:`~socket.AF_UNIX`, depending on *host* (or the *family* " +"argument, if provided)." msgstr "" "Socket 家族可以是 :py:const:`~socket.AF_INET`、:py:const:`~socket.AF_INET6` " "或 :py:const:`~socket.AF_UNIX`,視乎 *host*\\ (或提供的 *family* 引數)而" "定。" -#: ../../library/asyncio-eventloop.rst:559 +#: ../../library/asyncio-eventloop.rst:562 msgid "The socket type will be :py:const:`~socket.SOCK_DGRAM`." msgstr "Socket 類型將為 :py:const:`~socket.SOCK_DGRAM`。" -#: ../../library/asyncio-eventloop.rst:561 -#: ../../library/asyncio-eventloop.rst:686 -#: ../../library/asyncio-eventloop.rst:833 +#: ../../library/asyncio-eventloop.rst:564 +#: ../../library/asyncio-eventloop.rst:689 +#: ../../library/asyncio-eventloop.rst:836 msgid "" "*protocol_factory* must be a callable returning a :ref:`protocol ` implementation." @@ -936,31 +950,31 @@ msgstr "" "*protocol_factory* 必須是可呼叫的函式,回傳 :ref:`protocol ` 實作。" -#: ../../library/asyncio-eventloop.rst:564 -#: ../../library/asyncio-eventloop.rst:642 +#: ../../library/asyncio-eventloop.rst:567 +#: ../../library/asyncio-eventloop.rst:645 msgid "A tuple of ``(transport, protocol)`` is returned on success." msgstr "成功時回傳 ``(transport, protocol)`` 元組。" -#: ../../library/asyncio-eventloop.rst:568 +#: ../../library/asyncio-eventloop.rst:571 msgid "" "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " -"the socket locally. The *local_host* and *local_port* are looked up using :" -"meth:`getaddrinfo`." +"the socket locally. The *local_host* and *local_port* are looked up " +"using :meth:`getaddrinfo`." msgstr "" "*local_addr*,如果提供,是一個 ``(local_host, local_port)`` 元組,用於在本地" "綁定 socket。*local_host* 和 *local_port* 使用 :meth:`getaddrinfo` 來查找。" -#: ../../library/asyncio-eventloop.rst:572 +#: ../../library/asyncio-eventloop.rst:575 msgid "" "*remote_addr*, if given, is a ``(remote_host, remote_port)`` tuple used to " "connect the socket to a remote address. The *remote_host* and *remote_port* " "are looked up using :meth:`getaddrinfo`." msgstr "" "*remote_addr*,如果提供,是一個 ``(remote_host, remote_port)`` 元組,用於將 " -"socket 連線到遠端位址。 *remote_host* 和 *remote_port* 使用 :meth:" -"`getaddrinfo` 來查找。" +"socket 連線到遠端位址。 *remote_host* 和 *remote_port* 使" +"用 :meth:`getaddrinfo` 來查找。" -#: ../../library/asyncio-eventloop.rst:576 +#: ../../library/asyncio-eventloop.rst:579 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to :meth:`getaddrinfo` for *host* resolution. If " @@ -971,7 +985,7 @@ msgstr "" "的可選地址家族、協定和旗標。如果提供,這些應該都是來自相應的 :mod:`socket` 模" "組常數的整數。" -#: ../../library/asyncio-eventloop.rst:581 +#: ../../library/asyncio-eventloop.rst:584 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " @@ -980,35 +994,36 @@ msgid "" "is not defined then this capability is unsupported." msgstr "" "*reuse_port* 告訴核心允許將此端點綁定到與其他現有端點相同的埠,只要它們在建立" -"時都設定了此旗標。此選項不受 Windows 和某些 Unix 系統支援。如果未定義 :py:" -"const:`~socket.SO_REUSEPORT` 常數,則不支援此功能。" +"時都設定了此旗標。此選項不受 Windows 和某些 Unix 系統支援。如果未定" +"義 :py:const:`~socket.SO_REUSEPORT` 常數,則不支援此功能。" -#: ../../library/asyncio-eventloop.rst:587 +#: ../../library/asyncio-eventloop.rst:590 msgid "" "*allow_broadcast* tells the kernel to allow this endpoint to send messages " "to the broadcast address." msgstr "*allow_broadcast* 告訴核心允許此端點向廣播位址發送訊息。" -#: ../../library/asyncio-eventloop.rst:590 +#: ../../library/asyncio-eventloop.rst:593 msgid "" "*sock* can optionally be specified in order to use a preexisting, already " "connected, :class:`socket.socket` object to be used by the transport. If " -"specified, *local_addr* and *remote_addr* should be omitted (must be :const:" -"`None`)." +"specified, *local_addr* and *remote_addr* should be omitted (must " +"be :const:`None`)." msgstr "" "*sock* 可以選擇性地指定,以使用預先存在且已連線的 :class:`socket.socket` 物件" -"供傳輸使用。如果指定,*local_addr* 和 *remote_addr* 應省略(必須是 :const:" -"`None`\\ )。" +"供傳輸使用。如果指定,*local_addr* 和 *remote_addr* 應省略(必須" +"是 :const:`None`\\ )。" -#: ../../library/asyncio-eventloop.rst:601 +#: ../../library/asyncio-eventloop.rst:604 msgid "" -"See :ref:`UDP echo client protocol ` and :" -"ref:`UDP echo server protocol ` examples." +"See :ref:`UDP echo client protocol ` " +"and :ref:`UDP echo server protocol ` " +"examples." msgstr "" -"請參閱 :ref:`UDP 回應用戶端協議 ` 和 :ref:" -"`UDP 回應伺服器協議 ` 範例。" +"請參閱 :ref:`UDP 回應用戶端協議 ` " +"和 :ref:`UDP 回應伺服器協議 ` 範例。" -#: ../../library/asyncio-eventloop.rst:604 +#: ../../library/asyncio-eventloop.rst:607 msgid "" "The *family*, *proto*, *flags*, *reuse_address*, *reuse_port*, " "*allow_broadcast*, and *sock* parameters were added." @@ -1016,20 +1031,21 @@ msgstr "" "新增 *family*、*proto*、*flags*、*reuse_address*、*reuse_port*、" "*allow_broadcast* 和 *sock* 參數。" -#: ../../library/asyncio-eventloop.rst:608 +#: ../../library/asyncio-eventloop.rst:611 msgid "Added support for Windows." msgstr "新增對於 Windows 的支援。" -#: ../../library/asyncio-eventloop.rst:611 +#: ../../library/asyncio-eventloop.rst:614 msgid "" -"The *reuse_address* parameter is no longer supported, as using :ref:`socket." -"SO_REUSEADDR ` poses a significant security concern " -"for UDP. Explicitly passing ``reuse_address=True`` will raise an exception." +"The *reuse_address* parameter is no longer supported, as " +"using :ref:`socket.SO_REUSEADDR ` poses a significant " +"security concern for UDP. Explicitly passing ``reuse_address=True`` will " +"raise an exception." msgstr "" "不再支援 *reuse_address* 參數,因為使用 :py:const:`~sockets.SO_REUSEADDR` 對" "於 UDP 存有重大的安全疑慮。明確傳遞 ``reuse_address=True`` 將引發例外。" -#: ../../library/asyncio-eventloop.rst:617 +#: ../../library/asyncio-eventloop.rst:620 msgid "" "When multiple processes with differing UIDs assign sockets to an identical " "UDP socket address with ``SO_REUSEADDR``, incoming packets can become " @@ -1038,7 +1054,7 @@ msgstr "" "當具有不同 UID 的多個行程使用 ``SO_REUSEADDR`` 將 socket 分配給相同的 UDP " "socket 地址時,傳入的封包可能會在 socket 之間隨機分佈。" -#: ../../library/asyncio-eventloop.rst:621 +#: ../../library/asyncio-eventloop.rst:624 msgid "" "For supported platforms, *reuse_port* can be used as a replacement for " "similar functionality. With *reuse_port*, :ref:`socket.SO_REUSEPORT ` is set by default " "for all TCP connections." msgstr "" -"新增 *ssl_handshake_timeout* 與 *start_serving* 參數。所有 TCP 連線都預設有 :" -"ref:`socket.TCP_NODELAY ` socket 選項。" +"新增 *ssl_handshake_timeout* 與 *start_serving* 參數。所有 TCP 連線都預設" +"有 :ref:`socket.TCP_NODELAY ` socket 選項。" -#: ../../library/asyncio-eventloop.rst:780 +#: ../../library/asyncio-eventloop.rst:783 msgid "" "The :func:`start_server` function is a higher-level alternative API that " "returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can " "be used in an async/await code." msgstr "" -":func:`start_server` 函式是一個更高階的替代 API,它回傳一對 :class:" -"`StreamReader` 和 :class:`StreamWriter`,可以在 async/await 程式碼中使用。" +":func:`start_server` 函式是一個更高階的替代 API,它回傳一" +"對 :class:`StreamReader` 和 :class:`StreamWriter`,可以在 async/await 程式碼" +"中使用。" -#: ../../library/asyncio-eventloop.rst:791 +#: ../../library/asyncio-eventloop.rst:794 msgid "" -"Similar to :meth:`loop.create_server` but works with the :py:const:`~socket." -"AF_UNIX` socket family." +"Similar to :meth:`loop.create_server` but works with " +"the :py:const:`~socket.AF_UNIX` socket family." msgstr "" "類似 :meth:`loop.create_server`,但適用於 :py:const:`~socket.AF_UNIX` socket " "家族。" -#: ../../library/asyncio-eventloop.rst:794 +#: ../../library/asyncio-eventloop.rst:797 msgid "" "*path* is the name of a Unix domain socket, and is required, unless a *sock* " "argument is provided. Abstract Unix sockets, :class:`str`, :class:`bytes`, " @@ -1291,20 +1310,22 @@ msgstr "" "象 Unix sockets、:class:`str`、:class:`bytes` 和 :class:`~pathlib.Path` 路" "徑。" -#: ../../library/asyncio-eventloop.rst:799 +#: ../../library/asyncio-eventloop.rst:802 msgid "" "If *cleanup_socket* is true then the Unix socket will automatically be " "removed from the filesystem when the server is closed, unless the socket has " "been replaced after the server has been created." msgstr "" +"如果 *cleanup_socket* 為真,則 Unix socket 將在伺服器關閉時自動從檔案系統中刪" +"除,除非在建立伺服器後替換了 socket。" -#: ../../library/asyncio-eventloop.rst:803 +#: ../../library/asyncio-eventloop.rst:806 msgid "" "See the documentation of the :meth:`loop.create_server` method for " "information about arguments to this method." msgstr "有關此方法的引數資訊,請參閱 :meth:`loop.create_server` 方法的文件。" -#: ../../library/asyncio-eventloop.rst:810 +#: ../../library/asyncio-eventloop.rst:813 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :class:`~pathlib.Path` object." @@ -1312,26 +1333,26 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。*path* 參數現在可為一" "個 :class:`~pathlib.Path` 物件。" -#: ../../library/asyncio-eventloop.rst:819 +#: ../../library/asyncio-eventloop.rst:822 msgid "Added the *cleanup_socket* parameter." msgstr "加入 *cleanup_socket* 參數。" -#: ../../library/asyncio-eventloop.rst:826 +#: ../../library/asyncio-eventloop.rst:829 msgid "Wrap an already accepted connection into a transport/protocol pair." msgstr "將已接受的連線包裝成傳輸層/協議對。" -#: ../../library/asyncio-eventloop.rst:828 +#: ../../library/asyncio-eventloop.rst:831 msgid "" "This method can be used by servers that accept connections outside of " "asyncio but that use asyncio to handle them." msgstr "此方法可以由在 asyncio 外接受連線但使用 asyncio 處理連線的伺服器使用。" -#: ../../library/asyncio-eventloop.rst:831 -#: ../../library/asyncio-eventloop.rst:921 +#: ../../library/asyncio-eventloop.rst:834 +#: ../../library/asyncio-eventloop.rst:924 msgid "Parameters:" msgstr "參數:" -#: ../../library/asyncio-eventloop.rst:836 +#: ../../library/asyncio-eventloop.rst:839 msgid "" "*sock* is a preexisting socket object returned from :meth:`socket.accept " "`." @@ -1339,13 +1360,13 @@ msgstr "" "*sock* 是從 :meth:`socket.accept ` 回傳的預先存在的 " "socket 物件。" -#: ../../library/asyncio-eventloop.rst:845 +#: ../../library/asyncio-eventloop.rst:848 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the " "accepted connections." msgstr "*ssl* 可以設置為 :class:`~ssl.SSLContext` 以在已接受的連線上啟用 SSL。" -#: ../../library/asyncio-eventloop.rst:848 +#: ../../library/asyncio-eventloop.rst:851 msgid "" "*ssl_handshake_timeout* is (for an SSL connection) the time in seconds to " "wait for the SSL handshake to complete before aborting the connection. " @@ -1354,29 +1375,29 @@ msgstr "" "(對於 SSL 連線)\\ *ssl_handshake_timeout* 是在中斷連線之前等待 SSL 握手完成" "的時間(以秒為單位)。如果為 ``None``\\ (預設),則為 ``60.0`` 秒。" -#: ../../library/asyncio-eventloop.rst:856 +#: ../../library/asyncio-eventloop.rst:859 msgid "Returns a ``(transport, protocol)`` pair." msgstr "回傳 ``(transport, protocol)`` 對。" -#: ../../library/asyncio-eventloop.rst:870 +#: ../../library/asyncio-eventloop.rst:873 msgid "Transferring files" msgstr "傳輸檔案" -#: ../../library/asyncio-eventloop.rst:875 +#: ../../library/asyncio-eventloop.rst:878 msgid "" "Send a *file* over a *transport*. Return the total number of bytes sent." msgstr "通過 *transport* 發送 *file*。回傳發送的總位元組數。" -#: ../../library/asyncio-eventloop.rst:878 +#: ../../library/asyncio-eventloop.rst:881 msgid "The method uses high-performance :meth:`os.sendfile` if available." msgstr "如果可用,該方法使用高性能 :meth:`os.sendfile`。" -#: ../../library/asyncio-eventloop.rst:880 +#: ../../library/asyncio-eventloop.rst:883 msgid "*file* must be a regular file object opened in binary mode." msgstr "*file* 必須是以二進位模式打開的常規檔案物件。" -#: ../../library/asyncio-eventloop.rst:882 -#: ../../library/asyncio-eventloop.rst:1127 +#: ../../library/asyncio-eventloop.rst:885 +#: ../../library/asyncio-eventloop.rst:1136 msgid "" "*offset* tells from where to start reading the file. If specified, *count* " "is the total number of bytes to transmit as opposed to sending the file " @@ -1388,7 +1409,7 @@ msgstr "" "不是發送檔案直到達到 EOF。即使此方法引發錯誤時,檔案位置也始終更新,可以使" "用 :meth:`file.tell() ` 取得實際發送的位元組數。" -#: ../../library/asyncio-eventloop.rst:889 +#: ../../library/asyncio-eventloop.rst:892 msgid "" "*fallback* set to ``True`` makes asyncio to manually read and send the file " "when the platform does not support the sendfile system call (e.g. Windows or " @@ -1397,23 +1418,23 @@ msgstr "" "將 *fallback* 設置為 ``True`` 會使 asyncio 在平台不支援 sendfile 系統呼叫時" "(例如 Windows 或 Unix 上的 SSL socket)手動讀取和發送檔案。" -#: ../../library/asyncio-eventloop.rst:893 +#: ../../library/asyncio-eventloop.rst:896 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support the " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -"如果系統不支援 *sendfile* 系統呼叫且 *fallback* 為 ``False``,則引發 :exc:" -"`SendfileNotAvailableError`。" +"如果系統不支援 *sendfile* 系統呼叫且 *fallback* 為 ``False``,則引" +"發 :exc:`SendfileNotAvailableError`。" -#: ../../library/asyncio-eventloop.rst:900 +#: ../../library/asyncio-eventloop.rst:903 msgid "TLS Upgrade" msgstr "TLS 升級" -#: ../../library/asyncio-eventloop.rst:907 +#: ../../library/asyncio-eventloop.rst:910 msgid "Upgrade an existing transport-based connection to TLS." msgstr "將基於傳輸的現有連線升級到 TLS。" -#: ../../library/asyncio-eventloop.rst:909 +#: ../../library/asyncio-eventloop.rst:912 msgid "" "Create a TLS coder/decoder instance and insert it between the *transport* " "and the *protocol*. The coder/decoder implements both *transport*-facing " @@ -1422,7 +1443,7 @@ msgstr "" "建立 TLS 編解碼器實例並在 *transport* 和 *protocol* 之間插入它。編解碼器既實" "作了對於 *transport* 的協議,也實作了對於 *protocol* 的傳輸。" -#: ../../library/asyncio-eventloop.rst:913 +#: ../../library/asyncio-eventloop.rst:916 msgid "" "Return the created two-interface instance. After *await*, the *protocol* " "must stop using the original *transport* and communicate with the returned " @@ -1433,25 +1454,25 @@ msgstr "" "*transport*,僅與回傳的物件通信,因為編碼器快取了 *protocol* 端的資料,並且" "與 *transport* 間歇性地交換額外的 TLS session 封包。" -#: ../../library/asyncio-eventloop.rst:918 +#: ../../library/asyncio-eventloop.rst:921 msgid "" "In some situations (e.g. when the passed transport is already closing) this " "may return ``None``." msgstr "在某些情況下(例如傳入的傳輸已經關閉),此函式可能回傳 ``None``。" -#: ../../library/asyncio-eventloop.rst:923 +#: ../../library/asyncio-eventloop.rst:926 msgid "" -"*transport* and *protocol* instances that methods like :meth:`~loop." -"create_server` and :meth:`~loop.create_connection` return." +"*transport* and *protocol* instances that methods " +"like :meth:`~loop.create_server` and :meth:`~loop.create_connection` return." msgstr "" -"*transport* 和 *protocol* 實例,由像 :meth:`~loop.create_server` 和 :meth:" -"`~loop.create_connection` 等方法回傳。" +"*transport* 和 *protocol* 實例,由像 :meth:`~loop.create_server` " +"和 :meth:`~loop.create_connection` 等方法回傳。" -#: ../../library/asyncio-eventloop.rst:927 +#: ../../library/asyncio-eventloop.rst:930 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "*sslcontext*:配置好的 :class:`~ssl.SSLContext` 實例。" -#: ../../library/asyncio-eventloop.rst:929 +#: ../../library/asyncio-eventloop.rst:932 msgid "" "*server_side* pass ``True`` when a server-side connection is being upgraded " "(like the one created by :meth:`~loop.create_server`)." @@ -1459,17 +1480,17 @@ msgstr "" "當升級伺服器端連線時(像由 :meth:`~loop.create_server` 建立的那樣)傳遞 " "``True``。" -#: ../../library/asyncio-eventloop.rst:932 +#: ../../library/asyncio-eventloop.rst:935 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "*server_hostname*:設置或覆蓋將用於匹配目標伺服器憑證的主機名。" -#: ../../library/asyncio-eventloop.rst:952 +#: ../../library/asyncio-eventloop.rst:955 msgid "Watching file descriptors" msgstr "監視檔案描述器" -#: ../../library/asyncio-eventloop.rst:956 +#: ../../library/asyncio-eventloop.rst:959 msgid "" "Start monitoring the *fd* file descriptor for read availability and invoke " "*callback* with the specified arguments once *fd* is available for reading." @@ -1477,7 +1498,14 @@ msgstr "" "開始監視 *fd* 檔案描述器的讀取可用性,一但 *fd* 可讀取,使用指定引數呼叫 " "*callback*。" -#: ../../library/asyncio-eventloop.rst:962 +#: ../../library/asyncio-eventloop.rst:963 +#: ../../library/asyncio-eventloop.rst:977 +msgid "" +"Any preexisting callback registered for *fd* is cancelled and replaced by " +"*callback*." +msgstr "任何預先存在、為 *fd* 註冊的回呼函式將被取消並替換為 *callback*。" + +#: ../../library/asyncio-eventloop.rst:968 msgid "" "Stop monitoring the *fd* file descriptor for read availability. Returns " "``True`` if *fd* was previously being monitored for reads." @@ -1485,7 +1513,7 @@ msgstr "" "停止監視 *fd* 檔案描述器的讀取可用性。如果 *fd* 之前正在監視讀取,則回傳 " "``True``。" -#: ../../library/asyncio-eventloop.rst:967 +#: ../../library/asyncio-eventloop.rst:973 msgid "" "Start monitoring the *fd* file descriptor for write availability and invoke " "*callback* with the specified arguments once *fd* is available for writing." @@ -1493,8 +1521,8 @@ msgstr "" "開始監視 *fd* 檔案描述器的寫入可用性,一旦 *fd* 可寫入,使用指定引數呼叫 " "*callback*。" -#: ../../library/asyncio-eventloop.rst:971 -#: ../../library/asyncio-eventloop.rst:1236 +#: ../../library/asyncio-eventloop.rst:980 +#: ../../library/asyncio-eventloop.rst:1245 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." @@ -1502,7 +1530,7 @@ msgstr "" "使用 :func:`functools.partial` 向 *callback* :ref:`傳送關鍵字引數 `。" -#: ../../library/asyncio-eventloop.rst:976 +#: ../../library/asyncio-eventloop.rst:985 msgid "" "Stop monitoring the *fd* file descriptor for write availability. Returns " "``True`` if *fd* was previously being monitored for writes." @@ -1510,7 +1538,7 @@ msgstr "" "停止監視 *fd* 檔案描述器的寫入可用性。如果 *fd* 之前正在監視寫入,則回傳 " "``True``。" -#: ../../library/asyncio-eventloop.rst:979 +#: ../../library/asyncio-eventloop.rst:988 msgid "" "See also :ref:`Platform Support ` section for some " "limitations of these methods." @@ -1518,47 +1546,47 @@ msgstr "" "另請參閱\\ :ref:`平台支援 `\\ 部分以了解這些方法的" "一些限制。" -#: ../../library/asyncio-eventloop.rst:984 +#: ../../library/asyncio-eventloop.rst:993 msgid "Working with socket objects directly" msgstr "直接使用 socket 物件" -#: ../../library/asyncio-eventloop.rst:986 +#: ../../library/asyncio-eventloop.rst:995 msgid "" -"In general, protocol implementations that use transport-based APIs such as :" -"meth:`loop.create_connection` and :meth:`loop.create_server` are faster than " -"implementations that work with sockets directly. However, there are some use " -"cases when performance is not critical, and working with :class:`~socket." -"socket` objects directly is more convenient." +"In general, protocol implementations that use transport-based APIs such " +"as :meth:`loop.create_connection` and :meth:`loop.create_server` are faster " +"than implementations that work with sockets directly. However, there are " +"some use cases when performance is not critical, and working " +"with :class:`~socket.socket` objects directly is more convenient." msgstr "" -"一般情況下,使用基於傳輸的 API(如 :meth:`loop.create_connection` 和 :meth:" -"`loop.create_server`\\ )的協議實作比直接使用 socket 的實作更快。然而在某些情" -"況下性能不是關鍵,直接使用 :class:`~socket.socket` 物件更方便。" +"一般情況下,使用基於傳輸的 API(如 :meth:`loop.create_connection` " +"和 :meth:`loop.create_server`\\ )的協議實作比直接使用 socket 的實作更快。然" +"而在某些情況下性能不是關鍵,直接使用 :class:`~socket.socket` 物件更方便。" -#: ../../library/asyncio-eventloop.rst:995 +#: ../../library/asyncio-eventloop.rst:1004 msgid "" -"Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." -"recv() `." +"Receive up to *nbytes* from *sock*. Asynchronous version " +"of :meth:`socket.recv() `." msgstr "" "從 *sock* 接收最多 *nbytes*。:meth:`socket.recv() ` 的非" "同步版本。" -#: ../../library/asyncio-eventloop.rst:998 +#: ../../library/asyncio-eventloop.rst:1007 msgid "Return the received data as a bytes object." msgstr "將接收到的資料作為 bytes 物件回傳。" -#: ../../library/asyncio-eventloop.rst:1000 -#: ../../library/asyncio-eventloop.rst:1014 -#: ../../library/asyncio-eventloop.rst:1025 -#: ../../library/asyncio-eventloop.rst:1037 -#: ../../library/asyncio-eventloop.rst:1052 -#: ../../library/asyncio-eventloop.rst:1067 -#: ../../library/asyncio-eventloop.rst:1077 -#: ../../library/asyncio-eventloop.rst:1103 -#: ../../library/asyncio-eventloop.rst:1141 +#: ../../library/asyncio-eventloop.rst:1009 +#: ../../library/asyncio-eventloop.rst:1023 +#: ../../library/asyncio-eventloop.rst:1034 +#: ../../library/asyncio-eventloop.rst:1046 +#: ../../library/asyncio-eventloop.rst:1061 +#: ../../library/asyncio-eventloop.rst:1076 +#: ../../library/asyncio-eventloop.rst:1086 +#: ../../library/asyncio-eventloop.rst:1112 +#: ../../library/asyncio-eventloop.rst:1150 msgid "*sock* must be a non-blocking socket." msgstr "*sock* 必須是非阻塞 socket。" -#: ../../library/asyncio-eventloop.rst:1002 +#: ../../library/asyncio-eventloop.rst:1011 msgid "" "Even though this method was always documented as a coroutine method, " "releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this " @@ -1567,51 +1595,52 @@ msgstr "" "儘管此方法一直記錄為協程方法,但 Python 3.7 之前的版本回傳 :class:`Future`。" "自 Python 3.7 起,這是 ``async def`` 方法。" -#: ../../library/asyncio-eventloop.rst:1009 +#: ../../library/asyncio-eventloop.rst:1018 msgid "" -"Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" -"meth:`socket.recv_into() ` method." +"Receive data from *sock* into the *buf* buffer. Modeled after the " +"blocking :meth:`socket.recv_into() ` method." msgstr "" "從 *sock* 接收資料到 *buf* 緩衝區。仿照阻塞 :meth:`socket.recv_into() " "` 方法。" -#: ../../library/asyncio-eventloop.rst:1012 +#: ../../library/asyncio-eventloop.rst:1021 msgid "Return the number of bytes written to the buffer." msgstr "回傳寫入緩衝區位元組的數目。" -#: ../../library/asyncio-eventloop.rst:1020 +#: ../../library/asyncio-eventloop.rst:1029 msgid "" -"Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :" -"meth:`socket.recvfrom() `." +"Receive a datagram of up to *bufsize* from *sock*. Asynchronous version " +"of :meth:`socket.recvfrom() `." msgstr "" "從 *sock* 接收最多 *bufsize* 大小的資料單元。:meth:`socket.recvfrom() " "` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1023 +#: ../../library/asyncio-eventloop.rst:1032 msgid "Return a tuple of (received data, remote address)." msgstr "回傳一個元組 (received data, remote address)。" -#: ../../library/asyncio-eventloop.rst:1031 +#: ../../library/asyncio-eventloop.rst:1040 msgid "" "Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous " "version of :meth:`socket.recvfrom_into() `." msgstr "" -"從 *sock* 接收最多 *nbytes* 大小的資料單元到 *buf*。:meth:`socket." -"recvfrom_into() ` 的非同步版本。" +"從 *sock* 接收最多 *nbytes* 大小的資料單元到 " +"*buf*。:meth:`socket.recvfrom_into() ` 的非同步" +"版本。" -#: ../../library/asyncio-eventloop.rst:1035 +#: ../../library/asyncio-eventloop.rst:1044 msgid "Return a tuple of (number of bytes received, remote address)." msgstr "回傳一個元組 (number of bytes received, remote address)。" -#: ../../library/asyncio-eventloop.rst:1043 +#: ../../library/asyncio-eventloop.rst:1052 msgid "" -"Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." -"sendall() `." +"Send *data* to the *sock* socket. Asynchronous version " +"of :meth:`socket.sendall() `." msgstr "" -"將 *data* 發送到 *sock* socket。:meth:`socket.sendall() ` 的非同步版本。" +"將 *data* 發送到 *sock* socket。:meth:`socket.sendall() " +"` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1046 +#: ../../library/asyncio-eventloop.rst:1055 msgid "" "This method continues to send to the socket until either all data in *data* " "has been sent or an error occurs. ``None`` is returned on success. On " @@ -1623,8 +1652,8 @@ msgstr "" "回傳 ``None``。錯誤時引發例外。此外,沒有辦法確定接收端成功處理了多少資料(如" "果有的話)。" -#: ../../library/asyncio-eventloop.rst:1054 -#: ../../library/asyncio-eventloop.rst:1105 +#: ../../library/asyncio-eventloop.rst:1063 +#: ../../library/asyncio-eventloop.rst:1114 msgid "" "Even though the method was always documented as a coroutine method, before " "Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an " @@ -1633,39 +1662,39 @@ msgstr "" "儘管該方法一直被記錄為協程方法,但在 Python 3.7 之前它回傳 :class:`Future`。" "從 Python 3.7 開始,這是一個 ``async def`` 方法。" -#: ../../library/asyncio-eventloop.rst:1061 +#: ../../library/asyncio-eventloop.rst:1070 msgid "" -"Send a datagram from *sock* to *address*. Asynchronous version of :meth:" -"`socket.sendto() `." +"Send a datagram from *sock* to *address*. Asynchronous version " +"of :meth:`socket.sendto() `." msgstr "" -"從 *sock* 向 *address* 發送一個資料單元。:meth:`socket.sendto() ` 的非同步版本。" +"從 *sock* 向 *address* 發送一個資料單元。:meth:`socket.sendto() " +"` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1065 +#: ../../library/asyncio-eventloop.rst:1074 msgid "Return the number of bytes sent." msgstr "回傳發送的位元組數。" -#: ../../library/asyncio-eventloop.rst:1073 +#: ../../library/asyncio-eventloop.rst:1082 msgid "Connect *sock* to a remote socket at *address*." msgstr "將 *sock* 連線到位於 *address* 的遠端 socket。" -#: ../../library/asyncio-eventloop.rst:1075 +#: ../../library/asyncio-eventloop.rst:1084 msgid "" "Asynchronous version of :meth:`socket.connect() `." msgstr ":meth:`socket.connect() ` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1079 +#: ../../library/asyncio-eventloop.rst:1088 msgid "" "``address`` no longer needs to be resolved. ``sock_connect`` will try to " -"check if the *address* is already resolved by calling :func:`socket." -"inet_pton`. If not, :meth:`loop.getaddrinfo` will be used to resolve the " -"*address*." +"check if the *address* is already resolved by " +"calling :func:`socket.inet_pton`. If not, :meth:`loop.getaddrinfo` will be " +"used to resolve the *address*." msgstr "" -"不再需要解析 ``address``。``sock_connect`` 將嘗試透過呼叫 :func:`socket." -"inet_pton` 檢查 *address* 是否已解析。如果沒有,將使用 :meth:`loop." -"getaddrinfo` 解析 *address*。" +"不再需要解析 ``address``。``sock_connect`` 將嘗試透過呼" +"叫 :func:`socket.inet_pton` 檢查 *address* 是否已解析。如果沒有,將使" +"用 :meth:`loop.getaddrinfo` 解析 *address*。" -#: ../../library/asyncio-eventloop.rst:1088 +#: ../../library/asyncio-eventloop.rst:1097 msgid "" ":meth:`loop.create_connection` and :func:`asyncio.open_connection() " "`." @@ -1673,7 +1702,7 @@ msgstr "" ":meth:`loop.create_connection` 和 :func:`asyncio.open_connection() " "`。" -#: ../../library/asyncio-eventloop.rst:1094 +#: ../../library/asyncio-eventloop.rst:1103 msgid "" "Accept a connection. Modeled after the blocking :meth:`socket.accept() " "` method." @@ -1681,7 +1710,7 @@ msgstr "" "接受一個連線。模擬阻塞的 :meth:`socket.accept() ` 方" "法。" -#: ../../library/asyncio-eventloop.rst:1097 +#: ../../library/asyncio-eventloop.rst:1106 msgid "" "The socket must be bound to an address and listening for connections. The " "return value is a pair ``(conn, address)`` where *conn* is a *new* socket " @@ -1692,34 +1721,34 @@ msgstr "" "中 *conn* 是一個 *新* socket 物件,可在連線上發送和接收資料,*address* 是連接" "另一端對應的 socket 地址。" -#: ../../library/asyncio-eventloop.rst:1112 +#: ../../library/asyncio-eventloop.rst:1121 msgid ":meth:`loop.create_server` and :func:`start_server`." msgstr ":meth:`loop.create_server` 和 :func:`start_server`。" -#: ../../library/asyncio-eventloop.rst:1117 +#: ../../library/asyncio-eventloop.rst:1126 msgid "" "Send a file using high-performance :mod:`os.sendfile` if possible. Return " "the total number of bytes sent." msgstr "" "如果可行,使用高性能 :mod:`os.sendfile` 發送檔案。回傳發送的總位元組數。" -#: ../../library/asyncio-eventloop.rst:1120 +#: ../../library/asyncio-eventloop.rst:1129 msgid "" "Asynchronous version of :meth:`socket.sendfile() `." msgstr ":meth:`socket.sendfile() ` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1122 +#: ../../library/asyncio-eventloop.rst:1131 msgid "" -"*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." -"socket`." +"*sock* must be a non-" +"blocking :const:`socket.SOCK_STREAM` :class:`~socket.socket`." msgstr "" "*sock* 必須是非阻塞的 :const:`socket.SOCK_STREAM` :class:`~socket.socket`。" -#: ../../library/asyncio-eventloop.rst:1125 +#: ../../library/asyncio-eventloop.rst:1134 msgid "*file* must be a regular file object open in binary mode." msgstr "*file* 必須是以二進位模式打開的常規檔案物件。" -#: ../../library/asyncio-eventloop.rst:1134 +#: ../../library/asyncio-eventloop.rst:1143 msgid "" "*fallback*, when set to ``True``, makes asyncio manually read and send the " "file when the platform does not support the sendfile syscall (e.g. Windows " @@ -1728,27 +1757,27 @@ msgstr "" "當設置為 ``True`` 時,*fallback* 使 asyncio 在平台不支援 sendfile 系統呼叫時" "(例如 Windows 或 Unix 上的 SSL socket)手動讀取和發送檔案。" -#: ../../library/asyncio-eventloop.rst:1138 +#: ../../library/asyncio-eventloop.rst:1147 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -"如果系統不支援 *sendfile* 系統呼叫且 *fallback* 為 ``False``,引發 :exc:" -"`SendfileNotAvailableError`。" +"如果系統不支援 *sendfile* 系統呼叫且 *fallback* 為 ``False``,引" +"發 :exc:`SendfileNotAvailableError`。" -#: ../../library/asyncio-eventloop.rst:1147 +#: ../../library/asyncio-eventloop.rst:1156 msgid "DNS" msgstr "DNS" -#: ../../library/asyncio-eventloop.rst:1152 +#: ../../library/asyncio-eventloop.rst:1161 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." msgstr ":meth:`socket.getaddrinfo` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1156 +#: ../../library/asyncio-eventloop.rst:1165 msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr ":meth:`socket.getnameinfo` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1159 +#: ../../library/asyncio-eventloop.rst:1168 msgid "" "Both *getaddrinfo* and *getnameinfo* internally utilize their synchronous " "versions through the loop's default thread pool executor. When this executor " @@ -1758,84 +1787,86 @@ msgid "" "executor with a larger number of workers." msgstr "" -#: ../../library/asyncio-eventloop.rst:1166 +#: ../../library/asyncio-eventloop.rst:1175 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " -"return a coroutine, but prior to Python 3.7 they were, in fact, returning :" -"class:`asyncio.Future` objects. Starting with Python 3.7 both methods are " -"coroutines." +"return a coroutine, but prior to Python 3.7 they were, in fact, " +"returning :class:`asyncio.Future` objects. Starting with Python 3.7 both " +"methods are coroutines." msgstr "" "*getaddrinfo* 和 *getnameinfo* 方法一直被記錄為回傳協程,但在 Python 3.7 之前" "它們實際上回傳 :class:`asyncio.Future` 物件。從 Python 3.7 開始,兩個方法都是" "協程。" -#: ../../library/asyncio-eventloop.rst:1174 +#: ../../library/asyncio-eventloop.rst:1183 msgid "Working with pipes" msgstr "使用管道" -#: ../../library/asyncio-eventloop.rst:1178 +#: ../../library/asyncio-eventloop.rst:1187 msgid "Register the read end of *pipe* in the event loop." msgstr "在事件迴圈中註冊 *pipe* 的讀取端。" -#: ../../library/asyncio-eventloop.rst:1183 +#: ../../library/asyncio-eventloop.rst:1192 msgid "*pipe* is a :term:`file-like object `." msgstr "*pipe* 是 :term:`類檔案物件 `。" -#: ../../library/asyncio-eventloop.rst:1185 +#: ../../library/asyncio-eventloop.rst:1194 msgid "" -"Return pair ``(transport, protocol)``, where *transport* supports the :class:" -"`ReadTransport` interface and *protocol* is an object instantiated by the " -"*protocol_factory*." +"Return pair ``(transport, protocol)``, where *transport* supports " +"the :class:`ReadTransport` interface and *protocol* is an object " +"instantiated by the *protocol_factory*." msgstr "" -"回傳 ``(transport, protocol)`` 對,其中 *transport* 支援 :class:" -"`ReadTransport` 介面,*protocol* 是由 *protocol_factory* 實例化的物件。" +"回傳 ``(transport, protocol)`` 對,其中 *transport* 支" +"援 :class:`ReadTransport` 介面,*protocol* 是由 *protocol_factory* 實例化的物" +"件。" -#: ../../library/asyncio-eventloop.rst:1189 -#: ../../library/asyncio-eventloop.rst:1205 +#: ../../library/asyncio-eventloop.rst:1198 +#: ../../library/asyncio-eventloop.rst:1214 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." msgstr "使用 :class:`SelectorEventLoop` 事件迴圈時,*pipe* 設置為非阻塞模式。" -#: ../../library/asyncio-eventloop.rst:1194 +#: ../../library/asyncio-eventloop.rst:1203 msgid "Register the write end of *pipe* in the event loop." msgstr "在事件迴圈中註冊 *pipe* 的寫入端。" -#: ../../library/asyncio-eventloop.rst:1199 +#: ../../library/asyncio-eventloop.rst:1208 msgid "*pipe* is :term:`file-like object `." msgstr "*pipe* 是 :term:`file-like object `。" -#: ../../library/asyncio-eventloop.rst:1201 +#: ../../library/asyncio-eventloop.rst:1210 msgid "" -"Return pair ``(transport, protocol)``, where *transport* supports :class:" -"`WriteTransport` interface and *protocol* is an object instantiated by the " -"*protocol_factory*." +"Return pair ``(transport, protocol)``, where *transport* " +"supports :class:`WriteTransport` interface and *protocol* is an object " +"instantiated by the *protocol_factory*." msgstr "" -"回傳 ``(transport, protocol)`` 對,其中 *transport* 支援 :class:" -"`WriteTransport` 介面,*protocol* 是由 *protocol_factory* 實例化的物件。" +"回傳 ``(transport, protocol)`` 對,其中 *transport* 支" +"援 :class:`WriteTransport` 介面,*protocol* 是由 *protocol_factory* 實例化的" +"物件。" -#: ../../library/asyncio-eventloop.rst:1210 +#: ../../library/asyncio-eventloop.rst:1219 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." msgstr "" -":class:`SelectorEventLoop` 在 Windows 上不支援上述方法。對於 Windows 請使用 :" -"class:`ProactorEventLoop`。" +":class:`SelectorEventLoop` 在 Windows 上不支援上述方法。對於 Windows 請使" +"用 :class:`ProactorEventLoop`。" -#: ../../library/asyncio-eventloop.rst:1215 +#: ../../library/asyncio-eventloop.rst:1224 msgid "" "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." msgstr ":meth:`loop.subprocess_exec` 和 :meth:`loop.subprocess_shell` 方法。" -#: ../../library/asyncio-eventloop.rst:1220 +#: ../../library/asyncio-eventloop.rst:1229 msgid "Unix signals" msgstr "Unix 訊號" -#: ../../library/asyncio-eventloop.rst:1226 +#: ../../library/asyncio-eventloop.rst:1235 msgid "Set *callback* as the handler for the *signum* signal." msgstr "將 *callback* 設置為 *signum* 訊號的處理程式。" -#: ../../library/asyncio-eventloop.rst:1228 +#: ../../library/asyncio-eventloop.rst:1237 msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " "and runnable coroutines of that event loop. Unlike signal handlers " @@ -1846,7 +1877,7 @@ msgstr "" "用 :func:`signal.signal` 註冊的訊號處理程式不同,使用此函式註冊的回呼允許與事" "件迴圈進行互動。" -#: ../../library/asyncio-eventloop.rst:1233 +#: ../../library/asyncio-eventloop.rst:1242 msgid "" "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " "Raise :exc:`RuntimeError` if there is a problem setting up the handler." @@ -1854,16 +1885,16 @@ msgstr "" "如果訊號號無效或不可捕獲,引發 :exc:`ValueError`。如果設定處理程序有問題,拋" "出 :exc:`RuntimeError`。" -#: ../../library/asyncio-eventloop.rst:1239 +#: ../../library/asyncio-eventloop.rst:1248 msgid "" "Like :func:`signal.signal`, this function must be invoked in the main thread." msgstr "像 :func:`signal.signal` 一樣,此函式必須在主執行緒中呼叫。" -#: ../../library/asyncio-eventloop.rst:1244 +#: ../../library/asyncio-eventloop.rst:1253 msgid "Remove the handler for the *sig* signal." msgstr "移除 *sig* 訊號的處理程式。" -#: ../../library/asyncio-eventloop.rst:1246 +#: ../../library/asyncio-eventloop.rst:1255 msgid "" "Return ``True`` if the signal handler was removed, or ``False`` if no " "handler was set for the given signal." @@ -1871,19 +1902,19 @@ msgstr "" "如果訊號處理程式被移除,回傳 ``True``;如果給定訊號沒有設置處理程式,回傳 " "``False``。" -#: ../../library/asyncio-eventloop.rst:1253 +#: ../../library/asyncio-eventloop.rst:1262 msgid "The :mod:`signal` module." msgstr ":mod:`signal` 模組。" -#: ../../library/asyncio-eventloop.rst:1257 +#: ../../library/asyncio-eventloop.rst:1266 msgid "Executing code in thread or process pools" msgstr "在執行緒池或行程池中執行程式碼" -#: ../../library/asyncio-eventloop.rst:1261 +#: ../../library/asyncio-eventloop.rst:1270 msgid "Arrange for *func* to be called in the specified executor." msgstr "安排在指定的執行器中呼叫 *func*。" -#: ../../library/asyncio-eventloop.rst:1263 +#: ../../library/asyncio-eventloop.rst:1272 msgid "" "The *executor* argument should be an :class:`concurrent.futures.Executor` " "instance. The default executor is used if *executor* is ``None``. The " @@ -1892,7 +1923,7 @@ msgid "" "and used by :func:`run_in_executor` if needed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1271 +#: ../../library/asyncio-eventloop.rst:1280 msgid "" "import asyncio\n" "import concurrent.futures\n" @@ -1935,23 +1966,23 @@ msgid "" " asyncio.run(main())" msgstr "" -#: ../../library/asyncio-eventloop.rst:1311 +#: ../../library/asyncio-eventloop.rst:1320 msgid "" "Note that the entry point guard (``if __name__ == '__main__'``) is required " "for option 3 due to the peculiarities of :mod:`multiprocessing`, which is " "used by :class:`~concurrent.futures.ProcessPoolExecutor`. See :ref:`Safe " "importing of main module `." msgstr "" -"請注意,由於 :mod:`multiprocessing`\\ (由 :class:`~concurrent.futures." -"ProcessPoolExecutor` 使用)的特殊性,選項 3 需要進入點保護(\\ ``if __name__ " -"== '__main__'``\\ )。請參閱\\ :ref:`主模組的安全引入 `。" +"請注意,由於 :mod:`multiprocessing`\\ " +"(由 :class:`~concurrent.futures.ProcessPoolExecutor` 使用)的特殊性,選項 3 " +"需要進入點保護(\\ ``if __name__ == '__main__'``\\ )。請參閱\\ :ref:`主模組" +"的安全引入 `。" -#: ../../library/asyncio-eventloop.rst:1316 +#: ../../library/asyncio-eventloop.rst:1325 msgid "This method returns a :class:`asyncio.Future` object." msgstr "此方法回傳 :class:`asyncio.Future` 物件。" -#: ../../library/asyncio-eventloop.rst:1318 +#: ../../library/asyncio-eventloop.rst:1327 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." @@ -1959,7 +1990,7 @@ msgstr "" "使用 :func:`functools.partial` 將來\\ :ref:`關鍵字引數傳遞 `\\ 給 *func*。" -#: ../../library/asyncio-eventloop.rst:1321 +#: ../../library/asyncio-eventloop.rst:1330 msgid "" ":meth:`loop.run_in_executor` no longer configures the ``max_workers`` of the " "thread pool executor it creates, instead leaving it up to the thread pool " @@ -1967,38 +1998,38 @@ msgid "" "default." msgstr "" ":meth:`loop.run_in_executor` 不再配置它建立的執行緒池執行器的 " -"``max_workers``,而是讓執行緒池執行器(\\ :class:`~concurrent.futures." -"ThreadPoolExecutor`)設定預設值。" +"``max_workers``,而是讓執行緒池執行器" +"(\\ :class:`~concurrent.futures.ThreadPoolExecutor`)設定預設值。" -#: ../../library/asyncio-eventloop.rst:1330 +#: ../../library/asyncio-eventloop.rst:1339 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " -"*executor* must be an instance of :class:`~concurrent.futures." -"ThreadPoolExecutor`." +"*executor* must be an instance " +"of :class:`~concurrent.futures.ThreadPoolExecutor`." msgstr "" "將 *executor* 設置為 :meth:`run_in_executor` 使用的預設執行器。*executor* 必" "須是 :class:`~concurrent.futures.ThreadPoolExecutor` 的實例。" -#: ../../library/asyncio-eventloop.rst:1334 +#: ../../library/asyncio-eventloop.rst:1343 msgid "" -"*executor* must be an instance of :class:`~concurrent.futures." -"ThreadPoolExecutor`." +"*executor* must be an instance " +"of :class:`~concurrent.futures.ThreadPoolExecutor`." msgstr "" "*executor* 必須是 :class:`~concurrent.futures.ThreadPoolExecutor` 的實例。" -#: ../../library/asyncio-eventloop.rst:1340 +#: ../../library/asyncio-eventloop.rst:1349 msgid "Error Handling API" msgstr "錯誤處理 API" -#: ../../library/asyncio-eventloop.rst:1342 +#: ../../library/asyncio-eventloop.rst:1351 msgid "Allows customizing how exceptions are handled in the event loop." msgstr "允許自定義事件迴圈中的例外處理方式。" -#: ../../library/asyncio-eventloop.rst:1346 +#: ../../library/asyncio-eventloop.rst:1355 msgid "Set *handler* as the new event loop exception handler." msgstr "將 *handler* 設定為新的事件迴圈例外處理程式。" -#: ../../library/asyncio-eventloop.rst:1348 +#: ../../library/asyncio-eventloop.rst:1357 msgid "" "If *handler* is ``None``, the default exception handler will be set. " "Otherwise, *handler* must be a callable with the signature matching ``(loop, " @@ -2011,16 +2042,16 @@ msgstr "" "圈的,``context`` 是包含例外詳細資訊的 ``dict`` 物件(有關情境的詳細資訊,請" "參閱 :meth:`call_exception_handler` 文件)。" -#: ../../library/asyncio-eventloop.rst:1356 +#: ../../library/asyncio-eventloop.rst:1365 msgid "" -"If the handler is called on behalf of a :class:`~asyncio.Task` or :class:" -"`~asyncio.Handle`, it is run in the :class:`contextvars.Context` of that " -"task or callback handle." +"If the handler is called on behalf of a :class:`~asyncio.Task` " +"or :class:`~asyncio.Handle`, it is run in the :class:`contextvars.Context` " +"of that task or callback handle." msgstr "" "如果代表 :class:`~asyncio.Task` 或 :class:`~asyncio.Handle` 呼叫處理程式,它" "將在該任務或回呼處理程式的 :class:`contextvars.Context` 中運行。" -#: ../../library/asyncio-eventloop.rst:1362 +#: ../../library/asyncio-eventloop.rst:1371 msgid "" "The handler may be called in the :class:`~contextvars.Context` of the task " "or handle where the exception originated." @@ -2028,18 +2059,18 @@ msgstr "" "處理程式可能在引發例外的任務或處理程式的 :class:`~contextvars.Context` 中被呼" "叫。" -#: ../../library/asyncio-eventloop.rst:1367 +#: ../../library/asyncio-eventloop.rst:1376 msgid "" "Return the current exception handler, or ``None`` if no custom exception " "handler was set." msgstr "" "回傳當前的例外處理程式,如果未設置自定義例外處理程式,則回傳 ``None``。" -#: ../../library/asyncio-eventloop.rst:1374 +#: ../../library/asyncio-eventloop.rst:1383 msgid "Default exception handler." msgstr "預設例外處理程式。" -#: ../../library/asyncio-eventloop.rst:1376 +#: ../../library/asyncio-eventloop.rst:1385 msgid "" "This is called when an exception occurs and no exception handler is set. " "This can be called by a custom exception handler that wants to defer to the " @@ -2048,17 +2079,17 @@ msgstr "" "當發生例外且未設置例外處理程式時呼叫此函式。自定義例外處理程式可以呼叫此函式" "以轉由預設處理程式處理。" -#: ../../library/asyncio-eventloop.rst:1380 +#: ../../library/asyncio-eventloop.rst:1389 msgid "" -"*context* parameter has the same meaning as in :meth:" -"`call_exception_handler`." +"*context* parameter has the same meaning as " +"in :meth:`call_exception_handler`." msgstr "*context* 參數與 :meth:`call_exception_handler` 中的意思相同。" -#: ../../library/asyncio-eventloop.rst:1385 +#: ../../library/asyncio-eventloop.rst:1394 msgid "Call the current event loop exception handler." msgstr "呼叫當前事件迴圈例外處理程式。" -#: ../../library/asyncio-eventloop.rst:1387 +#: ../../library/asyncio-eventloop.rst:1396 msgid "" "*context* is a ``dict`` object containing the following keys (new keys may " "be introduced in future Python versions):" @@ -2066,141 +2097,143 @@ msgstr "" "*context* 是一個包含以下鍵的 ``dict`` 物件(未來的 Python 版本中可能會引入新" "的鍵):" -#: ../../library/asyncio-eventloop.rst:1390 +#: ../../library/asyncio-eventloop.rst:1399 msgid "'message': Error message;" msgstr "'message':錯誤訊息;" -#: ../../library/asyncio-eventloop.rst:1391 +#: ../../library/asyncio-eventloop.rst:1400 msgid "'exception' (optional): Exception object;" msgstr "'exception'(可選):例外物件;" -#: ../../library/asyncio-eventloop.rst:1392 +#: ../../library/asyncio-eventloop.rst:1401 msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "'future'(可選): :class:`asyncio.Future` 實例;" -#: ../../library/asyncio-eventloop.rst:1393 +#: ../../library/asyncio-eventloop.rst:1402 msgid "'task' (optional): :class:`asyncio.Task` instance;" msgstr "'task'(可選): :class:`asyncio.Task` 實例;" -#: ../../library/asyncio-eventloop.rst:1394 +#: ../../library/asyncio-eventloop.rst:1403 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" msgstr "'handle'(可選): :class:`asyncio.Handle` 實例;" -#: ../../library/asyncio-eventloop.rst:1395 +#: ../../library/asyncio-eventloop.rst:1404 msgid "'protocol' (optional): :ref:`Protocol ` instance;" msgstr "'protocol'(可選): :ref:`Protocol ` 實例;" -#: ../../library/asyncio-eventloop.rst:1396 +#: ../../library/asyncio-eventloop.rst:1405 msgid "'transport' (optional): :ref:`Transport ` instance;" msgstr "'transport'(可選): :ref:`Transport ` 實例;" -#: ../../library/asyncio-eventloop.rst:1397 +#: ../../library/asyncio-eventloop.rst:1406 msgid "'socket' (optional): :class:`socket.socket` instance;" msgstr "'socket'(可選): :class:`socket.socket` 實例;" -#: ../../library/asyncio-eventloop.rst:1398 +#: ../../library/asyncio-eventloop.rst:1407 msgid "'asyncgen' (optional): Asynchronous generator that caused" msgstr "'asyncgen'(可選): 非同步產生器引發" -#: ../../library/asyncio-eventloop.rst:1399 +#: ../../library/asyncio-eventloop.rst:1408 msgid "the exception." msgstr "例外。" -#: ../../library/asyncio-eventloop.rst:1403 +#: ../../library/asyncio-eventloop.rst:1412 msgid "" "This method should not be overloaded in subclassed event loops. For custom " "exception handling, use the :meth:`set_exception_handler` method." msgstr "" -"此方法不應在子類別事件迴圈中被覆寫。為了自定義例外處理,請使用 :meth:" -"`set_exception_handler` 方法。" +"此方法不應在子類別事件迴圈中被覆寫。為了自定義例外處理,請使" +"用 :meth:`set_exception_handler` 方法。" -#: ../../library/asyncio-eventloop.rst:1408 +#: ../../library/asyncio-eventloop.rst:1417 msgid "Enabling debug mode" msgstr "啟用除錯模式" -#: ../../library/asyncio-eventloop.rst:1412 +#: ../../library/asyncio-eventloop.rst:1421 msgid "Get the debug mode (:class:`bool`) of the event loop." msgstr "取得事件迴圈的除錯模式(\\ :class:`bool`\\ )。" -#: ../../library/asyncio-eventloop.rst:1414 +#: ../../library/asyncio-eventloop.rst:1423 msgid "" -"The default value is ``True`` if the environment variable :envvar:" -"`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." +"The default value is ``True`` if the environment " +"variable :envvar:`PYTHONASYNCIODEBUG` is set to a non-empty string, " +"``False`` otherwise." msgstr "" "如果環境變數 :envvar:`PYTHONASYNCIODEBUG` 被設定為非空字串,則預設值為 " "``True``,否則為 ``False``。" -#: ../../library/asyncio-eventloop.rst:1420 +#: ../../library/asyncio-eventloop.rst:1429 msgid "Set the debug mode of the event loop." msgstr "設定事件迴圈的除錯模式。" -#: ../../library/asyncio-eventloop.rst:1424 +#: ../../library/asyncio-eventloop.rst:1433 msgid "" "The new :ref:`Python Development Mode ` can now also be used to " "enable the debug mode." msgstr "現在也可以使用新的 :ref:`Python 開發模式 ` 啟用除錯模式。" -#: ../../library/asyncio-eventloop.rst:1429 +#: ../../library/asyncio-eventloop.rst:1438 msgid "" "This attribute can be used to set the minimum execution duration in seconds " "that is considered \"slow\". When debug mode is enabled, \"slow\" callbacks " "are logged." msgstr "" -"此屬性可用於設定被視為\"慢\"的最短執行時間(以秒為單位)。啟用偵錯模式" -"後,\"慢\"回呼將被記錄。" +"此屬性可用於設定被視為\"慢\"的最短執行時間(以秒為單位)。啟用偵錯模式後," +"\"慢\"回呼將被記錄。" -#: ../../library/asyncio-eventloop.rst:1433 +#: ../../library/asyncio-eventloop.rst:1442 msgid "Default value is 100 milliseconds." msgstr "預設值為 100 毫秒" -#: ../../library/asyncio-eventloop.rst:1437 +#: ../../library/asyncio-eventloop.rst:1446 msgid "The :ref:`debug mode of asyncio `." msgstr ":ref:`asyncio 的除錯模式 `。" -#: ../../library/asyncio-eventloop.rst:1441 +#: ../../library/asyncio-eventloop.rst:1450 msgid "Running Subprocesses" msgstr "運行子行程" -#: ../../library/asyncio-eventloop.rst:1443 +#: ../../library/asyncio-eventloop.rst:1452 msgid "" "Methods described in this subsections are low-level. In regular async/await " "code consider using the high-level :func:`asyncio.create_subprocess_shell` " "and :func:`asyncio.create_subprocess_exec` convenience functions instead." msgstr "" -"本小節描述的方法是低階的。在常規的 async/await 程式碼中,請考慮使用高階 :" -"func:`asyncio.create_subprocess_shell` 和 :func:`asyncio." -"create_subprocess_exec` 輔助功能而不是。" +"本小節描述的方法是低階的。在常規的 async/await 程式碼中,請考慮使用高" +"階 :func:`asyncio.create_subprocess_shell` " +"和 :func:`asyncio.create_subprocess_exec` 輔助功能而不是。" -#: ../../library/asyncio-eventloop.rst:1450 +#: ../../library/asyncio-eventloop.rst:1459 msgid "" "On Windows, the default event loop :class:`ProactorEventLoop` supports " -"subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" -"`Subprocess Support on Windows ` for details." +"subprocesses, whereas :class:`SelectorEventLoop` does not. " +"See :ref:`Subprocess Support on Windows ` for " +"details." msgstr "" -"在 Windows 上,預設事件迴圈 :class:`ProactorEventLoop` 支援子行程,而 :class:" -"`SelectorEventLoop` 不支援。詳細資訊請參見 :ref:`Windows 上對於子行程的支援 " -"`。" +"在 Windows 上,預設事件迴圈 :class:`ProactorEventLoop` 支援子行程," +"而 :class:`SelectorEventLoop` 不支援。詳細資訊請參見 :ref:`Windows 上對於子行" +"程的支援 `。" -#: ../../library/asyncio-eventloop.rst:1461 +#: ../../library/asyncio-eventloop.rst:1470 msgid "" "Create a subprocess from one or more string arguments specified by *args*." msgstr "從 *args* 指定的一個或多個字串引數建立子行程。" -#: ../../library/asyncio-eventloop.rst:1464 +#: ../../library/asyncio-eventloop.rst:1473 msgid "*args* must be a list of strings represented by:" msgstr "*args* 必須是由以下項表示的字串串列:" -#: ../../library/asyncio-eventloop.rst:1466 +#: ../../library/asyncio-eventloop.rst:1475 msgid ":class:`str`;" msgstr ":class:`str`;" -#: ../../library/asyncio-eventloop.rst:1467 +#: ../../library/asyncio-eventloop.rst:1476 msgid "" "or :class:`bytes`, encoded to the :ref:`filesystem encoding `." msgstr "或 :class:`bytes`,編碼為 :ref:`檔案系統編碼 `。" -#: ../../library/asyncio-eventloop.rst:1470 +#: ../../library/asyncio-eventloop.rst:1479 msgid "" "The first string specifies the program executable, and the remaining strings " "specify the arguments. Together, string arguments form the ``argv`` of the " @@ -2209,7 +2242,7 @@ msgstr "" "第一個字串指定程序可執行檔案,其餘字串指定引數。字串引數一起組成程序的 " "``argv``。" -#: ../../library/asyncio-eventloop.rst:1474 +#: ../../library/asyncio-eventloop.rst:1483 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=False`` and the list of strings passed as the first " @@ -2220,75 +2253,75 @@ msgstr "" "字串串列作為第一個引數傳遞;然而,:class:`~subprocess.Popen` 接受單個字串串列" "引數,*subprocess_exec* 接受多個字串引數。" -#: ../../library/asyncio-eventloop.rst:1480 +#: ../../library/asyncio-eventloop.rst:1489 msgid "" -"The *protocol_factory* must be a callable returning a subclass of the :class:" -"`asyncio.SubprocessProtocol` class." +"The *protocol_factory* must be a callable returning a subclass of " +"the :class:`asyncio.SubprocessProtocol` class." msgstr "" "*protocol_factory* 必須是回傳 :class:`asyncio.SubprocessProtocol` 子類別的可" "呼叫物件。" -#: ../../library/asyncio-eventloop.rst:1483 +#: ../../library/asyncio-eventloop.rst:1492 msgid "Other parameters:" msgstr "其他參數:" -#: ../../library/asyncio-eventloop.rst:1485 +#: ../../library/asyncio-eventloop.rst:1494 msgid "*stdin* can be any of these:" msgstr "*stdin* 可以是以下任意一個:" -#: ../../library/asyncio-eventloop.rst:1487 -#: ../../library/asyncio-eventloop.rst:1498 -#: ../../library/asyncio-eventloop.rst:1508 +#: ../../library/asyncio-eventloop.rst:1496 +#: ../../library/asyncio-eventloop.rst:1507 +#: ../../library/asyncio-eventloop.rst:1517 msgid "a file-like object" msgstr "類檔案物件" -#: ../../library/asyncio-eventloop.rst:1488 +#: ../../library/asyncio-eventloop.rst:1497 msgid "" "an existing file descriptor (a positive integer), for example those created " "with :meth:`os.pipe`" msgstr "現有的檔案描述器(正整數),例如用 :meth:`os.pipe` 建立的" -#: ../../library/asyncio-eventloop.rst:1489 -#: ../../library/asyncio-eventloop.rst:1499 -#: ../../library/asyncio-eventloop.rst:1509 +#: ../../library/asyncio-eventloop.rst:1498 +#: ../../library/asyncio-eventloop.rst:1508 +#: ../../library/asyncio-eventloop.rst:1518 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," msgstr ":const:`subprocess.PIPE` 常數(預設),它將建立一個新的管道並連線," -#: ../../library/asyncio-eventloop.rst:1491 -#: ../../library/asyncio-eventloop.rst:1501 -#: ../../library/asyncio-eventloop.rst:1511 +#: ../../library/asyncio-eventloop.rst:1500 +#: ../../library/asyncio-eventloop.rst:1510 +#: ../../library/asyncio-eventloop.rst:1520 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" msgstr "值 ``None`` 將使子行程從此行程繼承檔案描述器" -#: ../../library/asyncio-eventloop.rst:1493 -#: ../../library/asyncio-eventloop.rst:1503 -#: ../../library/asyncio-eventloop.rst:1513 +#: ../../library/asyncio-eventloop.rst:1502 +#: ../../library/asyncio-eventloop.rst:1512 +#: ../../library/asyncio-eventloop.rst:1522 msgid "" -"the :const:`subprocess.DEVNULL` constant which indicates that the special :" -"data:`os.devnull` file will be used" +"the :const:`subprocess.DEVNULL` constant which indicates that the " +"special :data:`os.devnull` file will be used" msgstr "" ":const:`subprocess.DEVNULL` 常數,表示將使用特殊的 :data:`os.devnull` 檔案" -#: ../../library/asyncio-eventloop.rst:1496 +#: ../../library/asyncio-eventloop.rst:1505 msgid "*stdout* can be any of these:" msgstr "*stdout* 可以是以下任意一個:" -#: ../../library/asyncio-eventloop.rst:1506 +#: ../../library/asyncio-eventloop.rst:1515 msgid "*stderr* can be any of these:" msgstr "*stderr* 可以是以下任意一個:" -#: ../../library/asyncio-eventloop.rst:1515 +#: ../../library/asyncio-eventloop.rst:1524 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" msgstr "" ":const:`subprocess.STDOUT` 常數,它將標準錯誤串流連線到行程的標準輸出串流" -#: ../../library/asyncio-eventloop.rst:1518 +#: ../../library/asyncio-eventloop.rst:1527 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " @@ -2298,7 +2331,7 @@ msgstr "" "*bufsize*、*universal_newlines*、*shell*、*text*、*encoding* 和 *errors* 除" "外,這些不應該指定。" -#: ../../library/asyncio-eventloop.rst:1523 +#: ../../library/asyncio-eventloop.rst:1532 msgid "" "The ``asyncio`` subprocess API does not support decoding the streams as " "text. :func:`bytes.decode` can be used to convert the bytes returned from " @@ -2307,43 +2340,43 @@ msgstr "" "``asyncio`` 子行程 API 不支援將串流解碼為文本。可以使用 :func:`bytes.decode` " "將從串流回傳的位元組轉換為文本。" -#: ../../library/asyncio-eventloop.rst:1527 +#: ../../library/asyncio-eventloop.rst:1536 msgid "" "If a file-like object passed as *stdin*, *stdout* or *stderr* represents a " -"pipe, then the other side of this pipe should be registered with :meth:" -"`~loop.connect_write_pipe` or :meth:`~loop.connect_read_pipe` for use with " -"the event loop." +"pipe, then the other side of this pipe should be registered " +"with :meth:`~loop.connect_write_pipe` or :meth:`~loop.connect_read_pipe` for " +"use with the event loop." msgstr "" "如果傳遞給 *stdin*、*stdout* 或 *stderr* 的類檔案物件表示管道,則該管道的另一" -"端應該使用 :meth:`~loop.connect_write_pipe` 或 :meth:`~loop." -"connect_read_pipe` 註冊到事件迴圈中。" +"端應該使用 :meth:`~loop.connect_write_pipe` " +"或 :meth:`~loop.connect_read_pipe` 註冊到事件迴圈中。" -#: ../../library/asyncio-eventloop.rst:1532 +#: ../../library/asyncio-eventloop.rst:1541 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." msgstr "有關其他引數的文件,請參閱 :class:`subprocess.Popen` 類別的建構函式。" -#: ../../library/asyncio-eventloop.rst:1535 +#: ../../library/asyncio-eventloop.rst:1544 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " "object instantiated by the *protocol_factory*." msgstr "" -"回傳 ``(transport, protocol)`` 對,其中 *transport* 符合 :class:`asyncio." -"SubprocessTransport` 基底類別,*protocol* 是由 *protocol_factory* 實例化的物" -"件。" +"回傳 ``(transport, protocol)`` 對,其中 *transport* 符" +"合 :class:`asyncio.SubprocessTransport` 基底類別,*protocol* 是由 " +"*protocol_factory* 實例化的物件。" -#: ../../library/asyncio-eventloop.rst:1543 +#: ../../library/asyncio-eventloop.rst:1552 msgid "" -"Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" -"`bytes` string encoded to the :ref:`filesystem encoding `, using the platform's \"shell\" syntax." msgstr "" "使用平台的 “shell” 語法從 *cmd* 建立子行程,*cmd* 可以是 :class:`str` 或編碼" "為 :ref:`檔案系統編碼 ` 的 :class:`bytes` 字串。" -#: ../../library/asyncio-eventloop.rst:1548 +#: ../../library/asyncio-eventloop.rst:1557 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." @@ -2351,31 +2384,31 @@ msgstr "" "這類似於標準函式庫中的 :class:`subprocess.Popen` 類別,使用 ``shell=True`` 呼" "叫。" -#: ../../library/asyncio-eventloop.rst:1551 +#: ../../library/asyncio-eventloop.rst:1560 msgid "" -"The *protocol_factory* must be a callable returning a subclass of the :class:" -"`SubprocessProtocol` class." +"The *protocol_factory* must be a callable returning a subclass of " +"the :class:`SubprocessProtocol` class." msgstr "" "*protocol_factory* 必須是回傳 :class:`SubprocessProtocol` 子類別的可呼叫物" "件。" -#: ../../library/asyncio-eventloop.rst:1554 +#: ../../library/asyncio-eventloop.rst:1563 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "有關其餘引數的更多詳細資訊,請參閱 :meth:`~loop.subprocess_exec`。" -#: ../../library/asyncio-eventloop.rst:1557 +#: ../../library/asyncio-eventloop.rst:1566 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " "instantiated by the *protocol_factory*." msgstr "" -"回傳一對 ``(transport, protocol)``,其中 *transport* 符合 :class:" -"`SubprocessTransport` 基底類別,而 *protocol* 是由 *protocol_factory* 實例化" -"的物件。" +"回傳一對 ``(transport, protocol)``,其中 *transport* 符" +"合 :class:`SubprocessTransport` 基底類別,而 *protocol* 是由 " +"*protocol_factory* 實例化的物件。" -#: ../../library/asyncio-eventloop.rst:1562 +#: ../../library/asyncio-eventloop.rst:1571 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -2384,76 +2417,77 @@ msgid "" "escape whitespace and special characters in strings that are going to be " "used to construct shell commands." msgstr "" -"由應用程式負責確保適當引用所有空白和特殊字元,以避免 `shell 注入 `_\\ 風險。可以使用 :func:" -"`shlex.quote` 函式來正確跳脫用於構建 shell 命令的字串中的空白和特殊字元。" +"由應用程式負責確保適當引用所有空白和特殊字元,以避免 `shell 注入 `_\\ 風險。可以使" +"用 :func:`shlex.quote` 函式來正確跳脫用於構建 shell 命令的字串中的空白和特殊" +"字元。" -#: ../../library/asyncio-eventloop.rst:1571 +#: ../../library/asyncio-eventloop.rst:1580 msgid "Callback Handles" msgstr "回呼處理" -#: ../../library/asyncio-eventloop.rst:1575 +#: ../../library/asyncio-eventloop.rst:1584 msgid "" -"A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." -"call_soon_threadsafe`." +"A callback wrapper object returned " +"by :meth:`loop.call_soon`, :meth:`loop.call_soon_threadsafe`." msgstr "" "由 :meth:`loop.call_soon` 和 :meth:`loop.call_soon_threadsafe` 回傳的回呼包裝" "器。" -#: ../../library/asyncio-eventloop.rst:1580 +#: ../../library/asyncio-eventloop.rst:1589 msgid "" "Return the :class:`contextvars.Context` object associated with the handle." msgstr "回傳與處理相關聯的 :class:`contextvars.Context` 物件。" -#: ../../library/asyncio-eventloop.rst:1587 +#: ../../library/asyncio-eventloop.rst:1596 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "取消回呼。如果回呼已被取消或執行,此方法將不起作用。" -#: ../../library/asyncio-eventloop.rst:1592 +#: ../../library/asyncio-eventloop.rst:1601 msgid "Return ``True`` if the callback was cancelled." msgstr "如果回呼已被取消,回傳 ``True``。" -#: ../../library/asyncio-eventloop.rst:1598 +#: ../../library/asyncio-eventloop.rst:1607 msgid "" -"A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" -"`loop.call_at`." +"A callback wrapper object returned by :meth:`loop.call_later`, " +"and :meth:`loop.call_at`." msgstr "由 :meth:`loop.call_later` 和 :meth:`loop.call_at` 回傳的回呼包裝器。" -#: ../../library/asyncio-eventloop.rst:1601 +#: ../../library/asyncio-eventloop.rst:1610 msgid "This class is a subclass of :class:`Handle`." msgstr "這個類別是 :class:`Handle` 的子類別。" -#: ../../library/asyncio-eventloop.rst:1605 +#: ../../library/asyncio-eventloop.rst:1614 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "回傳預定的回呼時間,以 :class:`float` 秒為單位。" -#: ../../library/asyncio-eventloop.rst:1607 +#: ../../library/asyncio-eventloop.rst:1616 msgid "" -"The time is an absolute timestamp, using the same time reference as :meth:" -"`loop.time`." +"The time is an absolute timestamp, using the same time reference " +"as :meth:`loop.time`." msgstr "時間是一個絕對的時間戳,使用與 :meth:`loop.time` 相同的時間參照。" -#: ../../library/asyncio-eventloop.rst:1614 +#: ../../library/asyncio-eventloop.rst:1623 msgid "Server Objects" msgstr "Server 物件" -#: ../../library/asyncio-eventloop.rst:1616 +#: ../../library/asyncio-eventloop.rst:1625 msgid "" -"Server objects are created by :meth:`loop.create_server`, :meth:`loop." -"create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " -"functions." +"Server objects are created " +"by :meth:`loop.create_server`, :meth:`loop.create_unix_server`, :func:`start_server`, " +"and :func:`start_unix_server` functions." msgstr "" -"Server 物件是由 :meth:`loop.create_server`、:meth:`loop." -"create_unix_server`、:func:`start_server` 和 :func:`start_unix_server` 函式所" -"建立。" +"Server 物件是" +"由 :meth:`loop.create_server`、:meth:`loop.create_unix_server`、:func:`start_server` " +"和 :func:`start_unix_server` 函式所建立。" -#: ../../library/asyncio-eventloop.rst:1620 +#: ../../library/asyncio-eventloop.rst:1629 msgid "Do not instantiate the :class:`Server` class directly." msgstr "請勿直接實例化 :class:`Server` 類別。" -#: ../../library/asyncio-eventloop.rst:1624 +#: ../../library/asyncio-eventloop.rst:1633 msgid "" "*Server* objects are asynchronous context managers. When used in an ``async " "with`` statement, it's guaranteed that the Server object is closed and not " @@ -2462,7 +2496,7 @@ msgstr "" "*Server* 物件是非同步情境管理器。當在 ``async with`` 陳述中使用時,可以保證在" "完成 ``async with`` 陳述時,Server 物件將會關閉並停止接受新的連線: ::" -#: ../../library/asyncio-eventloop.rst:1629 +#: ../../library/asyncio-eventloop.rst:1638 msgid "" "srv = await loop.create_server(...)\n" "\n" @@ -2471,31 +2505,37 @@ msgid "" "\n" "# At this point, srv is closed and no longer accepts new connections." msgstr "" +"srv = await loop.create_server(...)\n" +"\n" +"async with srv:\n" +" # 一些程式碼\n" +"\n" +"# 此時 srv 已關閉,不再接受新的連線。" -#: ../../library/asyncio-eventloop.rst:1637 +#: ../../library/asyncio-eventloop.rst:1646 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "自 Python 3.7 起,Server 物件是非同步情境管理器。" -#: ../../library/asyncio-eventloop.rst:1640 +#: ../../library/asyncio-eventloop.rst:1649 msgid "" "This class was exposed publicly as ``asyncio.Server`` in Python 3.9.11, " "3.10.3 and 3.11." msgstr "" "此類別在 Python 3.9.11、3.10.3 和 3.11 中以 ``asyncio.Server`` 的形式被公開。" -#: ../../library/asyncio-eventloop.rst:1645 +#: ../../library/asyncio-eventloop.rst:1654 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "停止服務:關閉監聽的 sockets 並將 :attr:`sockets` 屬性設為 ``None``。" -#: ../../library/asyncio-eventloop.rst:1648 +#: ../../library/asyncio-eventloop.rst:1657 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "代表現有傳入用戶端連線的 sockets 仍然保持開啟。" -#: ../../library/asyncio-eventloop.rst:1651 +#: ../../library/asyncio-eventloop.rst:1660 msgid "" "The server is closed asynchronously; use the :meth:`wait_closed` coroutine " "to wait until the server is closed (and no more connections are active)." @@ -2503,53 +2543,53 @@ msgstr "" "伺服器以非同步方式關閉;使用 :meth:`wait_close` 協程等待伺服器關閉(不再有活" "躍連線)。" -#: ../../library/asyncio-eventloop.rst:1657 +#: ../../library/asyncio-eventloop.rst:1666 msgid "Close all existing incoming client connections." msgstr "關閉所有現有的傳入客戶端連線。" -#: ../../library/asyncio-eventloop.rst:1659 +#: ../../library/asyncio-eventloop.rst:1668 msgid "" "Calls :meth:`~asyncio.BaseTransport.close` on all associated transports." -msgstr "" +msgstr "在所有關聯的傳輸上呼叫 :meth:`~asyncio.BaseTransport.close`。" -#: ../../library/asyncio-eventloop.rst:1662 +#: ../../library/asyncio-eventloop.rst:1671 msgid "" ":meth:`close` should be called before :meth:`close_clients` when closing the " "server to avoid races with new clients connecting." msgstr "" -#: ../../library/asyncio-eventloop.rst:1669 +#: ../../library/asyncio-eventloop.rst:1678 msgid "" "Close all existing incoming client connections immediately, without waiting " "for pending operations to complete." -msgstr "" +msgstr "立即關閉所有現有的傳入客戶端連線,而不等待待定操作完成。" -#: ../../library/asyncio-eventloop.rst:1672 +#: ../../library/asyncio-eventloop.rst:1681 msgid "" "Calls :meth:`~asyncio.WriteTransport.abort` on all associated transports." -msgstr "" +msgstr "在所有關聯的傳輸上呼叫 :meth:`~asyncio.BaseTransport.close`。" -#: ../../library/asyncio-eventloop.rst:1675 +#: ../../library/asyncio-eventloop.rst:1684 msgid "" ":meth:`close` should be called before :meth:`abort_clients` when closing the " "server to avoid races with new clients connecting." msgstr "" -#: ../../library/asyncio-eventloop.rst:1682 +#: ../../library/asyncio-eventloop.rst:1691 msgid "Return the event loop associated with the server object." msgstr "回傳與伺服器物件關聯的事件迴圈。" -#: ../../library/asyncio-eventloop.rst:1688 +#: ../../library/asyncio-eventloop.rst:1697 msgid "Start accepting connections." msgstr "開始接受連線。" -#: ../../library/asyncio-eventloop.rst:1690 +#: ../../library/asyncio-eventloop.rst:1699 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "此方法是幂等的,因此可以在伺服器已經運行時呼叫。" -#: ../../library/asyncio-eventloop.rst:1693 +#: ../../library/asyncio-eventloop.rst:1702 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -2557,19 +2597,19 @@ msgid "" "or :meth:`Server.serve_forever` can be used to make the Server start " "accepting connections." msgstr "" -"*start_serving* 僅限關鍵字參數只能在 :meth:`loop.create_server` 和 :meth:" -"`asyncio.start_server` 中使用,允許建立一個最初不接受連線的 Server 物件。在這" -"種情況下,可以使用 ``Server.start_serving()`` 或 :meth:`Server." -"serve_forever` 來使 Server 開始接受連線。" +"*start_serving* 僅限關鍵字參數只能在 :meth:`loop.create_server` " +"和 :meth:`asyncio.start_server` 中使用,允許建立一個最初不接受連線的 Server " +"物件。在這種情況下,可以使用 ``Server.start_serving()`` " +"或 :meth:`Server.serve_forever` 來使 Server 開始接受連線。" -#: ../../library/asyncio-eventloop.rst:1704 +#: ../../library/asyncio-eventloop.rst:1713 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" "開始接受連線,直到協程被取消。取消 ``serve_forever`` 任務會導致伺服器關閉。" -#: ../../library/asyncio-eventloop.rst:1708 +#: ../../library/asyncio-eventloop.rst:1717 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." @@ -2577,7 +2617,7 @@ msgstr "" "如果伺服器已經接受連線,則可以呼叫此方法。每個 *Server* 物件只能存在一個 " "``serve_forever`` 任務。" -#: ../../library/asyncio-eventloop.rst:1714 +#: ../../library/asyncio-eventloop.rst:1723 msgid "" "async def client_connected(reader, writer):\n" " # Communicate with the client with\n" @@ -2591,25 +2631,36 @@ msgid "" "\n" "asyncio.run(main('127.0.0.1', 0))" msgstr "" +"async def client_connected(reader, writer):\n" +" # 透過讀取器/寫入器串流\n" +" # 與客戶端溝通。例如:\n" +" await reader.readline()\n" +"\n" +"async def main(host, port):\n" +" srv = await asyncio.start_server(\n" +" client_connected, host, port)\n" +" await srv.serve_forever()\n" +"\n" +"asyncio.run(main('127.0.0.1', 0))" -#: ../../library/asyncio-eventloop.rst:1730 +#: ../../library/asyncio-eventloop.rst:1739 msgid "Return ``True`` if the server is accepting new connections." msgstr "如果伺服器正在接受新連線,則回傳 ``True``。" -#: ../../library/asyncio-eventloop.rst:1736 +#: ../../library/asyncio-eventloop.rst:1745 msgid "" "Wait until the :meth:`close` method completes and all active connections " "have finished." msgstr "等待 :meth:`close` 方法完成且所有活動連線都已結束。" -#: ../../library/asyncio-eventloop.rst:1741 +#: ../../library/asyncio-eventloop.rst:1750 msgid "" "List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the " "server is listening on." msgstr "" "伺服器正在監聽的類似 socket 的物件串列,``asyncio.trsock.TransportSocket``。" -#: ../../library/asyncio-eventloop.rst:1744 +#: ../../library/asyncio-eventloop.rst:1753 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." @@ -2617,29 +2668,29 @@ msgstr "" "在 Python 3.7 之前,``Server.sockets`` 曾經直接回傳內部伺服器 sockets 的串" "列。在 3.7 中回傳了該串列的副本。" -#: ../../library/asyncio-eventloop.rst:1754 +#: ../../library/asyncio-eventloop.rst:1763 msgid "Event Loop Implementations" msgstr "事件迴圈實作" -#: ../../library/asyncio-eventloop.rst:1756 +#: ../../library/asyncio-eventloop.rst:1765 msgid "" -"asyncio ships with two different event loop implementations: :class:" -"`SelectorEventLoop` and :class:`ProactorEventLoop`." +"asyncio ships with two different event loop " +"implementations: :class:`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -"asyncio 內附兩個不同的事件迴圈實作::class:`SelectorEventLoop` 和 :class:" -"`ProactorEventLoop`。" +"asyncio 內附兩個不同的事件迴圈實作::class:`SelectorEventLoop` " +"和 :class:`ProactorEventLoop`。" -#: ../../library/asyncio-eventloop.rst:1759 +#: ../../library/asyncio-eventloop.rst:1768 msgid "By default asyncio is configured to use :class:`EventLoop`." msgstr "預設情況下,asyncio 被配置為要使用 :class:`EventLoop`。" -#: ../../library/asyncio-eventloop.rst:1764 +#: ../../library/asyncio-eventloop.rst:1773 msgid "" "A subclass of :class:`AbstractEventLoop` based on the :mod:`selectors` " "module." msgstr "基於 :mod:`selectors` 模組的一個 :class:`AbstractEventLoop` 子類別。" -#: ../../library/asyncio-eventloop.rst:1767 +#: ../../library/asyncio-eventloop.rst:1776 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " @@ -2648,7 +2699,7 @@ msgstr "" "使用特定平台上最有效的 *selector*。也可以手動配置要使用的確切 selector 實" "作: ::" -#: ../../library/asyncio-eventloop.rst:1771 +#: ../../library/asyncio-eventloop.rst:1780 msgid "" "import asyncio\n" "import selectors\n" @@ -2670,7 +2721,7 @@ msgstr "" "\n" "asyncio.set_event_loop_policy(MyPolicy())" -#: ../../library/asyncio-eventloop.rst:1787 +#: ../../library/asyncio-eventloop.rst:1796 msgid "" "A subclass of :class:`AbstractEventLoop` for Windows that uses \"I/O " "Completion Ports\" (IOCP)." @@ -2678,7 +2729,7 @@ msgstr "" "用於 Windows 的 :class:`AbstractEventLoop` 子類別,使用「I/O 完成埠 (IOCP, I/" "O Completion Ports)」。" -#: ../../library/asyncio-eventloop.rst:1793 +#: ../../library/asyncio-eventloop.rst:1802 msgid "" "`MSDN documentation on I/O Completion Ports `_." @@ -2686,25 +2737,25 @@ msgstr "" "`I/O 完成埠的 MSDN 文件 `_。" -#: ../../library/asyncio-eventloop.rst:1798 +#: ../../library/asyncio-eventloop.rst:1807 msgid "" -"An alias to the most efficient available subclass of :class:" -"`AbstractEventLoop` for the given platform." +"An alias to the most efficient available subclass " +"of :class:`AbstractEventLoop` for the given platform." msgstr "" -#: ../../library/asyncio-eventloop.rst:1801 +#: ../../library/asyncio-eventloop.rst:1810 msgid "" -"It is an alias to :class:`SelectorEventLoop` on Unix and :class:" -"`ProactorEventLoop` on Windows." +"It is an alias to :class:`SelectorEventLoop` on Unix " +"and :class:`ProactorEventLoop` on Windows." msgstr "" -"在 Unix 上是 :class:`SelectorEventLoop` 的別名,在 Windows 上是 :class:" -"`ProactorEventLoop` 的別名。" +"在 Unix 上是 :class:`SelectorEventLoop` 的別名,在 Windows 上" +"是 :class:`ProactorEventLoop` 的別名。" -#: ../../library/asyncio-eventloop.rst:1807 +#: ../../library/asyncio-eventloop.rst:1816 msgid "Abstract base class for asyncio-compliant event loops." msgstr "為符合 asyncio 標準的事件迴圈的抽象基礎類別。" -#: ../../library/asyncio-eventloop.rst:1809 +#: ../../library/asyncio-eventloop.rst:1818 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." @@ -2712,26 +2763,27 @@ msgstr "" ":ref:`asyncio-event-loop-methods` 部分列出了替代 ``AbstractEventLoop`` 實作應" "該定義的所有方法。" -#: ../../library/asyncio-eventloop.rst:1815 +#: ../../library/asyncio-eventloop.rst:1824 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1817 +#: ../../library/asyncio-eventloop.rst:1826 msgid "" "Note that all examples in this section **purposefully** show how to use the " -"low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." -"call_soon`. Modern asyncio applications rarely need to be written this way; " -"consider using the high-level functions like :func:`asyncio.run`." +"low-level event loop APIs, such as :meth:`loop.run_forever` " +"and :meth:`loop.call_soon`. Modern asyncio applications rarely need to be " +"written this way; consider using the high-level functions " +"like :func:`asyncio.run`." msgstr "" -"請注意,本節中的所有範例都 **故意** 展示如何使用低階事件迴圈 API,如 :meth:" -"`loop.run_forever` 和 :meth:`loop.call_soon`。現代 asyncio 應用程式很少需要這" -"種方式撰寫;請考慮使用高階的函式,如 :func:`asyncio.run`。" +"請注意,本節中的所有範例都 **故意** 展示如何使用低階事件迴圈 API," +"如 :meth:`loop.run_forever` 和 :meth:`loop.call_soon`。現代 asyncio 應用程式" +"很少需要這種方式撰寫;請考慮使用高階的函式,如 :func:`asyncio.run`。" -#: ../../library/asyncio-eventloop.rst:1827 +#: ../../library/asyncio-eventloop.rst:1836 msgid "Hello World with call_soon()" msgstr "使用 call_soon() 的 Hello World 範例" -#: ../../library/asyncio-eventloop.rst:1829 +#: ../../library/asyncio-eventloop.rst:1838 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" @@ -2739,7 +2791,7 @@ msgstr "" "使用 :meth:`loop.call_soon` 方法排程回呼的範例。回呼會顯示 ``\"Hello " "World\"``,然後停止事件迴圈: ::" -#: ../../library/asyncio-eventloop.rst:1833 +#: ../../library/asyncio-eventloop.rst:1842 msgid "" "import asyncio\n" "\n" @@ -2759,19 +2811,36 @@ msgid "" "finally:\n" " loop.close()" msgstr "" +"import asyncio\n" +"\n" +"def hello_world(loop):\n" +" \"\"\"列印 'Hello World' 並停止事件迴圈的回呼\"\"\"\n" +" print('Hello World')\n" +" loop.stop()\n" +"\n" +"loop = asyncio.new_event_loop()\n" +"\n" +"# 排程對 hello_world() 的呼叫\n" +"loop.call_soon(hello_world, loop)\n" +"\n" +"# 阻塞呼叫被 loop.stop() 中斷\n" +"try:\n" +" loop.run_forever()\n" +"finally:\n" +" loop.close()" -#: ../../library/asyncio-eventloop.rst:1853 +#: ../../library/asyncio-eventloop.rst:1862 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" "使用協程和 :func:`run` 函式建立的類似 :ref:`Hello World ` 範例。" -#: ../../library/asyncio-eventloop.rst:1860 +#: ../../library/asyncio-eventloop.rst:1869 msgid "Display the current date with call_later()" msgstr "使用 call_later() 顯示目前日期" -#: ../../library/asyncio-eventloop.rst:1862 +#: ../../library/asyncio-eventloop.rst:1871 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " @@ -2780,7 +2849,7 @@ msgstr "" "一個回呼的範例,每秒顯示目前日期。回呼使用 :meth:`loop.call_later` 方法在 5 " "秒後重新排程自己,然後停止事件迴圈: ::" -#: ../../library/asyncio-eventloop.rst:1866 +#: ../../library/asyncio-eventloop.rst:1875 msgid "" "import asyncio\n" "import datetime\n" @@ -2804,8 +2873,29 @@ msgid "" "finally:\n" " loop.close()" msgstr "" +"import asyncio\n" +"import datetime\n" +"\n" +"def display_date(end_time, loop):\n" +" print(datetime.datetime.now())\n" +" if (loop.time() + 1.0) < end_time:\n" +" loop.call_later(1, display_date, end_time, loop)\n" +" else:\n" +" loop.stop()\n" +"\n" +"loop = asyncio.new_event_loop()\n" +"\n" +"# 排程 display_date() 的第一次呼叫\n" +"end_time = loop.time() + 5.0\n" +"loop.call_soon(display_date, end_time, loop)\n" +"\n" +"# 阻塞呼叫被 loop.stop() 中斷\n" +"try:\n" +" loop.run_forever()\n" +"finally:\n" +" loop.close()" -#: ../../library/asyncio-eventloop.rst:1890 +#: ../../library/asyncio-eventloop.rst:1899 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." @@ -2813,19 +2903,19 @@ msgstr "" "使用協程和 :func:`run` 函式建立的類似 :ref:`current date " "` 範例。" -#: ../../library/asyncio-eventloop.rst:1897 +#: ../../library/asyncio-eventloop.rst:1906 msgid "Watch a file descriptor for read events" msgstr "監聽檔案描述器以進行讀取事件" -#: ../../library/asyncio-eventloop.rst:1899 +#: ../../library/asyncio-eventloop.rst:1908 msgid "" -"Wait until a file descriptor received some data using the :meth:`loop." -"add_reader` method and then close the event loop::" +"Wait until a file descriptor received some data using " +"the :meth:`loop.add_reader` method and then close the event loop::" msgstr "" "使用 :meth:`loop.add_reader` 方法等待檔案描述器接收到某些資料,然後關閉事件迴" "圈: ::" -#: ../../library/asyncio-eventloop.rst:1902 +#: ../../library/asyncio-eventloop.rst:1911 msgid "" "import asyncio\n" "from socket import socketpair\n" @@ -2860,8 +2950,40 @@ msgid "" " wsock.close()\n" " loop.close()" msgstr "" +"import asyncio\n" +"from socket import socketpair\n" +"\n" +"# 建立一對連接的檔案描述器\n" +"rsock, wsock = socketpair()\n" +"\n" +"loop = asyncio.new_event_loop()\n" +"\n" +"def reader():\n" +" data = rsock.recv(100)\n" +" print(\"Received:\", data.decode())\n" +"\n" +" # 我們完成了:註銷檔案描述器\n" +" loop.remove_reader(rsock)\n" +"\n" +" # 停止事件迴圈\n" +" loop.stop()\n" +"\n" +"# 為讀取事件註冊檔案描述器\n" +"loop.add_reader(rsock, reader)\n" +"\n" +"# 模擬從網路接收資料\n" +"loop.call_soon(wsock.send, 'abc'.encode())\n" +"\n" +"try:\n" +" # 運行事件迴圈\n" +" loop.run_forever()\n" +"finally:\n" +" # 我們完成了。關閉 socket 和事件迴圈。\n" +" rsock.close()\n" +" wsock.close()\n" +" loop.close()" -#: ../../library/asyncio-eventloop.rst:1937 +#: ../../library/asyncio-eventloop.rst:1946 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." @@ -2869,7 +2991,7 @@ msgstr "" "使用傳輸、協定和 :meth:`loop.create_connection` 方法的類似 :ref:`範例 " "`。" -#: ../../library/asyncio-eventloop.rst:1941 +#: ../../library/asyncio-eventloop.rst:1950 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." @@ -2877,23 +2999,24 @@ msgstr "" "另一個使用高階 :func:`asyncio.open_connection` 函式和串流的類似 :ref:`範例 " "`。" -#: ../../library/asyncio-eventloop.rst:1949 +#: ../../library/asyncio-eventloop.rst:1958 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "設定 SIGINT 和 SIGTERM 的訊號處理程式" -#: ../../library/asyncio-eventloop.rst:1951 +#: ../../library/asyncio-eventloop.rst:1960 msgid "(This ``signals`` example only works on Unix.)" msgstr "(此 ``signals`` 範例僅在 Unix 上運作。)" -#: ../../library/asyncio-eventloop.rst:1953 +#: ../../library/asyncio-eventloop.rst:1962 msgid "" -"Register handlers for signals :const:`~signal.SIGINT` and :const:`~signal." -"SIGTERM` using the :meth:`loop.add_signal_handler` method::" +"Register handlers for signals :const:`~signal.SIGINT` " +"and :const:`~signal.SIGTERM` using the :meth:`loop.add_signal_handler` " +"method::" msgstr "" -"使用 :meth:`loop.add_signal_handler` 方法註冊訊號 :py:data:`SIGINT` 和 :py:" -"data:`SIGTERM` 的處理程式: ::" +"使用 :meth:`loop.add_signal_handler` 方法註冊訊號 :py:data:`SIGINT` " +"和 :py:data:`SIGTERM` 的處理程式: ::" -#: ../../library/asyncio-eventloop.rst:1956 +#: ../../library/asyncio-eventloop.rst:1965 msgid "" "import asyncio\n" "import functools\n" @@ -2919,3 +3042,26 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"import functools\n" +"import os\n" +"import signal\n" +"\n" +"def ask_exit(signame, loop):\n" +" print(\"got signal %s: exit\" % signame)\n" +" loop.stop()\n" +"\n" +"async def main():\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" for signame in {'SIGINT', 'SIGTERM'}:\n" +" loop.add_signal_handler(\n" +" getattr(signal, signame),\n" +" functools.partial(ask_exit, signame, loop))\n" +"\n" +" await asyncio.sleep(3600)\n" +"\n" +"print(\"Event loop running for 1 hour, press Ctrl+C to interrupt.\")\n" +"print(f\"pid {os.getpid()}: send SIGINT or SIGTERM to exit.\")\n" +"\n" +"asyncio.run(main())" diff --git a/library/asyncio-queue.po b/library/asyncio-queue.po index 088dea0967..effaeebec4 100644 --- a/library/asyncio-queue.po +++ b/library/asyncio-queue.po @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-01-10 00:14+0000\n" "PO-Revision-Date: 2022-02-20 18:34+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -39,8 +39,8 @@ msgstr "" #: ../../library/asyncio-queue.rst:17 msgid "" -"Note that methods of asyncio queues don't have a *timeout* parameter; use :" -"func:`asyncio.wait_for` function to do queue operations with a timeout." +"Note that methods of asyncio queues don't have a *timeout* parameter; " +"use :func:`asyncio.wait_for` function to do queue operations with a timeout." msgstr "" "注意 asyncio 的佇列沒有 *timeout* 參數;請使用 :func:`asyncio.wait_for` 函式" "來為佇列新增具有超時 (timeout) 設定的操作。" @@ -63,16 +63,16 @@ msgid "" "it is an integer greater than ``0``, then ``await put()`` blocks when the " "queue reaches *maxsize* until an item is removed by :meth:`get`." msgstr "" -"如果 *maxsize* 小於或等於零,則佇列尺寸是無限制的。如果是大於 ``0`` 的整數," -"則當佇列達到 *maxsize* 時,``await put()`` 將會阻塞 (block),直到某個元素被 :" -"meth:`get` 取出。" +"如果 *maxsize* 小於或等於零,則佇列大小是無限制的。如果是大於 ``0`` 的整數," +"則當佇列達到 *maxsize* 時,``await put()`` 將會阻塞 (block),直到某個元素" +"被 :meth:`get` 取出。" #: ../../library/asyncio-queue.rst:35 msgid "" "Unlike the standard library threading :mod:`queue`, the size of the queue is " "always known and can be returned by calling the :meth:`qsize` method." msgstr "" -"不像標準函式庫中執行緒類型的 :mod:`queue`,佇列的尺寸一直是已知的,可以透過呼" +"不像標準函式庫中執行緒類型的 :mod:`queue`,佇列的大小一直是已知的,可以透過呼" "叫 :meth:`qsize` 方法回傳。" #: ../../library/asyncio-queue.rst:39 @@ -97,8 +97,8 @@ msgstr "如果有 :attr:`maxsize` 個條目在佇列中,則回傳 ``True``。" #: ../../library/asyncio-queue.rst:57 msgid "" -"If the queue was initialized with ``maxsize=0`` (the default), then :meth:" -"`full` never returns ``True``." +"If the queue was initialized with ``maxsize=0`` (the default), " +"then :meth:`full` never returns ``True``." msgstr "" "如果佇列用 ``maxsize=0`` (預設)初始化,則 :meth:`full` 永遠不會回傳 " "``True``。" @@ -127,10 +127,10 @@ msgstr "持續阻塞直到佇列中所有的元素都被接收和處理完畢。 #: ../../library/asyncio-queue.rst:77 msgid "" "The count of unfinished tasks goes up whenever an item is added to the " -"queue. The count goes down whenever a consumer coroutine calls :meth:" -"`task_done` to indicate that the item was retrieved and all work on it is " -"complete. When the count of unfinished tasks drops to zero, :meth:`join` " -"unblocks." +"queue. The count goes down whenever a consumer coroutine " +"calls :meth:`task_done` to indicate that the item was retrieved and all work " +"on it is complete. When the count of unfinished tasks drops to " +"zero, :meth:`join` unblocks." msgstr "" "當條目新增到佇列的時候,未完成任務的計數就會增加。每當一個消耗者 (consumer) " "協程呼叫 :meth:`task_done`,表示這個條目已經被取回且被它包含的所有工作都已完" @@ -147,7 +147,7 @@ msgstr "" #: ../../library/asyncio-queue.rst:88 msgid "Raises :exc:`QueueShutDown` if the queue has been shut down." -msgstr "" +msgstr "如果佇列已經被關閉,則引發 :exc:`QueueShutDown`。" #: ../../library/asyncio-queue.rst:92 msgid "Put an item into the queue without blocking." @@ -163,8 +163,8 @@ msgstr "回傳佇列中的元素數量。" #: ../../library/asyncio-queue.rst:102 msgid "" -"Shut down the queue, making :meth:`~Queue.get` and :meth:`~Queue.put` raise :" -"exc:`QueueShutDown`." +"Shut down the queue, making :meth:`~Queue.get` and :meth:`~Queue.put` " +"raise :exc:`QueueShutDown`." msgstr "" #: ../../library/asyncio-queue.rst:105 @@ -178,22 +178,22 @@ msgstr "" msgid "" "All blocked callers of :meth:`~Queue.put` and :meth:`~Queue.get` will be " "unblocked. If *immediate* is true, a task will be marked as done for each " -"remaining item in the queue, which may unblock callers of :meth:`~Queue." -"join`." +"remaining item in the queue, which may unblock callers " +"of :meth:`~Queue.join`." msgstr "" #: ../../library/asyncio-queue.rst:118 -msgid "Indicate that a formerly enqueued task is complete." -msgstr "表示前面一個排隊的任務已經完成。" +msgid "Indicate that a formerly enqueued work item is complete." +msgstr "表示前面一個排隊的工作項目已經完成。" #: ../../library/asyncio-queue.rst:120 msgid "" -"Used by queue consumers. For each :meth:`~Queue.get` used to fetch a task, a " -"subsequent call to :meth:`task_done` tells the queue that the processing on " -"the task is complete." +"Used by queue consumers. For each :meth:`~Queue.get` used to fetch a work " +"item, a subsequent call to :meth:`task_done` tells the queue that the " +"processing on the work item is complete." msgstr "" -"由佇列消耗者使用。對於每個用於獲取一個任務的 :meth:`~Queue.get`,接續的 :" -"meth:`task_done` 呼叫會告訴佇列這個任務的處理已經完成。" +"由佇列消耗者使用。對於每個用於獲取一個工作項目的 :meth:`~Queue.get`,接續" +"的 :meth:`task_done` 呼叫會告訴佇列這個工作項目的處理已經完成。" #: ../../library/asyncio-queue.rst:124 msgid "" @@ -202,7 +202,7 @@ msgid "" "item that had been :meth:`~Queue.put` into the queue)." msgstr "" "如果 :meth:`join` 當前正在阻塞,在所有項目都被處理後會解除阻塞(意味著每個" -"以 :meth:`~Queue.put` 放進佇列的條目都會收到一個 :meth:`task_done`\\ )。" +"以 :meth:`~Queue.put` 放進佇列的條目都會收到一個 :meth:`task_done`)。" #: ../../library/asyncio-queue.rst:129 msgid "" @@ -259,13 +259,10 @@ msgstr "" "法會引發這個例外。" #: ../../library/asyncio-queue.rst:174 -#, fuzzy msgid "" "Exception raised when :meth:`~Queue.put` or :meth:`~Queue.get` is called on " "a queue which has been shut down." msgstr "" -"當佇列中條目數量已經達到它的 *maxsize* 時,呼叫 :meth:`~Queue.put_nowait` 方" -"法會引發這個例外。" #: ../../library/asyncio-queue.rst:181 msgid "Examples" diff --git a/library/calendar.po b/library/calendar.po index 564f71a8d6..02ae510536 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-26 00:13+0000\n" +"POT-Creation-Date: 2025-01-08 00:13+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -38,8 +38,8 @@ msgstr "" "這個模組讓你可以像 Unix 的 :program:`cal` 程式一樣輸出日曆,並額外提供有用的" "日曆相關函式。這些日曆預設把週一當作一週的第一天,而週日當作最後一天(歐洲的" "慣例)。可以使用 :func:`setfirstweekday` 設定一週的第一天為週日 (6) 或一週的" -"其它任一天,其中指定日期的參數是整數。相關功能參考 :mod:`datetime` 和 :mod:" -"`time` 模組。" +"其它任一天,其中指定日期的參數是整數。相關功能參考 :mod:`datetime` " +"和 :mod:`time` 模組。" #: ../../library/calendar.rst:22 msgid "" @@ -60,11 +60,11 @@ msgstr "" #: ../../library/calendar.rst:33 msgid "" "Creates a :class:`Calendar` object. *firstweekday* is an integer specifying " -"the first day of the week. :const:`MONDAY` is ``0`` (the default), :const:" -"`SUNDAY` is ``6``." +"the first day of the week. :const:`MONDAY` is ``0`` (the " +"default), :const:`SUNDAY` is ``6``." msgstr "" -"建立 :class:`Calendar` 物件。*firstweekday* 是一個指定一週第一天的整數,:" -"const:`MONDAY` 是 ``0``\\ (預設值),:const:`SUNDAY` 是 ``6``。" +"建立 :class:`Calendar` 物件。*firstweekday* 是一個指定一週第一天的整" +"數,:const:`MONDAY` 是 ``0``\\ (預設值),:const:`SUNDAY` 是 ``6``。" #: ../../library/calendar.rst:36 msgid "" @@ -76,19 +76,47 @@ msgstr "" "做任何格式化,這是子類別的工作。" #: ../../library/calendar.rst:41 -msgid ":class:`Calendar` instances have the following methods:" -msgstr ":class:`Calendar` 實例有以下方法:" +msgid ":class:`Calendar` instances have the following methods and attributes:" +msgstr ":class:`Calendar` 實例有以下方法與屬性:" #: ../../library/calendar.rst:45 +msgid "The first weekday as an integer (0--6)." +msgstr "" + +#: ../../library/calendar.rst:47 +msgid "" +"This property can also be set and read " +"using :meth:`~Calendar.setfirstweekday` " +"and :meth:`~Calendar.getfirstweekday` respectively." +msgstr "" + +#: ../../library/calendar.rst:53 +msgid "Return an :class:`int` for the current first weekday (0--6)." +msgstr "" + +#: ../../library/calendar.rst:55 +msgid "Identical to reading the :attr:`~Calendar.firstweekday` property." +msgstr "" + +#: ../../library/calendar.rst:59 +msgid "" +"Set the first weekday to *firstweekday*, passed as an :class:`int` (0--6)" +msgstr "" + +#: ../../library/calendar.rst:61 +msgid "Identical to setting the :attr:`~Calendar.firstweekday` property." +msgstr "" + +#: ../../library/calendar.rst:65 msgid "" "Return an iterator for the week day numbers that will be used for one week. " -"The first value from the iterator will be the same as the value of the :attr:" -"`firstweekday` property." +"The first value from the iterator will be the same as the value of " +"the :attr:`~Calendar.firstweekday` property." msgstr "" -"回傳一個以數字代表一週的每一天的疊代器 (iterator)。疊代器的第一個值和 :attr:" -"`firstweekday` 屬性的值一樣。" +"回傳一個以數字代表一週的每一天的疊代器 (iterator)。疊代器的第一個值" +"和 :attr:`~Calendar.firstweekday` 屬性的值一樣。" -#: ../../library/calendar.rst:52 +#: ../../library/calendar.rst:72 msgid "" "Return an iterator for the month *month* (1--12) in the year *year*. This " "iterator will return all days (as :class:`datetime.date` objects) for the " @@ -98,59 +126,59 @@ msgstr "" "回傳一個在 *year* 年 *month* (1--12) 月的疊代器。這個疊代器會回傳該月的所有日" "期(:class:`datetime.date` 物件)以及在該月之前及之後用來組成完整一週的日期。" -#: ../../library/calendar.rst:60 +#: ../../library/calendar.rst:80 msgid "" -"Return an iterator for the month *month* in the year *year* similar to :meth:" -"`itermonthdates`, but not restricted by the :class:`datetime.date` range. " -"Days returned will simply be day of the month numbers. For the days outside " -"of the specified month, the day number is ``0``." +"Return an iterator for the month *month* in the year *year* similar " +"to :meth:`itermonthdates`, but not restricted by the :class:`datetime.date` " +"range. Days returned will simply be day of the month numbers. For the days " +"outside of the specified month, the day number is ``0``." msgstr "" "類似 :meth:`itermonthdates`,回傳一個在 *year* 年 *month* 月的疊代器,但不受" "限於 :class:`datetime.date` 的範圍。回傳的日期單純是該月當日的數字,對於該月" "之外的日期數字會是 ``0``。" -#: ../../library/calendar.rst:68 +#: ../../library/calendar.rst:88 msgid "" -"Return an iterator for the month *month* in the year *year* similar to :meth:" -"`itermonthdates`, but not restricted by the :class:`datetime.date` range. " -"Days returned will be tuples consisting of a day of the month number and a " -"week day number." +"Return an iterator for the month *month* in the year *year* similar " +"to :meth:`itermonthdates`, but not restricted by the :class:`datetime.date` " +"range. Days returned will be tuples consisting of a day of the month number " +"and a week day number." msgstr "" "類似 :meth:`itermonthdates`,回傳一個在 *year* 年 *month* 月的疊代器,但不受" "限於 :class:`datetime.date` 的範圍。回傳的日期是一個由該月當日的數字及代表週" "幾的數字組成的元組。" -#: ../../library/calendar.rst:76 +#: ../../library/calendar.rst:96 msgid "" -"Return an iterator for the month *month* in the year *year* similar to :meth:" -"`itermonthdates`, but not restricted by the :class:`datetime.date` range. " -"Days returned will be tuples consisting of a year, a month and a day of the " -"month numbers." +"Return an iterator for the month *month* in the year *year* similar " +"to :meth:`itermonthdates`, but not restricted by the :class:`datetime.date` " +"range. Days returned will be tuples consisting of a year, a month and a day " +"of the month numbers." msgstr "" "類似 :meth:`itermonthdates`,回傳一個在 *year* 年 *month* 月的疊代器,但不受" "限於 :class:`datetime.date` 的範圍。回傳的日期是一個由年、月、日的數字組成的" "元組。" -#: ../../library/calendar.rst:86 +#: ../../library/calendar.rst:106 msgid "" -"Return an iterator for the month *month* in the year *year* similar to :meth:" -"`itermonthdates`, but not restricted by the :class:`datetime.date` range. " -"Days returned will be tuples consisting of a year, a month, a day of the " -"month, and a day of the week numbers." +"Return an iterator for the month *month* in the year *year* similar " +"to :meth:`itermonthdates`, but not restricted by the :class:`datetime.date` " +"range. Days returned will be tuples consisting of a year, a month, a day of " +"the month, and a day of the week numbers." msgstr "" "類似 :meth:`itermonthdates`,回傳一個在 *year* 年 *month* 月的疊代器,但不受" "限於 :class:`datetime.date` 的範圍。回傳的日期是一個由年、月、日及代表週幾的" "數字組成的元組。" -#: ../../library/calendar.rst:96 +#: ../../library/calendar.rst:116 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven :class:`datetime.date` objects." msgstr "" -"回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七個 :" -"class:`datetime.date` 物件。" +"回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七" +"個 :class:`datetime.date` 物件。" -#: ../../library/calendar.rst:102 +#: ../../library/calendar.rst:122 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven tuples of day numbers and weekday numbers." @@ -158,7 +186,7 @@ msgstr "" "回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七個該" "月當日的數字及代表週幾的數字組成的元組。" -#: ../../library/calendar.rst:109 +#: ../../library/calendar.rst:129 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven day numbers." @@ -166,7 +194,7 @@ msgstr "" "回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七個該" "月當日的數字。" -#: ../../library/calendar.rst:115 +#: ../../library/calendar.rst:135 msgid "" "Return the data for the specified year ready for formatting. The return " "value is a list of month rows. Each month row contains up to *width* months " @@ -177,76 +205,113 @@ msgstr "" "*width* 個月份組成(預設為 3)。每個月份包含四到六週,每一週包含一到七天,每" "一天則是一個 :class:`datetime.date` 物件。" -#: ../../library/calendar.rst:123 +#: ../../library/calendar.rst:143 msgid "" -"Return the data for the specified year ready for formatting (similar to :" -"meth:`yeardatescalendar`). Entries in the week lists are tuples of day " +"Return the data for the specified year ready for formatting (similar " +"to :meth:`yeardatescalendar`). Entries in the week lists are tuples of day " "numbers and weekday numbers. Day numbers outside this month are zero." msgstr "" "回傳用來格式化的指定年份的資料(類似 :meth:`yeardatescalendar`)。每一天是一" "個該月當日的數字及代表週幾的數字組成的元組,該月外的日期的該月當日數字為 0。" -#: ../../library/calendar.rst:130 +#: ../../library/calendar.rst:150 msgid "" -"Return the data for the specified year ready for formatting (similar to :" -"meth:`yeardatescalendar`). Entries in the week lists are day numbers. Day " -"numbers outside this month are zero." +"Return the data for the specified year ready for formatting (similar " +"to :meth:`yeardatescalendar`). Entries in the week lists are day numbers. " +"Day numbers outside this month are zero." msgstr "" "回傳用來格式化的指定年份的資料(類似 :meth:`yeardatescalendar`)。每一天是一" "個該月當日的數字,該月外的日期的該月當日數字為 0。" -#: ../../library/calendar.rst:137 +#: ../../library/calendar.rst:157 msgid "This class can be used to generate plain text calendars." msgstr "這個類別用來產生純文字的日曆。" -#: ../../library/calendar.rst:139 +#: ../../library/calendar.rst:159 msgid ":class:`TextCalendar` instances have the following methods:" msgstr ":class:`TextCalendar` 實例有以下方法:" -#: ../../library/calendar.rst:143 +#: ../../library/calendar.rst:164 +msgid "" +"Return a string representing a single day formatted with the given *width*. " +"If *theday* is ``0``, return a string of spaces of the specified width, " +"representing an empty day. The *weekday* parameter is unused." +msgstr "" + +#: ../../library/calendar.rst:171 +msgid "" +"Return a single week in a string with no newline. If *w* is provided, it " +"specifies the width of the date columns, which are centered. Depends on the " +"first weekday as specified in the constructor or set by " +"the :meth:`setfirstweekday` method." +msgstr "" + +#: ../../library/calendar.rst:178 +msgid "" +"Return a string representing the name of a single weekday formatted to the " +"specified *width*. The *weekday* parameter is an integer representing the " +"day of the week, where ``0`` is Monday and ``6`` is Sunday." +msgstr "" + +#: ../../library/calendar.rst:184 +msgid "" +"Return a string containing the header row of weekday names, formatted with " +"the given *width* for each column. The names depend on the locale settings " +"and are padded to the specified width." +msgstr "" + +#: ../../library/calendar.rst:190 msgid "" "Return a month's calendar in a multi-line string. If *w* is provided, it " "specifies the width of the date columns, which are centered. If *l* is " "given, it specifies the number of lines that each week will use. Depends on " -"the first weekday as specified in the constructor or set by the :meth:" -"`setfirstweekday` method." +"the first weekday as specified in the constructor or set by " +"the :meth:`setfirstweekday` method." msgstr "" "以多行字串的形式回傳一個月份的日曆。如果給定 *w*,它會指定置中的日期欄的寬" "度。如果給定 *l*,它會指定每一週使用的行數。這個日曆會依據在建構函式中指定或" "者透過 :meth:`setfirstweekday` 方法設定的一週的第一天來輸出。" -#: ../../library/calendar.rst:152 +#: ../../library/calendar.rst:198 +msgid "" +"Return a string representing the month's name centered within the specified " +"*width*. If *withyear* is ``True``, include the year in the output. The " +"*theyear* and *themonth* parameters specify the year and month for the name " +"to be formatted respectively." +msgstr "" + +#: ../../library/calendar.rst:205 msgid "Print a month's calendar as returned by :meth:`formatmonth`." msgstr "印出一個月份的日曆,內容和 :meth:`formatmonth` 回傳的一樣。" -#: ../../library/calendar.rst:157 +#: ../../library/calendar.rst:210 msgid "" "Return a *m*-column calendar for an entire year as a multi-line string. " "Optional parameters *w*, *l*, and *c* are for date column width, lines per " "week, and number of spaces between month columns, respectively. Depends on " -"the first weekday as specified in the constructor or set by the :meth:" -"`setfirstweekday` method. The earliest year for which a calendar can be " -"generated is platform-dependent." +"the first weekday as specified in the constructor or set by " +"the :meth:`setfirstweekday` method. The earliest year for which a calendar " +"can be generated is platform-dependent." msgstr "" "以多行字串的形式回傳有 *m* 欄的一整年的日曆。可選的參數 *w*、*l* 及 *c* 分別" "是日期欄寬度、每週行數及月份欄中間的空白數。這個日曆會依據在建構函式中指定或" "者透過 :meth:`setfirstweekday` 方法設定的一週的第一天來輸出。最早可以產生日曆" "的年份會依據平台而不同。" -#: ../../library/calendar.rst:167 +#: ../../library/calendar.rst:220 msgid "" "Print the calendar for an entire year as returned by :meth:`formatyear`." msgstr "印出一整年的日曆,內容和 :meth:`formatyear` 回傳的一樣。" -#: ../../library/calendar.rst:172 +#: ../../library/calendar.rst:225 msgid "This class can be used to generate HTML calendars." msgstr "這個類別用來產生 HTML 日曆。" -#: ../../library/calendar.rst:175 +#: ../../library/calendar.rst:228 msgid ":class:`!HTMLCalendar` instances have the following methods:" msgstr ":class:`!HTMLCalendar` 實例有以下方法:" -#: ../../library/calendar.rst:179 +#: ../../library/calendar.rst:232 msgid "" "Return a month's calendar as an HTML table. If *withyear* is true the year " "will be included in the header, otherwise just the month name will be used." @@ -254,14 +319,14 @@ msgstr "" "以 HTML 表格的形式回傳一個月份的日曆。如果 *withyear* 是 true 則標題會包含年" "份,否則只會有月份名稱。" -#: ../../library/calendar.rst:186 +#: ../../library/calendar.rst:239 msgid "" "Return a year's calendar as an HTML table. *width* (defaulting to 3) " "specifies the number of months per row." msgstr "" "以 HTML 表格的形式回傳一整年的日曆。*width*\\ (預設為 3)指定一列有幾個月。" -#: ../../library/calendar.rst:192 +#: ../../library/calendar.rst:245 msgid "" "Return a year's calendar as a complete HTML page. *width* (defaulting to 3) " "specifies the number of months per row. *css* is the name for the cascading " @@ -273,7 +338,7 @@ msgstr "" "月。*css* 是要使用的 CSS (cascading style sheet) 名稱,可以給 :const:`None` " "表示不使用任何 CSS。*encoding* 指定輸出使用的編碼(預設使用系統預設編碼)。" -#: ../../library/calendar.rst:201 +#: ../../library/calendar.rst:254 msgid "" "Return a month name as an HTML table row. If *withyear* is true the year " "will be included in the row, otherwise just the month name will be used." @@ -281,28 +346,28 @@ msgstr "" "以 HTML 表列的形式回傳一個月份的名稱。如果 *withyear* 是 true 則該列會包含年" "份,否則只會有月份名稱。" -#: ../../library/calendar.rst:206 +#: ../../library/calendar.rst:259 msgid "" ":class:`!HTMLCalendar` has the following attributes you can override to " "customize the CSS classes used by the calendar:" msgstr ":class:`!HTMLCalendar` 可以覆寫以下屬性來客製日曆所使用的 CSS 類別:" -#: ../../library/calendar.rst:211 +#: ../../library/calendar.rst:264 msgid "" "A list of CSS classes used for each weekday. The default class list is::" msgstr "對應一週每一天 CSS 類別的串列。預設的串列內容為: ::" -#: ../../library/calendar.rst:213 +#: ../../library/calendar.rst:266 msgid "" "cssclasses = [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"]" msgstr "" "cssclasses = [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"]" -#: ../../library/calendar.rst:215 +#: ../../library/calendar.rst:268 msgid "more styles can be added for each day::" msgstr "可以針對每一天增加更多樣式: ::" -#: ../../library/calendar.rst:217 +#: ../../library/calendar.rst:270 msgid "" "cssclasses = [\"mon text-bold\", \"tue\", \"wed\", \"thu\", \"fri\", " "\"sat\", \"sun red\"]" @@ -310,15 +375,15 @@ msgstr "" "cssclasses = [\"mon text-bold\", \"tue\", \"wed\", \"thu\", \"fri\", " "\"sat\", \"sun red\"]" -#: ../../library/calendar.rst:219 +#: ../../library/calendar.rst:272 msgid "Note that the length of this list must be seven items." msgstr "注意這個串列的長度必須是七個項目。" -#: ../../library/calendar.rst:224 +#: ../../library/calendar.rst:277 msgid "The CSS class for a weekday occurring in the previous or coming month." msgstr "跟當月為同一週且屬於前一個或下一個月份的日期使用的 CSS 類別。" -#: ../../library/calendar.rst:231 +#: ../../library/calendar.rst:284 msgid "" "A list of CSS classes used for weekday names in the header row. The default " "is the same as :attr:`cssclasses`." @@ -326,7 +391,7 @@ msgstr "" "在標題列中一週每一天名稱的 CSS 類別的串列。預設內容和 :attr:`cssclasses` 相" "同。" -#: ../../library/calendar.rst:239 +#: ../../library/calendar.rst:292 msgid "" "The month's head CSS class (used by :meth:`formatmonthname`). The default " "value is ``\"month\"``." @@ -334,7 +399,7 @@ msgstr "" "月份標題的 CSS 類別(由 :meth:`formatmonthname` 所使用),預設值是 " "``\"month\"``。" -#: ../../library/calendar.rst:247 +#: ../../library/calendar.rst:300 msgid "" "The CSS class for the whole month's table (used by :meth:`formatmonth`). The " "default value is ``\"month\"``." @@ -342,22 +407,22 @@ msgstr "" "整個月份表格的 CSS 類別(由 :meth:`formatmonth` 所使用),預設值是 " "``\"month\"``。" -#: ../../library/calendar.rst:255 +#: ../../library/calendar.rst:308 msgid "" -"The CSS class for the whole year's table of tables (used by :meth:" -"`formatyear`). The default value is ``\"year\"``." +"The CSS class for the whole year's table of tables (used " +"by :meth:`formatyear`). The default value is ``\"year\"``." msgstr "" "整年表格的 CSS 類別(由 :meth:`formatyear` 所使用),預設值是 ``\"year\"``。" -#: ../../library/calendar.rst:263 +#: ../../library/calendar.rst:316 msgid "" -"The CSS class for the table head for the whole year (used by :meth:" -"`formatyear`). The default value is ``\"year\"``." +"The CSS class for the table head for the whole year (used " +"by :meth:`formatyear`). The default value is ``\"year\"``." msgstr "" "整年表格標題的 CSS 類別(由 :meth:`formatyear` 所使用),預設值是 " "``\"year\"``。" -#: ../../library/calendar.rst:269 +#: ../../library/calendar.rst:322 msgid "" "Note that although the naming for the above described class attributes is " "singular (e.g. ``cssclass_month`` ``cssclass_noday``), one can replace the " @@ -367,15 +432,15 @@ msgstr "" "``cssclass_noday``),你可以使用多個以空格隔開的 CSS 類別取代單一 CSS 類別," "例如: ::" -#: ../../library/calendar.rst:273 +#: ../../library/calendar.rst:326 msgid "\"text-bold text-red\"" msgstr "\"text-bold text-red\"" -#: ../../library/calendar.rst:275 +#: ../../library/calendar.rst:328 msgid "Here is an example how :class:`!HTMLCalendar` can be customized::" msgstr "以下是客製化 :class:`!HTMLCalendar` 的範例: ::" -#: ../../library/calendar.rst:277 +#: ../../library/calendar.rst:330 msgid "" "class CustomHTMLCal(calendar.HTMLCalendar):\n" " cssclasses = [style + \" text-nowrap\" for style in\n" @@ -391,7 +456,7 @@ msgstr "" " cssclass_month = \"text-center month\"\n" " cssclass_year = \"text-italic lead\"" -#: ../../library/calendar.rst:287 +#: ../../library/calendar.rst:340 msgid "" "This subclass of :class:`TextCalendar` can be passed a locale name in the " "constructor and will return month and weekday names in the specified locale." @@ -399,7 +464,7 @@ msgstr "" ":class:`TextCalendar` 的子類別,可以在建構函式傳入語系名稱,它會回傳指定語系" "的月份及一週每一天的名稱。" -#: ../../library/calendar.rst:293 +#: ../../library/calendar.rst:346 msgid "" "This subclass of :class:`HTMLCalendar` can be passed a locale name in the " "constructor and will return month and weekday names in the specified locale." @@ -407,7 +472,7 @@ msgstr "" ":class:`HTMLCalendar` 的子類別,可以在建構函式傳入語系名稱,它會回傳指定語系" "的月份及一週每一天的名稱。" -#: ../../library/calendar.rst:299 +#: ../../library/calendar.rst:352 msgid "" "The constructor, :meth:`!formatweekday` and :meth:`!formatmonthname` methods " "of these two classes temporarily change the ``LC_TIME`` locale to the given " @@ -418,22 +483,22 @@ msgstr "" "會把 ``LC_TIME`` 語系暫時改成給定的 *locale*。因為目前的語系是屬於整個行程 " "(process-wide) 的設定,它們不是執行緒安全的。" -#: ../../library/calendar.rst:305 +#: ../../library/calendar.rst:358 msgid "For simple text calendars this module provides the following functions." msgstr "這個模組提供以下函式給單純的文字日曆使用。" -#: ../../library/calendar.rst:309 +#: ../../library/calendar.rst:362 msgid "" "Sets the weekday (``0`` is Monday, ``6`` is Sunday) to start each week. The " -"values :const:`MONDAY`, :const:`TUESDAY`, :const:`WEDNESDAY`, :const:" -"`THURSDAY`, :const:`FRIDAY`, :const:`SATURDAY`, and :const:`SUNDAY` are " -"provided for convenience. For example, to set the first weekday to Sunday::" +"values :const:`MONDAY`, :const:`TUESDAY`, :const:`WEDNESDAY`, :const:`THURSDAY`, :const:`FRIDAY`, :const:`SATURDAY`, " +"and :const:`SUNDAY` are provided for convenience. For example, to set the " +"first weekday to Sunday::" msgstr "" -"設定一週的第一天(``0`` 是週一、``6`` 是週日)。提供 :const:`MONDAY`、:const:" -"`TUESDAY`、:const:`WEDNESDAY`、:const:`THURSDAY`、:const:`FRIDAY`、:const:" -"`SATURDAY` 及 :const:`SUNDAY` 可以方便設定。例如設定一週的第一天為週日: ::" +"設定一週的第一天(``0`` 是週一、``6`` 是週日)。提" +"供 :const:`MONDAY`、:const:`TUESDAY`、:const:`WEDNESDAY`、:const:`THURSDAY`、:const:`FRIDAY`、:const:`SATURDAY` " +"及 :const:`SUNDAY` 可以方便設定。例如設定一週的第一天為週日: ::" -#: ../../library/calendar.rst:314 +#: ../../library/calendar.rst:367 msgid "" "import calendar\n" "calendar.setfirstweekday(calendar.SUNDAY)" @@ -441,27 +506,27 @@ msgstr "" "import calendar\n" "calendar.setfirstweekday(calendar.SUNDAY)" -#: ../../library/calendar.rst:320 +#: ../../library/calendar.rst:373 msgid "Returns the current setting for the weekday to start each week." msgstr "回傳目前設定的一週的第一天。" -#: ../../library/calendar.rst:325 +#: ../../library/calendar.rst:378 msgid "" "Returns :const:`True` if *year* is a leap year, otherwise :const:`False`." msgstr "如果 *year* 是閏年回傳 :const:`True`,否則回傳 :const:`False`。" -#: ../../library/calendar.rst:330 +#: ../../library/calendar.rst:383 msgid "" "Returns the number of leap years in the range from *y1* to *y2* (exclusive), " "where *y1* and *y2* are years." msgstr "" "回傳從 *y1* 到 *y2*\\ (不包含)間有幾個閏年,其中 *y1* 和 *y2* 是年份。" -#: ../../library/calendar.rst:333 +#: ../../library/calendar.rst:386 msgid "This function works for ranges spanning a century change." msgstr "這個函式也適用在跨越世紀的時間範圍。" -#: ../../library/calendar.rst:338 +#: ../../library/calendar.rst:391 msgid "" "Returns the day of the week (``0`` is Monday) for *year* (``1970``--...), " "*month* (``1``--``12``), *day* (``1``--``31``)." @@ -469,19 +534,19 @@ msgstr "" "回傳 *year* 年 (``1970``--...) *month* 月 (``1``--``12``) *day* 日 (``1``--" "``31``) 是週幾(``0`` 是星期一)。" -#: ../../library/calendar.rst:344 +#: ../../library/calendar.rst:397 msgid "" "Return a header containing abbreviated weekday names. *n* specifies the " "width in characters for one weekday." msgstr "回傳包含一週每一天的名稱縮寫的標題。*n* 指定每一天的字元寬度。" -#: ../../library/calendar.rst:350 +#: ../../library/calendar.rst:403 msgid "" "Returns weekday of first day of the month and number of days in month, for " "the specified *year* and *month*." msgstr "回傳指定 *year* 年 *month* 月該月第一天代表週幾的數字及該月有多少天。" -#: ../../library/calendar.rst:356 +#: ../../library/calendar.rst:409 msgid "" "Returns a matrix representing a month's calendar. Each row represents a " "week; days outside of the month are represented by zeros. Each week begins " @@ -490,32 +555,32 @@ msgstr "" "回傳代表一個月份日曆的矩陣。每一列為一週;該月以外的日期以 0 表示。每一週以週" "一開始,除非有使用 :func:`setfirstweekday` 改變設定。" -#: ../../library/calendar.rst:363 +#: ../../library/calendar.rst:416 msgid "Prints a month's calendar as returned by :func:`month`." msgstr "印出一個月份的日曆,跟 :func:`month` 回傳的內容一樣。" -#: ../../library/calendar.rst:368 +#: ../../library/calendar.rst:421 msgid "" -"Returns a month's calendar in a multi-line string using the :meth:" -"`~TextCalendar.formatmonth` of the :class:`TextCalendar` class." +"Returns a month's calendar in a multi-line string using " +"the :meth:`~TextCalendar.formatmonth` of the :class:`TextCalendar` class." msgstr "" -"以多行字串的形式回傳一個月的日曆,使用 :class:`TextCalendar` 類別的 :meth:" -"`~TextCalendar.formatmonth`。" +"以多行字串的形式回傳一個月的日曆,使用 :class:`TextCalendar` 類別" +"的 :meth:`~TextCalendar.formatmonth`。" -#: ../../library/calendar.rst:374 +#: ../../library/calendar.rst:427 msgid "" "Prints the calendar for an entire year as returned by :func:`calendar`." msgstr "印出一整年的日曆,跟 :func:`calendar` 回傳的內容一樣。" -#: ../../library/calendar.rst:379 +#: ../../library/calendar.rst:432 msgid "" "Returns a 3-column calendar for an entire year as a multi-line string using " "the :meth:`~TextCalendar.formatyear` of the :class:`TextCalendar` class." msgstr "" -"以多行字串回傳三欄形式的一整年日曆,使用 :class:`TextCalendar` 類別的 :meth:" -"`~TextCalendar.formatyear`。" +"以多行字串回傳三欄形式的一整年日曆,使用 :class:`TextCalendar` 類別" +"的 :meth:`~TextCalendar.formatyear`。" -#: ../../library/calendar.rst:385 +#: ../../library/calendar.rst:438 msgid "" "An unrelated but handy function that takes a time tuple such as returned by " "the :func:`~time.gmtime` function in the :mod:`time` module, and returns the " @@ -523,51 +588,52 @@ msgid "" "encoding. In fact, :func:`time.gmtime` and :func:`timegm` are each others' " "inverse." msgstr "" -"一個跟日曆無關但方便的函式,它接受一個像 :mod:`time` 模組裡的 :func:`~time." -"gmtime` 函式回傳的元組,並回傳對應的 Unix 時間戳,假設從 1970 開始及 POSIX 編" -"碼。事實上,:func:`time.gmtime` 和 :func:`timegm` 是彼此相反的。" +"一個跟日曆無關但方便的函式,它接受一個像 :mod:`time` 模組裡" +"的 :func:`~time.gmtime` 函式回傳的元組,並回傳對應的 Unix 時間戳,假設從 " +"1970 開始及 POSIX 編碼。事實上,:func:`time.gmtime` 和 :func:`timegm` 是彼此" +"相反的。" -#: ../../library/calendar.rst:392 +#: ../../library/calendar.rst:445 msgid "The :mod:`calendar` module exports the following data attributes:" msgstr ":mod:`calendar` 模組匯出以下資料屬性:" -#: ../../library/calendar.rst:396 +#: ../../library/calendar.rst:449 msgid "" "A sequence that represents the days of the week in the current locale, where " "Monday is day number 0." msgstr "以目前語系來表示的一週每一天名稱的序列,其中週一是第 0 天。" -#: ../../library/calendar.rst:406 +#: ../../library/calendar.rst:459 msgid "" "A sequence that represents the abbreviated days of the week in the current " "locale, where Mon is day number 0." msgstr "以目前語系來表示的一週每一天縮寫名稱的序列,其中 Mon 是第 0 天。" -#: ../../library/calendar.rst:421 +#: ../../library/calendar.rst:474 msgid "" "Aliases for the days of the week, where ``MONDAY`` is ``0`` and ``SUNDAY`` " "is ``6``." msgstr "一週每一天的別名,其中 ``MONDAY`` 是 ``0`` 而 ``SUNDAY`` 是 ``6``。" -#: ../../library/calendar.rst:429 +#: ../../library/calendar.rst:482 msgid "" "Enumeration defining days of the week as integer constants. The members of " -"this enumeration are exported to the module scope as :data:`MONDAY` through :" -"data:`SUNDAY`." +"this enumeration are exported to the module scope as :data:`MONDAY` " +"through :data:`SUNDAY`." msgstr "" -"將一週中的幾天定義為整數常數的列舉。此列舉的成員將作為 :data:`MONDAY` 到 :" -"data:`SUNDAY` 匯出到模組作用域。" +"將一週中的幾天定義為整數常數的列舉。此列舉的成員將作為 :data:`MONDAY` " +"到 :data:`SUNDAY` 匯出到模組作用域。" -#: ../../library/calendar.rst:438 +#: ../../library/calendar.rst:491 msgid "" "A sequence that represents the months of the year in the current locale. " "This follows normal convention of January being month number 1, so it has a " -"length of 13 and ``month_name[0]`` is the empty string." +"length of 13 and ``month_name[0]`` is the empty string." msgstr "" "以目前語系來表示的一年每個月份名稱的序列。它按照一般慣例以數字 1 代表一月,因" "此它的長度為 13,而 ``month_name[0]`` 是空字串。" -#: ../../library/calendar.rst:449 +#: ../../library/calendar.rst:502 msgid "" "A sequence that represents the abbreviated months of the year in the current " "locale. This follows normal convention of January being month number 1, so " @@ -576,77 +642,77 @@ msgstr "" "以目前語系來表示的一年每個月份縮寫名稱的序列。它按照一般慣例以數字 1 代表一" "月,因此它的長度為 13,而 ``month_abbr[0]`` 是空字串。" -#: ../../library/calendar.rst:470 +#: ../../library/calendar.rst:523 msgid "" "Aliases for the months of the year, where ``JANUARY`` is ``1`` and " "``DECEMBER`` is ``12``." msgstr "" "一年內每個月的別名,其中 ``JANUARY`` 是 ``ㄅ`` 而 ``DECEMBER`` 是 ``12``。" -#: ../../library/calendar.rst:478 +#: ../../library/calendar.rst:531 msgid "" "Enumeration defining months of the year as integer constants. The members of " "this enumeration are exported to the module scope as :data:`JANUARY` " "through :data:`DECEMBER`." msgstr "" -"將一年中的月份定義為整數常數的列舉。此列舉的成員將作為 :data:`JANUARY` 到 :" -"data:`DECEMBER` 匯出到模組作用域。" +"將一年中的月份定義為整數常數的列舉。此列舉的成員將作為 :data:`JANUARY` " +"到 :data:`DECEMBER` 匯出到模組作用域。" -#: ../../library/calendar.rst:485 +#: ../../library/calendar.rst:538 msgid "The :mod:`calendar` module defines the following exceptions:" msgstr ":mod:`calendar` 模組定義了以下例外:" -#: ../../library/calendar.rst:489 +#: ../../library/calendar.rst:542 msgid "" "A subclass of :exc:`ValueError`, raised when the given month number is " "outside of the range 1-12 (inclusive)." msgstr "" ":exc:`ValueError` 的子類別,當給定的月份數字超出 1-12 範圍(含)時引發。" -#: ../../library/calendar.rst:494 +#: ../../library/calendar.rst:547 msgid "The invalid month number." msgstr "無效的月份號。" -#: ../../library/calendar.rst:499 +#: ../../library/calendar.rst:552 msgid "" "A subclass of :exc:`ValueError`, raised when the given weekday number is " "outside of the range 0-6 (inclusive)." msgstr "" ":exc:`ValueError` 的子類別,當給定的週幾的數字超出 0-6(含)範圍時引發。" -#: ../../library/calendar.rst:504 +#: ../../library/calendar.rst:557 msgid "The invalid weekday number." msgstr "無效的週幾編號。" -#: ../../library/calendar.rst:509 +#: ../../library/calendar.rst:562 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/calendar.rst:510 +#: ../../library/calendar.rst:563 msgid "" "Object-oriented interface to dates and times with similar functionality to " "the :mod:`time` module." msgstr "日期與時間的物件導向介面,和 :mod:`time` 模組有相似的功能。" -#: ../../library/calendar.rst:513 +#: ../../library/calendar.rst:566 msgid "Module :mod:`time`" msgstr ":mod:`time` 模組" -#: ../../library/calendar.rst:514 +#: ../../library/calendar.rst:567 msgid "Low-level time related functions." msgstr "底層的時間相關函式。" -#: ../../library/calendar.rst:520 +#: ../../library/calendar.rst:573 msgid "Command-Line Usage" msgstr "命令列用法" -#: ../../library/calendar.rst:524 +#: ../../library/calendar.rst:577 msgid "" "The :mod:`calendar` module can be executed as a script from the command line " "to interactively print a calendar." msgstr ":mod:`calendar` 模組可以作為腳本從命令列執行,並以互動方式列印日曆。" -#: ../../library/calendar.rst:527 +#: ../../library/calendar.rst:580 msgid "" "python -m calendar [-h] [-L LOCALE] [-e ENCODING] [-t {text,html}]\n" " [-w WIDTH] [-l LINES] [-s SPACING] [-m MONTHS] [-c CSS]\n" @@ -656,11 +722,11 @@ msgstr "" " [-w WIDTH] [-l LINES] [-s SPACING] [-m MONTHS] [-c CSS]\n" " [-f FIRST_WEEKDAY] [year] [month]" -#: ../../library/calendar.rst:534 +#: ../../library/calendar.rst:587 msgid "For example, to print a calendar for the year 2000:" msgstr "例如,要列印 2000 年的日曆:" -#: ../../library/calendar.rst:536 +#: ../../library/calendar.rst:589 msgid "" "$ python -m calendar 2000\n" " 2000\n" @@ -738,40 +804,40 @@ msgstr "" "23 24 25 26 27 28 29 27 28 29 30 25 26 27 28 29 30 31\n" "30 31" -#: ../../library/calendar.rst:577 +#: ../../library/calendar.rst:630 msgid "The following options are accepted:" msgstr "接受以下選項:" -#: ../../library/calendar.rst:584 +#: ../../library/calendar.rst:637 msgid "Show the help message and exit." msgstr "顯示幫助訊息並退出。" -#: ../../library/calendar.rst:589 +#: ../../library/calendar.rst:642 msgid "The locale to use for month and weekday names. Defaults to English." msgstr "用於月份和週幾名稱的語系。預設為英語。" -#: ../../library/calendar.rst:595 +#: ../../library/calendar.rst:648 msgid "" -"The encoding to use for output. :option:`--encoding` is required if :option:" -"`--locale` is set." +"The encoding to use for output. :option:`--encoding` is required " +"if :option:`--locale` is set." msgstr "" "用於輸出的編碼。如有設定 :option:`--locale` 則必須給定 :option:`--encoding`。" -#: ../../library/calendar.rst:601 +#: ../../library/calendar.rst:654 msgid "Print the calendar to the terminal as text, or as an HTML document." msgstr "將日曆以文字或 HTML 文件的形式印出到終端機。" -#: ../../library/calendar.rst:607 +#: ../../library/calendar.rst:660 msgid "" "The weekday to start each week. Must be a number between 0 (Monday) and 6 " "(Sunday). Defaults to 0." msgstr "一週起始的日子。必須是 0(週一)到 6(週日)之間的數字。預設為 0。" -#: ../../library/calendar.rst:615 +#: ../../library/calendar.rst:668 msgid "The year to print the calendar for. Defaults to the current year." msgstr "印出日曆的年份。預設為當前年份。" -#: ../../library/calendar.rst:621 +#: ../../library/calendar.rst:674 msgid "" "The month of the specified :option:`year` to print the calendar for. Must be " "a number between 1 and 12, and may only be used in text mode. Defaults to " @@ -780,11 +846,11 @@ msgstr "" "要列印日曆的指定 :option:`year` 的月份。必須是 1 到 12 之間的數字,並且只能在" "文字模式下使用。預設列印全年日曆。" -#: ../../library/calendar.rst:627 +#: ../../library/calendar.rst:680 msgid "*Text-mode options:*" msgstr "*文字模式選項:*" -#: ../../library/calendar.rst:631 +#: ../../library/calendar.rst:684 msgid "" "The width of the date column in terminal columns. The date is printed " "centred in the column. Any value lower than 2 is ignored. Defaults to 2." @@ -792,7 +858,7 @@ msgstr "" "終端機行中日期行的寬度。日期印出在行的中央。任何小於 2 的值都會被忽略。預設" "為 2。" -#: ../../library/calendar.rst:639 +#: ../../library/calendar.rst:692 msgid "" "The number of lines for each week in terminal rows. The date is printed top-" "aligned. Any value lower than 1 is ignored. Defaults to 1." @@ -800,21 +866,21 @@ msgstr "" "終端機列中每週的列數。日期印出時頂部會對齊。任何小於 1 的值都會被忽略。預設" "為 1。" -#: ../../library/calendar.rst:647 +#: ../../library/calendar.rst:700 msgid "" "The space between months in columns. Any value lower than 2 is ignored. " "Defaults to 6." msgstr "行中月份之間的間距。任何小於 2 的值都會被忽略。預設為 6。" -#: ../../library/calendar.rst:654 +#: ../../library/calendar.rst:707 msgid "The number of months printed per row. Defaults to 3." msgstr "每列印出的月份數量。預設為 3。" -#: ../../library/calendar.rst:658 +#: ../../library/calendar.rst:711 msgid "*HTML-mode options:*" msgstr "*HTML 模式選項:*" -#: ../../library/calendar.rst:662 +#: ../../library/calendar.rst:715 msgid "" "The path of a CSS stylesheet to use for the calendar. This must either be " "relative to the generated HTML, or an absolute HTTP or ``file:///`` URL." diff --git a/library/collections.abc.po b/library/collections.abc.po index 0012205941..1edc583b3e 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-07 03:11+0800\n" +"POT-Creation-Date: 2025-01-07 00:14+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-" @@ -34,8 +33,8 @@ msgstr "**原始碼:**\\ :source:`Lib/_collections_abc.py`" msgid "" "This module provides :term:`abstract base classes ` " "that can be used to test whether a class provides a particular interface; " -"for example, whether it is :term:`hashable` or whether it is a :term:" -"`mapping`." +"for example, whether it is :term:`hashable` or whether it is " +"a :term:`mapping`." msgstr "" #: ../../library/collections.abc.rst:27 @@ -105,9 +104,9 @@ msgstr "" msgid "" "In this example, class :class:`!D` does not need to define ``__contains__``, " "``__iter__``, and ``__reversed__`` because the :ref:`in-operator " -"`, the :term:`iteration ` logic, and the :func:" -"`reversed` function automatically fall back to using ``__getitem__`` and " -"``__len__``." +"`, the :term:`iteration ` logic, and " +"the :func:`reversed` function automatically fall back to using " +"``__getitem__`` and ``__len__``." msgstr "" #: ../../library/collections.abc.rst:82 @@ -232,7 +231,7 @@ msgstr ":class:`Generator` [1]_" msgid ":class:`Iterator`" msgstr ":class:`Iterator`" -#: ../../library/collections.abc.rst:128 ../../library/collections.abc.rst:176 +#: ../../library/collections.abc.rst:128 ../../library/collections.abc.rst:177 msgid "``send``, ``throw``" msgstr "``send``、``throw``" @@ -244,7 +243,7 @@ msgstr "``close``、``__iter__``、``__next__``" msgid ":class:`Sized` [1]_" msgstr ":class:`Sized` [1]_" -#: ../../library/collections.abc.rst:129 ../../library/collections.abc.rst:168 +#: ../../library/collections.abc.rst:129 msgid "``__len__``" msgstr "``__len__``" @@ -311,45 +310,47 @@ msgstr ":class:`ByteString`" msgid "Inherited :class:`Sequence` methods" msgstr "" -#: ../../library/collections.abc.rst:147 ../../library/collections.abc.rst:151 +#: ../../library/collections.abc.rst:147 ../../library/collections.abc.rst:152 msgid ":class:`Set`" msgstr ":class:`Set`" -#: ../../library/collections.abc.rst:147 ../../library/collections.abc.rst:157 +#: ../../library/collections.abc.rst:147 ../../library/collections.abc.rst:158 msgid ":class:`Collection`" msgstr ":class:`Collection`" #: ../../library/collections.abc.rst:147 msgid "" "``__le__``, ``__lt__``, ``__eq__``, ``__ne__``, ``__gt__``, ``__ge__``, " -"``__and__``, ``__or__``, ``__sub__``, ``__xor__``, and ``isdisjoint``" +"``__and__``, ``__or__``, ``__sub__``, ``__rsub__``, ``__xor__``, " +"``__rxor__`` and ``isdisjoint``" msgstr "" "``__le__``、``__lt__``、``__eq__``、``__ne__``、``__gt__``、``__ge__``、" -"``__and__``、``__or__``、``__sub__``、``__xor__`` 與 ``isdisjoint``" +"``__and__``、``__or__``、``__sub__``、``__rsub__``、``__xor__``、" +"``__rxor__`` 和 ``isdisjoint``" -#: ../../library/collections.abc.rst:151 +#: ../../library/collections.abc.rst:152 msgid ":class:`MutableSet`" msgstr ":class:`MutableSet`" -#: ../../library/collections.abc.rst:151 +#: ../../library/collections.abc.rst:152 msgid "``__contains__``, ``__iter__``, ``__len__``, ``add``, ``discard``" msgstr "``__contains__``、``__iter__``、``__len__``、``add``、``discard``" -#: ../../library/collections.abc.rst:151 +#: ../../library/collections.abc.rst:152 msgid "" "Inherited :class:`Set` methods and ``clear``, ``pop``, ``remove``, " "``__ior__``, ``__iand__``, ``__ixor__``, and ``__isub__``" msgstr "" -#: ../../library/collections.abc.rst:157 ../../library/collections.abc.rst:161 +#: ../../library/collections.abc.rst:158 ../../library/collections.abc.rst:162 msgid ":class:`Mapping`" msgstr ":class:`Mapping`" -#: ../../library/collections.abc.rst:157 +#: ../../library/collections.abc.rst:158 msgid "``__getitem__``, ``__iter__``, ``__len__``" msgstr "``__getitem__``、``__iter__``、``__len__``" -#: ../../library/collections.abc.rst:157 +#: ../../library/collections.abc.rst:158 msgid "" "``__contains__``, ``keys``, ``items``, ``values``, ``get``, ``__eq__``, and " "``__ne__``" @@ -357,124 +358,128 @@ msgstr "" "``__contains__``、``keys``、``items``、``values``、``get``、``__eq__`` 和 " "``__ne__``" -#: ../../library/collections.abc.rst:161 +#: ../../library/collections.abc.rst:162 msgid ":class:`MutableMapping`" msgstr ":class:`MutableMapping`" -#: ../../library/collections.abc.rst:161 +#: ../../library/collections.abc.rst:162 msgid "" "``__getitem__``, ``__setitem__``, ``__delitem__``, ``__iter__``, ``__len__``" msgstr "" "``__getitem__``、``__setitem__``、``__delitem__``、``__iter__``、``__len__``" -#: ../../library/collections.abc.rst:161 +#: ../../library/collections.abc.rst:162 msgid "" "Inherited :class:`Mapping` methods and ``pop``, ``popitem``, ``clear``, " "``update``, and ``setdefault``" msgstr "" -#: ../../library/collections.abc.rst:168 +#: ../../library/collections.abc.rst:169 msgid ":class:`MappingView`" msgstr ":class:`MappingView`" -#: ../../library/collections.abc.rst:168 +#: ../../library/collections.abc.rst:169 msgid ":class:`Sized`" msgstr ":class:`Sized`" #: ../../library/collections.abc.rst:169 +msgid "``__init__``, ``__len__`` and ``__repr__``" +msgstr "``__init__``、``__len__`` 和 ``__repr__``" + +#: ../../library/collections.abc.rst:170 msgid ":class:`ItemsView`" msgstr ":class:`ItemsView`" -#: ../../library/collections.abc.rst:169 ../../library/collections.abc.rst:171 +#: ../../library/collections.abc.rst:170 ../../library/collections.abc.rst:172 msgid ":class:`MappingView`, :class:`Set`" msgstr ":class:`MappingView`、:class:`Set`" -#: ../../library/collections.abc.rst:169 ../../library/collections.abc.rst:171 -#: ../../library/collections.abc.rst:173 +#: ../../library/collections.abc.rst:170 ../../library/collections.abc.rst:172 +#: ../../library/collections.abc.rst:174 msgid "``__contains__``, ``__iter__``" msgstr "``__contains__``、``__iter__``" -#: ../../library/collections.abc.rst:171 +#: ../../library/collections.abc.rst:172 msgid ":class:`KeysView`" msgstr ":class:`KeysView`" -#: ../../library/collections.abc.rst:173 +#: ../../library/collections.abc.rst:174 msgid ":class:`ValuesView`" msgstr ":class:`ValuesView`" -#: ../../library/collections.abc.rst:173 +#: ../../library/collections.abc.rst:174 msgid ":class:`MappingView`, :class:`Collection`" msgstr ":class:`MappingView`、:class:`Collection`" -#: ../../library/collections.abc.rst:175 +#: ../../library/collections.abc.rst:176 msgid ":class:`Awaitable` [1]_" msgstr ":class:`Awaitable` [1]_" -#: ../../library/collections.abc.rst:175 +#: ../../library/collections.abc.rst:176 msgid "``__await__``" msgstr "``__await__``" -#: ../../library/collections.abc.rst:176 +#: ../../library/collections.abc.rst:177 msgid ":class:`Coroutine` [1]_" msgstr ":class:`Coroutine` [1]_" -#: ../../library/collections.abc.rst:176 +#: ../../library/collections.abc.rst:177 msgid ":class:`Awaitable`" msgstr ":class:`Awaitable`" -#: ../../library/collections.abc.rst:176 +#: ../../library/collections.abc.rst:177 msgid "``close``" msgstr "``close``" -#: ../../library/collections.abc.rst:177 +#: ../../library/collections.abc.rst:178 msgid ":class:`AsyncIterable` [1]_" msgstr ":class:`AsyncIterable` [1]_" -#: ../../library/collections.abc.rst:177 ../../library/collections.abc.rst:178 +#: ../../library/collections.abc.rst:178 ../../library/collections.abc.rst:179 msgid "``__aiter__``" msgstr "``__aiter__``" -#: ../../library/collections.abc.rst:178 +#: ../../library/collections.abc.rst:179 msgid ":class:`AsyncIterator` [1]_" msgstr ":class:`AsyncIterator` [1]_" -#: ../../library/collections.abc.rst:178 +#: ../../library/collections.abc.rst:179 msgid ":class:`AsyncIterable`" msgstr ":class:`AsyncIterable`" -#: ../../library/collections.abc.rst:178 +#: ../../library/collections.abc.rst:179 msgid "``__anext__``" msgstr "``__anext__``" -#: ../../library/collections.abc.rst:179 +#: ../../library/collections.abc.rst:180 msgid ":class:`AsyncGenerator` [1]_" msgstr ":class:`AsyncGenerator` [1]_" -#: ../../library/collections.abc.rst:179 +#: ../../library/collections.abc.rst:180 msgid ":class:`AsyncIterator`" msgstr ":class:`AsyncIterator`" -#: ../../library/collections.abc.rst:179 +#: ../../library/collections.abc.rst:180 msgid "``asend``, ``athrow``" msgstr "``asend``、``athrow``" -#: ../../library/collections.abc.rst:179 +#: ../../library/collections.abc.rst:180 msgid "``aclose``, ``__aiter__``, ``__anext__``" msgstr "``aclose``、``__aiter__``、``__anext__``" -#: ../../library/collections.abc.rst:180 +#: ../../library/collections.abc.rst:181 msgid ":class:`Buffer` [1]_" msgstr ":class:`Buffer` [1]_" -#: ../../library/collections.abc.rst:180 +#: ../../library/collections.abc.rst:181 msgid "``__buffer__``" msgstr "``__buffer__``" -#: ../../library/collections.abc.rst:185 +#: ../../library/collections.abc.rst:186 msgid "Footnotes" -msgstr "註解" +msgstr "註腳" -#: ../../library/collections.abc.rst:186 +#: ../../library/collections.abc.rst:187 msgid "" "These ABCs override :meth:`~abc.ABCMeta.__subclasshook__` to support testing " "an interface by verifying the required methods are present and have not been " @@ -482,211 +487,214 @@ msgid "" "interfaces require registration or direct subclassing." msgstr "" -#: ../../library/collections.abc.rst:192 +#: ../../library/collections.abc.rst:193 msgid "" "Checking ``isinstance(obj, Iterable)`` detects classes that are registered " "as :class:`Iterable` or that have an :meth:`~container.__iter__` method, but " "it does not detect classes that iterate with the :meth:`~object.__getitem__` " -"method. The only reliable way to determine whether an object is :term:" -"`iterable` is to call ``iter(obj)``." +"method. The only reliable way to determine whether an object " +"is :term:`iterable` is to call ``iter(obj)``." msgstr "" -#: ../../library/collections.abc.rst:200 +#: ../../library/collections.abc.rst:201 msgid "Collections Abstract Base Classes -- Detailed Descriptions" msgstr "" -#: ../../library/collections.abc.rst:205 +#: ../../library/collections.abc.rst:206 msgid "ABC for classes that provide the :meth:`~object.__contains__` method." msgstr "" -#: ../../library/collections.abc.rst:209 +#: ../../library/collections.abc.rst:210 msgid "ABC for classes that provide the :meth:`~object.__hash__` method." msgstr "" -#: ../../library/collections.abc.rst:213 +#: ../../library/collections.abc.rst:214 msgid "ABC for classes that provide the :meth:`~object.__len__` method." msgstr "" -#: ../../library/collections.abc.rst:217 +#: ../../library/collections.abc.rst:218 msgid "ABC for classes that provide the :meth:`~object.__call__` method." msgstr "" -#: ../../library/collections.abc.rst:219 +#: ../../library/collections.abc.rst:220 msgid "" "See :ref:`annotating-callables` for details on how to use :class:`!Callable` " "in type annotations." msgstr "" -#: ../../library/collections.abc.rst:224 +#: ../../library/collections.abc.rst:225 msgid "ABC for classes that provide the :meth:`~container.__iter__` method." msgstr "" -#: ../../library/collections.abc.rst:226 +#: ../../library/collections.abc.rst:227 msgid "" "Checking ``isinstance(obj, Iterable)`` detects classes that are registered " "as :class:`Iterable` or that have an :meth:`~container.__iter__` method, but " "it does not detect classes that iterate with the :meth:`~object.__getitem__` " -"method. The only reliable way to determine whether an object is :term:" -"`iterable` is to call ``iter(obj)``." +"method. The only reliable way to determine whether an object " +"is :term:`iterable` is to call ``iter(obj)``." msgstr "" -#: ../../library/collections.abc.rst:235 +#: ../../library/collections.abc.rst:236 msgid "ABC for sized iterable container classes." msgstr "" -#: ../../library/collections.abc.rst:241 +#: ../../library/collections.abc.rst:242 msgid "" -"ABC for classes that provide the :meth:`~iterator.__iter__` and :meth:" -"`~iterator.__next__` methods. See also the definition of :term:`iterator`." +"ABC for classes that provide the :meth:`~iterator.__iter__` " +"and :meth:`~iterator.__next__` methods. See also the definition " +"of :term:`iterator`." msgstr "" -#: ../../library/collections.abc.rst:247 +#: ../../library/collections.abc.rst:248 msgid "" "ABC for iterable classes that also provide the :meth:`~object.__reversed__` " "method." msgstr "" -#: ../../library/collections.abc.rst:254 +#: ../../library/collections.abc.rst:255 msgid "" -"ABC for :term:`generator` classes that implement the protocol defined in :" -"pep:`342` that extends :term:`iterators ` with the :meth:" -"`~generator.send`, :meth:`~generator.throw` and :meth:`~generator.close` " -"methods." +"ABC for :term:`generator` classes that implement the protocol defined " +"in :pep:`342` that extends :term:`iterators ` with " +"the :meth:`~generator.send`, :meth:`~generator.throw` " +"and :meth:`~generator.close` methods." msgstr "" -#: ../../library/collections.abc.rst:259 +#: ../../library/collections.abc.rst:260 msgid "" -"See :ref:`annotating-generators-and-coroutines` for details on using :class:" -"`!Generator` in type annotations." +"See :ref:`annotating-generators-and-coroutines` for details on " +"using :class:`!Generator` in type annotations." msgstr "" -#: ../../library/collections.abc.rst:268 +#: ../../library/collections.abc.rst:269 msgid "ABCs for read-only and mutable :term:`sequences `." msgstr "" -#: ../../library/collections.abc.rst:270 +#: ../../library/collections.abc.rst:271 msgid "" -"Implementation note: Some of the mixin methods, such as :meth:`~container." -"__iter__`, :meth:`~object.__reversed__` and :meth:`index`, make repeated " -"calls to the underlying :meth:`~object.__getitem__` method. Consequently, " +"Implementation note: Some of the mixin methods, such " +"as :meth:`~container.__iter__`, :meth:`~object.__reversed__` " +"and :meth:`index`, make repeated calls to the " +"underlying :meth:`~object.__getitem__` method. Consequently, " "if :meth:`~object.__getitem__` is implemented with constant access speed, " "the mixin methods will have linear performance; however, if the underlying " "method is linear (as it would be with a linked list), the mixins will have " "quadratic performance and will likely need to be overridden." msgstr "" -#: ../../library/collections.abc.rst:279 +#: ../../library/collections.abc.rst:280 msgid "The index() method added support for *stop* and *start* arguments." msgstr "" -#: ../../library/collections.abc.rst:283 +#: ../../library/collections.abc.rst:284 msgid "" "The :class:`ByteString` ABC has been deprecated. For use in typing, prefer a " "union, like ``bytes | bytearray``, or :class:`collections.abc.Buffer`. For " "use as an ABC, prefer :class:`Sequence` or :class:`collections.abc.Buffer`." msgstr "" -#: ../../library/collections.abc.rst:292 +#: ../../library/collections.abc.rst:293 msgid "ABCs for read-only and mutable :ref:`sets `." msgstr "" -#: ../../library/collections.abc.rst:297 +#: ../../library/collections.abc.rst:298 msgid "ABCs for read-only and mutable :term:`mappings `." msgstr "" -#: ../../library/collections.abc.rst:304 +#: ../../library/collections.abc.rst:305 msgid "" "ABCs for mapping, items, keys, and values :term:`views `." msgstr "" -#: ../../library/collections.abc.rst:308 +#: ../../library/collections.abc.rst:309 msgid "" "ABC for :term:`awaitable` objects, which can be used in :keyword:`await` " -"expressions. Custom implementations must provide the :meth:`~object." -"__await__` method." +"expressions. Custom implementations must provide " +"the :meth:`~object.__await__` method." msgstr "" -#: ../../library/collections.abc.rst:312 +#: ../../library/collections.abc.rst:313 msgid "" -":term:`Coroutine ` objects and instances of the :class:" -"`~collections.abc.Coroutine` ABC are all instances of this ABC." +":term:`Coroutine ` objects and instances of " +"the :class:`~collections.abc.Coroutine` ABC are all instances of this ABC." msgstr "" -#: ../../library/collections.abc.rst:316 +#: ../../library/collections.abc.rst:317 msgid "" "In CPython, generator-based coroutines (:term:`generators ` " "decorated with :func:`@types.coroutine `) are *awaitables*, " "even though they do not have an :meth:`~object.__await__` method. Using " -"``isinstance(gencoro, Awaitable)`` for them will return ``False``. Use :func:" -"`inspect.isawaitable` to detect them." +"``isinstance(gencoro, Awaitable)`` for them will return ``False``. " +"Use :func:`inspect.isawaitable` to detect them." msgstr "" -#: ../../library/collections.abc.rst:326 +#: ../../library/collections.abc.rst:327 msgid "" "ABC for :term:`coroutine` compatible classes. These implement the following " -"methods, defined in :ref:`coroutine-objects`: :meth:`~coroutine.send`, :meth:" -"`~coroutine.throw`, and :meth:`~coroutine.close`. Custom implementations " -"must also implement :meth:`~object.__await__`. All :class:`Coroutine` " -"instances are also instances of :class:`Awaitable`." +"methods, defined in :ref:`coroutine-" +"objects`: :meth:`~coroutine.send`, :meth:`~coroutine.throw`, " +"and :meth:`~coroutine.close`. Custom implementations must also " +"implement :meth:`~object.__await__`. All :class:`Coroutine` instances are " +"also instances of :class:`Awaitable`." msgstr "" -#: ../../library/collections.abc.rst:334 +#: ../../library/collections.abc.rst:335 msgid "" "In CPython, generator-based coroutines (:term:`generators ` " "decorated with :func:`@types.coroutine `) are *awaitables*, " "even though they do not have an :meth:`~object.__await__` method. Using " -"``isinstance(gencoro, Coroutine)`` for them will return ``False``. Use :func:" -"`inspect.isawaitable` to detect them." +"``isinstance(gencoro, Coroutine)`` for them will return ``False``. " +"Use :func:`inspect.isawaitable` to detect them." msgstr "" -#: ../../library/collections.abc.rst:340 +#: ../../library/collections.abc.rst:341 msgid "" -"See :ref:`annotating-generators-and-coroutines` for details on using :class:" -"`!Coroutine` in type annotations. The variance and order of type parameters " -"correspond to those of :class:`Generator`." +"See :ref:`annotating-generators-and-coroutines` for details on " +"using :class:`!Coroutine` in type annotations. The variance and order of " +"type parameters correspond to those of :class:`Generator`." msgstr "" -#: ../../library/collections.abc.rst:349 +#: ../../library/collections.abc.rst:350 msgid "" "ABC for classes that provide an ``__aiter__`` method. See also the " "definition of :term:`asynchronous iterable`." msgstr "" -#: ../../library/collections.abc.rst:356 +#: ../../library/collections.abc.rst:357 msgid "" "ABC for classes that provide ``__aiter__`` and ``__anext__`` methods. See " "also the definition of :term:`asynchronous iterator`." msgstr "" -#: ../../library/collections.abc.rst:363 +#: ../../library/collections.abc.rst:364 msgid "" "ABC for :term:`asynchronous generator` classes that implement the protocol " "defined in :pep:`525` and :pep:`492`." msgstr "" -#: ../../library/collections.abc.rst:366 +#: ../../library/collections.abc.rst:367 msgid "" -"See :ref:`annotating-generators-and-coroutines` for details on using :class:" -"`!AsyncGenerator` in type annotations." +"See :ref:`annotating-generators-and-coroutines` for details on " +"using :class:`!AsyncGenerator` in type annotations." msgstr "" -#: ../../library/collections.abc.rst:373 +#: ../../library/collections.abc.rst:374 msgid "" "ABC for classes that provide the :meth:`~object.__buffer__` method, " "implementing the :ref:`buffer protocol `. See :pep:`688`." msgstr "" -#: ../../library/collections.abc.rst:379 +#: ../../library/collections.abc.rst:380 msgid "Examples and Recipes" msgstr "" -#: ../../library/collections.abc.rst:381 +#: ../../library/collections.abc.rst:382 msgid "" "ABCs allow us to ask classes or instances if they provide particular " "functionality, for example::" msgstr "" -#: ../../library/collections.abc.rst:384 +#: ../../library/collections.abc.rst:385 msgid "" "size = None\n" "if isinstance(myvar, collections.abc.Sized):\n" @@ -696,17 +704,18 @@ msgstr "" "if isinstance(myvar, collections.abc.Sized):\n" " size = len(myvar)" -#: ../../library/collections.abc.rst:388 +#: ../../library/collections.abc.rst:389 msgid "" "Several of the ABCs are also useful as mixins that make it easier to develop " "classes supporting container APIs. For example, to write a class supporting " "the full :class:`Set` API, it is only necessary to supply the three " -"underlying abstract methods: :meth:`~object.__contains__`, :meth:`~container." -"__iter__`, and :meth:`~object.__len__`. The ABC supplies the remaining " -"methods such as :meth:`!__and__` and :meth:`~frozenset.isdisjoint`::" +"underlying abstract " +"methods: :meth:`~object.__contains__`, :meth:`~container.__iter__`, " +"and :meth:`~object.__len__`. The ABC supplies the remaining methods such " +"as :meth:`!__and__` and :meth:`~frozenset.isdisjoint`::" msgstr "" -#: ../../library/collections.abc.rst:395 +#: ../../library/collections.abc.rst:396 msgid "" "class ListBasedSet(collections.abc.Set):\n" " ''' Alternate set implementation favoring space over speed\n" @@ -732,31 +741,31 @@ msgid "" "automatically" msgstr "" -#: ../../library/collections.abc.rst:417 +#: ../../library/collections.abc.rst:418 msgid "Notes on using :class:`Set` and :class:`MutableSet` as a mixin:" msgstr "" -#: ../../library/collections.abc.rst:420 +#: ../../library/collections.abc.rst:421 msgid "" "Since some set operations create new sets, the default mixin methods need a " "way to create new instances from an :term:`iterable`. The class constructor " "is assumed to have a signature in the form ``ClassName(iterable)``. That " -"assumption is factored-out to an internal :class:`classmethod` called :meth:" -"`!_from_iterable` which calls ``cls(iterable)`` to produce a new set. If " -"the :class:`Set` mixin is being used in a class with a different constructor " -"signature, you will need to override :meth:`!_from_iterable` with a " -"classmethod or regular method that can construct new instances from an " -"iterable argument." +"assumption is factored-out to an internal :class:`classmethod` " +"called :meth:`!_from_iterable` which calls ``cls(iterable)`` to produce a " +"new set. If the :class:`Set` mixin is being used in a class with a different " +"constructor signature, you will need to override :meth:`!_from_iterable` " +"with a classmethod or regular method that can construct new instances from " +"an iterable argument." msgstr "" -#: ../../library/collections.abc.rst:431 +#: ../../library/collections.abc.rst:432 msgid "" "To override the comparisons (presumably for speed, as the semantics are " "fixed), redefine :meth:`~object.__le__` and :meth:`~object.__ge__`, then the " "other operations will automatically follow suit." msgstr "" -#: ../../library/collections.abc.rst:437 +#: ../../library/collections.abc.rst:438 msgid "" "The :class:`Set` mixin provides a :meth:`!_hash` method to compute a hash " "value for the set; however, :meth:`~object.__hash__` is not defined because " @@ -765,12 +774,12 @@ msgid "" "define ``__hash__ = Set._hash``." msgstr "" -#: ../../library/collections.abc.rst:445 +#: ../../library/collections.abc.rst:446 msgid "" "`OrderedSet recipe `_ for an " "example built on :class:`MutableSet`." msgstr "" -#: ../../library/collections.abc.rst:448 +#: ../../library/collections.abc.rst:449 msgid "For more about ABCs, see the :mod:`abc` module and :pep:`3119`." msgstr "關於 ABC 的更多資訊請見 :mod:`abc` module 和 :pep:`3119`。" diff --git a/library/datetime.po b/library/datetime.po index 5fcda8bc81..d1b39481c8 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-15 00:14+0000\n" +"POT-Creation-Date: 2025-02-05 00:13+0000\n" "PO-Revision-Date: 2023-08-07 10:20+0800\n" "Last-Translator: Griiid \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1493,7 +1493,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:940 -msgid "Use :meth:`datetime.now` with :attr:`UTC` instead." +msgid "Use :meth:`datetime.now` with :const:`UTC` instead." msgstr "" #: ../../library/datetime.rst:945 @@ -1593,7 +1593,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:1012 -msgid "Use :meth:`datetime.fromtimestamp` with :attr:`UTC` instead." +msgid "Use :meth:`datetime.fromtimestamp` with :const:`UTC` instead." msgstr "" #: ../../library/datetime.rst:1017 diff --git a/library/decimal.po b/library/decimal.po index 0ab719a400..0563622d36 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-02-05 00:13+0000\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2810,7 +2810,7 @@ msgstr "" #: ../../library/decimal.rst:2248 msgid "" -"For inexact results, :attr:`MAX_PREC` is far too large on 64-bit platforms " +"For inexact results, :const:`MAX_PREC` is far too large on 64-bit platforms " "and the available memory will be insufficient::" msgstr "" diff --git a/library/email.contentmanager.po b/library/email.contentmanager.po index a03eead9b1..3ecae14486 100644 --- a/library/email.contentmanager.po +++ b/library/email.contentmanager.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2025-01-19 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -218,10 +218,19 @@ msgstr "" #: ../../library/email.contentmanager.rst:159 msgid "" "For ``str`` objects, if *cte* is not set use heuristics to determine the " -"most compact encoding." +"most compact encoding. Prior to encoding, :meth:`str.splitlines` is used to " +"normalize all line boundaries, ensuring that each line of the payload is " +"terminated by the current policy's :data:`~email.policy.Policy.linesep` " +"property (even if the original string did not end with one)." msgstr "" -#: ../../library/email.contentmanager.rst:161 +#: ../../library/email.contentmanager.rst:165 +msgid "" +"For ``bytes`` objects, *cte* is taken to be base64 if not set, and the " +"aforementioned newline translation is not performed." +msgstr "" + +#: ../../library/email.contentmanager.rst:167 msgid "" "For :class:`~email.message.EmailMessage`, per :rfc:`2046`, raise an error if " "a *cte* of ``quoted-printable`` or ``base64`` is requested for *subtype* " @@ -230,14 +239,14 @@ msgid "" "For all other values of *subtype*, use ``7bit``." msgstr "" -#: ../../library/email.contentmanager.rst:168 +#: ../../library/email.contentmanager.rst:174 msgid "" "A *cte* of ``binary`` does not actually work correctly yet. The " "``EmailMessage`` object as modified by ``set_content`` is correct, but :" "class:`~email.generator.BytesGenerator` does not serialize it correctly." msgstr "" -#: ../../library/email.contentmanager.rst:173 +#: ../../library/email.contentmanager.rst:179 msgid "" "If *disposition* is set, use it as the value of the :mailheader:`Content-" "Disposition` header. If not specified, and *filename* is specified, add the " @@ -246,37 +255,37 @@ msgid "" "values for *disposition* are ``attachment`` and ``inline``." msgstr "" -#: ../../library/email.contentmanager.rst:180 +#: ../../library/email.contentmanager.rst:186 msgid "" "If *filename* is specified, use it as the value of the ``filename`` " "parameter of the :mailheader:`Content-Disposition` header." msgstr "" -#: ../../library/email.contentmanager.rst:183 +#: ../../library/email.contentmanager.rst:189 msgid "" "If *cid* is specified, add a :mailheader:`Content-ID` header with *cid* as " "its value." msgstr "" -#: ../../library/email.contentmanager.rst:186 +#: ../../library/email.contentmanager.rst:192 msgid "" "If *params* is specified, iterate its ``items`` method and use the resulting " "``(key, value)`` pairs to set additional parameters on the :mailheader:" "`Content-Type` header." msgstr "" -#: ../../library/email.contentmanager.rst:190 +#: ../../library/email.contentmanager.rst:196 msgid "" "If *headers* is specified and is a list of strings of the form ``headername: " "headervalue`` or a list of ``header`` objects (distinguished from strings by " "having a ``name`` attribute), add the headers to *msg*." msgstr "" -#: ../../library/email.contentmanager.rst:197 +#: ../../library/email.contentmanager.rst:203 msgid "Footnotes" msgstr "註解" -#: ../../library/email.contentmanager.rst:198 +#: ../../library/email.contentmanager.rst:204 msgid "" "Originally added in 3.4 as a :term:`provisional module `" msgstr "" diff --git a/library/email.policy.po b/library/email.policy.po index 20f6c5e82b..526811754f 100644 --- a/library/email.policy.po +++ b/library/email.policy.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-01-06 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -355,7 +355,7 @@ msgstr "" #: ../../library/email.policy.rst:268 msgid "" "Handle a *defect* found on *obj*. When the email package calls this method, " -"*defect* will always be a subclass of :class:`~email.errors.Defect`." +"*defect* will always be a subclass of :class:`~email.errors.MessageDefect`." msgstr "" #: ../../library/email.policy.rst:272 @@ -368,7 +368,7 @@ msgstr "" #: ../../library/email.policy.rst:279 msgid "" "Register a *defect* on *obj*. In the email package, *defect* will always be " -"a subclass of :class:`~email.errors.Defect`." +"a subclass of :class:`~email.errors.MessageDefect`." msgstr "" #: ../../library/email.policy.rst:282 diff --git a/library/errno.po b/library/errno.po index 0d41f0a9c6..8da2253e03 100644 --- a/library/errno.po +++ b/library/errno.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2025-01-29 00:13+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-" @@ -581,24 +581,128 @@ msgstr "" msgid "Interface output queue is full" msgstr "" -#: ../../library/errno.rst:670 +#: ../../library/errno.rst:671 +msgid "No medium found" +msgstr "" + +#: ../../library/errno.rst:676 +msgid "Wrong medium type" +msgstr "" + +#: ../../library/errno.rst:681 +msgid "Required key not available" +msgstr "" + +#: ../../library/errno.rst:686 +msgid "Key has expired" +msgstr "" + +#: ../../library/errno.rst:691 +msgid "Key has been revoked" +msgstr "" + +#: ../../library/errno.rst:696 +msgid "Key was rejected by service" +msgstr "" + +#: ../../library/errno.rst:701 +msgid "Operation not possible due to RF-kill" +msgstr "" + +#: ../../library/errno.rst:706 +msgid "Locked lock was unmapped" +msgstr "" + +#: ../../library/errno.rst:711 +msgid "Facility is not active" +msgstr "" + +#: ../../library/errno.rst:716 +msgid "Authentication error" +msgstr "" + +#: ../../library/errno.rst:723 +msgid "Bad CPU type in executable" +msgstr "" + +#: ../../library/errno.rst:730 +msgid "Bad executable (or shared library)" +msgstr "" + +#: ../../library/errno.rst:737 +msgid "Malformed Mach-o file" +msgstr "" + +#: ../../library/errno.rst:744 +msgid "Device error" +msgstr "" + +#: ../../library/errno.rst:751 +msgid "Inappropriate file type or format" +msgstr "" + +#: ../../library/errno.rst:758 +msgid "Need authenticator" +msgstr "" + +#: ../../library/errno.rst:765 +msgid "Attribute not found" +msgstr "" + +#: ../../library/errno.rst:772 +msgid "Policy not found" +msgstr "" + +#: ../../library/errno.rst:779 +msgid "Too many processes" +msgstr "" + +#: ../../library/errno.rst:786 +msgid "Bad procedure for program" +msgstr "" + +#: ../../library/errno.rst:793 +msgid "Program version wrong" +msgstr "" + +#: ../../library/errno.rst:800 +msgid "RPC prog. not avail" +msgstr "" + +#: ../../library/errno.rst:807 +msgid "Device power is off" +msgstr "" + +#: ../../library/errno.rst:814 +msgid "RPC struct is bad" +msgstr "" + +#: ../../library/errno.rst:821 +msgid "RPC version wrong" +msgstr "" + +#: ../../library/errno.rst:828 +msgid "Shared library version mismatch" +msgstr "" + +#: ../../library/errno.rst:835 msgid "" "Capabilities insufficient. This error is mapped to the exception :exc:" "`PermissionError`." msgstr "" -#: ../../library/errno.rst:673 +#: ../../library/errno.rst:838 msgid "Availability" msgstr "" -#: ../../library/errno.rst:680 +#: ../../library/errno.rst:845 msgid "Operation canceled" msgstr "" -#: ../../library/errno.rst:687 +#: ../../library/errno.rst:852 msgid "Owner died" msgstr "" -#: ../../library/errno.rst:694 +#: ../../library/errno.rst:859 msgid "State not recoverable" msgstr "" diff --git a/library/exceptions.po b/library/exceptions.po index b413eabffe..c3f246ac87 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -8,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-02-04 00:13+0000\n" "PO-Revision-Date: 2024-12-20 16:57+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,12 +24,13 @@ msgstr "內建的例外" #: ../../library/exceptions.rst:10 msgid "" -"In Python, all exceptions must be instances of a class that derives from :" -"class:`BaseException`. In a :keyword:`try` statement with an :keyword:" -"`except` clause that mentions a particular class, that clause also handles " -"any exception classes derived from that class (but not exception classes " -"from which *it* is derived). Two exception classes that are not related via " -"subclassing are never equivalent, even if they have the same name." +"In Python, all exceptions must be instances of a class that derives " +"from :class:`BaseException`. In a :keyword:`try` statement with " +"an :keyword:`except` clause that mentions a particular class, that clause " +"also handles any exception classes derived from that class (but not " +"exception classes from which *it* is derived). Two exception classes that " +"are not related via subclassing are never equivalent, even if they have the " +"same name." msgstr "" "在 Python 中,所有例外必須是從 :class:`BaseException` 衍生的類別的實例。在陳" "述式 :keyword:`try` 搭配 :keyword:`except` 子句裡提到一個特定的類別時,那個子" @@ -67,10 +67,10 @@ msgstr "" #: ../../library/exceptions.rst:31 msgid "" "The built-in exception classes can be subclassed to define new exceptions; " -"programmers are encouraged to derive new exceptions from the :exc:" -"`Exception` class or one of its subclasses, and not from :exc:" -"`BaseException`. More information on defining exceptions is available in " -"the Python Tutorial under :ref:`tut-userexceptions`." +"programmers are encouraged to derive new exceptions from " +"the :exc:`Exception` class or one of its subclasses, and not " +"from :exc:`BaseException`. More information on defining exceptions is " +"available in the Python Tutorial under :ref:`tut-userexceptions`." msgstr "" "可以從內建的例外類別定義新的例外子類別;程式設計師被鼓勵從 :exc:`Exception` " "類別或其子類別衍生新的例外,而不是從 :exc:`BaseException` 來衍生。更多關於定" @@ -90,13 +90,13 @@ msgstr "三個例外物件上的屬性提供關於引發此例外的情境的資 msgid "" "When raising a new exception while another exception is already being " "handled, the new exception's :attr:`!__context__` attribute is automatically " -"set to the handled exception. An exception may be handled when an :keyword:" -"`except` or :keyword:`finally` clause, or a :keyword:`with` statement, is " -"used." +"set to the handled exception. An exception may be handled when " +"an :keyword:`except` or :keyword:`finally` clause, or a :keyword:`with` " +"statement, is used." msgstr "" "當引發一個新的例外而同時有另一個例外已經正在被處理時,這個新例外的 :attr:`!" -"__context__` 屬性會自動被設成那個已處理的例外。當使用 :keyword:`except` 或 :" -"keyword:`finally` 子句或 :keyword:`with` 陳述式的時候例外會被處理。" +"__context__` 屬性會自動被設成那個已處理的例外。當使用 :keyword:`except` " +"或 :keyword:`finally` 子句或 :keyword:`with` 陳述式的時候例外會被處理。" #: ../../library/exceptions.rst:59 msgid "" @@ -122,11 +122,11 @@ msgid "" "introspection when debugging." msgstr "" "在 :keyword:`from` 後面的運算式必須是一個例外或 ``None``。它將會被設定" -"成所引發例外的 :attr:`!__cause__`。設定 :attr:`!__cause__` 也隱含地設定 :" -"attr:`!__suppress_context__` 屬性為 ``True``,因此使用 ``raise new_exc from " -"None`` 實際上會以新的例外取代舊的例外以利於顯示(例如轉換 :exc:`KeyError` " -"為 :exc:`AttributeError`),同時保持舊的例外可以透過 :attr:`!__context__` 取" -"得以方便 debug 的時候檢查。" +"成所引發例外的 :attr:`!__cause__`。設定 :attr:`!__cause__` 也隱含地設" +"定 :attr:`!__suppress_context__` 屬性為 ``True``,因此使用 ``raise new_exc " +"from None`` 實際上會以新的例外取代舊的例外以利於顯示(例如轉" +"換 :exc:`KeyError` 為 :exc:`AttributeError`),同時保持舊的例外可以透" +"過 :attr:`!__context__` 取得以方便 debug 的時候檢查。" #: ../../library/exceptions.rst:74 msgid "" @@ -168,17 +168,18 @@ msgstr "" #: ../../library/exceptions.rst:95 msgid "" -"Most built-in exceptions are implemented in C for efficiency, see: :source:" -"`Objects/exceptions.c`. Some have custom memory layouts which makes it " -"impossible to create a subclass that inherits from multiple exception types. " -"The memory layout of a type is an implementation detail and might change " -"between Python versions, leading to new conflicts in the future. Therefore, " -"it's recommended to avoid subclassing multiple exception types altogether." +"Most built-in exceptions are implemented in C for efficiency, " +"see: :source:`Objects/exceptions.c`. Some have custom memory layouts which " +"makes it impossible to create a subclass that inherits from multiple " +"exception types. The memory layout of a type is an implementation detail and " +"might change between Python versions, leading to new conflicts in the " +"future. Therefore, it's recommended to avoid subclassing multiple exception " +"types altogether." msgstr "" -"為了效率,大部分的內建例外使用 C 來實作,參考 :source:`Objects/exceptions." -"c`。一些例外有客製化的記憶體佈局,使其不可能建立一個繼承多種例外型別的子類" -"別。型別的記憶體佈局是實作細節且可能會在不同 Python 版本間改變,造成未來新的" -"衝突。因此,總之建議避免繼承多種例外型別。" +"為了效率,大部分的內建例外使用 C 來實作,參考 :source:`Objects/" +"exceptions.c`。一些例外有客製化的記憶體佈局,使其不可能建立一個繼承多種例外型" +"別的子類別。型別的記憶體佈局是實作細節且可能會在不同 Python 版本間改變,造成" +"未來新的衝突。因此,總之建議避免繼承多種例外型別。" #: ../../library/exceptions.rst:105 msgid "Base classes" @@ -193,14 +194,14 @@ msgstr "以下的例外大部分被用在當作其他例外的基底類別。" #: ../../library/exceptions.rst:111 msgid "" "The base class for all built-in exceptions. It is not meant to be directly " -"inherited by user-defined classes (for that, use :exc:`Exception`). If :" -"func:`str` is called on an instance of this class, the representation of the " -"argument(s) to the instance are returned, or the empty string when there " +"inherited by user-defined classes (for that, use :exc:`Exception`). " +"If :func:`str` is called on an instance of this class, the representation of " +"the argument(s) to the instance are returned, or the empty string when there " "were no arguments." msgstr "" -"所有內建例外的基底類別。這不是為了讓使用者定義的類別直接繼承(可以使用 :exc:" -"`Exception`)。如果在這個類別的實例上呼叫 :func:`str`,會回傳實例的引數的表" -"示,或者沒有引數的時候會回傳空字串。" +"所有內建例外的基底類別。這不是為了讓使用者定義的類別直接繼承(可以使" +"用 :exc:`Exception`)。如果在這個類別的實例上呼叫 :func:`str`,會回傳實例的引" +"數的表示,或者沒有引數的時候會回傳空字串。" #: ../../library/exceptions.rst:119 msgid "" @@ -263,8 +264,9 @@ msgstr "" #: ../../library/exceptions.rst:157 msgid "" -"A list of the notes of this exception, which were added with :meth:" -"`add_note`. This attribute is created when :meth:`add_note` is called." +"A list of the notes of this exception, which were added " +"with :meth:`add_note`. This attribute is created when :meth:`add_note` is " +"called." msgstr "" "該例外的備註串列,使用 :meth:`add_note` 來新增。此屬性在 :meth:`add_note` 被" "呼叫的時候建立。" @@ -280,11 +282,12 @@ msgstr "" #: ../../library/exceptions.rst:171 msgid "" "The base class for those built-in exceptions that are raised for various " -"arithmetic errors: :exc:`OverflowError`, :exc:`ZeroDivisionError`, :exc:" -"`FloatingPointError`." +"arithmetic " +"errors: :exc:`OverflowError`, :exc:`ZeroDivisionError`, :exc:`FloatingPointError`." msgstr "" -"各種運算錯誤所引發的那些內建例外::exc:`OverflowError`、:exc:" -"`ZeroDivisionError`、:exc:`FloatingPointError` 的基底類別。" +"各種運算錯誤所引發的那些內建例" +"外::exc:`OverflowError`、:exc:`ZeroDivisionError`、:exc:`FloatingPointError` " +"的基底類別。" #: ../../library/exceptions.rst:178 msgid "" @@ -300,8 +303,9 @@ msgid "" "on a mapping or sequence is invalid: :exc:`IndexError`, :exc:`KeyError`. " "This can be raised directly by :func:`codecs.lookup`." msgstr "" -"當使用在對映或序列上的鍵或索引是無效的時候所引發的例外::exc:`IndexError`、:" -"exc:`KeyError` 的基底類別。這可以被 :func:`codecs.lookup` 直接引發。" +"當使用在對映或序列上的鍵或索引是無效的時候所引發的例" +"外::exc:`IndexError`、:exc:`KeyError` 的基底類別。這可以" +"被 :func:`codecs.lookup` 直接引發。" #: ../../library/exceptions.rst:190 msgid "Concrete exceptions" @@ -342,8 +346,9 @@ msgstr "新增 :attr:`name` 與 :attr:`obj` 屬性。" #: ../../library/exceptions.rst:217 msgid "" "Raised when the :func:`input` function hits an end-of-file condition (EOF) " -"without reading any data. (N.B.: the :meth:`io.IOBase.read` and :meth:`io." -"IOBase.readline` methods return an empty string when they hit EOF.)" +"without reading any data. (N.B.: the :meth:`io.IOBase.read` " +"and :meth:`io.IOBase.readline` methods return an empty string when they hit " +"EOF.)" msgstr "" "當 :func:`input` 函式在沒有讀到任何資料而到達檔案結尾 (end-of-file, EOF) 條件" "的時候被引發。(注意::meth:`io.IOBase.read` 和 :meth:`io.IOBase.readline` 方" @@ -355,14 +360,15 @@ msgstr "目前沒有被使用。" #: ../../library/exceptions.rst:229 msgid "" -"Raised when a :term:`generator` or :term:`coroutine` is closed; see :meth:" -"`generator.close` and :meth:`coroutine.close`. It directly inherits from :" -"exc:`BaseException` instead of :exc:`Exception` since it is technically not " -"an error." +"Raised when a :term:`generator` or :term:`coroutine` is closed; " +"see :meth:`generator.close` and :meth:`coroutine.close`. It directly " +"inherits from :exc:`BaseException` instead of :exc:`Exception` since it is " +"technically not an error." msgstr "" -"當 :term:`generator` 或 :term:`coroutine` 被關閉的時候被引發;參考 :meth:" -"`generator.close` 和 :meth:`coroutine.close`。此例外直接繼承自 :exc:" -"`BaseException` 而不是 :exc:`Exception`,因為技術上來說這不是一個錯誤。" +"當 :term:`generator` 或 :term:`coroutine` 被關閉的時候被引發;參" +"考 :meth:`generator.close` 和 :meth:`coroutine.close`。此例外直接繼承" +"自 :exc:`BaseException` 而不是 :exc:`Exception`,因為技術上來說這不是一個錯" +"誤。" #: ../../library/exceptions.rst:237 msgid "" @@ -394,8 +400,8 @@ msgstr "新增 :attr:`name` 與 :attr:`path` 屬性。" #: ../../library/exceptions.rst:257 msgid "" "A subclass of :exc:`ImportError` which is raised by :keyword:`import` when a " -"module could not be located. It is also raised when ``None`` is found in :" -"data:`sys.modules`." +"module could not be located. It is also raised when ``None`` is found " +"in :data:`sys.modules`." msgstr "" ":exc:`ImportError` 的子類別,當模組不能被定位的時候會被 :keyword:`import` 所" "引發。當在 :data:`sys.modules` 裡找到 ``None`` 時也會被引發。" @@ -417,16 +423,16 @@ msgstr "當對映(字典)的鍵無法在已存在的鍵的集合中被找到 #: ../../library/exceptions.rst:282 msgid "" -"Raised when the user hits the interrupt key (normally :kbd:`Control-C` or :" -"kbd:`Delete`). During execution, a check for interrupts is made regularly. " -"The exception inherits from :exc:`BaseException` so as to not be " +"Raised when the user hits the interrupt key (normally :kbd:`Control-C` " +"or :kbd:`Delete`). During execution, a check for interrupts is made " +"regularly. The exception inherits from :exc:`BaseException` so as to not be " "accidentally caught by code that catches :exc:`Exception` and thus prevent " "the interpreter from exiting." msgstr "" -"當使用者輸入中斷鍵 (interrupt key)(一般來說是 :kbd:`Control-C` 或 :kbd:" -"`Delete`)時會被引發。在執行過程中,會定期檢查是否產生中斷。此例外繼承自 :" -"exc:`BaseException` 以防止意外地被捕捉 :exc:`Exception` 的程式碼所捕捉,而因" -"此讓直譯器無法結束。" +"當使用者輸入中斷鍵 (interrupt key)(一般來說是 :kbd:`Control-C` " +"或 :kbd:`Delete`)時會被引發。在執行過程中,會定期檢查是否產生中斷。此例外繼" +"承自 :exc:`BaseException` 以防止意外地被捕捉 :exc:`Exception` 的程式碼所捕" +"捉,而因此讓直譯器無法結束。" #: ../../library/exceptions.rst:290 msgid "" @@ -437,19 +443,20 @@ msgid "" "avoid raising it entirely. (See :ref:`handlers-and-exceptions`.)" msgstr "" "捕捉 :exc:`KeyboardInterrupt` 需要特殊的考量。因為它可以在無法預期的時間點被" -"引發,可能在某些情況下讓正在跑的程式處在一個不一致的狀態。一般來說最好讓 :" -"exc:`KeyboardInterrupt` 越快結束程式越好,或者完全避免引發它。(參考 :ref:" -"`handlers-and-exceptions`。)" +"引發,可能在某些情況下讓正在跑的程式處在一個不一致的狀態。一般來說最好" +"讓 :exc:`KeyboardInterrupt` 越快結束程式越好,或者完全避免引發它。(參" +"考 :ref:`handlers-and-exceptions`。)" #: ../../library/exceptions.rst:300 msgid "" "Raised when an operation runs out of memory but the situation may still be " "rescued (by deleting some objects). The associated value is a string " "indicating what kind of (internal) operation ran out of memory. Note that " -"because of the underlying memory management architecture (C's :c:func:" -"`malloc` function), the interpreter may not always be able to completely " -"recover from this situation; it nevertheless raises an exception so that a " -"stack traceback can be printed, in case a run-away program was the cause." +"because of the underlying memory management architecture " +"(C's :c:func:`malloc` function), the interpreter may not always be able to " +"completely recover from this situation; it nevertheless raises an exception " +"so that a stack traceback can be printed, in case a run-away program was the " +"cause." msgstr "" "當一個操作用光了記憶體但情況還可能被修復 (rescued)(透過刪除一些物件)的時候" "被引發。關聯值是一個字串,表示什麼類型的(內部)操作用光了記憶體。需注意的是" @@ -521,21 +528,22 @@ msgstr "" msgid "" "The second form of the constructor sets the corresponding attributes, " "described below. The attributes default to :const:`None` if not specified. " -"For backwards compatibility, if three arguments are passed, the :attr:" -"`~BaseException.args` attribute contains only a 2-tuple of the first two " -"constructor arguments." +"For backwards compatibility, if three arguments are passed, " +"the :attr:`~BaseException.args` attribute contains only a 2-tuple of the " +"first two constructor arguments." msgstr "" -"建構函式的第二種形式會設定以下描述的相對應屬性。如果沒有給定則屬性預設為 :" -"const:`None`。為了向後相容,如果傳入三個引數,:attr:`~BaseException.args` 屬" -"性只會是包含建構函式前兩個引數的雙元素元組。" +"建構函式的第二種形式會設定以下描述的相對應屬性。如果沒有給定則屬性預設" +"為 :const:`None`。為了向後相容,如果傳入三個引" +"數,:attr:`~BaseException.args` 屬性只會是包含建構函式前兩個引數的雙元素元" +"組。" #: ../../library/exceptions.rst:357 msgid "" "The constructor often actually returns a subclass of :exc:`OSError`, as " "described in `OS exceptions`_ below. The particular subclass depends on the " -"final :attr:`.errno` value. This behaviour only occurs when constructing :" -"exc:`OSError` directly or via an alias, and is not inherited when " -"subclassing." +"final :attr:`.errno` value. This behaviour only occurs when " +"constructing :exc:`OSError` directly or via an alias, and is not inherited " +"when subclassing." msgstr "" "如同下面的\\ `作業系統例外 `_\\ 所描述,實際上建構函式通常回" "傳 :exc:`OSError` 的子類別。會依據最後 :attr:`.errno` 的值決定特定子類別。這" @@ -548,19 +556,19 @@ msgstr "從 C 變數 :c:data:`errno` 而來的數值錯誤代碼。" #: ../../library/exceptions.rst:369 msgid "" -"Under Windows, this gives you the native Windows error code. The :attr:`." -"errno` attribute is then an approximate translation, in POSIX terms, of that " -"native error code." +"Under Windows, this gives you the native Windows error code. " +"The :attr:`.errno` attribute is then an approximate translation, in POSIX " +"terms, of that native error code." msgstr "" "在 Windows 下,這會提供你原生的 Windows 錯誤代碼。而 :attr:`.errno` 屬性是一" "個該原生錯誤代碼對於 POSIX 來說的近似翻譯。" #: ../../library/exceptions.rst:373 msgid "" -"Under Windows, if the *winerror* constructor argument is an integer, the :" -"attr:`.errno` attribute is determined from the Windows error code, and the " -"*errno* argument is ignored. On other platforms, the *winerror* argument is " -"ignored, and the :attr:`winerror` attribute does not exist." +"Under Windows, if the *winerror* constructor argument is an integer, " +"the :attr:`.errno` attribute is determined from the Windows error code, and " +"the *errno* argument is ignored. On other platforms, the *winerror* " +"argument is ignored, and the :attr:`winerror` attribute does not exist." msgstr "" "在 Windows 下,如果建構函式引數 *winerror* 是整數,則 :attr:`.errno` 屬性會根" "據該 Windows 錯誤代碼來決定,且 *errno* 引數會被忽略。在其他平台上," @@ -569,40 +577,40 @@ msgstr "" #: ../../library/exceptions.rst:381 msgid "" "The corresponding error message, as provided by the operating system. It is " -"formatted by the C functions :c:func:`perror` under POSIX, and :c:func:" -"`FormatMessage` under Windows." +"formatted by the C functions :c:func:`perror` under POSIX, " +"and :c:func:`FormatMessage` under Windows." msgstr "" "作業系統提供的對應錯誤訊息。在 POSIX 下會使用 C 函式 :c:func:`perror` 做格式" "化,而在 Windows 下會使用 :c:func:`FormatMessage`。" #: ../../library/exceptions.rst:389 msgid "" -"For exceptions that involve a file system path (such as :func:`open` or :" -"func:`os.unlink`), :attr:`filename` is the file name passed to the function. " -"For functions that involve two file system paths (such as :func:`os." -"rename`), :attr:`filename2` corresponds to the second file name passed to " -"the function." +"For exceptions that involve a file system path (such as :func:`open` " +"or :func:`os.unlink`), :attr:`filename` is the file name passed to the " +"function. For functions that involve two file system paths (such " +"as :func:`os.rename`), :attr:`filename2` corresponds to the second file name " +"passed to the function." msgstr "" -"對於包含檔案系統路徑的例外(像是 :func:`open` 或 :func:`os.unlink`),:attr:" -"`filename` 是傳入函式的檔案名稱。對於包含兩個檔案系統路徑的函式(像是 :func:" -"`os.rename`),:attr:`filename2` 對應到傳入函式的第二個檔案名稱。" +"對於包含檔案系統路徑的例外(像是 :func:`open` " +"或 :func:`os.unlink`),:attr:`filename` 是傳入函式的檔案名稱。對於包含兩個檔" +"案系統路徑的函式(像是 :func:`os.rename`),:attr:`filename2` 對應到傳入函式" +"的第二個檔案名稱。" #: ../../library/exceptions.rst:396 msgid "" -":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket." -"error`, :exc:`select.error` and :exc:`mmap.error` have been merged into :exc:" -"`OSError`, and the constructor may return a subclass." +":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket.error`, :exc:`select.error` " +"and :exc:`mmap.error` have been merged into :exc:`OSError`, and the " +"constructor may return a subclass." msgstr "" -":exc:`EnvironmentError`、:exc:`IOError`、:exc:`WindowsError`、:exc:`socket." -"error`、:exc:`select.error` 及 :exc:`mmap.error` 已合併進 :exc:`OSError`,而" -"建構函式可能會回傳子類別。" +":exc:`EnvironmentError`、:exc:`IOError`、:exc:`WindowsError`、:exc:`socket.error`、:exc:`select.error` " +"及 :exc:`mmap.error` 已合併進 :exc:`OSError`,而建構函式可能會回傳子類別。" #: ../../library/exceptions.rst:402 msgid "" "The :attr:`filename` attribute is now the original file name passed to the " -"function, instead of the name encoded to or decoded from the :term:" -"`filesystem encoding and error handler`. Also, the *filename2* constructor " -"argument and attribute was added." +"function, instead of the name encoded to or decoded from " +"the :term:`filesystem encoding and error handler`. Also, the *filename2* " +"constructor argument and attribute was added." msgstr "" ":attr:`filename` 屬性現在是傳入函式的原始檔名,而不是從\\ :term:`檔案系統編碼" "和錯誤處理函式 `\\ 編碼或解碼過的名" @@ -611,11 +619,11 @@ msgstr "" #: ../../library/exceptions.rst:411 msgid "" "Raised when the result of an arithmetic operation is too large to be " -"represented. This cannot occur for integers (which would rather raise :exc:" -"`MemoryError` than give up). However, for historical reasons, OverflowError " -"is sometimes raised for integers that are outside a required range. " -"Because of the lack of standardization of floating-point exception handling " -"in C, most floating-point operations are not checked." +"represented. This cannot occur for integers (which would rather " +"raise :exc:`MemoryError` than give up). However, for historical reasons, " +"OverflowError is sometimes raised for integers that are outside a required " +"range. Because of the lack of standardization of floating-point exception " +"handling in C, most floating-point operations are not checked." msgstr "" "當運算操作的結果太大而無法表示的時候會引發此例外。這不會發生在整數上(會改成" "引發 :exc:`MemoryError` 而不是放棄)。然而,因為一些歷史因素,OverflowError " @@ -628,14 +636,14 @@ msgid "" "operation is blocked during interpreter shutdown also known as :term:`Python " "finalization `." msgstr "" -"此例外衍生自 :exc:`RuntimeError`。當一個操作在直譯器關閉(也稱作 :term:" -"`Python 最終化 (Python finalization) `)期間被阻塞會引" -"發此例外。" +"此例外衍生自 :exc:`RuntimeError`。當一個操作在直譯器關閉(也稱" +"作 :term:`Python 最終化 (Python finalization) `)期間" +"被阻塞會引發此例外。" #: ../../library/exceptions.rst:425 msgid "" -"Examples of operations which can be blocked with a :exc:" -"`PythonFinalizationError` during the Python finalization:" +"Examples of operations which can be blocked with " +"a :exc:`PythonFinalizationError` during the Python finalization:" msgstr "" "在 Python 最終化期間,能夠以 :exc:`PythonFinalizationError` 被阻塞的操作範" "例:" @@ -659,17 +667,17 @@ msgstr "在之前,會引發一般的 :exc:`RuntimeError`。" #: ../../library/exceptions.rst:439 msgid "" "This exception is derived from :exc:`RuntimeError`. It is raised when the " -"interpreter detects that the maximum recursion depth (see :func:`sys." -"getrecursionlimit`) is exceeded." +"interpreter detects that the maximum recursion depth " +"(see :func:`sys.getrecursionlimit`) is exceeded." msgstr "" -"此例外衍生自 :exc:`RuntimeError`。當直譯器偵測到超過最大的遞迴深度(參考 :" -"func:`sys.getrecursionlimit`)時會引發此例外。" +"此例外衍生自 :exc:`RuntimeError`。當直譯器偵測到超過最大的遞迴深度(參" +"考 :func:`sys.getrecursionlimit`)時會引發此例外。" #: ../../library/exceptions.rst:449 msgid "" -"This exception is raised when a weak reference proxy, created by the :func:" -"`weakref.proxy` function, is used to access an attribute of the referent " -"after it has been garbage collected. For more information on weak " +"This exception is raised when a weak reference proxy, created by " +"the :func:`weakref.proxy` function, is used to access an attribute of the " +"referent after it has been garbage collected. For more information on weak " "references, see the :mod:`weakref` module." msgstr "" "當一個被 :func:`weakref.proxy` 函式建立的弱參照代理 (weak reference proxy) 被" @@ -687,9 +695,9 @@ msgstr "" #: ../../library/exceptions.rst:464 msgid "" -"Raised by built-in function :func:`next` and an :term:`iterator`\\'s :meth:" -"`~iterator.__next__` method to signal that there are no further items " -"produced by the iterator." +"Raised by built-in function :func:`next` and " +"an :term:`iterator`\\'s :meth:`~iterator.__next__` method to signal that " +"there are no further items produced by the iterator." msgstr "" "會被內建函式 :func:`next` 及 :term:`iterator` 的 :meth:`~iterator.__next__` " "方法引發,用來表示疊代器沒有更多項目可以產生。" @@ -697,21 +705,22 @@ msgstr "" #: ../../library/exceptions.rst:470 msgid "" "The exception object has a single attribute :attr:`!value`, which is given " -"as an argument when constructing the exception, and defaults to :const:" -"`None`." +"as an argument when constructing the exception, and defaults " +"to :const:`None`." msgstr "" -"此例外物件有單一屬性 :attr:`!value`,當建構此例外時會以引數給定,預設為 :" -"const:`None`。" +"此例外物件有單一屬性 :attr:`!value`,當建構此例外時會以引數給定,預設" +"為 :const:`None`。" #: ../../library/exceptions.rst:474 msgid "" -"When a :term:`generator` or :term:`coroutine` function returns, a new :exc:" -"`StopIteration` instance is raised, and the value returned by the function " -"is used as the :attr:`value` parameter to the constructor of the exception." +"When a :term:`generator` or :term:`coroutine` function returns, a " +"new :exc:`StopIteration` instance is raised, and the value returned by the " +"function is used as the :attr:`value` parameter to the constructor of the " +"exception." msgstr "" -"當 :term:`generator` 或 :term:`coroutine` 函式回傳時,新的 :exc:" -"`StopIteration` 實例會被引發,而該函式的回傳值會被用來當作此例外建構函式的 :" -"attr:`value` 參數。" +"當 :term:`generator` 或 :term:`coroutine` 函式回傳時,新" +"的 :exc:`StopIteration` 實例會被引發,而該函式的回傳值會被用來當作此例外建構" +"函式的 :attr:`value` 參數。" #: ../../library/exceptions.rst:479 msgid "" @@ -719,8 +728,8 @@ msgid "" "is converted into a :exc:`RuntimeError` (retaining the :exc:`StopIteration` " "as the new exception's cause)." msgstr "" -"如果產生器程式直接或間接引發 :exc:`StopIteration`,則其會被轉換成 :exc:" -"`RuntimeError`\\ (保留 :exc:`StopIteration` 作為新例外的成因)。" +"如果產生器程式直接或間接引發 :exc:`StopIteration`,則其會被轉換" +"成 :exc:`RuntimeError`\\ (保留 :exc:`StopIteration` 作為新例外的成因)。" #: ../../library/exceptions.rst:483 msgid "" @@ -754,10 +763,10 @@ msgstr "" #: ../../library/exceptions.rst:504 msgid "" -"Raised when the parser encounters a syntax error. This may occur in an :" -"keyword:`import` statement, in a call to the built-in functions :func:" -"`compile`, :func:`exec`, or :func:`eval`, or when reading the initial script " -"or standard input (also interactively)." +"Raised when the parser encounters a syntax error. This may occur in " +"an :keyword:`import` statement, in a call to the built-in " +"functions :func:`compile`, :func:`exec`, or :func:`eval`, or when reading " +"the initial script or standard input (also interactively)." msgstr "" "當剖析器遇到語法錯誤時會引發此例外。這可能發生在 :keyword:`import` 陳述式、在" "呼叫內建函式 :func:`compile`、:func:`exec` 或 :func:`eval` 的時候,或者在讀取" @@ -837,52 +846,59 @@ msgid "" "Raised when indentation contains an inconsistent use of tabs and spaces. " "This is a subclass of :exc:`IndentationError`." msgstr "" -"當縮排包含製表符號 (tab) 和空白的不一致用法時會引發此例外。這是 :exc:" -"`IndentationError` 的子類別。" +"當縮排包含製表符號 (tab) 和空白的不一致用法時會引發此例外。這" +"是 :exc:`IndentationError` 的子類別。" #: ../../library/exceptions.rst:563 msgid "" "Raised when the interpreter finds an internal error, but the situation does " "not look so serious to cause it to abandon all hope. The associated value is " -"a string indicating what went wrong (in low-level terms)." +"a string indicating what went wrong (in low-level terms). " +"In :term:`CPython`, this could be raised by incorrectly using Python's C " +"API, such as returning a ``NULL`` value without an exception set." msgstr "" "當直譯器找到一個內部錯誤,但該情況看起來沒有嚴重到要讓它放棄所有的希望時會引" "發此例外。關聯值是一個表示什麼地方出錯的字串(以低階的方式表達)。" +"在 :term:`CPython` 中,這可能是因為錯誤地使用 Python 的 C API,例如回傳一個 " +"``NULL`` 值而沒有設定例外。" -#: ../../library/exceptions.rst:567 +#: ../../library/exceptions.rst:569 msgid "" -"You should report this to the author or maintainer of your Python " -"interpreter. Be sure to report the version of the Python interpreter (``sys." -"version``; it is also printed at the start of an interactive Python " -"session), the exact error message (the exception's associated value) and if " -"possible the source of the program that triggered the error." +"If you're confident that this exception wasn't your fault, or the fault of a " +"package you're using, you should report this to the author or maintainer of " +"your Python interpreter. Be sure to report the version of the Python " +"interpreter (``sys.version``; it is also printed at the start of an " +"interactive Python session), the exact error message (the exception's " +"associated value) and if possible the source of the program that triggered " +"the error." msgstr "" -"你應該向你的 Python 直譯器作者或維護者回報此錯誤。務必要回報該 Python 直譯器" -"的版本(``sys.version``;這也會在互動式 Python 會話的開頭被印出)、確切的錯誤" -"訊息(該例外的關聯值)及如果可能的話,觸發此錯誤的程式來源。" +"如果你確定這個例外不是你的或者所用套件的錯,你應該向你的 Python 直譯器作者或" +"維護者回報此錯誤。務必要回報該 Python 直譯器的版本(``sys.version``;這也會在" +"互動式 Python 會話的開頭被印出)、確切的錯誤訊息(該例外的關聯值)及如果可能" +"的話,觸發此錯誤的程式來源。" -#: ../../library/exceptions.rst:576 +#: ../../library/exceptions.rst:580 msgid "" "This exception is raised by the :func:`sys.exit` function. It inherits " "from :exc:`BaseException` instead of :exc:`Exception` so that it is not " "accidentally caught by code that catches :exc:`Exception`. This allows the " "exception to properly propagate up and cause the interpreter to exit. When " "it is not handled, the Python interpreter exits; no stack traceback is " -"printed. The constructor accepts the same optional argument passed to :func:" -"`sys.exit`. If the value is an integer, it specifies the system exit status " -"(passed to C's :c:func:`exit` function); if it is ``None``, the exit status " -"is zero; if it has another type (such as a string), the object's value is " -"printed and the exit status is one." -msgstr "" -"此例外會被 :func:`sys.exit` 函式引發。它繼承自 :exc:`BaseException` 而不是 :" -"exc:`Exception` 因此不會被捕捉 :exc:`Exception` 的程式意外地捕捉。這允許例外" -"可以正確地向上傳遞並導致直譯器結束。當它未被處理時,Python 直譯器會結束;不會" -"印出堆疊回溯。建構函式接受跟傳入 :func:`sys.exit` 一樣的可選引數。如果該值是" -"整數,它會指定系統的結束狀態(傳入 C 的 :c:func:`exit` 函式 );如果它是 " +"printed. The constructor accepts the same optional argument passed " +"to :func:`sys.exit`. If the value is an integer, it specifies the system " +"exit status (passed to C's :c:func:`exit` function); if it is ``None``, the " +"exit status is zero; if it has another type (such as a string), the object's " +"value is printed and the exit status is one." +msgstr "" +"此例外會被 :func:`sys.exit` 函式引發。它繼承自 :exc:`BaseException` 而不" +"是 :exc:`Exception` 因此不會被捕捉 :exc:`Exception` 的程式意外地捕捉。這允許" +"例外可以正確地向上傳遞並導致直譯器結束。當它未被處理時,Python 直譯器會結束;" +"不會印出堆疊回溯。建構函式接受跟傳入 :func:`sys.exit` 一樣的可選引數。如果該" +"值是整數,它會指定系統的結束狀態(傳入 C 的 :c:func:`exit` 函式 );如果它是 " "``None``,結束狀態會是 0;如果它是其他型別(例如字串),則物件的值會被印出而" "結束狀態是 1。" -#: ../../library/exceptions.rst:587 +#: ../../library/exceptions.rst:591 msgid "" "A call to :func:`sys.exit` is translated into an exception so that clean-up " "handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be " @@ -893,16 +909,16 @@ msgid "" msgstr "" "對 :func:`sys.exit` 的呼叫會轉譯成例外讓負責清理的處理函式(:keyword:`try` 陳" "述式的 :keyword:`finally` 子句)可以被執行,且讓除錯器可以在不冒著失去控制的" -"風險下執行腳本。如果在絕對有必要立即結束的情況(例如在子行程呼叫完 :func:`os." -"fork` 之後 )可以使用 :func:`os._exit` 函式。" +"風險下執行腳本。如果在絕對有必要立即結束的情況(例如在子行程呼叫" +"完 :func:`os.fork` 之後 )可以使用 :func:`os._exit` 函式。" -#: ../../library/exceptions.rst:596 +#: ../../library/exceptions.rst:600 msgid "" "The exit status or error message that is passed to the constructor. " "(Defaults to ``None``.)" msgstr "傳入建構函式的結束狀態或錯誤訊息。(預設是 ``None``。 )" -#: ../../library/exceptions.rst:602 +#: ../../library/exceptions.rst:606 msgid "" "Raised when an operation or function is applied to an object of " "inappropriate type. The associated value is a string giving details about " @@ -911,7 +927,7 @@ msgstr "" "當一個操作或函式被用在不適合的型別的物件時會引發此例外。關聯值是一個字串,提" "供關於不相符型別的細節。" -#: ../../library/exceptions.rst:605 +#: ../../library/exceptions.rst:609 msgid "" "This exception may be raised by user code to indicate that an attempted " "operation on an object is not supported, and is not meant to be. If an " @@ -922,27 +938,27 @@ msgstr "" "這樣做。如果一個物件有意要支援某個給定的操作但尚未提供實作,該引發的正確例外" "是 :exc:`NotImplementedError`。" -#: ../../library/exceptions.rst:610 +#: ../../library/exceptions.rst:614 msgid "" -"Passing arguments of the wrong type (e.g. passing a :class:`list` when an :" -"class:`int` is expected) should result in a :exc:`TypeError`, but passing " -"arguments with the wrong value (e.g. a number outside expected boundaries) " -"should result in a :exc:`ValueError`." +"Passing arguments of the wrong type (e.g. passing a :class:`list` when " +"an :class:`int` is expected) should result in a :exc:`TypeError`, but " +"passing arguments with the wrong value (e.g. a number outside expected " +"boundaries) should result in a :exc:`ValueError`." msgstr "" "傳入錯誤型別的引數(例如當預期傳入 :class:`int` 卻傳入 :class:`list`)應該要" "導致 :exc:`TypeError`,但傳入帶有錯誤值的引數(例如超出預期範圍的數值)應該要" "導致 :exc:`ValueError`。" -#: ../../library/exceptions.rst:617 +#: ../../library/exceptions.rst:621 msgid "" "Raised when a reference is made to a local variable in a function or method, " -"but no value has been bound to that variable. This is a subclass of :exc:" -"`NameError`." +"but no value has been bound to that variable. This is a subclass " +"of :exc:`NameError`." msgstr "" "當在函式或方法裡引用某個區域變數,但該變數尚未被繫結到任何值的時候會引發此例" "外。這是 :exc:`NameError` 的子類別。" -#: ../../library/exceptions.rst:624 +#: ../../library/exceptions.rst:628 msgid "" "Raised when a Unicode-related encoding or decoding error occurs. It is a " "subclass of :exc:`ValueError`." @@ -950,36 +966,36 @@ msgstr "" "當 Unicode 相關的編碼或解碼錯誤發生時會引發此例外。這是 :exc:`ValueError` 的" "子類別。" -#: ../../library/exceptions.rst:627 +#: ../../library/exceptions.rst:631 msgid "" ":exc:`UnicodeError` has attributes that describe the encoding or decoding " "error. For example, ``err.object[err.start:err.end]`` gives the particular " "invalid input that the codec failed on." msgstr "" -":exc:`UnicodeError` 有屬性描述編碼或解碼錯誤。例如 ``err.object[err.start:" -"err.end]`` 會提供讓編解碼器失敗的具體無效輸入。" +":exc:`UnicodeError` 有屬性描述編碼或解碼錯誤。例如 " +"``err.object[err.start:err.end]`` 會提供讓編解碼器失敗的具體無效輸入。" -#: ../../library/exceptions.rst:633 +#: ../../library/exceptions.rst:637 msgid "The name of the encoding that raised the error." msgstr "引發錯誤的編碼名稱。" -#: ../../library/exceptions.rst:637 +#: ../../library/exceptions.rst:641 msgid "A string describing the specific codec error." msgstr "描述特定編解碼器錯誤的字串。" -#: ../../library/exceptions.rst:641 +#: ../../library/exceptions.rst:645 msgid "The object the codec was attempting to encode or decode." msgstr "編解碼器嘗試編碼或解碼的物件。" -#: ../../library/exceptions.rst:645 +#: ../../library/exceptions.rst:649 msgid "The first index of invalid data in :attr:`object`." msgstr "在 :attr:`object` 中無效資料的開始索引。" -#: ../../library/exceptions.rst:649 +#: ../../library/exceptions.rst:653 msgid "The index after the last invalid data in :attr:`object`." msgstr "在 :attr:`object` 中最後的無效資料後的索引。" -#: ../../library/exceptions.rst:654 +#: ../../library/exceptions.rst:658 msgid "" "Raised when a Unicode-related error occurs during encoding. It is a " "subclass of :exc:`UnicodeError`." @@ -987,7 +1003,7 @@ msgstr "" "在編碼當中發生 Unicode 相關錯誤時會引發此例外。這是 :exc:`UnicodeError` 的子" "類別。" -#: ../../library/exceptions.rst:660 +#: ../../library/exceptions.rst:664 msgid "" "Raised when a Unicode-related error occurs during decoding. It is a " "subclass of :exc:`UnicodeError`." @@ -995,7 +1011,7 @@ msgstr "" "在解碼當中發生 Unicode 相關錯誤時會引發此例外。這是 :exc:`UnicodeError` 的子" "類別。" -#: ../../library/exceptions.rst:666 +#: ../../library/exceptions.rst:670 msgid "" "Raised when a Unicode-related error occurs during translating. It is a " "subclass of :exc:`UnicodeError`." @@ -1003,7 +1019,7 @@ msgstr "" "在轉譯當中發生 Unicode 相關錯誤時會引發此例外。這是 :exc:`UnicodeError` 的子" "類別。" -#: ../../library/exceptions.rst:672 +#: ../../library/exceptions.rst:676 msgid "" "Raised when an operation or function receives an argument that has the right " "type but an inappropriate value, and the situation is not described by a " @@ -1012,7 +1028,7 @@ msgstr "" "當一個操作或函式收到引數是正確型別但是不適合的值,且該情況無法被更精確的例外" "例如 :exc:`IndexError` 所描述時會引發此例外。" -#: ../../library/exceptions.rst:679 +#: ../../library/exceptions.rst:683 msgid "" "Raised when the second argument of a division or modulo operation is zero. " "The associated value is a string indicating the type of the operands and the " @@ -1021,47 +1037,47 @@ msgstr "" "當除法或模數運算 (modulo operation) 的第二個引數是 0 的時候會引發此例外。關聯" "值是一個字串,表示運算元及運算的類型。" -#: ../../library/exceptions.rst:684 +#: ../../library/exceptions.rst:688 msgid "" "The following exceptions are kept for compatibility with previous versions; " "starting from Python 3.3, they are aliases of :exc:`OSError`." msgstr "" -"以下例外是為了相容於之前版本而保留;從 Python 3.3 開始,它們是 :exc:" -"`OSError` 的別名。" +"以下例外是為了相容於之前版本而保留;從 Python 3.3 開始,它們" +"是 :exc:`OSError` 的別名。" -#: ../../library/exceptions.rst:693 +#: ../../library/exceptions.rst:697 msgid "Only available on Windows." msgstr "僅限於在 Windows 中使用。" -#: ../../library/exceptions.rst:697 +#: ../../library/exceptions.rst:701 msgid "OS exceptions" msgstr "作業系統例外" -#: ../../library/exceptions.rst:699 +#: ../../library/exceptions.rst:703 msgid "" "The following exceptions are subclasses of :exc:`OSError`, they get raised " "depending on the system error code." msgstr "以下的例外是 :exc:`OSError` 的子類別,它們根據系統錯誤代碼來引發。" -#: ../../library/exceptions.rst:704 +#: ../../library/exceptions.rst:708 msgid "" "Raised when an operation would block on an object (e.g. socket) set for non-" -"blocking operation. Corresponds to :c:data:`errno` :py:const:`~errno." -"EAGAIN`, :py:const:`~errno.EALREADY`, :py:const:`~errno.EWOULDBLOCK` and :py:" -"const:`~errno.EINPROGRESS`." +"blocking operation. Corresponds " +"to :c:data:`errno` :py:const:`~errno.EAGAIN`, :py:const:`~errno.EALREADY`, :py:const:`~errno.EWOULDBLOCK` " +"and :py:const:`~errno.EINPROGRESS`." msgstr "" "當設置為非阻塞操作的物件(例如 socket)上的操作將要阻塞時會引發此例外。對應" -"到 :c:data:`errno` :py:const:`~errno.EAGAIN`、:py:const:`~errno.EALREADY`、:" -"py:const:`~errno.EWOULDBLOCK` 及 :py:const:`~errno.EINPROGRESS`。" +"到 :c:data:`errno` :py:const:`~errno.EAGAIN`、:py:const:`~errno.EALREADY`、:py:const:`~errno.EWOULDBLOCK` " +"及 :py:const:`~errno.EINPROGRESS`。" -#: ../../library/exceptions.rst:709 +#: ../../library/exceptions.rst:713 msgid "" "In addition to those of :exc:`OSError`, :exc:`BlockingIOError` can have one " "more attribute:" msgstr "" "除了 :exc:`OSError` 的那些屬性之外,:exc:`BlockingIOError` 有多一個屬性:" -#: ../../library/exceptions.rst:714 +#: ../../library/exceptions.rst:718 msgid "" "An integer containing the number of characters written to the stream before " "it blocked. This attribute is available when using the buffered I/O classes " @@ -1070,56 +1086,58 @@ msgstr "" "一個整數,內容為在其阻塞之前,已寫進串流的字元數。當使用 :mod:`io` 模組裡的緩" "衝 I/O 類別時這個屬性是可用的。" -#: ../../library/exceptions.rst:720 +#: ../../library/exceptions.rst:724 msgid "" -"Raised when an operation on a child process failed. Corresponds to :c:data:" -"`errno` :py:const:`~errno.ECHILD`." +"Raised when an operation on a child process failed. Corresponds " +"to :c:data:`errno` :py:const:`~errno.ECHILD`." msgstr "" -"當子行程上的操作失敗時會引發此例外。對應到 :c:data:`errno` :py:const:`~errno." -"ECHILD`。" +"當子行程上的操作失敗時會引發此例外。對應" +"到 :c:data:`errno` :py:const:`~errno.ECHILD`。" -#: ../../library/exceptions.rst:725 +#: ../../library/exceptions.rst:729 msgid "A base class for connection-related issues." msgstr "連線相關問題的基礎類別。" -#: ../../library/exceptions.rst:727 +#: ../../library/exceptions.rst:731 msgid "" -"Subclasses are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" -"`ConnectionRefusedError` and :exc:`ConnectionResetError`." +"Subclasses " +"are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:`ConnectionRefusedError` " +"and :exc:`ConnectionResetError`." msgstr "" -"子類別有 :exc:`BrokenPipeError`、:exc:`ConnectionAbortedError`、:exc:" -"`ConnectionRefusedError` 及 :exc:`ConnectionResetError`。" +"子類別" +"有 :exc:`BrokenPipeError`、:exc:`ConnectionAbortedError`、:exc:`ConnectionRefusedError` " +"及 :exc:`ConnectionResetError`。" -#: ../../library/exceptions.rst:732 +#: ../../library/exceptions.rst:736 msgid "" "A subclass of :exc:`ConnectionError`, raised when trying to write on a pipe " "while the other end has been closed, or trying to write on a socket which " -"has been shutdown for writing. Corresponds to :c:data:`errno` :py:const:" -"`~errno.EPIPE` and :py:const:`~errno.ESHUTDOWN`." +"has been shutdown for writing. Corresponds " +"to :c:data:`errno` :py:const:`~errno.EPIPE` and :py:const:`~errno.ESHUTDOWN`." msgstr "" ":exc:`ConnectionError` 的子類別,當嘗試寫入管道 (pipe) 同時另一端已經被關閉時" -"會引發此例外,或者當嘗試寫入已關閉寫入的 socket 時也會引發。對應到 :c:data:" -"`errno` :py:const:`~errno.EPIPE` 及 :py:const:`~errno.ESHUTDOWN`。" +"會引發此例外,或者當嘗試寫入已關閉寫入的 socket 時也會引發。對應" +"到 :c:data:`errno` :py:const:`~errno.EPIPE` 及 :py:const:`~errno.ESHUTDOWN`。" -#: ../../library/exceptions.rst:739 +#: ../../library/exceptions.rst:743 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " -"aborted by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." -"ECONNABORTED`." +"aborted by the peer. Corresponds " +"to :c:data:`errno` :py:const:`~errno.ECONNABORTED`." msgstr "" ":exc:`ConnectionError` 的子類別。當一個連線的嘗試被對等端點 (peer) 中斷時會引" "發此例外。對應到 :c:data:`errno` :py:const:`~errno.ECONNABORTED`。" -#: ../../library/exceptions.rst:745 +#: ../../library/exceptions.rst:749 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " -"refused by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." -"ECONNREFUSED`." +"refused by the peer. Corresponds " +"to :c:data:`errno` :py:const:`~errno.ECONNREFUSED`." msgstr "" ":exc:`ConnectionError` 的子類別。當一個連線的嘗試被對等端點拒絕時會引發此例" "外。對應到 :c:data:`errno` :py:const:`~errno.ECONNREFUSED`。" -#: ../../library/exceptions.rst:751 +#: ../../library/exceptions.rst:755 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection is reset by " "the peer. Corresponds to :c:data:`errno` :py:const:`~errno.ECONNRESET`." @@ -1127,146 +1145,146 @@ msgstr "" ":exc:`ConnectionError` 的子類別。當一個連線被對等端點重置時會引發此例外。對應" "到 :c:data:`errno` :py:const:`~errno.ECONNRESET`。" -#: ../../library/exceptions.rst:757 +#: ../../library/exceptions.rst:761 msgid "" "Raised when trying to create a file or directory which already exists. " "Corresponds to :c:data:`errno` :py:const:`~errno.EEXIST`." msgstr "" -"當嘗試建立已存在的檔案或目錄時會引發此例外。對應到 :c:data:`errno` :py:const:" -"`~errno.EEXIST`。" +"當嘗試建立已存在的檔案或目錄時會引發此例外。對應" +"到 :c:data:`errno` :py:const:`~errno.EEXIST`。" -#: ../../library/exceptions.rst:762 +#: ../../library/exceptions.rst:766 msgid "" "Raised when a file or directory is requested but doesn't exist. Corresponds " "to :c:data:`errno` :py:const:`~errno.ENOENT`." msgstr "" -"當請求不存在的檔案或目錄時會引發此例外。對應到 :c:data:`errno` :py:const:" -"`~errno.ENOENT`。" +"當請求不存在的檔案或目錄時會引發此例外。對應" +"到 :c:data:`errno` :py:const:`~errno.ENOENT`。" -#: ../../library/exceptions.rst:767 +#: ../../library/exceptions.rst:771 msgid "" "Raised when a system call is interrupted by an incoming signal. Corresponds " "to :c:data:`errno` :py:const:`~errno.EINTR`." msgstr "" -"當系統呼叫被傳入的信號中斷時會引發此例外。對應到 :c:data:`errno` :py:const:" -"`~errno.EINTR`。" +"當系統呼叫被傳入的信號中斷時會引發此例外。對應" +"到 :c:data:`errno` :py:const:`~errno.EINTR`。" -#: ../../library/exceptions.rst:770 +#: ../../library/exceptions.rst:774 msgid "" "Python now retries system calls when a syscall is interrupted by a signal, " "except if the signal handler raises an exception (see :pep:`475` for the " "rationale), instead of raising :exc:`InterruptedError`." msgstr "" -"現在當 syscall 被信號中斷時 Python 會重試系統呼叫而不會引發 :exc:" -"`InterruptedError`,除非信號處理器引發例外(理由可參考 :pep:`475`)。" +"現在當 syscall 被信號中斷時 Python 會重試系統呼叫而不會引" +"發 :exc:`InterruptedError`,除非信號處理器引發例外(理由可參考 :pep:`475`)。" -#: ../../library/exceptions.rst:777 +#: ../../library/exceptions.rst:781 msgid "" "Raised when a file operation (such as :func:`os.remove`) is requested on a " "directory. Corresponds to :c:data:`errno` :py:const:`~errno.EISDIR`." msgstr "" -"當在目錄上請求檔案操作(例如 :func:`os.remove`)時會引發此例外。對應到 :c:" -"data:`errno` :py:const:`~errno.EISDIR`。" +"當在目錄上請求檔案操作(例如 :func:`os.remove`)時會引發此例外。對應" +"到 :c:data:`errno` :py:const:`~errno.EISDIR`。" -#: ../../library/exceptions.rst:783 +#: ../../library/exceptions.rst:787 msgid "" "Raised when a directory operation (such as :func:`os.listdir`) is requested " "on something which is not a directory. On most POSIX platforms, it may also " "be raised if an operation attempts to open or traverse a non-directory file " -"as if it were a directory. Corresponds to :c:data:`errno` :py:const:`~errno." -"ENOTDIR`." +"as if it were a directory. Corresponds " +"to :c:data:`errno` :py:const:`~errno.ENOTDIR`." msgstr "" "當在某個不是目錄的東西上請求目錄操作(例如 :func:`os.listdir`)時會引發此例" "外。在大多數的 POSIX 平台上,如果嘗試操作開啟或遍歷一個當作目錄的非目錄檔案也" "會引發此例外。對應到 :c:data:`errno` :py:const:`~errno.ENOTDIR`。" -#: ../../library/exceptions.rst:791 +#: ../../library/exceptions.rst:795 msgid "" "Raised when trying to run an operation without the adequate access rights - " -"for example filesystem permissions. Corresponds to :c:data:`errno` :py:const:" -"`~errno.EACCES`, :py:const:`~errno.EPERM`, and :py:const:`~errno." -"ENOTCAPABLE`." +"for example filesystem permissions. Corresponds " +"to :c:data:`errno` :py:const:`~errno.EACCES`, :py:const:`~errno.EPERM`, " +"and :py:const:`~errno.ENOTCAPABLE`." msgstr "" "當嘗試執行一個沒有合乎存取權限的操作時會引發此例外 — 例如檔案系統權限。對應" -"到 :c:data:`errno` :py:const:`~errno.EACCES`、:py:const:`~errno.EPERM` 及 :" -"py:const:`~errno.ENOTCAPABLE`。" +"到 :c:data:`errno` :py:const:`~errno.EACCES`、:py:const:`~errno.EPERM` " +"及 :py:const:`~errno.ENOTCAPABLE`。" -#: ../../library/exceptions.rst:796 +#: ../../library/exceptions.rst:800 msgid "" -"WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to :exc:" -"`PermissionError`." +"WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped " +"to :exc:`PermissionError`." msgstr "" "WASI 的 :py:const:`~errno.ENOTCAPABLE` 現在對應到 :exc:`PermissionError`。" -#: ../../library/exceptions.rst:802 +#: ../../library/exceptions.rst:806 msgid "" -"Raised when a given process doesn't exist. Corresponds to :c:data:`errno` :" -"py:const:`~errno.ESRCH`." +"Raised when a given process doesn't exist. Corresponds " +"to :c:data:`errno` :py:const:`~errno.ESRCH`." msgstr "" -"當給定的行程不存在時會引發此例外。對應到 :c:data:`errno` :py:const:`~errno." -"ESRCH`。" +"當給定的行程不存在時會引發此例外。對應" +"到 :c:data:`errno` :py:const:`~errno.ESRCH`。" -#: ../../library/exceptions.rst:807 +#: ../../library/exceptions.rst:811 msgid "" -"Raised when a system function timed out at the system level. Corresponds to :" -"c:data:`errno` :py:const:`~errno.ETIMEDOUT`." +"Raised when a system function timed out at the system level. Corresponds " +"to :c:data:`errno` :py:const:`~errno.ETIMEDOUT`." msgstr "" -"當系統函式在系統層級超時會引發此例外。對應到 :c:data:`errno` :py:const:" -"`~errno.ETIMEDOUT`。" +"當系統函式在系統層級超時會引發此例外。對應" +"到 :c:data:`errno` :py:const:`~errno.ETIMEDOUT`。" -#: ../../library/exceptions.rst:810 +#: ../../library/exceptions.rst:814 msgid "All the above :exc:`OSError` subclasses were added." msgstr "加入以上所有的 :exc:`OSError` 子類別。" -#: ../../library/exceptions.rst:816 +#: ../../library/exceptions.rst:820 msgid ":pep:`3151` - Reworking the OS and IO exception hierarchy" msgstr ":pep:`3151` — 改寫作業系統與 IO 例外階層" -#: ../../library/exceptions.rst:822 +#: ../../library/exceptions.rst:826 msgid "Warnings" msgstr "警告" -#: ../../library/exceptions.rst:824 +#: ../../library/exceptions.rst:828 msgid "" -"The following exceptions are used as warning categories; see the :ref:" -"`warning-categories` documentation for more details." +"The following exceptions are used as warning categories; see " +"the :ref:`warning-categories` documentation for more details." msgstr "" "以下的例外是當作警告的種類使用;更多細節參考 :ref:`warning-categories` 文件。" -#: ../../library/exceptions.rst:829 +#: ../../library/exceptions.rst:833 msgid "Base class for warning categories." msgstr "警告種類的基礎類別。" -#: ../../library/exceptions.rst:834 +#: ../../library/exceptions.rst:838 msgid "Base class for warnings generated by user code." msgstr "使用者程式碼產生的警告的基礎類別。" -#: ../../library/exceptions.rst:839 +#: ../../library/exceptions.rst:843 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for other Python developers." msgstr "關於已棄用功能的警告的基礎類別,且當那些警告是針對其他 Python 開發者。" -#: ../../library/exceptions.rst:842 +#: ../../library/exceptions.rst:846 msgid "" -"Ignored by the default warning filters, except in the ``__main__`` module (:" -"pep:`565`). Enabling the :ref:`Python Development Mode ` shows this " -"warning." +"Ignored by the default warning filters, except in the ``__main__`` module " +"(:pep:`565`). Enabling the :ref:`Python Development Mode ` shows " +"this warning." msgstr "" -"會被預設的警告過濾器忽略,在 ``__main__`` 模組裡除外 (:pep:`565`)。啟用 :ref:" -"`Python 開發模式 `\\ 會顯示此警告。" +"會被預設的警告過濾器忽略,在 ``__main__`` 模組裡除外 (:pep:`565`)。啟" +"用 :ref:`Python 開發模式 `\\ 會顯示此警告。" -#: ../../library/exceptions.rst:846 ../../library/exceptions.rst:862 +#: ../../library/exceptions.rst:850 ../../library/exceptions.rst:866 msgid "The deprecation policy is described in :pep:`387`." msgstr "棄用原則描述在 :pep:`387` 裡。" -#: ../../library/exceptions.rst:851 +#: ../../library/exceptions.rst:855 msgid "" "Base class for warnings about features which are obsolete and expected to be " "deprecated in the future, but are not deprecated at the moment." msgstr "關於過時且預期未來要被棄用,但目前尚未被棄用的功能的警告的基礎類別。" -#: ../../library/exceptions.rst:855 +#: ../../library/exceptions.rst:859 msgid "" "This class is rarely used as emitting a warning about a possible upcoming " "deprecation is unusual, and :exc:`DeprecationWarning` is preferred for " @@ -1275,8 +1293,8 @@ msgstr "" "因為發出關於可能即將被棄用的警告是不尋常的,此類別很少被使用,而對已經被棄用" "的情況會優先使用 :exc:`DeprecationWarning`。" -#: ../../library/exceptions.rst:859 ../../library/exceptions.rst:885 -#: ../../library/exceptions.rst:912 +#: ../../library/exceptions.rst:863 ../../library/exceptions.rst:889 +#: ../../library/exceptions.rst:916 msgid "" "Ignored by the default warning filters. Enabling the :ref:`Python " "Development Mode ` shows this warning." @@ -1284,15 +1302,15 @@ msgstr "" "會被預設的警告過濾器忽略。啟用 :ref:`Python 開發模式 `\\ 會顯示此警" "告。" -#: ../../library/exceptions.rst:867 +#: ../../library/exceptions.rst:871 msgid "Base class for warnings about dubious syntax." msgstr "關於可疑語法的警告的基礎類別。" -#: ../../library/exceptions.rst:872 +#: ../../library/exceptions.rst:876 msgid "Base class for warnings about dubious runtime behavior." msgstr "關於可疑執行環境行為的警告的基礎類別。" -#: ../../library/exceptions.rst:877 +#: ../../library/exceptions.rst:881 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for end users of applications that are written in Python." @@ -1300,36 +1318,36 @@ msgstr "" "關於已棄用功能的警告的基礎類別,且當那些警告是針對以 Python 寫的應用程式的終" "端使用者。" -#: ../../library/exceptions.rst:883 +#: ../../library/exceptions.rst:887 msgid "Base class for warnings about probable mistakes in module imports." msgstr "關於在模組引入的可能錯誤的警告的基礎類別。" -#: ../../library/exceptions.rst:891 +#: ../../library/exceptions.rst:895 msgid "Base class for warnings related to Unicode." msgstr "Unicode 相關警告的基礎類別。" -#: ../../library/exceptions.rst:896 +#: ../../library/exceptions.rst:900 msgid "Base class for warnings related to encodings." msgstr "編碼相關警告的基礎類別。" -#: ../../library/exceptions.rst:898 +#: ../../library/exceptions.rst:902 msgid "See :ref:`io-encoding-warning` for details." msgstr "細節參考\\ :ref:`io-encoding-warning`。" -#: ../../library/exceptions.rst:905 +#: ../../library/exceptions.rst:909 msgid "" "Base class for warnings related to :class:`bytes` and :class:`bytearray`." msgstr ":class:`bytes` 及 :class:`bytearray` 相關警告的基礎類別。" -#: ../../library/exceptions.rst:910 +#: ../../library/exceptions.rst:914 msgid "Base class for warnings related to resource usage." msgstr "資源用法相關警告的基礎類別。" -#: ../../library/exceptions.rst:921 +#: ../../library/exceptions.rst:925 msgid "Exception groups" msgstr "例外群組" -#: ../../library/exceptions.rst:923 +#: ../../library/exceptions.rst:927 msgid "" "The following are used when it is necessary to raise multiple unrelated " "exceptions. They are part of the exception hierarchy so they can be handled " @@ -1341,46 +1359,48 @@ msgstr "" "所有其他例外一樣使用 :keyword:`except` 來處理。此外,它們會以包含的例外型別為" "基礎來比對其子群組而被 :keyword:`except*` 辨認出來。" -#: ../../library/exceptions.rst:932 +#: ../../library/exceptions.rst:936 msgid "" "Both of these exception types wrap the exceptions in the sequence ``excs``. " "The ``msg`` parameter must be a string. The difference between the two " "classes is that :exc:`BaseExceptionGroup` extends :exc:`BaseException` and " -"it can wrap any exception, while :exc:`ExceptionGroup` extends :exc:" -"`Exception` and it can only wrap subclasses of :exc:`Exception`. This design " -"is so that ``except Exception`` catches an :exc:`ExceptionGroup` but not :" -"exc:`BaseExceptionGroup`." +"it can wrap any exception, while :exc:`ExceptionGroup` " +"extends :exc:`Exception` and it can only wrap subclasses " +"of :exc:`Exception`. This design is so that ``except Exception`` catches " +"an :exc:`ExceptionGroup` but not :exc:`BaseExceptionGroup`." msgstr "" "這兩個例外型別都將例外包裝在序列 ``excs`` 中。``msg`` 參數必須是字串。這兩個" "類別的差異是 :exc:`BaseExceptionGroup` 擴充了 :exc:`BaseException` 且可以包裝" -"任何例外,而 :exc:`ExceptionGroup` 擴充了 :exc:`Exception` 且只能包裝 :exc:" -"`Exception` 的子類別。這個設計使得 ``except Exception`` 可以捕捉 :exc:" -"`ExceptionGroup` 但不能捕捉 :exc:`BaseExceptionGroup`。" +"任何例外,而 :exc:`ExceptionGroup` 擴充了 :exc:`Exception` 且只能包" +"裝 :exc:`Exception` 的子類別。這個設計使得 ``except Exception`` 可以捕" +"捉 :exc:`ExceptionGroup` 但不能捕捉 :exc:`BaseExceptionGroup`。" -#: ../../library/exceptions.rst:940 +#: ../../library/exceptions.rst:944 msgid "" "The :exc:`BaseExceptionGroup` constructor returns an :exc:`ExceptionGroup` " -"rather than a :exc:`BaseExceptionGroup` if all contained exceptions are :exc:" -"`Exception` instances, so it can be used to make the selection automatic. " -"The :exc:`ExceptionGroup` constructor, on the other hand, raises a :exc:" -"`TypeError` if any contained exception is not an :exc:`Exception` subclass." +"rather than a :exc:`BaseExceptionGroup` if all contained exceptions " +"are :exc:`Exception` instances, so it can be used to make the selection " +"automatic. The :exc:`ExceptionGroup` constructor, on the other hand, raises " +"a :exc:`TypeError` if any contained exception is not an :exc:`Exception` " +"subclass." msgstr "" "如果所有包含的例外都是 :exc:`Exception` 實例,:exc:`BaseExceptionGroup` 建構" "函式會回傳 :exc:`ExceptionGroup` 而不是 :exc:`BaseExceptionGroup`,因此可以被" -"使用來讓這樣的選擇自動化。另一方面來說,如果任何包含的例外不是 :exc:" -"`Exception` 的子類別,:exc:`ExceptionGroup` 建構函式會引發 :exc:`TypeError`。" +"使用來讓這樣的選擇自動化。另一方面來說,如果任何包含的例外不" +"是 :exc:`Exception` 的子類別,:exc:`ExceptionGroup` 建構函式會引" +"發 :exc:`TypeError`。" -#: ../../library/exceptions.rst:949 +#: ../../library/exceptions.rst:953 msgid "The ``msg`` argument to the constructor. This is a read-only attribute." msgstr "建構函式的 ``msg`` 引數。這是一個唯讀的屬性。" -#: ../../library/exceptions.rst:953 +#: ../../library/exceptions.rst:957 msgid "" "A tuple of the exceptions in the ``excs`` sequence given to the constructor. " "This is a read-only attribute." msgstr "指定給建構函式 ``excs`` 序列中的例外組成的元組。這是一個唯讀的屬性。" -#: ../../library/exceptions.rst:958 +#: ../../library/exceptions.rst:962 msgid "" "Returns an exception group that contains only the exceptions from the " "current group that match *condition*, or ``None`` if the result is empty." @@ -1388,7 +1408,7 @@ msgstr "" "回傳只包含從現有群組比對到 *condition* 的例外的例外群組,或者當結果為空時回" "傳 ``None``。" -#: ../../library/exceptions.rst:961 +#: ../../library/exceptions.rst:965 msgid "" "The condition can be an exception type or tuple of exception types, in which " "case each exception is checked for a match using the same check that is used " @@ -1401,20 +1421,20 @@ msgstr "" "物件(除了型別物件之外),其接受一個例外作為單一引數,而如果該例外應該在子群" "組中就回傳 true。" -#: ../../library/exceptions.rst:967 +#: ../../library/exceptions.rst:971 msgid "" "The nesting structure of the current exception is preserved in the result, " -"as are the values of its :attr:`message`, :attr:`~BaseException." -"__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException." -"__context__` and :attr:`~BaseException.__notes__` fields. Empty nested " -"groups are omitted from the result." +"as are the values of " +"its :attr:`message`, :attr:`~BaseException.__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException.__context__` " +"and :attr:`~BaseException.__notes__` fields. Empty nested groups are omitted " +"from the result." msgstr "" -"現有例外的巢狀結構會保留在結果裡,其 :attr:`message`、:attr:`~BaseException." -"__traceback__`、:attr:`~BaseException.__cause__`、:attr:`~BaseException." -"__context__` 及 :attr:`~BaseException.__notes__` 欄位的值也一樣。空的巢狀群組" -"會從結果裡排除。" +"現有例外的巢狀結構會保留在結果裡," +"其 :attr:`message`、:attr:`~BaseException.__traceback__`、:attr:`~BaseException.__cause__`、:attr:`~BaseException.__context__` " +"及 :attr:`~BaseException.__notes__` 欄位的值也一樣。空的巢狀群組會從結果裡排" +"除。" -#: ../../library/exceptions.rst:974 +#: ../../library/exceptions.rst:978 msgid "" "The condition is checked for all exceptions in the nested exception group, " "including the top-level and any nested exception groups. If the condition is " @@ -1423,11 +1443,11 @@ msgstr "" "條件會對巢狀例外群組裡的所有例外做檢查,包括頂層及任何巢狀的例外群組。如果條" "件對這樣的例外群組為 true,它會被完整包含在結果裡。" -#: ../../library/exceptions.rst:978 +#: ../../library/exceptions.rst:982 msgid "``condition`` can be any callable which is not a type object." msgstr "``condition`` 可以是任何不是型別物件的可呼叫物件。" -#: ../../library/exceptions.rst:983 +#: ../../library/exceptions.rst:987 msgid "" "Like :meth:`subgroup`, but returns the pair ``(match, rest)`` where " "``match`` is ``subgroup(condition)`` and ``rest`` is the remaining non-" @@ -1436,13 +1456,13 @@ msgstr "" "像 :meth:`subgroup` 一樣,但回傳一對 ``(match, rest)``,其中 ``match`` 是 " "``subgroup(condition)`` 而 ``rest`` 是剩下沒有比對到的部分。" -#: ../../library/exceptions.rst:989 +#: ../../library/exceptions.rst:993 msgid "" "Returns an exception group with the same :attr:`message`, but which wraps " "the exceptions in ``excs``." msgstr "回傳有相同 :attr:`message` 但將例外包裝在 ``excs`` 的例外群組。" -#: ../../library/exceptions.rst:992 +#: ../../library/exceptions.rst:996 msgid "" "This method is used by :meth:`subgroup` and :meth:`split`, which are used in " "various contexts to break up an exception group. A subclass needs to " @@ -1450,23 +1470,23 @@ msgid "" "instances of the subclass rather than :exc:`ExceptionGroup`." msgstr "" "此方法被 :meth:`subgroup` 及 :meth:`split` 使用,被用來在各種情境下拆分例外群" -"組。子類別需要覆寫它來讓 :meth:`subgroup` 及 :meth:`split` 回傳子類別而不是 :" -"exc:`ExceptionGroup` 的實例。" +"組。子類別需要覆寫它來讓 :meth:`subgroup` 及 :meth:`split` 回傳子類別而不" +"是 :exc:`ExceptionGroup` 的實例。" -#: ../../library/exceptions.rst:998 +#: ../../library/exceptions.rst:1002 msgid "" -":meth:`subgroup` and :meth:`split` copy the :attr:`~BaseException." -"__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException." -"__context__` and :attr:`~BaseException.__notes__` fields from the original " -"exception group to the one returned by :meth:`derive`, so these fields do " -"not need to be updated by :meth:`derive`." +":meth:`subgroup` and :meth:`split` copy " +"the :attr:`~BaseException.__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException.__context__` " +"and :attr:`~BaseException.__notes__` fields from the original exception " +"group to the one returned by :meth:`derive`, so these fields do not need to " +"be updated by :meth:`derive`." msgstr "" -":meth:`subgroup` 及 :meth:`split` 會從原始的例外群組複製 :attr:" -"`~BaseException.__traceback__`、:attr:`~BaseException.__cause__`、:attr:" -"`~BaseException.__context__` 和 :attr:`~BaseException.__notes__` 欄位到 :" -"meth:`derive` 所回傳的例外群組上,因此這些欄位不需要被 :meth:`derive` 更新。" +":meth:`subgroup` 及 :meth:`split` 會從原始的例外群組複" +"製 :attr:`~BaseException.__traceback__`、:attr:`~BaseException.__cause__`、:attr:`~BaseException.__context__` " +"和 :attr:`~BaseException.__notes__` 欄位到 :meth:`derive` 所回傳的例外群組" +"上,因此這些欄位不需要被 :meth:`derive` 更新。" -#: ../../library/exceptions.rst:1005 +#: ../../library/exceptions.rst:1009 msgid "" ">>> class MyGroup(ExceptionGroup):\n" "... def derive(self, excs):\n" @@ -1520,7 +1540,7 @@ msgstr "" ">>> exc.__traceback__ is match.__traceback__ is rest.__traceback__\n" "True" -#: ../../library/exceptions.rst:1031 +#: ../../library/exceptions.rst:1035 msgid "" "Note that :exc:`BaseExceptionGroup` defines :meth:`~object.__new__`, so " "subclasses that need a different constructor signature need to override that " @@ -1532,7 +1552,7 @@ msgstr "" "建構函式簽名的子類別需要覆寫它而不是 :meth:`~object.__init__`。例如下面定義了" "一個例外群組子類別接受 exit_code 並從中建構群組的訊息。: ::" -#: ../../library/exceptions.rst:1037 +#: ../../library/exceptions.rst:1041 msgid "" "class Errors(ExceptionGroup):\n" " def __new__(cls, errors, exit_code):\n" @@ -1552,24 +1572,24 @@ msgstr "" " def derive(self, excs):\n" " return Errors(excs, self.exit_code)" -#: ../../library/exceptions.rst:1046 +#: ../../library/exceptions.rst:1050 msgid "" "Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which " -"is also a subclass of :exc:`Exception` can only wrap instances of :exc:" -"`Exception`." +"is also a subclass of :exc:`Exception` can only wrap instances " +"of :exc:`Exception`." msgstr "" "像 :exc:`ExceptionGroup` 一樣,任何 :exc:`BaseExceptionGroup` 的子類別且也" "是 :exc:`Exception` 的子類別只能包裝 :exc:`Exception` 的實例。" -#: ../../library/exceptions.rst:1054 +#: ../../library/exceptions.rst:1058 msgid "Exception hierarchy" msgstr "例外階層" -#: ../../library/exceptions.rst:1056 +#: ../../library/exceptions.rst:1060 msgid "The class hierarchy for built-in exceptions is:" msgstr "內建例外的類別階層如下:" -#: ../../library/exceptions.rst:1058 +#: ../../library/exceptions.rst:1062 msgid "" "BaseException\n" " ├── BaseExceptionGroup\n" diff --git a/library/fnmatch.po b/library/fnmatch.po index 345fd99a0a..75dd730a60 100644 --- a/library/fnmatch.po +++ b/library/fnmatch.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-01-15 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -90,12 +90,20 @@ msgstr "" #: ../../library/fnmatch.rst:49 msgid "" -"Also note that :func:`functools.lru_cache` with the *maxsize* of 32768 is " -"used to cache the compiled regex patterns in the following functions: :func:" -"`fnmatch`, :func:`fnmatchcase`, :func:`.filter`." +"Unless stated otherwise, \"filename string\" and \"pattern string\" either " +"refer to :class:`str` or ``ISO-8859-1`` encoded :class:`bytes` objects. Note " +"that the functions documented below do not allow to mix a :class:`!bytes` " +"pattern with a :class:`!str` filename, and vice-versa." msgstr "" -#: ../../library/fnmatch.rst:55 +#: ../../library/fnmatch.rst:54 +msgid "" +"Finally, note that :func:`functools.lru_cache` with a *maxsize* of 32768 is " +"used to cache the (typed) compiled regex patterns in the following " +"functions: :func:`fnmatch`, :func:`fnmatchcase`, :func:`.filter`." +msgstr "" + +#: ../../library/fnmatch.rst:61 msgid "" "Test whether the filename string *name* matches the pattern string *pat*, " "returning ``True`` or ``False``. Both parameters are case-normalized using :" @@ -104,13 +112,13 @@ msgid "" "operating system." msgstr "" -#: ../../library/fnmatch.rst:61 +#: ../../library/fnmatch.rst:67 msgid "" "This example will print all file names in the current directory with the " "extension ``.txt``::" msgstr "" -#: ../../library/fnmatch.rst:64 +#: ../../library/fnmatch.rst:70 msgid "" "import fnmatch\n" "import os\n" @@ -126,35 +134,35 @@ msgstr "" " if fnmatch.fnmatch(file, '*.txt'):\n" " print(file)" -#: ../../library/fnmatch.rst:74 +#: ../../library/fnmatch.rst:80 msgid "" "Test whether the filename string *name* matches the pattern string *pat*, " "returning ``True`` or ``False``; the comparison is case-sensitive and does " "not apply :func:`os.path.normcase`." msgstr "" -#: ../../library/fnmatch.rst:81 +#: ../../library/fnmatch.rst:87 msgid "" -"Construct a list from those elements of the :term:`iterable` *names* that " -"match pattern *pat*. It is the same as ``[n for n in names if fnmatch(n, " -"pat)]``, but implemented more efficiently." +"Construct a list from those elements of the :term:`iterable` of filename " +"strings *names* that match the pattern string *pat*. It is the same as ``[n " +"for n in names if fnmatch(n, pat)]``, but implemented more efficiently." msgstr "" -#: ../../library/fnmatch.rst:89 +#: ../../library/fnmatch.rst:95 msgid "" "Return the shell-style pattern *pat* converted to a regular expression for " -"using with :func:`re.match`." +"using with :func:`re.match`. The pattern is expected to be a :class:`str`." msgstr "" -#: ../../library/fnmatch.rst:92 +#: ../../library/fnmatch.rst:98 msgid "Example:" msgstr "範例:" -#: ../../library/fnmatch.rst:106 +#: ../../library/fnmatch.rst:112 msgid "Module :mod:`glob`" msgstr ":mod:`glob` 模組" -#: ../../library/fnmatch.rst:107 +#: ../../library/fnmatch.rst:113 msgid "Unix shell-style path expansion." msgstr "" diff --git a/library/importlib.metadata.po b/library/importlib.metadata.po index 3f925524cf..16d9154e59 100644 --- a/library/importlib.metadata.po +++ b/library/importlib.metadata.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-23 00:14+0000\n" +"POT-Creation-Date: 2025-02-05 00:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -595,7 +595,7 @@ msgstr "" #: ../../library/importlib.metadata.rst:377 msgid "" "Return a mapping from the top level module and import package names found " -"via :attr:`sys.meta_path` to the names of the distribution packages (if any) " +"via :data:`sys.meta_path` to the names of the distribution packages (if any) " "that provide the corresponding files." msgstr "" diff --git a/library/importlib.po b/library/importlib.po index abe935981e..bdfc300dcf 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2025-02-05 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -574,19 +574,23 @@ msgid "" "implemented." msgstr "" -#: ../../library/importlib.rst:383 +#: ../../library/importlib.rst:383 ../../library/importlib.rst:631 +msgid "*Superseded by TraversableResources*" +msgstr "" + +#: ../../library/importlib.rst:385 msgid "" "An abstract base class for a :term:`loader` which implements the optional :" "pep:`302` protocol for loading arbitrary resources from the storage back-end." msgstr "" -#: ../../library/importlib.rst:387 +#: ../../library/importlib.rst:389 msgid "" "This ABC is deprecated in favour of supporting resource loading through :" -"class:`importlib.resources.abc.ResourceReader`." +"class:`importlib.resources.abc.TraversableResources`." msgstr "" -#: ../../library/importlib.rst:393 +#: ../../library/importlib.rst:395 msgid "" "An abstract method to return the bytes for the data located at *path*. " "Loaders that have a file-like storage back-end that allows storing arbitrary " @@ -596,34 +600,34 @@ msgid "" "__file__` attribute or an item from a package's :attr:`~module.__path__`." msgstr "" -#: ../../library/importlib.rst:402 +#: ../../library/importlib.rst:404 msgid "Raises :exc:`OSError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:408 +#: ../../library/importlib.rst:410 msgid "" "An abstract base class for a :term:`loader` which implements the optional :" "pep:`302` protocol for loaders that inspect modules." msgstr "" -#: ../../library/importlib.rst:413 +#: ../../library/importlib.rst:415 msgid "" "Return the code object for a module, or ``None`` if the module does not have " "a code object (as would be the case, for example, for a built-in module). " "Raise an :exc:`ImportError` if loader cannot find the requested module." msgstr "" -#: ../../library/importlib.rst:419 +#: ../../library/importlib.rst:421 msgid "" "While the method has a default implementation, it is suggested that it be " "overridden if possible for performance." msgstr "" -#: ../../library/importlib.rst:425 +#: ../../library/importlib.rst:427 msgid "No longer abstract and a concrete implementation is provided." msgstr "" -#: ../../library/importlib.rst:430 +#: ../../library/importlib.rst:432 msgid "" "An abstract method to return the source of a module. It is returned as a " "text string using :term:`universal newlines`, translating all recognized " @@ -632,23 +636,23 @@ msgid "" "cannot find the module specified." msgstr "" -#: ../../library/importlib.rst:436 ../../library/importlib.rst:445 -#: ../../library/importlib.rst:495 +#: ../../library/importlib.rst:438 ../../library/importlib.rst:447 +#: ../../library/importlib.rst:497 msgid "Raises :exc:`ImportError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:441 +#: ../../library/importlib.rst:443 msgid "" "An optional method to return a true value if the module is a package, a " "false value otherwise. :exc:`ImportError` is raised if the :term:`loader` " "cannot find the module." msgstr "" -#: ../../library/importlib.rst:450 +#: ../../library/importlib.rst:452 msgid "Create a code object from Python source." msgstr "" -#: ../../library/importlib.rst:452 +#: ../../library/importlib.rst:454 msgid "" "The *data* argument can be whatever the :func:`compile` function supports (i." "e. string or bytes). The *path* argument should be the \"path\" to where the " @@ -656,107 +660,107 @@ msgid "" "in a zip file)." msgstr "" -#: ../../library/importlib.rst:457 +#: ../../library/importlib.rst:459 msgid "" "With the subsequent code object one can execute it in a module by running " "``exec(code, module.__dict__)``." msgstr "" -#: ../../library/importlib.rst:462 +#: ../../library/importlib.rst:464 msgid "Made the method static." msgstr "" -#: ../../library/importlib.rst:467 +#: ../../library/importlib.rst:469 msgid "Implementation of :meth:`Loader.exec_module`." msgstr ":meth:`Loader.exec_module` 的實作。" -#: ../../library/importlib.rst:473 +#: ../../library/importlib.rst:475 msgid "Implementation of :meth:`Loader.load_module`." msgstr ":meth:`Loader.load_module` 的實作。" -#: ../../library/importlib.rst:475 +#: ../../library/importlib.rst:477 msgid "use :meth:`exec_module` instead." msgstr "請改用 :meth:`exec_module`。" -#: ../../library/importlib.rst:481 +#: ../../library/importlib.rst:483 msgid "" "An abstract base class which inherits from :class:`InspectLoader` that, when " "implemented, helps a module to be executed as a script. The ABC represents " "an optional :pep:`302` protocol." msgstr "" -#: ../../library/importlib.rst:487 +#: ../../library/importlib.rst:489 msgid "" "An abstract method that is to return the value of :attr:`~module.__file__` " "for the specified module. If no path is available, :exc:`ImportError` is " "raised." msgstr "" -#: ../../library/importlib.rst:491 +#: ../../library/importlib.rst:493 msgid "" "If source code is available, then the method should return the path to the " "source file, regardless of whether a bytecode was used to load the module." msgstr "" -#: ../../library/importlib.rst:501 +#: ../../library/importlib.rst:503 msgid "" "An abstract base class which inherits from :class:`ResourceLoader` and :" "class:`ExecutionLoader`, providing concrete implementations of :meth:" "`ResourceLoader.get_data` and :meth:`ExecutionLoader.get_filename`." msgstr "" -#: ../../library/importlib.rst:505 +#: ../../library/importlib.rst:507 msgid "" "The *fullname* argument is a fully resolved name of the module the loader is " "to handle. The *path* argument is the path to the file for the module." msgstr "" -#: ../../library/importlib.rst:512 +#: ../../library/importlib.rst:514 msgid "The name of the module the loader can handle." msgstr "" -#: ../../library/importlib.rst:516 +#: ../../library/importlib.rst:518 msgid "Path to the file of the module." msgstr "" -#: ../../library/importlib.rst:520 +#: ../../library/importlib.rst:522 msgid "Calls super's ``load_module()``." msgstr "" -#: ../../library/importlib.rst:522 +#: ../../library/importlib.rst:524 msgid "Use :meth:`Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:527 ../../library/importlib.rst:1122 +#: ../../library/importlib.rst:529 ../../library/importlib.rst:1124 msgid "Returns :attr:`path`." msgstr "" -#: ../../library/importlib.rst:531 +#: ../../library/importlib.rst:533 msgid "Reads *path* as a binary file and returns the bytes from it." msgstr "" -#: ../../library/importlib.rst:536 +#: ../../library/importlib.rst:538 msgid "" "An abstract base class for implementing source (and optionally bytecode) " "file loading. The class inherits from both :class:`ResourceLoader` and :" "class:`ExecutionLoader`, requiring the implementation of:" msgstr "" -#: ../../library/importlib.rst:540 +#: ../../library/importlib.rst:542 msgid ":meth:`ResourceLoader.get_data`" msgstr ":meth:`ResourceLoader.get_data`" -#: ../../library/importlib.rst:541 +#: ../../library/importlib.rst:543 msgid ":meth:`ExecutionLoader.get_filename`" msgstr ":meth:`ExecutionLoader.get_filename`" -#: ../../library/importlib.rst:542 +#: ../../library/importlib.rst:544 msgid "" "Should only return the path to the source file; sourceless loading is not " "supported." msgstr "" -#: ../../library/importlib.rst:545 +#: ../../library/importlib.rst:547 msgid "" "The abstract methods defined by this class are to add optional bytecode file " "support. Not implementing these optional methods (or causing them to raise :" @@ -768,83 +772,83 @@ msgid "" "bytecode-specific API is exposed." msgstr "" -#: ../../library/importlib.rst:556 +#: ../../library/importlib.rst:558 msgid "" "Optional abstract method which returns a :class:`dict` containing metadata " "about the specified path. Supported dictionary keys are:" msgstr "" -#: ../../library/importlib.rst:559 +#: ../../library/importlib.rst:561 msgid "" "``'mtime'`` (mandatory): an integer or floating-point number representing " "the modification time of the source code;" msgstr "" -#: ../../library/importlib.rst:561 +#: ../../library/importlib.rst:563 msgid "``'size'`` (optional): the size in bytes of the source code." msgstr "" -#: ../../library/importlib.rst:563 +#: ../../library/importlib.rst:565 msgid "" "Any other keys in the dictionary are ignored, to allow for future " "extensions. If the path cannot be handled, :exc:`OSError` is raised." msgstr "" -#: ../../library/importlib.rst:568 ../../library/importlib.rst:581 +#: ../../library/importlib.rst:570 ../../library/importlib.rst:583 msgid "Raise :exc:`OSError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:573 +#: ../../library/importlib.rst:575 msgid "" "Optional abstract method which returns the modification time for the " "specified path." msgstr "" -#: ../../library/importlib.rst:576 +#: ../../library/importlib.rst:578 msgid "" "This method is deprecated in favour of :meth:`path_stats`. You don't have " "to implement it, but it is still available for compatibility purposes. " "Raise :exc:`OSError` if the path cannot be handled." msgstr "" -#: ../../library/importlib.rst:586 +#: ../../library/importlib.rst:588 msgid "" "Optional abstract method which writes the specified bytes to a file path. " "Any intermediate directories which do not exist are to be created " "automatically." msgstr "" -#: ../../library/importlib.rst:590 +#: ../../library/importlib.rst:592 msgid "" "When writing to the path fails because the path is read-only (:const:`errno." "EACCES`/:exc:`PermissionError`), do not propagate the exception." msgstr "" -#: ../../library/importlib.rst:594 +#: ../../library/importlib.rst:596 msgid "No longer raises :exc:`NotImplementedError` when called." msgstr "" -#: ../../library/importlib.rst:599 +#: ../../library/importlib.rst:601 msgid "Concrete implementation of :meth:`InspectLoader.get_code`." msgstr "" -#: ../../library/importlib.rst:603 +#: ../../library/importlib.rst:605 msgid "Concrete implementation of :meth:`Loader.exec_module`." msgstr "" -#: ../../library/importlib.rst:609 +#: ../../library/importlib.rst:611 msgid "Concrete implementation of :meth:`Loader.load_module`." msgstr "" -#: ../../library/importlib.rst:611 +#: ../../library/importlib.rst:613 msgid "Use :meth:`exec_module` instead." msgstr "" -#: ../../library/importlib.rst:616 +#: ../../library/importlib.rst:618 msgid "Concrete implementation of :meth:`InspectLoader.get_source`." msgstr "" -#: ../../library/importlib.rst:620 +#: ../../library/importlib.rst:622 msgid "" "Concrete implementation of :meth:`InspectLoader.is_package`. A module is " "determined to be a package if its file path (as provided by :meth:" @@ -853,16 +857,12 @@ msgid "" "``__init__``." msgstr "" -#: ../../library/importlib.rst:629 -msgid "*Superseded by TraversableResources*" -msgstr "" - -#: ../../library/importlib.rst:631 +#: ../../library/importlib.rst:633 msgid "" "An :term:`abstract base class` to provide the ability to read *resources*." msgstr "" -#: ../../library/importlib.rst:634 +#: ../../library/importlib.rst:636 msgid "" "From the perspective of this ABC, a *resource* is a binary artifact that is " "shipped within a package. Typically this is something like a data file that " @@ -872,7 +872,7 @@ msgid "" "file versus on the file system." msgstr "" -#: ../../library/importlib.rst:642 +#: ../../library/importlib.rst:644 msgid "" "For any of methods of this class, a *resource* argument is expected to be a :" "term:`path-like object` which represents conceptually just a file name. This " @@ -884,7 +884,7 @@ msgid "" "potentially representing multiple packages or a module)." msgstr "" -#: ../../library/importlib.rst:653 +#: ../../library/importlib.rst:655 msgid "" "Loaders that wish to support resource reading are expected to provide a " "method called ``get_resource_reader(fullname)`` which returns an object " @@ -893,37 +893,37 @@ msgid "" "with this ABC should only be returned when the specified module is a package." msgstr "" -#: ../../library/importlib.rst:662 ../../library/importlib.rst:772 +#: ../../library/importlib.rst:664 ../../library/importlib.rst:774 msgid "Use :class:`importlib.resources.abc.TraversableResources` instead." msgstr "" -#: ../../library/importlib.rst:667 +#: ../../library/importlib.rst:669 msgid "" "Returns an opened, :term:`file-like object` for binary reading of the " "*resource*." msgstr "" -#: ../../library/importlib.rst:670 +#: ../../library/importlib.rst:672 msgid "If the resource cannot be found, :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/importlib.rst:675 +#: ../../library/importlib.rst:677 msgid "Returns the file system path to the *resource*." msgstr "" -#: ../../library/importlib.rst:677 +#: ../../library/importlib.rst:679 msgid "" "If the resource does not concretely exist on the file system, raise :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/importlib.rst:682 +#: ../../library/importlib.rst:684 msgid "" "Returns ``True`` if the named *name* is considered a resource. :exc:" "`FileNotFoundError` is raised if *name* does not exist." msgstr "" -#: ../../library/importlib.rst:687 +#: ../../library/importlib.rst:689 msgid "" "Returns an :term:`iterable` of strings over the contents of the package. Do " "note that it is not required that all names returned by the iterator be " @@ -931,7 +931,7 @@ msgid "" "`is_resource` would be false." msgstr "" -#: ../../library/importlib.rst:693 +#: ../../library/importlib.rst:695 msgid "" "Allowing non-resource names to be returned is to allow for situations where " "how a package and its resources are stored are known a priori and the non-" @@ -940,71 +940,71 @@ msgid "" "stored on the file system then those subdirectory names can be used directly." msgstr "" -#: ../../library/importlib.rst:701 +#: ../../library/importlib.rst:703 msgid "The abstract method returns an iterable of no items." msgstr "" -#: ../../library/importlib.rst:706 +#: ../../library/importlib.rst:708 msgid "" "An object with a subset of :class:`pathlib.Path` methods suitable for " "traversing directories and opening files." msgstr "" -#: ../../library/importlib.rst:709 +#: ../../library/importlib.rst:711 msgid "" "For a representation of the object on the file-system, use :meth:`importlib." "resources.as_file`." msgstr "" -#: ../../library/importlib.rst:714 +#: ../../library/importlib.rst:716 msgid "Use :class:`importlib.resources.abc.Traversable` instead." msgstr "" -#: ../../library/importlib.rst:719 +#: ../../library/importlib.rst:721 msgid "Abstract. The base name of this object without any parent references." msgstr "" -#: ../../library/importlib.rst:723 +#: ../../library/importlib.rst:725 msgid "Yield ``Traversable`` objects in ``self``." msgstr "" -#: ../../library/importlib.rst:727 +#: ../../library/importlib.rst:729 msgid "Return ``True`` if ``self`` is a directory." msgstr "" -#: ../../library/importlib.rst:731 +#: ../../library/importlib.rst:733 msgid "Return ``True`` if ``self`` is a file." msgstr "" -#: ../../library/importlib.rst:735 +#: ../../library/importlib.rst:737 msgid "Return Traversable child in ``self``." msgstr "" -#: ../../library/importlib.rst:739 +#: ../../library/importlib.rst:741 msgid "Return ``Traversable`` child in ``self``." msgstr "" -#: ../../library/importlib.rst:743 +#: ../../library/importlib.rst:745 msgid "" "*mode* may be 'r' or 'rb' to open as text or binary. Return a handle " "suitable for reading (same as :attr:`pathlib.Path.open`)." msgstr "" -#: ../../library/importlib.rst:746 +#: ../../library/importlib.rst:748 msgid "" "When opening as text, accepts encoding parameters such as those accepted by :" -"attr:`io.TextIOWrapper`." +"class:`io.TextIOWrapper`." msgstr "" -#: ../../library/importlib.rst:751 +#: ../../library/importlib.rst:753 msgid "Read contents of ``self`` as bytes." msgstr "" -#: ../../library/importlib.rst:755 +#: ../../library/importlib.rst:757 msgid "Read contents of ``self`` as text." msgstr "" -#: ../../library/importlib.rst:760 +#: ../../library/importlib.rst:762 msgid "" "An abstract base class for resource readers capable of serving the :meth:" "`importlib.resources.files` interface. Subclasses :class:`importlib." @@ -1014,71 +1014,71 @@ msgid "" "also supplies ResourceReader." msgstr "" -#: ../../library/importlib.rst:767 +#: ../../library/importlib.rst:769 msgid "" "Loaders that wish to support resource reading are expected to implement this " "interface." msgstr "" -#: ../../library/importlib.rst:777 +#: ../../library/importlib.rst:779 msgid "" "Returns a :class:`importlib.resources.abc.Traversable` object for the loaded " "package." msgstr "" -#: ../../library/importlib.rst:783 +#: ../../library/importlib.rst:785 msgid ":mod:`importlib.machinery` -- Importers and path hooks" msgstr "" -#: ../../library/importlib.rst:788 +#: ../../library/importlib.rst:790 msgid "**Source code:** :source:`Lib/importlib/machinery.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/machinery.py`" -#: ../../library/importlib.rst:792 +#: ../../library/importlib.rst:794 msgid "" "This module contains the various objects that help :keyword:`import` find " "and load modules." msgstr "" -#: ../../library/importlib.rst:797 +#: ../../library/importlib.rst:799 msgid "" "A list of strings representing the recognized file suffixes for source " "modules." msgstr "" -#: ../../library/importlib.rst:804 +#: ../../library/importlib.rst:806 msgid "" "A list of strings representing the file suffixes for non-optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:809 ../../library/importlib.rst:819 -msgid "Use :attr:`BYTECODE_SUFFIXES` instead." +#: ../../library/importlib.rst:811 ../../library/importlib.rst:821 +msgid "Use :const:`BYTECODE_SUFFIXES` instead." msgstr "" -#: ../../library/importlib.rst:814 +#: ../../library/importlib.rst:816 msgid "" "A list of strings representing the file suffixes for optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:824 +#: ../../library/importlib.rst:826 msgid "" "A list of strings representing the recognized file suffixes for bytecode " "modules (including the leading dot)." msgstr "" -#: ../../library/importlib.rst:829 +#: ../../library/importlib.rst:831 msgid "The value is no longer dependent on ``__debug__``." msgstr "" -#: ../../library/importlib.rst:834 +#: ../../library/importlib.rst:836 msgid "" "A list of strings representing the recognized file suffixes for extension " "modules." msgstr "" -#: ../../library/importlib.rst:841 +#: ../../library/importlib.rst:843 msgid "" "Returns a combined list of strings representing all file suffixes for " "modules recognized by the standard import machinery. This is a helper for " @@ -1087,57 +1087,57 @@ msgid "" "`inspect.getmodulename`)." msgstr "" -#: ../../library/importlib.rst:852 +#: ../../library/importlib.rst:854 msgid "" "An :term:`importer` for built-in modules. All known built-in modules are " "listed in :data:`sys.builtin_module_names`. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:857 ../../library/importlib.rst:871 -#: ../../library/importlib.rst:884 ../../library/importlib.rst:899 +#: ../../library/importlib.rst:859 ../../library/importlib.rst:873 +#: ../../library/importlib.rst:886 ../../library/importlib.rst:901 msgid "" "Only class methods are defined by this class to alleviate the need for " "instantiation." msgstr "" -#: ../../library/importlib.rst:860 +#: ../../library/importlib.rst:862 msgid "" "As part of :pep:`489`, the builtin importer now implements :meth:`Loader." "create_module` and :meth:`Loader.exec_module`" msgstr "" -#: ../../library/importlib.rst:867 +#: ../../library/importlib.rst:869 msgid "" "An :term:`importer` for frozen modules. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:874 +#: ../../library/importlib.rst:876 msgid "" "Gained :meth:`~Loader.create_module` and :meth:`~Loader.exec_module` methods." msgstr "" -#: ../../library/importlib.rst:881 +#: ../../library/importlib.rst:883 msgid "" ":term:`Finder ` for modules declared in the Windows registry. This " "class implements the :class:`importlib.abc.MetaPathFinder` ABC." msgstr "" -#: ../../library/importlib.rst:889 +#: ../../library/importlib.rst:891 msgid "" "Use :mod:`site` configuration instead. Future versions of Python may not " "enable this finder by default." msgstr "" -#: ../../library/importlib.rst:896 +#: ../../library/importlib.rst:898 msgid "" "A :term:`Finder ` for :data:`sys.path` and package ``__path__`` " "attributes. This class implements the :class:`importlib.abc.MetaPathFinder` " "ABC." msgstr "" -#: ../../library/importlib.rst:904 +#: ../../library/importlib.rst:906 msgid "" "Class method that attempts to find a :term:`spec ` for the " "module specified by *fullname* on :data:`sys.path` or, if defined, on " @@ -1151,43 +1151,43 @@ msgid "" "cache and returned." msgstr "" -#: ../../library/importlib.rst:918 +#: ../../library/importlib.rst:920 msgid "" "If the current working directory -- represented by an empty string -- is no " "longer valid then ``None`` is returned but no value is cached in :data:`sys." "path_importer_cache`." msgstr "" -#: ../../library/importlib.rst:925 +#: ../../library/importlib.rst:927 msgid "" "Calls :meth:`importlib.abc.PathEntryFinder.invalidate_caches` on all finders " "stored in :data:`sys.path_importer_cache` that define the method. Otherwise " "entries in :data:`sys.path_importer_cache` set to ``None`` are deleted." msgstr "" -#: ../../library/importlib.rst:930 +#: ../../library/importlib.rst:932 msgid "Entries of ``None`` in :data:`sys.path_importer_cache` are deleted." msgstr "" -#: ../../library/importlib.rst:933 +#: ../../library/importlib.rst:935 msgid "" "Calls objects in :data:`sys.path_hooks` with the current working directory " "for ``''`` (i.e. the empty string)." msgstr "" -#: ../../library/importlib.rst:940 +#: ../../library/importlib.rst:942 msgid "" "A concrete implementation of :class:`importlib.abc.PathEntryFinder` which " "caches results from the file system." msgstr "" -#: ../../library/importlib.rst:943 +#: ../../library/importlib.rst:945 msgid "" "The *path* argument is the directory for which the finder is in charge of " "searching." msgstr "" -#: ../../library/importlib.rst:946 +#: ../../library/importlib.rst:948 msgid "" "The *loader_details* argument is a variable number of 2-item tuples each " "containing a loader and a sequence of file suffixes the loader recognizes. " @@ -1195,7 +1195,7 @@ msgid "" "module's name and the path to the file found." msgstr "" -#: ../../library/importlib.rst:951 +#: ../../library/importlib.rst:953 msgid "" "The finder will cache the directory contents as necessary, making stat calls " "for each module search to verify the cache is not outdated. Because cache " @@ -1208,166 +1208,166 @@ msgid "" "to call :func:`importlib.invalidate_caches`." msgstr "" -#: ../../library/importlib.rst:965 +#: ../../library/importlib.rst:967 msgid "The path the finder will search in." msgstr "" -#: ../../library/importlib.rst:969 +#: ../../library/importlib.rst:971 msgid "Attempt to find the spec to handle *fullname* within :attr:`path`." msgstr "" -#: ../../library/importlib.rst:975 +#: ../../library/importlib.rst:977 msgid "Clear out the internal cache." msgstr "" -#: ../../library/importlib.rst:979 +#: ../../library/importlib.rst:981 msgid "" "A class method which returns a closure for use on :data:`sys.path_hooks`. An " "instance of :class:`FileFinder` is returned by the closure using the path " "argument given to the closure directly and *loader_details* indirectly." msgstr "" -#: ../../library/importlib.rst:984 +#: ../../library/importlib.rst:986 msgid "" "If the argument to the closure is not an existing directory, :exc:" "`ImportError` is raised." msgstr "" -#: ../../library/importlib.rst:990 +#: ../../library/importlib.rst:992 msgid "" "A concrete implementation of :class:`importlib.abc.SourceLoader` by " "subclassing :class:`importlib.abc.FileLoader` and providing some concrete " "implementations of other methods." msgstr "" -#: ../../library/importlib.rst:998 +#: ../../library/importlib.rst:1000 msgid "The name of the module that this loader will handle." msgstr "" -#: ../../library/importlib.rst:1002 +#: ../../library/importlib.rst:1004 msgid "The path to the source file." msgstr "" -#: ../../library/importlib.rst:1006 +#: ../../library/importlib.rst:1008 msgid "Return ``True`` if :attr:`path` appears to be for a package." msgstr "" -#: ../../library/importlib.rst:1010 +#: ../../library/importlib.rst:1012 msgid "" "Concrete implementation of :meth:`importlib.abc.SourceLoader.path_stats`." msgstr "" -#: ../../library/importlib.rst:1014 +#: ../../library/importlib.rst:1016 msgid "Concrete implementation of :meth:`importlib.abc.SourceLoader.set_data`." msgstr "" -#: ../../library/importlib.rst:1018 ../../library/importlib.rst:1061 +#: ../../library/importlib.rst:1020 ../../library/importlib.rst:1063 msgid "" "Concrete implementation of :meth:`importlib.abc.Loader.load_module` where " "specifying the name of the module to load is optional." msgstr "" -#: ../../library/importlib.rst:1023 ../../library/importlib.rst:1066 +#: ../../library/importlib.rst:1025 ../../library/importlib.rst:1068 msgid "Use :meth:`importlib.abc.Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:1028 +#: ../../library/importlib.rst:1030 msgid "" "A concrete implementation of :class:`importlib.abc.FileLoader` which can " "import bytecode files (i.e. no source code files exist)." msgstr "" -#: ../../library/importlib.rst:1031 +#: ../../library/importlib.rst:1033 msgid "" "Please note that direct use of bytecode files (and thus not source code " "files) inhibits your modules from being usable by all Python implementations " "or new versions of Python which change the bytecode format." msgstr "" -#: ../../library/importlib.rst:1040 +#: ../../library/importlib.rst:1042 msgid "The name of the module the loader will handle." msgstr "" -#: ../../library/importlib.rst:1044 +#: ../../library/importlib.rst:1046 msgid "The path to the bytecode file." msgstr "" -#: ../../library/importlib.rst:1048 +#: ../../library/importlib.rst:1050 msgid "Determines if the module is a package based on :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1052 +#: ../../library/importlib.rst:1054 msgid "Returns the code object for :attr:`name` created from :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1056 +#: ../../library/importlib.rst:1058 msgid "" "Returns ``None`` as bytecode files have no source when this loader is used." msgstr "" -#: ../../library/importlib.rst:1071 +#: ../../library/importlib.rst:1073 msgid "" "A concrete implementation of :class:`importlib.abc.ExecutionLoader` for " "extension modules." msgstr "" -#: ../../library/importlib.rst:1074 +#: ../../library/importlib.rst:1076 msgid "" "The *fullname* argument specifies the name of the module the loader is to " "support. The *path* argument is the path to the extension module's file." msgstr "" -#: ../../library/importlib.rst:1077 +#: ../../library/importlib.rst:1079 msgid "" "Note that, by default, importing an extension module will fail in " "subinterpreters if it doesn't implement multi-phase init (see :pep:`489`), " "even if it would otherwise import successfully." msgstr "" -#: ../../library/importlib.rst:1083 +#: ../../library/importlib.rst:1085 msgid "Multi-phase init is now required for use in subinterpreters." msgstr "" -#: ../../library/importlib.rst:1088 ../../library/importlib.rst:1274 +#: ../../library/importlib.rst:1090 ../../library/importlib.rst:1276 msgid "Name of the module the loader supports." msgstr "" -#: ../../library/importlib.rst:1092 +#: ../../library/importlib.rst:1094 msgid "Path to the extension module." msgstr "" -#: ../../library/importlib.rst:1096 +#: ../../library/importlib.rst:1098 msgid "" "Creates the module object from the given specification in accordance with :" "pep:`489`." msgstr "" -#: ../../library/importlib.rst:1103 +#: ../../library/importlib.rst:1105 msgid "Initializes the given module object in accordance with :pep:`489`." msgstr "" -#: ../../library/importlib.rst:1109 +#: ../../library/importlib.rst:1111 msgid "" "Returns ``True`` if the file path points to a package's ``__init__`` module " -"based on :attr:`EXTENSION_SUFFIXES`." +"based on :const:`EXTENSION_SUFFIXES`." msgstr "" -#: ../../library/importlib.rst:1114 +#: ../../library/importlib.rst:1116 msgid "Returns ``None`` as extension modules lack a code object." msgstr "" -#: ../../library/importlib.rst:1118 +#: ../../library/importlib.rst:1120 msgid "Returns ``None`` as extension modules do not have source code." msgstr "" -#: ../../library/importlib.rst:1129 +#: ../../library/importlib.rst:1131 msgid "" "A concrete implementation of :class:`importlib.abc.InspectLoader` for " "namespace packages. This is an alias for a private class and is only made " "public for introspecting the ``__loader__`` attribute on namespace packages::" msgstr "" -#: ../../library/importlib.rst:1134 +#: ../../library/importlib.rst:1136 msgid "" ">>> from importlib.machinery import NamespaceLoader\n" ">>> import my_namespace\n" @@ -1385,7 +1385,7 @@ msgstr "" ">>> isinstance(my_namespace.__loader__, importlib.abc.Loader)\n" "True" -#: ../../library/importlib.rst:1147 +#: ../../library/importlib.rst:1149 msgid "" "A specification for a module's import-system-related state. This is " "typically exposed as the module's :attr:`~module.__spec__` attribute. Many " @@ -1398,19 +1398,19 @@ msgid "" "origin>`, and vice versa." msgstr "" -#: ../../library/importlib.rst:1161 +#: ../../library/importlib.rst:1163 msgid "" "The module's fully qualified name (see :attr:`module.__name__`). The :term:" "`finder` should always set this attribute to a non-empty string." msgstr "" -#: ../../library/importlib.rst:1166 +#: ../../library/importlib.rst:1168 msgid "" "The :term:`loader` used to load the module (see :attr:`module.__loader__`). " "The :term:`finder` should always set this attribute." msgstr "" -#: ../../library/importlib.rst:1171 +#: ../../library/importlib.rst:1173 msgid "" "The location the :term:`loader` should use to load the module (see :attr:" "`module.__file__`). For example, for modules loaded from a ``.py`` file this " @@ -1419,14 +1419,14 @@ msgid "" "there is not one (like for namespace packages), it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1180 +#: ../../library/importlib.rst:1182 msgid "" "A (possibly empty) :term:`sequence` of strings enumerating the locations in " "which a package's submodules will be found (see :attr:`module.__path__`). " "Most of the time there will only be a single directory in this list." msgstr "" -#: ../../library/importlib.rst:1185 +#: ../../library/importlib.rst:1187 msgid "" "The :term:`finder` should set this attribute to a sequence, even an empty " "one, to indicate to the import system that the module is a package. It " @@ -1434,41 +1434,41 @@ msgid "" "later to a special object for namespace packages." msgstr "" -#: ../../library/importlib.rst:1193 +#: ../../library/importlib.rst:1195 msgid "" "The :term:`finder` may set this attribute to an object containing " "additional, module-specific data to use when loading the module. Otherwise " "it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1199 +#: ../../library/importlib.rst:1201 msgid "" "The filename of a compiled version of the module's code (see :attr:`module." "__cached__`). The :term:`finder` should always set this attribute but it may " "be ``None`` for modules that do not need compiled code stored." msgstr "" -#: ../../library/importlib.rst:1206 +#: ../../library/importlib.rst:1208 msgid "" "(Read-only) The fully qualified name of the package the module is in (or the " "empty string for a top-level module). See :attr:`module.__package__`. If the " "module is a package then this is the same as :attr:`name`." msgstr "" -#: ../../library/importlib.rst:1213 +#: ../../library/importlib.rst:1215 msgid "" "``True`` if the spec's :attr:`origin` refers to a loadable location, " "``False`` otherwise. This value impacts how :attr:`!origin` is interpreted " "and how the module's :attr:`~module.__file__` is populated." msgstr "" -#: ../../library/importlib.rst:1220 +#: ../../library/importlib.rst:1222 msgid "" "A specialization of :class:`importlib.machinery.ExtensionFileLoader` that is " "able to load extension modules in Framework format." msgstr "" -#: ../../library/importlib.rst:1223 +#: ../../library/importlib.rst:1225 msgid "" "For compatibility with the iOS App Store, *all* binary modules in an iOS app " "must be dynamic libraries, contained in a framework with appropriate " @@ -1477,7 +1477,7 @@ msgid "" "material outside the Frameworks folder." msgstr "" -#: ../../library/importlib.rst:1229 +#: ../../library/importlib.rst:1231 msgid "" "To accommodate this requirement, when running on iOS, extension module " "binaries are *not* packaged as ``.so`` files on ``sys.path``, but as " @@ -1491,7 +1491,7 @@ msgid "" "fwork`` file, relative to the app bundle." msgstr "" -#: ../../library/importlib.rst:1240 +#: ../../library/importlib.rst:1242 msgid "" "For example, consider the case of an import ``from foo.bar import _whiz``, " "where ``_whiz`` is implemented with the binary module ``sources/foo/bar/" @@ -1507,7 +1507,7 @@ msgid "" "_whiz.origin``, containing the path to the ``.fwork`` file." msgstr "" -#: ../../library/importlib.rst:1254 +#: ../../library/importlib.rst:1256 msgid "" "When a module is loaded with this loader, the ``__file__`` for the module " "will report as the location of the ``.fwork`` file. This allows code to use " @@ -1516,7 +1516,7 @@ msgid "" "in the ``.framework`` folder." msgstr "" -#: ../../library/importlib.rst:1260 +#: ../../library/importlib.rst:1262 msgid "" "The Xcode project building the app is responsible for converting any ``.so`` " "files from wherever they exist in the ``PYTHONPATH`` into frameworks in the " @@ -1527,35 +1527,35 @@ msgid "" "details on how to construct this build step." msgstr "" -#: ../../library/importlib.rst:1270 +#: ../../library/importlib.rst:1272 msgid "Availability" msgstr "" -#: ../../library/importlib.rst:1278 +#: ../../library/importlib.rst:1280 msgid "Path to the ``.fwork`` file for the extension module." msgstr "" -#: ../../library/importlib.rst:1282 +#: ../../library/importlib.rst:1284 msgid ":mod:`importlib.util` -- Utility code for importers" msgstr "" -#: ../../library/importlib.rst:1288 +#: ../../library/importlib.rst:1290 msgid "**Source code:** :source:`Lib/importlib/util.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/util.py`" -#: ../../library/importlib.rst:1292 +#: ../../library/importlib.rst:1294 msgid "" "This module contains the various objects that help in the construction of " "an :term:`importer`." msgstr "" -#: ../../library/importlib.rst:1297 +#: ../../library/importlib.rst:1299 msgid "" "The bytes which represent the bytecode version number. If you need help with " "loading/writing bytecode then consider :class:`importlib.abc.SourceLoader`." msgstr "" -#: ../../library/importlib.rst:1304 +#: ../../library/importlib.rst:1306 msgid "" "Return the :pep:`3147`/:pep:`488` path to the byte-compiled file associated " "with the source *path*. For example, if *path* is ``/foo/bar/baz.py`` the " @@ -1565,7 +1565,7 @@ msgid "" "`NotImplementedError` will be raised)." msgstr "" -#: ../../library/importlib.rst:1311 +#: ../../library/importlib.rst:1313 msgid "" "The *optimization* parameter is used to specify the optimization level of " "the bytecode file. An empty string represents no optimization, so ``/foo/bar/" @@ -1578,7 +1578,7 @@ msgid "" "be alphanumeric, else :exc:`ValueError` is raised." msgstr "" -#: ../../library/importlib.rst:1321 +#: ../../library/importlib.rst:1323 msgid "" "The *debug_override* parameter is deprecated and can be used to override the " "system's value for ``__debug__``. A ``True`` value is the equivalent of " @@ -1587,18 +1587,18 @@ msgid "" "are not ``None`` then :exc:`TypeError` is raised." msgstr "" -#: ../../library/importlib.rst:1329 +#: ../../library/importlib.rst:1331 msgid "" "The *optimization* parameter was added and the *debug_override* parameter " "was deprecated." msgstr "" -#: ../../library/importlib.rst:1333 ../../library/importlib.rst:1349 -#: ../../library/importlib.rst:1438 +#: ../../library/importlib.rst:1335 ../../library/importlib.rst:1351 +#: ../../library/importlib.rst:1440 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/importlib.rst:1339 +#: ../../library/importlib.rst:1341 msgid "" "Given the *path* to a :pep:`3147` file name, return the associated source " "code file path. For example, if *path* is ``/foo/bar/__pycache__/baz." @@ -1608,25 +1608,25 @@ msgid "" "cache_tag` is not defined, :exc:`NotImplementedError` is raised." msgstr "" -#: ../../library/importlib.rst:1354 +#: ../../library/importlib.rst:1356 msgid "" "Decode the given bytes representing source code and return it as a string " "with universal newlines (as required by :meth:`importlib.abc.InspectLoader." "get_source`)." msgstr "" -#: ../../library/importlib.rst:1362 +#: ../../library/importlib.rst:1364 msgid "Resolve a relative module name to an absolute one." msgstr "" -#: ../../library/importlib.rst:1364 +#: ../../library/importlib.rst:1366 msgid "" "If **name** has no leading dots, then **name** is simply returned. This " "allows for usage such as ``importlib.util.resolve_name('sys', __spec__." "parent)`` without doing a check to see if the **package** argument is needed." msgstr "" -#: ../../library/importlib.rst:1369 +#: ../../library/importlib.rst:1371 msgid "" ":exc:`ImportError` is raised if **name** is a relative module name but " "**package** is a false value (e.g. ``None`` or the empty string). :exc:" @@ -1634,13 +1634,13 @@ msgid "" "package (e.g. requesting ``..bacon`` from within the ``spam`` package)." msgstr "" -#: ../../library/importlib.rst:1377 +#: ../../library/importlib.rst:1379 msgid "" "To improve consistency with import statements, raise :exc:`ImportError` " "instead of :exc:`ValueError` for invalid relative import attempts." msgstr "" -#: ../../library/importlib.rst:1384 +#: ../../library/importlib.rst:1386 msgid "" "Find the :term:`spec ` for a module, optionally relative to the " "specified **package** name. If the module is in :data:`sys.modules`, then " @@ -1650,30 +1650,30 @@ msgid "" "if no spec is found." msgstr "" -#: ../../library/importlib.rst:1391 +#: ../../library/importlib.rst:1393 msgid "" "If **name** is for a submodule (contains a dot), the parent module is " "automatically imported." msgstr "" -#: ../../library/importlib.rst:1394 +#: ../../library/importlib.rst:1396 msgid "**name** and **package** work the same as for :func:`import_module`." msgstr "" -#: ../../library/importlib.rst:1398 +#: ../../library/importlib.rst:1400 msgid "" "Raises :exc:`ModuleNotFoundError` instead of :exc:`AttributeError` if " "**package** is in fact not a package (i.e. lacks a :attr:`~module.__path__` " "attribute)." msgstr "" -#: ../../library/importlib.rst:1405 +#: ../../library/importlib.rst:1407 msgid "" "Create a new module based on **spec** and :meth:`spec.loader.create_module " "`." msgstr "" -#: ../../library/importlib.rst:1408 +#: ../../library/importlib.rst:1410 msgid "" "If :meth:`spec.loader.create_module ` " "does not return ``None``, then any pre-existing attributes will not be " @@ -1681,14 +1681,14 @@ msgid "" "accessing **spec** or setting an attribute on the module." msgstr "" -#: ../../library/importlib.rst:1413 +#: ../../library/importlib.rst:1415 msgid "" "This function is preferred over using :class:`types.ModuleType` to create a " "new module as **spec** is used to set as many import-controlled attributes " "on the module as possible." msgstr "" -#: ../../library/importlib.rst:1421 +#: ../../library/importlib.rst:1423 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on a loader. The parameters have the same meaning as they do " @@ -1697,7 +1697,7 @@ msgid "" "spec." msgstr "" -#: ../../library/importlib.rst:1431 +#: ../../library/importlib.rst:1433 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on the path to a file. Missing information will be filled in " @@ -1705,14 +1705,14 @@ msgid "" "module will be file-based." msgstr "" -#: ../../library/importlib.rst:1443 +#: ../../library/importlib.rst:1445 msgid "" "Return the hash of *source_bytes* as bytes. A hash-based ``.pyc`` file " "embeds the :func:`source_hash` of the corresponding source file's contents " "in its header." msgstr "" -#: ../../library/importlib.rst:1451 +#: ../../library/importlib.rst:1453 msgid "" "A context manager that can temporarily skip the compatibility check for " "extension modules. By default the check is enabled and will fail when a " @@ -1721,33 +1721,33 @@ msgid "" "interpreter GIL, when imported in an interpreter with its own GIL." msgstr "" -#: ../../library/importlib.rst:1458 +#: ../../library/importlib.rst:1460 msgid "" "Note that this function is meant to accommodate an unusual case; one which " "is likely to eventually go away. There's is a pretty good chance this is " "not what you were looking for." msgstr "" -#: ../../library/importlib.rst:1462 +#: ../../library/importlib.rst:1464 msgid "" "You can get the same effect as this function by implementing the basic " "interface of multi-phase init (:pep:`489`) and lying about support for " "multiple interpreters (or per-interpreter GIL)." msgstr "" -#: ../../library/importlib.rst:1467 +#: ../../library/importlib.rst:1469 msgid "" "Using this function to disable the check can lead to unexpected behavior and " "even crashes. It should only be used during extension module development." msgstr "" -#: ../../library/importlib.rst:1475 +#: ../../library/importlib.rst:1477 msgid "" "A class which postpones the execution of the loader of a module until the " "module has an attribute accessed." msgstr "" -#: ../../library/importlib.rst:1478 +#: ../../library/importlib.rst:1480 msgid "" "This class **only** works with loaders that define :meth:`~importlib.abc." "Loader.exec_module` as control over what module type is used for the module " @@ -1760,7 +1760,7 @@ msgid "" "raised if such a substitution is detected." msgstr "" -#: ../../library/importlib.rst:1489 +#: ../../library/importlib.rst:1491 msgid "" "For projects where startup time is critical, this class allows for " "potentially minimizing the cost of loading a module if it is never used. For " @@ -1769,21 +1769,21 @@ msgid "" "postponed and thus occurring out of context." msgstr "" -#: ../../library/importlib.rst:1497 +#: ../../library/importlib.rst:1499 msgid "" "Began calling :meth:`~importlib.abc.Loader.create_module`, removing the " "compatibility warning for :class:`importlib.machinery.BuiltinImporter` and :" "class:`importlib.machinery.ExtensionFileLoader`." msgstr "" -#: ../../library/importlib.rst:1504 +#: ../../library/importlib.rst:1506 msgid "" "A class method which returns a callable that creates a lazy loader. This is " "meant to be used in situations where the loader is passed by class instead " "of by instance. ::" msgstr "" -#: ../../library/importlib.rst:1509 +#: ../../library/importlib.rst:1511 msgid "" "suffixes = importlib.machinery.SOURCE_SUFFIXES\n" "loader = importlib.machinery.SourceFileLoader\n" @@ -1795,20 +1795,20 @@ msgstr "" "lazy_loader = importlib.util.LazyLoader.factory(loader)\n" "finder = importlib.machinery.FileFinder(path, (lazy_loader, suffixes))" -#: ../../library/importlib.rst:1517 +#: ../../library/importlib.rst:1519 msgid "Examples" msgstr "範例" -#: ../../library/importlib.rst:1520 +#: ../../library/importlib.rst:1522 msgid "Importing programmatically" msgstr "" -#: ../../library/importlib.rst:1522 +#: ../../library/importlib.rst:1524 msgid "" "To programmatically import a module, use :func:`importlib.import_module`. ::" msgstr "" -#: ../../library/importlib.rst:1525 +#: ../../library/importlib.rst:1527 msgid "" "import importlib\n" "\n" @@ -1818,23 +1818,23 @@ msgstr "" "\n" "itertools = importlib.import_module('itertools')" -#: ../../library/importlib.rst:1531 +#: ../../library/importlib.rst:1533 msgid "Checking if a module can be imported" msgstr "" -#: ../../library/importlib.rst:1533 +#: ../../library/importlib.rst:1535 msgid "" "If you need to find out if a module can be imported without actually doing " "the import, then you should use :func:`importlib.util.find_spec`." msgstr "" -#: ../../library/importlib.rst:1536 +#: ../../library/importlib.rst:1538 msgid "" "Note that if ``name`` is a submodule (contains a dot), :func:`importlib.util." "find_spec` will import the parent module. ::" msgstr "" -#: ../../library/importlib.rst:1540 +#: ../../library/importlib.rst:1542 msgid "" "import importlib.util\n" "import sys\n" @@ -1854,11 +1854,11 @@ msgid "" " print(f\"can't find the {name!r} module\")" msgstr "" -#: ../../library/importlib.rst:1559 +#: ../../library/importlib.rst:1561 msgid "Importing a source file directly" msgstr "" -#: ../../library/importlib.rst:1561 +#: ../../library/importlib.rst:1563 msgid "" "This recipe should be used with caution: it is an approximation of an import " "statement where the file path is specified directly, rather than :data:`sys." @@ -1868,13 +1868,13 @@ msgid "" "file is appropriate." msgstr "" -#: ../../library/importlib.rst:1568 +#: ../../library/importlib.rst:1570 msgid "" "To import a Python source file directly from a path, use the following " "recipe::" msgstr "" -#: ../../library/importlib.rst:1570 +#: ../../library/importlib.rst:1572 msgid "" "import importlib.util\n" "import sys\n" @@ -1897,15 +1897,15 @@ msgid "" "json = import_from_path(module_name, file_path)" msgstr "" -#: ../../library/importlib.rst:1592 +#: ../../library/importlib.rst:1594 msgid "Implementing lazy imports" msgstr "" -#: ../../library/importlib.rst:1594 +#: ../../library/importlib.rst:1596 msgid "The example below shows how to implement lazy imports::" msgstr "" -#: ../../library/importlib.rst:1596 +#: ../../library/importlib.rst:1598 msgid "" ">>> import importlib.util\n" ">>> import sys\n" @@ -1925,11 +1925,11 @@ msgid "" "False" msgstr "" -#: ../../library/importlib.rst:1615 +#: ../../library/importlib.rst:1617 msgid "Setting up an importer" msgstr "" -#: ../../library/importlib.rst:1617 +#: ../../library/importlib.rst:1619 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -1943,7 +1943,7 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: ../../library/importlib.rst:1628 +#: ../../library/importlib.rst:1630 msgid "" "import importlib.machinery\n" "import sys\n" @@ -1967,11 +1967,11 @@ msgid "" "sys.path_hooks.append(SpamPathEntryFinder.path_hook(loader_details))" msgstr "" -#: ../../library/importlib.rst:1649 +#: ../../library/importlib.rst:1651 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: ../../library/importlib.rst:1651 +#: ../../library/importlib.rst:1653 msgid "" "Import itself is implemented in Python code, making it possible to expose " "most of the import machinery through importlib. The following helps " @@ -1979,7 +1979,7 @@ msgid "" "approximate implementation of :func:`importlib.import_module`::" msgstr "" -#: ../../library/importlib.rst:1657 +#: ../../library/importlib.rst:1659 msgid "" "import importlib.util\n" "import sys\n" @@ -2012,11 +2012,11 @@ msgid "" " return module" msgstr "" -#: ../../library/importlib.rst:422 +#: ../../library/importlib.rst:424 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/importlib.rst:422 +#: ../../library/importlib.rst:424 msgid "importlib.abc.InspectLoader.get_source method" msgstr "importlib.abc.InspectLoader.get_source 方法" diff --git a/library/index.po b/library/index.po index 35406943a5..45c84d8fd6 100644 --- a/library/index.po +++ b/library/index.po @@ -1,10 +1,8 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: # Liang-Bo Wang , 2015-2016 -# Liang-Bo Wang , 2016 # Frank Jheng , 2015 # Steven Hsu , 2021 msgid "" diff --git a/library/itertools.po b/library/itertools.po index 48da6e992c..9da2ed2ccd 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-17 00:14+0000\n" +"POT-Creation-Date: 2025-02-07 15:02+0800\n" "PO-Revision-Date: 2024-08-16 15:01+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -488,10 +488,10 @@ msgid "" "www.ramseysolutions.com/real-estate/amortization-schedule>`_, accumulate the " "interest and apply payments:" msgstr "" -"*function* 引數可以被設定為 :func:`min` 以得到連續的最小值,設定為 :func:" -"`max` 以得到連續的最大值,或者設定為 :func:`operator.mul` 以得到連續的乘積。" -"也可以透過累積利息和付款來建立\\ `攤銷表 (Amortization tables) `_ :" +"*function* 引數可以被設定為 :func:`min` 以得到連續的最小值,設定" +"為 :func:`max` 以得到連續的最大值,或者設定為 :func:`operator.mul` 以得到連續" +"的乘積。也可以透過累積利息和付款來建立\\ `攤銷表 (Amortization tables) " +"`_ :" #: ../../library/itertools.rst:136 msgid "" @@ -630,9 +630,9 @@ msgstr "從輸入 *iterable* 中回傳長度為 *r* 的元素的子序列。" #: ../../library/itertools.rst:227 msgid "" "The output is a subsequence of :func:`product` keeping only entries that are " -"subsequences of the *iterable*. The length of the output is given by :func:" -"`math.comb` which computes ``n! / r! / (n - r)!`` when ``0 ≤ r ≤ n`` or zero " -"when ``r > n``." +"subsequences of the *iterable*. The length of the output is given " +"by :func:`math.comb` which computes ``n! / r! / (n - r)!`` when ``0 ≤ r ≤ " +"n`` or zero when ``r > n``." msgstr "" "輸出是 :func:`product` 的子序列,僅保留作為 *iterable* 子序列的條目。輸出的長" "度由 :func:`math.comb` 給定,當 ``0 ≤ r ≤ n`` 時,長度為 ``n! / r! / (n - r)!" @@ -758,8 +758,8 @@ msgstr "" #: ../../library/itertools.rst:323 msgid "" "Make an iterator that returns evenly spaced values beginning with *start*. " -"Can be used with :func:`map` to generate consecutive data points or with :" -"func:`zip` to add sequence numbers. Roughly equivalent to::" +"Can be used with :func:`map` to generate consecutive data points or " +"with :func:`zip` to add sequence numbers. Roughly equivalent to::" msgstr "" "建立一個疊代器,回傳從 *start* 開始的等差的值。可以與 :func:`map` 一起使用來" "產生連續的資料點,或與 :func:`zip` 一起使用來增加序列號。大致等價於: ::" @@ -939,9 +939,9 @@ msgstr "" #: ../../library/itertools.rst:420 msgid "" "The returned group is itself an iterator that shares the underlying iterable " -"with :func:`groupby`. Because the source is shared, when the :func:" -"`groupby` object is advanced, the previous group is no longer visible. So, " -"if that data is needed later, it should be stored as a list::" +"with :func:`groupby`. Because the source is shared, when " +"the :func:`groupby` object is advanced, the previous group is no longer " +"visible. So, if that data is needed later, it should be stored as a list::" msgstr "" "回傳的群組本身是一個與 :func:`groupby` 共享底層可疊代物件的疊代器。由於來源是" "共享的,當 :func:`groupby` 物件前進時,前一個群組將不再可見。因此,如果之後需" @@ -1146,11 +1146,11 @@ msgstr "" #: ../../library/itertools.rst:536 msgid "" -"Return successive *r* length `permutations of elements `_ from the *iterable*." +"Return successive *r* length `permutations of elements `_ from the *iterable*." msgstr "" -"回傳 *iterable* 中連續且長度為 *r* 的\\ `元素排列 `_ 。" +"回傳 *iterable* 中連續且長度為 *r* 的\\ `元素排列 `_ 。" #: ../../library/itertools.rst:539 msgid "" @@ -1163,13 +1163,13 @@ msgstr "" #: ../../library/itertools.rst:543 msgid "" "The output is a subsequence of :func:`product` where entries with repeated " -"elements have been filtered out. The length of the output is given by :func:" -"`math.perm` which computes ``n! / (n - r)!`` when ``0 ≤ r ≤ n`` or zero when " -"``r > n``." +"elements have been filtered out. The length of the output is given " +"by :func:`math.perm` which computes ``n! / (n - r)!`` when ``0 ≤ r ≤ n`` or " +"zero when ``r > n``." msgstr "" -"輸出是 :func:`product` 的子序列,其中重複元素的條目已被濾除。輸出的長度由 :" -"func:`math.perm` 給定,當 ``0 ≤ r ≤ n`` 時,長度為 ``n! / (n - r)!``,當 ``r " -"> n`` 時為零。" +"輸出是 :func:`product` 的子序列,其中重複元素的條目已被濾除。輸出的長度" +"由 :func:`math.perm` 給定,當 ``0 ≤ r ≤ n`` 時,長度為 ``n! / (n - r)!``,當 " +"``r > n`` 時為零。" #: ../../library/itertools.rst:548 msgid "" @@ -1432,14 +1432,15 @@ msgid "" "the input iterator and there is no way to access it. This could be an issue " "if an application wants to further consume the input iterator after " "*takewhile* has been run to exhaustion. To work around this problem, " -"consider using `more-itertools before_and_after() `_ instead." +"consider using `more-itertools before_and_after() `_ instead." msgstr "" "注意,第一個不符合條件判斷的元素將從輸入疊代器中被消耗,且無法再存取它。如果" "應用程式希望在 *takewhile* 耗盡後進一步消耗輸入疊代器,這可能會是個問題。為了" "解決這個問題,可以考慮使用 `more-itertools 中的 before_and_after() `_ 作為替代。" +"more-itertools.readthedocs.io/en/stable/" +"api.html#more_itertools.before_and_after>`_ 作為替代。" #: ../../library/itertools.rst:691 msgid "Return *n* independent iterators from a single iterable." @@ -1485,9 +1486,9 @@ msgstr "" msgid "" "When the input *iterable* is already a tee iterator object, all members of " "the return tuple are constructed as if they had been produced by the " -"upstream :func:`tee` call. This \"flattening step\" allows nested :func:" -"`tee` calls to share the same underlying data chain and to have a single " -"update step rather than a chain of calls." +"upstream :func:`tee` call. This \"flattening step\" allows " +"nested :func:`tee` calls to share the same underlying data chain and to have " +"a single update step rather than a chain of calls." msgstr "" #: ../../library/itertools.rst:734 @@ -1521,19 +1522,19 @@ msgid "" "even if the original *iterable* is threadsafe." msgstr "" "``tee`` 疊代器不是執行緒安全 (threadsafe) 的。當同時使用由同一個 :func:`tee` " -"呼叫所回傳的疊代器時,即使原始的 *iterable* 是執行緒安全的,也可能引發 :exc:" -"`RuntimeError`。" +"呼叫所回傳的疊代器時,即使原始的 *iterable* 是執行緒安全的,也可能引" +"發 :exc:`RuntimeError`。" #: ../../library/itertools.rst:758 msgid "" "This itertool may require significant auxiliary storage (depending on how " "much temporary data needs to be stored). In general, if one iterator uses " -"most or all of the data before another iterator starts, it is faster to use :" -"func:`list` instead of :func:`tee`." +"most or all of the data before another iterator starts, it is faster to " +"use :func:`list` instead of :func:`tee`." msgstr "" "此 itertool 可能需要大量的輔助儲存空間(取決於需要儲存多少臨時資料)。通常如" -"果一個疊代器在另一個疊代器開始之前使用了大部分或全部的資料,使用 :func:" -"`list` 會比 :func:`tee` 更快。" +"果一個疊代器在另一個疊代器開始之前使用了大部分或全部的資料,使" +"用 :func:`list` 會比 :func:`tee` 更快。" #: ../../library/itertools.rst:766 msgid "Make an iterator that aggregates elements from each of the *iterables*." @@ -1599,9 +1600,9 @@ msgstr "" #: ../../library/itertools.rst:798 msgid "" -"If one of the iterables is potentially infinite, then the :func:" -"`zip_longest` function should be wrapped with something that limits the " -"number of calls (for example :func:`islice` or :func:`takewhile`)." +"If one of the iterables is potentially infinite, then " +"the :func:`zip_longest` function should be wrapped with something that " +"limits the number of calls (for example :func:`islice` or :func:`takewhile`)." msgstr "" "如果其中一個 iterables 可能是無限的,那麼應該用別的可以限制呼叫次數的方法來包" "裝 :func:`zip_longest` 函式(例如 :func:`islice` 或 :func:`takewhile`)。" @@ -1624,16 +1625,16 @@ msgid "" "``chain.from_iterable`` is related to the concept of flattening. The " "recipes also give ideas about ways that the tools can be combined — for " "example, how ``starmap()`` and ``repeat()`` can work together. The recipes " -"also show patterns for using itertools with the :mod:`operator` and :mod:" -"`collections` modules as well as with the built-in itertools such as " -"``map()``, ``filter()``, ``reversed()``, and ``enumerate()``." +"also show patterns for using itertools with the :mod:`operator` " +"and :mod:`collections` modules as well as with the built-in itertools such " +"as ``map()``, ``filter()``, ``reversed()``, and ``enumerate()``." msgstr "" "itertools 應用技巧的主要目的是教學。這些應用技巧展示了對單個工具進行思考的各" "種方式 —— 例如,``chain.from_iterable`` 與攤平 (flattening) 的概念相關。這些" "應用技巧還提供了組合使用工具的想法 —— 例如,``starmap()`` 和 ``repeat()`` 如" -"何一起工作。另外還展示了將 itertools 與 :mod:`operator` 和 :mod:" -"`collections` 模組一同使用以及與內建 itertools(如 ``map()``、``filter()``、" -"``reversed()`` 和 ``enumerate()``)一同使用的模式。" +"何一起工作。另外還展示了將 itertools 與 :mod:`operator` " +"和 :mod:`collections` 模組一同使用以及與內建 itertools(如 ``map()``、" +"``filter()``、``reversed()`` 和 ``enumerate()``)一同使用的模式。" #: ../../library/itertools.rst:820 msgid "" @@ -1652,8 +1653,8 @@ msgid "" "Substantially all of these recipes and many, many others can be installed " "from the :pypi:`more-itertools` project found on the Python Package Index::" msgstr "" -"幾乎所有這些應用技巧以及許多其他應用技巧都可以從 Python Package Index 上的 :" -"pypi:`more-itertools` 專案中安裝: ::" +"幾乎所有這些應用技巧以及許多其他應用技巧都可以從 Python Package Index 上" +"的 :pypi:`more-itertools` 專案中安裝: ::" #: ../../library/itertools.rst:829 msgid "python -m pip install more-itertools" @@ -1674,15 +1675,15 @@ msgstr "" "可疊代物件一次性引入記憶體,能保持優異的記憶體性能。以\\ `函式風格 " "(functional style) `_ 將工具連接在一起,能將程式碼的數量維持在較少的情況。透過優先使" -"用「向量化 (vectorized)」的構建塊而不是使用會造成直譯器負擔的 for 迴圈和\\ :" -"term:`產生器 `,則能保持高速度。" +"用「向量化 (vectorized)」的構建塊而不是使用會造成直譯器負擔的 for 迴圈和" +"\\ :term:`產生器 `,則能保持高速度。" #: ../../library/itertools.rst:839 msgid "" -"from collections import deque\n" +"from collections import Counter, deque\n" "from contextlib import suppress\n" "from functools import reduce\n" -"from math import sumprod, isqrt\n" +"from math import comb, prod, sumprod, isqrt\n" "from operator import itemgetter, getitem, mul, neg\n" "\n" "def take(n, iterable):\n" @@ -1972,7 +1973,13 @@ msgid "" " # totient(12) → 4 because len([1, 5, 7, 11]) == 4\n" " for prime in set(factor(n)):\n" " n -= n // prime\n" -" return n" +" return n\n" +"\n" +"def multinomial(*counts):\n" +" \"Number of distinct arrangements of a multiset.\"\n" +" # Counter('abracadabra').values() -> 5 2 1 1 2\n" +" # multinomial(5, 2, 1, 1, 2) → 83160\n" +" return prod(map(comb, accumulate(counts), counts))" msgstr "" #~ msgid "" diff --git a/library/json.po b/library/json.po index 76e792b8cb..5c7cb4ed9f 100644 --- a/library/json.po +++ b/library/json.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2025-01-09 00:13+0000\n" "PO-Revision-Date: 2023-08-05 15:25+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,12 +30,12 @@ msgstr "**原始碼:**\\ :source:`Lib/json/__init__.py`" #: ../../library/json.rst:14 msgid "" -"`JSON (JavaScript Object Notation) `_, specified by :rfc:" -"`7159` (which obsoletes :rfc:`4627`) and by `ECMA-404 `_, specified " +"by :rfc:`7159` (which obsoletes :rfc:`4627`) and by `ECMA-404 `_, is a " -"lightweight data interchange format inspired by `JavaScript `_ object literal syntax (although it is not a " -"strict subset of JavaScript [#rfc-errata]_ )." +"lightweight data interchange format inspired by `JavaScript `_ object literal syntax (although it is " +"not a strict subset of JavaScript [#rfc-errata]_ )." msgstr "" "`JSON (JavaScript Object Notation) `_ 是一個輕量化的資料交" "換格式,在 :rfc:`7159`\\ (其廢棄了 :rfc:`4627`\\ )及 `ECMA-404 >> import json\n" ">>> def custom_json(obj):\n" "... if isinstance(obj, complex):\n" -"... return {'__complex__': True, 'real': obj.real, 'imag': obj." -"imag}\n" +"... return {'__complex__': True, 'real': obj.real, 'imag': " +"obj.imag}\n" "... raise TypeError(f'Cannot serialize object of {type(obj)}')\n" "...\n" ">>> json.dumps(1 + 2j, default=custom_json)\n" @@ -280,153 +280,139 @@ msgstr "基本用法" #: ../../library/json.rst:153 msgid "" "Serialize *obj* as a JSON formatted stream to *fp* (a ``.write()``-" -"supporting :term:`file-like object`) using this :ref:`conversion table `." +"supporting :term:`file-like object`) using this :ref:`Python-to-JSON " +"conversion table `." msgstr "" -"參考這個\\ :ref:`轉換表 `\\ 將 *obj* 序列化為符合 JSON 格式" -"的串流,並寫入到 *fp* (一個支援 ``.write()`` 方法的 :term:`file-like " -"object`)" +"參考這個 :ref:`Python-to-JSON 轉換表 `\\ 將 *obj* 序列化為" +"符合 JSON 格式的串流,並寫入到 *fp* (一個支援 ``.write()`` 方法" +"的 :term:`file-like object`)" -#: ../../library/json.rst:157 +# SkyLull: 我想這裡的 "framed protocol" 指的是 +# https://peps.python.org/pep-3154/#framing +#: ../../library/json.rst:159 msgid "" -"If *skipkeys* is true (default: ``False``), then dict keys that are not of a " -"basic type (:class:`str`, :class:`int`, :class:`float`, :class:`bool`, " -"``None``) will be skipped instead of raising a :exc:`TypeError`." +"Unlike :mod:`pickle` and :mod:`marshal`, JSON is not a framed protocol, so " +"trying to serialize multiple objects with repeated calls to :func:`dump` " +"using the same *fp* will result in an invalid JSON file." msgstr "" -"如果 *skipkeys* 被設為 true(預設值:``False``),那麼非基本型別(:class:" -"`str`、:class:`int`、:class:`float`、:class:`bool`、``None``)的 dictionary" -"(字典)鍵值將被略過而不會引發 :exc:`TypeError`。" +"與 :mod:`pickle` 和 :mod:`marshal` 不同,JSON 不具有二進位分框(binary " +"framed)的協定,因此嘗試重複呼叫 :func:`dump` 來序列化多個物件到同一個 *fp* " +"裡將導致無效的 JSON 檔案。" -#: ../../library/json.rst:161 +#: ../../library/json.rst:0 +msgid "Parameters" +msgstr "參數" + +#: ../../library/json.rst:163 +msgid "The Python object to be serialized." +msgstr "要被序列化的 Python 物件。" + +#: ../../library/json.rst:166 msgid "" -"The :mod:`json` module always produces :class:`str` objects, not :class:" -"`bytes` objects. Therefore, ``fp.write()`` must support :class:`str` input." +"The file-like object *obj* will be serialized to. The :mod:`!json` module " +"always produces :class:`str` objects, not :class:`bytes` objects, therefore " +"``fp.write()`` must support :class:`str` input." msgstr "" -":mod:`json` 模組總是產生 :class:`str` 物件,而非 :class:`bytes` 物件。因此," -"``fp.write()`` 必須支援 :class:`str` 輸入。" -#: ../../library/json.rst:165 ../../library/json.rst:442 +#: ../../library/json.rst:173 msgid "" -"If *ensure_ascii* is true (the default), the output is guaranteed to have " -"all incoming non-ASCII characters escaped. If *ensure_ascii* is false, " -"these characters will be output as-is." +"If ``True``, keys that are not of a basic type " +"(:class:`str`, :class:`int`, :class:`float`, :class:`bool`, ``None``) will " +"be skipped instead of raising a :exc:`TypeError`. Default ``False``." msgstr "" -"如果 *ensure_ascii* 被設為 true(預設值),則輸出時將確保所有輸入的非 ASCII " -"字元都會被轉義。若 *ensure_ascii* 為 false,則這些字元將照原樣輸出。" -#: ../../library/json.rst:169 +#: ../../library/json.rst:179 msgid "" -"If *check_circular* is false (default: ``True``), then the circular " -"reference check for container types will be skipped and a circular reference " -"will result in a :exc:`RecursionError` (or worse)." +"If ``True`` (the default), the output is guaranteed to have all incoming non-" +"ASCII characters escaped. If ``False``, these characters will be outputted " +"as-is." msgstr "" -"如果 *check_circular* 設為 false(預設是 ``True``),則針對不同容器型別的循環" -"參照 (circular reference) 檢查將會被跳過,若有循環參照則最後將引發 :exc:" -"`RecursionError` (或其他更糟的錯誤)。" -#: ../../library/json.rst:173 +#: ../../library/json.rst:184 msgid "" -"If *allow_nan* is false (default: ``True``), then it will be a :exc:" -"`ValueError` to serialize out of range :class:`float` values (``nan``, " -"``inf``, ``-inf``) in strict compliance of the JSON specification. If " -"*allow_nan* is true, their JavaScript equivalents (``NaN``, ``Infinity``, ``-" -"Infinity``) will be used." +"If ``False``, the circular reference check for container types is skipped " +"and a circular reference will result in a :exc:`RecursionError` (or worse). " +"Default ``True``." msgstr "" -"如果 *allow_nan* 為 false(預設值:``True``\\ ),則序列化不符合嚴格 JSON 規" -"範的 :class:`float` 值 (``nan``, ``inf``, ``-inf``) 會引發 :exc:" -"`ValueError`。如果 *allow_nan* 為 true,則將使用它們的 JavaScript 等效表示 " -"(``NaN``, ``Infinity``, ``-Infinity``)。" +"如為 ``False``,則針對不同容器型別的循環參照 (circular reference) 檢查將會被" +"跳過,若有循環參照則最後將引發 :exc:`RecursionError`\\ (或其他更糟的錯誤)。" +"預設為 ``True``。" -#: ../../library/json.rst:179 ../../library/json.rst:461 +#: ../../library/json.rst:189 msgid "" -"If *indent* is a non-negative integer or string, then JSON array elements " -"and object members will be pretty-printed with that indent level. An indent " -"level of 0, negative, or ``\"\"`` will only insert newlines. ``None`` (the " -"default) selects the most compact representation. Using a positive integer " -"indent indents that many spaces per level. If *indent* is a string (such as " -"``\"\\t\"``), that string is used to indent each level." +"If ``False``, serialization of out-of-range :class:`float` values (``nan``, " +"``inf``, ``-inf``) will result in a :exc:`ValueError`, in strict compliance " +"with the JSON specification. If ``True`` (the default), their JavaScript " +"equivalents (``NaN``, ``Infinity``, ``-Infinity``) are used." msgstr "" -"如果 *indent* 是非負整數或字串,則 JSON 陣列元素和物件成員將使用該縮排等級進" -"行格式美化。縮排等級 0、負數或 ``\"\"`` 只會插入換行符號。``None``\\ (預設" -"值)等於是選擇最緊湊的表示法。使用正整數縮排可以在每層縮排數量相同的空格。如" -"果 *indent* 是一個字串(例如 ``\"\\t\"``\\ ),則該字串用於縮排每個層級。" - -#: ../../library/json.rst:186 ../../library/json.rst:468 -msgid "Allow strings for *indent* in addition to integers." -msgstr "除了整數之外,*indent* 還允許使用字串作為輸入。" +"如為 ``False``,則序列化不符合嚴格 JSON 規範的超出範圍 :class:`float` 值 " +"(``nan``, ``inf``, ``-inf``) 會引發 :exc:`ValueError`。如為 ``True``\\ (預設" +"值),則將使用它們的 JavaScript 等效表示 (``NaN``, ``Infinity``, ``-" +"Infinity``)。" -#: ../../library/json.rst:189 ../../library/json.rst:471 +#: ../../library/json.rst:196 msgid "" -"If specified, *separators* should be an ``(item_separator, key_separator)`` " -"tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', " -"': ')`` otherwise. To get the most compact JSON representation, you should " -"specify ``(',', ':')`` to eliminate whitespace." +"If set, a custom JSON encoder with the :meth:`~JSONEncoder.default` method " +"overridden, for serializing into custom datatypes. If ``None`` (the " +"default), :class:`!JSONEncoder` is used." msgstr "" -"如果有指定本引數內容,*separators* 應該是一個 ``(item_separator, " -"key_separator)`` 二元組。如果 *indent* 為 ``None`` 則預設為 ``(', ', ': " -"')``,否則預設為 ``(',', ': ')``。想要獲得最緊湊的 JSON 表示形式,你可以改成" -"指定 ``(',', ':')`` 來消除空格。" -#: ../../library/json.rst:194 ../../library/json.rst:476 -msgid "Use ``(',', ': ')`` as default if *indent* is not ``None``." -msgstr "如果 *indent* 不是 ``None``,則使用 ``(',', ': ')`` 作為預設值" - -#: ../../library/json.rst:197 ../../library/json.rst:479 +#: ../../library/json.rst:203 msgid "" -"If specified, *default* should be a function that gets called for objects " -"that can't otherwise be serialized. It should return a JSON encodable " -"version of the object or raise a :exc:`TypeError`. If not specified, :exc:" -"`TypeError` is raised." +"If a positive integer or string, JSON array elements and object members will " +"be pretty-printed with that indent level. A positive integer indents that " +"many spaces per level; a string (such as ``\"\\t\"``) is used to indent each " +"level. If zero, negative, or ``\"\"`` (the empty string), only newlines are " +"inserted. If ``None`` (the default), the most compact representation is used." msgstr "" -"如果有指定本參數,*default* 會是一個遭遇無法序列化的物件時會被呼叫的函式。它" -"應該回傳該物件的 JSON 可編碼版本或引發 :exc:`TypeError`。如果未指定,則會直接" -"引發 :exc:`TypeError`。" -#: ../../library/json.rst:202 +#: ../../library/json.rst:213 msgid "" -"If *sort_keys* is true (default: ``False``), then the output of dictionaries " -"will be sorted by key." +"A two-tuple: ``(item_separator, key_separator)``. If ``None`` (the default), " +"*separators* defaults to ``(', ', ': ')`` if *indent* is ``None``, and " +"``(',', ': ')`` otherwise. For the most compact JSON, specify ``(',', ':')`` " +"to eliminate whitespace." msgstr "" -"如果 *sort_keys* 為 true(預設值:``False``),則字典的輸出將按鍵值排序。" +"一個二元組:``(item_separator, key_separator)``。如為 ``None``\\ (預設值)" +"則 *separators* 被預設為 ``(', ', ': ')``,否則預設為 ``(',', ': ')``。想要獲" +"得最緊湊的 JSON 表示形式,你可以指定 ``(',', ':')`` 來消除空格。" -#: ../../library/json.rst:205 +#: ../../library/json.rst:222 msgid "" -"To use a custom :class:`JSONEncoder` subclass (e.g. one that overrides the :" -"meth:`~JSONEncoder.default` method to serialize additional types), specify " -"it with the *cls* kwarg; otherwise :class:`JSONEncoder` is used." +"A function that is called for objects that can't otherwise be serialized. It " +"should return a JSON encodable version of the object or raise " +"a :exc:`TypeError`. If ``None`` (the default), :exc:`!TypeError` is raised." msgstr "" -"若要使用繼承自 :class:`JSONEncoder` 的自訂子類別(例如覆寫 :meth:" -"`~JSONEncoder.default` 方法來序列化其他型別的一個子類別物件),請使用關鍵字引" -"數 *cls* 指定該類別物件;否則預設使用 :class:`JSONEncoder`。" -#: ../../library/json.rst:209 ../../library/json.rst:287 +#: ../../library/json.rst:229 msgid "" -"All optional parameters are now :ref:`keyword-only `." +"If ``True``, dictionaries will be outputted sorted by key. Default ``False``." msgstr "" -"所有可選參數現在都是\\ :ref:`僅限關鍵字 `\\ 參數了。" -# SkyLull: 我想這裡的 "framed protocol" 指的是 -# https://peps.python.org/pep-3154/#framing -#: ../../library/json.rst:214 +#: ../../library/json.rst:233 ../../library/json.rst:518 +msgid "Allow strings for *indent* in addition to integers." +msgstr "除了整數之外,*indent* 還允許使用字串作為輸入。" + +#: ../../library/json.rst:236 ../../library/json.rst:526 +msgid "Use ``(',', ': ')`` as default if *indent* is not ``None``." +msgstr "如果 *indent* 不是 ``None``,則使用 ``(',', ': ')`` 作為預設值" + +#: ../../library/json.rst:239 ../../library/json.rst:338 msgid "" -"Unlike :mod:`pickle` and :mod:`marshal`, JSON is not a framed protocol, so " -"trying to serialize multiple objects with repeated calls to :func:`dump` " -"using the same *fp* will result in an invalid JSON file." +"All optional parameters are now :ref:`keyword-only `." msgstr "" -"與 :mod:`pickle` 和 :mod:`marshal` 不同,JSON 不具有二進位分框(binary " -"framed)的協定,因此嘗試重複呼叫 :func:`dump` 來序列化多個物件到同一個 *fp* " -"裡將導致無效的 JSON 檔案。" +"所有可選參數現在都是\\ :ref:`僅限關鍵字 `\\ 參數了。" -#: ../../library/json.rst:223 +#: ../../library/json.rst:248 msgid "" "Serialize *obj* to a JSON formatted :class:`str` using this :ref:`conversion " -"table `. The arguments have the same meaning as in :func:" -"`dump`." +"table `. The arguments have the same meaning as " +"in :func:`dump`." msgstr "" -"使用此\\ :ref:`轉換表 `\\ 來將 *obj* 序列化為 JSON 格式 :" -"class:`str`。這個引數的作用與 :func:`dump` 中的同名引數意義相同。" +"使用此\\ :ref:`轉換表 `\\ 來將 *obj* 序列化為 JSON 格" +"式 :class:`str`。這個引數的作用與 :func:`dump` 中的同名引數意義相同。" -#: ../../library/json.rst:229 +#: ../../library/json.rst:254 msgid "" "Keys in key/value pairs of JSON are always of the type :class:`str`. When a " "dictionary is converted into JSON, all the keys of the dictionary are " @@ -439,113 +425,120 @@ msgstr "" "轉換回字典,則該字典可能不等於原始字典。也就是說,如果字典 x 含有非字串鍵值," "則 ``loads(dumps(x)) != x``。" -#: ../../library/json.rst:238 +#: ../../library/json.rst:265 msgid "" -"Deserialize *fp* (a ``.read()``-supporting :term:`text file` or :term:" -"`binary file` containing a JSON document) to a Python object using this :ref:" -"`conversion table `." +"Deserialize *fp* to a Python object using the :ref:`JSON-to-Python " +"conversion table `." msgstr "" -"使用此\\ :ref:`轉換表 `\\ 來將 *fp*\\ (一個支援 ``." -"read()``、包含 JSON 文件的\\ :term:`文字檔案 `\\ 或\\ :term:`二進" -"位檔案 `\\ )去序列化為 Python 物件。" +"使用此 :ref:`JSON-to-Python 轉換表 `\\ 將 *fp* 解碼為 " +"Python 物件。" -#: ../../library/json.rst:242 +#: ../../library/json.rst:268 msgid "" -"*object_hook* is an optional function that will be called with the result of " -"any object literal decoded (a :class:`dict`). The return value of " -"*object_hook* will be used instead of the :class:`dict`. This feature can " -"be used to implement custom decoders (e.g. `JSON-RPC `_ class hinting)." +"A ``.read()``-supporting :term:`text file` or :term:`binary file` containing " +"the JSON document to be deserialized." +msgstr "" + +#: ../../library/json.rst:273 +msgid "" +"If set, a custom JSON decoder. Additional keyword arguments to :func:`!load` " +"will be passed to the constructor of *cls*. If ``None`` (the " +"default), :class:`!JSONDecoder` is used." +msgstr "" + +#: ../../library/json.rst:280 +#, fuzzy +msgid "" +"If set, a function that is called with the result of any object literal " +"decoded (a :class:`dict`). The return value of this function will be used " +"instead of the :class:`dict`. This feature can be used to implement custom " +"decoders, for example `JSON-RPC `_ class hinting. " +"Default ``None``." msgstr "" "*object_hook* 是一個可選引數,其接受一個函式作為輸入。原始的字串解碼結果(一" "個 :class:`dict`\\ )將被傳入這個函式、並使用 *object_hook* 的回傳值來取代原" "先的 :class:`dict` 輸出。此功能可用於實作自訂解碼器(例如 `JSON-RPC `_ 類別提示)。" -#: ../../library/json.rst:248 +#: ../../library/json.rst:290 +#, fuzzy msgid "" -"*object_pairs_hook* is an optional function that will be called with the " -"result of any object literal decoded with an ordered list of pairs. The " -"return value of *object_pairs_hook* will be used instead of the :class:" -"`dict`. This feature can be used to implement custom decoders. If " -"*object_hook* is also defined, the *object_pairs_hook* takes priority." +"If set, a function that is called with the result of any object literal " +"decoded with an ordered list of pairs. The return value of this function " +"will be used instead of the :class:`dict`. This feature can be used to " +"implement custom decoders. If *object_hook* is also set, *object_pairs_hook* " +"takes priority. Default ``None``." msgstr "" "*object_pairs_hook* 是一個可選引數,其接受一個函式作為輸入。原始的有序對串列" "(ordered list of pairs)解碼結果將被傳入這個函式、並使用 " "*object_pairs_hook* 的回傳值來取代原先的 :class:`dict` 輸出。此功能可用於實作" "自訂解碼器。如果也同時給定了 *object_hook*,則 *object_pairs_hook* 優先。" -#: ../../library/json.rst:254 ../../library/json.rst:358 -msgid "Added support for *object_pairs_hook*." -msgstr "新增對於 *object_pairs_hook* 的支援。" - -#: ../../library/json.rst:257 ../../library/json.rst:361 +#: ../../library/json.rst:300 +#, fuzzy msgid "" -"*parse_float* is an optional function that will be called with the string of " -"every JSON float to be decoded. By default, this is equivalent to " -"``float(num_str)``. This can be used to use another datatype or parser for " -"JSON floats (e.g. :class:`decimal.Decimal`)." +"If set, a function that is called with the string of every JSON float to be " +"decoded. If ``None`` (the default), it is equivalent to ``float(num_str)``. " +"This can be used to parse JSON floats into custom datatypes, for " +"example :class:`decimal.Decimal`." msgstr "" "*parse_float* 為可選函式,每個要被解碼的 JSON 浮點數字串都會改用這個參數給定" "的函式來進行解碼。預設情況這等效於 ``float(num_str)``。這個參數可用於將 JSON " "中的浮點數解碼或剖析為另一種資料型別(例如 :class:`decimal.Decimal`\\ )。" -#: ../../library/json.rst:262 ../../library/json.rst:366 +#: ../../library/json.rst:308 +#, fuzzy msgid "" -"*parse_int* is an optional function that will be called with the string of " -"every JSON int to be decoded. By default, this is equivalent to " -"``int(num_str)``. This can be used to use another datatype or parser for " -"JSON integers (e.g. :class:`float`)." +"If set, a function that is called with the string of every JSON int to be " +"decoded. If ``None`` (the default), it is equivalent to ``int(num_str)``. " +"This can be used to parse JSON integers into custom datatypes, for " +"example :class:`float`." msgstr "" "*parse_int* 為可選函式,當解碼 JSON 整數字串時會被呼叫。預設情況等效於 " "``int(num_str)``。這個參數可用於將 JSON 中的整數解碼或剖析為另一種資料型別" "(例如 :class:`float`)。" -#: ../../library/json.rst:267 +#: ../../library/json.rst:316 +#, fuzzy msgid "" -"The default *parse_int* of :func:`int` now limits the maximum length of the " -"integer string via the interpreter's :ref:`integer string conversion length " -"limitation ` to help avoid denial of service attacks." -msgstr "" -"預設 *parse_int* 使用的 :func:`int` 函式現在有限制整數字串的長度上限了,限制" -"由直譯器的\\ :ref:`整數字串轉換長度限制 `\\ 機制來達成," -"這能防止阻斷服務攻擊 (Denial of Service attacks)。" - -#: ../../library/json.rst:273 ../../library/json.rst:371 -msgid "" -"*parse_constant* is an optional function that will be called with one of the " -"following strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. This can be " -"used to raise an exception if invalid JSON numbers are encountered." +"If set, a function that is called with one of the following strings: ``'-" +"Infinity'``, ``'Infinity'``, or ``'NaN'``. This can be used to raise an " +"exception if invalid JSON numbers are encountered. Default ``None``." msgstr "" "*parse_constant* 為可選函式,在解碼時若遭遇字串 ``'-Infinity'``、" "``'Infinity'`` 或 ``'NaN'`` 其中之一則會改用這個參數給定的函式來進行解碼。這" "也可用於使解碼過程中遇到無效的 JSON 數字時引發一個例外。" -#: ../../library/json.rst:277 -msgid "*parse_constant* doesn't get called on 'null', 'true', 'false' anymore." +#: ../../library/json.rst:0 +msgid "Raises" msgstr "" -"遭遇 'null'、'true' 或 'false' 時不再以 *parse_constant* 給定的函式來處理了。" -#: ../../library/json.rst:280 -msgid "" -"To use a custom :class:`JSONDecoder` subclass, specify it with the ``cls`` " -"kwarg; otherwise :class:`JSONDecoder` is used. Additional keyword arguments " -"will be passed to the constructor of the class." +#: ../../library/json.rst:324 +#, fuzzy +msgid "When the data being deserialized is not a valid JSON document." msgstr "" -"若想要使用自訂的 :class:`JSONDecoder` 子類別物件,請以 ``cls`` 關鍵字引數指定" -"之,否則將使用預設的 :class:`JSONDecoder`。其他未使用到的關鍵字引數將繼續傳入" -"給 JSONDecoder 的建構函式使用。" +"如果被去序列化(deserialized)的資料不符合 JSON 格式,將會引" +"發 :exc:`JSONDecodeError` 例外。" -#: ../../library/json.rst:284 ../../library/json.rst:302 -#: ../../library/json.rst:380 +#: ../../library/json.rst:327 +#, fuzzy msgid "" -"If the data being deserialized is not a valid JSON document, a :exc:" -"`JSONDecodeError` will be raised." +"When the data being deserialized does not contain UTF-8, UTF-16 or UTF-32 " +"encoded data." msgstr "" -"如果被去序列化(deserialized)的資料不符合 JSON 格式,將會引發 :exc:" -"`JSONDecodeError` 例外。" +"如果被去序列化(deserialized)的資料不符合 JSON 格式,將會引" +"發 :exc:`JSONDecodeError` 例外。" -#: ../../library/json.rst:290 +#: ../../library/json.rst:333 +msgid "Added the optional *object_pairs_hook* parameter." +msgstr "新增可選的 *object_pairs_hook* 參數。" + +#: ../../library/json.rst:334 +msgid "*parse_constant* doesn't get called on 'null', 'true', 'false' anymore." +msgstr "" +"遭遇 'null'、'true' 或 'false' 時不再以 *parse_constant* 給定的函式來處理了。" + +#: ../../library/json.rst:339 msgid "" "*fp* can now be a :term:`binary file`. The input encoding should be UTF-8, " "UTF-16 or UTF-32." @@ -553,21 +546,29 @@ msgstr "" "現在,*fp* 可以是一個\\ :term:`二進位檔案 `,前提是其編碼格式為 " "UTF-8、UTF-16 或 UTF-32。" -#: ../../library/json.rst:296 +#: ../../library/json.rst:342 msgid "" -"Deserialize *s* (a :class:`str`, :class:`bytes` or :class:`bytearray` " -"instance containing a JSON document) to a Python object using this :ref:" -"`conversion table `." +"The default *parse_int* of :func:`int` now limits the maximum length of the " +"integer string via the interpreter's :ref:`integer string conversion length " +"limitation ` to help avoid denial of service attacks." msgstr "" -"使用\\ :ref:`轉換表 `\\ 將 *s* (一個含有 JSON 文件的 :" -"class:`str`、:class:`bytes` 或 :class:`bytearray` 的實例(instance))去序列" -"化(deserialize)為一個 Python 物件" +"預設 *parse_int* 使用的 :func:`int` 函式現在有限制整數字串的長度上限了,限制" +"由直譯器的\\ :ref:`整數字串轉換長度限制 `\\ 機制來達成," +"這能防止阻斷服務攻擊 (Denial of Service attacks)。" -#: ../../library/json.rst:300 -msgid "The other arguments have the same meaning as in :func:`load`." -msgstr "其餘引數的使用方式與意義和 :func:`load` 的相同。" +#: ../../library/json.rst:350 +#, fuzzy +msgid "" +"Identical to :func:`load`, but instead of a file-like object, deserialize " +"*s* (a :class:`str`, :class:`bytes` or :class:`bytearray` instance " +"containing a JSON document) to a Python object using this :ref:`conversion " +"table `." +msgstr "" +"使用\\ :ref:`轉換表 `\\ 將 *s* (一個含有 JSON 文件" +"的 :class:`str`、:class:`bytes` 或 :class:`bytearray` 的實例(instance))去" +"序列化(deserialize)為一個 Python 物件" -#: ../../library/json.rst:305 +#: ../../library/json.rst:355 msgid "" "*s* can now be of type :class:`bytes` or :class:`bytearray`. The input " "encoding should be UTF-8, UTF-16 or UTF-32." @@ -575,95 +576,95 @@ msgstr "" "現在,*s* 可以是一個二進位檔案如 :class:`bytes` 或 :class:`bytearray`,前提是" "其編碼格式為 UTF-8、UTF-16 或 UTF-32。" -#: ../../library/json.rst:309 +#: ../../library/json.rst:359 msgid "The keyword argument *encoding* has been removed." msgstr "刪除關鍵字引數 *encoding*。" -#: ../../library/json.rst:314 +#: ../../library/json.rst:364 msgid "Encoders and Decoders" msgstr "編碼器與解碼器" -#: ../../library/json.rst:318 +#: ../../library/json.rst:368 msgid "Simple JSON decoder." msgstr "簡易 JSON 解碼器" -#: ../../library/json.rst:320 +#: ../../library/json.rst:370 msgid "Performs the following translations in decoding by default:" msgstr "預設將執行下列資料型別轉換:" -#: ../../library/json.rst:325 ../../library/json.rst:413 +#: ../../library/json.rst:375 ../../library/json.rst:463 msgid "JSON" msgstr "JSON" -#: ../../library/json.rst:325 ../../library/json.rst:413 +#: ../../library/json.rst:375 ../../library/json.rst:463 msgid "Python" msgstr "Python" -#: ../../library/json.rst:327 ../../library/json.rst:415 +#: ../../library/json.rst:377 ../../library/json.rst:465 msgid "object" msgstr "object" -#: ../../library/json.rst:327 ../../library/json.rst:415 +#: ../../library/json.rst:377 ../../library/json.rst:465 msgid "dict" msgstr "dict" -#: ../../library/json.rst:329 ../../library/json.rst:417 +#: ../../library/json.rst:379 ../../library/json.rst:467 msgid "array" msgstr "array" -#: ../../library/json.rst:329 +#: ../../library/json.rst:379 msgid "list" msgstr "list" -#: ../../library/json.rst:331 ../../library/json.rst:419 +#: ../../library/json.rst:381 ../../library/json.rst:469 msgid "string" msgstr "string" -#: ../../library/json.rst:331 ../../library/json.rst:419 +#: ../../library/json.rst:381 ../../library/json.rst:469 msgid "str" msgstr "str" -#: ../../library/json.rst:333 +#: ../../library/json.rst:383 msgid "number (int)" msgstr "number (整數)" -#: ../../library/json.rst:333 +#: ../../library/json.rst:383 msgid "int" msgstr "int" -#: ../../library/json.rst:335 +#: ../../library/json.rst:385 msgid "number (real)" msgstr "number (實數)" -#: ../../library/json.rst:335 +#: ../../library/json.rst:385 msgid "float" msgstr "float" -#: ../../library/json.rst:337 ../../library/json.rst:423 +#: ../../library/json.rst:387 ../../library/json.rst:473 msgid "true" msgstr "true" -#: ../../library/json.rst:337 ../../library/json.rst:423 +#: ../../library/json.rst:387 ../../library/json.rst:473 msgid "True" msgstr "True" -#: ../../library/json.rst:339 ../../library/json.rst:425 +#: ../../library/json.rst:389 ../../library/json.rst:475 msgid "false" msgstr "false" -#: ../../library/json.rst:339 ../../library/json.rst:425 +#: ../../library/json.rst:389 ../../library/json.rst:475 msgid "False" msgstr "False" -#: ../../library/json.rst:341 ../../library/json.rst:427 +#: ../../library/json.rst:391 ../../library/json.rst:477 msgid "null" msgstr "null" -#: ../../library/json.rst:341 ../../library/json.rst:427 +#: ../../library/json.rst:391 ../../library/json.rst:477 msgid "None" msgstr "None" -#: ../../library/json.rst:344 +#: ../../library/json.rst:394 msgid "" "It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their " "corresponding ``float`` values, which is outside the JSON spec." @@ -671,27 +672,63 @@ msgstr "" "雖然 ``NaN``、``Infinity`` 和 ``-Infinity`` 並不符合 JSON 規範,但解碼器依然" "能正確地將其轉換到相應的 Python ``float`` 值。" -#: ../../library/json.rst:347 +#: ../../library/json.rst:397 msgid "" "*object_hook* is an optional function that will be called with the result of " "every JSON object decoded and its return value will be used in place of the " -"given :class:`dict`. This can be used to provide custom deserializations (e." -"g. to support `JSON-RPC `_ class hinting)." +"given :class:`dict`. This can be used to provide custom deserializations " +"(e.g. to support `JSON-RPC `_ class hinting)." msgstr "" "*object_hook* 是一個可選函式,其接受一個解碼後的 JSON 物件作為輸入,並使用其" "回傳值來取代原先的 :class:`dict`。這個功能可用於提供自訂的去序列化(例如支援 " "`JSON-RPC `_ 類別提示)。" -#: ../../library/json.rst:352 +#: ../../library/json.rst:402 msgid "" "*object_pairs_hook* is an optional function that will be called with the " "result of every JSON object decoded with an ordered list of pairs. The " -"return value of *object_pairs_hook* will be used instead of the :class:" -"`dict`. This feature can be used to implement custom decoders. If " -"*object_hook* is also defined, the *object_pairs_hook* takes priority." +"return value of *object_pairs_hook* will be used instead of " +"the :class:`dict`. This feature can be used to implement custom decoders. " +"If *object_hook* is also defined, the *object_pairs_hook* takes priority." +msgstr "" + +#: ../../library/json.rst:408 +msgid "Added support for *object_pairs_hook*." +msgstr "新增對於 *object_pairs_hook* 的支援。" + +#: ../../library/json.rst:411 +msgid "" +"*parse_float* is an optional function that will be called with the string of " +"every JSON float to be decoded. By default, this is equivalent to " +"``float(num_str)``. This can be used to use another datatype or parser for " +"JSON floats (e.g. :class:`decimal.Decimal`)." msgstr "" +"*parse_float* 為可選函式,每個要被解碼的 JSON 浮點數字串都會改用這個參數給定" +"的函式來進行解碼。預設情況這等效於 ``float(num_str)``。這個參數可用於將 JSON " +"中的浮點數解碼或剖析為另一種資料型別(例如 :class:`decimal.Decimal`\\ )。" -#: ../../library/json.rst:375 +#: ../../library/json.rst:416 +msgid "" +"*parse_int* is an optional function that will be called with the string of " +"every JSON int to be decoded. By default, this is equivalent to " +"``int(num_str)``. This can be used to use another datatype or parser for " +"JSON integers (e.g. :class:`float`)." +msgstr "" +"*parse_int* 為可選函式,當解碼 JSON 整數字串時會被呼叫。預設情況等效於 " +"``int(num_str)``。這個參數可用於將 JSON 中的整數解碼或剖析為另一種資料型別" +"(例如 :class:`float`)。" + +#: ../../library/json.rst:421 +msgid "" +"*parse_constant* is an optional function that will be called with one of the " +"following strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. This can be " +"used to raise an exception if invalid JSON numbers are encountered." +msgstr "" +"*parse_constant* 為可選函式,在解碼時若遭遇字串 ``'-Infinity'``、" +"``'Infinity'`` 或 ``'NaN'`` 其中之一則會改用這個參數給定的函式來進行解碼。這" +"也可用於使解碼過程中遇到無效的 JSON 數字時引發一個例外。" + +#: ../../library/json.rst:425 msgid "" "If *strict* is false (``True`` is the default), then control characters will " "be allowed inside strings. Control characters in this context are those " @@ -702,25 +739,33 @@ msgstr "" "語境中的控制字元指的是 ASCII 字元編碼在 0~31 範圍內的字元,包括 ``'\\t'``" "(tab)、``'\\n'``、``'\\r'`` 和 ``'\\0'``。" -#: ../../library/json.rst:383 ../../library/json.rst:484 +#: ../../library/json.rst:430 +msgid "" +"If the data being deserialized is not a valid JSON document, " +"a :exc:`JSONDecodeError` will be raised." +msgstr "" +"如果被去序列化(deserialized)的資料不符合 JSON 格式,將會引" +"發 :exc:`JSONDecodeError` 例外。" + +#: ../../library/json.rst:433 ../../library/json.rst:534 msgid "All parameters are now :ref:`keyword-only `." msgstr "" "所有參數現在都是\\ :ref:`僅限關鍵字參數 `\\ 了。" -#: ../../library/json.rst:388 +#: ../../library/json.rst:438 msgid "" "Return the Python representation of *s* (a :class:`str` instance containing " "a JSON document)." msgstr "" "回傳用 Python 型式表達的 *s* (一個含有 JSON 文件的 :class:`str` 實例)。" -#: ../../library/json.rst:391 +#: ../../library/json.rst:441 msgid "" ":exc:`JSONDecodeError` will be raised if the given JSON document is not " "valid." msgstr "若給定的輸入不符合 JSON 格式會引發 :exc:`JSONDecodeError` 例外。" -#: ../../library/json.rst:396 +#: ../../library/json.rst:446 msgid "" "Decode a JSON document from *s* (a :class:`str` beginning with a JSON " "document) and return a 2-tuple of the Python representation and the index in " @@ -729,43 +774,43 @@ msgstr "" "將 *s* (一個開頭部分含有合格 JSON 文件的 :class:`str`) 解碼,並將 JSON 文件" "結束點的索引值(index)和解碼結果合併為一個二元組(2-tuple)後回傳。" -#: ../../library/json.rst:400 +#: ../../library/json.rst:450 msgid "" "This can be used to decode a JSON document from a string that may have " "extraneous data at the end." msgstr "這個方法可以用來解碼尾段可能帶有 JSON 以外資料的文字。" -#: ../../library/json.rst:406 +#: ../../library/json.rst:456 msgid "Extensible JSON encoder for Python data structures." msgstr "可擴充的 Python 資料結構 JSON 編碼器。" -#: ../../library/json.rst:408 +#: ../../library/json.rst:458 msgid "Supports the following objects and types by default:" msgstr "預設可支援下列物件及型別:" -#: ../../library/json.rst:417 +#: ../../library/json.rst:467 msgid "list, tuple" msgstr "list, tuple" -#: ../../library/json.rst:421 +#: ../../library/json.rst:471 msgid "int, float, int- & float-derived Enums" msgstr "" "int、float 或可作為整數或浮點數運算的衍生列舉(int- or float-derived Enums)" -#: ../../library/json.rst:421 +#: ../../library/json.rst:471 msgid "number" msgstr "number" -#: ../../library/json.rst:430 +#: ../../library/json.rst:480 msgid "Added support for int- and float-derived Enum classes." msgstr "" "增加對整數(int)、浮點數(float)或可作為整數或浮點數運算的衍生列舉(int- " "or float-derived Enums)類別的支援性。" -#: ../../library/json.rst:433 +#: ../../library/json.rst:483 msgid "" -"To extend this to recognize other objects, subclass and implement a :meth:" -"`~JSONEncoder.default` method with another method that returns a " +"To extend this to recognize other objects, subclass and implement " +"a :meth:`~JSONEncoder.default` method with another method that returns a " "serializable object for ``o`` if possible, otherwise it should call the " "superclass implementation (to raise :exc:`TypeError`)." msgstr "" @@ -773,17 +818,27 @@ msgstr "" "方法。此方法應回傳一個可序列化的 ``o`` 物件,否則此方法應呼叫父類別的 " "JSONEncoder.default 方法(以引發 :exc:`TypeError` 例外)。" -#: ../../library/json.rst:438 +#: ../../library/json.rst:488 msgid "" "If *skipkeys* is false (the default), a :exc:`TypeError` will be raised when " -"trying to encode keys that are not :class:`str`, :class:`int`, :class:" -"`float` or ``None``. If *skipkeys* is true, such items are simply skipped." +"trying to encode keys that are " +"not :class:`str`, :class:`int`, :class:`float` or ``None``. If *skipkeys* " +"is true, such items are simply skipped." msgstr "" -"若 *skipkeys* 為 false(預設值),則當在編碼不是 :class:`str`、:class:" -"`int`、:class:`float` 或 ``None`` 的鍵值時,將引發 :exc:`TypeError`。如果 " -"*skipkeys* 為 true,這些項目將直接被跳過。" +"若 *skipkeys* 為 false(預設值),則當在編碼不" +"是 :class:`str`、:class:`int`、:class:`float` 或 ``None`` 的鍵值時,將引" +"發 :exc:`TypeError`。如果 *skipkeys* 為 true,這些項目將直接被跳過。" -#: ../../library/json.rst:446 +#: ../../library/json.rst:492 +msgid "" +"If *ensure_ascii* is true (the default), the output is guaranteed to have " +"all incoming non-ASCII characters escaped. If *ensure_ascii* is false, " +"these characters will be output as-is." +msgstr "" +"如果 *ensure_ascii* 被設為 true(預設值),則輸出時將確保所有輸入的非 ASCII " +"字元都會被轉義。若 *ensure_ascii* 為 false,則這些字元將照原樣輸出。" + +#: ../../library/json.rst:496 msgid "" "If *check_circular* is true (the default), then lists, dicts, and custom " "encoded objects will be checked for circular references during encoding to " @@ -791,10 +846,10 @@ msgid "" "Otherwise, no such check takes place." msgstr "" "如果 *check_circular* 為 true(預設值),則會在編碼期間檢查串列(list)、字典" -"(dict)和自訂編碼物件的循環參照,以防止無限遞迴(一個會導致 :exc:" -"`RecursionError` 例外的問題)。否則不會進行此類檢查。" +"(dict)和自訂編碼物件的循環參照,以防止無限遞迴(一個會導" +"致 :exc:`RecursionError` 例外的問題)。否則不會進行此類檢查。" -#: ../../library/json.rst:451 +#: ../../library/json.rst:501 msgid "" "If *allow_nan* is true (the default), then ``NaN``, ``Infinity``, and ``-" "Infinity`` will be encoded as such. This behavior is not JSON specification " @@ -806,7 +861,7 @@ msgstr "" "數基於 JavaScript 的編碼器和解碼器一致。否則若設為 false,嘗試對這些浮點數進" "行編碼將引發 :exc:`ValueError` 例外。" -#: ../../library/json.rst:457 +#: ../../library/json.rst:507 msgid "" "If *sort_keys* is true (default: ``False``), then the output of dictionaries " "will be sorted by key; this is useful for regression tests to ensure that " @@ -816,24 +871,61 @@ msgstr "" "按鍵值排序。這項功能可確保 JSON 序列化的結果能被互相比較,能讓日常的回歸測試" "檢查變得方便一些。" -#: ../../library/json.rst:490 +#: ../../library/json.rst:511 +msgid "" +"If *indent* is a non-negative integer or string, then JSON array elements " +"and object members will be pretty-printed with that indent level. An indent " +"level of 0, negative, or ``\"\"`` will only insert newlines. ``None`` (the " +"default) selects the most compact representation. Using a positive integer " +"indent indents that many spaces per level. If *indent* is a string (such as " +"``\"\\t\"``), that string is used to indent each level." +msgstr "" +"如果 *indent* 是非負整數或字串,則 JSON 陣列元素和物件成員將使用該縮排等級進" +"行格式美化。縮排等級 0、負數或 ``\"\"`` 只會插入換行符號。``None``\\ (預設" +"值)等於是選擇最緊湊的表示法。使用正整數縮排可以在每層縮排數量相同的空格。如" +"果 *indent* 是一個字串(例如 ``\"\\t\"``\\ ),則該字串用於縮排每個層級。" + +#: ../../library/json.rst:521 +msgid "" +"If specified, *separators* should be an ``(item_separator, key_separator)`` " +"tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', " +"': ')`` otherwise. To get the most compact JSON representation, you should " +"specify ``(',', ':')`` to eliminate whitespace." +msgstr "" +"如果有指定本引數內容,*separators* 應該是一個 ``(item_separator, " +"key_separator)`` 二元組。如果 *indent* 為 ``None`` 則預設為 ``(', ', ': " +"')``,否則預設為 ``(',', ': ')``。想要獲得最緊湊的 JSON 表示形式,你可以改成" +"指定 ``(',', ':')`` 來消除空格。" + +#: ../../library/json.rst:529 +msgid "" +"If specified, *default* should be a function that gets called for objects " +"that can't otherwise be serialized. It should return a JSON encodable " +"version of the object or raise a :exc:`TypeError`. If not " +"specified, :exc:`TypeError` is raised." +msgstr "" +"如果有指定本參數,*default* 會是一個遭遇無法序列化的物件時會被呼叫的函式。它" +"應該回傳該物件的 JSON 可編碼版本或引發 :exc:`TypeError`。如果未指定,則會直接" +"引發 :exc:`TypeError`。" + +#: ../../library/json.rst:540 msgid "" "Implement this method in a subclass such that it returns a serializable " -"object for *o*, or calls the base implementation (to raise a :exc:" -"`TypeError`)." +"object for *o*, or calls the base implementation (to raise " +"a :exc:`TypeError`)." msgstr "" "在任意一個子類別裡實作這個方法時須讓其回傳一個可序列化的物件 *o* ,或呼叫原始" "的實作以引發 :exc:`TypeError` 例外。" -#: ../../library/json.rst:494 +#: ../../library/json.rst:544 msgid "" -"For example, to support arbitrary iterators, you could implement :meth:" -"`~JSONEncoder.default` like this::" +"For example, to support arbitrary iterators, you could " +"implement :meth:`~JSONEncoder.default` like this::" msgstr "" -"舉例來說,想要讓編碼器支援任意疊代器(iterator),你可以實作這樣子的 :meth:" -"`~JSONEncoder.default`: ::" +"舉例來說,想要讓編碼器支援任意疊代器(iterator),你可以實作這樣子" +"的 :meth:`~JSONEncoder.default`: ::" -#: ../../library/json.rst:497 +#: ../../library/json.rst:547 msgid "" "def default(self, o):\n" " try:\n" @@ -846,13 +938,13 @@ msgid "" " return super().default(o)" msgstr "" -#: ../../library/json.rst:510 +#: ../../library/json.rst:560 msgid "" "Return a JSON string representation of a Python data structure, *o*. For " "example::" msgstr "回傳一個 Python 資料結構物件 *o* 的 JSON 的字串表示。例如: ::" -#: ../../library/json.rst:513 +#: ../../library/json.rst:563 msgid "" ">>> json.JSONEncoder().encode({\"foo\": [\"bar\", \"baz\"]})\n" "'{\"foo\": [\"bar\", \"baz\"]}'" @@ -860,7 +952,7 @@ msgstr "" ">>> json.JSONEncoder().encode({\"foo\": [\"bar\", \"baz\"]})\n" "'{\"foo\": [\"bar\", \"baz\"]}'" -#: ../../library/json.rst:519 +#: ../../library/json.rst:569 msgid "" "Encode the given object, *o*, and yield each string representation as " "available. For example::" @@ -868,7 +960,7 @@ msgstr "" "將物件 *o* 編碼,並將結果統整為一個能依序產生(yield)各結果字串的物件。如下" "例: ::" -#: ../../library/json.rst:522 +#: ../../library/json.rst:572 msgid "" "for chunk in json.JSONEncoder().iterencode(bigobject):\n" " mysocket.write(chunk)" @@ -876,39 +968,39 @@ msgstr "" "for chunk in json.JSONEncoder().iterencode(bigobject):\n" " mysocket.write(chunk)" -#: ../../library/json.rst:527 +#: ../../library/json.rst:577 msgid "Exceptions" msgstr "例外" -#: ../../library/json.rst:531 +#: ../../library/json.rst:581 msgid "Subclass of :exc:`ValueError` with the following additional attributes:" msgstr ":exc:`ValueError` 的子類別具有下列額外屬性:" -#: ../../library/json.rst:535 +#: ../../library/json.rst:585 msgid "The unformatted error message." msgstr "未受格式化的錯誤訊息。" -#: ../../library/json.rst:539 +#: ../../library/json.rst:589 msgid "The JSON document being parsed." msgstr "正在被剖析的 JSON 文件。" -#: ../../library/json.rst:543 +#: ../../library/json.rst:593 msgid "The start index of *doc* where parsing failed." msgstr "*doc* 剖析失敗處的起始點的索引值。" -#: ../../library/json.rst:547 +#: ../../library/json.rst:597 msgid "The line corresponding to *pos*." msgstr "*pos* 所在的列(line)數。" -#: ../../library/json.rst:551 +#: ../../library/json.rst:601 msgid "The column corresponding to *pos*." msgstr "*pos* 所在的行(column)數。" -#: ../../library/json.rst:557 +#: ../../library/json.rst:607 msgid "Standard Compliance and Interoperability" msgstr "合規性與互通性(Interoperability)" -#: ../../library/json.rst:559 +#: ../../library/json.rst:609 msgid "" "The JSON format is specified by :rfc:`7159` and by `ECMA-404 `_. This " @@ -921,7 +1013,7 @@ msgstr "" "組對 RFC 的遵循程度。簡單起見,:class:`JSONEncoder` 和 :class:`JSONDecoder` " "子類別以及未明確提及的參數將不予討論。" -#: ../../library/json.rst:565 +#: ../../library/json.rst:615 msgid "" "This module does not comply with the RFC in a strict fashion, implementing " "some extensions that are valid JavaScript but not valid JSON. In particular:" @@ -929,17 +1021,17 @@ msgstr "" "這個模組的部份實作並未非常嚴格地遵循 RFC 規範。準確來說,下列實際實作符合 " "JavaScript 語法格式,但並不符合 JSON 格式:" -#: ../../library/json.rst:568 +#: ../../library/json.rst:618 msgid "Infinite and NaN number values are accepted and output;" msgstr "無限(Infinite)和非數字(NaN)值會被接受。" -#: ../../library/json.rst:569 +#: ../../library/json.rst:619 msgid "" "Repeated names within an object are accepted, and only the value of the last " "name-value pair is used." msgstr "同一個物件內可以有重複的名稱,但只有最後一個同名物件是有效的。" -#: ../../library/json.rst:572 +#: ../../library/json.rst:622 msgid "" "Since the RFC permits RFC-compliant parsers to accept input texts that are " "not RFC-compliant, this module's deserializer is technically RFC-compliant " @@ -948,11 +1040,11 @@ msgstr "" "不過 RFC 准許遵循 RFC 的剖析器接受不合規的文字輸入,所以技術上來說若以預設設" "定運作,本模組的去序列化器(deserializer)是符合 RFC 規範的。" -#: ../../library/json.rst:577 +#: ../../library/json.rst:627 msgid "Character Encodings" msgstr "字元編碼格式" -#: ../../library/json.rst:579 +#: ../../library/json.rst:629 msgid "" "The RFC requires that JSON be represented using either UTF-8, UTF-16, or " "UTF-32, with UTF-8 being the recommended default for maximum " @@ -961,7 +1053,7 @@ msgstr "" "RFC 要求 JSON 必須以 UTF-8、UTF-16 或 UTF-32 格式編碼。並推薦以 UTF-8 編碼以" "達成最佳的互通性。" -#: ../../library/json.rst:582 +#: ../../library/json.rst:632 msgid "" "As permitted, though not required, by the RFC, this module's serializer sets " "*ensure_ascii=True* by default, thus escaping the output so that the " @@ -970,17 +1062,18 @@ msgstr "" "RFC 准許但並不強制編碼器的 *ensure_ascii=True* 行為是預設值,但本模組依然實作" "了此一選項作為預設,因此本模組預設會轉義所有非 ASCII 字元。" -#: ../../library/json.rst:586 +#: ../../library/json.rst:636 msgid "" "Other than the *ensure_ascii* parameter, this module is defined strictly in " "terms of conversion between Python objects and :class:`Unicode strings " "`, and thus does not otherwise directly address the issue of character " "encodings." msgstr "" -"除了 *ensure_ascii* 選項參數之外,本模組嚴格遵循 Python 物件與 :class:" -"`Unicode strings ` 之間的轉換規範,因此並不另外處理字元編碼的問題。" +"除了 *ensure_ascii* 選項參數之外,本模組嚴格遵循 Python 物件" +"與 :class:`Unicode strings ` 之間的轉換規範,因此並不另外處理字元編碼的" +"問題。" -#: ../../library/json.rst:591 +#: ../../library/json.rst:641 msgid "" "The RFC prohibits adding a byte order mark (BOM) to the start of a JSON " "text, and this module's serializer does not add a BOM to its output. The RFC " @@ -993,24 +1086,24 @@ msgstr "" "(deserializer)忽略文件初始的端序記號,因此本模組的去序列化器將在遭遇位於文" "件開頭的端序記號時引發 :exc:`ValueError` 例外。" -#: ../../library/json.rst:597 +#: ../../library/json.rst:647 msgid "" "The RFC does not explicitly forbid JSON strings which contain byte sequences " "that don't correspond to valid Unicode characters (e.g. unpaired UTF-16 " "surrogates), but it does note that they may cause interoperability problems. " -"By default, this module accepts and outputs (when present in the original :" -"class:`str`) code points for such sequences." +"By default, this module accepts and outputs (when present in the " +"original :class:`str`) code points for such sequences." msgstr "" "RFC 並未明確禁止 JSON 文件包含無法對應有效 Unicode 字元的位元組序列(例如未配" "對的 UTF-16 代理對(surrogate pairs)),但這個特性的確可能會引起相容性問題。" "預設情況下,當原始輸入的 :class:`str` 中存在此類序列時,該模組將接受並輸出這" "些序列的編碼位置(code points)。" -#: ../../library/json.rst:605 +#: ../../library/json.rst:655 msgid "Infinite and NaN Number Values" msgstr "正負無限與非數值" -#: ../../library/json.rst:607 +#: ../../library/json.rst:657 msgid "" "The RFC does not permit the representation of infinite or NaN number values. " "Despite that, by default, this module accepts and outputs ``Infinity``, ``-" @@ -1019,7 +1112,7 @@ msgstr "" "RFC 不允許表現無限大或非數值(NaN)。但預設情況下,這個模組仍接受並輸出 " "``Infinity``、``-Infinity`` 和 ``NaN``,如同它們是有效的 JSON 數值字面值: ::" -#: ../../library/json.rst:611 +#: ../../library/json.rst:661 msgid "" ">>> # Neither of these calls raises an exception, but the results are not " "valid JSON\n" @@ -1034,7 +1127,7 @@ msgid "" "nan" msgstr "" -#: ../../library/json.rst:622 +#: ../../library/json.rst:672 msgid "" "In the serializer, the *allow_nan* parameter can be used to alter this " "behavior. In the deserializer, the *parse_constant* parameter can be used " @@ -1043,11 +1136,11 @@ msgstr "" "在序列化器中,*allow_nan* 參數可以改變這個行為。在去序列化器中," "*parse_constant* 參數可以改變這個行為。" -#: ../../library/json.rst:628 +#: ../../library/json.rst:678 msgid "Repeated Names Within an Object" msgstr "物件內重複的名稱" -#: ../../library/json.rst:630 +#: ../../library/json.rst:680 msgid "" "The RFC specifies that the names within a JSON object should be unique, but " "does not mandate how repeated names in JSON objects should be handled. By " @@ -1058,22 +1151,22 @@ msgstr "" "字。預設情況下,本模組不會因此引發例外;相反的,它會忽略該名字的所有重複鍵值" "對,並只保留最後一個: ::" -#: ../../library/json.rst:635 +#: ../../library/json.rst:685 msgid "" ">>> weird_json = '{\"x\": 1, \"x\": 2, \"x\": 3}'\n" ">>> json.loads(weird_json)\n" "{'x': 3}" msgstr "" -#: ../../library/json.rst:639 +#: ../../library/json.rst:689 msgid "The *object_pairs_hook* parameter can be used to alter this behavior." msgstr "*object_parts_hook* 參數可以改變這個行為。" -#: ../../library/json.rst:643 +#: ../../library/json.rst:693 msgid "Top-level Non-Object, Non-Array Values" msgstr "位於頂層的非物件及非列表值" -#: ../../library/json.rst:645 +#: ../../library/json.rst:695 msgid "" "The old version of JSON specified by the obsolete :rfc:`4627` required that " "the top-level value of a JSON text must be either a JSON object or array " @@ -1087,37 +1180,37 @@ msgstr "" "boolean、數字或字串值。 :rfc:`7159` 移除了這個限制,而本模組的序列化器或去串" "列化器中未曾實施過該限制。" -#: ../../library/json.rst:652 +#: ../../library/json.rst:702 msgid "" "Regardless, for maximum interoperability, you may wish to voluntarily adhere " "to the restriction yourself." msgstr "如果想要最大限度地保留互通性,你可能還是會想要自行施加這個限制。" -#: ../../library/json.rst:657 +#: ../../library/json.rst:707 msgid "Implementation Limitations" msgstr "實作限制" -#: ../../library/json.rst:659 +#: ../../library/json.rst:709 msgid "Some JSON deserializer implementations may set limits on:" msgstr "某些 JSON 去序列化器的實作可能會造成下列限制:" -#: ../../library/json.rst:661 +#: ../../library/json.rst:711 msgid "the size of accepted JSON texts" msgstr "JSON 文件長度上限" -#: ../../library/json.rst:662 +#: ../../library/json.rst:712 msgid "the maximum level of nesting of JSON objects and arrays" msgstr "JSON 物件或陣列的最大巢狀層數(level of nesting)限制" -#: ../../library/json.rst:663 +#: ../../library/json.rst:713 msgid "the range and precision of JSON numbers" msgstr "數字的精準度或範圍" -#: ../../library/json.rst:664 +#: ../../library/json.rst:714 msgid "the content and maximum length of JSON strings" msgstr "JSON 字串長度上限" -#: ../../library/json.rst:666 +#: ../../library/json.rst:716 msgid "" "This module does not impose any such limits beyond those of the relevant " "Python datatypes themselves or the Python interpreter itself." @@ -1125,7 +1218,7 @@ msgstr "" "本模組除了 Python 資料型態本身或 Python 直譯器本身的限制以外,不會設定任何此" "類限制。" -#: ../../library/json.rst:669 +#: ../../library/json.rst:719 msgid "" "When serializing to JSON, beware any such limitations in applications that " "may consume your JSON. In particular, it is common for JSON numbers to be " @@ -1140,30 +1233,31 @@ msgstr "" "因而受到其表示範圍和精度限制的影響。這在序列化極大的 Python :class:`int` 數" "值、或是序列化特殊數字型別的實例時(例如 :class:`decimal.Decimal`)尤其重要。" -#: ../../library/json.rst:682 +#: ../../library/json.rst:732 msgid "Command Line Interface" msgstr "命令列介面" -#: ../../library/json.rst:687 +#: ../../library/json.rst:737 msgid "**Source code:** :source:`Lib/json/tool.py`" msgstr "**原始碼:**\\ :source:`Lib/json/tool.py`" -#: ../../library/json.rst:691 +#: ../../library/json.rst:741 msgid "" "The :mod:`json.tool` module provides a simple command line interface to " "validate and pretty-print JSON objects." msgstr "" ":mod:`json.tool` 模組提供了一個簡易的命令列介面以供校驗與美化呈現 JSON 物件。" -#: ../../library/json.rst:694 +#: ../../library/json.rst:744 msgid "" -"If the optional ``infile`` and ``outfile`` arguments are not specified, :" -"data:`sys.stdin` and :data:`sys.stdout` will be used respectively:" +"If the optional ``infile`` and ``outfile`` arguments are not " +"specified, :data:`sys.stdin` and :data:`sys.stdout` will be used " +"respectively:" msgstr "" -"如果沒有指定可選引數 ``infile`` 和 ``outfile`` ,則 :data:`sys.stdin` 和 :" -"data:`sys.stdout` 將各自做為輸入和輸出的預設值。" +"如果沒有指定可選引數 ``infile`` 和 ``outfile`` ,則 :data:`sys.stdin` " +"和 :data:`sys.stdout` 將各自做為輸入和輸出的預設值。" -#: ../../library/json.rst:697 +#: ../../library/json.rst:747 msgid "" "$ echo '{\"json\": \"obj\"}' | python -m json.tool\n" "{\n" @@ -1173,7 +1267,7 @@ msgid "" "Expecting property name enclosed in double quotes: line 1 column 2 (char 1)" msgstr "" -#: ../../library/json.rst:706 +#: ../../library/json.rst:756 msgid "" "The output is now in the same order as the input. Use the :option:`--sort-" "keys` option to sort the output of dictionaries alphabetically by key." @@ -1181,15 +1275,15 @@ msgstr "" "現在開始輸出和輸入的資料順序會是相同的。傳入 :option:`--sort-keys` 引數以按照" "鍵值的字母順序對輸出進行排序。" -#: ../../library/json.rst:713 +#: ../../library/json.rst:763 msgid "Command line options" msgstr "命令列選項" -#: ../../library/json.rst:717 +#: ../../library/json.rst:767 msgid "The JSON file to be validated or pretty-printed:" msgstr "將被用於校驗或美化呈現的 JSON 文件:" -#: ../../library/json.rst:719 +#: ../../library/json.rst:769 msgid "" "$ python -m json.tool mp_films.json\n" "[\n" @@ -1215,45 +1309,45 @@ msgstr "" " }\n" "]" -#: ../../library/json.rst:733 +#: ../../library/json.rst:783 msgid "If *infile* is not specified, read from :data:`sys.stdin`." msgstr "如果沒有指定 *infile* 則會從 :data:`sys.stdin` 讀取輸入。" -#: ../../library/json.rst:737 +#: ../../library/json.rst:787 msgid "" "Write the output of the *infile* to the given *outfile*. Otherwise, write it " "to :data:`sys.stdout`." msgstr "" -"將 *infile* 的結果寫入到給定的 *outfile*。若未提供則寫入到 :data:`sys." -"stdout`。" +"將 *infile* 的結果寫入到給定的 *outfile*。若未提供則寫入" +"到 :data:`sys.stdout`。" -#: ../../library/json.rst:742 +#: ../../library/json.rst:792 msgid "Sort the output of dictionaries alphabetically by key." msgstr "按照鍵值的字母順序對輸出字典進行排序。" -#: ../../library/json.rst:748 +#: ../../library/json.rst:798 msgid "" "Disable escaping of non-ascii characters, see :func:`json.dumps` for more " "information." msgstr "關閉非 ASCII 字元的自動轉義功能。詳情請參照 :func:`json.dumps`。" -#: ../../library/json.rst:754 +#: ../../library/json.rst:804 msgid "Parse every input line as separate JSON object." msgstr "將每一行輸入都單獨輸出為一個 JSON 物件。" -#: ../../library/json.rst:760 +#: ../../library/json.rst:810 msgid "Mutually exclusive options for whitespace control." msgstr "互斥的空白字元控制選項。" -#: ../../library/json.rst:766 +#: ../../library/json.rst:816 msgid "Show the help message." msgstr "顯示說明訊息。" -#: ../../library/json.rst:770 +#: ../../library/json.rst:820 msgid "Footnotes" msgstr "註解" -#: ../../library/json.rst:771 +#: ../../library/json.rst:821 msgid "" "As noted in `the errata for RFC 7159 `_, JSON permits literal U+2028 (LINE SEPARATOR) " @@ -1263,16 +1357,3 @@ msgstr "" "如 `RFC 7159 更正 `_ " "所述,JSON 允許字串中出現 U+2028(列分隔符)和 U+2029(段落分隔符)字元,而 " "JavaScript(截至 ECMAScript 5.1 版)則不允許。" - -#~ msgid "" -#~ "*object_pairs_hook*, if specified will be called with the result of every " -#~ "JSON object decoded with an ordered list of pairs. The return value of " -#~ "*object_pairs_hook* will be used instead of the :class:`dict`. This " -#~ "feature can be used to implement custom decoders. If *object_hook* is " -#~ "also defined, the *object_pairs_hook* takes priority." -#~ msgstr "" -#~ "*object_pairs_hook* 是一個可選引數,其接受一個函式作為輸入。原始的有序對串" -#~ "列(ordered list of pairs)解碼結果將被傳入這個函式、並使用 " -#~ "*object_pairs_hook* 的回傳值來取代原先的 :class:`dict` 輸出。此功能可用於" -#~ "實作自訂解碼器。如果也同時給定了 *object_hook*,則 *object_pairs_hook* 優" -#~ "先。" diff --git a/library/logging.po b/library/logging.po index 8bfdaea17d..c11c77e048 100644 --- a/library/logging.po +++ b/library/logging.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2025-02-05 00:13+0000\n" "PO-Revision-Date: 2024-03-28 22:40+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -527,7 +527,7 @@ msgstr "" msgid "" "If no handler is attached to this logger (or any of its ancestors, taking " "into account the relevant :attr:`Logger.propagate` attributes), the message " -"will be sent to the handler set on :attr:`lastResort`." +"will be sent to the handler set on :data:`lastResort`." msgstr "" #: ../../library/logging.rst:347 diff --git a/library/math.po b/library/math.po index 8280532b1a..c6ffeda216 100644 --- a/library/math.po +++ b/library/math.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 00:14+0000\n" +"POT-Creation-Date: 2025-01-05 00:15+0000\n" "PO-Revision-Date: 2024-04-26 15:15+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -548,8 +548,8 @@ msgstr ":func:`lgamma(x) `" #: ../../library/math.rst:112 msgid "" -"Natural logarithm of the absolute value of the `Gamma function `_ at *x*" +"Natural logarithm of the absolute value of the `Gamma function `_ at *x*" msgstr "" #: ../../library/math.rst:114 @@ -622,11 +622,11 @@ msgstr "" #: ../../library/math.rst:139 ../../library/math.rst:205 msgid "" -"Raises :exc:`TypeError` if either of the arguments are not integers. Raises :" -"exc:`ValueError` if either of the arguments are negative." +"Raises :exc:`TypeError` if either of the arguments are not integers. " +"Raises :exc:`ValueError` if either of the arguments are negative." msgstr "" -"當任一參數非整數型別時會引發 :exc:`TypeError`。當任一參數為負數時會引發 :exc:" -"`ValueError`。" +"當任一參數非整數型別時會引發 :exc:`TypeError`。當任一參數為負數時會引" +"發 :exc:`ValueError`。" #: ../../library/math.rst:147 msgid "" @@ -714,12 +714,12 @@ msgstr "" #: ../../library/math.rst:216 msgid "" "Return the ceiling of *x*, the smallest integer greater than or equal to " -"*x*. If *x* is not a float, delegates to :meth:`x.__ceil__ `, which should return an :class:`~numbers.Integral` value." +"*x*. If *x* is not a float, delegates to :meth:`x.__ceil__ " +"`, which should return an :class:`~numbers.Integral` value." msgstr "" "回傳 *x* 經上取整的值,即大於或等於 *x* 的最小整數。若 *x* 並非浮點數,此函式" -"將委派給 :meth:`x.__ceil__ `,並回傳 :class:`~numbers." -"Integral` 型別的值。" +"將委派給 :meth:`x.__ceil__ `,並回" +"傳 :class:`~numbers.Integral` 型別的值。" #: ../../library/math.rst:223 msgid "Return the absolute value of *x*." @@ -732,8 +732,8 @@ msgid "" "which should return an :class:`~numbers.Integral` value." msgstr "" "回傳 *x* 經下取整的值,即小於或等於 *x* 的最大整數。若 *x* 並非浮點數,此函式" -"將委派給 :meth:`x.__floor__ `,並回傳 :class:`~numbers." -"Integral` 型別的值。" +"將委派給 :meth:`x.__floor__ `,並回" +"傳 :class:`~numbers.Integral` 型別的值。" #: ../../library/math.rst:235 msgid "" @@ -754,35 +754,36 @@ msgstr "" #: ../../library/math.rst:251 msgid "" -"Return ``fmod(x, y)``, as defined by the platform C library. Note that the " -"Python expression ``x % y`` may not return the same result. The intent of " -"the C standard is that ``fmod(x, y)`` be exactly (mathematically; to " -"infinite precision) equal to ``x - n*y`` for some integer *n* such that the " -"result has the same sign as *x* and magnitude less than ``abs(y)``. " -"Python's ``x % y`` returns a result with the sign of *y* instead, and may " -"not be exactly computable for float arguments. For example, ``fmod(-1e-100, " -"1e100)`` is ``-1e-100``, but the result of Python's ``-1e-100 % 1e100`` is " -"``1e100-1e-100``, which cannot be represented exactly as a float, and rounds " -"to the surprising ``1e100``. For this reason, function :func:`fmod` is " -"generally preferred when working with floats, while Python's ``x % y`` is " -"preferred when working with integers." -msgstr "" -"回傳 C 函式庫所定義的 ``fmod(x, y)`` 函式值。請注意此函式與 Python 運算式 " -"``x % y`` 可能會回傳不同結果。C 標準要求 ``fmod(x, y)`` 的回傳值完全等同(數" -"學定義上,即無限精度)於 ``x - n*y``,*n* 為可使回傳值與 *x* 同號且長度小於 " -"``abs(y)`` 的整數。Python 運算式 ``x % y`` 的回傳值則與 *y* 同號,且可能無法" -"精確地計算浮點數引數。例如:``fmod(-1e-100, 1e100)`` 的值為 ``-1e-100``,但 " -"Python 運算式 ``-1e-100 % 1e100`` 的結果為 ``1e100-1e-100``,此值無法準確地表" -"示成浮點數,並會四捨五入為出乎意料的 ``1e100``。因此,處理浮點數時通常會選擇" -"函式 :func:`fmod`,而處理整數時會選擇 Python 運算式 ``x % y``。" - -#: ../../library/math.rst:266 +"Return the floating-point remainder of ``x / y``, as defined by the platform " +"C library function ``fmod(x, y)``. Note that the Python expression ``x % y`` " +"may not return the same result. The intent of the C standard is that " +"``fmod(x, y)`` be exactly (mathematically; to infinite precision) equal to " +"``x - n*y`` for some integer *n* such that the result has the same sign as " +"*x* and magnitude less than ``abs(y)``. Python's ``x % y`` returns a result " +"with the sign of *y* instead, and may not be exactly computable for float " +"arguments. For example, ``fmod(-1e-100, 1e100)`` is ``-1e-100``, but the " +"result of Python's ``-1e-100 % 1e100`` is ``1e100-1e-100``, which cannot be " +"represented exactly as a float, and rounds to the surprising ``1e100``. For " +"this reason, function :func:`fmod` is generally preferred when working with " +"floats, while Python's ``x % y`` is preferred when working with integers." +msgstr "" +"回傳 ``x / y`` 的浮點數餘數,其以平臺上的 C 函式庫 ``fmod(x, y)`` 函式定義。" +"請注意此函式與 Python 運算式 ``x % y`` 可能不會回傳相同結果。C 標準要求 " +"``fmod(x, y)`` 的回傳值完全等同(數學定義上,即無限精度)於 ``x - n*y``,*n* " +"為可使回傳值與 *x* 同號且長度小於 ``abs(y)`` 的整數。Python 運算式 ``x % y`` " +"的回傳值則與 *y* 同號,且可能無法精確地計算浮點數引數。例如:``fmod(-1e-100, " +"1e100)`` 的值為 ``-1e-100``,但 Python 運算式 ``-1e-100 % 1e100`` 的結果為 " +"``1e100-1e-100``,此值無法準確地表示成浮點數,並會四捨五入為出乎意料的 " +"``1e100``。因此,處理浮點數時通常會選擇函式 :func:`fmod`,而處理整數時會選擇 " +"Python 運算式 ``x % y``。" + +#: ../../library/math.rst:267 msgid "" "Return the fractional and integer parts of *x*. Both results carry the sign " "of *x* and are floats." msgstr "" -#: ../../library/math.rst:269 +#: ../../library/math.rst:270 msgid "" "Note that :func:`modf` has a different call/return pattern than its C " "equivalents: it takes a single argument and return a pair of values, rather " @@ -790,7 +791,7 @@ msgid "" "is no such thing in Python)." msgstr "" -#: ../../library/math.rst:277 +#: ../../library/math.rst:278 msgid "" "Return the IEEE 754-style remainder of *x* with respect to *y*. For finite " "*x* and finite nonzero *y*, this is the difference ``x - n*y``, where ``n`` " @@ -800,7 +801,7 @@ msgid "" "thus always satisfies ``abs(r) <= 0.5 * abs(y)``." msgstr "" -#: ../../library/math.rst:284 +#: ../../library/math.rst:285 msgid "" "Special cases follow IEEE 754: in particular, ``remainder(x, math.inf)`` is " "*x* for any finite *x*, and ``remainder(x, 0)`` and ``remainder(math.inf, " @@ -808,22 +809,22 @@ msgid "" "remainder operation is zero, that zero will have the same sign as *x*." msgstr "" -#: ../../library/math.rst:290 +#: ../../library/math.rst:291 msgid "" "On platforms using IEEE 754 binary floating point, the result of this " "operation is always exactly representable: no rounding error is introduced." msgstr "" -#: ../../library/math.rst:298 +#: ../../library/math.rst:299 msgid "" "Return *x* with the fractional part removed, leaving the integer part. This " "rounds toward 0: ``trunc()`` is equivalent to :func:`floor` for positive " "*x*, and equivalent to :func:`ceil` for negative *x*. If *x* is not a float, " -"delegates to :meth:`x.__trunc__ `, which should return an :" -"class:`~numbers.Integral` value." +"delegates to :meth:`x.__trunc__ `, which should return " +"an :class:`~numbers.Integral` value." msgstr "" -#: ../../library/math.rst:305 +#: ../../library/math.rst:306 msgid "" "For the :func:`ceil`, :func:`floor`, and :func:`modf` functions, note that " "*all* floating-point numbers of sufficiently large magnitude are exact " @@ -832,11 +833,11 @@ msgid "" "``abs(x) >= 2**52`` necessarily has no fractional bits." msgstr "" -#: ../../library/math.rst:313 +#: ../../library/math.rst:314 msgid "Floating point manipulation functions" msgstr "" -#: ../../library/math.rst:317 +#: ../../library/math.rst:318 msgid "" "Return a float with the magnitude (absolute value) of *x* but the sign of " "*y*. On platforms that support signed zeros, ``copysign(1.0, -0.0)`` " @@ -845,7 +846,7 @@ msgstr "" "回傳與 *x* 相同長度(絕對值)且與 *y* 同號的浮點數。在支援帶符號零的平臺上," "``copysign(1.0, -0.0)`` 回傳 *-1.0*。" -#: ../../library/math.rst:324 +#: ../../library/math.rst:325 msgid "" "Return the mantissa and exponent of *x* as the pair ``(m, e)``. *m* is a " "float and *e* is an integer such that ``x == m * 2**e`` exactly. If *x* is " @@ -856,7 +857,7 @@ msgstr "" "數,且兩者精確地使 ``x == m * 2**e``。若 *x* 為零,回傳 ``(0.0, 0)``,否則令 " "``0.5 <= abs(m) < 1``。此函式用於以可攜的方式「分割」浮點數內部表示法。" -#: ../../library/math.rst:329 +#: ../../library/math.rst:330 msgid "" "Note that :func:`frexp` has a different call/return pattern than its C " "equivalents: it takes a single argument and return a pair of values, rather " @@ -864,13 +865,13 @@ msgid "" "is no such thing in Python)." msgstr "" -#: ../../library/math.rst:336 +#: ../../library/math.rst:337 msgid "" "Return ``True`` if the values *a* and *b* are close to each other and " "``False`` otherwise." msgstr "若 *a* 及 *b* 兩值足夠接近便回傳 ``True``,否則回傳 ``False``。" -#: ../../library/math.rst:339 +#: ../../library/math.rst:340 msgid "" "Whether or not two values are considered close is determined according to " "given absolute and relative tolerances. If no errors occur, the result will " @@ -879,7 +880,7 @@ msgstr "" "兩數是否足夠接近取決於給定的絕對及相對容許偏差 (tolerance)。如果沒有錯誤發" "生,結果將為:``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)``。" -#: ../../library/math.rst:343 +#: ../../library/math.rst:344 msgid "" "*rel_tol* is the relative tolerance -- it is the maximum allowed difference " "between *a* and *b*, relative to the larger absolute value of *a* or *b*. " @@ -893,7 +894,7 @@ msgstr "" "設值為 ``1e-09``,該值可確保兩數於大約 9 個十進數位內相同。*rel_tol* 須不為負" "且小於 ``1.0``。" -#: ../../library/math.rst:350 +#: ../../library/math.rst:351 msgid "" "*abs_tol* is the absolute tolerance; it defaults to ``0.0`` and it must be " "nonnegative. When comparing ``x`` to ``0.0``, ``isclose(x, 0)`` is computed " @@ -902,7 +903,7 @@ msgid "" "to the call." msgstr "" -#: ../../library/math.rst:356 +#: ../../library/math.rst:357 msgid "" "The IEEE 754 special values of ``NaN``, ``inf``, and ``-inf`` will be " "handled according to IEEE rules. Specifically, ``NaN`` is not considered " @@ -913,11 +914,11 @@ msgstr "" "處理。更明確地說,``NaN`` 不會與包含自身在內的任何數字足夠接近,而 ``inf`` " "及 ``-inf`` 皆只與自身接近。" -#: ../../library/math.rst:365 +#: ../../library/math.rst:366 msgid ":pep:`485` -- A function for testing approximate equality" msgstr ":pep:`485` ── 用於測試近似相等的函式" -#: ../../library/math.rst:370 +#: ../../library/math.rst:371 msgid "" "Return ``True`` if *x* is neither an infinity nor a NaN, and ``False`` " "otherwise. (Note that ``0.0`` *is* considered finite.)" @@ -925,128 +926,128 @@ msgstr "" "若 *x* 不是無限值或 ``NaN`` 便回傳 ``True``,否則回傳 ``False``。(注意 " "``0.0`` 被視為有限數。)" -#: ../../library/math.rst:378 +#: ../../library/math.rst:379 msgid "" "Return ``True`` if *x* is a positive or negative infinity, and ``False`` " "otherwise." msgstr "若 *x* 是正無限值或負無限值便回傳 ``True``,否則回傳 ``False``。" -#: ../../library/math.rst:384 +#: ../../library/math.rst:385 msgid "" "Return ``True`` if *x* is a NaN (not a number), and ``False`` otherwise." msgstr "" "若 *x* 是 ``NaN`` ── 即非數字(NaN, not a number)── 便回傳 ``True``,否則回" "傳 ``False``。" -#: ../../library/math.rst:389 +#: ../../library/math.rst:390 msgid "" -"Return ``x * (2**i)``. This is essentially the inverse of function :func:" -"`frexp`." +"Return ``x * (2**i)``. This is essentially the inverse of " +"function :func:`frexp`." msgstr "回傳 ``x * (2**i)``。此函式本質上為 :func:`frexp` 的反函式。" -#: ../../library/math.rst:395 +#: ../../library/math.rst:396 msgid "Return the floating-point value *steps* steps after *x* towards *y*." msgstr "" -#: ../../library/math.rst:397 +#: ../../library/math.rst:398 msgid "If *x* is equal to *y*, return *y*, unless *steps* is zero." msgstr "" -#: ../../library/math.rst:399 +#: ../../library/math.rst:400 msgid "Examples:" msgstr "範例:" -#: ../../library/math.rst:401 +#: ../../library/math.rst:402 msgid "``math.nextafter(x, math.inf)`` goes up: towards positive infinity." msgstr "" -#: ../../library/math.rst:402 +#: ../../library/math.rst:403 msgid "``math.nextafter(x, -math.inf)`` goes down: towards minus infinity." msgstr "" -#: ../../library/math.rst:403 +#: ../../library/math.rst:404 msgid "``math.nextafter(x, 0.0)`` goes towards zero." msgstr "" -#: ../../library/math.rst:404 +#: ../../library/math.rst:405 msgid "``math.nextafter(x, math.copysign(math.inf, x))`` goes away from zero." msgstr "" -#: ../../library/math.rst:406 +#: ../../library/math.rst:407 msgid "See also :func:`math.ulp`." msgstr "另請參閱 :func:`math.ulp`。" -#: ../../library/math.rst:410 +#: ../../library/math.rst:411 msgid "Added the *steps* argument." msgstr "新增 *steps* 引數。" -#: ../../library/math.rst:416 +#: ../../library/math.rst:417 msgid "Return the value of the least significant bit of the float *x*:" msgstr "" -#: ../../library/math.rst:418 +#: ../../library/math.rst:419 msgid "If *x* is a NaN (not a number), return *x*." msgstr "" -#: ../../library/math.rst:419 +#: ../../library/math.rst:420 msgid "If *x* is negative, return ``ulp(-x)``." msgstr "若 *x* 為負值,回傳 ``ulp(-x)``。" -#: ../../library/math.rst:420 +#: ../../library/math.rst:421 msgid "If *x* is a positive infinity, return *x*." msgstr "若 *x* 為正無限值,回傳 *x*。" -#: ../../library/math.rst:421 +#: ../../library/math.rst:422 msgid "" "If *x* is equal to zero, return the smallest positive *denormalized* " -"representable float (smaller than the minimum positive *normalized* float, :" -"data:`sys.float_info.min `)." +"representable float (smaller than the minimum positive *normalized* " +"float, :data:`sys.float_info.min `)." msgstr "" -#: ../../library/math.rst:424 +#: ../../library/math.rst:425 msgid "" "If *x* is equal to the largest positive representable float, return the " "value of the least significant bit of *x*, such that the first float smaller " "than *x* is ``x - ulp(x)``." msgstr "" -#: ../../library/math.rst:427 +#: ../../library/math.rst:428 msgid "" "Otherwise (*x* is a positive finite number), return the value of the least " "significant bit of *x*, such that the first float bigger than *x* is ``x + " "ulp(x)``." msgstr "" -#: ../../library/math.rst:431 +#: ../../library/math.rst:432 msgid "ULP stands for \"Unit in the Last Place\"." msgstr "" -#: ../../library/math.rst:433 +#: ../../library/math.rst:434 msgid "" -"See also :func:`math.nextafter` and :data:`sys.float_info.epsilon `." +"See also :func:`math.nextafter` and :data:`sys.float_info.epsilon " +"`." msgstr "" -#: ../../library/math.rst:440 +#: ../../library/math.rst:441 msgid "Power, exponential and logarithmic functions" msgstr "" -#: ../../library/math.rst:444 +#: ../../library/math.rst:445 msgid "Return the cube root of *x*." msgstr "" -#: ../../library/math.rst:451 +#: ../../library/math.rst:452 msgid "" "Return *e* raised to the power *x*, where *e* = 2.718281... is the base of " "natural logarithms. This is usually more accurate than ``math.e ** x`` or " "``pow(math.e, x)``." msgstr "" -#: ../../library/math.rst:458 +#: ../../library/math.rst:459 msgid "Return *2* raised to the power *x*." msgstr "" -#: ../../library/math.rst:465 +#: ../../library/math.rst:466 msgid "" "Return *e* raised to the power *x*, minus 1. Here *e* is the base of " "natural logarithms. For small floats *x*, the subtraction in ``exp(x) - 1`` " @@ -1055,41 +1056,41 @@ msgid "" "compute this quantity to full precision:" msgstr "" -#: ../../library/math.rst:482 +#: ../../library/math.rst:483 msgid "With one argument, return the natural logarithm of *x* (to base *e*)." msgstr "" -#: ../../library/math.rst:484 +#: ../../library/math.rst:485 msgid "" "With two arguments, return the logarithm of *x* to the given *base*, " "calculated as ``log(x)/log(base)``." msgstr "" -#: ../../library/math.rst:490 +#: ../../library/math.rst:491 msgid "" "Return the natural logarithm of *1+x* (base *e*). The result is calculated " "in a way which is accurate for *x* near zero." msgstr "" -#: ../../library/math.rst:496 +#: ../../library/math.rst:497 msgid "" "Return the base-2 logarithm of *x*. This is usually more accurate than " "``log(x, 2)``." msgstr "" -#: ../../library/math.rst:503 +#: ../../library/math.rst:504 msgid "" ":meth:`int.bit_length` returns the number of bits necessary to represent an " "integer in binary, excluding the sign and leading zeros." msgstr "" -#: ../../library/math.rst:509 +#: ../../library/math.rst:510 msgid "" "Return the base-10 logarithm of *x*. This is usually more accurate than " "``log(x, 10)``." msgstr "" -#: ../../library/math.rst:515 +#: ../../library/math.rst:516 msgid "" "Return *x* raised to the power *y*. Exceptional cases follow the IEEE 754 " "standard as far as possible. In particular, ``pow(1.0, x)`` and ``pow(x, " @@ -1098,44 +1099,44 @@ msgid "" "y)`` is undefined, and raises :exc:`ValueError`." msgstr "" -#: ../../library/math.rst:522 +#: ../../library/math.rst:523 msgid "" "Unlike the built-in ``**`` operator, :func:`math.pow` converts both its " "arguments to type :class:`float`. Use ``**`` or the built-in :func:`pow` " "function for computing exact integer powers." msgstr "" -#: ../../library/math.rst:526 +#: ../../library/math.rst:527 msgid "" "The special cases ``pow(0.0, -inf)`` and ``pow(-0.0, -inf)`` were changed to " "return ``inf`` instead of raising :exc:`ValueError`, for consistency with " "IEEE 754." msgstr "" -#: ../../library/math.rst:534 +#: ../../library/math.rst:535 msgid "Return the square root of *x*." msgstr "" -#: ../../library/math.rst:538 +#: ../../library/math.rst:539 msgid "Summation and product functions" msgstr "" -#: ../../library/math.rst:542 +#: ../../library/math.rst:543 msgid "" "Return the Euclidean distance between two points *p* and *q*, each given as " "a sequence (or iterable) of coordinates. The two points must have the same " "dimension." msgstr "" -#: ../../library/math.rst:546 ../../library/math.rst:607 +#: ../../library/math.rst:547 ../../library/math.rst:608 msgid "Roughly equivalent to::" msgstr "" -#: ../../library/math.rst:548 +#: ../../library/math.rst:549 msgid "sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))" msgstr "sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))" -#: ../../library/math.rst:555 +#: ../../library/math.rst:556 msgid "" "Return an accurate floating-point sum of values in the iterable. Avoids " "loss of precision by tracking multiple intermediate partial sums." @@ -1143,7 +1144,7 @@ msgstr "" "回傳可疊代物件(iterable)中所有值的精確浮點數和。透過追蹤過程中多個部分和" "(partial sum)以避免精確度損失。" -#: ../../library/math.rst:558 +#: ../../library/math.rst:559 msgid "" "The algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the " "typical case where the rounding mode is half-even. On some non-Windows " @@ -1155,190 +1156,190 @@ msgstr "" "有些非 Windows 平台建置時,底層 C 函式庫使用延伸精度加法運算,而可能導致對過" "程中同一部分和重複捨入,並使其最低有效位不如預期。" -#: ../../library/math.rst:564 +#: ../../library/math.rst:565 msgid "" "For further discussion and two alternative approaches, see the `ASPN " -"cookbook recipes for accurate floating-point summation `_\\." +"cookbook recipes for accurate floating-point summation `_\\." msgstr "" "更深入的討論及兩種替代做法請參閱 `ASPN cookbook recipes 精準的浮點數總和 " "`_。" -#: ../../library/math.rst:571 +#: ../../library/math.rst:572 msgid "" "Return the Euclidean norm, ``sqrt(sum(x**2 for x in coordinates))``. This is " "the length of the vector from the origin to the point given by the " "coordinates." msgstr "" -#: ../../library/math.rst:575 +#: ../../library/math.rst:576 msgid "" "For a two dimensional point ``(x, y)``, this is equivalent to computing the " "hypotenuse of a right triangle using the Pythagorean theorem, ``sqrt(x*x + " "y*y)``." msgstr "" -#: ../../library/math.rst:579 +#: ../../library/math.rst:580 msgid "" "Added support for n-dimensional points. Formerly, only the two dimensional " "case was supported." msgstr "" -#: ../../library/math.rst:583 +#: ../../library/math.rst:584 msgid "" "Improved the algorithm's accuracy so that the maximum error is under 1 ulp " "(unit in the last place). More typically, the result is almost always " "correctly rounded to within 1/2 ulp." msgstr "" -#: ../../library/math.rst:591 +#: ../../library/math.rst:592 msgid "" "Calculate the product of all the elements in the input *iterable*. The " "default *start* value for the product is ``1``." msgstr "" -#: ../../library/math.rst:594 +#: ../../library/math.rst:595 msgid "" "When the iterable is empty, return the start value. This function is " "intended specifically for use with numeric values and may reject non-numeric " "types." msgstr "" -#: ../../library/math.rst:603 +#: ../../library/math.rst:604 msgid "Return the sum of products of values from two iterables *p* and *q*." msgstr "" -#: ../../library/math.rst:605 +#: ../../library/math.rst:606 msgid "Raises :exc:`ValueError` if the inputs do not have the same length." msgstr "" -#: ../../library/math.rst:609 +#: ../../library/math.rst:610 msgid "sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))" msgstr "sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))" -#: ../../library/math.rst:611 +#: ../../library/math.rst:612 msgid "" "For float and mixed int/float inputs, the intermediate products and sums are " "computed with extended precision." msgstr "" -#: ../../library/math.rst:618 +#: ../../library/math.rst:619 msgid "Angular conversion" msgstr "" -#: ../../library/math.rst:622 +#: ../../library/math.rst:623 msgid "Convert angle *x* from radians to degrees." msgstr "" -#: ../../library/math.rst:627 +#: ../../library/math.rst:628 msgid "Convert angle *x* from degrees to radians." msgstr "" -#: ../../library/math.rst:631 +#: ../../library/math.rst:632 msgid "Trigonometric functions" msgstr "" -#: ../../library/math.rst:635 +#: ../../library/math.rst:636 msgid "" "Return the arc cosine of *x*, in radians. The result is between ``0`` and " "``pi``." msgstr "" -#: ../../library/math.rst:641 +#: ../../library/math.rst:642 msgid "" "Return the arc sine of *x*, in radians. The result is between ``-pi/2`` and " "``pi/2``." msgstr "" -#: ../../library/math.rst:647 +#: ../../library/math.rst:648 msgid "" "Return the arc tangent of *x*, in radians. The result is between ``-pi/2`` " "and ``pi/2``." msgstr "" -#: ../../library/math.rst:653 +#: ../../library/math.rst:654 msgid "" "Return ``atan(y / x)``, in radians. The result is between ``-pi`` and " "``pi``. The vector in the plane from the origin to point ``(x, y)`` makes " "this angle with the positive X axis. The point of :func:`atan2` is that the " "signs of both inputs are known to it, so it can compute the correct quadrant " -"for the angle. For example, ``atan(1)`` and ``atan2(1, 1)`` are both " -"``pi/4``, but ``atan2(-1, -1)`` is ``-3*pi/4``." +"for the angle. For example, ``atan(1)`` and ``atan2(1, 1)`` are both ``pi/" +"4``, but ``atan2(-1, -1)`` is ``-3*pi/4``." msgstr "" -#: ../../library/math.rst:663 +#: ../../library/math.rst:664 msgid "Return the cosine of *x* radians." msgstr "" -#: ../../library/math.rst:668 +#: ../../library/math.rst:669 msgid "Return the sine of *x* radians." msgstr "" -#: ../../library/math.rst:673 +#: ../../library/math.rst:674 msgid "Return the tangent of *x* radians." msgstr "" -#: ../../library/math.rst:677 +#: ../../library/math.rst:678 msgid "Hyperbolic functions" msgstr "" -#: ../../library/math.rst:679 +#: ../../library/math.rst:680 msgid "" "`Hyperbolic functions `_ " "are analogs of trigonometric functions that are based on hyperbolas instead " "of circles." msgstr "" -#: ../../library/math.rst:685 +#: ../../library/math.rst:686 msgid "Return the inverse hyperbolic cosine of *x*." msgstr "" -#: ../../library/math.rst:690 +#: ../../library/math.rst:691 msgid "Return the inverse hyperbolic sine of *x*." msgstr "" -#: ../../library/math.rst:695 +#: ../../library/math.rst:696 msgid "Return the inverse hyperbolic tangent of *x*." msgstr "" -#: ../../library/math.rst:700 +#: ../../library/math.rst:701 msgid "Return the hyperbolic cosine of *x*." msgstr "" -#: ../../library/math.rst:705 +#: ../../library/math.rst:706 msgid "Return the hyperbolic sine of *x*." msgstr "" -#: ../../library/math.rst:710 +#: ../../library/math.rst:711 msgid "Return the hyperbolic tangent of *x*." msgstr "" -#: ../../library/math.rst:714 +#: ../../library/math.rst:715 msgid "Special functions" msgstr "特殊函式" -#: ../../library/math.rst:718 +#: ../../library/math.rst:719 msgid "" "Return the `error function `_ " "at *x*." msgstr "" -#: ../../library/math.rst:721 +#: ../../library/math.rst:722 msgid "" "The :func:`erf` function can be used to compute traditional statistical " -"functions such as the `cumulative standard normal distribution `_::" +"functions such as the `cumulative standard normal distribution `_::" msgstr "" -#: ../../library/math.rst:725 +#: ../../library/math.rst:726 msgid "" "def phi(x):\n" " 'Cumulative distribution function for the standard normal distribution'\n" " return (1.0 + erf(x / sqrt(2.0))) / 2.0" msgstr "" -#: ../../library/math.rst:734 +#: ../../library/math.rst:735 msgid "" "Return the complementary error function at *x*. The `complementary error " "function `_ is defined as " @@ -1347,31 +1348,31 @@ msgid "" "Loss_of_significance>`_\\." msgstr "" -#: ../../library/math.rst:745 +#: ../../library/math.rst:746 msgid "" "Return the `Gamma function `_ " "at *x*." msgstr "" -#: ../../library/math.rst:753 +#: ../../library/math.rst:754 msgid "" "Return the natural logarithm of the absolute value of the Gamma function at " "*x*." msgstr "" -#: ../../library/math.rst:760 +#: ../../library/math.rst:761 msgid "Constants" msgstr "常數" -#: ../../library/math.rst:764 +#: ../../library/math.rst:765 msgid "The mathematical constant *π* = 3.141592..., to available precision." msgstr "" -#: ../../library/math.rst:769 +#: ../../library/math.rst:770 msgid "The mathematical constant *e* = 2.718281..., to available precision." msgstr "" -#: ../../library/math.rst:774 +#: ../../library/math.rst:775 msgid "" "The mathematical constant *τ* = 6.283185..., to available precision. Tau is " "a circle constant equal to 2\\ *π*, the ratio of a circle's circumference to " @@ -1380,13 +1381,13 @@ msgid "" "celebrating `Tau day `_ by eating twice as much pie!" msgstr "" -#: ../../library/math.rst:785 +#: ../../library/math.rst:786 msgid "" -"A floating-point positive infinity. (For negative infinity, use ``-math." -"inf``.) Equivalent to the output of ``float('inf')``." +"A floating-point positive infinity. (For negative infinity, use ``-" +"math.inf``.) Equivalent to the output of ``float('inf')``." msgstr "" -#: ../../library/math.rst:793 +#: ../../library/math.rst:794 msgid "" "A floating-point \"not a number\" (NaN) value. Equivalent to the output of " "``float('nan')``. Due to the requirements of the `IEEE-754 standard \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -389,9 +389,9 @@ msgstr "" #: ../../library/os.rst:5303 ../../library/os.rst:5310 #: ../../library/os.rst:5319 ../../library/os.rst:5328 #: ../../library/os.rst:5337 ../../library/os.rst:5346 -#: ../../library/os.rst:5496 ../../library/os.rst:5505 -#: ../../library/os.rst:5529 ../../library/os.rst:5556 -#: ../../library/os.rst:5565 ../../library/os.rst:5688 +#: ../../library/os.rst:5498 ../../library/os.rst:5507 +#: ../../library/os.rst:5531 ../../library/os.rst:5558 +#: ../../library/os.rst:5567 ../../library/os.rst:5690 msgid "Availability" msgstr "" @@ -6078,128 +6078,129 @@ msgid "" "operating system." msgstr "" -#: ../../library/os.rst:5363 +#: ../../library/os.rst:5365 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:5367 +#: ../../library/os.rst:5369 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:5372 +#: ../../library/os.rst:5374 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:5376 +#: ../../library/os.rst:5378 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:5380 +#: ../../library/os.rst:5382 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:5384 +#: ../../library/os.rst:5386 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:5388 +#: ../../library/os.rst:5390 msgid "" "This flag can be OR'ed with any other scheduling policy. When a process with " "this flag set forks, its child's scheduling policy and priority are reset to " "the default." msgstr "" -#: ../../library/os.rst:5395 +#: ../../library/os.rst:5397 msgid "" "This class represents tunable scheduling parameters used in :func:" "`sched_setparam`, :func:`sched_setscheduler`, and :func:`sched_getparam`. It " "is immutable." msgstr "" -#: ../../library/os.rst:5399 +#: ../../library/os.rst:5401 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:5403 +#: ../../library/os.rst:5405 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:5408 +#: ../../library/os.rst:5410 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5414 +#: ../../library/os.rst:5416 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5420 +#: ../../library/os.rst:5422 msgid "" "Set the scheduling policy for the process with PID *pid*. A *pid* of 0 means " "the calling process. *policy* is one of the scheduling policy constants " "above. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:5427 +#: ../../library/os.rst:5429 msgid "" "Return the scheduling policy for the process with PID *pid*. A *pid* of 0 " "means the calling process. The result is one of the scheduling policy " "constants above." msgstr "" -#: ../../library/os.rst:5434 +#: ../../library/os.rst:5436 msgid "" "Set the scheduling parameters for the process with PID *pid*. A *pid* of 0 " "means the calling process. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:5440 +#: ../../library/os.rst:5442 msgid "" "Return the scheduling parameters as a :class:`sched_param` instance for the " "process with PID *pid*. A *pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:5446 +#: ../../library/os.rst:5448 msgid "" "Return the round-robin quantum in seconds for the process with PID *pid*. A " "*pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:5452 -msgid "Voluntarily relinquish the CPU." +#: ../../library/os.rst:5454 +msgid "" +"Voluntarily relinquish the CPU. See :manpage:`sched_yield(2)` for details." msgstr "" -#: ../../library/os.rst:5457 +#: ../../library/os.rst:5459 msgid "" "Restrict the process with PID *pid* (or the current process if zero) to a " "set of CPUs. *mask* is an iterable of integers representing the set of CPUs " "to which the process should be restricted." msgstr "" -#: ../../library/os.rst:5464 +#: ../../library/os.rst:5466 msgid "Return the set of CPUs the process with PID *pid* is restricted to." msgstr "" -#: ../../library/os.rst:5466 +#: ../../library/os.rst:5468 msgid "" "If *pid* is zero, return the set of CPUs the calling thread of the current " "process is restricted to." msgstr "" -#: ../../library/os.rst:5469 +#: ../../library/os.rst:5471 msgid "See also the :func:`process_cpu_count` function." msgstr "也請見 :func:`process_cpu_count` 函式。" -#: ../../library/os.rst:5475 +#: ../../library/os.rst:5477 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:5480 +#: ../../library/os.rst:5482 msgid "" "Return string-valued system configuration values. *name* specifies the " "configuration value to retrieve; it may be a string which is the name of a " @@ -6210,13 +6211,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:5488 +#: ../../library/os.rst:5490 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:5491 +#: ../../library/os.rst:5493 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -6224,62 +6225,62 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:5501 +#: ../../library/os.rst:5503 msgid "" "Dictionary mapping names accepted by :func:`confstr` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:5510 +#: ../../library/os.rst:5512 msgid "" "Return the number of logical CPUs in the **system**. Returns ``None`` if " "undetermined." msgstr "" -#: ../../library/os.rst:5513 +#: ../../library/os.rst:5515 msgid "" "The :func:`process_cpu_count` function can be used to get the number of " "logical CPUs usable by the calling thread of the **current process**." msgstr "" -#: ../../library/os.rst:5518 +#: ../../library/os.rst:5520 msgid "" "If :option:`-X cpu_count <-X>` is given or :envvar:`PYTHON_CPU_COUNT` is " "set, :func:`cpu_count` returns the overridden value *n*." msgstr "" -#: ../../library/os.rst:5525 +#: ../../library/os.rst:5527 msgid "" "Return the number of processes in the system run queue averaged over the " "last 1, 5, and 15 minutes or raises :exc:`OSError` if the load average was " "unobtainable." msgstr "" -#: ../../library/os.rst:5534 +#: ../../library/os.rst:5536 msgid "" "Get the number of logical CPUs usable by the calling thread of the **current " "process**. Returns ``None`` if undetermined. It can be less than :func:" "`cpu_count` depending on the CPU affinity." msgstr "" -#: ../../library/os.rst:5538 +#: ../../library/os.rst:5540 msgid "" "The :func:`cpu_count` function can be used to get the number of logical CPUs " "in the **system**." msgstr "" -#: ../../library/os.rst:5541 +#: ../../library/os.rst:5543 msgid "" "If :option:`-X cpu_count <-X>` is given or :envvar:`PYTHON_CPU_COUNT` is " "set, :func:`process_cpu_count` returns the overridden value *n*." msgstr "" -#: ../../library/os.rst:5544 +#: ../../library/os.rst:5546 msgid "See also the :func:`sched_getaffinity` function." msgstr "也請見 :func:`sched_getaffinity` 函式。" -#: ../../library/os.rst:5551 +#: ../../library/os.rst:5553 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -6288,44 +6289,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:5561 +#: ../../library/os.rst:5563 msgid "" "Dictionary mapping names accepted by :func:`sysconf` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:5567 +#: ../../library/os.rst:5569 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: ../../library/os.rst:5570 +#: ../../library/os.rst:5572 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:5573 +#: ../../library/os.rst:5575 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:5579 +#: ../../library/os.rst:5581 msgid "" "The constant string used by the operating system to refer to the current " "directory. This is ``'.'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:5587 +#: ../../library/os.rst:5589 msgid "" "The constant string used by the operating system to refer to the parent " "directory. This is ``'..'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:5596 +#: ../../library/os.rst:5598 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -6334,7 +6335,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5606 +#: ../../library/os.rst:5608 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -6342,27 +6343,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5615 +#: ../../library/os.rst:5617 msgid "" "The character which separates the base filename from the extension; for " "example, the ``'.'`` in :file:`os.py`. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5623 +#: ../../library/os.rst:5625 msgid "" "The character conventionally used by the operating system to separate search " "path components (as in :envvar:`PATH`), such as ``':'`` for POSIX or ``';'`` " "for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5630 +#: ../../library/os.rst:5632 msgid "" "The default search path used by :func:`exec\\*p\\* ` and :func:" "`spawn\\*p\\* ` if the environment doesn't have a ``'PATH'`` key. " "Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5637 +#: ../../library/os.rst:5639 msgid "" "The string used to separate (or, rather, terminate) lines on the current " "platform. This may be a single character, such as ``'\\n'`` for POSIX, or " @@ -6371,36 +6372,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:5646 +#: ../../library/os.rst:5648 msgid "" "The file path of the null device. For example: ``'/dev/null'`` for POSIX, " "``'nul'`` for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5657 +#: ../../library/os.rst:5659 msgid "" "Flags for use with the :func:`~sys.setdlopenflags` and :func:`~sys." "getdlopenflags` functions. See the Unix manual page :manpage:`dlopen(3)` " "for what the different flags mean." msgstr "" -#: ../../library/os.rst:5665 +#: ../../library/os.rst:5667 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:5670 +#: ../../library/os.rst:5672 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:5673 +#: ../../library/os.rst:5675 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:5676 +#: ../../library/os.rst:5678 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -6408,32 +6409,32 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:5681 +#: ../../library/os.rst:5683 msgid "" "The flags argument is a bit mask that can contain zero or more of the " "following values ORed together: :py:const:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -#: ../../library/os.rst:5685 +#: ../../library/os.rst:5687 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:5694 +#: ../../library/os.rst:5696 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:5696 +#: ../../library/os.rst:5698 msgid "" "This function returns random bytes from an OS-specific randomness source. " "The returned data should be unpredictable enough for cryptographic " "applications, though its exact quality depends on the OS implementation." msgstr "" -#: ../../library/os.rst:5700 +#: ../../library/os.rst:5702 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -6443,63 +6444,63 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:5707 +#: ../../library/os.rst:5709 msgid "" "On a Unix-like system, random bytes are read from the ``/dev/urandom`` " "device. If the ``/dev/urandom`` device is not available or not readable, " "the :exc:`NotImplementedError` exception is raised." msgstr "" -#: ../../library/os.rst:5711 +#: ../../library/os.rst:5713 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: ../../library/os.rst:5714 +#: ../../library/os.rst:5716 msgid "" "The :mod:`secrets` module provides higher level functions. For an easy-to-" "use interface to the random number generator provided by your platform, " "please see :class:`random.SystemRandom`." msgstr "" -#: ../../library/os.rst:5718 +#: ../../library/os.rst:5720 msgid "" "On Linux 3.17 and newer, the ``getrandom()`` syscall is now used when " "available. On OpenBSD 5.6 and newer, the C ``getentropy()`` function is now " "used. These functions avoid the usage of an internal file descriptor." msgstr "" -#: ../../library/os.rst:5724 +#: ../../library/os.rst:5726 msgid "" "On Linux, if the ``getrandom()`` syscall blocks (the urandom entropy pool is " "not initialized yet), fall back on reading ``/dev/urandom``." msgstr "" -#: ../../library/os.rst:5728 +#: ../../library/os.rst:5730 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:5732 +#: ../../library/os.rst:5734 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: ../../library/os.rst:5738 +#: ../../library/os.rst:5740 msgid "" "By default, when reading from ``/dev/random``, :func:`getrandom` blocks if " "no random bytes are available, and when reading from ``/dev/urandom``, it " "blocks if the entropy pool has not yet been initialized." msgstr "" -#: ../../library/os.rst:5742 +#: ../../library/os.rst:5744 msgid "" "If the :py:data:`GRND_NONBLOCK` flag is set, then :func:`getrandom` does not " "block in these cases, but instead immediately raises :exc:`BlockingIOError`." msgstr "" -#: ../../library/os.rst:5749 +#: ../../library/os.rst:5751 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." @@ -6609,40 +6610,40 @@ msgstr "" msgid "signalling" msgstr "signalling(信號)" -#: ../../library/os.rst:5576 ../../library/os.rst:5612 +#: ../../library/os.rst:5578 ../../library/os.rst:5614 msgid ". (dot)" msgstr ". (點)" -#: ../../library/os.rst:5576 ../../library/os.rst:5584 -#: ../../library/os.rst:5592 ../../library/os.rst:5603 -#: ../../library/os.rst:5612 +#: ../../library/os.rst:5578 ../../library/os.rst:5586 +#: ../../library/os.rst:5594 ../../library/os.rst:5605 +#: ../../library/os.rst:5614 msgid "in pathnames" msgstr "於 pathnames(路徑名稱)中" -#: ../../library/os.rst:5584 +#: ../../library/os.rst:5586 msgid ".." msgstr ".." -#: ../../library/os.rst:5592 ../../library/os.rst:5603 +#: ../../library/os.rst:5594 ../../library/os.rst:5605 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../library/os.rst:5593 +#: ../../library/os.rst:5595 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/os.rst:5593 +#: ../../library/os.rst:5595 msgid "in pathnames (Windows)" msgstr "in pathnames (Windows)(在路徑名稱中 (Windows))" -#: ../../library/os.rst:5619 +#: ../../library/os.rst:5621 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/os.rst:5619 +#: ../../library/os.rst:5621 msgid "path separator (POSIX)" msgstr "path separator (POSIX)(路徑分隔器 (POSIX))" -#: ../../library/os.rst:5619 +#: ../../library/os.rst:5621 msgid "; (semicolon)" msgstr "; (分號)" diff --git a/library/pdb.po b/library/pdb.po index 82e3ec7697..7740a944de 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 01:58+0800\n" +"POT-Creation-Date: 2025-01-15 00:13+0000\n" "PO-Revision-Date: 2024-10-19 17:39+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -43,13 +43,14 @@ msgstr "" #: ../../library/pdb.rst:26 msgid "" -"The debugger is extensible -- it is actually defined as the class :class:" -"`Pdb`. This is currently undocumented but easily understood by reading the " -"source. The extension interface uses the modules :mod:`bdb` and :mod:`cmd`." +"The debugger is extensible -- it is actually defined as the " +"class :class:`Pdb`. This is currently undocumented but easily understood by " +"reading the source. The extension interface uses the modules :mod:`bdb` " +"and :mod:`cmd`." msgstr "" "偵錯器是可擴充的 —— 偵錯器實際被定義為 :class:`Pdb` 類別。該類別目前沒有文" -"件,但可以很容易地透過閱讀原始碼來理解它。擴充套件介面使用了 :mod:`bdb` 和 :" -"mod:`cmd` 模組。" +"件,但可以很容易地透過閱讀原始碼來理解它。擴充套件介面使用了 :mod:`bdb` " +"和 :mod:`cmd` 模組。" #: ../../library/pdb.rst:32 msgid "Module :mod:`faulthandler`" @@ -274,15 +275,15 @@ msgid "" "statement using :pdbcmd:`step` or :pdbcmd:`next` (all these commands are " "explained below). The optional *globals* and *locals* arguments specify the " "environment in which the code is executed; by default the dictionary of the " -"module :mod:`__main__` is used. (See the explanation of the built-in :func:" -"`exec` or :func:`eval` functions.)" +"module :mod:`__main__` is used. (See the explanation of the built-" +"in :func:`exec` or :func:`eval` functions.)" msgstr "" "在偵錯器控制下執行 *statement*\\ (以字串或程式碼物件形式給定)。偵錯提示字元" "會在執行任何程式碼前出現;你可以設定斷點並輸入 :pdbcmd:`continue`,或也可以使" "用 :pdbcmd:`step` 或 :pdbcmd:`next` 逐步執行陳述式(這些命令在下面都有說" -"明)。可選引數 *globals* 和 *locals* 指定程式碼執行的環境;預設使用 :mod:" -"`__main__` 模組的字典。(請參閱內建函式 :func:`exec` 或 :func:`eval` 的說" -"明。)" +"明)。可選引數 *globals* 和 *locals* 指定程式碼執行的環境;預設使" +"用 :mod:`__main__` 模組的字典。(請參閱內建函式 :func:`exec` 或 :func:`eval` " +"的說明。)" #: ../../library/pdb.rst:149 msgid "" @@ -290,9 +291,9 @@ msgid "" "debugger control. When :func:`runeval` returns, it returns the value of the " "*expression*. Otherwise this function is similar to :func:`run`." msgstr "" -"在偵錯器控制下為 *expression* 求值(以字串或程式碼物件形式給定)。當 :func:" -"`runeval` 回傳時,它回傳 *expression* 的值。除此之外,該函式與 :func:`run` 類" -"似。" +"在偵錯器控制下為 *expression* 求值(以字串或程式碼物件形式給定)。" +"當 :func:`runeval` 回傳時,它回傳 *expression* 的值。除此之外,該函式" +"與 :func:`run` 類似。" #: ../../library/pdb.rst:156 msgid "" @@ -301,9 +302,9 @@ msgid "" "function call returned. The debugger prompt appears as soon as the function " "is entered." msgstr "" -"使用給定的引數呼叫 *function*\\ (只可以是函式或方法物件,不能是字串)。:" -"func:`runcall` 回傳的是所呼叫函式的回傳值。偵錯器提示字元將在進入函式後立即出" -"現。" +"使用給定的引數呼叫 *function*\\ (只可以是函式或方法物件,不能是字" +"串)。:func:`runcall` 回傳的是所呼叫函式的回傳值。偵錯器提示字元將在進入函式" +"後立即出現。" #: ../../library/pdb.rst:164 msgid "" @@ -328,33 +329,37 @@ msgstr ":func:`set_trace` 將立即進入偵錯器,而不是在下一列要執 #: ../../library/pdb.rst:178 msgid "" -"Enter post-mortem debugging of the given *traceback* object. If no " -"*traceback* is given, it uses the one of the exception that is currently " -"being handled (an exception must be being handled if the default is to be " -"used)." +"Enter post-mortem debugging of the given exception or :ref:`traceback object " +"`. If no value is given, it uses the exception that is " +"currently being handled, or raises ``ValueError`` if there isn’t one." msgstr "" -"進入所給定 *traceback* 物件的事後偵錯。如果沒有給定 *traceback*,預設使用當前" -"正在處理的例外之一(使用預設情況時,必須要有正在處理的例外存在)。" +"進入所給定例外或\\ :ref:`回溯物件 `\\ 的事後偵錯。如果沒有" +"給定,預設使用當前正在處理的例外,或如果沒有例外則會引發 ``ValueError``。" -#: ../../library/pdb.rst:186 +#: ../../library/pdb.rst:183 +msgid "Support for exception objects was added." +msgstr "新增對例外物件的支援。" + +#: ../../library/pdb.rst:188 msgid "" "Enter post-mortem debugging of the exception found in :data:`sys.last_exc`." msgstr "進入在 :data:`sys.last_exc` 中發現的例外的事後偵錯。" -#: ../../library/pdb.rst:190 +#: ../../library/pdb.rst:192 msgid "" "The ``run*`` functions and :func:`set_trace` are aliases for instantiating " "the :class:`Pdb` class and calling the method of the same name. If you want " "to access further features, you have to do this yourself:" msgstr "" -"``run*`` 函式和 :func:`set_trace` 都是別名,用於實例化 (instantiate) :class:" -"`Pdb` 類別並呼叫同名方法。如果要使用更多功能,則必須自己執行以下操作:" +"``run*`` 函式和 :func:`set_trace` 都是別名,用於實例化 " +"(instantiate) :class:`Pdb` 類別並呼叫同名方法。如果要使用更多功能,則必須自己" +"執行以下操作:" -#: ../../library/pdb.rst:197 +#: ../../library/pdb.rst:199 msgid ":class:`Pdb` is the debugger class." msgstr ":class:`Pdb` 是偵錯器類別。" -#: ../../library/pdb.rst:199 +#: ../../library/pdb.rst:201 msgid "" "The *completekey*, *stdin* and *stdout* arguments are passed to the " "underlying :class:`cmd.Cmd` class; see the description there." @@ -362,7 +367,7 @@ msgstr "" "*completekey*、*stdin* 與 *stdout* 引數會被傳到底層的 :class:`cmd.Cmd` 類別;" "請於該文件閱讀相關敘述。" -#: ../../library/pdb.rst:202 +#: ../../library/pdb.rst:204 msgid "" "The *skip* argument, if given, must be an iterable of glob-style module name " "patterns. The debugger will not step into frames that originate in a module " @@ -371,63 +376,63 @@ msgstr "" "如果給定 *skip* 引數,則它必須是一個給出 glob 樣式之模組名稱的疊代器。如果遇" "到匹配這些樣式的模組,偵錯器將不會進入來自該模組的 frame。 [1]_" -#: ../../library/pdb.rst:206 +#: ../../library/pdb.rst:208 msgid "" "By default, Pdb sets a handler for the SIGINT signal (which is sent when the " -"user presses :kbd:`Ctrl-C` on the console) when you give a :pdbcmd:" -"`continue` command. This allows you to break into the debugger again by " -"pressing :kbd:`Ctrl-C`. If you want Pdb not to touch the SIGINT handler, " -"set *nosigint* to true." +"user presses :kbd:`Ctrl-C` on the console) when you give " +"a :pdbcmd:`continue` command. This allows you to break into the debugger " +"again by pressing :kbd:`Ctrl-C`. If you want Pdb not to touch the SIGINT " +"handler, set *nosigint* to true." msgstr "" "預設情況下,當你發出 :pdbcmd:`continue` 命令時,Pdb 會為 SIGINT 訊號(即使用" "者在控制台上按下 :kbd:`Ctrl-C` 時會發送的訊號)設定一個處理程式 (handler),這" "允許你透過按下 :kbd:`Ctrl-C` 再次切入偵錯器。如果你希望 Pdb 不影響到 SIGINT " "處理程式,請將 *nosigint* 設定為 true。" -#: ../../library/pdb.rst:211 +#: ../../library/pdb.rst:213 msgid "" -"The *readrc* argument defaults to true and controls whether Pdb will load ." -"pdbrc files from the filesystem." +"The *readrc* argument defaults to true and controls whether Pdb will " +"load .pdbrc files from the filesystem." msgstr "*readrc* 引數預設為 true,它控制 Pdb 是否從檔案系統載入 .pdbrc 檔案。" -#: ../../library/pdb.rst:214 +#: ../../library/pdb.rst:216 msgid "Example call to enable tracing with *skip*::" msgstr "啟用追蹤 (tracing) 且帶有 *skip* 引數的呼叫示範: ::" -#: ../../library/pdb.rst:216 +#: ../../library/pdb.rst:218 msgid "import pdb; pdb.Pdb(skip=['django.*']).set_trace()" msgstr "import pdb; pdb.Pdb(skip=['django.*']).set_trace()" -#: ../../library/pdb.rst:218 +#: ../../library/pdb.rst:220 msgid "" "Raises an :ref:`auditing event ` ``pdb.Pdb`` with no arguments." msgstr "" -"不帶引數地引發一個\\ :ref:`稽核事件 (auditing event) ` ``pdb." -"Pdb``。" +"不帶引數地引發一個\\ :ref:`稽核事件 (auditing event) ` " +"``pdb.Pdb``。" -#: ../../library/pdb.rst:220 +#: ../../library/pdb.rst:222 msgid "Added the *skip* parameter." msgstr "新增了 *skip* 參數。" -#: ../../library/pdb.rst:223 +#: ../../library/pdb.rst:225 msgid "" "Added the *nosigint* parameter. Previously, a SIGINT handler was never set " "by Pdb." msgstr "新增了 *nosigint* 參數。以前 SIGINT 處理程式從未被 Pdb 設定過。" -#: ../../library/pdb.rst:227 +#: ../../library/pdb.rst:229 msgid "The *readrc* argument." msgstr "*readrc* 引數。" -#: ../../library/pdb.rst:235 +#: ../../library/pdb.rst:237 msgid "See the documentation for the functions explained above." msgstr "請見上面關於這些函式的文件說明。" -#: ../../library/pdb.rst:241 +#: ../../library/pdb.rst:243 msgid "Debugger Commands" msgstr "偵錯器命令" -#: ../../library/pdb.rst:243 +#: ../../library/pdb.rst:245 msgid "" "The commands recognized by the debugger are listed below. Most commands can " "be abbreviated to one or two letters as indicated; e.g. ``h(elp)`` means " @@ -444,15 +449,15 @@ msgstr "" "空格(空格符 (spaces) 或製表符 (tabs))分隔。在命令語法中,可選引數被括在方括" "號 (``[]``) 中;使用時請勿輸入方括號。命令語法中的選擇項由豎線 (``|``) 分隔。" -#: ../../library/pdb.rst:252 +#: ../../library/pdb.rst:254 msgid "" "Entering a blank line repeats the last command entered. Exception: if the " "last command was a :pdbcmd:`list` command, the next 11 lines are listed." msgstr "" -"輸入一個空白列 (blank line) 將重複上次輸入的命令。例外:如果上一個命令是 :" -"pdbcmd:`list` 命令,則會列出接下來的 11 列。" +"輸入一個空白列 (blank line) 將重複上次輸入的命令。例外:如果上一個命令" +"是 :pdbcmd:`list` 命令,則會列出接下來的 11 列。" -#: ../../library/pdb.rst:255 +#: ../../library/pdb.rst:257 msgid "" "Commands that the debugger doesn't recognize are assumed to be Python " "statements and are executed in the context of the program being debugged. " @@ -467,13 +472,13 @@ msgstr "" "大方法,甚至可以修改變數或呼叫函式。當此類陳述式發生例外,將印出例外名稱,但" "偵錯器的狀態不會改變。" -#: ../../library/pdb.rst:263 +#: ../../library/pdb.rst:265 msgid "" "Expressions/Statements whose prefix is a pdb command are now correctly " "identified and executed." msgstr "現在可以正確辨識並執行前綴為 pdb 命令的運算式/陳述式。" -#: ../../library/pdb.rst:267 +#: ../../library/pdb.rst:269 msgid "" "The debugger supports :ref:`aliases `. Aliases can have " "parameters which allows one a certain level of adaptability to the context " @@ -482,7 +487,7 @@ msgstr "" "偵錯器有支援設定\\ :ref:`別名 `。別名可以有參數,使得偵錯器" "對被檢查的情境有一定程度的適應性。" -#: ../../library/pdb.rst:271 +#: ../../library/pdb.rst:273 msgid "" "Multiple commands may be entered on a single line, separated by ``;;``. (A " "single ``;`` is not used as it is the separator for multiple commands in a " @@ -497,7 +502,7 @@ msgstr "" "總是在第一處 ``;;`` 被切分開,即使它位於引號內的字串之中。對於具有雙分號字串" "的一個變通解法,是使用隱式字串連接 ``';'';'`` 或 ``\";\"\";\"``。" -#: ../../library/pdb.rst:278 +#: ../../library/pdb.rst:280 msgid "" "To set a temporary global variable, use a *convenience variable*. A " "*convenience variable* is a variable whose name starts with ``$``. For " @@ -511,27 +516,27 @@ msgstr "" "可以在偵錯器會話 (debugger session) 中使用它。當程式恢復執行時,*便利變數*\\ " "將被清除,因此與使用 ``foo = 1`` 等普通變數相比,它不太會去干擾你的程式。" -#: ../../library/pdb.rst:285 +#: ../../library/pdb.rst:287 msgid "There are three preset *convenience variables*:" msgstr "共有三個預先設定的\\ *便利變數*:" -#: ../../library/pdb.rst:287 +#: ../../library/pdb.rst:289 msgid "``$_frame``: the current frame you are debugging" msgstr "``$_frame``:當前正在偵錯的 frame" -#: ../../library/pdb.rst:288 +#: ../../library/pdb.rst:290 msgid "``$_retval``: the return value if the frame is returning" msgstr "``$_retval``:frame 回傳時的回傳值" -#: ../../library/pdb.rst:289 +#: ../../library/pdb.rst:291 msgid "``$_exception``: the exception if the frame is raising an exception" msgstr "``$_exception``:frame 引發例外時的例外" -#: ../../library/pdb.rst:293 +#: ../../library/pdb.rst:295 msgid "Added the *convenience variable* feature." msgstr "新增了\\ *便利變數*\\ 功能。" -#: ../../library/pdb.rst:299 +#: ../../library/pdb.rst:301 msgid "" "If a file :file:`.pdbrc` exists in the user's home directory or in the " "current directory, it is read with ``'utf-8'`` encoding and executed as if " @@ -545,16 +550,16 @@ msgstr "" "空列和以 ``#`` 開頭的列會被忽略之外。這對於別名設定特別有用。如果兩個檔案都存" "在,則先讀取家目錄中的檔案,且定義於其中的別名可以被本地檔案覆蓋。" -#: ../../library/pdb.rst:306 +#: ../../library/pdb.rst:308 msgid "" -":file:`.pdbrc` can now contain commands that continue debugging, such as :" -"pdbcmd:`continue` or :pdbcmd:`next`. Previously, these commands had no " +":file:`.pdbrc` can now contain commands that continue debugging, such " +"as :pdbcmd:`continue` or :pdbcmd:`next`. Previously, these commands had no " "effect." msgstr "" -":file:`.pdbrc` 現在可以包含繼續偵錯的命令,如 :pdbcmd:`continue` 或 :pdbcmd:" -"`next`。以前檔案中的這些命令是無效的。" +":file:`.pdbrc` 現在可以包含繼續偵錯的命令,如 :pdbcmd:`continue` " +"或 :pdbcmd:`next`。以前檔案中的這些命令是無效的。" -#: ../../library/pdb.rst:311 +#: ../../library/pdb.rst:313 msgid "" ":file:`.pdbrc` is now read with ``'utf-8'`` encoding. Previously, it was " "read with the system locale encoding." @@ -562,7 +567,7 @@ msgstr "" ":file:`.pdbrc` 現在使用 ``'utf-8'`` 編碼讀取。以前它是使用系統區域設定編碼讀" "取的。" -#: ../../library/pdb.rst:318 +#: ../../library/pdb.rst:320 msgid "" "Without argument, print the list of available commands. With a *command* as " "argument, print help about that command. ``help pdb`` displays the full " @@ -575,7 +580,7 @@ msgstr "" "由於 *command* 引數必須是一個識別字 (identifier),若要獲取 ``!`` 命令的幫助訊" "息則必須輸入 ``help exec``。" -#: ../../library/pdb.rst:326 +#: ../../library/pdb.rst:328 msgid "" "Print a stack trace, with the most recent frame at the bottom. An arrow " "(``>``) indicates the current frame, which determines the context of most " @@ -584,7 +589,7 @@ msgstr "" "印出 stack trace,最新的 frame 會位於底部。箭頭(``>``)表示當前的 frame,它" "也決定了大多數命令的情境。" -#: ../../library/pdb.rst:331 +#: ../../library/pdb.rst:333 msgid "" "Move the current frame *count* (default one) levels down in the stack trace " "(to a newer frame)." @@ -592,7 +597,7 @@ msgstr "" "在 stack trace 中,將當前 frame 向下移動 *count* 級(預設為 1 級,移往較新的 " "frame)。" -#: ../../library/pdb.rst:336 +#: ../../library/pdb.rst:338 msgid "" "Move the current frame *count* (default one) levels up in the stack trace " "(to an older frame)." @@ -600,21 +605,21 @@ msgstr "" "在 stack trace 中,將當前 frame 向上移動 *count* 級(預設為 1 級,移向較舊的 " "frame)。" -#: ../../library/pdb.rst:341 +#: ../../library/pdb.rst:343 msgid "" "With a *lineno* argument, set a break at line *lineno* in the current file. " "The line number may be prefixed with a *filename* and a colon, to specify a " "breakpoint in another file (possibly one that hasn't been loaded yet). The " "file is searched on :data:`sys.path`. Accepatable forms of *filename* are " -"``/abspath/to/file.py``, ``relpath/file.py``, ``module`` and ``package." -"module``." +"``/abspath/to/file.py``, ``relpath/file.py``, ``module`` and " +"``package.module``." msgstr "" "如帶有 *lineno* 引數,則在目前檔案中的 *lineno* 列處設定中斷。列號可以以 " "*filename* 和冒號為前綴,以指定另一個檔案(可能是尚未載入的檔案)中的斷點。該" "檔案會在 :data:`sys.path` 上搜尋。可接受的 *filename* 形式為 ``/abspath/to/" "file.py``、``relpath/file.py``、``module`` 和 ``package.module``。" -#: ../../library/pdb.rst:348 +#: ../../library/pdb.rst:350 msgid "" "With a *function* argument, set a break at the first executable statement " "within that function. *function* can be any expression that evaluates to a " @@ -623,13 +628,13 @@ msgstr "" "如帶有 *function* 引數,在該函式內的第一個可執行陳述式處設定中斷。*function* " "可以是任何其求值結果為目前命名空間中函式的運算式。" -#: ../../library/pdb.rst:352 +#: ../../library/pdb.rst:354 msgid "" "If a second argument is present, it is an expression which must evaluate to " "true before the breakpoint is honored." msgstr "如果第二個引數存在,它是一個運算式,在斷點生效前其必須求值為 true" -#: ../../library/pdb.rst:355 +#: ../../library/pdb.rst:357 msgid "" "Without argument, list all breaks, including for each breakpoint, the number " "of times that breakpoint has been hit, the current ignore count, and the " @@ -638,20 +643,20 @@ msgstr "" "如果不帶引數執行會列出所有斷點資訊,包括每個斷點、命中該斷點的次數、當前的忽" "略次數以及關聯的條件(如存在)。" -#: ../../library/pdb.rst:359 +#: ../../library/pdb.rst:361 msgid "" "Each breakpoint is assigned a number to which all the other breakpoint " "commands refer." msgstr "每個斷點都有賦予一個編號,所有其他斷點命令都參照該編號。" -#: ../../library/pdb.rst:364 +#: ../../library/pdb.rst:366 msgid "" "Temporary breakpoint, which is removed automatically when it is first hit. " "The arguments are the same as for :pdbcmd:`break`." msgstr "" "臨時斷點,在第一次遇見時會自動被刪除。它的引數與 :pdbcmd:`break` 相同。" -#: ../../library/pdb.rst:369 +#: ../../library/pdb.rst:371 msgid "" "With a *filename:lineno* argument, clear all the breakpoints at this line. " "With a space separated list of breakpoint numbers, clear those breakpoints. " @@ -660,7 +665,7 @@ msgstr "" "如帶有 *filename:lineno* 引數,則清除此列上的所有斷點。如果引數是空格分隔的斷" "點編號列表,則清除這些斷點。如果不帶引數則清除所有斷點(但會先提示確認)。" -#: ../../library/pdb.rst:375 +#: ../../library/pdb.rst:377 msgid "" "Disable the breakpoints given as a space separated list of breakpoint " "numbers. Disabling a breakpoint means it cannot cause the program to stop " @@ -670,11 +675,11 @@ msgstr "" "停用斷點,斷點以空格分隔的斷點編號列表來給定。停用斷點表示它不會導致程式停止" "執行,但是與清除斷點不同,停用的斷點將保留在斷點列表中並且可以(重新)啟用。" -#: ../../library/pdb.rst:382 +#: ../../library/pdb.rst:384 msgid "Enable the breakpoints specified." msgstr "啟用指定的斷點。" -#: ../../library/pdb.rst:386 +#: ../../library/pdb.rst:388 msgid "" "Set the ignore count for the given breakpoint number. If *count* is " "omitted, the ignore count is set to 0. A breakpoint becomes active when the " @@ -686,7 +691,7 @@ msgstr "" "為 0 時,斷點將變為有效狀態。當非 0 時,每次到達斷點,且斷點沒有被禁用,且任" "何關聯的條件被求值為 true,則 *count* 就會遞減。" -#: ../../library/pdb.rst:394 +#: ../../library/pdb.rst:396 msgid "" "Set a new *condition* for the breakpoint, an expression which must evaluate " "to true before the breakpoint is honored. If *condition* is absent, any " @@ -695,7 +700,7 @@ msgstr "" "為斷點設定一個新 *condition*,為一個運算式,且其求值結果為 true 時斷點才會起" "作用。如果沒有給定 *condition*,則刪除任何現有條件,也就是不為斷點設定條件。" -#: ../../library/pdb.rst:400 +#: ../../library/pdb.rst:402 msgid "" "Specify a list of commands for breakpoint number *bpnumber*. The commands " "themselves appear on the following lines. Type a line containing just " @@ -704,7 +709,7 @@ msgstr "" "為編號是 *bpnumber* 的斷點指定一系列命令。命令內容出現在後續的幾列中。輸入僅" "包含 ``end`` 的一列來結束命令列表。例如: ::" -#: ../../library/pdb.rst:404 +#: ../../library/pdb.rst:406 msgid "" "(Pdb) commands 1\n" "(com) p some_variable\n" @@ -716,7 +721,7 @@ msgstr "" "(com) end\n" "(Pdb)" -#: ../../library/pdb.rst:409 +#: ../../library/pdb.rst:411 msgid "" "To remove all commands from a breakpoint, type ``commands`` and follow it " "immediately with ``end``; that is, give no commands." @@ -724,37 +729,37 @@ msgstr "" "要刪除斷點上的所有命令,請輸入 ``commands`` 並立即以 ``end`` 結尾,也就是不指" "定任何命令。" -#: ../../library/pdb.rst:412 +#: ../../library/pdb.rst:414 msgid "" "With no *bpnumber* argument, ``commands`` refers to the last breakpoint set." msgstr "不帶有 *bpnumber* 引數則 ``commands`` 會關聯到上一個設定的斷點。" -#: ../../library/pdb.rst:414 +#: ../../library/pdb.rst:416 msgid "" "You can use breakpoint commands to start your program up again. Simply use " "the :pdbcmd:`continue` command, or :pdbcmd:`step`, or any other command that " "resumes execution." msgstr "" -"可以使用斷點命令來重新啟動程式,只需使用 :pdbcmd:`continue` 或 :pdbcmd:" -"`step` 命令,或其他可以繼續執行程式的命令。" +"可以使用斷點命令來重新啟動程式,只需使用 :pdbcmd:`continue` " +"或 :pdbcmd:`step` 命令,或其他可以繼續執行程式的命令。" -#: ../../library/pdb.rst:418 +#: ../../library/pdb.rst:420 msgid "" -"Specifying any command resuming execution (currently :pdbcmd:`continue`, :" -"pdbcmd:`step`, :pdbcmd:`next`, :pdbcmd:`return`, :pdbcmd:`jump`, :pdbcmd:" -"`quit` and their abbreviations) terminates the command list (as if that " -"command was immediately followed by end). This is because any time you " -"resume execution (even with a simple next or step), you may encounter " -"another breakpoint—which could have its own command list, leading to " -"ambiguities about which list to execute." +"Specifying any command resuming execution " +"(currently :pdbcmd:`continue`, :pdbcmd:`step`, :pdbcmd:`next`, :pdbcmd:`return`, :pdbcmd:`jump`, :pdbcmd:`quit` " +"and their abbreviations) terminates the command list (as if that command was " +"immediately followed by end). This is because any time you resume execution " +"(even with a simple next or step), you may encounter another breakpoint—" +"which could have its own command list, leading to ambiguities about which " +"list to execute." msgstr "" -"如果指定了某個繼續執行程式的命令(目前包括 :pdbcmd:`continue`、:pdbcmd:" -"`step`、:pdbcmd:`next`、:pdbcmd:`return`、:pdbcmd:`jump`、:pdbcmd:`quit` 及它" -"們的縮寫)將終止命令列表(就像該命令後馬上跟著 end)。因為在任何時候繼續執行" -"下去(即使是簡單的 next 或 step),都可能會遇到另一個斷點,該斷點可能具有自己" -"的命令列表,這會導致無法確定要執行哪個列表。" +"如果指定了某個繼續執行程式的命令(目前包" +"括 :pdbcmd:`continue`、:pdbcmd:`step`、:pdbcmd:`next`、:pdbcmd:`return`、:pdbcmd:`jump`、:pdbcmd:`quit` " +"及它們的縮寫)將終止命令列表(就像該命令後馬上跟著 end)。因為在任何時候繼續" +"執行下去(即使是簡單的 next 或 step),都可能會遇到另一個斷點,該斷點可能具有" +"自己的命令列表,這會導致無法確定要執行哪個列表。" -#: ../../library/pdb.rst:427 +#: ../../library/pdb.rst:429 msgid "" "If you use the ``silent`` command in the command list, the usual message " "about stopping at a breakpoint is not printed. This may be desirable for " @@ -766,7 +771,7 @@ msgstr "" "息就不會印出。對於要印出特定訊息再繼續的斷點來說,這可能會是需要的功能。如果" "其他命令都沒有印出任何內容,那你就看不到已到達斷點的跡象。" -#: ../../library/pdb.rst:434 +#: ../../library/pdb.rst:436 msgid "" "Execute the current line, stop at the first possible occasion (either in a " "function that is called or on the next line in the current function)." @@ -774,7 +779,7 @@ msgstr "" "執行當前列,在第一個可以停止的位置(在被呼叫的函式內部或在當前函式的下一列)" "停止。" -#: ../../library/pdb.rst:439 +#: ../../library/pdb.rst:441 msgid "" "Continue execution until the next line in the current function is reached or " "it returns. (The difference between :pdbcmd:`next` and :pdbcmd:`step` is " @@ -787,13 +792,13 @@ msgstr "" "而 :pdbcmd:`next`\\ (幾乎)全速執行被呼叫的函式,並僅在當前函式的下一列停" "止。)" -#: ../../library/pdb.rst:447 +#: ../../library/pdb.rst:449 msgid "" "Without argument, continue execution until the line with a number greater " "than the current one is reached." msgstr "如果不帶引數則繼續執行,直到列號比當前的列大時停止。" -#: ../../library/pdb.rst:450 +#: ../../library/pdb.rst:452 msgid "" "With *lineno*, continue execution until a line with a number greater or " "equal to *lineno* is reached. In both cases, also stop when the current " @@ -802,19 +807,19 @@ msgstr "" "如帶有 *lineno* 則繼續執行,直到到達列號大於或等於 *lineno* 的那一列。在這兩" "種情況下,當前 frame 回傳時也會停止。" -#: ../../library/pdb.rst:454 +#: ../../library/pdb.rst:456 msgid "Allow giving an explicit line number." msgstr "允許明確給定一個列號。" -#: ../../library/pdb.rst:459 +#: ../../library/pdb.rst:461 msgid "Continue execution until the current function returns." msgstr "繼續執行,直到目前的函式回傳。" -#: ../../library/pdb.rst:463 +#: ../../library/pdb.rst:465 msgid "Continue execution, only stop when a breakpoint is encountered." msgstr "繼續執行,除非遇到斷點才停下來。" -#: ../../library/pdb.rst:467 +#: ../../library/pdb.rst:469 msgid "" "Set the next line that will be executed. Only available in the bottom-most " "frame. This lets you jump back and execute code again, or jump forward to " @@ -823,16 +828,16 @@ msgstr "" "設定即將執行的下一列,僅可用於堆疊中最底部的 frame。這讓你可以跳回去並再次執" "行程式碼,或者往前跳以跳過不想執行的程式碼。" -#: ../../library/pdb.rst:471 +#: ../../library/pdb.rst:473 msgid "" "It should be noted that not all jumps are allowed -- for instance it is not " -"possible to jump into the middle of a :keyword:`for` loop or out of a :" -"keyword:`finally` clause." +"possible to jump into the middle of a :keyword:`for` loop or out of " +"a :keyword:`finally` clause." msgstr "" "需要注意的是,不是所有的跳轉都是被允許的 -- 例如不能跳轉到 :keyword:`for` 迴" "圈的中間或跳出 :keyword:`finally` 子句。" -#: ../../library/pdb.rst:477 +#: ../../library/pdb.rst:479 msgid "" "List source code for the current file. Without arguments, list 11 lines " "around the current line or continue the previous listing. With ``.`` as " @@ -845,7 +850,7 @@ msgstr "" "列出那一列周圍的 11 列。如果帶有兩個引數,則列出給定範圍中的程式碼;如果第二" "個引數小於第一個引數,則將其直譯為要列出的列數。" -#: ../../library/pdb.rst:483 +#: ../../library/pdb.rst:485 msgid "" "The current line in the current frame is indicated by ``->``. If an " "exception is being debugged, the line where the exception was originally " @@ -855,34 +860,34 @@ msgstr "" "當前 frame 中的當前列會用 ``->`` 標記出來。如果正在偵錯一個例外,且引發或傳遞" "該例外的那一列不是當前列,則會用 ``>>`` 來標記該列。" -#: ../../library/pdb.rst:488 +#: ../../library/pdb.rst:490 msgid "Added the ``>>`` marker." msgstr "新增了 ``>>`` 標記。" -#: ../../library/pdb.rst:493 +#: ../../library/pdb.rst:495 msgid "" "List all source code for the current function or frame. Interesting lines " "are marked as for :pdbcmd:`list`." msgstr "" "列出當前函式或 frame 的所有原始碼。相關列的標記方式與 :pdbcmd:`list` 相同。" -#: ../../library/pdb.rst:500 +#: ../../library/pdb.rst:502 msgid "Print the arguments of the current function and their current values." msgstr "印出當前函式的引數及它們當前的值。" -#: ../../library/pdb.rst:504 +#: ../../library/pdb.rst:506 msgid "Evaluate *expression* in the current context and print its value." msgstr "在當前情境中為 *expression* 求值並印出其值。" -#: ../../library/pdb.rst:508 +#: ../../library/pdb.rst:510 msgid "" "``print()`` can also be used, but is not a debugger command --- this " "executes the Python :func:`print` function." msgstr "" -"也可以使用 ``print()``,但它不是一個偵錯器命令 --- 它會執行 Python :func:" -"`print` 函式。" +"也可以使用 ``print()``,但它不是一個偵錯器命令 --- 它會執行 " +"Python :func:`print` 函式。" -#: ../../library/pdb.rst:514 +#: ../../library/pdb.rst:516 msgid "" "Like the :pdbcmd:`p` command, except the value of *expression* is pretty-" "printed using the :mod:`pprint` module." @@ -890,26 +895,26 @@ msgstr "" "與 :pdbcmd:`p` 命令類似,除了 *expression* 的值是使用 :mod:`pprint` 模組美化" "後印出來的。" -#: ../../library/pdb.rst:519 +#: ../../library/pdb.rst:521 msgid "Print the type of *expression*." msgstr "印出 *expression* 的型別。" -#: ../../library/pdb.rst:523 +#: ../../library/pdb.rst:525 msgid "Try to get source code of *expression* and display it." msgstr "嘗試獲取 *expression* 的原始碼並顯示它。" -#: ../../library/pdb.rst:529 +#: ../../library/pdb.rst:531 msgid "" "Display the value of *expression* if it changed, each time execution stops " "in the current frame." msgstr "每次在當前 frame 中停止執行時,顯示 *expression* 的值(如果有變更)。" -#: ../../library/pdb.rst:532 +#: ../../library/pdb.rst:534 msgid "" "Without *expression*, list all display expressions for the current frame." msgstr "如果不帶有 *expression*,則列出當前 frame 的所有運算式。" -#: ../../library/pdb.rst:536 +#: ../../library/pdb.rst:538 msgid "" "Display evaluates *expression* and compares to the result of the previous " "evaluation of *expression*, so when the result is mutable, display may not " @@ -918,11 +923,11 @@ msgstr "" "display 會對 *expression* 求值並將結果與之前 *expression* 的求值結果進行比" "較,因此當結果可變時,display 可能無法獲取其變更。" -#: ../../library/pdb.rst:540 ../../library/pdb.rst:690 +#: ../../library/pdb.rst:542 ../../library/pdb.rst:692 msgid "Example::" msgstr "範例如下: ::" -#: ../../library/pdb.rst:542 +#: ../../library/pdb.rst:544 msgid "" "lst = []\n" "breakpoint()\n" @@ -936,15 +941,15 @@ msgstr "" "lst.append(1)\n" "print(lst)" -#: ../../library/pdb.rst:548 +#: ../../library/pdb.rst:550 msgid "" "Display won't realize ``lst`` has been changed because the result of " "evaluation is modified in place by ``lst.append(1)`` before being compared::" msgstr "" -"display 不會意識到 ``lst`` 已更改,因為其求值結果在比較之前已被 ``lst." -"append(1)`` 原地 (in place) 修改: ::" +"display 不會意識到 ``lst`` 已更改,因為其求值結果在比較之前已被 " +"``lst.append(1)`` 原地 (in place) 修改: ::" -#: ../../library/pdb.rst:551 +#: ../../library/pdb.rst:553 msgid "" "> example.py(3)()\n" "-> pass\n" @@ -970,11 +975,11 @@ msgstr "" "-> print(lst)\n" "(Pdb)" -#: ../../library/pdb.rst:563 +#: ../../library/pdb.rst:565 msgid "You can do some tricks with copy mechanism to make it work::" msgstr "你可以運用複製機制的一些技巧來使其能夠運作: ::" -#: ../../library/pdb.rst:565 +#: ../../library/pdb.rst:567 msgid "" "> example.py(3)()\n" "-> pass\n" @@ -1002,7 +1007,7 @@ msgstr "" "display lst[:]: [1] [old: []]\n" "(Pdb)" -#: ../../library/pdb.rst:582 +#: ../../library/pdb.rst:584 msgid "" "Do not display *expression* anymore in the current frame. Without " "*expression*, clear all display expressions for the current frame." @@ -1010,7 +1015,7 @@ msgstr "" "不再顯示當前 frame 中的 *expression*。如果不帶有 *expression*,則清除當前 " "frame 的所有顯示運算式。" -#: ../../library/pdb.rst:589 +#: ../../library/pdb.rst:591 msgid "" "Start an interactive interpreter (using the :mod:`code` module) in a new " "global namespace initialised from the local and global namespaces for the " @@ -1021,7 +1026,7 @@ msgstr "" "(使用 :mod:`code` 模組)。可使用 ``exit()`` 或 ``quit()`` 退出直譯器並回到偵" "錯器。" -#: ../../library/pdb.rst:596 +#: ../../library/pdb.rst:598 msgid "" "As ``interact`` creates a new dedicated namespace for code execution, " "assignments to variables will not affect the original namespaces. However, " @@ -1032,20 +1037,20 @@ msgstr "" "影響原始命名空間,但是對任何被參照的可變物件的修改將像往常一樣反映在原始命名" "空間中。" -#: ../../library/pdb.rst:603 +#: ../../library/pdb.rst:605 msgid "" "``exit()`` and ``quit()`` can be used to exit the :pdbcmd:`interact` command." msgstr "``exit()`` 和 ``quit()`` 可用來退出 :pdbcmd:`interact` 命令。" -#: ../../library/pdb.rst:607 +#: ../../library/pdb.rst:609 msgid "" ":pdbcmd:`interact` directs its output to the debugger's output channel " "rather than :data:`sys.stderr`." msgstr "" -":pdbcmd:`interact` 將其輸出導向到偵錯器的輸出通道 (output channel),而不是 :" -"data:`sys.stderr`。" +":pdbcmd:`interact` 將其輸出導向到偵錯器的輸出通道 (output channel),而不" +"是 :data:`sys.stderr`。" -#: ../../library/pdb.rst:615 +#: ../../library/pdb.rst:617 msgid "" "Create an alias called *name* that executes *command*. The *command* must " "*not* be enclosed in quotes. Replaceable parameters can be indicated by " @@ -1058,7 +1063,7 @@ msgstr "" "有參數替換。如果省略 *command*,則顯示 *name* 的目前別名。如果未給定引數,則" "列出所有別名。" -#: ../../library/pdb.rst:621 +#: ../../library/pdb.rst:623 msgid "" "Aliases may be nested and can contain anything that can be legally typed at " "the pdb prompt. Note that internal pdb commands *can* be overridden by " @@ -1070,14 +1075,14 @@ msgstr "" "部 pdb 命令\\ *可以*\\ 被別名所覆蓋。這樣的命令在別名被移除前都將被隱藏。別名" "會遞迴地應用到命令列的第一個單詞;該列內的其他單詞則不會受影響。" -#: ../../library/pdb.rst:627 +#: ../../library/pdb.rst:629 msgid "" -"As an example, here are two useful aliases (especially when placed in the :" -"file:`.pdbrc` file)::" +"As an example, here are two useful aliases (especially when placed in " +"the :file:`.pdbrc` file)::" msgstr "" "作為範例,這裡列出了兩個有用的別名(特別是放在 :file:`.pdbrc` 檔案中時): ::" -#: ../../library/pdb.rst:630 +#: ../../library/pdb.rst:632 msgid "" "# Print instance variables (usage \"pi classInst\")\n" "alias pi for k in %1.__dict__.keys(): print(f\"%1.{k} = {%1.__dict__[k]}\")\n" @@ -1089,11 +1094,11 @@ msgstr "" "# 印出 self 中的實例變數\n" "alias ps pi self" -#: ../../library/pdb.rst:637 +#: ../../library/pdb.rst:639 msgid "Delete the specified alias *name*." msgstr "刪除指定的別名 *name*。" -#: ../../library/pdb.rst:641 +#: ../../library/pdb.rst:643 msgid "" "Execute the (one-line) *statement* in the context of the current stack " "frame. The exclamation point can be omitted unless the first word of the " @@ -1102,7 +1107,7 @@ msgstr "" "在當前 stack frame 的情境中執行(單列)\\ *statement*。除非陳述式的第一個單詞" "類似於偵錯器命令,否則可以省略驚嘆號,例如:" -#: ../../library/pdb.rst:645 +#: ../../library/pdb.rst:647 msgid "" "(Pdb) ! n=42\n" "(Pdb)" @@ -1110,15 +1115,15 @@ msgstr "" "(Pdb) ! n=42\n" "(Pdb)" -#: ../../library/pdb.rst:650 +#: ../../library/pdb.rst:652 msgid "" -"To set a global variable, you can prefix the assignment command with a :" -"keyword:`global` statement on the same line, e.g.:" +"To set a global variable, you can prefix the assignment command with " +"a :keyword:`global` statement on the same line, e.g.:" msgstr "" "要設定全域變數,你可以在同一列的賦值命令前面加上 :keyword:`global` 陳述式,例" "如:" -#: ../../library/pdb.rst:653 +#: ../../library/pdb.rst:655 msgid "" "(Pdb) global list_options; list_options = ['-l']\n" "(Pdb)" @@ -1126,22 +1131,22 @@ msgstr "" "(Pdb) global list_options; list_options = ['-l']\n" "(Pdb)" -#: ../../library/pdb.rst:661 +#: ../../library/pdb.rst:663 msgid "" "Restart the debugged Python program. If *args* is supplied, it is split " "with :mod:`shlex` and the result is used as the new :data:`sys.argv`. " -"History, breakpoints, actions and debugger options are preserved. :pdbcmd:" -"`restart` is an alias for :pdbcmd:`run`." +"History, breakpoints, actions and debugger options are " +"preserved. :pdbcmd:`restart` is an alias for :pdbcmd:`run`." msgstr "" "重新啟動已偵錯完畢的 Python 程式。如果提供了 *args*,它將以 :mod:`shlex` 分" "割,並將結果用作新的 :data:`sys.argv`。歷史記錄、斷點、操作和偵錯器選項均會被" "保留。:pdbcmd:`restart` 是 :pdbcmd:`run` 的別名。" -#: ../../library/pdb.rst:668 +#: ../../library/pdb.rst:670 msgid "Quit from the debugger. The program being executed is aborted." msgstr "離開偵錯器,執行中的程式會被中止。" -#: ../../library/pdb.rst:672 +#: ../../library/pdb.rst:674 msgid "" "Enter a recursive debugger that steps through *code* (which is an arbitrary " "expression or statement to be executed in the current environment)." @@ -1149,15 +1154,15 @@ msgstr "" "進入一個遞迴偵錯器,逐步執行 *code*\\ (這是要在當前環境中執行的任意運算式或" "陳述式)。" -#: ../../library/pdb.rst:678 +#: ../../library/pdb.rst:680 msgid "Print the return value for the last return of the current function." msgstr "印出當前函式最後一次回傳的回傳值。" -#: ../../library/pdb.rst:682 +#: ../../library/pdb.rst:684 msgid "List or jump between chained exceptions." msgstr "列出鏈接例外 (chained exceptions),或在其間跳轉。" -#: ../../library/pdb.rst:684 +#: ../../library/pdb.rst:686 msgid "" "When using ``pdb.pm()`` or ``Pdb.post_mortem(...)`` with a chained " "exception instead of a traceback, it allows the user to move between the " @@ -1168,7 +1173,7 @@ msgstr "" "許使用者在鏈接例外之間移動,使用 ``exceptions`` 命令以列出例外,並使用 " "``exception `` 切換到該例外。" -#: ../../library/pdb.rst:692 +#: ../../library/pdb.rst:694 msgid "" "def out():\n" " try:\n" @@ -1204,11 +1209,11 @@ msgstr "" "\n" " out()" -#: ../../library/pdb.rst:709 +#: ../../library/pdb.rst:711 msgid "calling ``pdb.pm()`` will allow to move between exceptions::" msgstr "呼叫 ``pdb.pm()`` 將允許在例外之間移動: ::" -#: ../../library/pdb.rst:711 +#: ../../library/pdb.rst:713 msgid "" "> example.py(5)out()\n" "-> raise ValueError(\"reraise middle() error\") from e\n" @@ -1242,11 +1247,11 @@ msgstr "" "> example.py(10)middle()\n" "-> return inner(0)" -#: ../../library/pdb.rst:730 +#: ../../library/pdb.rst:732 msgid "Footnotes" msgstr "註腳" -#: ../../library/pdb.rst:731 +#: ../../library/pdb.rst:733 msgid "" "Whether a frame is considered to originate in a certain module is determined " "by the ``__name__`` in the frame globals." @@ -1274,18 +1279,18 @@ msgstr "bdb" msgid "cmd" msgstr "cmd" -#: ../../library/pdb.rst:295 +#: ../../library/pdb.rst:297 msgid ".pdbrc" msgstr ".pdbrc" -#: ../../library/pdb.rst:295 +#: ../../library/pdb.rst:297 msgid "file" msgstr "file(檔案)" -#: ../../library/pdb.rst:295 +#: ../../library/pdb.rst:297 msgid "debugger" msgstr "debugger(偵錯器)" -#: ../../library/pdb.rst:295 +#: ../../library/pdb.rst:297 msgid "configuration" msgstr "configuration(設定)" diff --git a/library/plistlib.po b/library/plistlib.po index 282baf27aa..8e0a57dc70 100644 --- a/library/plistlib.po +++ b/library/plistlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-02-05 00:13+0000\n" "PO-Revision-Date: 2016-01-31 07:27+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -119,7 +119,7 @@ msgstr "" msgid "" "When *aware_datetime* is true, fields with type ``datetime.datetime`` will " "be created as :ref:`aware object `, with :attr:`!" -"tzinfo` as :attr:`datetime.UTC`." +"tzinfo` as :const:`datetime.UTC`." msgstr "" #: ../../library/plistlib.rst:76 diff --git a/library/site.po b/library/site.po index 89fbfeb209..9108089b60 100644 --- a/library/site.po +++ b/library/site.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-02-05 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -58,7 +58,7 @@ msgid "" "then :file:`lib/site-packages` (on Windows) or :file:`lib/python{X.Y[t]}/" "site-packages` (on Unix and macOS). (The optional suffix \"t\" indicates " "the :term:`free threading` build, and is appended if ``\"t\"`` is present in " -"the :attr:`sys.abiflags` constant.) For each of the distinct head-tail " +"the :data:`sys.abiflags` constant.) For each of the distinct head-tail " "combinations, it sees if it refers to an existing directory, and if so, adds " "it to ``sys.path`` and also inspects the newly added path for configuration " "files." diff --git a/library/socket.po b/library/socket.po index 4b6ff2fe44..67135fe667 100644 --- a/library/socket.po +++ b/library/socket.po @@ -66,10 +66,10 @@ msgstr "由於是呼叫作業系統的 socket API,某些行為可能會因平 #: ../../library/socket.rst:1441 ../../library/socket.rst:1488 #: ../../library/socket.rst:1502 ../../library/socket.rst:1522 #: ../../library/socket.rst:1569 ../../library/socket.rst:1614 -#: ../../library/socket.rst:1744 ../../library/socket.rst:1788 -#: ../../library/socket.rst:1896 ../../library/socket.rst:1914 -#: ../../library/socket.rst:1998 ../../library/socket.rst:2008 -#: ../../library/socket.rst:2020 ../../includes/wasm-notavail.rst:3 +#: ../../library/socket.rst:1739 ../../library/socket.rst:1783 +#: ../../library/socket.rst:1891 ../../library/socket.rst:1909 +#: ../../library/socket.rst:1993 ../../library/socket.rst:2003 +#: ../../library/socket.rst:2015 ../../includes/wasm-notavail.rst:3 msgid "Availability" msgstr "" @@ -87,8 +87,8 @@ msgid "" "call and library interface for sockets to Python's object-oriented style: " "the :func:`~socket.socket` function returns a :dfn:`socket object` whose " "methods implement the various socket system calls. Parameter types are " -"somewhat higher-level than in the C interface: as with :meth:`read` and :" -"meth:`write` operations on Python files, buffer allocation on receive " +"somewhat higher-level than in the C interface: as with :meth:`read` " +"and :meth:`write` operations on Python files, buffer allocation on receive " "operations is automatic, and buffer length is implicit on send operations." msgstr "" "Python 的介面是將 Unix 的系統呼叫和 socket 函式庫介面直接轉換成 Python 的物件" @@ -148,7 +148,7 @@ msgid "" msgstr "" #: ../../library/socket.rst:66 ../../library/socket.rst:1189 -#: ../../library/socket.rst:1231 ../../library/socket.rst:1992 +#: ../../library/socket.rst:1231 ../../library/socket.rst:1987 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "" @@ -164,10 +164,10 @@ msgstr "" msgid "" "For IPv4 addresses, two special forms are accepted instead of a host " "address: ``''`` represents :const:`INADDR_ANY`, which is used to bind to all " -"interfaces, and the string ``''`` represents :const:" -"`INADDR_BROADCAST`. This behavior is not compatible with IPv6, therefore, " -"you may want to avoid these if you intend to support IPv6 with your Python " -"programs." +"interfaces, and the string ``''`` " +"represents :const:`INADDR_BROADCAST`. This behavior is not compatible with " +"IPv6, therefore, you may want to avoid these if you intend to support IPv6 " +"with your Python programs." msgstr "" #: ../../library/socket.rst:83 @@ -490,8 +490,8 @@ msgstr "" #: ../../library/socket.rst:272 msgid "" "Non-blocking mode is supported through :meth:`~socket.setblocking`. A " -"generalization of this based on timeouts is supported through :meth:`~socket." -"settimeout`." +"generalization of this based on timeouts is supported " +"through :meth:`~socket.settimeout`." msgstr "" #: ../../library/socket.rst:278 @@ -517,11 +517,12 @@ msgstr "" #: ../../library/socket.rst:296 msgid "" "A subclass of :exc:`OSError`, this exception is raised for address-related " -"errors, i.e. for functions that use *h_errno* in the POSIX C API, including :" -"func:`gethostbyname_ex` and :func:`gethostbyaddr`. The accompanying value is " -"a pair ``(h_errno, string)`` representing an error returned by a library " -"call. *h_errno* is a numeric value, while *string* represents the " -"description of *h_errno*, as returned by the :c:func:`hstrerror` C function." +"errors, i.e. for functions that use *h_errno* in the POSIX C API, " +"including :func:`gethostbyname_ex` and :func:`gethostbyaddr`. The " +"accompanying value is a pair ``(h_errno, string)`` representing an error " +"returned by a library call. *h_errno* is a numeric value, while *string* " +"represents the description of *h_errno*, as returned by " +"the :c:func:`hstrerror` C function." msgstr "" #: ../../library/socket.rst:304 ../../library/socket.rst:317 @@ -546,10 +547,10 @@ msgstr "" #: ../../library/socket.rst:324 msgid "" "A subclass of :exc:`OSError`, this exception is raised when a timeout occurs " -"on a socket which has had timeouts enabled via a prior call to :meth:" -"`~socket.settimeout` (or implicitly through :func:`~socket." -"setdefaulttimeout`). The accompanying value is a string whose value is " -"currently always \"timed out\"." +"on a socket which has had timeouts enabled via a prior call " +"to :meth:`~socket.settimeout` (or implicitly " +"through :func:`~socket.setdefaulttimeout`). The accompanying value is a " +"string whose value is currently always \"timed out\"." msgstr "" #: ../../library/socket.rst:333 @@ -562,8 +563,8 @@ msgstr "常數" #: ../../library/socket.rst:340 msgid "" -"The AF_* and SOCK_* constants are now :class:`AddressFamily` and :class:" -"`SocketKind` :class:`.IntEnum` collections." +"The AF_* and SOCK_* constants are now :class:`AddressFamily` " +"and :class:`SocketKind` :class:`.IntEnum` collections." msgstr "" #: ../../library/socket.rst:349 @@ -583,8 +584,8 @@ msgstr "" #: ../../library/socket.rst:366 msgid "" -"These constants represent the socket types, used for the second argument to :" -"func:`~socket.socket`. More constants may be available depending on the " +"These constants represent the socket types, used for the second argument " +"to :func:`~socket.socket`. More constants may be available depending on the " "system. (Only :const:`SOCK_STREAM` and :const:`SOCK_DGRAM` appear to be " "generally useful.)" msgstr "" @@ -598,18 +599,18 @@ msgstr "" #: ../../library/socket.rst:380 msgid "" -"`Secure File Descriptor Handling `_ for a more thorough explanation." +"`Secure File Descriptor Handling `_ for a more thorough explanation." msgstr "" #: ../../library/socket.rst:404 msgid "" "Many constants of these forms, documented in the Unix documentation on " "sockets and/or the IP protocol, are also defined in the socket module. They " -"are generally used in arguments to the :meth:`~socket.setsockopt` and :meth:" -"`~socket.getsockopt` methods of socket objects. In most cases, only those " -"symbols that are defined in the Unix header files are defined; for a few " -"symbols, default values are provided." +"are generally used in arguments to the :meth:`~socket.setsockopt` " +"and :meth:`~socket.getsockopt` methods of socket objects. In most cases, " +"only those symbols that are defined in the Unix header files are defined; " +"for a few symbols, default values are provided." msgstr "" #: ../../library/socket.rst:411 @@ -799,8 +800,8 @@ msgstr "" #: ../../library/socket.rst:662 msgid "" -"Constant to optimize CPU locality, to be used in conjunction with :data:" -"`SO_REUSEPORT`." +"Constant to optimize CPU locality, to be used in conjunction " +"with :data:`SO_REUSEPORT`." msgstr "" #: ../../library/socket.rst:682 @@ -835,14 +836,14 @@ msgstr "" #: ../../library/socket.rst:722 msgid "" "Create a new socket using the given address family, socket type and protocol " -"number. The address family should be :const:`AF_INET` (the default), :const:" -"`AF_INET6`, :const:`AF_UNIX`, :const:`AF_CAN`, :const:`AF_PACKET`, or :const:" -"`AF_RDS`. The socket type should be :const:`SOCK_STREAM` (the default), :" -"const:`SOCK_DGRAM`, :const:`SOCK_RAW` or perhaps one of the other ``SOCK_`` " -"constants. The protocol number is usually zero and may be omitted or in the " -"case where the address family is :const:`AF_CAN` the protocol should be one " -"of :const:`CAN_RAW`, :const:`CAN_BCM`, :const:`CAN_ISOTP` or :const:" -"`CAN_J1939`." +"number. The address family should be :const:`AF_INET` (the " +"default), :const:`AF_INET6`, :const:`AF_UNIX`, :const:`AF_CAN`, :const:`AF_PACKET`, " +"or :const:`AF_RDS`. The socket type should be :const:`SOCK_STREAM` (the " +"default), :const:`SOCK_DGRAM`, :const:`SOCK_RAW` or perhaps one of the other " +"``SOCK_`` constants. The protocol number is usually zero and may be omitted " +"or in the case where the address family is :const:`AF_CAN` the protocol " +"should be one of :const:`CAN_RAW`, :const:`CAN_BCM`, :const:`CAN_ISOTP` " +"or :const:`CAN_J1939`." msgstr "" #: ../../library/socket.rst:732 @@ -851,9 +852,9 @@ msgid "" "auto-detected from the specified file descriptor. Auto-detection can be " "overruled by calling the function with explicit *family*, *type*, or *proto* " "arguments. This only affects how Python represents e.g. the return value " -"of :meth:`socket.getpeername` but not the actual OS resource. Unlike :func:" -"`socket.fromfd`, *fileno* will return the same socket and not a duplicate. " -"This may help close a detached socket using :meth:`socket.close`." +"of :meth:`socket.getpeername` but not the actual OS resource. " +"Unlike :func:`socket.fromfd`, *fileno* will return the same socket and not a " +"duplicate. This may help close a detached socket using :meth:`socket.close`." msgstr "" #: ../../library/socket.rst:741 ../../library/socket.rst:887 @@ -994,21 +995,21 @@ msgstr "" msgid "" "*family* should be either :data:`AF_INET` or :data:`AF_INET6`. *backlog* is " "the queue size passed to :meth:`socket.listen`; if not specified , a default " -"reasonable value is chosen. *reuse_port* dictates whether to set the :data:" -"`SO_REUSEPORT` socket option." +"reasonable value is chosen. *reuse_port* dictates whether to set " +"the :data:`SO_REUSEPORT` socket option." msgstr "" #: ../../library/socket.rst:841 msgid "" "If *dualstack_ipv6* is true and the platform supports it the socket will be " -"able to accept both IPv4 and IPv6 connections, else it will raise :exc:" -"`ValueError`. Most POSIX platforms and Windows are supposed to support this " -"functionality. When this functionality is enabled the address returned by :" -"meth:`socket.getpeername` when an IPv4 connection occurs will be an IPv6 " -"address represented as an IPv4-mapped IPv6 address. If *dualstack_ipv6* is " -"false it will explicitly disable this functionality on platforms that enable " -"it by default (e.g. Linux). This parameter can be used in conjunction with :" -"func:`has_dualstack_ipv6`:" +"able to accept both IPv4 and IPv6 connections, else it will " +"raise :exc:`ValueError`. Most POSIX platforms and Windows are supposed to " +"support this functionality. When this functionality is enabled the address " +"returned by :meth:`socket.getpeername` when an IPv4 connection occurs will " +"be an IPv6 address represented as an IPv4-mapped IPv6 address. If " +"*dualstack_ipv6* is false it will explicitly disable this functionality on " +"platforms that enable it by default (e.g. Linux). This parameter can be used " +"in conjunction with :func:`has_dualstack_ipv6`:" msgstr "" #: ../../library/socket.rst:854 @@ -1048,12 +1049,12 @@ msgstr "" msgid "" "Duplicate the file descriptor *fd* (an integer as returned by a file " "object's :meth:`~io.IOBase.fileno` method) and build a socket object from " -"the result. Address family, socket type and protocol number are as for the :" -"func:`~socket.socket` function above. The file descriptor should refer to a " -"socket, but this is not checked --- subsequent operations on the object may " -"fail if the file descriptor is invalid. This function is rarely needed, but " -"can be used to get or set socket options on a socket passed to a program as " -"standard input or output (such as a server started by the Unix inet " +"the result. Address family, socket type and protocol number are as for " +"the :func:`~socket.socket` function above. The file descriptor should refer " +"to a socket, but this is not checked --- subsequent operations on the object " +"may fail if the file descriptor is invalid. This function is rarely needed, " +"but can be used to get or set socket options on a socket passed to a program " +"as standard input or output (such as a server started by the Unix inet " "daemon). The socket is assumed to be in blocking mode." msgstr "" @@ -1110,9 +1111,9 @@ msgstr "" #: ../../library/socket.rst:939 msgid "" "The *flags* argument can be one or several of the ``AI_*`` constants, and " -"will influence how results are computed and returned. For example, :const:" -"`AI_NUMERICHOST` will disable domain name resolution and will raise an error " -"if *host* is a domain name." +"will influence how results are computed and returned. For " +"example, :const:`AI_NUMERICHOST` will disable domain name resolution and " +"will raise an error if *host* is a domain name." msgstr "" #: ../../library/socket.rst:944 @@ -1127,12 +1128,13 @@ msgstr "``(family, type, proto, canonname, sockaddr)``" msgid "" "In these tuples, *family*, *type*, *proto* are all integers and are meant to " "be passed to the :func:`~socket.socket` function. *canonname* will be a " -"string representing the canonical name of the *host* if :const:" -"`AI_CANONNAME` is part of the *flags* argument; else *canonname* will be " -"empty. *sockaddr* is a tuple describing a socket address, whose format " -"depends on the returned *family* (a ``(address, port)`` 2-tuple for :const:" -"`AF_INET`, a ``(address, port, flowinfo, scope_id)`` 4-tuple for :const:" -"`AF_INET6`), and is meant to be passed to the :meth:`socket.connect` method." +"string representing the canonical name of the *host* " +"if :const:`AI_CANONNAME` is part of the *flags* argument; else *canonname* " +"will be empty. *sockaddr* is a tuple describing a socket address, whose " +"format depends on the returned *family* (a ``(address, port)`` 2-tuple " +"for :const:`AF_INET`, a ``(address, port, flowinfo, scope_id)`` 4-tuple " +"for :const:`AF_INET6`), and is meant to be passed to " +"the :meth:`socket.connect` method." msgstr "" #: ../../library/socket.rst:960 @@ -1232,8 +1234,8 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyname`` with " "argument ``hostname``." msgstr "" -"引發一個附帶引數 ``hostname`` 的\\ :ref:`稽核事件 ` ``socket." -"gethostbyname``。" +"引發一個附帶引數 ``hostname`` 的\\ :ref:`稽核事件 ` " +"``socket.gethostbyname``。" #: ../../library/socket.rst:1028 msgid "" @@ -1273,8 +1275,8 @@ msgid "" "(possibly empty) list of alternative host names for the same address, and " "*ipaddrlist* is a list of IPv4/v6 addresses for the same interface on the " "same host (most likely containing only a single address). To find the fully " -"qualified domain name, use the function :func:`getfqdn`. :func:" -"`gethostbyaddr` supports both IPv4 and IPv6." +"qualified domain name, use the " +"function :func:`getfqdn`. :func:`gethostbyaddr` supports both IPv4 and IPv6." msgstr "" #: ../../library/socket.rst:1065 @@ -1282,8 +1284,8 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with " "argument ``ip_address``." msgstr "" -"引發一個附帶引數 ``ip_address`` 的\\ :ref:`稽核事件 ` ``socket." -"gethostbyaddr``。" +"引發一個附帶引數 ``ip_address`` 的\\ :ref:`稽核事件 ` " +"``socket.gethostbyaddr``。" #: ../../library/socket.rst:1072 msgid "" @@ -1309,16 +1311,17 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.getnameinfo`` with " "argument ``sockaddr``." msgstr "" -"引發一個附帶引數 ``sockaddr`` 的\\ :ref:`稽核事件 ` ``socket." -"getnameinfo``。" +"引發一個附帶引數 ``sockaddr`` 的\\ :ref:`稽核事件 ` " +"``socket.getnameinfo``。" #: ../../library/socket.rst:1089 msgid "" "Translate an internet protocol name (for example, ``'icmp'``) to a constant " -"suitable for passing as the (optional) third argument to the :func:`~socket." -"socket` function. This is usually only needed for sockets opened in \"raw\" " -"mode (:const:`SOCK_RAW`); for the normal socket modes, the correct protocol " -"is chosen automatically if the protocol is omitted or zero." +"suitable for passing as the (optional) third argument to " +"the :func:`~socket.socket` function. This is usually only needed for " +"sockets opened in \"raw\" mode (:const:`SOCK_RAW`); for the normal socket " +"modes, the correct protocol is chosen automatically if the protocol is " +"omitted or zero." msgstr "" #: ../../library/socket.rst:1100 @@ -1401,9 +1404,9 @@ msgstr "" #: ../../library/socket.rst:1167 msgid "" -"If the IPv4 address string passed to this function is invalid, :exc:" -"`OSError` will be raised. Note that exactly what is valid depends on the " -"underlying C implementation of :c:func:`inet_aton`." +"If the IPv4 address string passed to this function is " +"invalid, :exc:`OSError` will be raised. Note that exactly what is valid " +"depends on the underlying C implementation of :c:func:`inet_aton`." msgstr "" #: ../../library/socket.rst:1171 @@ -1434,17 +1437,17 @@ msgstr "" msgid "" "Convert an IP address from its family-specific string format to a packed, " "binary format. :func:`inet_pton` is useful when a library or network " -"protocol calls for an object of type :c:struct:`in_addr` (similar to :func:" -"`inet_aton`) or :c:struct:`in6_addr`." +"protocol calls for an object of type :c:struct:`in_addr` (similar " +"to :func:`inet_aton`) or :c:struct:`in6_addr`." msgstr "" #: ../../library/socket.rst:1200 msgid "" -"Supported values for *address_family* are currently :const:`AF_INET` and :" -"const:`AF_INET6`. If the IP address string *ip_string* is invalid, :exc:" -"`OSError` will be raised. Note that exactly what is valid depends on both " -"the value of *address_family* and the underlying implementation of :c:func:" -"`inet_pton`." +"Supported values for *address_family* are currently :const:`AF_INET` " +"and :const:`AF_INET6`. If the IP address string *ip_string* is " +"invalid, :exc:`OSError` will be raised. Note that exactly what is valid " +"depends on both the value of *address_family* and the underlying " +"implementation of :c:func:`inet_pton`." msgstr "" #: ../../library/socket.rst:1208 ../../library/socket.rst:1228 @@ -1462,10 +1465,11 @@ msgstr "" #: ../../library/socket.rst:1221 msgid "" -"Supported values for *address_family* are currently :const:`AF_INET` and :" -"const:`AF_INET6`. If the bytes object *packed_ip* is not the correct length " -"for the specified address family, :exc:`ValueError` will be raised. :exc:" -"`OSError` is raised for errors from the call to :func:`inet_ntop`." +"Supported values for *address_family* are currently :const:`AF_INET` " +"and :const:`AF_INET6`. If the bytes object *packed_ip* is not the correct " +"length for the specified address family, :exc:`ValueError` will be " +"raised. :exc:`OSError` is raised for errors from the call " +"to :func:`inet_ntop`." msgstr "" #: ../../library/socket.rst:1243 @@ -1473,14 +1477,14 @@ msgid "" "Return the total length, without trailing padding, of an ancillary data item " "with associated data of the given *length*. This value can often be used as " "the buffer size for :meth:`~socket.recvmsg` to receive a single item of " -"ancillary data, but :rfc:`3542` requires portable applications to use :func:" -"`CMSG_SPACE` and thus include space for padding, even when the item will be " -"the last in the buffer. Raises :exc:`OverflowError` if *length* is outside " -"the permissible range of values." +"ancillary data, but :rfc:`3542` requires portable applications to " +"use :func:`CMSG_SPACE` and thus include space for padding, even when the " +"item will be the last in the buffer. Raises :exc:`OverflowError` if " +"*length* is outside the permissible range of values." msgstr "" -#: ../../library/socket.rst:1254 ../../library/socket.rst:1746 -#: ../../library/socket.rst:1790 ../../library/socket.rst:1898 +#: ../../library/socket.rst:1254 ../../library/socket.rst:1741 +#: ../../library/socket.rst:1785 ../../library/socket.rst:1893 msgid "Most Unix platforms." msgstr "" @@ -1516,8 +1520,9 @@ msgstr "" #: ../../library/socket.rst:1291 msgid "" "Set the default timeout in seconds (float) for new socket objects. When the " -"socket module is first imported, the default is ``None``. See :meth:" -"`~socket.settimeout` for possible values and their respective meanings." +"socket module is first imported, the default is ``None``. " +"See :meth:`~socket.settimeout` for possible values and their respective " +"meanings." msgstr "" #: ../../library/socket.rst:1299 @@ -1531,8 +1536,8 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.sethostname`` with " "argument ``name``." msgstr "" -"引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``socket." -"sethostname``。" +"引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` " +"``socket.sethostname``。" #: ../../library/socket.rst:1311 msgid "" @@ -1575,8 +1580,8 @@ msgstr "" #: ../../library/socket.rst:1338 msgid "" -"Return a network interface index number corresponding to an interface name. :" -"exc:`OSError` if no interface with the given name exists." +"Return a network interface index number corresponding to an interface " +"name. :exc:`OSError` if no interface with the given name exists." msgstr "" #: ../../library/socket.rst:1350 ../../library/socket.rst:1367 @@ -1585,15 +1590,15 @@ msgstr "" #: ../../library/socket.rst:1355 msgid "" -"Return a network interface name corresponding to an interface index number. :" -"exc:`OSError` if no interface with the given index exists." +"Return a network interface name corresponding to an interface index " +"number. :exc:`OSError` if no interface with the given index exists." msgstr "" #: ../../library/socket.rst:1372 msgid "" "Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket " -"*sock*. The *fds* parameter is a sequence of file descriptors. Consult :meth:" -"`~socket.sendmsg` for the documentation of these parameters." +"*sock*. The *fds* parameter is a sequence of file descriptors. " +"Consult :meth:`~socket.sendmsg` for the documentation of these parameters." msgstr "" #: ../../library/socket.rst:1378 ../../library/socket.rst:1392 @@ -1605,8 +1610,8 @@ msgstr "" #: ../../library/socket.rst:1386 msgid "" "Receive up to *maxfds* file descriptors from an :const:`AF_UNIX` socket " -"*sock*. Return ``(msg, list(fds), flags, addr)``. Consult :meth:`~socket." -"recvmsg` for the documentation of these parameters." +"*sock*. Return ``(msg, list(fds), flags, addr)``. " +"Consult :meth:`~socket.recvmsg` for the documentation of these parameters." msgstr "" #: ../../library/socket.rst:1399 @@ -1619,8 +1624,9 @@ msgstr "Socket 物件" #: ../../library/socket.rst:1407 msgid "" -"Socket objects have the following methods. Except for :meth:`~socket." -"makefile`, these correspond to Unix system calls applicable to sockets." +"Socket objects have the following methods. Except " +"for :meth:`~socket.makefile`, these correspond to Unix system calls " +"applicable to sockets." msgstr "" #: ../../library/socket.rst:1411 @@ -1642,14 +1648,14 @@ msgstr "" msgid "The socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:1428 ../../library/socket.rst:1659 -#: ../../library/socket.rst:1673 ../../library/socket.rst:1750 -#: ../../library/socket.rst:1823 ../../library/socket.rst:1842 -#: ../../library/socket.rst:1859 ../../library/socket.rst:1904 +#: ../../library/socket.rst:1428 ../../library/socket.rst:1654 +#: ../../library/socket.rst:1668 ../../library/socket.rst:1745 +#: ../../library/socket.rst:1818 ../../library/socket.rst:1837 +#: ../../library/socket.rst:1854 ../../library/socket.rst:1899 msgid "" "If the system call is interrupted and the signal handler does not raise an " -"exception, the method now retries the system call instead of raising an :exc:" -"`InterruptedError` exception (see :pep:`475` for the rationale)." +"exception, the method now retries the system call instead of raising " +"an :exc:`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" #: ../../library/socket.rst:1436 @@ -1684,8 +1690,8 @@ msgstr "" #: ../../library/socket.rst:1456 msgid "" -":exc:`OSError` is now raised if an error occurs when the underlying :c:func:" -"`close` call is made." +":exc:`OSError` is now raised if an error occurs when the " +"underlying :c:func:`close` call is made." msgstr "" #: ../../library/socket.rst:1462 @@ -1706,9 +1712,9 @@ msgid "" "If the connection is interrupted by a signal, the method waits until the " "connection completes, or raise a :exc:`TimeoutError` on timeout, if the " "signal handler doesn't raise an exception and the socket is blocking or has " -"a timeout. For non-blocking sockets, the method raises an :exc:" -"`InterruptedError` exception if the connection is interrupted by a signal " -"(or the exception raised by the signal handler)." +"a timeout. For non-blocking sockets, the method raises " +"an :exc:`InterruptedError` exception if the connection is interrupted by a " +"signal (or the exception raised by the signal handler)." msgstr "" #: ../../library/socket.rst:1480 ../../library/socket.rst:1500 @@ -1721,8 +1727,8 @@ msgstr "" #: ../../library/socket.rst:1482 msgid "" -"The method now waits until the connection completes instead of raising an :" -"exc:`InterruptedError` exception if the connection is interrupted by a " +"The method now waits until the connection completes instead of raising " +"an :exc:`InterruptedError` exception if the connection is interrupted by a " "signal, the signal handler doesn't raise an exception and the socket is " "blocking or has a timeout (see the :pep:`475` for the rationale)." msgstr "" @@ -1785,15 +1791,15 @@ msgstr "" #: ../../library/socket.rst:1560 msgid "" -"Return the value of the given socket option (see the Unix man page :manpage:" -"`getsockopt(2)`). The needed symbolic constants (:ref:`SO_\\* etc. `) are defined in this module. If *buflen* is absent, an " -"integer option is assumed and its integer value is returned by the " -"function. If *buflen* is present, it specifies the maximum length of the " -"buffer used to receive the option in, and this buffer is returned as a bytes " -"object. It is up to the caller to decode the contents of the buffer (see " -"the optional built-in module :mod:`struct` for a way to decode C structures " -"encoded as byte strings)." +"Return the value of the given socket option (see the Unix man " +"page :manpage:`getsockopt(2)`). The needed symbolic constants (:ref:`SO_\\* " +"etc. `) are defined in this module. If *buflen* is " +"absent, an integer option is assumed and its integer value is returned by " +"the function. If *buflen* is present, it specifies the maximum length of " +"the buffer used to receive the option in, and this buffer is returned as a " +"bytes object. It is up to the caller to decode the contents of the buffer " +"(see the optional built-in module :mod:`struct` for a way to decode C " +"structures encoded as byte strings)." msgstr "" #: ../../library/socket.rst:1574 @@ -1808,8 +1814,8 @@ msgstr "這等同於檢查 ``socket.gettimeout() != 0``。" #: ../../library/socket.rst:1584 msgid "" "Return the timeout in seconds (float) associated with socket operations, or " -"``None`` if no timeout is set. This reflects the last call to :meth:" -"`setblocking` or :meth:`settimeout`." +"``None`` if no timeout is set. This reflects the last call " +"to :meth:`setblocking` or :meth:`settimeout`." msgstr "" #: ../../library/socket.rst:0 @@ -1823,8 +1829,9 @@ msgstr "Windows" #: ../../library/socket.rst:1593 msgid "" "The :meth:`ioctl` method is a limited interface to the WSAIoctl system " -"interface. Please refer to the `Win32 documentation `_ for more information." +"interface. Please refer to the `Win32 documentation `_ for more " +"information." msgstr "" #: ../../library/socket.rst:1598 @@ -1870,8 +1877,8 @@ msgstr "" #: ../../library/socket.rst:1635 msgid "" "Closing the file object returned by :meth:`makefile` won't close the " -"original socket unless all other file objects have been closed and :meth:" -"`socket.close` has been called on the socket object." +"original socket unless all other file objects have been closed " +"and :meth:`socket.close` has been called on the socket object." msgstr "" #: ../../library/socket.rst:1641 @@ -1886,18 +1893,12 @@ msgid "" "Receive data from the socket. The return value is a bytes object " "representing the data received. The maximum amount of data to be received " "at once is specified by *bufsize*. A returned empty bytes object indicates " -"that the client has disconnected. See the Unix manual page :manpage:" -"`recv(2)` for the meaning of the optional argument *flags*; it defaults to " -"zero." +"that the client has disconnected. See the Unix manual " +"page :manpage:`recv(2)` for the meaning of the optional argument *flags*; it " +"defaults to zero." msgstr "" -#: ../../library/socket.rst:1656 -msgid "" -"For best match with hardware and network realities, the value of *bufsize* " -"should be a relatively small power of 2, for example, 4096." -msgstr "" - -#: ../../library/socket.rst:1667 +#: ../../library/socket.rst:1662 msgid "" "Receive data from the socket. The return value is a pair ``(bytes, " "address)`` where *bytes* is a bytes object representing the data received " @@ -1907,14 +1908,14 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1678 +#: ../../library/socket.rst:1673 msgid "" "For multicast IPv6 address, first item of *address* does not contain " -"``%scope_id`` part anymore. In order to get full IPv6 address use :func:" -"`getnameinfo`." +"``%scope_id`` part anymore. In order to get full IPv6 address " +"use :func:`getnameinfo`." msgstr "" -#: ../../library/socket.rst:1685 +#: ../../library/socket.rst:1680 msgid "" "Receive normal data (up to *bufsize* bytes) and ancillary data from the " "socket. The *ancbufsize* argument sets the size in bytes of the internal " @@ -1925,7 +1926,7 @@ msgid "" "*flags* argument defaults to 0 and has the same meaning as for :meth:`recv`." msgstr "" -#: ../../library/socket.rst:1695 +#: ../../library/socket.rst:1690 msgid "" "The return value is a 4-tuple: ``(data, ancdata, msg_flags, address)``. The " "*data* item is a :class:`bytes` object holding the non-ancillary data " @@ -1940,38 +1941,39 @@ msgid "" "socket, if available; otherwise, its value is unspecified." msgstr "" -#: ../../library/socket.rst:1709 +#: ../../library/socket.rst:1704 msgid "" "On some systems, :meth:`sendmsg` and :meth:`recvmsg` can be used to pass " "file descriptors between processes over an :const:`AF_UNIX` socket. When " "this facility is used (it is often restricted to :const:`SOCK_STREAM` " "sockets), :meth:`recvmsg` will return, in its ancillary data, items of the " -"form ``(socket.SOL_SOCKET, socket.SCM_RIGHTS, fds)``, where *fds* is a :" -"class:`bytes` object representing the new file descriptors as a binary array " -"of the native C :c:expr:`int` type. If :meth:`recvmsg` raises an exception " -"after the system call returns, it will first attempt to close any file " -"descriptors received via this mechanism." +"form ``(socket.SOL_SOCKET, socket.SCM_RIGHTS, fds)``, where *fds* is " +"a :class:`bytes` object representing the new file descriptors as a binary " +"array of the native C :c:expr:`int` type. If :meth:`recvmsg` raises an " +"exception after the system call returns, it will first attempt to close any " +"file descriptors received via this mechanism." msgstr "" -#: ../../library/socket.rst:1720 +#: ../../library/socket.rst:1715 msgid "" "Some systems do not indicate the truncated length of ancillary data items " "which have been only partially received. If an item appears to extend " -"beyond the end of the buffer, :meth:`recvmsg` will issue a :exc:" -"`RuntimeWarning`, and will return the part of it which is inside the buffer " -"provided it has not been truncated before the start of its associated data." +"beyond the end of the buffer, :meth:`recvmsg` will issue " +"a :exc:`RuntimeWarning`, and will return the part of it which is inside the " +"buffer provided it has not been truncated before the start of its associated " +"data." msgstr "" -#: ../../library/socket.rst:1727 +#: ../../library/socket.rst:1722 msgid "" "On systems which support the :const:`SCM_RIGHTS` mechanism, the following " "function will receive up to *maxfds* file descriptors, returning the message " "data and a list containing the descriptors (while ignoring unexpected " -"conditions such as unrelated control messages being received). See also :" -"meth:`sendmsg`. ::" +"conditions such as unrelated control messages being received). See " +"also :meth:`sendmsg`. ::" msgstr "" -#: ../../library/socket.rst:1733 +#: ../../library/socket.rst:1728 msgid "" "import socket, array\n" "\n" @@ -1980,28 +1982,29 @@ msgid "" " msg, ancdata, flags, addr = sock.recvmsg(msglen, socket.CMSG_LEN(maxfds " "* fds.itemsize))\n" " for cmsg_level, cmsg_type, cmsg_data in ancdata:\n" -" if cmsg_level == socket.SOL_SOCKET and cmsg_type == socket." -"SCM_RIGHTS:\n" +" if cmsg_level == socket.SOL_SOCKET and cmsg_type == " +"socket.SCM_RIGHTS:\n" " # Append data, ignoring any truncated integers at the end.\n" -" fds.frombytes(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % fds." -"itemsize)])\n" +" fds.frombytes(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % " +"fds.itemsize)])\n" " return msg, list(fds)" msgstr "" -#: ../../library/socket.rst:1758 +#: ../../library/socket.rst:1753 msgid "" -"Receive normal data and ancillary data from the socket, behaving as :meth:" -"`recvmsg` would, but scatter the non-ancillary data into a series of buffers " -"instead of returning a new bytes object. The *buffers* argument must be an " -"iterable of objects that export writable buffers (e.g. :class:`bytearray` " -"objects); these will be filled with successive chunks of the non-ancillary " -"data until it has all been written or there are no more buffers. The " -"operating system may set a limit (:func:`~os.sysconf` value ``SC_IOV_MAX``) " -"on the number of buffers that can be used. The *ancbufsize* and *flags* " -"arguments have the same meaning as for :meth:`recvmsg`." +"Receive normal data and ancillary data from the socket, behaving " +"as :meth:`recvmsg` would, but scatter the non-ancillary data into a series " +"of buffers instead of returning a new bytes object. The *buffers* argument " +"must be an iterable of objects that export writable buffers " +"(e.g. :class:`bytearray` objects); these will be filled with successive " +"chunks of the non-ancillary data until it has all been written or there are " +"no more buffers. The operating system may set a limit (:func:`~os.sysconf` " +"value ``SC_IOV_MAX``) on the number of buffers that can be used. The " +"*ancbufsize* and *flags* arguments have the same meaning as " +"for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1769 +#: ../../library/socket.rst:1764 msgid "" "The return value is a 4-tuple: ``(nbytes, ancdata, msg_flags, address)``, " "where *nbytes* is the total number of bytes of non-ancillary data written " @@ -2009,11 +2012,11 @@ msgid "" "for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1774 +#: ../../library/socket.rst:1769 msgid "Example::" msgstr "範例: ::" -#: ../../library/socket.rst:1776 +#: ../../library/socket.rst:1771 msgid "" ">>> import socket\n" ">>> s1, s2 = socket.socketpair()\n" @@ -2039,7 +2042,7 @@ msgstr "" ">>> [b1, b2, b3]\n" "[bytearray(b'Mary'), bytearray(b'01 had a 9'), bytearray(b'little lamb---')]" -#: ../../library/socket.rst:1797 +#: ../../library/socket.rst:1792 msgid "" "Receive data from the socket, writing it into *buffer* instead of creating a " "new bytestring. The return value is a pair ``(nbytes, address)`` where " @@ -2049,7 +2052,7 @@ msgid "" "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1807 +#: ../../library/socket.rst:1802 msgid "" "Receive up to *nbytes* bytes from the socket, storing the data into a buffer " "rather than creating a new bytestring. If *nbytes* is not specified (or 0), " @@ -2058,7 +2061,7 @@ msgid "" "of the optional argument *flags*; it defaults to zero." msgstr "" -#: ../../library/socket.rst:1816 +#: ../../library/socket.rst:1811 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -2068,7 +2071,7 @@ msgid "" "data. For further information on this topic, consult the :ref:`socket-howto`." msgstr "" -#: ../../library/socket.rst:1831 +#: ../../library/socket.rst:1826 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -2078,13 +2081,13 @@ msgid "" "to determine how much data, if any, was successfully sent." msgstr "" -#: ../../library/socket.rst:1838 +#: ../../library/socket.rst:1833 msgid "" "The socket timeout is no longer reset each time data is sent successfully. " "The socket timeout is now the maximum total duration to send all data." msgstr "" -#: ../../library/socket.rst:1851 +#: ../../library/socket.rst:1846 msgid "" "Send data to the socket. The socket should not be connected to a remote " "socket, since the destination socket is specified by *address*. The " @@ -2093,7 +2096,7 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1857 +#: ../../library/socket.rst:1852 msgid "" "Raises an :ref:`auditing event ` ``socket.sendto`` with arguments " "``self``, ``address``." @@ -2101,13 +2104,13 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendto``。" -#: ../../library/socket.rst:1867 +#: ../../library/socket.rst:1862 msgid "" "Send normal and ancillary data to the socket, gathering the non-ancillary " "data from a series of buffers and concatenating it into a single message. " -"The *buffers* argument specifies the non-ancillary data as an iterable of :" -"term:`bytes-like objects ` (e.g. :class:`bytes` objects); " -"the operating system may set a limit (:func:`~os.sysconf` value " +"The *buffers* argument specifies the non-ancillary data as an iterable " +"of :term:`bytes-like objects ` (e.g. :class:`bytes` " +"objects); the operating system may set a limit (:func:`~os.sysconf` value " "``SC_IOV_MAX``) on the number of buffers that can be used. The *ancdata* " "argument specifies the ancillary data (control messages) as an iterable of " "zero or more tuples ``(cmsg_level, cmsg_type, cmsg_data)``, where " @@ -2121,28 +2124,28 @@ msgid "" "bytes of non-ancillary data sent." msgstr "" -#: ../../library/socket.rst:1887 +#: ../../library/socket.rst:1882 msgid "" -"The following function sends the list of file descriptors *fds* over an :" -"const:`AF_UNIX` socket, on systems which support the :const:`SCM_RIGHTS` " +"The following function sends the list of file descriptors *fds* over " +"an :const:`AF_UNIX` socket, on systems which support the :const:`SCM_RIGHTS` " "mechanism. See also :meth:`recvmsg`. ::" msgstr "" -#: ../../library/socket.rst:1891 +#: ../../library/socket.rst:1886 msgid "" "import socket, array\n" "\n" "def send_fds(sock, msg, fds):\n" -" return sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, array." -"array(\"i\", fds))])" +" return sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, " +"array.array(\"i\", fds))])" msgstr "" "import socket, array\n" "\n" "def send_fds(sock, msg, fds):\n" -" return sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, array." -"array(\"i\", fds))])" +" return sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, " +"array.array(\"i\", fds))])" -#: ../../library/socket.rst:1900 +#: ../../library/socket.rst:1895 msgid "" "Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments " "``self``, ``address``." @@ -2150,158 +2153,161 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendmsg``。" -#: ../../library/socket.rst:1911 +#: ../../library/socket.rst:1906 msgid "" "Specialized version of :meth:`~socket.sendmsg` for :const:`AF_ALG` socket. " "Set mode, IV, AEAD associated data length and flags for :const:`AF_ALG` " "socket." msgstr "" -#: ../../library/socket.rst:1920 +#: ../../library/socket.rst:1915 msgid "" -"Send a file until EOF is reached by using high-performance :mod:`os." -"sendfile` and return the total number of bytes which were sent. *file* must " -"be a regular file object opened in binary mode. If :mod:`os.sendfile` is not " -"available (e.g. Windows) or *file* is not a regular file :meth:`send` will " -"be used instead. *offset* tells from where to start reading the file. If " -"specified, *count* is the total number of bytes to transmit as opposed to " -"sending the file until EOF is reached. File position is updated on return or " -"also in case of error in which case :meth:`file.tell() ` can " -"be used to figure out the number of bytes which were sent. The socket must " -"be of :const:`SOCK_STREAM` type. Non-blocking sockets are not supported." +"Send a file until EOF is reached by using high-" +"performance :mod:`os.sendfile` and return the total number of bytes which " +"were sent. *file* must be a regular file object opened in binary mode. " +"If :mod:`os.sendfile` is not available (e.g. Windows) or *file* is not a " +"regular file :meth:`send` will be used instead. *offset* tells from where to " +"start reading the file. If specified, *count* is the total number of bytes " +"to transmit as opposed to sending the file until EOF is reached. File " +"position is updated on return or also in case of error in which " +"case :meth:`file.tell() ` can be used to figure out the " +"number of bytes which were sent. The socket must be of :const:`SOCK_STREAM` " +"type. Non-blocking sockets are not supported." msgstr "" -#: ../../library/socket.rst:1936 +#: ../../library/socket.rst:1931 msgid "" "Set the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle." msgstr "" -#: ../../library/socket.rst:1944 +#: ../../library/socket.rst:1939 msgid "" "Set blocking or non-blocking mode of the socket: if *flag* is false, the " "socket is set to non-blocking, else to blocking mode." msgstr "" -#: ../../library/socket.rst:1947 +#: ../../library/socket.rst:1942 msgid "" "This method is a shorthand for certain :meth:`~socket.settimeout` calls:" msgstr "" -#: ../../library/socket.rst:1949 +#: ../../library/socket.rst:1944 msgid "``sock.setblocking(True)`` is equivalent to ``sock.settimeout(None)``" msgstr "``sock.setblocking(True)`` 等價於 ``sock.settimeout(None)``" -#: ../../library/socket.rst:1951 +#: ../../library/socket.rst:1946 msgid "``sock.setblocking(False)`` is equivalent to ``sock.settimeout(0.0)``" msgstr "``sock.setblocking(False)`` 等價於 ``sock.settimeout(0.0)``" -#: ../../library/socket.rst:1953 +#: ../../library/socket.rst:1948 msgid "" -"The method no longer applies :const:`SOCK_NONBLOCK` flag on :attr:`socket." -"type`." +"The method no longer applies :const:`SOCK_NONBLOCK` flag " +"on :attr:`socket.type`." msgstr "" -#: ../../library/socket.rst:1960 +#: ../../library/socket.rst:1955 msgid "" "Set a timeout on blocking socket operations. The *value* argument can be a " "nonnegative floating-point number expressing seconds, or ``None``. If a non-" -"zero value is given, subsequent socket operations will raise a :exc:" -"`timeout` exception if the timeout period *value* has elapsed before the " -"operation has completed. If zero is given, the socket is put in non-" +"zero value is given, subsequent socket operations will raise " +"a :exc:`timeout` exception if the timeout period *value* has elapsed before " +"the operation has completed. If zero is given, the socket is put in non-" "blocking mode. If ``None`` is given, the socket is put in blocking mode." msgstr "" -#: ../../library/socket.rst:1967 +#: ../../library/socket.rst:1962 msgid "" "For further information, please consult the :ref:`notes on socket timeouts " "`." msgstr "" -#: ../../library/socket.rst:1969 +#: ../../library/socket.rst:1964 msgid "" -"The method no longer toggles :const:`SOCK_NONBLOCK` flag on :attr:`socket." -"type`." +"The method no longer toggles :const:`SOCK_NONBLOCK` flag " +"on :attr:`socket.type`." msgstr "" -#: ../../library/socket.rst:1982 +#: ../../library/socket.rst:1977 msgid "" -"Set the value of the given socket option (see the Unix manual page :manpage:" -"`setsockopt(2)`). The needed symbolic constants are defined in this module " -"(:ref:`!SO_\\* etc. `). The value can be an integer, " -"``None`` or a :term:`bytes-like object` representing a buffer. In the later " -"case it is up to the caller to ensure that the bytestring contains the " -"proper bits (see the optional built-in module :mod:`struct` for a way to " -"encode C structures as bytestrings). When *value* is set to ``None``, " -"*optlen* argument is required. It's equivalent to call :c:func:`setsockopt` " -"C function with ``optval=NULL`` and ``optlen=optlen``." +"Set the value of the given socket option (see the Unix manual " +"page :manpage:`setsockopt(2)`). The needed symbolic constants are defined " +"in this module (:ref:`!SO_\\* etc. `). The value can " +"be an integer, ``None`` or a :term:`bytes-like object` representing a " +"buffer. In the later case it is up to the caller to ensure that the " +"bytestring contains the proper bits (see the optional built-in " +"module :mod:`struct` for a way to encode C structures as bytestrings). When " +"*value* is set to ``None``, *optlen* argument is required. It's equivalent " +"to call :c:func:`setsockopt` C function with ``optval=NULL`` and " +"``optlen=optlen``." msgstr "" -#: ../../library/socket.rst:1995 +#: ../../library/socket.rst:1990 msgid "setsockopt(level, optname, None, optlen: int) form added." msgstr "" -#: ../../library/socket.rst:2003 +#: ../../library/socket.rst:1998 msgid "" -"Shut down one or both halves of the connection. If *how* is :const:" -"`SHUT_RD`, further receives are disallowed. If *how* is :const:`SHUT_WR`, " -"further sends are disallowed. If *how* is :const:`SHUT_RDWR`, further sends " -"and receives are disallowed." +"Shut down one or both halves of the connection. If *how* " +"is :const:`SHUT_RD`, further receives are disallowed. If *how* " +"is :const:`SHUT_WR`, further sends are disallowed. If *how* " +"is :const:`SHUT_RDWR`, further sends and receives are disallowed." msgstr "" -#: ../../library/socket.rst:2013 +#: ../../library/socket.rst:2008 msgid "" "Duplicate a socket and prepare it for sharing with a target process. The " "target process must be provided with *process_id*. The resulting bytes " "object can then be passed to the target process using some form of " -"interprocess communication and the socket can be recreated there using :func:" -"`fromshare`. Once this method has been called, it is safe to close the " -"socket since the operating system has already duplicated it for the target " -"process." +"interprocess communication and the socket can be recreated there " +"using :func:`fromshare`. Once this method has been called, it is safe to " +"close the socket since the operating system has already duplicated it for " +"the target process." msgstr "" -#: ../../library/socket.rst:2025 +#: ../../library/socket.rst:2020 msgid "" -"Note that there are no methods :meth:`read` or :meth:`write`; use :meth:" -"`~socket.recv` and :meth:`~socket.send` without *flags* argument instead." +"Note that there are no methods :meth:`read` or :meth:`write`; " +"use :meth:`~socket.recv` and :meth:`~socket.send` without *flags* argument " +"instead." msgstr "" -#: ../../library/socket.rst:2028 +#: ../../library/socket.rst:2023 msgid "" "Socket objects also have these (read-only) attributes that correspond to the " "values given to the :class:`~socket.socket` constructor." msgstr "" -#: ../../library/socket.rst:2034 +#: ../../library/socket.rst:2029 msgid "The socket family." msgstr "" -#: ../../library/socket.rst:2039 +#: ../../library/socket.rst:2034 msgid "The socket type." msgstr "" -#: ../../library/socket.rst:2044 +#: ../../library/socket.rst:2039 msgid "The socket protocol." msgstr "" -#: ../../library/socket.rst:2051 +#: ../../library/socket.rst:2046 msgid "Notes on socket timeouts" msgstr "" -#: ../../library/socket.rst:2053 +#: ../../library/socket.rst:2048 msgid "" "A socket object can be in one of three modes: blocking, non-blocking, or " "timeout. Sockets are by default always created in blocking mode, but this " "can be changed by calling :func:`setdefaulttimeout`." msgstr "" -#: ../../library/socket.rst:2057 +#: ../../library/socket.rst:2052 msgid "" "In *blocking mode*, operations block until complete or the system returns an " "error (such as connection timed out)." msgstr "" -#: ../../library/socket.rst:2060 +#: ../../library/socket.rst:2055 msgid "" "In *non-blocking mode*, operations fail (with an error that is unfortunately " "system-dependent) if they cannot be completed immediately: functions from " @@ -2309,14 +2315,14 @@ msgid "" "available for reading or writing." msgstr "" -#: ../../library/socket.rst:2065 +#: ../../library/socket.rst:2060 msgid "" "In *timeout mode*, operations fail if they cannot be completed within the " "timeout specified for the socket (they raise a :exc:`timeout` exception) or " "if the system returns an error." msgstr "" -#: ../../library/socket.rst:2070 +#: ../../library/socket.rst:2065 msgid "" "At the operating system level, sockets in *timeout mode* are internally set " "in non-blocking mode. Also, the blocking and timeout modes are shared " @@ -2325,38 +2331,38 @@ msgid "" "you decide to use the :meth:`~socket.fileno` of a socket." msgstr "" -#: ../../library/socket.rst:2077 +#: ../../library/socket.rst:2072 msgid "Timeouts and the ``connect`` method" msgstr "" -#: ../../library/socket.rst:2079 +#: ../../library/socket.rst:2074 msgid "" "The :meth:`~socket.connect` operation is also subject to the timeout " "setting, and in general it is recommended to call :meth:`~socket.settimeout` " -"before calling :meth:`~socket.connect` or pass a timeout parameter to :meth:" -"`create_connection`. However, the system network stack may also return a " -"connection timeout error of its own regardless of any Python socket timeout " -"setting." +"before calling :meth:`~socket.connect` or pass a timeout parameter " +"to :meth:`create_connection`. However, the system network stack may also " +"return a connection timeout error of its own regardless of any Python socket " +"timeout setting." msgstr "" -#: ../../library/socket.rst:2087 +#: ../../library/socket.rst:2082 msgid "Timeouts and the ``accept`` method" msgstr "" -#: ../../library/socket.rst:2089 +#: ../../library/socket.rst:2084 msgid "" -"If :func:`getdefaulttimeout` is not :const:`None`, sockets returned by the :" -"meth:`~socket.accept` method inherit that timeout. Otherwise, the behaviour " -"depends on settings of the listening socket:" +"If :func:`getdefaulttimeout` is not :const:`None`, sockets returned by " +"the :meth:`~socket.accept` method inherit that timeout. Otherwise, the " +"behaviour depends on settings of the listening socket:" msgstr "" -#: ../../library/socket.rst:2093 +#: ../../library/socket.rst:2088 msgid "" "if the listening socket is in *blocking mode* or in *timeout mode*, the " "socket returned by :meth:`~socket.accept` is in *blocking mode*;" msgstr "" -#: ../../library/socket.rst:2096 +#: ../../library/socket.rst:2091 msgid "" "if the listening socket is in *non-blocking mode*, whether the socket " "returned by :meth:`~socket.accept` is in blocking or non-blocking mode is " @@ -2364,28 +2370,29 @@ msgid "" "it is recommended you manually override this setting." msgstr "" -#: ../../library/socket.rst:2105 +#: ../../library/socket.rst:2100 msgid "Example" msgstr "範例" -#: ../../library/socket.rst:2107 +#: ../../library/socket.rst:2102 msgid "" "Here are four minimal example programs using the TCP/IP protocol: a server " "that echoes all data that it receives back (servicing only one client), and " -"a client using it. Note that a server must perform the sequence :func:" -"`~socket.socket`, :meth:`~socket.bind`, :meth:`~socket.listen`, :meth:" -"`~socket.accept` (possibly repeating the :meth:`~socket.accept` to service " -"more than one client), while a client only needs the sequence :func:`~socket." -"socket`, :meth:`~socket.connect`. Also note that the server does not :meth:" -"`~socket.sendall`/:meth:`~socket.recv` on the socket it is listening on but " -"on the new socket returned by :meth:`~socket.accept`." +"a client using it. Note that a server must perform the " +"sequence :func:`~socket.socket`, :meth:`~socket.bind`, :meth:`~socket.listen`, :meth:`~socket.accept` " +"(possibly repeating the :meth:`~socket.accept` to service more than one " +"client), while a client only needs the " +"sequence :func:`~socket.socket`, :meth:`~socket.connect`. Also note that " +"the server does not :meth:`~socket.sendall`/:meth:`~socket.recv` on the " +"socket it is listening on but on the new socket returned " +"by :meth:`~socket.accept`." msgstr "" -#: ../../library/socket.rst:2117 +#: ../../library/socket.rst:2112 msgid "The first two examples support IPv4 only. ::" msgstr "前兩個範例只支援 IPv4: ::" -#: ../../library/socket.rst:2119 +#: ../../library/socket.rst:2114 msgid "" "# Echo server program\n" "import socket\n" @@ -2404,7 +2411,7 @@ msgid "" " conn.sendall(data)" msgstr "" -#: ../../library/socket.rst:2137 +#: ../../library/socket.rst:2132 msgid "" "# Echo client program\n" "import socket\n" @@ -2418,7 +2425,7 @@ msgid "" "print('Received', repr(data))" msgstr "" -#: ../../library/socket.rst:2148 +#: ../../library/socket.rst:2143 msgid "" "The next two examples are identical to the above two, but support both IPv4 " "and IPv6. The server side will listen to the first address family available " @@ -2428,7 +2435,7 @@ msgid "" "resolution, and sends traffic to the first one connected successfully. ::" msgstr "" -#: ../../library/socket.rst:2155 +#: ../../library/socket.rst:2150 msgid "" "# Echo server program\n" "import socket\n" @@ -2465,7 +2472,7 @@ msgid "" " conn.send(data)" msgstr "" -#: ../../library/socket.rst:2191 +#: ../../library/socket.rst:2186 msgid "" "# Echo client program\n" "import socket\n" @@ -2474,8 +2481,8 @@ msgid "" "HOST = 'daring.cwi.nl' # The remote host\n" "PORT = 50007 # The same port as used by the server\n" "s = None\n" -"for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket." -"SOCK_STREAM):\n" +"for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, " +"socket.SOCK_STREAM):\n" " af, socktype, proto, canonname, sa = res\n" " try:\n" " s = socket.socket(af, socktype, proto)\n" @@ -2498,14 +2505,14 @@ msgid "" "print('Received', repr(data))" msgstr "" -#: ../../library/socket.rst:2220 +#: ../../library/socket.rst:2215 msgid "" "The next example shows how to write a very simple network sniffer with raw " "sockets on Windows. The example requires administrator privileges to modify " "the interface::" msgstr "" -#: ../../library/socket.rst:2224 +#: ../../library/socket.rst:2219 msgid "" "import socket\n" "\n" @@ -2529,29 +2536,29 @@ msgid "" "s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF)" msgstr "" -#: ../../library/socket.rst:2245 +#: ../../library/socket.rst:2240 msgid "" "The next example shows how to use the socket interface to communicate to a " "CAN network using the raw socket protocol. To use CAN with the broadcast " "manager protocol instead, open a socket with::" msgstr "" -#: ../../library/socket.rst:2249 +#: ../../library/socket.rst:2244 msgid "socket.socket(socket.AF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM)" msgstr "socket.socket(socket.AF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM)" -#: ../../library/socket.rst:2251 +#: ../../library/socket.rst:2246 msgid "" "After binding (:const:`CAN_RAW`) or connecting (:const:`CAN_BCM`) the " "socket, you can use the :meth:`socket.send` and :meth:`socket.recv` " "operations (and their counterparts) on the socket object as usual." msgstr "" -#: ../../library/socket.rst:2255 +#: ../../library/socket.rst:2250 msgid "This last example might require special privileges::" msgstr "" -#: ../../library/socket.rst:2257 +#: ../../library/socket.rst:2252 msgid "" "import socket\n" "import struct\n" @@ -2593,29 +2600,29 @@ msgid "" " print('Error sending CAN frame')" msgstr "" -#: ../../library/socket.rst:2295 +#: ../../library/socket.rst:2290 msgid "" "Running an example several times with too small delay between executions, " "could lead to this error::" msgstr "" -#: ../../library/socket.rst:2298 +#: ../../library/socket.rst:2293 msgid "OSError: [Errno 98] Address already in use" msgstr "OSError: [Errno 98] Address already in use" -#: ../../library/socket.rst:2300 +#: ../../library/socket.rst:2295 msgid "" "This is because the previous execution has left the socket in a " "``TIME_WAIT`` state, and can't be immediately reused." msgstr "" -#: ../../library/socket.rst:2303 +#: ../../library/socket.rst:2298 msgid "" -"There is a :mod:`socket` flag to set, in order to prevent this, :const:" -"`socket.SO_REUSEADDR`::" +"There is a :mod:`socket` flag to set, in order to prevent " +"this, :const:`socket.SO_REUSEADDR`::" msgstr "" -#: ../../library/socket.rst:2306 +#: ../../library/socket.rst:2301 msgid "" "s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" "s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n" @@ -2625,30 +2632,30 @@ msgstr "" "s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n" "s.bind((HOST, PORT))" -#: ../../library/socket.rst:2310 +#: ../../library/socket.rst:2305 msgid "" "the :data:`SO_REUSEADDR` flag tells the kernel to reuse a local socket in " "``TIME_WAIT`` state, without waiting for its natural timeout to expire." msgstr "" -#: ../../library/socket.rst:2316 +#: ../../library/socket.rst:2311 msgid "" "For an introduction to socket programming (in C), see the following papers:" msgstr "" -#: ../../library/socket.rst:2318 +#: ../../library/socket.rst:2313 msgid "" "*An Introductory 4.3BSD Interprocess Communication Tutorial*, by Stuart " "Sechrest" msgstr "" -#: ../../library/socket.rst:2320 +#: ../../library/socket.rst:2315 msgid "" "*An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. " "Leffler et al," msgstr "" -#: ../../library/socket.rst:2323 +#: ../../library/socket.rst:2318 msgid "" "both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections " "PS1:7 and PS1:8). The platform-specific reference material for the various " @@ -2675,10 +2682,10 @@ msgstr "I/O control(I/O 控制)" msgid "buffering" msgstr "buffering(緩衝)" -#: ../../library/socket.rst:1980 +#: ../../library/socket.rst:1975 msgid "module" msgstr "module(模組)" -#: ../../library/socket.rst:1980 +#: ../../library/socket.rst:1975 msgid "struct" msgstr "struct" diff --git a/library/socketserver.po b/library/socketserver.po index 4373fe8002..d87251dc5d 100644 --- a/library/socketserver.po +++ b/library/socketserver.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2025-02-07 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -90,9 +90,9 @@ msgid "" "classes, passing it the server's address and the request handler class. It " "is recommended to use the server in a :keyword:`with` statement. Then call " "the :meth:`~BaseServer.handle_request` or :meth:`~BaseServer.serve_forever` " -"method of the server object to process one or many requests. Finally, call :" -"meth:`~BaseServer.server_close` to close the socket (unless you used a :" -"keyword:`!with` statement)." +"method of the server object to process one or many requests. Finally, " +"call :meth:`~BaseServer.server_close` to close the socket (unless you used " +"a :keyword:`!with` statement)." msgstr "" #: ../../library/socketserver.rst:64 @@ -103,8 +103,8 @@ msgid "" "attribute *daemon_threads*, which indicates whether or not the server should " "wait for thread termination. You should set the flag explicitly if you " "would like threads to behave autonomously; the default is :const:`False`, " -"meaning that Python will not exit until all threads created by :class:" -"`ThreadingMixIn` have exited." +"meaning that Python will not exit until all threads created " +"by :class:`ThreadingMixIn` have exited." msgstr "" #: ../../library/socketserver.rst:73 @@ -177,9 +177,9 @@ msgstr "" #: ../../library/socketserver.rst:112 msgid "" -"The mix-in class comes first, since it overrides a method defined in :class:" -"`UDPServer`. Setting the various attributes also changes the behavior of " -"the underlying server mechanism." +"The mix-in class comes first, since it overrides a method defined " +"in :class:`UDPServer`. Setting the various attributes also changes the " +"behavior of the underlying server mechanism." msgstr "" #: ../../library/socketserver.rst:116 @@ -204,18 +204,18 @@ msgstr "" #: ../../library/socketserver.rst:131 msgid "" -"For :class:`ThreadingMixIn` use daemonic threads by setting :data:" -"`ThreadingMixIn.daemon_threads ` to ``True`` to not wait " -"until threads complete." +"For :class:`ThreadingMixIn` use daemonic threads by " +"setting :data:`ThreadingMixIn.daemon_threads ` to ``True`` " +"to not wait until threads complete." msgstr "" #: ../../library/socketserver.rst:137 msgid "" -":meth:`ForkingMixIn.server_close ` and :meth:" -"`ThreadingMixIn.server_close ` now waits until all " -"child processes and non-daemonic threads complete. Add a new :attr:" -"`ForkingMixIn.block_on_close ` class attribute to opt-in for " -"the pre-3.7 behaviour." +":meth:`ForkingMixIn.server_close ` " +"and :meth:`ThreadingMixIn.server_close ` now waits " +"until all child processes and non-daemonic threads complete. Add a " +"new :attr:`ForkingMixIn.block_on_close ` class attribute to " +"opt-in for the pre-3.7 behaviour." msgstr "" #: ../../library/socketserver.rst:153 @@ -230,13 +230,13 @@ msgstr "" #: ../../library/socketserver.rst:159 msgid "" -"To implement a service, you must derive a class from :class:" -"`BaseRequestHandler` and redefine its :meth:`~BaseRequestHandler.handle` " -"method. You can then run various versions of the service by combining one of " -"the server classes with your request handler class. The request handler " -"class must be different for datagram or stream services. This can be hidden " -"by using the handler subclasses :class:`StreamRequestHandler` or :class:" -"`DatagramRequestHandler`." +"To implement a service, you must derive a class " +"from :class:`BaseRequestHandler` and redefine " +"its :meth:`~BaseRequestHandler.handle` method. You can then run various " +"versions of the service by combining one of the server classes with your " +"request handler class. The request handler class must be different for " +"datagram or stream services. This can be hidden by using the handler " +"subclasses :class:`StreamRequestHandler` or :class:`DatagramRequestHandler`." msgstr "" #: ../../library/socketserver.rst:167 @@ -264,8 +264,8 @@ msgid "" "In some cases, it may be appropriate to process part of a request " "synchronously, but to finish processing in a forked child depending on the " "request data. This can be implemented by using a synchronous server and " -"doing an explicit fork in the request handler class :meth:" -"`~BaseRequestHandler.handle` method." +"doing an explicit fork in the request handler " +"class :meth:`~BaseRequestHandler.handle` method." msgstr "" #: ../../library/socketserver.rst:185 @@ -288,8 +288,8 @@ msgstr "" msgid "" "This is the superclass of all Server objects in the module. It defines the " "interface, given below, but does not implement most of the methods, which is " -"done in subclasses. The two parameters are stored in the respective :attr:" -"`server_address` and :attr:`RequestHandlerClass` attributes." +"done in subclasses. The two parameters are stored in the " +"respective :attr:`server_address` and :attr:`RequestHandlerClass` attributes." msgstr "" #: ../../library/socketserver.rst:210 @@ -302,12 +302,13 @@ msgstr "" #: ../../library/socketserver.rst:217 msgid "" "Process a single request. This function calls the following methods in " -"order: :meth:`get_request`, :meth:`verify_request`, and :meth:" -"`process_request`. If the user-provided :meth:`~BaseRequestHandler.handle` " -"method of the handler class raises an exception, the server's :meth:" -"`handle_error` method will be called. If no request is received within :" -"attr:`timeout` seconds, :meth:`handle_timeout` will be called and :meth:" -"`handle_request` will return." +"order: :meth:`get_request`, :meth:`verify_request`, " +"and :meth:`process_request`. If the user-" +"provided :meth:`~BaseRequestHandler.handle` method of the handler class " +"raises an exception, the server's :meth:`handle_error` method will be " +"called. If no request is received within :attr:`timeout` " +"seconds, :meth:`handle_timeout` will be called and :meth:`handle_request` " +"will return." msgstr "" #: ../../library/socketserver.rst:229 @@ -333,9 +334,9 @@ msgstr "" #: ../../library/socketserver.rst:251 msgid "" -"Tell the :meth:`serve_forever` loop to stop and wait until it does. :meth:" -"`shutdown` must be called while :meth:`serve_forever` is running in a " -"different thread otherwise it will deadlock." +"Tell the :meth:`serve_forever` loop to stop and wait until it " +"does. :meth:`shutdown` must be called while :meth:`serve_forever` is running " +"in a different thread otherwise it will deadlock." msgstr "" #: ../../library/socketserver.rst:258 @@ -357,9 +358,9 @@ msgstr "" #: ../../library/socketserver.rst:275 msgid "" "The address on which the server is listening. The format of addresses " -"varies depending on the protocol family; see the documentation for the :mod:" -"`socket` module for details. For internet protocols, this is a tuple " -"containing a string giving the address, and an integer port number: " +"varies depending on the protocol family; see the documentation for " +"the :mod:`socket` module for details. For internet protocols, this is a " +"tuple containing a string giving the address, and an integer port number: " "``('127.0.0.1', 80)``, for example." msgstr "" @@ -374,8 +375,8 @@ msgstr "" #: ../../library/socketserver.rst:293 msgid "" -"Whether the server will allow the reuse of an address. This defaults to :" -"const:`False`, and can be set in subclasses to change the policy." +"Whether the server will allow the reuse of an address. This defaults " +"to :const:`False`, and can be set in subclasses to change the policy." msgstr "" #: ../../library/socketserver.rst:299 @@ -389,8 +390,8 @@ msgstr "" #: ../../library/socketserver.rst:308 msgid "" -"The type of socket used by the server; :const:`socket.SOCK_STREAM` and :" -"const:`socket.SOCK_DGRAM` are two common values." +"The type of socket used by the server; :const:`socket.SOCK_STREAM` " +"and :const:`socket.SOCK_DGRAM` are two common values." msgstr "" #: ../../library/socketserver.rst:314 @@ -443,10 +444,10 @@ msgstr "" #: ../../library/socketserver.rst:362 msgid "" -"Calls :meth:`finish_request` to create an instance of the :attr:" -"`RequestHandlerClass`. If desired, this function can create a new process " -"or thread to handle the request; the :class:`ForkingMixIn` and :class:" -"`ThreadingMixIn` classes do this." +"Calls :meth:`finish_request` to create an instance of " +"the :attr:`RequestHandlerClass`. If desired, this function can create a new " +"process or thread to handle the request; the :class:`ForkingMixIn` " +"and :class:`ThreadingMixIn` classes do this." msgstr "" #: ../../library/socketserver.rst:374 @@ -499,8 +500,8 @@ msgid "" "This function must do all the work required to service a request. The " "default implementation does nothing. Several instance attributes are " "available to it; the request is available as :attr:`request`; the client " -"address as :attr:`client_address`; and the server instance as :attr:" -"`server`, in case it needs access to per-server information." +"address as :attr:`client_address`; and the server instance " +"as :attr:`server`, in case it needs access to per-server information." msgstr "" #: ../../library/socketserver.rst:424 @@ -533,21 +534,21 @@ msgstr "" #: ../../library/socketserver.rst:455 msgid "" -"These :class:`BaseRequestHandler` subclasses override the :meth:" -"`~BaseRequestHandler.setup` and :meth:`~BaseRequestHandler.finish` methods, " -"and provide :attr:`rfile` and :attr:`wfile` attributes." +"These :class:`BaseRequestHandler` subclasses override " +"the :meth:`~BaseRequestHandler.setup` and :meth:`~BaseRequestHandler.finish` " +"methods, and provide :attr:`rfile` and :attr:`wfile` attributes." msgstr "" #: ../../library/socketserver.rst:461 msgid "" -"A file object from which receives the request is read. Support the :class:" -"`io.BufferedIOBase` readable interface." +"A file object from which receives the request is read. Support " +"the :class:`io.BufferedIOBase` readable interface." msgstr "" #: ../../library/socketserver.rst:466 msgid "" -"A file object to which the reply is written. Support the :class:`io." -"BufferedIOBase` writable interface" +"A file object to which the reply is written. Support " +"the :class:`io.BufferedIOBase` writable interface" msgstr "" #: ../../library/socketserver.rst:470 @@ -564,7 +565,7 @@ msgstr "範例" msgid ":class:`socketserver.TCPServer` Example" msgstr ":class:`socketserver.TCPServer` 範例" -#: ../../library/socketserver.rst:481 ../../library/socketserver.rst:581 +#: ../../library/socketserver.rst:481 ../../library/socketserver.rst:592 msgid "This is the server side::" msgstr "" @@ -583,11 +584,17 @@ msgid "" "\n" " def handle(self):\n" " # self.request is the TCP socket connected to the client\n" -" self.data = self.request.recv(1024).strip()\n" -" print(\"Received from {}:\".format(self.client_address[0]))\n" -" print(self.data)\n" +" pieces = [b'']\n" +" total = 0\n" +" while b'\\n' not in pieces[-1] and total < 10_000:\n" +" pieces.append(self.request.recv(2000))\n" +" total += len(pieces[-1])\n" +" self.data = b''.join(pieces)\n" +" print(f\"Received from {self.client_address[0]}:\")\n" +" print(self.data.decode(\"utf-8\"))\n" " # just send back the same data, but upper-cased\n" " self.request.sendall(self.data.upper())\n" +" # after we return, the socket will be closed.\n" "\n" "if __name__ == \"__main__\":\n" " HOST, PORT = \"localhost\", 9999\n" @@ -599,42 +606,46 @@ msgid "" " server.serve_forever()" msgstr "" -#: ../../library/socketserver.rst:511 +#: ../../library/socketserver.rst:517 msgid "" "An alternative request handler class that makes use of streams (file-like " "objects that simplify communication by providing the standard file " "interface)::" msgstr "" -#: ../../library/socketserver.rst:514 +#: ../../library/socketserver.rst:520 msgid "" "class MyTCPHandler(socketserver.StreamRequestHandler):\n" "\n" " def handle(self):\n" -" # self.rfile is a file-like object created by the handler;\n" -" # we can now use e.g. readline() instead of raw recv() calls\n" -" self.data = self.rfile.readline().strip()\n" -" print(\"{} wrote:\".format(self.client_address[0]))\n" -" print(self.data)\n" +" # self.rfile is a file-like object created by the handler.\n" +" # We can now use e.g. readline() instead of raw recv() calls.\n" +" # We limit ourselves to 10000 bytes to avoid abuse by the sender.\n" +" self.data = self.rfile.readline(10000).rstrip()\n" +" print(f\"{self.client_address[0]} wrote:\")\n" +" print(self.data.decode(\"utf-8\"))\n" " # Likewise, self.wfile is a file-like object used to write back\n" " # to the client\n" " self.wfile.write(self.data.upper())" msgstr "" -#: ../../library/socketserver.rst:526 +#: ../../library/socketserver.rst:533 msgid "" "The difference is that the ``readline()`` call in the second handler will " "call ``recv()`` multiple times until it encounters a newline character, " -"while the single ``recv()`` call in the first handler will just return what " -"has been received so far from the client's ``sendall()`` call (typically all " -"of it, but this is not guaranteed by the TCP protocol)." +"while the the first handler had to use a ``recv()`` loop to accumulate data " +"until a newline itself. If it had just used a single ``recv()`` without the " +"loop it would just have returned what has been received so far from the " +"client. TCP is stream based: data arrives in the order it was sent, but " +"there no correlation between client ``send()`` or ``sendall()`` calls and " +"the number of ``recv()`` calls on the server required to receive it." msgstr "" -#: ../../library/socketserver.rst:533 ../../library/socketserver.rst:605 +#: ../../library/socketserver.rst:543 ../../library/socketserver.rst:616 msgid "This is the client side::" msgstr "" -#: ../../library/socketserver.rst:535 +#: ../../library/socketserver.rst:545 msgid "" "import socket\n" "import sys\n" @@ -646,24 +657,25 @@ msgid "" "with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:\n" " # Connect to server and send data\n" " sock.connect((HOST, PORT))\n" -" sock.sendall(bytes(data + \"\\n\", \"utf-8\"))\n" +" sock.sendall(bytes(data, \"utf-8\"))\n" +" sock.sendall(b\"\\n\")\n" "\n" " # Receive data from the server and shut down\n" " received = str(sock.recv(1024), \"utf-8\")\n" "\n" -"print(\"Sent: {}\".format(data))\n" -"print(\"Received: {}\".format(received))" +"print(\"Sent: \", data)\n" +"print(\"Received:\", received)" msgstr "" -#: ../../library/socketserver.rst:554 ../../library/socketserver.rst:680 +#: ../../library/socketserver.rst:565 ../../library/socketserver.rst:691 msgid "The output of the example should look something like this:" msgstr "" -#: ../../library/socketserver.rst:556 +#: ../../library/socketserver.rst:567 msgid "Server:" msgstr "" -#: ../../library/socketserver.rst:558 +#: ../../library/socketserver.rst:569 msgid "" "$ python TCPServer.py\n" "127.0.0.1 wrote:\n" @@ -677,11 +689,11 @@ msgstr "" "127.0.0.1 wrote:\n" "b'python is nice'" -#: ../../library/socketserver.rst:566 +#: ../../library/socketserver.rst:577 msgid "Client:" msgstr "" -#: ../../library/socketserver.rst:568 +#: ../../library/socketserver.rst:579 msgid "" "$ python TCPClient.py hello world with TCP\n" "Sent: hello world with TCP\n" @@ -697,11 +709,11 @@ msgstr "" "Sent: python is nice\n" "Received: PYTHON IS NICE" -#: ../../library/socketserver.rst:579 +#: ../../library/socketserver.rst:590 msgid ":class:`socketserver.UDPServer` Example" msgstr ":class:`socketserver.UDPServer` 範例" -#: ../../library/socketserver.rst:583 +#: ../../library/socketserver.rst:594 msgid "" "import socketserver\n" "\n" @@ -716,7 +728,7 @@ msgid "" " def handle(self):\n" " data = self.request[0].strip()\n" " socket = self.request[1]\n" -" print(\"{} wrote:\".format(self.client_address[0]))\n" +" print(f\"{self.client_address[0]} wrote:\")\n" " print(data)\n" " socket.sendto(data.upper(), self.client_address)\n" "\n" @@ -726,7 +738,7 @@ msgid "" " server.serve_forever()" msgstr "" -#: ../../library/socketserver.rst:607 +#: ../../library/socketserver.rst:618 msgid "" "import socket\n" "import sys\n" @@ -742,31 +754,31 @@ msgid "" "sock.sendto(bytes(data + \"\\n\", \"utf-8\"), (HOST, PORT))\n" "received = str(sock.recv(1024), \"utf-8\")\n" "\n" -"print(\"Sent: {}\".format(data))\n" -"print(\"Received: {}\".format(received))" +"print(\"Sent: \", data)\n" +"print(\"Received:\", received)" msgstr "" -#: ../../library/socketserver.rst:624 +#: ../../library/socketserver.rst:635 msgid "" "The output of the example should look exactly like for the TCP server " "example." msgstr "" -#: ../../library/socketserver.rst:628 +#: ../../library/socketserver.rst:639 msgid "Asynchronous Mixins" msgstr "" -#: ../../library/socketserver.rst:630 +#: ../../library/socketserver.rst:641 msgid "" -"To build asynchronous handlers, use the :class:`ThreadingMixIn` and :class:" -"`ForkingMixIn` classes." +"To build asynchronous handlers, use the :class:`ThreadingMixIn` " +"and :class:`ForkingMixIn` classes." msgstr "" -#: ../../library/socketserver.rst:633 +#: ../../library/socketserver.rst:644 msgid "An example for the :class:`ThreadingMixIn` class::" msgstr "" -#: ../../library/socketserver.rst:635 +#: ../../library/socketserver.rst:646 msgid "" "import socket\n" "import threading\n" @@ -780,8 +792,8 @@ msgid "" " response = bytes(\"{}: {}\".format(cur_thread.name, data), 'ascii')\n" " self.request.sendall(response)\n" "\n" -"class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver." -"TCPServer):\n" +"class ThreadedTCPServer(socketserver.ThreadingMixIn, " +"socketserver.TCPServer):\n" " pass\n" "\n" "def client(ip, port, message):\n" @@ -814,7 +826,7 @@ msgid "" " server.shutdown()" msgstr "" -#: ../../library/socketserver.rst:682 +#: ../../library/socketserver.rst:693 msgid "" "$ python ThreadedTCPServer.py\n" "Server loop running in thread: Thread-1\n" @@ -828,7 +840,7 @@ msgstr "" "Received: Thread-3: Hello World 2\n" "Received: Thread-4: Hello World 3" -#: ../../library/socketserver.rst:691 +#: ../../library/socketserver.rst:702 msgid "" "The :class:`ForkingMixIn` class is used in the same way, except that the " "server will spawn a new process for each request. Available only on POSIX " diff --git a/library/ssl.po b/library/ssl.po index 6fa89a6402..15a4f1f037 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-20 00:13+0000\n" +"POT-Creation-Date: 2025-02-05 00:13+0000\n" "PO-Revision-Date: 2024-08-28 00:43+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2707,8 +2707,8 @@ msgstr "" msgid "" "A :class:`TLSVersion` enum member representing the highest supported TLS " "version. The value defaults to :attr:`TLSVersion.MAXIMUM_SUPPORTED`. The " -"attribute is read-only for protocols other than :attr:`PROTOCOL_TLS`, :attr:" -"`PROTOCOL_TLS_CLIENT`, and :attr:`PROTOCOL_TLS_SERVER`." +"attribute is read-only for protocols other than :const:`PROTOCOL_TLS`, :" +"const:`PROTOCOL_TLS_CLIENT`, and :const:`PROTOCOL_TLS_SERVER`." msgstr "" #: ../../library/ssl.rst:1937 @@ -2729,7 +2729,7 @@ msgstr "" #: ../../library/ssl.rst:1957 msgid "" -"Control the number of TLS 1.3 session tickets of a :attr:" +"Control the number of TLS 1.3 session tickets of a :const:" "`PROTOCOL_TLS_SERVER` context. The setting has no impact on TLS 1.0 to 1.2 " "connections." msgstr "" diff --git a/library/string.po b/library/string.po index 5537df8ef6..ceb98aace6 100644 --- a/library/string.po +++ b/library/string.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-15 00:17+0000\n" +"POT-Creation-Date: 2025-01-16 00:13+0000\n" "PO-Revision-Date: 2024-03-10 15:57+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -44,9 +44,9 @@ msgstr "此模組中定義的常數為:" #: ../../library/string.rst:26 msgid "" -"The concatenation of the :const:`ascii_lowercase` and :const:" -"`ascii_uppercase` constants described below. This value is not locale-" -"dependent." +"The concatenation of the :const:`ascii_lowercase` " +"and :const:`ascii_uppercase` constants described below. This value is not " +"locale-dependent." msgstr "" "下文描述的 :const:`ascii_lowercase` 和 :const:`ascii_uppercase` 常數的串接," "該值不依賴於區域設定。" @@ -85,17 +85,26 @@ msgstr "" "在 ``C`` 語言中被視為標點符號的 ASCII 字元的字串:``!\"#$%&'()*+,-./:;<=>?" "@[\\]^_`{|}~``。" -#: ../../library/string.rst:64 +#: ../../library/string.rst:65 msgid "" -"String of ASCII characters which are considered printable. This is a " -"combination of :const:`digits`, :const:`ascii_letters`, :const:" -"`punctuation`, and :const:`whitespace`." +"String of ASCII characters which are considered printable by Python. This is " +"a combination " +"of :const:`digits`, :const:`ascii_letters`, :const:`punctuation`, " +"and :const:`whitespace`." msgstr "" -"ASCII 字元的字串是可被列印輸出的。 這是 :const:`digits`、:const:" -"`ascii_letters`、:const:`punctuation` 和 :const:`whitespace` 的組合。" +"ASCII 字元的字串被 Python 是為可被列印輸出的。這" +"是 :const:`digits`、:const:`ascii_letters`、:const:`punctuation` " +"和 :const:`whitespace` 的組合。" #: ../../library/string.rst:71 msgid "" +"By design, :meth:`string.printable.isprintable() ` " +"returns :const:`False`. In particular, ``string.printable`` is not printable " +"in the POSIX sense (see :manpage:`LC_CTYPE `)." +msgstr "" + +#: ../../library/string.rst:78 +msgid "" "A string containing all ASCII characters that are considered whitespace. " "This includes the characters space, tab, linefeed, return, formfeed, and " "vertical tab." @@ -104,11 +113,11 @@ msgstr "" "符號 (tab)、換行符號 (linefeed)、return、換頁符號 (formfeed) 和垂直製表符號 " "(vertical tab) 這些字元。" -#: ../../library/string.rst:79 +#: ../../library/string.rst:86 msgid "Custom String Formatting" msgstr "自訂字串格式" -#: ../../library/string.rst:81 +#: ../../library/string.rst:88 msgid "" "The built-in string class provides the ability to do complex variable " "substitutions and value formatting via the :meth:`~str.format` method " @@ -122,42 +131,43 @@ msgstr "" "模組可讓你使用與內建 :meth:`~str.format` 方法相同的實作來建立和自訂你自己的字" "串格式化行為。" -#: ../../library/string.rst:90 +#: ../../library/string.rst:97 msgid "The :class:`Formatter` class has the following public methods:" msgstr ":class:`Formatter` 類別有以下的公開方法:" -#: ../../library/string.rst:94 +#: ../../library/string.rst:101 msgid "" "The primary API method. It takes a format string and an arbitrary set of " -"positional and keyword arguments. It is just a wrapper that calls :meth:" -"`vformat`." +"positional and keyword arguments. It is just a wrapper that " +"calls :meth:`vformat`." msgstr "" -"主要的 API 方法。它接收一個格式字串及一組任意的位置引數與關鍵字引數,是呼叫 :" -"meth:`vformat` 的包裝器 (wrapper)。" +"主要的 API 方法。它接收一個格式字串及一組任意的位置引數與關鍵字引數,是呼" +"叫 :meth:`vformat` 的包裝器 (wrapper)。" -#: ../../library/string.rst:98 +#: ../../library/string.rst:105 msgid "" "A format string argument is now :ref:`positional-only `." msgstr "現在格式字串引數是\\ :ref:`僅限位置參數 `。" -#: ../../library/string.rst:104 +#: ../../library/string.rst:111 msgid "" "This function does the actual work of formatting. It is exposed as a " "separate function for cases where you want to pass in a predefined " "dictionary of arguments, rather than unpacking and repacking the dictionary " -"as individual arguments using the ``*args`` and ``**kwargs`` syntax. :meth:" -"`vformat` does the work of breaking up the format string into character data " -"and replacement fields. It calls the various methods described below." +"as individual arguments using the ``*args`` and ``**kwargs`` " +"syntax. :meth:`vformat` does the work of breaking up the format string into " +"character data and replacement fields. It calls the various methods " +"described below." msgstr "" -#: ../../library/string.rst:112 +#: ../../library/string.rst:119 msgid "" "In addition, the :class:`Formatter` defines a number of methods that are " "intended to be replaced by subclasses:" msgstr "" -#: ../../library/string.rst:117 +#: ../../library/string.rst:124 msgid "" "Loop over the format_string and return an iterable of tuples " "(*literal_text*, *field_name*, *format_spec*, *conversion*). This is used " @@ -168,7 +178,7 @@ msgstr "" "*field_name*, *format_spec*, *conversion*)。這會被 :meth:`vformat` 用於將字串" "裁切為字面文本或替換欄位。" -#: ../../library/string.rst:122 +#: ../../library/string.rst:129 msgid "" "The values in the tuple conceptually represent a span of literal text " "followed by a single replacement field. If there is no literal text (which " @@ -178,17 +188,17 @@ msgid "" "be ``None``." msgstr "" -#: ../../library/string.rst:131 +#: ../../library/string.rst:138 msgid "" "Given *field_name* as returned by :meth:`parse` (see above), convert it to " "an object to be formatted. Returns a tuple (obj, used_key). The default " -"version takes strings of the form defined in :pep:`3101`, such as " -"\"0[name]\" or \"label.title\". *args* and *kwargs* are as passed in to :" -"meth:`vformat`. The return value *used_key* has the same meaning as the " +"version takes strings of the form defined in :pep:`3101`, such as \"0[name]" +"\" or \"label.title\". *args* and *kwargs* are as passed in " +"to :meth:`vformat`. The return value *used_key* has the same meaning as the " "*key* parameter to :meth:`get_value`." msgstr "" -#: ../../library/string.rst:140 +#: ../../library/string.rst:147 msgid "" "Retrieve a given field value. The *key* argument will be either an integer " "or a string. If it is an integer, it represents the index of the positional " @@ -196,62 +206,63 @@ msgid "" "in *kwargs*." msgstr "" -#: ../../library/string.rst:145 +#: ../../library/string.rst:152 msgid "" -"The *args* parameter is set to the list of positional arguments to :meth:" -"`vformat`, and the *kwargs* parameter is set to the dictionary of keyword " -"arguments." +"The *args* parameter is set to the list of positional arguments " +"to :meth:`vformat`, and the *kwargs* parameter is set to the dictionary of " +"keyword arguments." msgstr "" -#: ../../library/string.rst:149 +#: ../../library/string.rst:156 msgid "" "For compound field names, these functions are only called for the first " "component of the field name; subsequent components are handled through " "normal attribute and indexing operations." msgstr "" -#: ../../library/string.rst:153 +#: ../../library/string.rst:160 msgid "" "So for example, the field expression '0.name' would cause :meth:`get_value` " "to be called with a *key* argument of 0. The ``name`` attribute will be " -"looked up after :meth:`get_value` returns by calling the built-in :func:" -"`getattr` function." +"looked up after :meth:`get_value` returns by calling the built-" +"in :func:`getattr` function." msgstr "" -#: ../../library/string.rst:158 +#: ../../library/string.rst:165 msgid "" -"If the index or keyword refers to an item that does not exist, then an :exc:" -"`IndexError` or :exc:`KeyError` should be raised." +"If the index or keyword refers to an item that does not exist, then " +"an :exc:`IndexError` or :exc:`KeyError` should be raised." msgstr "" -#: ../../library/string.rst:163 +#: ../../library/string.rst:170 msgid "" "Implement checking for unused arguments if desired. The arguments to this " "function is the set of all argument keys that were actually referred to in " "the format string (integers for positional arguments, and strings for named " "arguments), and a reference to the *args* and *kwargs* that was passed to " -"vformat. The set of unused args can be calculated from these parameters. :" -"meth:`check_unused_args` is assumed to raise an exception if the check fails." +"vformat. The set of unused args can be calculated from these " +"parameters. :meth:`check_unused_args` is assumed to raise an exception if " +"the check fails." msgstr "" -#: ../../library/string.rst:173 +#: ../../library/string.rst:180 msgid "" ":meth:`format_field` simply calls the global :func:`format` built-in. The " "method is provided so that subclasses can override it." msgstr "" -#: ../../library/string.rst:178 +#: ../../library/string.rst:185 msgid "" "Converts the value (returned by :meth:`get_field`) given a conversion type " "(as in the tuple returned by the :meth:`parse` method). The default version " "understands 's' (str), 'r' (repr) and 'a' (ascii) conversion types." msgstr "" -#: ../../library/string.rst:187 +#: ../../library/string.rst:194 msgid "Format String Syntax" msgstr "格式化文字語法" -#: ../../library/string.rst:189 +#: ../../library/string.rst:196 msgid "" "The :meth:`str.format` method and the :class:`Formatter` class share the " "same syntax for format strings (although in the case of :class:`Formatter`, " @@ -261,7 +272,7 @@ msgid "" "expressions." msgstr "" -#: ../../library/string.rst:202 +#: ../../library/string.rst:209 msgid "" "Format strings contain \"replacement fields\" surrounded by curly braces ``{}" "``. Anything that is not contained in braces is considered literal text, " @@ -270,11 +281,11 @@ msgid "" "``." msgstr "" -#: ../../library/string.rst:207 +#: ../../library/string.rst:214 msgid "The grammar for a replacement field is as follows:" msgstr "" -#: ../../library/string.rst:219 +#: ../../library/string.rst:226 msgid "" "In less formal terms, the replacement field can start with a *field_name* " "that specifies the object whose value is to be formatted and inserted into " @@ -284,11 +295,11 @@ msgid "" "specify a non-default format for the replacement value." msgstr "" -#: ../../library/string.rst:226 +#: ../../library/string.rst:233 msgid "See also the :ref:`formatspec` section." msgstr "另請參閱 :ref:`formatspec` 部份。" -#: ../../library/string.rst:228 +#: ../../library/string.rst:235 msgid "" "The *field_name* itself begins with an *arg_name* that is either a number or " "a keyword. If it's a number, it refers to a positional argument, and if " @@ -300,27 +311,27 @@ msgid "" "not quote-delimited, it is not possible to specify arbitrary dictionary keys " "(e.g., the strings ``'10'`` or ``':-]'``) within a format string. The " "*arg_name* can be followed by any number of index or attribute expressions. " -"An expression of the form ``'.name'`` selects the named attribute using :" -"func:`getattr`, while an expression of the form ``'[index]'`` does an index " -"lookup using :meth:`~object.__getitem__`." +"An expression of the form ``'.name'`` selects the named attribute " +"using :func:`getattr`, while an expression of the form ``'[index]'`` does an " +"index lookup using :meth:`~object.__getitem__`." msgstr "" -#: ../../library/string.rst:242 +#: ../../library/string.rst:249 msgid "" "The positional argument specifiers can be omitted for :meth:`str.format`, so " "``'{} {}'.format(a, b)`` is equivalent to ``'{0} {1}'.format(a, b)``." msgstr "" -#: ../../library/string.rst:246 +#: ../../library/string.rst:253 msgid "" "The positional argument specifiers can be omitted for :class:`Formatter`." msgstr "" -#: ../../library/string.rst:249 +#: ../../library/string.rst:256 msgid "Some simple format string examples::" msgstr "" -#: ../../library/string.rst:251 +#: ../../library/string.rst:258 msgid "" "\"First, thou shalt count to {0}\" # References first positional argument\n" "\"Bring me a {}\" # Implicitly references the first " @@ -333,37 +344,37 @@ msgid "" "'players'." msgstr "" -#: ../../library/string.rst:258 +#: ../../library/string.rst:265 msgid "" "The *conversion* field causes a type coercion before formatting. Normally, " "the job of formatting a value is done by the :meth:`~object.__format__` " "method of the value itself. However, in some cases it is desirable to force " "a type to be formatted as a string, overriding its own definition of " -"formatting. By converting the value to a string before calling :meth:" -"`~object.__format__`, the normal formatting logic is bypassed." +"formatting. By converting the value to a string before " +"calling :meth:`~object.__format__`, the normal formatting logic is bypassed." msgstr "" -#: ../../library/string.rst:265 +#: ../../library/string.rst:272 msgid "" -"Three conversion flags are currently supported: ``'!s'`` which calls :func:" -"`str` on the value, ``'!r'`` which calls :func:`repr` and ``'!a'`` which " -"calls :func:`ascii`." +"Three conversion flags are currently supported: ``'!s'`` which " +"calls :func:`str` on the value, ``'!r'`` which calls :func:`repr` and ``'!" +"a'`` which calls :func:`ascii`." msgstr "" "目前支援三種轉換旗標:``'!s'`` 會對該值呼叫 :func:`str`,``'!r'`` 會對該值呼" "叫 :func:`repr`,而 ``'!a'`` 則會對該值呼叫 :func:`ascii`。" -#: ../../library/string.rst:269 +#: ../../library/string.rst:276 msgid "Some examples::" msgstr "一些範例: ::" -#: ../../library/string.rst:271 +#: ../../library/string.rst:278 msgid "" "\"Harold's a clever {0!s}\" # Calls str() on the argument first\n" "\"Bring out the holy {name!r}\" # Calls repr() on the argument first\n" "\"More {!a}\" # Calls ascii() on the argument first" msgstr "" -#: ../../library/string.rst:275 +#: ../../library/string.rst:282 msgid "" "The *format_spec* field contains a specification of how the value should be " "presented, including such details as field width, alignment, padding, " @@ -374,13 +385,13 @@ msgstr "" "數精度等細節資訊。每種值類型都可以定義自己的「格式化迷你語言 (formatting " "mini-language)」或對 *format_spec* 的解釋。" -#: ../../library/string.rst:280 +#: ../../library/string.rst:287 msgid "" "Most built-in types support a common formatting mini-language, which is " "described in the next section." msgstr "大多數內建型別都支援常見的格式化迷你語言,下一節將會詳細說明。" -#: ../../library/string.rst:283 +#: ../../library/string.rst:290 msgid "" "A *format_spec* field can also include nested replacement fields within it. " "These nested replacement fields may contain a field name, conversion flag " @@ -394,28 +405,28 @@ msgstr "" "format_spec 内部的替換欄位會在 *format_spec* 字串被直譯前被替換。這讓數值的格" "式能夠被動態地指定。" -#: ../../library/string.rst:290 +#: ../../library/string.rst:297 msgid "See the :ref:`formatexamples` section for some examples." msgstr "範例請見 :ref:`formatexamples`。" -#: ../../library/string.rst:296 +#: ../../library/string.rst:303 msgid "Format Specification Mini-Language" msgstr "格式規格 (Format Specification) 迷你語言" -#: ../../library/string.rst:298 +#: ../../library/string.rst:305 msgid "" "\"Format specifications\" are used within replacement fields contained " -"within a format string to define how individual values are presented (see :" -"ref:`formatstrings` and :ref:`f-strings`). They can also be passed directly " -"to the built-in :func:`format` function. Each formattable type may define " -"how the format specification is to be interpreted." +"within a format string to define how individual values are presented " +"(see :ref:`formatstrings` and :ref:`f-strings`). They can also be passed " +"directly to the built-in :func:`format` function. Each formattable type may " +"define how the format specification is to be interpreted." msgstr "" "「格式規格」在格式字串 (format string) 中包含的替換欄位中使用,以定義各個值如" "何被呈現(請參考 :ref:`formatstrings` 和 :ref:`f-strings`\\ )。它們也能夠直" "接傳遞給內建的 :func:`format` 函式。每個可格式化型別 (formattable type) 可以" "定義格式規格如何被直譯。" -#: ../../library/string.rst:305 +#: ../../library/string.rst:312 msgid "" "Most built-in types implement the following options for format " "specifications, although some of the formatting options are only supported " @@ -423,7 +434,7 @@ msgid "" msgstr "" "大部分內建型別為了格式規格實作了下列選項,不過有些選項只被數值型別支援。" -#: ../../library/string.rst:308 +#: ../../library/string.rst:315 msgid "" "A general convention is that an empty format specification produces the same " "result as if you had called :func:`str` on the value. A non-empty format " @@ -432,11 +443,11 @@ msgstr "" "一般來說,輸入空格式規格會產生和對值呼叫 :func:`str` 函式相同的結果,非空的格" "式規格才會修改結果。" -#: ../../library/string.rst:312 +#: ../../library/string.rst:319 msgid "The general form of a *standard format specifier* is:" msgstr "*標準格式說明符號 (standard format specifier)* 的一般型式如下:" -#: ../../library/string.rst:324 +#: ../../library/string.rst:331 msgid "" "If a valid *align* value is specified, it can be preceded by a *fill* " "character that can be any character and defaults to a space if omitted. It " @@ -447,67 +458,67 @@ msgid "" "the :func:`format` function." msgstr "" "如果給定了一個有效的 *align* 值,則可以在它之前加一個 *fill* 字元,且該字元可" -"為任意字元,若不加的話預設為空格。使用\\ :ref:`格式字串 `\\ 或 :" -"meth:`str.format` 時是無法在其中使用大括號(\"``{``\" 或 \"``}``\")作為 " -"*fill* 字元的,但仍可透過巢狀替換欄位的方式插入大括號。此限制不影響 :func:" -"`format` 函式。" +"為任意字元,若不加的話預設為空格。使用\\ :ref:`格式字串 `\\ " +"或 :meth:`str.format` 時是無法在其中使用大括號(\"``{``\" 或 \"``}``\")作為 " +"*fill* 字元的,但仍可透過巢狀替換欄位的方式插入大括號。此限制不影" +"響 :func:`format` 函式。" -#: ../../library/string.rst:333 +#: ../../library/string.rst:340 msgid "The meaning of the various alignment options is as follows:" msgstr "" -#: ../../library/string.rst:342 ../../library/string.rst:374 +#: ../../library/string.rst:349 ../../library/string.rst:381 msgid "Option" msgstr "選項" -#: ../../library/string.rst:342 ../../library/string.rst:374 -#: ../../library/string.rst:459 ../../library/string.rst:470 -#: ../../library/string.rst:505 +#: ../../library/string.rst:349 ../../library/string.rst:381 +#: ../../library/string.rst:466 ../../library/string.rst:477 +#: ../../library/string.rst:512 msgid "Meaning" msgstr "含義" -#: ../../library/string.rst:344 +#: ../../library/string.rst:351 msgid "``'<'``" msgstr "``'<'``" -#: ../../library/string.rst:344 +#: ../../library/string.rst:351 msgid "" "Forces the field to be left-aligned within the available space (this is the " "default for most objects)." msgstr "強制欄位在可用空間內靠左對齊(這是大多數物件的預設值)。" -#: ../../library/string.rst:347 +#: ../../library/string.rst:354 msgid "``'>'``" msgstr "``'>'``" -#: ../../library/string.rst:347 +#: ../../library/string.rst:354 msgid "" "Forces the field to be right-aligned within the available space (this is the " "default for numbers)." msgstr "強制欄位在可用空間內靠右對齊(這是數字的預設值)。" -#: ../../library/string.rst:350 +#: ../../library/string.rst:357 msgid "``'='``" msgstr "``'='``" -#: ../../library/string.rst:350 +#: ../../library/string.rst:357 msgid "" "Forces the padding to be placed after the sign (if any) but before the " "digits. This is used for printing fields in the form '+000000120'. This " -"alignment option is only valid for numeric types, excluding :class:" -"`complex`. It becomes the default for numbers when '0' immediately precedes " -"the field width." +"alignment option is only valid for numeric types, " +"excluding :class:`complex`. It becomes the default for numbers when '0' " +"immediately precedes the field width." msgstr "" -#: ../../library/string.rst:357 +#: ../../library/string.rst:364 msgid "``'^'``" msgstr "``'^'``" -#: ../../library/string.rst:357 +#: ../../library/string.rst:364 msgid "Forces the field to be centered within the available space." msgstr "強制欄位在可用空間內置中。" -#: ../../library/string.rst:361 +#: ../../library/string.rst:368 msgid "" "Note that unless a minimum field width is defined, the field width will " "always be the same size as the data to fill it, so that the alignment option " @@ -516,54 +527,54 @@ msgstr "" "請注意,除非有定義了最小欄位寬度,否則欄位寬度將始終與填充它的資料大小相同," "故在該情況下的對齊選項是沒有意義的。" -#: ../../library/string.rst:365 +#: ../../library/string.rst:372 msgid "" "The *sign* option is only valid for number types, and can be one of the " "following:" msgstr "*sign* 選項只適用於數字型別,並可為以下之一:" -#: ../../library/string.rst:376 +#: ../../library/string.rst:383 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/string.rst:376 +#: ../../library/string.rst:383 msgid "" "indicates that a sign should be used for both positive as well as negative " "numbers." msgstr "表示正數與負數均需使用符號。" -#: ../../library/string.rst:379 +#: ../../library/string.rst:386 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/string.rst:379 +#: ../../library/string.rst:386 msgid "" "indicates that a sign should be used only for negative numbers (this is the " "default behavior)." msgstr "" -#: ../../library/string.rst:368 ../../library/string.rst:382 +#: ../../library/string.rst:375 ../../library/string.rst:389 msgid "space" msgstr "空格" -#: ../../library/string.rst:382 +#: ../../library/string.rst:389 msgid "" "indicates that a leading space should be used on positive numbers, and a " "minus sign on negative numbers." msgstr "表示正數應使用前導空格,負數應使用減號。" -#: ../../library/string.rst:389 +#: ../../library/string.rst:396 msgid "" "The ``'z'`` option coerces negative zero floating-point values to positive " "zero after rounding to the format precision. This option is only valid for " "floating-point presentation types." msgstr "" -#: ../../library/string.rst:393 +#: ../../library/string.rst:400 msgid "Added the ``'z'`` option (see also :pep:`682`)." msgstr "新增 ``'z'`` 選項(請見 :pep:`682`\\ )。" -#: ../../library/string.rst:398 +#: ../../library/string.rst:405 msgid "" "The ``'#'`` option causes the \"alternate form\" to be used for the " "conversion. The alternate form is defined differently for different types. " @@ -577,7 +588,7 @@ msgid "" "and ``'G'`` conversions, trailing zeros are not removed from the result." msgstr "" -#: ../../library/string.rst:412 +#: ../../library/string.rst:419 msgid "" "The ``','`` option signals the use of a comma for a thousands separator for " "floating-point presentation types and for integer presentation type ``'d'``. " @@ -585,11 +596,11 @@ msgid "" "separator, use the ``'n'`` integer presentation type instead." msgstr "" -#: ../../library/string.rst:418 +#: ../../library/string.rst:425 msgid "Added the ``','`` option (see also :pep:`378`)." msgstr "新增 ``','`` 選項(請見 :pep:`378`\\ )。" -#: ../../library/string.rst:423 +#: ../../library/string.rst:430 msgid "" "The ``'_'`` option signals the use of an underscore for a thousands " "separator for floating-point presentation types and for integer presentation " @@ -601,11 +612,11 @@ msgstr "" "號。對於整數表示型別 ``'b'``,``'o'``,``'x'`` 和 ``'X'``,每 4 位數字會插入" "底線。對於其他表示型別,指定此選項會出錯。" -#: ../../library/string.rst:430 +#: ../../library/string.rst:437 msgid "Added the ``'_'`` option (see also :pep:`515`)." msgstr "新增 ``'_'`` 選項(請見 :pep:`515`\\ )。" -#: ../../library/string.rst:433 +#: ../../library/string.rst:440 msgid "" "*width* is a decimal integer defining the minimum total field width, " "including any prefixes, separators, and other formatting characters. If not " @@ -614,24 +625,24 @@ msgstr "" "*width* 是一個十進位整數,定義了最小總欄位寬度,包括任何前綴、分隔符號和其他" "格式字元。如果未指定,則欄位寬度將由內容決定。" -#: ../../library/string.rst:437 +#: ../../library/string.rst:444 msgid "" "When no explicit alignment is given, preceding the *width* field by a zero " "(``'0'``) character enables sign-aware zero-padding for numeric types, " "excluding :class:`complex`. This is equivalent to a *fill* character of " "``'0'`` with an *alignment* type of ``'='``." msgstr "" -"當未給予明確的對齊指示,在 *width* 欄位前面填入零 (``'0'``) 字元將會為 :" -"class:`complex` 以外的數值型別啟用有符號察覺的零填充 (sign-aware zero-" +"當未給予明確的對齊指示,在 *width* 欄位前面填入零 (``'0'``) 字元將會" +"為 :class:`complex` 以外的數值型別啟用有符號察覺的零填充 (sign-aware zero-" "padding)。這相當於使用 ``'0'`` 為 *fill* 字元且對齊類型為 ``'='``。" -#: ../../library/string.rst:442 +#: ../../library/string.rst:449 msgid "" "Preceding the *width* field by ``'0'`` no longer affects the default " "alignment for strings." msgstr "在 *width* 欄位前面加上 ``'0'`` 不再影響字串的預設對齊方式。" -#: ../../library/string.rst:446 +#: ../../library/string.rst:453 msgid "" "The *precision* is a decimal integer indicating how many digits should be " "displayed after the decimal point for presentation types ``'f'`` and " @@ -646,89 +657,89 @@ msgstr "" "示類型,該欄位指定最大欄位大小 - 換言之,將使用欄位中的多少字元。整數表示類型" "不允許使用 *precision*。" -#: ../../library/string.rst:454 +#: ../../library/string.rst:461 msgid "Finally, the *type* determines how the data should be presented." msgstr "最終,型別決定了資料將會如何呈現" -#: ../../library/string.rst:456 +#: ../../library/string.rst:463 msgid "The available string presentation types are:" msgstr "可用的字串表示型別有:" -#: ../../library/string.rst:459 ../../library/string.rst:470 -#: ../../library/string.rst:505 +#: ../../library/string.rst:466 ../../library/string.rst:477 +#: ../../library/string.rst:512 msgid "Type" msgstr "型別" -#: ../../library/string.rst:461 +#: ../../library/string.rst:468 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/string.rst:461 +#: ../../library/string.rst:468 msgid "String format. This is the default type for strings and may be omitted." msgstr "" -#: ../../library/string.rst:464 ../../library/string.rst:493 -#: ../../library/string.rst:578 +#: ../../library/string.rst:471 ../../library/string.rst:500 +#: ../../library/string.rst:585 msgid "None" msgstr "None" -#: ../../library/string.rst:464 +#: ../../library/string.rst:471 msgid "The same as ``'s'``." msgstr "與 ``'s'`` 相同。" -#: ../../library/string.rst:467 +#: ../../library/string.rst:474 msgid "The available integer presentation types are:" msgstr "" -#: ../../library/string.rst:472 +#: ../../library/string.rst:479 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/string.rst:472 +#: ../../library/string.rst:479 msgid "Binary format. Outputs the number in base 2." msgstr "" -#: ../../library/string.rst:474 +#: ../../library/string.rst:481 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/string.rst:474 +#: ../../library/string.rst:481 msgid "" "Character. Converts the integer to the corresponding unicode character " "before printing." msgstr "" -#: ../../library/string.rst:477 +#: ../../library/string.rst:484 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/string.rst:477 +#: ../../library/string.rst:484 msgid "Decimal Integer. Outputs the number in base 10." msgstr "" -#: ../../library/string.rst:479 +#: ../../library/string.rst:486 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/string.rst:479 +#: ../../library/string.rst:486 msgid "Octal format. Outputs the number in base 8." msgstr "" -#: ../../library/string.rst:481 +#: ../../library/string.rst:488 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/string.rst:481 +#: ../../library/string.rst:488 msgid "" "Hex format. Outputs the number in base 16, using lower-case letters for the " "digits above 9." msgstr "十六進位格式。輸出以 16 為基數的數字,9 以上的數字使用小寫字母。" -#: ../../library/string.rst:484 +#: ../../library/string.rst:491 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/string.rst:484 +#: ../../library/string.rst:491 msgid "" "Hex format. Outputs the number in base 16, using upper-case letters for the " "digits above 9. In case ``'#'`` is specified, the prefix ``'0x'`` will be " @@ -737,21 +748,21 @@ msgstr "" "十六進位格式。輸出以 16 為基數的數字,9 以上的數字使用大寫字母。如果指定了 " "``'#'``,則前綴 ``'0x'`` 也會被轉成大寫的 ``'0X'``。" -#: ../../library/string.rst:489 ../../library/string.rst:571 +#: ../../library/string.rst:496 ../../library/string.rst:578 msgid "``'n'``" msgstr "``'n'``" -#: ../../library/string.rst:489 +#: ../../library/string.rst:496 msgid "" "Number. This is the same as ``'d'``, except that it uses the current locale " "setting to insert the appropriate number separator characters." msgstr "" -#: ../../library/string.rst:493 +#: ../../library/string.rst:500 msgid "The same as ``'d'``." msgstr "與 ``'d'`` 相同。" -#: ../../library/string.rst:496 +#: ../../library/string.rst:503 msgid "" "In addition to the above presentation types, integers can be formatted with " "the floating-point presentation types listed below (except ``'n'`` and " @@ -759,43 +770,43 @@ msgid "" "floating-point number before formatting." msgstr "" -#: ../../library/string.rst:501 +#: ../../library/string.rst:508 msgid "" -"The available presentation types for :class:`float` and :class:`~decimal." -"Decimal` values are:" +"The available presentation types for :class:`float` " +"and :class:`~decimal.Decimal` values are:" msgstr "" -#: ../../library/string.rst:507 +#: ../../library/string.rst:514 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/string.rst:507 +#: ../../library/string.rst:514 msgid "" "Scientific notation. For a given precision ``p``, formats the number in " "scientific notation with the letter 'e' separating the coefficient from the " "exponent. The coefficient has one digit before and ``p`` digits after the " "decimal point, for a total of ``p + 1`` significant digits. With no " "precision given, uses a precision of ``6`` digits after the decimal point " -"for :class:`float`, and shows all coefficient digits for :class:`~decimal." -"Decimal`. If ``p=0``, the decimal point is omitted unless the ``#`` option " -"is used." +"for :class:`float`, and shows all coefficient digits " +"for :class:`~decimal.Decimal`. If ``p=0``, the decimal point is omitted " +"unless the ``#`` option is used." msgstr "" -#: ../../library/string.rst:518 +#: ../../library/string.rst:525 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/string.rst:518 +#: ../../library/string.rst:525 msgid "" "Scientific notation. Same as ``'e'`` except it uses an upper case 'E' as the " "separator character." msgstr "" -#: ../../library/string.rst:521 +#: ../../library/string.rst:528 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/string.rst:521 +#: ../../library/string.rst:528 msgid "" "Fixed-point notation. For a given precision ``p``, formats the number as a " "decimal number with exactly ``p`` digits following the decimal point. With " @@ -805,21 +816,21 @@ msgid "" "point is omitted unless the ``#`` option is used." msgstr "" -#: ../../library/string.rst:530 +#: ../../library/string.rst:537 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/string.rst:530 +#: ../../library/string.rst:537 msgid "" "Fixed-point notation. Same as ``'f'``, but converts ``nan`` to ``NAN`` and " "``inf`` to ``INF``." msgstr "" -#: ../../library/string.rst:533 +#: ../../library/string.rst:540 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/string.rst:533 +#: ../../library/string.rst:540 msgid "" "General format. For a given precision ``p >= 1``, this rounds the number to " "``p`` significant digits and then formats the result in either fixed-point " @@ -827,7 +838,7 @@ msgid "" "``0`` is treated as equivalent to a precision of ``1``." msgstr "" -#: ../../library/string.rst:540 +#: ../../library/string.rst:547 msgid "" "The precise rules are as follows: suppose that the result formatted with " "presentation type ``'e'`` and precision ``p-1`` would have exponent " @@ -840,50 +851,50 @@ msgid "" "unless the ``'#'`` option is used." msgstr "" -#: ../../library/string.rst:553 +#: ../../library/string.rst:560 msgid "" -"With no precision given, uses a precision of ``6`` significant digits for :" -"class:`float`. For :class:`~decimal.Decimal`, the coefficient of the result " -"is formed from the coefficient digits of the value; scientific notation is " -"used for values smaller than ``1e-6`` in absolute value and values where the " -"place value of the least significant digit is larger than 1, and fixed-point " -"notation is used otherwise." +"With no precision given, uses a precision of ``6`` significant digits " +"for :class:`float`. For :class:`~decimal.Decimal`, the coefficient of the " +"result is formed from the coefficient digits of the value; scientific " +"notation is used for values smaller than ``1e-6`` in absolute value and " +"values where the place value of the least significant digit is larger than " +"1, and fixed-point notation is used otherwise." msgstr "" -#: ../../library/string.rst:562 +#: ../../library/string.rst:569 msgid "" "Positive and negative infinity, positive and negative zero, and nans, are " "formatted as ``inf``, ``-inf``, ``0``, ``-0`` and ``nan`` respectively, " "regardless of the precision." msgstr "" -#: ../../library/string.rst:567 +#: ../../library/string.rst:574 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/string.rst:567 +#: ../../library/string.rst:574 msgid "" "General format. Same as ``'g'`` except switches to ``'E'`` if the number " "gets too large. The representations of infinity and NaN are uppercased, too." msgstr "" -#: ../../library/string.rst:571 +#: ../../library/string.rst:578 msgid "" "Number. This is the same as ``'g'``, except that it uses the current locale " "setting to insert the appropriate number separator characters." msgstr "" -#: ../../library/string.rst:575 +#: ../../library/string.rst:582 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/string.rst:575 +#: ../../library/string.rst:582 msgid "" "Percentage. Multiplies the number by 100 and displays in fixed (``'f'``) " "format, followed by a percent sign." msgstr "" -#: ../../library/string.rst:578 +#: ../../library/string.rst:585 msgid "" "For :class:`float` this is like the ``'g'`` type, except that when fixed-" "point notation is used to format the result, it always includes at least one " @@ -892,20 +903,20 @@ msgid "" "as large as needed to represent the given value faithfully." msgstr "" -#: ../../library/string.rst:586 +#: ../../library/string.rst:593 msgid "" "For :class:`~decimal.Decimal`, this is the same as either ``'g'`` or ``'G'`` " "depending on the value of ``context.capitals`` for the current decimal " "context." msgstr "" -#: ../../library/string.rst:590 +#: ../../library/string.rst:597 msgid "" "The overall effect is to match the output of :func:`str` as altered by the " "other format modifiers." msgstr "" -#: ../../library/string.rst:594 +#: ../../library/string.rst:601 msgid "" "The result should be correctly rounded to a given precision ``p`` of digits " "after the decimal point. The rounding mode for :class:`float` matches that " @@ -913,7 +924,7 @@ msgid "" "mode of the current :ref:`context ` will be used." msgstr "" -#: ../../library/string.rst:599 +#: ../../library/string.rst:606 msgid "" "The available presentation types for :class:`complex` are the same as those " "for :class:`float` (``'%'`` is not allowed). Both the real and imaginary " @@ -925,17 +936,17 @@ msgid "" "surrounded by parentheses), possibly altered by other format modifiers." msgstr "" -#: ../../library/string.rst:612 +#: ../../library/string.rst:619 msgid "Format examples" msgstr "格式範例" -#: ../../library/string.rst:614 +#: ../../library/string.rst:621 msgid "" "This section contains examples of the :meth:`str.format` syntax and " "comparison with the old ``%``-formatting." msgstr "本節包含 :meth:`str.format` 語法以及與舊式 ``%`` 格式的比較。" -#: ../../library/string.rst:617 +#: ../../library/string.rst:624 msgid "" "In most of the cases the syntax is similar to the old ``%``-formatting, with " "the addition of the ``{}`` and with ``:`` used instead of ``%``. For " @@ -944,17 +955,17 @@ msgstr "" "此語法在大多情況下與舊式的 ``%`` 格式類似,只是增加了 ``{}`` 和 ``:`` 來取代 " "``%``。例如,``'%03.2f'`` 可以改寫為 ``'{:03.2f}'``。" -#: ../../library/string.rst:621 +#: ../../library/string.rst:628 msgid "" "The new format syntax also supports new and different options, shown in the " "following examples." msgstr "新的語法還支援新的選項,將在以下的範例中說明。" -#: ../../library/string.rst:624 +#: ../../library/string.rst:631 msgid "Accessing arguments by position::" msgstr "按位置存取引數: ::" -#: ../../library/string.rst:626 +#: ../../library/string.rst:633 msgid "" ">>> '{0}, {1}, {2}'.format('a', 'b', 'c')\n" "'a, b, c'\n" @@ -979,11 +990,11 @@ msgstr "" ">>> '{0}{1}{0}'.format('abra', 'cad') # 引數索引可以重複\n" "'abracadabra'" -#: ../../library/string.rst:637 +#: ../../library/string.rst:644 msgid "Accessing arguments by name::" msgstr "按名稱存取引數: ::" -#: ../../library/string.rst:639 +#: ../../library/string.rst:646 msgid "" ">>> 'Coordinates: {latitude}, {longitude}'.format(latitude='37.24N', " "longitude='-115.81W')\n" @@ -993,11 +1004,11 @@ msgid "" "'Coordinates: 37.24N, -115.81W'" msgstr "" -#: ../../library/string.rst:645 +#: ../../library/string.rst:652 msgid "Accessing arguments' attributes::" msgstr "存取引數的屬性: ::" -#: ../../library/string.rst:647 +#: ../../library/string.rst:654 msgid "" ">>> c = 3-5j\n" ">>> ('The complex number {0} is formed from the real part {0.real} '\n" @@ -1014,11 +1025,11 @@ msgid "" "'Point(4, 2)'" msgstr "" -#: ../../library/string.rst:660 +#: ../../library/string.rst:667 msgid "Accessing arguments' items::" msgstr "存取引數的內容: ::" -#: ../../library/string.rst:662 +#: ../../library/string.rst:669 msgid "" ">>> coord = (3, 5)\n" ">>> 'X: {0[0]}; Y: {0[1]}'.format(coord)\n" @@ -1028,11 +1039,11 @@ msgstr "" ">>> 'X: {0[0]}; Y: {0[1]}'.format(coord)\n" "'X: 3; Y: 5'" -#: ../../library/string.rst:666 +#: ../../library/string.rst:673 msgid "Replacing ``%s`` and ``%r``::" msgstr "替換 ``%s`` 和 ``%r``: ::" -#: ../../library/string.rst:668 +#: ../../library/string.rst:675 msgid "" ">>> \"repr() shows quotes: {!r}; str() doesn't: {!s}\".format('test1', " "'test2')\n" @@ -1042,11 +1053,11 @@ msgstr "" "'test2')\n" "\"repr() shows quotes: 'test1'; str() doesn't: test2\"" -#: ../../library/string.rst:671 +#: ../../library/string.rst:678 msgid "Aligning the text and specifying a width::" msgstr "對齊文字以及指定寬度: ::" -#: ../../library/string.rst:673 +#: ../../library/string.rst:680 msgid "" ">>> '{:<30}'.format('left aligned')\n" "'left aligned '\n" @@ -1058,18 +1069,18 @@ msgid "" "'***********centered***********'" msgstr "" -#: ../../library/string.rst:682 +#: ../../library/string.rst:689 msgid "Replacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign::" msgstr "替換 ``%+f``、``%-f`` 和 ``% f`` 以及指定正負號: ::" -#: ../../library/string.rst:684 +#: ../../library/string.rst:691 msgid "" ">>> '{:+f}; {:+f}'.format(3.14, -3.14) # show it always\n" "'+3.140000; -3.140000'\n" ">>> '{: f}; {: f}'.format(3.14, -3.14) # show a space for positive numbers\n" "' 3.140000; -3.140000'\n" -">>> '{:-f}; {:-f}'.format(3.14, -3.14) # show only the minus -- same as '{:" -"f}; {:f}'\n" +">>> '{:-f}; {:-f}'.format(3.14, -3.14) # show only the minus -- same as " +"'{:f}; {:f}'\n" "'3.140000; -3.140000'" msgstr "" ">>> '{:+f}; {:+f}'.format(3.14, -3.14) # 總會顯示\n" @@ -1080,12 +1091,12 @@ msgstr "" "同\n" "'3.140000; -3.140000'" -#: ../../library/string.rst:691 +#: ../../library/string.rst:698 msgid "" "Replacing ``%x`` and ``%o`` and converting the value to different bases::" msgstr "替換 ``%x`` 和 ``%o`` 並將其值轉換為不同的進位制: ::" -#: ../../library/string.rst:693 +#: ../../library/string.rst:700 msgid "" ">>> # format also supports binary numbers\n" ">>> \"int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}\".format(42)\n" @@ -1095,11 +1106,11 @@ msgid "" "'int: 42; hex: 0x2a; oct: 0o52; bin: 0b101010'" msgstr "" -#: ../../library/string.rst:700 +#: ../../library/string.rst:707 msgid "Using the comma as a thousands separator::" msgstr "使用逗號作為千位分隔符: ::" -#: ../../library/string.rst:702 +#: ../../library/string.rst:709 msgid "" ">>> '{:,}'.format(1234567890)\n" "'1,234,567,890'" @@ -1107,11 +1118,11 @@ msgstr "" ">>> '{:,}'.format(1234567890)\n" "'1,234,567,890'" -#: ../../library/string.rst:705 +#: ../../library/string.rst:712 msgid "Expressing a percentage::" msgstr "表示為百分比: ::" -#: ../../library/string.rst:707 +#: ../../library/string.rst:714 msgid "" ">>> points = 19\n" ">>> total = 22\n" @@ -1123,11 +1134,11 @@ msgstr "" ">>> 'Correct answers: {:.2%}'.format(points/total)\n" "'Correct answers: 86.36%'" -#: ../../library/string.rst:712 +#: ../../library/string.rst:719 msgid "Using type-specific formatting::" msgstr "作為特定型別格式: ::" -#: ../../library/string.rst:714 +#: ../../library/string.rst:721 msgid "" ">>> import datetime\n" ">>> d = datetime.datetime(2010, 7, 4, 12, 15, 58)\n" @@ -1139,11 +1150,11 @@ msgstr "" ">>> '{:%Y-%m-%d %H:%M:%S}'.format(d)\n" "'2010-07-04 12:15:58'" -#: ../../library/string.rst:719 +#: ../../library/string.rst:726 msgid "Nesting arguments and more complex examples::" msgstr "巢狀引數及更多複雜範例: ::" -#: ../../library/string.rst:721 +#: ../../library/string.rst:728 msgid "" ">>> for align, text in zip('<^>', ['left', 'center', 'right']):\n" "... '{0:{fill}{align}16}'.format(text, fill=align, align=align)\n" @@ -1201,35 +1212,36 @@ msgstr "" " 10 A 12 1010\n" " 11 B 13 1011" -#: ../../library/string.rst:753 +#: ../../library/string.rst:760 msgid "Template strings" msgstr "模板字串" -#: ../../library/string.rst:755 +#: ../../library/string.rst:762 msgid "" -"Template strings provide simpler string substitutions as described in :pep:" -"`292`. A primary use case for template strings is for internationalization " -"(i18n) since in that context, the simpler syntax and functionality makes it " -"easier to translate than other built-in string formatting facilities in " -"Python. As an example of a library built on template strings for i18n, see " -"the `flufl.i18n `_ package." +"Template strings provide simpler string substitutions as described " +"in :pep:`292`. A primary use case for template strings is for " +"internationalization (i18n) since in that context, the simpler syntax and " +"functionality makes it easier to translate than other built-in string " +"formatting facilities in Python. As an example of a library built on " +"template strings for i18n, see the `flufl.i18n `_ package." msgstr "" "模板字串提供如 :pep:`292` 所述更簡單的字串替換。模板字串的主要用例是國際化 " "(i18n),因為在這種情況下,更簡單的語法和功能使得它比其他 Python 內建字串格式" "化工具更容易翻譯。基於模板字串建構的 i18n 函式庫範例,請參閱 `flufl.i18n " "`_ 套件。" -#: ../../library/string.rst:765 +#: ../../library/string.rst:772 msgid "" "Template strings support ``$``-based substitutions, using the following " "rules:" msgstr "" -#: ../../library/string.rst:767 +#: ../../library/string.rst:774 msgid "``$$`` is an escape; it is replaced with a single ``$``." msgstr "" -#: ../../library/string.rst:769 +#: ../../library/string.rst:776 msgid "" "``$identifier`` names a substitution placeholder matching a mapping key of " "``\"identifier\"``. By default, ``\"identifier\"`` is restricted to any " @@ -1239,30 +1251,30 @@ msgid "" "specification." msgstr "" -#: ../../library/string.rst:776 +#: ../../library/string.rst:783 msgid "" "``${identifier}`` is equivalent to ``$identifier``. It is required when " "valid identifier characters follow the placeholder but are not part of the " "placeholder, such as ``\"${noun}ification\"``." msgstr "" -#: ../../library/string.rst:780 +#: ../../library/string.rst:787 msgid "" -"Any other appearance of ``$`` in the string will result in a :exc:" -"`ValueError` being raised." +"Any other appearance of ``$`` in the string will result in " +"a :exc:`ValueError` being raised." msgstr "" -#: ../../library/string.rst:783 +#: ../../library/string.rst:790 msgid "" "The :mod:`string` module provides a :class:`Template` class that implements " "these rules. The methods of :class:`Template` are:" msgstr "" -#: ../../library/string.rst:789 +#: ../../library/string.rst:796 msgid "The constructor takes a single argument which is the template string." msgstr "" -#: ../../library/string.rst:794 +#: ../../library/string.rst:801 msgid "" "Performs the template substitution, returning a new string. *mapping* is " "any dictionary-like object with keys that match the placeholders in the " @@ -1274,7 +1286,7 @@ msgstr "" "的字典型物件。或者如果關鍵字就是佔位符號時,你也可以改提供關鍵字引數。當 " "*mapping* 跟 *kwds* 同時給定並存在重複時,*kwds* 的佔位符號會被優先使用。" -#: ../../library/string.rst:803 +#: ../../library/string.rst:810 msgid "" "Like :meth:`substitute`, except that if placeholders are missing from " "*mapping* and *kwds*, instead of raising a :exc:`KeyError` exception, the " @@ -1287,7 +1299,7 @@ msgstr "" "與 :meth:`substitute` 不同的是,任何包含 ``$`` 的字句會直接回傳 ``$`` 而非引" "發 :exc:`ValueError`。" -#: ../../library/string.rst:809 +#: ../../library/string.rst:816 msgid "" "While other exceptions may still occur, this method is called \"safe\" " "because it always tries to return a usable string instead of raising an " @@ -1301,26 +1313,26 @@ msgstr "" "完全安全,因為它會默默忽略格式錯誤的模板,這些模板包含了多餘的左右定界符、不" "匹配的括號,或者不是有效的 Python 識別字的佔位符號。" -#: ../../library/string.rst:819 +#: ../../library/string.rst:826 msgid "" -"Returns false if the template has invalid placeholders that will cause :meth:" -"`substitute` to raise :exc:`ValueError`." +"Returns false if the template has invalid placeholders that will " +"cause :meth:`substitute` to raise :exc:`ValueError`." msgstr "" "如果模板有將導致 :meth:`substitute` 引發 :exc:`ValueError` 的無效佔位符號,就" "會回傳 false。" -#: ../../library/string.rst:827 +#: ../../library/string.rst:834 msgid "" "Returns a list of the valid identifiers in the template, in the order they " "first appear, ignoring any invalid identifiers." msgstr "" "回傳模板中有效識別字的串列,按照它們首次出現的順序,並忽略任何無效的識別字。" -#: ../../library/string.rst:832 +#: ../../library/string.rst:839 msgid ":class:`Template` instances also provide one public data attribute:" msgstr ":class:`Template` 實例也提供一個公開的資料屬性:" -#: ../../library/string.rst:836 +#: ../../library/string.rst:843 msgid "" "This is the object passed to the constructor's *template* argument. In " "general, you shouldn't change it, but read-only access is not enforced." @@ -1328,11 +1340,11 @@ msgstr "" "這是傳遞給建構函式 *template* 引數的物件。一般來說,你不應該改變它,但並沒有" "強制設定成唯讀。" -#: ../../library/string.rst:839 +#: ../../library/string.rst:846 msgid "Here is an example of how to use a Template::" msgstr "以下是如何使用 Template 的一個範例: ::" -#: ../../library/string.rst:841 +#: ../../library/string.rst:848 msgid "" ">>> from string import Template\n" ">>> s = Template('$who likes $what')\n" @@ -1366,7 +1378,7 @@ msgstr "" ">>> Template('$who likes $what').safe_substitute(d)\n" "'tim likes $what'" -#: ../../library/string.rst:857 +#: ../../library/string.rst:864 msgid "" "Advanced usage: you can derive subclasses of :class:`Template` to customize " "the placeholder syntax, delimiter character, or the entire regular " @@ -1376,21 +1388,21 @@ msgstr "" "進階用法:你可以衍生 :class:`Template` 類別來自定義佔位符號語法、左右定界符字" "元,或者用於剖析模板字串的正規表示式。你可以透過覆寫這些類別屬性來達成:" -#: ../../library/string.rst:862 +#: ../../library/string.rst:869 msgid "" "*delimiter* -- This is the literal string describing a placeholder " "introducing delimiter. The default value is ``$``. Note that this should " -"*not* be a regular expression, as the implementation will call :meth:`re." -"escape` on this string as needed. Note further that you cannot change the " -"delimiter after class creation (i.e. a different delimiter must be set in " -"the subclass's class namespace)." +"*not* be a regular expression, as the implementation will " +"call :meth:`re.escape` on this string as needed. Note further that you " +"cannot change the delimiter after class creation (i.e. a different delimiter " +"must be set in the subclass's class namespace)." msgstr "" "*delimiter* -- 這是描述引入左右定界符的文字字串。預設值是 ``$``。請注意這\\ *" "不是*\\ 正規表示式,因為實作會在需要時對這個字串呼叫 :meth:`re.escape`。也請" "注意你不能在建立類別後修改左右定界符。(意即在子類別的命名空間中必須設置不同" "的左右定界符)" -#: ../../library/string.rst:869 +#: ../../library/string.rst:876 msgid "" "*idpattern* -- This is the regular expression describing the pattern for non-" "braced placeholders. The default value is the regular expression ``(?a:[_a-" @@ -1398,19 +1410,19 @@ msgid "" "pattern will also apply to braced placeholders." msgstr "" -#: ../../library/string.rst:876 +#: ../../library/string.rst:883 msgid "" "Since default *flags* is ``re.IGNORECASE``, pattern ``[a-z]`` can match with " "some non-ASCII characters. That's why we use the local ``a`` flag here." msgstr "" -#: ../../library/string.rst:880 +#: ../../library/string.rst:887 msgid "" "*braceidpattern* can be used to define separate patterns used inside and " "outside the braces." msgstr "" -#: ../../library/string.rst:884 +#: ../../library/string.rst:891 msgid "" "*braceidpattern* -- This is like *idpattern* but describes the pattern for " "braced placeholders. Defaults to ``None`` which means to fall back to " @@ -1419,7 +1431,7 @@ msgid "" "unbraced placeholders." msgstr "" -#: ../../library/string.rst:892 +#: ../../library/string.rst:899 msgid "" "*flags* -- The regular expression flags that will be applied when compiling " "the regular expression used for recognizing substitutions. The default " @@ -1428,7 +1440,7 @@ msgid "" "regular expressions." msgstr "" -#: ../../library/string.rst:900 +#: ../../library/string.rst:907 msgid "" "Alternatively, you can provide the entire regular expression pattern by " "overriding the class attribute *pattern*. If you do this, the value must be " @@ -1437,13 +1449,13 @@ msgid "" "placeholder rule:" msgstr "" -#: ../../library/string.rst:906 +#: ../../library/string.rst:913 msgid "" "*escaped* -- This group matches the escape sequence, e.g. ``$$``, in the " "default pattern." msgstr "*escaped* -- 此群組與跳脫序列匹配,例如在預設模式下為 ``$$``。" -#: ../../library/string.rst:909 +#: ../../library/string.rst:916 msgid "" "*named* -- This group matches the unbraced placeholder name; it should not " "include the delimiter in capturing group." @@ -1451,7 +1463,7 @@ msgstr "" "*named* -- 此群組與不帶大括號的佔位符號名稱匹配;它不應包含擷取群組中的左右定" "界符號。" -#: ../../library/string.rst:912 +#: ../../library/string.rst:919 msgid "" "*braced* -- This group matches the brace enclosed placeholder name; it " "should not include either the delimiter or braces in the capturing group." @@ -1459,7 +1471,7 @@ msgstr "" "*braced* -- 此群組與大括號括起來的佔位符號名稱匹配;它不應在擷取群組中包含左" "右定界符或大括號。" -#: ../../library/string.rst:915 +#: ../../library/string.rst:922 msgid "" "*invalid* -- This group matches any other delimiter pattern (usually a " "single delimiter), and it should appear last in the regular expression." @@ -1467,103 +1479,103 @@ msgstr "" "*invalid* -- 此群組與任何其他左右定界符模式(通常是單一左右定界符)匹配,且它" "應該出現在正規表示式的最後。" -#: ../../library/string.rst:918 +#: ../../library/string.rst:925 msgid "" "The methods on this class will raise :exc:`ValueError` if the pattern " "matches the template without one of these named groups matching." msgstr "" -"當此模式有匹配於模板但這些命名組中卻有任一個不匹配,此類別的方法將引發 :exc:" -"`ValueError`。" +"當此模式有匹配於模板但這些命名組中卻有任一個不匹配,此類別的方法將引" +"發 :exc:`ValueError`。" -#: ../../library/string.rst:923 +#: ../../library/string.rst:930 msgid "Helper functions" msgstr "輔助函式" -#: ../../library/string.rst:927 +#: ../../library/string.rst:934 msgid "" "Split the argument into words using :meth:`str.split`, capitalize each word " -"using :meth:`str.capitalize`, and join the capitalized words using :meth:" -"`str.join`. If the optional second argument *sep* is absent or ``None``, " -"runs of whitespace characters are replaced by a single space and leading and " -"trailing whitespace are removed, otherwise *sep* is used to split and join " -"the words." +"using :meth:`str.capitalize`, and join the capitalized words " +"using :meth:`str.join`. If the optional second argument *sep* is absent or " +"``None``, runs of whitespace characters are replaced by a single space and " +"leading and trailing whitespace are removed, otherwise *sep* is used to " +"split and join the words." msgstr "" "使用 :meth:`str.split` 將引數分割為字詞,使用 :meth:`str.capitalize` 將每個單" "字大寫,並使用 :meth:`str.join` 將大寫字詞連接起來。如果可選的第二引數 *sep* " "不存在或為 ``None``,則連續的空白字元將替換為單一空格,並且刪除前導和尾隨空" "白;在其他情況下則使用 *sep* 來分割和連接單字。" -#: ../../library/string.rst:195 +#: ../../library/string.rst:202 msgid "{} (curly brackets)" msgstr "{} (花括號)" -#: ../../library/string.rst:195 ../../library/string.rst:335 -#: ../../library/string.rst:368 ../../library/string.rst:387 -#: ../../library/string.rst:396 ../../library/string.rst:410 -#: ../../library/string.rst:421 +#: ../../library/string.rst:202 ../../library/string.rst:342 +#: ../../library/string.rst:375 ../../library/string.rst:394 +#: ../../library/string.rst:403 ../../library/string.rst:417 +#: ../../library/string.rst:428 msgid "in string formatting" msgstr "於字串格式化" -#: ../../library/string.rst:195 +#: ../../library/string.rst:202 msgid ". (dot)" msgstr ". (點)" -#: ../../library/string.rst:195 +#: ../../library/string.rst:202 msgid "[] (square brackets)" msgstr "[] (方括號)" -#: ../../library/string.rst:195 +#: ../../library/string.rst:202 msgid "! (exclamation)" msgstr "! (驚嘆號)" -#: ../../library/string.rst:195 +#: ../../library/string.rst:202 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/string.rst:335 +#: ../../library/string.rst:342 msgid "< (less)" msgstr "< (小於)" -#: ../../library/string.rst:335 +#: ../../library/string.rst:342 msgid "> (greater)" msgstr "> (大於)" -#: ../../library/string.rst:335 +#: ../../library/string.rst:342 msgid "= (equals)" msgstr "= (等於)" -#: ../../library/string.rst:335 +#: ../../library/string.rst:342 msgid "^ (caret)" msgstr "^ (插入符號)" -#: ../../library/string.rst:368 +#: ../../library/string.rst:375 msgid "+ (plus)" msgstr "+ (加號)" -#: ../../library/string.rst:368 +#: ../../library/string.rst:375 msgid "- (minus)" msgstr "- (減號)" -#: ../../library/string.rst:387 +#: ../../library/string.rst:394 msgid "z" msgstr "z" -#: ../../library/string.rst:396 +#: ../../library/string.rst:403 msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/string.rst:410 +#: ../../library/string.rst:417 msgid ", (comma)" msgstr ", (逗號)" -#: ../../library/string.rst:421 +#: ../../library/string.rst:428 msgid "_ (underscore)" msgstr "_ (底線)" -#: ../../library/string.rst:763 +#: ../../library/string.rst:770 msgid "$ (dollar)" msgstr "$ (金錢符號)" -#: ../../library/string.rst:763 +#: ../../library/string.rst:770 msgid "in template strings" msgstr "於 template strings(模板字串)" diff --git a/library/sys.po b/library/sys.po index 0cafa0cde7..99a0ab456f 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-13 00:13+0000\n" +"POT-Creation-Date: 2025-01-18 00:13+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,8 @@ msgstr ":mod:`!sys` --- 系統特定的參數與函式" msgid "" "This module provides access to some variables used or maintained by the " "interpreter and to functions that interact strongly with the interpreter. It " -"is always available." +"is always available. Unless explicitly noted otherwise, all variables are " +"read-only." msgstr "" #: ../../library/sys.rst:16 diff --git a/library/sysconfig.po b/library/sysconfig.po index 7a2c3ec0df..7323abb9ea 100644 --- a/library/sysconfig.po +++ b/library/sysconfig.po @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-02-04 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -23,9 +23,8 @@ msgid "" msgstr ":mod:`!sysconfig` --- 提供 Python 設定資訊的存取" #: ../../library/sysconfig.rst:12 -#, fuzzy msgid "**Source code:** :source:`Lib/sysconfig`" -msgstr "**原始碼:**\\ :source:`Lib/sysconfig.py`" +msgstr "**原始碼:**\\ :source:`Lib/sysconfig`" #: ../../library/sysconfig.rst:19 msgid "" @@ -110,10 +109,10 @@ msgstr "" #: ../../library/sysconfig.rst:70 msgid "" "Python uses an installation scheme that differs depending on the platform " -"and on the installation options. These schemes are stored in :mod:" -"`sysconfig` under unique identifiers based on the value returned by :const:" -"`os.name`. The schemes are used by package installers to determine where to " -"copy files to." +"and on the installation options. These schemes are stored " +"in :mod:`sysconfig` under unique identifiers based on the value returned " +"by :const:`os.name`. The schemes are used by package installers to determine " +"where to copy files to." msgstr "" #: ../../library/sysconfig.rst:75 @@ -135,8 +134,8 @@ msgstr "" #: ../../library/sysconfig.rst:81 msgid "" "*posix_user*: scheme for POSIX platforms, when the *user* option is used. " -"This scheme defines paths located under the user's home directory (:const:" -"`site.USER_BASE`)." +"This scheme defines paths located under the user's home directory " +"(:const:`site.USER_BASE`)." msgstr "" #: ../../library/sysconfig.rst:84 @@ -234,8 +233,8 @@ msgstr "" msgid "" "Files will be installed into subdirectories of :const:`site.USER_BASE` " "(written as :file:`{userbase}` hereafter). This scheme installs pure Python " -"modules and extension modules in the same location (also known as :const:" -"`site.USER_SITE`)." +"modules and extension modules in the same location (also known " +"as :const:`site.USER_SITE`)." msgstr "" #: ../../library/sysconfig.rst:126 @@ -358,8 +357,8 @@ msgid "" "The idea behind the \"home scheme\" is that you build and maintain a " "personal stash of Python modules. This scheme's name is derived from the " "idea of a \"home\" directory on Unix, since it's not unusual for a Unix user " -"to make their home directory have a layout similar to :file:`/usr/` or :file:" -"`/usr/local/`. This scheme can be used by anyone, regardless of the " +"to make their home directory have a layout similar to :file:`/usr/` " +"or :file:`/usr/local/`. This scheme can be used by anyone, regardless of the " "operating system they are installing for." msgstr "" @@ -480,8 +479,8 @@ msgstr "" #: ../../library/sysconfig.rst:265 msgid "" -"Return a tuple containing all schemes currently supported in :mod:" -"`sysconfig`." +"Return a tuple containing all schemes currently supported " +"in :mod:`sysconfig`." msgstr "" #: ../../library/sysconfig.rst:271 @@ -533,14 +532,14 @@ msgstr "" #: ../../library/sysconfig.rst:307 msgid "" -"End users should not use this function, but :func:`get_default_scheme` and :" -"func:`get_preferred_scheme` instead." +"End users should not use this function, but :func:`get_default_scheme` " +"and :func:`get_preferred_scheme` instead." msgstr "" #: ../../library/sysconfig.rst:315 msgid "" -"Return a tuple containing all path names currently supported in :mod:" -"`sysconfig`." +"Return a tuple containing all path names currently supported " +"in :mod:`sysconfig`." msgstr "" #: ../../library/sysconfig.rst:321 @@ -570,9 +569,9 @@ msgstr "" #: ../../library/sysconfig.rst:334 msgid "" -"If *scheme* is provided, it must be a value from the list returned by :func:" -"`get_scheme_names`. Otherwise, the default scheme for the current platform " -"is used." +"If *scheme* is provided, it must be a value from the list returned " +"by :func:`get_scheme_names`. Otherwise, the default scheme for the current " +"platform is used." msgstr "" #: ../../library/sysconfig.rst:338 @@ -615,8 +614,8 @@ msgstr "" #: ../../library/sysconfig.rst:360 msgid "" -"If *scheme* is not an existing scheme, :func:`get_paths` will raise a :exc:" -"`KeyError`." +"If *scheme* is not an existing scheme, :func:`get_paths` will raise " +"a :exc:`KeyError`." msgstr "" #: ../../library/sysconfig.rst:365 @@ -628,8 +627,8 @@ msgid "" "Return the ``MAJOR.MINOR`` Python version number as a string. Similar to " "``'%d.%d' % sys.version_info[:2]``." msgstr "" -"回傳 ``MAJOR.MINOR`` Python 版本號碼字串。類似於 ``'%d.%d' % sys." -"version_info[:2]``。" +"回傳 ``MAJOR.MINOR`` Python 版本號碼字串。類似於 ``'%d.%d' % " +"sys.version_info[:2]``。" #: ../../library/sysconfig.rst:375 msgid "Return a string that identifies the current platform." @@ -665,78 +664,82 @@ msgid "Windows will return one of:" msgstr "" #: ../../library/sysconfig.rst:391 -msgid "win-amd64 (64bit Windows on AMD64, aka x86_64, Intel64, and EM64T)" +msgid "win-amd64 (64-bit Windows on AMD64, aka x86_64, Intel64, and EM64T)" msgstr "" #: ../../library/sysconfig.rst:392 +msgid "win-arm64 (64-bit Windows on ARM64, aka AArch64)" +msgstr "" + +#: ../../library/sysconfig.rst:393 msgid "win32 (all others - specifically, sys.platform is returned)" msgstr "" -#: ../../library/sysconfig.rst:394 +#: ../../library/sysconfig.rst:395 msgid "macOS can return:" msgstr "" -#: ../../library/sysconfig.rst:396 +#: ../../library/sysconfig.rst:397 msgid "macosx-10.6-ppc" msgstr "macosx-10.6-ppc" -#: ../../library/sysconfig.rst:397 +#: ../../library/sysconfig.rst:398 msgid "macosx-10.4-ppc64" msgstr "macosx-10.4-ppc64" -#: ../../library/sysconfig.rst:398 +#: ../../library/sysconfig.rst:399 msgid "macosx-10.3-i386" msgstr "macosx-10.3-i386" -#: ../../library/sysconfig.rst:399 +#: ../../library/sysconfig.rst:400 msgid "macosx-10.4-fat" msgstr "macosx-10.4-fat" -#: ../../library/sysconfig.rst:401 +#: ../../library/sysconfig.rst:402 msgid "" "For other non-POSIX platforms, currently just returns :data:`sys.platform`." msgstr "" -#: ../../library/sysconfig.rst:406 +#: ../../library/sysconfig.rst:407 msgid "" "Return ``True`` if the running Python interpreter was built from source and " "is being run from its built location, and not from a location resulting from " "e.g. running ``make install`` or installing via a binary installer." msgstr "" -#: ../../library/sysconfig.rst:413 +#: ../../library/sysconfig.rst:414 msgid "Parse a :file:`config.h`\\-style file." msgstr "" -#: ../../library/sysconfig.rst:415 +#: ../../library/sysconfig.rst:416 msgid "" "*fp* is a file-like object pointing to the :file:`config.h`\\-like file." msgstr "" -#: ../../library/sysconfig.rst:417 +#: ../../library/sysconfig.rst:418 msgid "" "A dictionary containing name/value pairs is returned. If an optional " "dictionary is passed in as the second argument, it is used instead of a new " "dictionary, and updated with the values read in the file." msgstr "" -#: ../../library/sysconfig.rst:424 +#: ../../library/sysconfig.rst:425 msgid "Return the path of :file:`pyconfig.h`." msgstr "回傳 :file:`pyconfig.h` 的路徑。" -#: ../../library/sysconfig.rst:428 +#: ../../library/sysconfig.rst:429 msgid "Return the path of :file:`Makefile`." msgstr "回傳 :file:`Makefile` 的路徑。" -#: ../../library/sysconfig.rst:433 +#: ../../library/sysconfig.rst:434 msgid "Using :mod:`sysconfig` as a script" msgstr "將 :mod:`sysconfig` 作為腳本使用" -#: ../../library/sysconfig.rst:435 +#: ../../library/sysconfig.rst:436 msgid "You can use :mod:`sysconfig` as a script with Python's *-m* option:" msgstr "" -#: ../../library/sysconfig.rst:437 +#: ../../library/sysconfig.rst:438 msgid "" "$ python -m sysconfig\n" "Platform: \"macosx-10.4-i386\"\n" @@ -782,11 +785,11 @@ msgstr "" " ARFLAGS = \"rc\"\n" " ..." -#: ../../library/sysconfig.rst:461 +#: ../../library/sysconfig.rst:462 msgid "" -"This call will print in the standard output the information returned by :" -"func:`get_platform`, :func:`get_python_version`, :func:`get_path` and :func:" -"`get_config_vars`." +"This call will print in the standard output the information returned " +"by :func:`get_platform`, :func:`get_python_version`, :func:`get_path` " +"and :func:`get_config_vars`." msgstr "" #: ../../library/sysconfig.rst:14 diff --git a/library/time.po b/library/time.po index db6badd4c8..52833ec856 100644 --- a/library/time.po +++ b/library/time.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-12 00:13+0000\n" +"POT-Creation-Date: 2025-01-19 00:15+0000\n" "PO-Revision-Date: 2024-11-20 15:25+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -120,9 +119,9 @@ msgstr "" msgid "" "On the other hand, the precision of :func:`.time` and :func:`sleep` is " "better than their Unix equivalents: times are expressed as floating-point " -"numbers, :func:`.time` returns the most accurate time available (using Unix :" -"c:func:`!gettimeofday` where available), and :func:`sleep` will accept a " -"time with a nonzero fraction (Unix :c:func:`!select` is used to implement " +"numbers, :func:`.time` returns the most accurate time available (using " +"Unix :c:func:`!gettimeofday` where available), and :func:`sleep` will accept " +"a time with a nonzero fraction (Unix :c:func:`!select` is used to implement " "this, where available)." msgstr "" "另一方面,:func:`.time` 和 :func:`sleep` 的精確度比它們的在 Unix 的等效函式更" @@ -132,16 +131,16 @@ msgstr "" #: ../../library/time.rst:78 msgid "" -"The time value as returned by :func:`gmtime`, :func:`localtime`, and :func:" -"`strptime`, and accepted by :func:`asctime`, :func:`mktime` and :func:" -"`strftime`, is a sequence of 9 integers. The return values of :func:" -"`gmtime`, :func:`localtime`, and :func:`strptime` also offer attribute names " -"for individual fields." +"The time value as returned by :func:`gmtime`, :func:`localtime`, " +"and :func:`strptime`, and accepted by :func:`asctime`, :func:`mktime` " +"and :func:`strftime`, is a sequence of 9 integers. The return values " +"of :func:`gmtime`, :func:`localtime`, and :func:`strptime` also offer " +"attribute names for individual fields." msgstr "" -"由 :func:`gmtime`、:func:`localtime` 和 :func:`strptime` 回傳,並由 :func:" -"`asctime`、:func:`mktime` 和 :func:`strftime` 接受的時間值,是一個 9 個整數的" -"序列。:func:`gmtime`、:func:`localtime` 和 :func:`strptime` 的回傳值也為各個" -"欄位提供屬性名稱。" +"由 :func:`gmtime`、:func:`localtime` 和 :func:`strptime` 回傳,並" +"由 :func:`asctime`、:func:`mktime` 和 :func:`strftime` 接受的時間值,是一個 " +"9 個整數的序列。:func:`gmtime`、:func:`localtime` 和 :func:`strptime` 的回傳" +"值也為各個欄位提供屬性名稱。" #: ../../library/time.rst:84 msgid "See :class:`struct_time` for a description of these objects." @@ -149,20 +148,20 @@ msgstr "關於這些物件的敘述請見 :class:`struct_time`。" #: ../../library/time.rst:86 msgid "" -"The :class:`struct_time` type was extended to provide the :attr:" -"`~struct_time.tm_gmtoff` and :attr:`~struct_time.tm_zone` attributes when " -"platform supports corresponding ``struct tm`` members." +"The :class:`struct_time` type was extended to provide " +"the :attr:`~struct_time.tm_gmtoff` and :attr:`~struct_time.tm_zone` " +"attributes when platform supports corresponding ``struct tm`` members." msgstr "" "當平台支援對應的 ``struct tm`` 成員時,:class:`struct_time` 型別被擴展以提" "供 :attr:`~struct_time.tm_gmtoff` 和 :attr:`~struct_time.tm_zone` 屬性。" #: ../../library/time.rst:92 msgid "" -"The :class:`struct_time` attributes :attr:`~struct_time.tm_gmtoff` and :attr:" -"`~struct_time.tm_zone` are now available on all platforms." +"The :class:`struct_time` attributes :attr:`~struct_time.tm_gmtoff` " +"and :attr:`~struct_time.tm_zone` are now available on all platforms." msgstr "" -":class:`struct_time` 的屬性 :attr:`~struct_time.tm_gmtoff` 和 :attr:" -"`~struct_time.tm_zone` 現在在所有平台上都可用。" +":class:`struct_time` 的屬性 :attr:`~struct_time.tm_gmtoff` " +"和 :attr:`~struct_time.tm_zone` 現在在所有平台上都可用。" #: ../../library/time.rst:97 msgid "Use the following functions to convert between time representations:" @@ -216,10 +215,11 @@ msgstr "函式" #: ../../library/time.rst:123 msgid "" -"Convert a tuple or :class:`struct_time` representing a time as returned by :" -"func:`gmtime` or :func:`localtime` to a string of the following form: ``'Sun " -"Jun 20 23:21:05 1993'``. The day field is two characters long and is space " -"padded if the day is a single digit, e.g.: ``'Wed Jun 9 04:26:40 1993'``." +"Convert a tuple or :class:`struct_time` representing a time as returned " +"by :func:`gmtime` or :func:`localtime` to a string of the following form: " +"``'Sun Jun 20 23:21:05 1993'``. The day field is two characters long and is " +"space padded if the day is a single digit, e.g.: ``'Wed Jun 9 04:26:40 " +"1993'``." msgstr "" "將由 :func:`gmtime` 或 :func:`localtime` 回傳的元組或 :class:`struct_time` 表" "示的時間轉換為以下格式的字串:``'Sun Jun 20 23:21:05 1993'``。日期欄位為兩個" @@ -252,8 +252,8 @@ msgid "" "attribute of :class:`threading.Thread` objects to get a suitable value for " "*thread_id*." msgstr "" -"使用 :func:`threading.get_ident` 或 :class:`threading.Thread` 物件的 :attr:" -"`~threading.Thread.ident` 屬性來獲取適用於 *thread_id* 的值。" +"使用 :func:`threading.get_ident` 或 :class:`threading.Thread` 物件" +"的 :attr:`~threading.Thread.ident` 屬性來獲取適用於 *thread_id* 的值。" #: ../../library/time.rst:146 msgid "" @@ -266,14 +266,14 @@ msgstr "" #: ../../library/time.rst:149 ../../library/time.rst:161 #: ../../library/time.rst:174 ../../library/time.rst:183 #: ../../library/time.rst:196 ../../library/time.rst:205 -#: ../../library/time.rst:734 ../../library/time.rst:758 -#: ../../library/time.rst:854 ../../library/time.rst:865 -#: ../../library/time.rst:875 ../../library/time.rst:885 -#: ../../library/time.rst:894 ../../library/time.rst:903 -#: ../../library/time.rst:912 ../../library/time.rst:923 -#: ../../library/time.rst:931 ../../library/time.rst:942 -#: ../../library/time.rst:953 ../../library/time.rst:962 -#: ../../library/time.rst:975 +#: ../../library/time.rst:743 ../../library/time.rst:767 +#: ../../library/time.rst:863 ../../library/time.rst:874 +#: ../../library/time.rst:884 ../../library/time.rst:894 +#: ../../library/time.rst:903 ../../library/time.rst:912 +#: ../../library/time.rst:921 ../../library/time.rst:932 +#: ../../library/time.rst:940 ../../library/time.rst:951 +#: ../../library/time.rst:962 ../../library/time.rst:971 +#: ../../library/time.rst:984 msgid "Availability" msgstr "" @@ -296,13 +296,13 @@ msgid "" "Return the time of the specified clock *clk_id*. Refer to :ref:`time-clock-" "id-constants` for a list of accepted values for *clk_id*." msgstr "" -"回傳指定時鐘 *clk_id* 的時間。有關 *clk_id* 可接受的值的串列,請參閱 :ref:" -"`time-clock-id-constants`。" +"回傳指定時鐘 *clk_id* 的時間。有關 *clk_id* 可接受的值的串列,請參" +"閱 :ref:`time-clock-id-constants`。" #: ../../library/time.rst:171 msgid "" -"Use :func:`clock_gettime_ns` to avoid the precision loss caused by the :" -"class:`float` type." +"Use :func:`clock_gettime_ns` to avoid the precision loss caused by " +"the :class:`float` type." msgstr "" "使用 :func:`clock_gettime_ns` 以避免 :class:`float` 型別造成的精確度損失。" @@ -313,16 +313,16 @@ msgstr "" #: ../../library/time.rst:190 msgid "" -"Set the time of the specified clock *clk_id*. Currently, :data:" -"`CLOCK_REALTIME` is the only accepted value for *clk_id*." +"Set the time of the specified clock *clk_id*. " +"Currently, :data:`CLOCK_REALTIME` is the only accepted value for *clk_id*." msgstr "" "設定指定時鐘 *clk_id* 的時間。目前,:data:`CLOCK_REALTIME` 是 *clk_id* 唯一可" "以接受的值。" #: ../../library/time.rst:193 msgid "" -"Use :func:`clock_settime_ns` to avoid the precision loss caused by the :" -"class:`float` type." +"Use :func:`clock_settime_ns` to avoid the precision loss caused by " +"the :class:`float` type." msgstr "" "使用 :func:`clock_settime_ns` 以避免 :class:`float` 型別造成的精確度損失。" @@ -343,10 +343,10 @@ msgstr "" #: ../../library/time.rst:217 msgid "" -"If *secs* is not provided or :const:`None`, the current time as returned by :" -"func:`.time` is used. ``ctime(secs)`` is equivalent to " -"``asctime(localtime(secs))``. Locale information is not used by :func:" -"`ctime`." +"If *secs* is not provided or :const:`None`, the current time as returned " +"by :func:`.time` is used. ``ctime(secs)`` is equivalent to " +"``asctime(localtime(secs))``. Locale information is not used " +"by :func:`ctime`." msgstr "" "如果未提供 *secs* 或其為 :const:`None`,則使用由 :func:`.time` 回傳的當前時" "間。``ctime(secs)`` 等同於 ``asctime(localtime(secs))``。:func:`ctime` 不使用" @@ -397,8 +397,8 @@ msgid "" "*implementation*: The name of the underlying C function used to get the " "clock value. Refer to :ref:`time-clock-id-constants` for possible values." msgstr "" -"*implementation*: 用於獲取時鐘的值的底層 C 函式名稱。有關可能的值,請參閱 :" -"ref:`time-clock-id-constants`。" +"*implementation*: 用於獲取時鐘的值的底層 C 函式名稱。有關可能的值,請參" +"閱 :ref:`time-clock-id-constants`。" #: ../../library/time.rst:241 msgid "" @@ -411,12 +411,12 @@ msgstr "*resolution*: 以秒 (:class:`float`) 為單位的時鐘的解析度" #: ../../library/time.rst:250 msgid "" -"Convert a time expressed in seconds since the epoch_ to a :class:" -"`struct_time` in UTC in which the dst flag is always zero. If *secs* is not " -"provided or :const:`None`, the current time as returned by :func:`.time` is " -"used. Fractions of a second are ignored. See above for a description of " -"the :class:`struct_time` object. See :func:`calendar.timegm` for the inverse " -"of this function." +"Convert a time expressed in seconds since the epoch_ to " +"a :class:`struct_time` in UTC in which the dst flag is always zero. If " +"*secs* is not provided or :const:`None`, the current time as returned " +"by :func:`.time` is used. Fractions of a second are ignored. See above for " +"a description of the :class:`struct_time` object. " +"See :func:`calendar.timegm` for the inverse of this function." msgstr "" "將自 epoch_ 起以秒表示的時間轉換為 UTC 中的 :class:`struct_time`,其中 dst 旗" "標始終為零。如果未提供 *secs* 或其為 :const:`None`,則使用由 :func:`.time` 回" @@ -429,41 +429,41 @@ msgid "" "or :const:`None`, the current time as returned by :func:`.time` is used. " "The dst flag is set to ``1`` when DST applies to the given time." msgstr "" -"類似於 :func:`gmtime`,但轉換為當地時間。如果未提供 *secs* 或其為 :const:" -"`None`,則使用由 :func:`.time` 回傳的當前時間。當 DST 適用於給定時間時,dst " -"旗標會被設定為 ``1``。" +"類似於 :func:`gmtime`,但轉換為當地時間。如果未提供 *secs* 或其" +"為 :const:`None`,則使用由 :func:`.time` 回傳的當前時間。當 DST 適用於給定時" +"間時,dst 旗標會被設定為 ``1``。" #: ../../library/time.rst:264 msgid "" ":func:`localtime` may raise :exc:`OverflowError`, if the timestamp is " "outside the range of values supported by the platform C :c:func:`localtime` " -"or :c:func:`gmtime` functions, and :exc:`OSError` on :c:func:`localtime` or :" -"c:func:`gmtime` failure. It's common for this to be restricted to years " +"or :c:func:`gmtime` functions, and :exc:`OSError` on :c:func:`localtime` " +"or :c:func:`gmtime` failure. It's common for this to be restricted to years " "between 1970 and 2038." msgstr "" "如果時間戳超出 C 平台的 :c:func:`localtime` 或 :c:func:`gmtime` 函式支援的範" -"圍,:func:`localtime` 可能會引發 :exc:`OverflowError`;在 :c:func:" -"`localtime` 或 :c:func:`gmtime` 失敗時,會引發 :exc:`OSError`。通常會把年份限" -"制在 1970 年到 2038 年之間。" +"圍,:func:`localtime` 可能會引發 :exc:`OverflowError`;" +"在 :c:func:`localtime` 或 :c:func:`gmtime` 失敗時,會引發 :exc:`OSError`。通" +"常會把年份限制在 1970 年到 2038 年之間。" #: ../../library/time.rst:273 msgid "" -"This is the inverse function of :func:`localtime`. Its argument is the :" -"class:`struct_time` or full 9-tuple (since the dst flag is needed; use " +"This is the inverse function of :func:`localtime`. Its argument is " +"the :class:`struct_time` or full 9-tuple (since the dst flag is needed; use " "``-1`` as the dst flag if it is unknown) which expresses the time in *local* " -"time, not UTC. It returns a floating-point number, for compatibility with :" -"func:`.time`. If the input value cannot be represented as a valid time, " -"either :exc:`OverflowError` or :exc:`ValueError` will be raised (which " +"time, not UTC. It returns a floating-point number, for compatibility " +"with :func:`.time`. If the input value cannot be represented as a valid " +"time, either :exc:`OverflowError` or :exc:`ValueError` will be raised (which " "depends on whether the invalid value is caught by Python or the underlying C " "libraries). The earliest date for which it can generate a time is platform-" "dependent." msgstr "" -"這是 :func:`localtime` 的反函式。其引數是表示\\ *當地*\\ 時間(不是 UTC)的 :" -"class:`struct_time` 或完整的 9 元組(因為需要 dst 旗標;如果 dst 為未知,則使" -"用 ``-1`` 作為 dst 旗標)。它回傳一個浮點數,以與 :func:`.time` 相容。如果輸" -"入值不能表示為有效時間,將引發 :exc:`OverflowError` 或 :exc:`ValueError`\\ " -"(取決於無效值是被 Python 還是底層 C 函式庫捕獲)。它能生成時間的最早日期根據" -"平台而有所不同。" +"這是 :func:`localtime` 的反函式。其引數是表示\\ *當地*\\ 時間(不是 UTC)" +"的 :class:`struct_time` 或完整的 9 元組(因為需要 dst 旗標;如果 dst 為未知," +"則使用 ``-1`` 作為 dst 旗標)。它回傳一個浮點數,以與 :func:`.time` 相容。如" +"果輸入值不能表示為有效時間,將引發 :exc:`OverflowError` " +"或 :exc:`ValueError`\\ (取決於無效值是被 Python 還是底層 C 函式庫捕獲)。它" +"能生成時間的最早日期根據平台而有所不同。" #: ../../library/time.rst:285 msgid "" @@ -476,7 +476,7 @@ msgstr "" "示)。該時鐘不受系統時鐘更新的影響。回傳值的參考點沒有定義,因此只有兩次呼叫" "結果之間的差異才是有效的。" -#: ../../library/time.rst:290 ../../library/time.rst:700 +#: ../../library/time.rst:290 ../../library/time.rst:709 msgid "Clock:" msgstr "時鐘:" @@ -507,8 +507,8 @@ msgstr "否則,呼叫 ``clock_gettime(CLOCK_MONOTONIC)``。" #: ../../library/time.rst:299 msgid "" -"Use :func:`monotonic_ns` to avoid the precision loss caused by the :class:" -"`float` type." +"Use :func:`monotonic_ns` to avoid the precision loss caused by " +"the :class:`float` type." msgstr "使用 :func:`monotonic_ns` 以避免 :class:`float` 型別造成的精確度損失。" #: ../../library/time.rst:304 @@ -545,8 +545,8 @@ msgstr "" #: ../../library/time.rst:333 msgid "" -"Use :func:`perf_counter_ns` to avoid the precision loss caused by the :class:" -"`float` type." +"Use :func:`perf_counter_ns` to avoid the precision loss caused by " +"the :class:`float` type." msgstr "" "使用 :func:`perf_counter_ns` 以避免 :class:`float` 型別造成的精確度損失。" @@ -576,8 +576,8 @@ msgstr "" #: ../../library/time.rst:365 msgid "" -"Use :func:`process_time_ns` to avoid the precision loss caused by the :class:" -"`float` type." +"Use :func:`process_time_ns` to avoid the precision loss caused by " +"the :class:`float` type." msgstr "" "使用 :func:`process_time_ns` 以避免 :class:`float` 型別造成的精確度損失。" @@ -608,7 +608,11 @@ msgid "" "because of the scheduling of other activity in the system." msgstr "由於系統中其他活動的調度,暫停時間可能會比請求的時間長任意的量。" -#: ../../library/time.rst:388 +#: ../../library/time.rst:389 +msgid "Windows implementation" +msgstr "Windows 實作" + +#: ../../library/time.rst:390 msgid "" "On Windows, if *secs* is zero, the thread relinquishes the remainder of its " "time slice to any other thread that is ready to run. If there are no other " @@ -624,23 +628,34 @@ msgstr "" "learn.microsoft.com/windows-hardware/drivers/kernel/high-resolution-" "timers>`_,其解析度為 100 奈秒。如果 *secs* 為零,則使用 ``Sleep(0)``。" -#: ../../library/time.rst:396 -msgid "Unix implementation:" -msgstr "Unix 實作:" +#: ../../library/time.rst:399 +msgid "Unix implementation" +msgstr "Unix 實作" -#: ../../library/time.rst:398 +#: ../../library/time.rst:400 msgid "Use ``clock_nanosleep()`` if available (resolution: 1 nanosecond);" msgstr "如果可以,使用 ``clock_nanosleep()``\\ (解析度:1 奈秒);" -#: ../../library/time.rst:399 +#: ../../library/time.rst:401 msgid "Or use ``nanosleep()`` if available (resolution: 1 nanosecond);" msgstr "或者使用 ``nanosleep()``\\ (解析度:1 奈秒);" -#: ../../library/time.rst:400 +#: ../../library/time.rst:402 msgid "Or use ``select()`` (resolution: 1 microsecond)." msgstr "或使用 ``select()``\\ (解析度:1 微秒)。" -#: ../../library/time.rst:402 +#: ../../library/time.rst:406 +msgid "" +"To emulate a \"no-op\", use :keyword:`pass` instead of ``time.sleep(0)``." +msgstr "" + +#: ../../library/time.rst:408 +msgid "" +"To voluntarily relinquish the CPU, specify a real-time :ref:`scheduling " +"policy ` and use :func:`os.sched_yield` instead." +msgstr "" + +#: ../../library/time.rst:411 msgid "" "Raises an :ref:`auditing event ` ``time.sleep`` with argument " "``secs``." @@ -648,7 +663,7 @@ msgstr "" "引發一個帶有引數 ``secs`` 的\\ :ref:`稽核事件 (auditing event) ` " "``time.sleep``。" -#: ../../library/time.rst:404 +#: ../../library/time.rst:413 msgid "" "The function now sleeps at least *secs* even if the sleep is interrupted by " "a signal, except if the signal handler raises an exception (see :pep:`475` " @@ -657,7 +672,7 @@ msgstr "" "即使睡眠被訊號中斷,此函式現在至少還是會睡眠 *secs*,除非訊號處理器引發例外" "(理由請參閱 :pep:`475`)。" -#: ../../library/time.rst:409 +#: ../../library/time.rst:418 msgid "" "On Unix, the ``clock_nanosleep()`` and ``nanosleep()`` functions are now " "used if available. On Windows, a waitable timer is now used." @@ -665,24 +680,24 @@ msgstr "" "在 Unix 上,如果可以的話現在會使用 ``clock_nanosleep()`` 和 ``nanosleep()`` " "函式。在 Windows 上,現在使用可等待的計時器。" -#: ../../library/time.rst:413 +#: ../../library/time.rst:422 msgid "Raises an auditing event." msgstr "引發一個稽核事件。" -#: ../../library/time.rst:421 +#: ../../library/time.rst:430 msgid "" -"Convert a tuple or :class:`struct_time` representing a time as returned by :" -"func:`gmtime` or :func:`localtime` to a string as specified by the *format* " -"argument. If *t* is not provided, the current time as returned by :func:" -"`localtime` is used. *format* must be a string. :exc:`ValueError` is " -"raised if any field in *t* is outside of the allowed range." +"Convert a tuple or :class:`struct_time` representing a time as returned " +"by :func:`gmtime` or :func:`localtime` to a string as specified by the " +"*format* argument. If *t* is not provided, the current time as returned " +"by :func:`localtime` is used. *format* must be a string. :exc:`ValueError` " +"is raised if any field in *t* is outside of the allowed range." msgstr "" -"將由 :func:`gmtime` 或 :func:`localtime` 回傳代表時間的一個元組或 :class:" -"`struct_time` 轉換為由 *format* 引數指定的字串。如果未提供 *t*,則使用由 :" -"func:`localtime` 回傳的當前時間。*format* 必須是一個字串。如果 *t* 中的任何欄" -"位超出允許範圍,將會引發 :exc:`ValueError`。" +"將由 :func:`gmtime` 或 :func:`localtime` 回傳代表時間的一個元組" +"或 :class:`struct_time` 轉換為由 *format* 引數指定的字串。如果未提供 *t*,則" +"使用由 :func:`localtime` 回傳的當前時間。*format* 必須是一個字串。如果 *t* 中" +"的任何欄位超出允許範圍,將會引發 :exc:`ValueError`。" -#: ../../library/time.rst:427 +#: ../../library/time.rst:436 msgid "" "0 is a legal argument for any position in the time tuple; if it is normally " "illegal the value is forced to a correct one." @@ -690,7 +705,7 @@ msgstr "" "0 在時間元組中的任何位置都是合法引數;如果元組中出現常見的錯誤,該值將被強制" "更改為正確的值。" -#: ../../library/time.rst:430 +#: ../../library/time.rst:439 msgid "" "The following directives can be embedded in the *format* string. They are " "shown without the optional field width and precision specification, and are " @@ -699,151 +714,151 @@ msgstr "" "以下指令可以嵌入在 *format* 字串中。它們顯示時不帶可選的欄位寬度和精度規範," "並在 :func:`strftime` 的結果中被標示的字元替換:" -#: ../../library/time.rst:435 +#: ../../library/time.rst:444 msgid "Directive" msgstr "指令" -#: ../../library/time.rst:435 +#: ../../library/time.rst:444 msgid "Meaning" msgstr "意義" -#: ../../library/time.rst:435 +#: ../../library/time.rst:444 msgid "Notes" msgstr "註解" -#: ../../library/time.rst:437 +#: ../../library/time.rst:446 msgid "``%a``" msgstr "``%a``" -#: ../../library/time.rst:437 +#: ../../library/time.rst:446 msgid "Locale's abbreviated weekday name." msgstr "區域設定的週間日 (weekday) 縮寫名稱。" -#: ../../library/time.rst:440 +#: ../../library/time.rst:449 msgid "``%A``" msgstr "``%A``" -#: ../../library/time.rst:440 +#: ../../library/time.rst:449 msgid "Locale's full weekday name." msgstr "區域設定的完整週間日名稱。" -#: ../../library/time.rst:442 +#: ../../library/time.rst:451 msgid "``%b``" msgstr "``%b``" -#: ../../library/time.rst:442 +#: ../../library/time.rst:451 msgid "Locale's abbreviated month name." msgstr "區域設定的縮寫月份名稱。" -#: ../../library/time.rst:445 +#: ../../library/time.rst:454 msgid "``%B``" msgstr "``%B``" -#: ../../library/time.rst:445 +#: ../../library/time.rst:454 msgid "Locale's full month name." msgstr "區域設定的完整月份名稱。" -#: ../../library/time.rst:447 +#: ../../library/time.rst:456 msgid "``%c``" msgstr "``%c``" -#: ../../library/time.rst:447 +#: ../../library/time.rst:456 msgid "Locale's appropriate date and time representation." msgstr "區域設定的合適的日期和時間的表示法。" -#: ../../library/time.rst:450 +#: ../../library/time.rst:459 msgid "``%d``" msgstr "``%d``" -#: ../../library/time.rst:450 +#: ../../library/time.rst:459 msgid "Day of the month as a decimal number [01,31]." msgstr "月份中的日期,表示為十進位數 [01,31]。" -#: ../../library/time.rst:453 +#: ../../library/time.rst:462 msgid "``%f``" msgstr "``%f``" -#: ../../library/time.rst:453 +#: ../../library/time.rst:462 msgid "Microseconds as a decimal number" msgstr "微秒,表示為十進位數" -#: ../../library/time.rst:454 +#: ../../library/time.rst:463 msgid "[000000,999999]." msgstr "[000000,999999]。" -#: ../../library/time.rst:453 +#: ../../library/time.rst:462 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/time.rst:457 +#: ../../library/time.rst:466 msgid "``%H``" msgstr "``%H``" -#: ../../library/time.rst:457 +#: ../../library/time.rst:466 msgid "Hour (24-hour clock) as a decimal number [00,23]." msgstr "小時(24 小時制),表示為十進位數 [00,23]。" -#: ../../library/time.rst:460 +#: ../../library/time.rst:469 msgid "``%I``" msgstr "``%I``" -#: ../../library/time.rst:460 +#: ../../library/time.rst:469 msgid "Hour (12-hour clock) as a decimal number [01,12]." msgstr "小時(12 小時制),表示為十進位數 [01,12]。" -#: ../../library/time.rst:463 +#: ../../library/time.rst:472 msgid "``%j``" msgstr "``%j``" -#: ../../library/time.rst:463 +#: ../../library/time.rst:472 msgid "Day of the year as a decimal number [001,366]." msgstr "一年中的第幾天,表示為十進位數 [001,366]。" -#: ../../library/time.rst:466 +#: ../../library/time.rst:475 msgid "``%m``" msgstr "``%m``" -#: ../../library/time.rst:466 +#: ../../library/time.rst:475 msgid "Month as a decimal number [01,12]." msgstr "月份,表示為十進位數 [01,12]。" -#: ../../library/time.rst:469 +#: ../../library/time.rst:478 msgid "``%M``" msgstr "``%M``" -#: ../../library/time.rst:469 +#: ../../library/time.rst:478 msgid "Minute as a decimal number [00,59]." msgstr "分鐘,表示為十進位數 [00,59]。" -#: ../../library/time.rst:472 +#: ../../library/time.rst:481 msgid "``%p``" msgstr "``%p``" -#: ../../library/time.rst:472 +#: ../../library/time.rst:481 msgid "Locale's equivalent of either AM or PM." msgstr "區域設定中相當於 AM 或 PM 的表示。" -#: ../../library/time.rst:472 +#: ../../library/time.rst:481 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/time.rst:475 +#: ../../library/time.rst:484 msgid "``%S``" msgstr "``%S``" -#: ../../library/time.rst:475 +#: ../../library/time.rst:484 msgid "Second as a decimal number [00,61]." msgstr "秒,表示為十進位數 [00,61]。" -#: ../../library/time.rst:475 +#: ../../library/time.rst:484 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/time.rst:478 +#: ../../library/time.rst:487 msgid "``%U``" msgstr "``%U``" -#: ../../library/time.rst:478 +#: ../../library/time.rst:487 msgid "" "Week number of the year (Sunday as the first day of the week) as a decimal " "number [00,53]. All days in a new year preceding the first Sunday are " @@ -852,31 +867,31 @@ msgstr "" "一年中的週數(星期天作為一週的第一天),表示為十進位數 [00,53]。新的一年中," "在第一個星期天之前的所有日子都被認定為第 0 週。" -#: ../../library/time.rst:478 ../../library/time.rst:492 +#: ../../library/time.rst:487 ../../library/time.rst:501 msgid "\\(4)" msgstr "\\(4)" -#: ../../library/time.rst:486 +#: ../../library/time.rst:495 msgid "``%u``" msgstr "``%u``" -#: ../../library/time.rst:486 +#: ../../library/time.rst:495 msgid "Day of the week (Monday is 1; Sunday is 7) as a decimal number [1, 7]." msgstr "一週中的日期(周一為 1;週日為 7),表示為十進位數 [1,7]。" -#: ../../library/time.rst:489 +#: ../../library/time.rst:498 msgid "``%w``" msgstr "``%w``" -#: ../../library/time.rst:489 +#: ../../library/time.rst:498 msgid "Weekday as a decimal number [0(Sunday),6]." msgstr "週間日,表示為十進位數 [0(星期天),6]。" -#: ../../library/time.rst:492 +#: ../../library/time.rst:501 msgid "``%W``" msgstr "``%W``" -#: ../../library/time.rst:492 +#: ../../library/time.rst:501 msgid "" "Week number of the year (Monday as the first day of the week) as a decimal " "number [00,53]. All days in a new year preceding the first Monday are " @@ -885,43 +900,43 @@ msgstr "" "一年中的週數(星期一作為一週的第一天),表示為十進位數 [00,53]。新的一年中," "在第一個星期一之前的所有日子都被認定為第 0 週。" -#: ../../library/time.rst:500 +#: ../../library/time.rst:509 msgid "``%x``" msgstr "``%x``" -#: ../../library/time.rst:500 +#: ../../library/time.rst:509 msgid "Locale's appropriate date representation." msgstr "區域設定的合適的日期表示法。" -#: ../../library/time.rst:503 +#: ../../library/time.rst:512 msgid "``%X``" msgstr "``%X``" -#: ../../library/time.rst:503 +#: ../../library/time.rst:512 msgid "Locale's appropriate time representation." msgstr "區域設定的合適的時間表示法。" -#: ../../library/time.rst:506 +#: ../../library/time.rst:515 msgid "``%y``" msgstr "``%y``" -#: ../../library/time.rst:506 +#: ../../library/time.rst:515 msgid "Year without century as a decimal number [00,99]." msgstr "去掉世紀的年份,表示為十進位數 [00,99]。" -#: ../../library/time.rst:509 +#: ../../library/time.rst:518 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/time.rst:509 +#: ../../library/time.rst:518 msgid "Year with century as a decimal number." msgstr "帶世紀的年份,表示為十進位數。" -#: ../../library/time.rst:512 +#: ../../library/time.rst:521 msgid "``%z``" msgstr "``%z``" -#: ../../library/time.rst:512 +#: ../../library/time.rst:521 msgid "" "Time zone offset indicating a positive or negative time difference from UTC/" "GMT of the form +HHMM or -HHMM, where H represents decimal hour digits and M " @@ -930,19 +945,19 @@ msgstr "" "時區偏移量,表示與 UTC/GMT 的正或負時間差,形式為 +HHMM 或 -HHMM,其中 H 代表" "十進位的小時數碼 (digits),M 代表十進位的分鐘數碼 [-23:59, +23:59]。 [1]_" -#: ../../library/time.rst:518 +#: ../../library/time.rst:527 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/time.rst:518 +#: ../../library/time.rst:527 msgid "Time zone name (no characters if no time zone exists). Deprecated. [1]_" msgstr "時區名稱(如果不存在時區,則無字元)。已被棄用。 [1]_" -#: ../../library/time.rst:521 +#: ../../library/time.rst:530 msgid "``%G``" msgstr "``%G``" -#: ../../library/time.rst:521 +#: ../../library/time.rst:530 msgid "" "ISO 8601 year (similar to ``%Y`` but follows the rules for the ISO 8601 " "calendar year). The year starts with the week that contains the first " @@ -951,11 +966,11 @@ msgstr "" "ISO 8601 年(類似於 ``%Y``,但遵循 ISO 8601 日曆年的規則)。年份從包含該日曆" "年第一個星期四的那一週開始。" -#: ../../library/time.rst:526 +#: ../../library/time.rst:535 msgid "``%V``" msgstr "``%V``" -#: ../../library/time.rst:526 +#: ../../library/time.rst:535 msgid "" "ISO 8601 week number (as a decimal number [01,53]). The first week of the " "year is the one that contains the first Thursday of the year. Weeks start on " @@ -964,30 +979,30 @@ msgstr "" "ISO 8601 週數(以十進位數表示 [01,53])。年份的第一週是包含該年第一個星期四的" "那一週。每週從星期一開始。" -#: ../../library/time.rst:531 +#: ../../library/time.rst:540 msgid "``%%``" msgstr "``%%``" -#: ../../library/time.rst:531 +#: ../../library/time.rst:540 msgid "A literal ``'%'`` character." msgstr "字面意義上的 ``'%'`` 字元。" -#: ../../library/time.rst:534 +#: ../../library/time.rst:543 msgid "Notes:" msgstr "註解:" -#: ../../library/time.rst:537 +#: ../../library/time.rst:546 msgid "" -"The ``%f`` format directive only applies to :func:`strptime`, not to :func:" -"`strftime`. However, see also :meth:`datetime.datetime.strptime` and :meth:" -"`datetime.datetime.strftime` where the ``%f`` format directive :ref:`applies " -"to microseconds `." +"The ``%f`` format directive only applies to :func:`strptime`, not " +"to :func:`strftime`. However, see also :meth:`datetime.datetime.strptime` " +"and :meth:`datetime.datetime.strftime` where the ``%f`` format " +"directive :ref:`applies to microseconds `." msgstr "" "``%f`` 格式的指令僅適用於 :func:`strptime`,不適用於 :func:`strftime`。然而," "在 :meth:`datetime.datetime.strptime` 和 :meth:`datetime.datetime.strftime` " "其中的 ``%f`` 格式的指令\\ :ref:`適用於微秒 `。" -#: ../../library/time.rst:543 +#: ../../library/time.rst:552 msgid "" "When used with the :func:`strptime` function, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " @@ -996,7 +1011,7 @@ msgstr "" "當與 :func:`strptime` 函式一起使用時,``%p`` 指令僅在使用 ``%I`` 指令剖析小時" "時影響輸出小時的欄位。" -#: ../../library/time.rst:549 +#: ../../library/time.rst:558 msgid "" "The range really is ``0`` to ``61``; value ``60`` is valid in timestamps " "representing `leap seconds`_ and value ``61`` is supported for historical " @@ -1005,7 +1020,7 @@ msgstr "" "範圍確實是從 ``0`` 到 ``61``;數值 ``60`` 在表示 `leap seconds`_ 的時間戳中是" "有效的,而數值 ``61`` 是出於歷史因素而被支援。" -#: ../../library/time.rst:554 +#: ../../library/time.rst:563 msgid "" "When used with the :func:`strptime` function, ``%U`` and ``%W`` are only " "used in calculations when the day of the week and the year are specified." @@ -1013,7 +1028,7 @@ msgstr "" "當與 :func:`strptime` 函式一起使用時,``%U`` 和 ``%W`` 僅在指定週間的某天和年" "份時用於計算中。" -#: ../../library/time.rst:557 +#: ../../library/time.rst:566 msgid "" "Here is an example, a format for dates compatible with that specified in " "the :rfc:`2822` Internet email standard. [1]_ ::" @@ -1021,7 +1036,7 @@ msgstr "" "以下是一個範例,其為一種與 :rfc:`2822` 網際網路電子郵件標準中指定的日期格式兼" "容的格式。 [1]_: ::" -#: ../../library/time.rst:560 +#: ../../library/time.rst:569 msgid "" ">>> from time import gmtime, strftime\n" ">>> strftime(\"%a, %d %b %Y %H:%M:%S +0000\", gmtime())\n" @@ -1031,17 +1046,17 @@ msgstr "" ">>> strftime(\"%a, %d %b %Y %H:%M:%S +0000\", gmtime())\n" "'Thu, 28 Jun 2001 14:17:15 +0000'" -#: ../../library/time.rst:564 +#: ../../library/time.rst:573 msgid "" "Additional directives may be supported on certain platforms, but only the " "ones listed here have a meaning standardized by ANSI C. To see the full set " -"of format codes supported on your platform, consult the :manpage:" -"`strftime(3)` documentation." +"of format codes supported on your platform, consult " +"the :manpage:`strftime(3)` documentation." msgstr "" "某些平台可能支援額外的指令,但只有這裡列出的指令具有 ANSI C 標準化的意義。要" "查看你的平台上支援的完整格式碼集,請參閱 :manpage:`strftime(3)` 文件。" -#: ../../library/time.rst:569 +#: ../../library/time.rst:578 msgid "" "On some platforms, an optional field width and precision specification can " "immediately follow the initial ``'%'`` of a directive in the following " @@ -1051,23 +1066,23 @@ msgstr "" "在某些平台上,可選的欄位寬度和精度規範可以以此順序緊跟在指令初始的 ``'%'`` 之" "後;這也是不可攜 (portable) 的。欄位寬度通常為 2,除了 ``%j`` 為 3。" -#: ../../library/time.rst:580 +#: ../../library/time.rst:589 msgid "" "Parse a string representing a time according to a format. The return value " "is a :class:`struct_time` as returned by :func:`gmtime` or :func:`localtime`." msgstr "" -"根據格式剖析表示時間的字串。回傳值是 :class:`struct_time`,如同由 :func:" -"`gmtime` 或 :func:`localtime` 回傳的一樣。" +"根據格式剖析表示時間的字串。回傳值是 :class:`struct_time`,如同" +"由 :func:`gmtime` 或 :func:`localtime` 回傳的一樣。" -#: ../../library/time.rst:584 +#: ../../library/time.rst:593 msgid "" -"The *format* parameter uses the same directives as those used by :func:" -"`strftime`; it defaults to ``\"%a %b %d %H:%M:%S %Y\"`` which matches the " -"formatting returned by :func:`ctime`. If *string* cannot be parsed according " -"to *format*, or if it has excess data after parsing, :exc:`ValueError` is " -"raised. The default values used to fill in any missing data when more " -"accurate values cannot be inferred are ``(1900, 1, 1, 0, 0, 0, 0, 1, -1)``. " -"Both *string* and *format* must be strings." +"The *format* parameter uses the same directives as those used " +"by :func:`strftime`; it defaults to ``\"%a %b %d %H:%M:%S %Y\"`` which " +"matches the formatting returned by :func:`ctime`. If *string* cannot be " +"parsed according to *format*, or if it has excess data after " +"parsing, :exc:`ValueError` is raised. The default values used to fill in any " +"missing data when more accurate values cannot be inferred are ``(1900, 1, 1, " +"0, 0, 0, 0, 1, -1)``. Both *string* and *format* must be strings." msgstr "" "*format* 參數使用與 :func:`strftime` 相同的指令;預設為 ``\"%a %b %d %H:%M:" "%S %Y\"``,與 :func:`ctime` 回傳的格式匹配。如果 *string* 無法根據 *format* " @@ -1075,11 +1090,11 @@ msgstr "" "時,用來填充任何缺失資料的預設值為 ``(1900, 1, 1, 0, 0, 0, 0, 1, -1)``。" "*string* 和 *format* 都必須是字串。" -#: ../../library/time.rst:592 +#: ../../library/time.rst:601 msgid "For example:" msgstr "例如:" -#: ../../library/time.rst:599 +#: ../../library/time.rst:608 msgid "" "Support for the ``%Z`` directive is based on the values contained in " "``tzname`` and whether ``daylight`` is true. Because of this, it is " @@ -1090,7 +1105,7 @@ msgstr "" "因此,除了識別始終已知的 UTC 和 GMT(且被考慮為非日光節約時區)外,這是特定於" "平台的。" -#: ../../library/time.rst:604 +#: ../../library/time.rst:613 msgid "" "Only the directives specified in the documentation are supported. Because " "``strftime()`` is implemented per platform it can sometimes offer more " @@ -1102,121 +1117,121 @@ msgstr "" "提供比列出的還要更多的指令。但是 ``strptime()`` 與任何平台無關,因此不一定支" "援所有未記載為支援的指令。" -#: ../../library/time.rst:613 +#: ../../library/time.rst:622 msgid "" -"The type of the time value sequence returned by :func:`gmtime`, :func:" -"`localtime`, and :func:`strptime`. It is an object with a :term:`named " -"tuple` interface: values can be accessed by index and by attribute name. " -"The following values are present:" +"The type of the time value sequence returned " +"by :func:`gmtime`, :func:`localtime`, and :func:`strptime`. It is an object " +"with a :term:`named tuple` interface: values can be accessed by index and by " +"attribute name. The following values are present:" msgstr "" "由 :func:`gmtime`、:func:`localtime` 和 :func:`strptime` 回傳的時間值序列的型" "別。它是一個具有 :term:`named tuple` 介面的物件:值可以通過索引和屬性名稱存" "取。包含以下值:" -#: ../../library/time.rst:620 +#: ../../library/time.rst:629 msgid "Index" msgstr "索引" -#: ../../library/time.rst:621 +#: ../../library/time.rst:630 msgid "Attribute" msgstr "屬性" -#: ../../library/time.rst:622 +#: ../../library/time.rst:631 msgid "Values" msgstr "值" -#: ../../library/time.rst:624 +#: ../../library/time.rst:633 msgid "0" msgstr "0" -#: ../../library/time.rst:626 +#: ../../library/time.rst:635 msgid "(for example, 1993)" msgstr "(例如 1993)" -#: ../../library/time.rst:628 +#: ../../library/time.rst:637 msgid "1" msgstr "1" -#: ../../library/time.rst:630 +#: ../../library/time.rst:639 msgid "range [1, 12]" msgstr "範圍 [1, 12]" -#: ../../library/time.rst:632 +#: ../../library/time.rst:641 msgid "2" msgstr "2" -#: ../../library/time.rst:634 +#: ../../library/time.rst:643 msgid "range [1, 31]" msgstr "範圍 [1, 31]" -#: ../../library/time.rst:636 +#: ../../library/time.rst:645 msgid "3" msgstr "3" -#: ../../library/time.rst:638 +#: ../../library/time.rst:647 msgid "range [0, 23]" msgstr "範圍 [0, 23]" -#: ../../library/time.rst:640 +#: ../../library/time.rst:649 msgid "4" msgstr "4" -#: ../../library/time.rst:642 +#: ../../library/time.rst:651 msgid "range [0, 59]" msgstr "範圍 [0, 59]" -#: ../../library/time.rst:644 +#: ../../library/time.rst:653 msgid "5" msgstr "5" -#: ../../library/time.rst:646 +#: ../../library/time.rst:655 msgid "range [0, 61]; see :ref:`Note (2) ` in :func:`strftime`" msgstr "" "範圍 [0, 61];參見 :func:`strftime` 中的\\ :ref:`註釋 (2) `" -#: ../../library/time.rst:648 +#: ../../library/time.rst:657 msgid "6" msgstr "6" -#: ../../library/time.rst:650 +#: ../../library/time.rst:659 msgid "range [0, 6]; Monday is 0" msgstr "範圍 [0, 6];星期一是 0" -#: ../../library/time.rst:652 +#: ../../library/time.rst:661 msgid "7" msgstr "7" -#: ../../library/time.rst:654 +#: ../../library/time.rst:663 msgid "range [1, 366]" msgstr "範圍 [1, 366]" -#: ../../library/time.rst:656 +#: ../../library/time.rst:665 msgid "8" msgstr "8" -#: ../../library/time.rst:658 +#: ../../library/time.rst:667 msgid "0, 1 or -1; see below" msgstr "0、1 或 -1;見下文" -#: ../../library/time.rst:660 ../../library/time.rst:664 +#: ../../library/time.rst:669 ../../library/time.rst:673 msgid "N/A" msgstr "N/A" -#: ../../library/time.rst:662 +#: ../../library/time.rst:671 msgid "abbreviation of timezone name" msgstr "時區名稱的縮寫" -#: ../../library/time.rst:666 +#: ../../library/time.rst:675 msgid "offset east of UTC in seconds" msgstr "UTC 向東的偏移量(以秒為單位)" -#: ../../library/time.rst:668 +#: ../../library/time.rst:677 msgid "" "Note that unlike the C structure, the month value is a range of [1, 12], not " "[0, 11]." msgstr "請注意,與 C 結構不同,月份值的範圍是 [1, 12],而不是 [0, 11]。" -#: ../../library/time.rst:671 +#: ../../library/time.rst:680 msgid "" "In calls to :func:`mktime`, :attr:`tm_isdst` may be set to 1 when daylight " "savings time is in effect, and 0 when it is not. A value of -1 indicates " @@ -1226,28 +1241,28 @@ msgstr "" "在呼叫 :func:`mktime` 時,當日光節約時間生效的時候,:attr:`tm_isdst` 可以設定" "為 1,不生效時設定為 0。值 -1 表示未知是否生效,通常結果會填入正確的狀態。" -#: ../../library/time.rst:675 +#: ../../library/time.rst:684 msgid "" -"When a tuple with an incorrect length is passed to a function expecting a :" -"class:`struct_time`, or having elements of the wrong type, a :exc:" -"`TypeError` is raised." +"When a tuple with an incorrect length is passed to a function expecting " +"a :class:`struct_time`, or having elements of the wrong type, " +"a :exc:`TypeError` is raised." msgstr "" "當一個長度不正確的元組被傳遞給預期得到 :class:`struct_time` 的函式時,或者其" "中有元素型別錯誤時,將引發 :exc:`TypeError`。" -#: ../../library/time.rst:681 +#: ../../library/time.rst:690 msgid "" "Return the time in seconds since the epoch_ as a floating-point number. The " "handling of `leap seconds`_ is platform dependent. On Windows and most Unix " "systems, the leap seconds are not counted towards the time in seconds since " -"the epoch_. This is commonly referred to as `Unix time `_." +"the epoch_. This is commonly referred to as `Unix time `_." msgstr "" "回傳自 epoch_ 起的時間(秒)至今的浮點數。對 `leap seconds`_ 的處理是與平台有" "關的。在 Windows 和大多數 Unix 系統上,閏秒不計入自 epoch_ 起的秒數中。這通常" "被稱為 `Unix 時間 `_。" -#: ../../library/time.rst:687 +#: ../../library/time.rst:696 msgid "" "Note that even though the time is always returned as a floating-point " "number, not all systems provide time with a better precision than 1 second. " @@ -1259,45 +1274,45 @@ msgstr "" "間。雖然此函式通常回傳非遞減的值,但如果在兩次呼叫之間系統時鐘被回調,則它可" "能回傳比之前呼叫更小的值。" -#: ../../library/time.rst:693 +#: ../../library/time.rst:702 msgid "" "The number returned by :func:`.time` may be converted into a more common " -"time format (i.e. year, month, day, hour, etc...) in UTC by passing it to :" -"func:`gmtime` function or in local time by passing it to the :func:" -"`localtime` function. In both cases a :class:`struct_time` object is " -"returned, from which the components of the calendar date may be accessed as " -"attributes." +"time format (i.e. year, month, day, hour, etc...) in UTC by passing it " +"to :func:`gmtime` function or in local time by passing it to " +"the :func:`localtime` function. In both cases a :class:`struct_time` object " +"is returned, from which the components of the calendar date may be accessed " +"as attributes." msgstr "" "由 :func:`.time` 回傳的數字可以通過傳遞給 :func:`gmtime` 函式轉換為 UTC 內更" "常見的時間格式(即年、月、日、小時等)或通過傳遞給 :func:`localtime` 函式轉換" "為當地時間。在這兩種情況下都會回傳一個 :class:`struct_time` 物件,從中可以作" "為屬性存取日曆日期的組成部分。" -#: ../../library/time.rst:702 +#: ../../library/time.rst:711 msgid "On Windows, call ``GetSystemTimeAsFileTime()``." msgstr "在 Windows 上,呼叫 ``GetSystemTimeAsFileTime()``。" -#: ../../library/time.rst:703 +#: ../../library/time.rst:712 msgid "Call ``clock_gettime(CLOCK_REALTIME)`` if available." msgstr "如果可以的話,呼叫 ``clock_gettime(CLOCK_REALTIME)``。" -#: ../../library/time.rst:704 +#: ../../library/time.rst:713 msgid "Otherwise, call ``gettimeofday()``." msgstr "否則,呼叫 ``gettimeofday()``。" -#: ../../library/time.rst:706 +#: ../../library/time.rst:715 msgid "" "Use :func:`time_ns` to avoid the precision loss caused by the :class:`float` " "type." msgstr "使用 :func:`time_ns` 以避免 :class:`float` 型別造成的精確度損失。" -#: ../../library/time.rst:712 +#: ../../library/time.rst:721 msgid "" "Similar to :func:`~time.time` but returns time as an integer number of " "nanoseconds since the epoch_." msgstr "類似於 :func:`~time.time`,但回傳自 epoch_ 起的以奈秒為單位的整數。" -#: ../../library/time.rst:725 +#: ../../library/time.rst:734 msgid "" "Return the value (in fractional seconds) of the sum of the system and user " "CPU time of the current thread. It does not include time elapsed during " @@ -1309,22 +1324,22 @@ msgstr "" "期間經過的時間。根據定義,這是執行緒特定 (thread-specific) 的。回傳值的參照點" "未定義,因此只有同一執行緒中兩次呼叫結果之間的差異才是有效的。" -#: ../../library/time.rst:731 +#: ../../library/time.rst:740 msgid "" -"Use :func:`thread_time_ns` to avoid the precision loss caused by the :class:" -"`float` type." +"Use :func:`thread_time_ns` to avoid the precision loss caused by " +"the :class:`float` type." msgstr "" "使用 :func:`thread_time_ns` 以避免 :class:`float` 型別造成的精確度損失。" -#: ../../library/time.rst:736 +#: ../../library/time.rst:745 msgid "Unix systems supporting ``CLOCK_THREAD_CPUTIME_ID``." msgstr "有支援 ``CLOCK_THREAD_CPUTIME_ID`` 的 Unix 系統。" -#: ../../library/time.rst:743 +#: ../../library/time.rst:752 msgid "Similar to :func:`thread_time` but return time as nanoseconds." msgstr "類似於 :func:`thread_time`,但回傳以奈秒為單位的時間。" -#: ../../library/time.rst:750 +#: ../../library/time.rst:759 msgid "" "Reset the time conversion rules used by the library routines. The " "environment variable :envvar:`TZ` specifies how this is done. It will also " @@ -1341,51 +1356,51 @@ msgstr "" "``daylight``\\ (如果該時區沒有日光節約時間規則,則設定為 0;如果在過去、現在" "或未來的某個時間有日光節約時間規則,則設置為非零的值)。" -#: ../../library/time.rst:762 +#: ../../library/time.rst:771 msgid "" "Although in many cases, changing the :envvar:`TZ` environment variable may " -"affect the output of functions like :func:`localtime` without calling :func:" -"`tzset`, this behavior should not be relied on." +"affect the output of functions like :func:`localtime` without " +"calling :func:`tzset`, this behavior should not be relied on." msgstr "" "雖然在許多情況下,更改 :envvar:`TZ` 環境變數可能會在沒有呼叫 :func:`tzset` 的" "情況下影響 :func:`localtime` 等函式的輸出,但是這種行為是不該被依賴的。" -#: ../../library/time.rst:766 +#: ../../library/time.rst:775 msgid "The :envvar:`TZ` environment variable should contain no whitespace." msgstr ":envvar:`TZ` 環境變數不應包含空格字元。" -#: ../../library/time.rst:768 +#: ../../library/time.rst:777 msgid "" "The standard format of the :envvar:`TZ` environment variable is (whitespace " "added for clarity)::" msgstr "" ":envvar:`TZ` 環境變數的標準格式為(為了清楚表達,中間增加了空格字元): ::" -#: ../../library/time.rst:771 +#: ../../library/time.rst:780 msgid "std offset [dst [offset [,start[/time], end[/time]]]]" msgstr "std offset [dst [offset [,start[/time], end[/time]]]]" -#: ../../library/time.rst:773 +#: ../../library/time.rst:782 msgid "Where the components are:" msgstr "其中各個組成部分為:" -#: ../../library/time.rst:775 +#: ../../library/time.rst:784 msgid "``std`` and ``dst``" msgstr "``std`` 和 ``dst``" -#: ../../library/time.rst:776 +#: ../../library/time.rst:785 msgid "" "Three or more alphanumerics giving the timezone abbreviations. These will be " "propagated into time.tzname" msgstr "" -"三個或更多字母與數字 (alphanumerics) 組成的時區縮寫。這些縮寫會被傳播到 time." -"tzname 中。" +"三個或更多字母與數字 (alphanumerics) 組成的時區縮寫。這些縮寫會被傳播到 " +"time.tzname 中。" -#: ../../library/time.rst:779 +#: ../../library/time.rst:788 msgid "``offset``" msgstr "``offset``" -#: ../../library/time.rst:780 +#: ../../library/time.rst:789 msgid "" "The offset has the form: ``± hh[:mm[:ss]]``. This indicates the value added " "the local time to arrive at UTC. If preceded by a '-', the timezone is east " @@ -1396,22 +1411,22 @@ msgstr "" "果以 '-' 開頭,則表示該時區位於本初子午線以東;否則,位於其西。如果 dst 之後" "沒有偏移量,則假定日光時間比標準時間快一小時。" -#: ../../library/time.rst:785 +#: ../../library/time.rst:794 msgid "``start[/time], end[/time]``" msgstr "``start[/time], end[/time]``" -#: ../../library/time.rst:786 +#: ../../library/time.rst:795 msgid "" "Indicates when to change to and back from DST. The format of the start and " "end dates are one of the following:" msgstr "" "表示何時切換至日光節約時間及何時切換回來。開始和結束日期的格式如以下其一:" -#: ../../library/time.rst:789 +#: ../../library/time.rst:798 msgid ":samp:`J{n}`" msgstr ":samp:`J{n}`" -#: ../../library/time.rst:790 +#: ../../library/time.rst:799 msgid "" "The Julian day *n* (1 <= *n* <= 365). Leap days are not counted, so in all " "years February 28 is day 59 and March 1 is day 60." @@ -1419,22 +1434,22 @@ msgstr "" "儒略日 (Julian day) *n*(1 <= *n* <= 365)。閏日不計算,因此在所有年份中,2 " "月 28 日是第 59 天,3 月 1 日是第 60 天。" -#: ../../library/time.rst:793 +#: ../../library/time.rst:802 msgid ":samp:`{n}`" msgstr ":samp:`{n}`" -#: ../../library/time.rst:794 +#: ../../library/time.rst:803 msgid "" "The zero-based Julian day (0 <= *n* <= 365). Leap days are counted, and it " "is possible to refer to February 29." msgstr "" "從 0 開始的儒略日 (0 <= *n* <= 365)。閏日會計算,因此可以適用至 2 月 29 日。" -#: ../../library/time.rst:797 +#: ../../library/time.rst:806 msgid ":samp:`M{m}.{n}.{d}`" msgstr ":samp:`M{m}.{n}.{d}`" -#: ../../library/time.rst:798 +#: ../../library/time.rst:807 msgid "" "The *d*'th day (0 <= *d* <= 6) of week *n* of month *m* of the year (1 <= " "*n* <= 5, 1 <= *m* <= 12, where week 5 means \"the last *d* day in month " @@ -1445,7 +1460,7 @@ msgstr "" "*m* <= 12,其中 *n* 為 5 表示「該月的最後一個第 *d* 天」,這可能出現在第四或" "第五週)。第 1 週是 *d* 天首次出現的那一週。第零天為星期天。" -#: ../../library/time.rst:804 +#: ../../library/time.rst:813 msgid "" "``time`` has the same format as ``offset`` except that no leading sign ('-' " "or '+') is allowed. The default, if time is not given, is 02:00:00." @@ -1453,7 +1468,7 @@ msgstr "" "``time`` 的格式與 ``offset`` 相同,但不允許出現前導符號('-' 或 '+')。如果未" "指定時間,則預設為 02:00:00。" -#: ../../library/time.rst:809 +#: ../../library/time.rst:818 msgid "" ">>> os.environ['TZ'] = 'EST+05EDT,M4.1.0,M10.5.0'\n" ">>> time.tzset()\n" @@ -1473,7 +1488,7 @@ msgstr "" ">>> time.strftime('%X %x %Z')\n" "'16:08:12 05/08/03 AEST'" -#: ../../library/time.rst:818 +#: ../../library/time.rst:827 msgid "" "On many Unix systems (including \\*BSD, Linux, Solaris, and Darwin), it is " "more convenient to use the system's zoneinfo (:manpage:`tzfile(5)`) " @@ -1490,7 +1505,7 @@ msgstr "" "Eastern'``、``'Australia/Melbourne'``、``'Egypt'`` 或 ``'Europe/" "Amsterdam'``。 ::" -#: ../../library/time.rst:826 +#: ../../library/time.rst:835 msgid "" ">>> os.environ['TZ'] = 'US/Eastern'\n" ">>> time.tzset()\n" @@ -1510,35 +1525,35 @@ msgstr "" ">>> time.tzname\n" "('EET', 'EEST')" -#: ../../library/time.rst:839 +#: ../../library/time.rst:848 msgid "Clock ID Constants" msgstr "時鐘 ID 常數" -#: ../../library/time.rst:841 +#: ../../library/time.rst:850 msgid "" -"These constants are used as parameters for :func:`clock_getres` and :func:" -"`clock_gettime`." +"These constants are used as parameters for :func:`clock_getres` " +"and :func:`clock_gettime`." msgstr "這些常數用作 :func:`clock_getres` 和 :func:`clock_gettime` 的參數。" -#: ../../library/time.rst:846 +#: ../../library/time.rst:855 msgid "" "Identical to :data:`CLOCK_MONOTONIC`, except it also includes any time that " "the system is suspended." msgstr "" "與 :data:`CLOCK_MONOTONIC` 基本相同,不同之處在於它還包括系統暫停的任何時間。" -#: ../../library/time.rst:849 +#: ../../library/time.rst:858 msgid "" "This allows applications to get a suspend-aware monotonic clock without " "having to deal with the complications of :data:`CLOCK_REALTIME`, which may " "have discontinuities if the time is changed using ``settimeofday()`` or " "similar." msgstr "" -"這允許應用程式獲取一個能夠感知暫停的單調時鐘,而無需處理 :data:" -"`CLOCK_REALTIME` 的複雜情況,後者在使用 ``settimeofday()`` 或類似函式更改時間" -"時可能會出現不連續的情況。" +"這允許應用程式獲取一個能夠感知暫停的單調時鐘,而無需處" +"理 :data:`CLOCK_REALTIME` 的複雜情況,後者在使用 ``settimeofday()`` 或類似函" +"式更改時間時可能會出現不連續的情況。" -#: ../../library/time.rst:861 +#: ../../library/time.rst:870 msgid "" "The Solaris OS has a ``CLOCK_HIGHRES`` timer that attempts to use an optimal " "hardware source, and may give close to nanosecond resolution. " @@ -1547,13 +1562,13 @@ msgstr "" "Solaris 作業系統具有 ``CLOCK_HIGHRES`` 計時器,它嘗試使用最佳的硬體資源,並可" "能提供接近奈秒的解析度。``CLOCK_HIGHRES`` 是不可調整且高解析度的時鐘。" -#: ../../library/time.rst:872 +#: ../../library/time.rst:881 msgid "" "Clock that cannot be set and represents monotonic time since some " "unspecified starting point." msgstr "該時鐘無法被設定,其表示自某個未指定起點以來的單調時間。" -#: ../../library/time.rst:882 +#: ../../library/time.rst:891 msgid "" "Similar to :data:`CLOCK_MONOTONIC`, but provides access to a raw hardware-" "based time that is not subject to NTP adjustments." @@ -1561,7 +1576,7 @@ msgstr "" "類似於 :data:`CLOCK_MONOTONIC`,但提供對基於硬體的原始時間的存取,此時間不受 " "NTP 調整的影響。" -#: ../../library/time.rst:891 +#: ../../library/time.rst:900 msgid "" "Similar to :data:`CLOCK_MONOTONIC_RAW`, but reads a value cached by the " "system at context switch and hence has less accuracy." @@ -1569,11 +1584,11 @@ msgstr "" "類似於 :data:`CLOCK_MONOTONIC_RAW`,但讀取的是系統在情境切換時快取的值,因此" "精準度較低。" -#: ../../library/time.rst:901 ../../library/time.rst:910 +#: ../../library/time.rst:910 ../../library/time.rst:919 msgid "High-resolution per-process timer from the CPU." msgstr "來自 CPU 的高解析度每個行程的計時器。" -#: ../../library/time.rst:918 +#: ../../library/time.rst:927 msgid "" "`International Atomic Time `_" @@ -1581,18 +1596,18 @@ msgstr "" "`國際原子時間 `_" -#: ../../library/time.rst:920 +#: ../../library/time.rst:929 msgid "" "The system must have a current leap second table in order for this to give " "the correct answer. PTP or NTP software can maintain a leap second table." msgstr "" "系統必須擁有當前的閏秒表才能給出正確答案。PTP 或 NTP 軟體可以維護閏秒表。" -#: ../../library/time.rst:929 +#: ../../library/time.rst:938 msgid "Thread-specific CPU-time clock." msgstr "執行緒相關的 CPU 時間時鐘。" -#: ../../library/time.rst:938 +#: ../../library/time.rst:947 msgid "" "Time whose absolute value is the time the system has been running and not " "suspended, providing accurate uptime measurement, both absolute and interval." @@ -1600,7 +1615,7 @@ msgstr "" "表示系統運作且無暫停的絕對時間,提供包括絕對時間 (absolute) 和時間區間 " "(interval) 的精確的正常上線時間 (uptime) 測量。" -#: ../../library/time.rst:949 +#: ../../library/time.rst:958 msgid "" "Clock that increments monotonically, tracking the time since an arbitrary " "point, unaffected by frequency or time adjustments and not incremented while " @@ -1609,7 +1624,7 @@ msgstr "" "單調增量的時鐘,從某個任意點開始計時,不受頻率或時間調整影響,並且在系統休眠" "時不增量。" -#: ../../library/time.rst:959 +#: ../../library/time.rst:968 msgid "" "Like :data:`CLOCK_UPTIME_RAW`, but the value is cached by the system at " "context switches and therefore has less accuracy." @@ -1617,23 +1632,23 @@ msgstr "" "類似於 :data:`CLOCK_UPTIME_RAW`,但該值在情境切換時由系統快取,因此精準度較" "低。" -#: ../../library/time.rst:966 +#: ../../library/time.rst:975 msgid "" -"The following constant is the only parameter that can be sent to :func:" -"`clock_settime`." +"The following constant is the only parameter that can be sent " +"to :func:`clock_settime`." msgstr "以下常數是唯一可以傳遞給 :func:`clock_settime` 的參數。" -#: ../../library/time.rst:972 +#: ../../library/time.rst:981 msgid "" "System-wide real-time clock. Setting this clock requires appropriate " "privileges." msgstr "涵蓋整個系統的即時時鐘。設定此時鐘需要適當的權限。" -#: ../../library/time.rst:983 +#: ../../library/time.rst:992 msgid "Timezone Constants" msgstr "時區常數" -#: ../../library/time.rst:987 +#: ../../library/time.rst:996 msgid "" "The offset of the local DST timezone, in seconds west of UTC, if one is " "defined. This is negative if the local DST timezone is east of UTC (as in " @@ -1644,11 +1659,11 @@ msgstr "" "為單位)。若本地 DST 時區位於 UTC 以東(例如包括英國在內的西歐),則此值為負" "值。僅在 ``daylight`` 為非零時使用此值。詳情請參見下方註釋。" -#: ../../library/time.rst:993 +#: ../../library/time.rst:1002 msgid "Nonzero if a DST timezone is defined. See note below." msgstr "如果定義了 DST 時區,則為非零值。詳情請參見下方註釋。" -#: ../../library/time.rst:997 +#: ../../library/time.rst:1006 msgid "" "The offset of the local (non-DST) timezone, in seconds west of UTC (negative " "in most of Western Europe, positive in the US, zero in the UK). See note " @@ -1657,7 +1672,7 @@ msgstr "" "本地(非 DST)時區相對於 UTC 以西的偏移量(以秒為單位),西歐大多數地區為負," "美國為正,英國為零。詳情請參見下方註釋。" -#: ../../library/time.rst:1002 +#: ../../library/time.rst:1011 msgid "" "A tuple of two strings: the first is the name of the local non-DST timezone, " "the second is the name of the local DST timezone. If no DST timezone is " @@ -1666,46 +1681,48 @@ msgstr "" "一個包含兩個字串的元組:第一個是本地非 DST 時區的名稱,第二個是本地 DST 時區" "的名稱。如果沒有定義 DST 時區,則不應使用第二個字串。詳情請參見下方註釋。" -#: ../../library/time.rst:1008 -msgid "" -"For the above Timezone constants (:data:`altzone`, :data:`daylight`, :data:" -"`timezone`, and :data:`tzname`), the value is determined by the timezone " -"rules in effect at module load time or the last time :func:`tzset` is called " -"and may be incorrect for times in the past. It is recommended to use the :" -"attr:`~struct_time.tm_gmtoff` and :attr:`~struct_time.tm_zone` results from :" -"func:`localtime` to obtain timezone information." -msgstr "" -"對於上述時區常數(:data:`altzone`、:data:`daylight`、:data:`timezone` 和 :" -"data:`tzname`),其值由模組載入時或 :func:`tzset` 最後一次被呼叫時的時區規則" -"決定,且過去的時間可能會不準確。建議使用 :func:`localtime` 回傳的 :attr:" -"`~struct_time.tm_gmtoff` 和 :attr:`~struct_time.tm_zone` 來獲取時區資訊。" - #: ../../library/time.rst:1017 +msgid "" +"For the above Timezone constants " +"(:data:`altzone`, :data:`daylight`, :data:`timezone`, and :data:`tzname`), " +"the value is determined by the timezone rules in effect at module load time " +"or the last time :func:`tzset` is called and may be incorrect for times in " +"the past. It is recommended to use the :attr:`~struct_time.tm_gmtoff` " +"and :attr:`~struct_time.tm_zone` results from :func:`localtime` to obtain " +"timezone information." +msgstr "" +"對於上述時區常數(:data:`altzone`、:data:`daylight`、:data:`timezone` " +"和 :data:`tzname`),其值由模組載入時或 :func:`tzset` 最後一次被呼叫時的時區" +"規則決定,且過去的時間可能會不準確。建議使用 :func:`localtime` 回傳" +"的 :attr:`~struct_time.tm_gmtoff` 和 :attr:`~struct_time.tm_zone` 來獲取時區" +"資訊。" + +#: ../../library/time.rst:1026 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/time.rst:1018 +#: ../../library/time.rst:1027 msgid "More object-oriented interface to dates and times." msgstr "更多物件導向的日期和時間介面。" -#: ../../library/time.rst:1020 +#: ../../library/time.rst:1029 msgid "Module :mod:`locale`" msgstr ":mod:`locale` 模組" -#: ../../library/time.rst:1021 +#: ../../library/time.rst:1030 msgid "" "Internationalization services. The locale setting affects the " -"interpretation of many format specifiers in :func:`strftime` and :func:" -"`strptime`." +"interpretation of many format specifiers in :func:`strftime` " +"and :func:`strptime`." msgstr "" "國際化服務。區域設定會影響 :func:`strftime` 和 :func:`strptime` 中許多格式指" "定符號 (format specifiers) 的解譯。" -#: ../../library/time.rst:1024 +#: ../../library/time.rst:1033 msgid "Module :mod:`calendar`" msgstr ":mod:`calendar` 模組" -#: ../../library/time.rst:1025 +#: ../../library/time.rst:1034 msgid "" "General calendar-related functions. :func:`~calendar.timegm` is the " "inverse of :func:`gmtime` from this module." @@ -1713,11 +1730,11 @@ msgstr "" "通用的日曆相關函式。:func:`~calendar.timegm` 是本模組中 :func:`gmtime` 的反函" "式。" -#: ../../library/time.rst:1029 +#: ../../library/time.rst:1038 msgid "Footnotes" msgstr "註解" -#: ../../library/time.rst:1030 +#: ../../library/time.rst:1039 msgid "" "The use of ``%Z`` is now deprecated, but the ``%z`` escape that expands to " "the preferred hour/minute offset is not supported by all ANSI C libraries. " @@ -1762,22 +1779,22 @@ msgid "Daylight Saving Time" msgstr "Daylight Saving Time(日光節約時間)" #: ../../library/time.rst:319 ../../library/time.rst:354 -#: ../../library/time.rst:720 +#: ../../library/time.rst:729 msgid "benchmarking" msgstr "benchmarking(基準測試)" -#: ../../library/time.rst:354 ../../library/time.rst:720 +#: ../../library/time.rst:354 ../../library/time.rst:729 msgid "CPU time" msgstr "CPU time(CPU 時間)" -#: ../../library/time.rst:354 ../../library/time.rst:720 +#: ../../library/time.rst:354 ../../library/time.rst:729 msgid "processor time" msgstr "processor time(處理器時間)" -#: ../../library/time.rst:416 ../../library/time.rst:575 +#: ../../library/time.rst:425 ../../library/time.rst:584 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/time.rst:416 ../../library/time.rst:575 +#: ../../library/time.rst:425 ../../library/time.rst:584 msgid "datetime format" msgstr "datetime format(日期時間格式)" diff --git a/library/tokenize.po b/library/tokenize.po index 32d1dd0754..eed97f5d0f 100644 --- a/library/tokenize.po +++ b/library/tokenize.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-01-20 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -140,40 +140,39 @@ msgstr "" #: ../../library/tokenize.rst:94 msgid "" -"The reconstructed script is returned as a single string. The result is " -"guaranteed to tokenize back to match the input so that the conversion is " -"lossless and round-trips are assured. The guarantee applies only to the " -"token type and token string as the spacing between tokens (column positions) " -"may change." +"The result is guaranteed to tokenize back to match the input so that the " +"conversion is lossless and round-trips are assured. The guarantee applies " +"only to the token type and token string as the spacing between tokens " +"(column positions) may change." msgstr "" -#: ../../library/tokenize.rst:100 +#: ../../library/tokenize.rst:99 msgid "" "It returns bytes, encoded using the :data:`~token.ENCODING` token, which is " "the first token sequence output by :func:`.tokenize`. If there is no " "encoding token in the input, it returns a str instead." msgstr "" -#: ../../library/tokenize.rst:105 +#: ../../library/tokenize.rst:104 msgid "" ":func:`.tokenize` needs to detect the encoding of source files it tokenizes. " "The function it uses to do this is available:" msgstr "" -#: ../../library/tokenize.rst:110 +#: ../../library/tokenize.rst:109 msgid "" "The :func:`detect_encoding` function is used to detect the encoding that " "should be used to decode a Python source file. It requires one argument, " "readline, in the same way as the :func:`.tokenize` generator." msgstr "" -#: ../../library/tokenize.rst:114 +#: ../../library/tokenize.rst:113 msgid "" "It will call readline a maximum of twice, and return the encoding used (as a " "string) and a list of any lines (not decoded from bytes) it has read in." msgstr "" -#: ../../library/tokenize.rst:118 +#: ../../library/tokenize.rst:117 msgid "" "It detects the encoding from the presence of a UTF-8 BOM or an encoding " "cookie as specified in :pep:`263`. If both a BOM and a cookie are present, " @@ -181,31 +180,31 @@ msgid "" "found, ``'utf-8-sig'`` will be returned as an encoding." msgstr "" -#: ../../library/tokenize.rst:123 +#: ../../library/tokenize.rst:122 msgid "" "If no encoding is specified, then the default of ``'utf-8'`` will be " "returned." msgstr "" -#: ../../library/tokenize.rst:126 +#: ../../library/tokenize.rst:125 msgid "" "Use :func:`.open` to open Python source files: it uses :func:" "`detect_encoding` to detect the file encoding." msgstr "" -#: ../../library/tokenize.rst:132 +#: ../../library/tokenize.rst:131 msgid "" "Open a file in read only mode using the encoding detected by :func:" "`detect_encoding`." msgstr "" -#: ../../library/tokenize.rst:139 +#: ../../library/tokenize.rst:138 msgid "" "Raised when either a docstring or expression that may be split over several " "lines is not completed anywhere in the file, for example::" msgstr "" -#: ../../library/tokenize.rst:142 +#: ../../library/tokenize.rst:141 msgid "" "\"\"\"Beginning of\n" "docstring" @@ -213,11 +212,11 @@ msgstr "" "\"\"\"Beginning of\n" "docstring" -#: ../../library/tokenize.rst:145 +#: ../../library/tokenize.rst:144 msgid "or::" msgstr "或是: ::" -#: ../../library/tokenize.rst:147 +#: ../../library/tokenize.rst:146 msgid "" "[1,\n" " 2,\n" @@ -227,49 +226,49 @@ msgstr "" " 2,\n" " 3" -#: ../../library/tokenize.rst:154 +#: ../../library/tokenize.rst:153 msgid "Command-Line Usage" msgstr "" -#: ../../library/tokenize.rst:158 +#: ../../library/tokenize.rst:157 msgid "" "The :mod:`tokenize` module can be executed as a script from the command " "line. It is as simple as:" msgstr "" -#: ../../library/tokenize.rst:161 +#: ../../library/tokenize.rst:160 msgid "python -m tokenize [-e] [filename.py]" msgstr "python -m tokenize [-e] [filename.py]" -#: ../../library/tokenize.rst:165 +#: ../../library/tokenize.rst:164 msgid "The following options are accepted:" msgstr "" -#: ../../library/tokenize.rst:171 +#: ../../library/tokenize.rst:170 msgid "show this help message and exit" msgstr "" -#: ../../library/tokenize.rst:175 +#: ../../library/tokenize.rst:174 msgid "display token names using the exact type" msgstr "" -#: ../../library/tokenize.rst:177 +#: ../../library/tokenize.rst:176 msgid "" "If :file:`filename.py` is specified its contents are tokenized to stdout. " "Otherwise, tokenization is performed on stdin." msgstr "" -#: ../../library/tokenize.rst:181 +#: ../../library/tokenize.rst:180 msgid "Examples" msgstr "範例" -#: ../../library/tokenize.rst:183 +#: ../../library/tokenize.rst:182 msgid "" "Example of a script rewriter that transforms float literals into Decimal " "objects::" msgstr "" -#: ../../library/tokenize.rst:186 +#: ../../library/tokenize.rst:185 msgid "" "from tokenize import tokenize, untokenize, NUMBER, STRING, NAME, OP\n" "from io import BytesIO\n" @@ -312,11 +311,11 @@ msgid "" " return untokenize(result).decode('utf-8')" msgstr "" -#: ../../library/tokenize.rst:225 +#: ../../library/tokenize.rst:224 msgid "Example of tokenizing from the command line. The script::" msgstr "" -#: ../../library/tokenize.rst:227 +#: ../../library/tokenize.rst:226 msgid "" "def say_hello():\n" " print(\"Hello, World!\")\n" @@ -328,7 +327,7 @@ msgstr "" "\n" "say_hello()" -#: ../../library/tokenize.rst:232 +#: ../../library/tokenize.rst:231 msgid "" "will be tokenized to the following output where the first column is the " "range of the line/column coordinates where the token is found, the second " @@ -336,7 +335,7 @@ msgid "" "token (if any)" msgstr "" -#: ../../library/tokenize.rst:236 +#: ../../library/tokenize.rst:235 msgid "" "$ python -m tokenize hello.py\n" "0,0-0,0: ENCODING 'utf-8'\n" @@ -382,12 +381,12 @@ msgstr "" "4,11-4,12: NEWLINE '\\n'\n" "5,0-5,0: ENDMARKER ''" -#: ../../library/tokenize.rst:260 +#: ../../library/tokenize.rst:259 msgid "" "The exact token type names can be displayed using the :option:`-e` option:" msgstr "" -#: ../../library/tokenize.rst:262 +#: ../../library/tokenize.rst:261 msgid "" "$ python -m tokenize -e hello.py\n" "0,0-0,0: ENCODING 'utf-8'\n" @@ -433,13 +432,13 @@ msgstr "" "4,11-4,12: NEWLINE '\\n'\n" "5,0-5,0: ENDMARKER ''" -#: ../../library/tokenize.rst:286 +#: ../../library/tokenize.rst:285 msgid "" "Example of tokenizing a file programmatically, reading unicode strings " "instead of bytes with :func:`generate_tokens`::" msgstr "" -#: ../../library/tokenize.rst:289 +#: ../../library/tokenize.rst:288 msgid "" "import tokenize\n" "\n" @@ -455,11 +454,11 @@ msgstr "" " for token in tokens:\n" " print(token)" -#: ../../library/tokenize.rst:296 +#: ../../library/tokenize.rst:295 msgid "Or reading bytes directly with :func:`.tokenize`::" msgstr "" -#: ../../library/tokenize.rst:298 +#: ../../library/tokenize.rst:297 msgid "" "import tokenize\n" "\n" diff --git a/library/turtle.po b/library/turtle.po index 3a6d1eb7aa..1c8a60bcbc 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-01-15 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1644,8 +1644,8 @@ msgid "" ">>> turtle.heading()\n" "90.0\n" "\n" -"Change angle measurement unit to grad (also known as gon,\n" -"grade, or gradian and equals 1/100-th of the right angle.)\n" +">>> # Change angle measurement unit to grad (also known as gon,\n" +">>> # grade, or gradian and equals 1/100-th of the right angle.)\n" ">>> turtle.degrees(400.0)\n" ">>> turtle.heading()\n" "100.0\n" diff --git a/license.po b/license.po index f56bcc5556..f233a27c8c 100644 --- a/license.po +++ b/license.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-02-02 00:14+0000\n" "PO-Revision-Date: 2022-06-27 09:40+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,49 +31,49 @@ msgstr "軟體沿革" #: ../../license.rst:13 msgid "" "Python was created in the early 1990s by Guido van Rossum at Stichting " -"Mathematisch Centrum (CWI, see https://www.cwi.nl/) in the Netherlands as a " +"Mathematisch Centrum (CWI, see https://www.cwi.nl) in the Netherlands as a " "successor of a language called ABC. Guido remains Python's principal " "author, although it includes many contributions from others." msgstr "" -"Python 是由荷蘭數學和計算機科學研究學會(CWI,見 https://www.cwi.nl/)的 " +"Python 是由荷蘭數學和計算機科學研究學會(CWI,見 https://www.cwi.nl)的 " "Guido van Rossum 於 1990 年代早期所創造,目的是作為一種稱為 ABC 語言的後繼" "者。儘管 Python 包含了許多來自其他人的貢獻,Guido 仍是其主要作者。" #: ../../license.rst:18 msgid "" "In 1995, Guido continued his work on Python at the Corporation for National " -"Research Initiatives (CNRI, see https://www.cnri.reston.va.us/) in Reston, " +"Research Initiatives (CNRI, see https://www.cnri.reston.va.us) in Reston, " "Virginia where he released several versions of the software." msgstr "" -"1995 年,Guido 在維吉尼亞州雷斯頓的國家創新研究公司(CNRI,見 https://www." -"cnri.reston.va.us/)繼續他在 Python 的工作,並在那裡發佈了該軟體的多個版本。" +"1995 年,Guido 在維吉尼亞州雷斯頓的國家創新研究公司(CNRI,見 https://" +"www.cnri.reston.va.us)繼續他在 Python 的工作,並在那裡發佈了該軟體的多個版" +"本。" #: ../../license.rst:22 msgid "" "In May 2000, Guido and the Python core development team moved to BeOpen.com " "to form the BeOpen PythonLabs team. In October of the same year, the " -"PythonLabs team moved to Digital Creations (now Zope Corporation; see " -"https://www.zope.org/). In 2001, the Python Software Foundation (PSF, see " -"https://www.python.org/psf/) was formed, a non-profit organization created " -"specifically to own Python-related Intellectual Property. Zope Corporation " -"is a sponsoring member of the PSF." +"PythonLabs team moved to Digital Creations, which became Zope Corporation. " +"In 2001, the Python Software Foundation (PSF, see https://www.python.org/" +"psf/) was formed, a non-profit organization created specifically to own " +"Python-related Intellectual Property. Zope Corporation was a sponsoring " +"member of the PSF." msgstr "" "2000 年五月,Guido 和 Python 核心開發團隊轉移到 BeOpen.com 並成立了 BeOpen " -"PythonLabs 團隊。同年十月,PythonLabs 團隊轉移到 Digital Creations(現為 " -"Zope Corporation;見 https://www.zope.org/)。2001 年,Python 軟體基金會" -"(PSF,見 https://www.python.org/psf/)成立,這是一個專為擁有 Python 相關的智" -"慧財產權而創立的非營利組織。Zope Corporation 是 PSF 的一個贊助會員。" +"PythonLabs 團隊。同年十月,PythonLabs 團隊轉移到 Digital Creations,後來成為 " +"Zope Corporation。2001 年,Python 軟體基金會(PSF,見 https://www.python.org/" +"psf/)成立,這是一個專為擁有 Python 相關的智慧財產權而創立的非營利組織。Zope " +"Corporation 過去是 PSF 的一個贊助會員。" #: ../../license.rst:30 msgid "" -"All Python releases are Open Source (see https://opensource.org/ for the " -"Open Source Definition). Historically, most, but not all, Python releases " -"have also been GPL-compatible; the table below summarizes the various " -"releases." +"All Python releases are Open Source (see https://opensource.org for the Open " +"Source Definition). Historically, most, but not all, Python releases have " +"also been GPL-compatible; the table below summarizes the various releases." msgstr "" -"所有的 Python 版本都是開源的(有關開源的定義,參閱 https://opensource." -"org/)。歷史上,大多數但非全部的 Python 版本,也是 GPL 相容的;以下表格總結各" -"個版本的差異。" +"所有的 Python 版本都是開源的(有關開源的定義,參閱 https://opensource.org)。" +"歷史上,大多數但非全部的 Python 版本,也是 GPL 相容的;以下表格總結各個版本的" +"差異。" #: ../../license.rst:35 msgid "Release" @@ -92,8 +92,8 @@ msgid "Owner" msgstr "擁有者" #: ../../license.rst:35 -msgid "GPL compatible?" -msgstr "GPL 相容性?" +msgid "GPL-compatible? (1)" +msgstr "GPL 相容性? (1)" #: ../../license.rst:37 msgid "0.9.0 thru 1.2" @@ -145,8 +145,7 @@ msgstr "1.5.2" msgid "2000" msgstr "2000" -#: ../../license.rst:41 ../../license.rst:43 ../../license.rst:45 -#: ../../license.rst:47 +#: ../../license.rst:41 ../../license.rst:43 ../../license.rst:47 msgid "no" msgstr "否" @@ -167,6 +166,10 @@ msgstr "1.6.1" msgid "2001" msgstr "2001" +#: ../../license.rst:45 +msgid "yes (2)" +msgstr "是 (2)" + #: ../../license.rst:47 msgid "2.1" msgstr "2.1" @@ -214,7 +217,7 @@ msgstr "2001 至今" #: ../../license.rst:62 msgid "" -"GPL-compatible doesn't mean that we're distributing Python under the GPL. " +"GPL-compatible doesn't mean that we're distributing Python under the GPL. " "All Python licenses, unlike the GPL, let you distribute a modified version " "without making your changes open source. The GPL-compatible licenses make it " "possible to combine Python with other software that is released under the " @@ -226,50 +229,63 @@ msgstr "" #: ../../license.rst:68 msgid "" +"According to Richard Stallman, 1.6.1 is not GPL-compatible, because its " +"license has a choice of law clause. According to CNRI, however, Stallman's " +"lawyer has told CNRI's lawyer that 1.6.1 is \"not incompatible\" with the " +"GPL." +msgstr "" +"根據 Richard Stallman 的說法,1.6.1 不是 GPL 相容的,因為其授權有一個法律選擇" +"條款。然而根據 CNRI 的說法,Stallman 的律師告訴 CNRI 的律師,1.6.1 與 GPL「不" +"相容」。" + +#: ../../license.rst:72 +msgid "" "Thanks to the many outside volunteers who have worked under Guido's " "direction to make these releases possible." msgstr "" "感謝許多的外部志工,在 Guido 指導下的付出,使得這些版本的發佈成為可能。" -#: ../../license.rst:73 +#: ../../license.rst:77 msgid "Terms and conditions for accessing or otherwise using Python" msgstr "關於存取或以其他方式使用 Python 的合約條款" -#: ../../license.rst:75 +#: ../../license.rst:79 msgid "" -"Python software and documentation are licensed under the :ref:`PSF License " -"Agreement `." -msgstr "Python 軟體和說明文件的授權是基於 :ref:`PSF 授權合約 `。" +"Python software and documentation are licensed under the Python Software " +"Foundation License Version 2." +msgstr "" +"Python 軟體和說明文件的授權是基於 Python 軟體基金會授權第二版 (Python " +"Software Foundation License Version 2)。" -#: ../../license.rst:78 +#: ../../license.rst:82 msgid "" "Starting with Python 3.8.6, examples, recipes, and other code in the " -"documentation are dual licensed under the PSF License Agreement and the :ref:" -"`Zero-Clause BSD license `." +"documentation are dual licensed under the PSF License Version 2 and " +"the :ref:`Zero-Clause BSD license `." msgstr "" "從 Python 3.8.6 開始,說明文件中的範例、程式庫和其他程式碼,是被雙重授權 " -"(dual licensed) 於 PSF 授權合約以及 :ref:`Zero-Clause BSD 授權 `。" +"(dual licensed) 於 PSF 授權第二版以及 :ref:`Zero-Clause BSD 授權 `。" -#: ../../license.rst:82 +#: ../../license.rst:86 msgid "" "Some software incorporated into Python is under different licenses. The " -"licenses are listed with code falling under that license. See :ref:" -"`OtherLicenses` for an incomplete list of these licenses." +"licenses are listed with code falling under that license. " +"See :ref:`OtherLicenses` for an incomplete list of these licenses." msgstr "" "有些被納入 Python 中的軟體是基於不同的授權。這些授權將會與其授權之程式碼一起" "被列出。關於這些授權的不完整清單,請參閱\\ :ref:`OtherLicenses`。" -#: ../../license.rst:90 -msgid "PSF LICENSE AGREEMENT FOR PYTHON |release|" -msgstr "用於 PYTHON |release| 的 PSF 授權合約" - #: ../../license.rst:94 +msgid "PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2" +msgstr "PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2" + +#: ../../license.rst:98 msgid "" "1. This LICENSE AGREEMENT is between the Python Software Foundation " "(\"PSF\"), and\n" " the Individual or Organization (\"Licensee\") accessing and otherwise " -"using Python\n" -" |release| software in source or binary form and its associated " +"using this\n" +" software (\"Python\") in source or binary form and its associated " "documentation.\n" "\n" "2. Subject to the terms and conditions of this License Agreement, PSF " @@ -278,40 +294,34 @@ msgid "" "reproduce,\n" " analyze, test, perform and/or display publicly, prepare derivative " "works,\n" -" distribute, and otherwise use Python |release| alone or in any " -"derivative\n" +" distribute, and otherwise use Python alone or in any derivative\n" " version, provided, however, that PSF's License Agreement and PSF's notice " "of\n" " copyright, i.e., \"Copyright © 2001-2024 Python Software Foundation; All " "Rights\n" -" Reserved\" are retained in Python |release| alone or in any derivative " -"version\n" +" Reserved\" are retained in Python alone or in any derivative version\n" " prepared by Licensee.\n" "\n" "3. In the event Licensee prepares a derivative work that is based on or\n" -" incorporates Python |release| or any part thereof, and wants to make the\n" +" incorporates Python or any part thereof, and wants to make the\n" " derivative work available to others as provided herein, then Licensee " "hereby\n" " agrees to include in any such work a brief summary of the changes made to " -"Python\n" -" |release|.\n" +"Python.\n" "\n" -"4. PSF is making Python |release| available to Licensee on an \"AS IS\" " -"basis.\n" +"4. PSF is making Python available to Licensee on an \"AS IS\" basis.\n" " PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY " "OF\n" " EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY " "REPRESENTATION OR\n" " WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT " "THE\n" -" USE OF PYTHON |release| WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.\n" +" USE OF PYTHON WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.\n" "\n" -"5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON |" -"release|\n" +"5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON\n" " FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT " "OF\n" -" MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON |release|, OR ANY " -"DERIVATIVE\n" +" MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, OR ANY DERIVATIVE\n" " THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.\n" "\n" "6. This License Agreement will automatically terminate upon a material " @@ -328,15 +338,14 @@ msgid "" "or any\n" " third party.\n" "\n" -"8. By copying, installing or otherwise using Python |release|, Licensee " -"agrees\n" +"8. By copying, installing or otherwise using Python, Licensee agrees\n" " to be bound by the terms and conditions of this License Agreement." msgstr "" "1. This LICENSE AGREEMENT is between the Python Software Foundation " "(\"PSF\"), and\n" " the Individual or Organization (\"Licensee\") accessing and otherwise " -"using Python\n" -" |release| software in source or binary form and its associated " +"using this\n" +" software (\"Python\") in source or binary form and its associated " "documentation.\n" "\n" "2. Subject to the terms and conditions of this License Agreement, PSF " @@ -345,40 +354,34 @@ msgstr "" "reproduce,\n" " analyze, test, perform and/or display publicly, prepare derivative " "works,\n" -" distribute, and otherwise use Python |release| alone or in any " -"derivative\n" +" distribute, and otherwise use Python alone or in any derivative\n" " version, provided, however, that PSF's License Agreement and PSF's notice " "of\n" " copyright, i.e., \"Copyright © 2001-2024 Python Software Foundation; All " "Rights\n" -" Reserved\" are retained in Python |release| alone or in any derivative " -"version\n" +" Reserved\" are retained in Python alone or in any derivative version\n" " prepared by Licensee.\n" "\n" "3. In the event Licensee prepares a derivative work that is based on or\n" -" incorporates Python |release| or any part thereof, and wants to make the\n" +" incorporates Python or any part thereof, and wants to make the\n" " derivative work available to others as provided herein, then Licensee " "hereby\n" " agrees to include in any such work a brief summary of the changes made to " -"Python\n" -" |release|.\n" +"Python.\n" "\n" -"4. PSF is making Python |release| available to Licensee on an \"AS IS\" " -"basis.\n" +"4. PSF is making Python available to Licensee on an \"AS IS\" basis.\n" " PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY " "OF\n" " EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY " "REPRESENTATION OR\n" " WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT " "THE\n" -" USE OF PYTHON |release| WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.\n" +" USE OF PYTHON WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.\n" "\n" -"5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON |" -"release|\n" +"5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON\n" " FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT " "OF\n" -" MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON |release|, OR ANY " -"DERIVATIVE\n" +" MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, OR ANY DERIVATIVE\n" " THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.\n" "\n" "6. This License Agreement will automatically terminate upon a material " @@ -395,19 +398,18 @@ msgstr "" "or any\n" " third party.\n" "\n" -"8. By copying, installing or otherwise using Python |release|, Licensee " -"agrees\n" +"8. By copying, installing or otherwise using Python, Licensee agrees\n" " to be bound by the terms and conditions of this License Agreement." -#: ../../license.rst:138 +#: ../../license.rst:141 msgid "BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0" -msgstr "用於 PYTHON 2.0 的 BEOPEN.COM 授權合約" +msgstr "BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0" -#: ../../license.rst:140 +#: ../../license.rst:143 msgid "BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1" -msgstr "BEOPEN PYTHON 開源授權合約第 1 版" +msgstr "BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1" -#: ../../license.rst:144 +#: ../../license.rst:147 msgid "" "1. This LICENSE AGREEMENT is between BeOpen.com (\"BeOpen\"), having an " "office at\n" @@ -535,11 +537,11 @@ msgstr "" "to be\n" " bound by the terms and conditions of this License Agreement." -#: ../../license.rst:185 +#: ../../license.rst:188 msgid "CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1" -msgstr "用於 PYTHON 1.6.1 的 CNRI 授權合約" +msgstr "CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1" -#: ../../license.rst:189 +#: ../../license.rst:192 msgid "" "1. This LICENSE AGREEMENT is between the Corporation for National Research\n" " Initiatives, having an office at 1895 Preston White Drive, Reston, VA " @@ -573,7 +575,7 @@ msgid "" "handle):\n" " 1895.22/1013. This Agreement may also be obtained from a proxy server on " "the\n" -" internet using the following URL: http://hdl.handle.net/1895.22/1013.\"\n" +" internet using the following URL: http://hdl.handle.net/1895.22/1013\".\n" "\n" "3. In the event Licensee prepares a derivative work that is based on or\n" " incorporates Python 1.6.1 or any part thereof, and wants to make the " @@ -670,7 +672,7 @@ msgstr "" "handle):\n" " 1895.22/1013. This Agreement may also be obtained from a proxy server on " "the\n" -" internet using the following URL: http://hdl.handle.net/1895.22/1013.\"\n" +" internet using the following URL: http://hdl.handle.net/1895.22/1013\".\n" "\n" "3. In the event Licensee prepares a derivative work that is based on or\n" " incorporates Python 1.6.1 or any part thereof, and wants to make the " @@ -735,11 +737,11 @@ msgstr "" "and\n" " conditions of this License Agreement." -#: ../../license.rst:250 +#: ../../license.rst:253 msgid "CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2" -msgstr "用於 PYTHON 0.9.0 至 1.2 的 CWI 授權合約" +msgstr "CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2" -#: ../../license.rst:254 +#: ../../license.rst:257 msgid "" "Copyright © 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, The\n" "Netherlands. All rights reserved.\n" @@ -797,11 +799,11 @@ msgstr "" "ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\n" "SOFTWARE." -#: ../../license.rst:277 -msgid "ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON |release| DOCUMENTATION" -msgstr "用於 PYTHON |release| 說明文件內程式碼的 ZERO-CLAUSE BSD 授權" +#: ../../license.rst:280 +msgid "ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION" +msgstr "ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION" -#: ../../license.rst:281 +#: ../../license.rst:284 msgid "" "Permission to use, copy, modify, and/or distribute this software for any\n" "purpose with or without fee is hereby granted.\n" @@ -831,11 +833,11 @@ msgstr "" "OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n" "PERFORMANCE OF THIS SOFTWARE." -#: ../../license.rst:296 +#: ../../license.rst:299 msgid "Licenses and Acknowledgements for Incorporated Software" msgstr "被收錄軟體的授權與致謝" -#: ../../license.rst:298 +#: ../../license.rst:301 msgid "" "This section is an incomplete, but growing list of licenses and " "acknowledgements for third-party software incorporated in the Python " @@ -844,22 +846,22 @@ msgstr "" "本節是一個不完整但持續增加的授權與致謝清單,對象是在 Python 發佈版本中所收錄" "的第三方軟體。" -#: ../../license.rst:303 +#: ../../license.rst:306 msgid "Mersenne Twister" msgstr "Mersenne Twister" -#: ../../license.rst:305 +#: ../../license.rst:308 msgid "" "The :mod:`!_random` C extension underlying the :mod:`random` module includes " "code based on a download from http://www.math.sci.hiroshima-u.ac.jp/~m-mat/" "MT/MT2002/emt19937ar.html. The following are the verbatim comments from the " "original code::" msgstr "" -":mod:`random` 模組底下的 :mod:`!_random` C 擴充程式包含了以 http://www.math." -"sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html 的下載內容為基礎的程式" -"碼。以下是原始程式碼的完整聲明: ::" +":mod:`random` 模組底下的 :mod:`!_random` C 擴充程式包含了以 http://" +"www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html 的下載內容為" +"基礎的程式碼。以下是原始程式碼的完整聲明: ::" -#: ../../license.rst:310 +#: ../../license.rst:313 msgid "" "A C-program for MT19937, with initialization improved 2002/1/26.\n" "Coded by Takuji Nishimura and Makoto Matsumoto.\n" @@ -945,21 +947,21 @@ msgstr "" "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html\n" "email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)" -#: ../../license.rst:353 +#: ../../license.rst:356 msgid "Sockets" msgstr "Sockets" -#: ../../license.rst:355 +#: ../../license.rst:358 msgid "" -"The :mod:`socket` module uses the functions, :c:func:`!getaddrinfo`, and :c:" -"func:`!getnameinfo`, which are coded in separate source files from the WIDE " -"Project, https://www.wide.ad.jp/. ::" +"The :mod:`socket` module uses the functions, :c:func:`!getaddrinfo`, " +"and :c:func:`!getnameinfo`, which are coded in separate source files from " +"the WIDE Project, https://www.wide.ad.jp/. ::" msgstr "" ":mod:`socket` 模組使用 :c:func:`!getaddrinfo` 和 :c:func:`!getnameinfo` 函" "式,它們在 WIDE 專案(https://www.wide.ad.jp/)內,於不同的原始檔案中被編" "碼: ::" -#: ../../license.rst:359 +#: ../../license.rst:362 msgid "" "Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.\n" "All rights reserved.\n" @@ -976,7 +978,7 @@ msgid "" " may be used to endorse or promote products derived from this software\n" " without specific prior written permission.\n" "\n" -"THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND\n" +"THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS \"AS IS\" AND\n" "ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n" "ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE\n" @@ -1003,7 +1005,7 @@ msgstr "" " may be used to endorse or promote products derived from this software\n" " without specific prior written permission.\n" "\n" -"THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND\n" +"THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS \"AS IS\" AND\n" "ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n" "ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE\n" @@ -1015,11 +1017,11 @@ msgstr "" "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n" "SUCH DAMAGE." -#: ../../license.rst:388 +#: ../../license.rst:391 msgid "Asynchronous socket services" msgstr "非同步 socket 服務" -#: ../../license.rst:390 +#: ../../license.rst:393 msgid "" "The :mod:`!test.support.asynchat` and :mod:`!test.support.asyncore` modules " "contain the following notice::" @@ -1027,7 +1029,7 @@ msgstr "" ":mod:`!test.support.asynchat` 和 :mod:`!test.support.asyncore` 模組包含以下聲" "明: ::" -#: ../../license.rst:393 +#: ../../license.rst:396 msgid "" "Copyright 1996 by Sam Rushing\n" "\n" @@ -1071,15 +1073,15 @@ msgstr "" "NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN\n" "CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE." -#: ../../license.rst:416 +#: ../../license.rst:419 msgid "Cookie management" msgstr "Cookie 管理" -#: ../../license.rst:418 +#: ../../license.rst:421 msgid "The :mod:`http.cookies` module contains the following notice::" msgstr ":mod:`http.cookies` 模組包含以下聲明: ::" -#: ../../license.rst:420 +#: ../../license.rst:423 msgid "" "Copyright 2000 by Timothy O'Malley \n" "\n" @@ -1125,15 +1127,15 @@ msgstr "" "ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n" "PERFORMANCE OF THIS SOFTWARE." -#: ../../license.rst:444 +#: ../../license.rst:447 msgid "Execution tracing" msgstr "執行追蹤" -#: ../../license.rst:446 +#: ../../license.rst:449 msgid "The :mod:`trace` module contains the following notice::" msgstr ":mod:`trace` 模組包含以下聲明: ::" -#: ../../license.rst:448 +#: ../../license.rst:451 msgid "" "portions copyright 2001, Autonomous Zones Industries, Inc., all rights...\n" "err... reserved and offered to the public under the terms of the\n" @@ -1189,15 +1191,15 @@ msgstr "" "Bioreason or Mojam Media be used in advertising or publicity pertaining to\n" "distribution of the software without specific, written prior permission." -#: ../../license.rst:477 +#: ../../license.rst:480 msgid "UUencode and UUdecode functions" msgstr "UUencode 與 UUdecode 函式" -#: ../../license.rst:479 +#: ../../license.rst:482 msgid "The ``uu`` codec contains the following notice::" msgstr "``uu`` 編解碼器包含以下聲明: ::" -#: ../../license.rst:481 +#: ../../license.rst:484 msgid "" "Copyright 1994 by Lance Ellinghouse\n" "Cathedral City, California Republic, United States of America.\n" @@ -1247,15 +1249,15 @@ msgstr "" " version is still 5 times faster, though.\n" "- Arguments more compliant with Python standard" -#: ../../license.rst:507 +#: ../../license.rst:510 msgid "XML Remote Procedure Calls" msgstr "XML 遠端程序呼叫" -#: ../../license.rst:509 +#: ../../license.rst:512 msgid "The :mod:`xmlrpc.client` module contains the following notice::" msgstr ":mod:`xmlrpc.client` 模組包含以下聲明: ::" -#: ../../license.rst:511 +#: ../../license.rst:514 msgid "" " The XML-RPC client interface is\n" "\n" @@ -1311,15 +1313,15 @@ msgstr "" "ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE\n" "OF THIS SOFTWARE." -#: ../../license.rst:540 +#: ../../license.rst:543 msgid "test_epoll" msgstr "test_epoll" -#: ../../license.rst:542 +#: ../../license.rst:545 msgid "The :mod:`!test.test_epoll` module contains the following notice::" msgstr ":mod:`!test.test_epoll` 模組包含以下聲明: ::" -#: ../../license.rst:544 +#: ../../license.rst:547 msgid "" "Copyright (c) 2001-2006 Twisted Matrix Laboratories.\n" "\n" @@ -1363,17 +1365,17 @@ msgstr "" "OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n" "WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." -#: ../../license.rst:566 +#: ../../license.rst:569 msgid "Select kqueue" msgstr "Select kqueue" -#: ../../license.rst:568 +#: ../../license.rst:571 msgid "" "The :mod:`select` module contains the following notice for the kqueue " "interface::" msgstr ":mod:`select` 模組對於 kqueue 介面包含以下聲明: ::" -#: ../../license.rst:571 +#: ../../license.rst:574 msgid "" "Copyright (c) 2000 Doug White, 2006 James Knight, 2007 Christian Heimes\n" "All rights reserved.\n" @@ -1387,7 +1389,7 @@ msgid "" " notice, this list of conditions and the following disclaimer in the\n" " documentation and/or other materials provided with the distribution.\n" "\n" -"THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n" +"THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS \"AS IS\" AND\n" "ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n" "ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n" @@ -1411,7 +1413,7 @@ msgstr "" " notice, this list of conditions and the following disclaimer in the\n" " documentation and/or other materials provided with the distribution.\n" "\n" -"THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n" +"THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS \"AS IS\" AND\n" "ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n" "ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n" @@ -1423,11 +1425,11 @@ msgstr "" "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n" "SUCH DAMAGE." -#: ../../license.rst:597 +#: ../../license.rst:600 msgid "SipHash24" msgstr "SipHash24" -#: ../../license.rst:599 +#: ../../license.rst:602 msgid "" "The file :file:`Python/pyhash.c` contains Marek Majkowski' implementation of " "Dan Bernstein's SipHash24 algorithm. It contains the following note::" @@ -1435,7 +1437,7 @@ msgstr "" ":file:`Python/pyhash.c` 檔案包含 Marek Majkowski' 基於 Dan Bernstein 的 " "SipHash24 演算法的實作。它包含以下聲明: ::" -#: ../../license.rst:602 +#: ../../license.rst:605 msgid "" "\n" "Copyright (c) 2013 Marek Majkowski \n" @@ -1487,25 +1489,25 @@ msgstr "" " djb (supercop/crypto_auth/siphash24/little2)\n" " Jean-Philippe Aumasson (https://131002.net/siphash/siphash24.c)" -#: ../../license.rst:626 +#: ../../license.rst:629 msgid "strtod and dtoa" msgstr "strtod 與 dtoa" -#: ../../license.rst:628 +#: ../../license.rst:631 msgid "" "The file :file:`Python/dtoa.c`, which supplies C functions dtoa and strtod " "for conversion of C doubles to and from strings, is derived from the file of " -"the same name by David M. Gay, currently available from https://web.archive." -"org/web/20220517033456/http://www.netlib.org/fp/dtoa.c. The original file, " -"as retrieved on March 16, 2009, contains the following copyright and " -"licensing notice::" +"the same name by David M. Gay, currently available from https://" +"web.archive.org/web/20220517033456/http://www.netlib.org/fp/dtoa.c. The " +"original file, as retrieved on March 16, 2009, contains the following " +"copyright and licensing notice::" msgstr "" ":file:`Python/dtoa.c` 檔案提供了 C 的 dtoa 和 strtod 函式,用於將 C 的雙精度" "浮點數和字串互相轉換。該檔案是衍生自 David M. Gay 建立的同名檔案,後者現在可" "以從 https://web.archive.org/web/20220517033456/http://www.netlib.org/fp/" "dtoa.c 下載。於 2009 年 3 月 16 日所檢索的原始檔案包含以下版權與授權聲明: ::" -#: ../../license.rst:635 +#: ../../license.rst:638 msgid "" "/****************************************************************\n" " *\n" @@ -1547,12 +1549,11 @@ msgstr "" " *\n" " ***************************************************************/" -#: ../../license.rst:656 +#: ../../license.rst:659 msgid "OpenSSL" msgstr "OpenSSL" -#: ../../license.rst:658 -#, fuzzy +#: ../../license.rst:661 msgid "" "The modules :mod:`hashlib`, :mod:`posix` and :mod:`ssl` use the OpenSSL " "library for added performance if made available by the operating system. " @@ -1561,13 +1562,13 @@ msgid "" "For the OpenSSL 3.0 release, and later releases derived from that, the " "Apache License v2 applies::" msgstr "" -"如果 OpenSSL 函式庫可被作業系統使用,則 :mod:`hashlib`、:mod:`posix`、:mod:" -"`ssl`、:mod:`crypt` 模組會使用它來提升效能。此外,因為 Windows 和 macOS 的 " -"Python 安裝程式可能包含 OpenSSL 函式庫的副本,所以我們也在此收錄 OpenSSL 授權" -"的副本。對於 OpenSSL 3.0 版本以及由此衍生的更新版本則適用 Apache 許可證 " -"v2: ::" +"如果 OpenSSL 函式庫可被作業系統使用," +"則 :mod:`hashlib`、:mod:`posix`、:mod:`ssl` 模組會使用它來提升效能。此外,因" +"為 Windows 和 macOS 的 Python 安裝程式可能包含 OpenSSL 函式庫的副本,所以我們" +"也在此收錄 OpenSSL 授權的副本。對於 OpenSSL 3.0 版本以及由此衍生的更新版本則" +"適用 Apache 許可證 v2: ::" -#: ../../license.rst:666 +#: ../../license.rst:669 msgid "" " Apache License\n" " Version 2.0, January 2004\n" @@ -1923,11 +1924,11 @@ msgstr "" "\n" "END OF TERMS AND CONDITIONS" -#: ../../license.rst:845 +#: ../../license.rst:848 msgid "expat" msgstr "expat" -#: ../../license.rst:847 +#: ../../license.rst:850 msgid "" "The :mod:`pyexpat ` extension is built using an included " "copy of the expat sources unless the build is configured ``--with-system-" @@ -1936,7 +1937,7 @@ msgstr "" "除非在建置 :mod:`pyexpat ` 擴充時設定為 ``--with-system-" "expat``,否則該擴充會用一個內含 expat 原始碼的副本來建置: ::" -#: ../../license.rst:850 +#: ../../license.rst:853 msgid "" "Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd\n" " and Clark Cooper\n" @@ -1982,11 +1983,11 @@ msgstr "" "TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n" "SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." -#: ../../license.rst:874 +#: ../../license.rst:877 msgid "libffi" msgstr "libffi" -#: ../../license.rst:876 +#: ../../license.rst:879 msgid "" "The :mod:`!_ctypes` C extension underlying the :mod:`ctypes` module is built " "using an included copy of the libffi sources unless the build is configured " @@ -1995,13 +1996,13 @@ msgstr "" "除非在建置 :mod:`_ctypes` 模組底下 :mod:`!_ctypes` 擴充程式時設定為 ``--with-" "system-libffi``,否則該擴充會用一個內含 libffi 原始碼的副本來建置: ::" -#: ../../license.rst:880 +#: ../../license.rst:883 msgid "" "Copyright (c) 1996-2008 Red Hat, Inc and others.\n" "\n" "Permission is hereby granted, free of charge, to any person obtaining\n" "a copy of this software and associated documentation files (the\n" -"``Software''), to deal in the Software without restriction, including\n" +"\"Software\"), to deal in the Software without restriction, including\n" "without limitation the rights to use, copy, modify, merge, publish,\n" "distribute, sublicense, and/or sell copies of the Software, and to\n" "permit persons to whom the Software is furnished to do so, subject to\n" @@ -2010,7 +2011,7 @@ msgid "" "The above copyright notice and this permission notice shall be included\n" "in all copies or substantial portions of the Software.\n" "\n" -"THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,\n" +"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n" "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n" "NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n" @@ -2023,7 +2024,7 @@ msgstr "" "\n" "Permission is hereby granted, free of charge, to any person obtaining\n" "a copy of this software and associated documentation files (the\n" -"``Software''), to deal in the Software without restriction, including\n" +"\"Software\"), to deal in the Software without restriction, including\n" "without limitation the rights to use, copy, modify, merge, publish,\n" "distribute, sublicense, and/or sell copies of the Software, and to\n" "permit persons to whom the Software is furnished to do so, subject to\n" @@ -2032,7 +2033,7 @@ msgstr "" "The above copyright notice and this permission notice shall be included\n" "in all copies or substantial portions of the Software.\n" "\n" -"THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,\n" +"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n" "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n" "NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n" @@ -2041,11 +2042,11 @@ msgstr "" "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n" "DEALINGS IN THE SOFTWARE." -#: ../../license.rst:904 +#: ../../license.rst:907 msgid "zlib" msgstr "zlib" -#: ../../license.rst:906 +#: ../../license.rst:909 msgid "" "The :mod:`zlib` extension is built using an included copy of the zlib " "sources if the zlib version found on the system is too old to be used for " @@ -2054,7 +2055,7 @@ msgstr "" "如果在系統上找到的 zlib 版本太舊以致於無法用於建置 :mod:`zlib` 擴充,則該擴充" "會用一個內含 zlib 原始碼的副本來建置: ::" -#: ../../license.rst:910 +#: ../../license.rst:913 msgid "" "Copyright (C) 1995-2011 Jean-loup Gailly and Mark Adler\n" "\n" @@ -2102,11 +2103,11 @@ msgstr "" "Jean-loup Gailly Mark Adler\n" "jloup@gzip.org madler@alumni.caltech.edu" -#: ../../license.rst:935 +#: ../../license.rst:938 msgid "cfuhash" msgstr "cfuhash" -#: ../../license.rst:937 +#: ../../license.rst:940 msgid "" "The implementation of the hash table used by the :mod:`tracemalloc` is based " "on the cfuhash project::" @@ -2114,7 +2115,7 @@ msgstr "" ":mod:`tracemalloc` 使用的雜湊表 (hash table) 實作,是以 cfuhash 專案為基" "礎: ::" -#: ../../license.rst:940 +#: ../../license.rst:943 msgid "" "Copyright (c) 2005 Don Owens\n" "All rights reserved.\n" @@ -2184,11 +2185,11 @@ msgstr "" "ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n" "OF THE POSSIBILITY OF SUCH DAMAGE." -#: ../../license.rst:976 +#: ../../license.rst:979 msgid "libmpdec" msgstr "libmpdec" -#: ../../license.rst:978 +#: ../../license.rst:981 msgid "" "The :mod:`!_decimal` C extension underlying the :mod:`decimal` module is " "built using an included copy of the libmpdec library unless the build is " @@ -2198,7 +2199,7 @@ msgstr "" "with-system-libmpdec``,否則該模組會用一個內含 libmpdec 函式庫的副本來建" "置: ::" -#: ../../license.rst:982 +#: ../../license.rst:985 msgid "" "Copyright (c) 2008-2020 Stefan Krah. All rights reserved.\n" "\n" @@ -2250,11 +2251,11 @@ msgstr "" "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n" "SUCH DAMAGE." -#: ../../license.rst:1009 +#: ../../license.rst:1012 msgid "W3C C14N test suite" msgstr "W3C C14N 測試套件" -#: ../../license.rst:1011 +#: ../../license.rst:1014 msgid "" "The C14N 2.0 test suite in the :mod:`test` package (``Lib/test/xmltestdata/" "c14n-20/``) was retrieved from the W3C website at https://www.w3.org/TR/xml-" @@ -2264,7 +2265,7 @@ msgstr "" "是從 W3C 網站 https://www.w3.org/TR/xml-c14n2-testcases/ 被檢索,且是基於 3-" "clause BSD 授權被發佈: ::" -#: ../../license.rst:1016 +#: ../../license.rst:1019 msgid "" "Copyright (c) 2013 W3C(R) (MIT, ERCIM, Keio, Beihang),\n" "All Rights Reserved.\n" @@ -2322,15 +2323,15 @@ msgstr "" "(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n" "OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -#: ../../license.rst:1048 +#: ../../license.rst:1051 msgid "mimalloc" msgstr "mimalloc" -#: ../../license.rst:1050 +#: ../../license.rst:1053 msgid "MIT License::" -msgstr "" +msgstr "MIT 授權: ::" -#: ../../license.rst:1052 +#: ../../license.rst:1055 msgid "" "Copyright (c) 2018-2021 Microsoft Corporation, Daan Leijen\n" "\n" @@ -2386,11 +2387,11 @@ msgstr "" "THE\n" "SOFTWARE." -#: ../../license.rst:1074 +#: ../../license.rst:1077 msgid "asyncio" msgstr "asyncio" -#: ../../license.rst:1076 +#: ../../license.rst:1079 msgid "" "Parts of the :mod:`asyncio` module are incorporated from `uvloop 0.16 " "`_, which is distributed " @@ -2399,7 +2400,7 @@ msgstr "" ":mod:`asyncio` 模組的部分內容是從 `uvloop 0.16 `_ 中收錄過來,其基於 MIT 授權來發佈: ::" -#: ../../license.rst:1080 +#: ../../license.rst:1083 msgid "" "Copyright (c) 2015-2021 MagicStack Inc. http://magic.io\n" "\n" @@ -2443,19 +2444,19 @@ msgstr "" "OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n" "WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." -#: ../../license.rst:1103 +#: ../../license.rst:1106 msgid "Global Unbounded Sequences (GUS)" msgstr "" -#: ../../license.rst:1105 +#: ../../license.rst:1108 msgid "" "The file :file:`Python/qsbr.c` is adapted from FreeBSD's \"Global Unbounded " -"Sequences\" safe memory reclamation scheme in `subr_smr.c `_. The file is " +"Sequences\" safe memory reclamation scheme in `subr_smr.c `_. The file is " "distributed under the 2-Clause BSD License::" msgstr "" -#: ../../license.rst:1110 +#: ../../license.rst:1113 msgid "" "Copyright (c) 2019,2020 Jeffrey Roberson \n" "\n" @@ -2469,7 +2470,7 @@ msgid "" " notice, this list of conditions and the following disclaimer in the\n" " documentation and/or other materials provided with the distribution.\n" "\n" -"THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n" +"THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR\n" "IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n" "OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n" "IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n" @@ -2492,7 +2493,7 @@ msgstr "" " notice, this list of conditions and the following disclaimer in the\n" " documentation and/or other materials provided with the distribution.\n" "\n" -"THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n" +"THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR\n" "IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n" "OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n" "IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index d5a74fad17..d887991a95 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-29 11:18+0000\n" +"POT-Creation-Date: 2025-01-22 00:13+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-" @@ -610,8 +610,8 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:526 -#: ../../reference/compound_stmts.rst:1547 -#: ../../reference/compound_stmts.rst:1588 +#: ../../reference/compound_stmts.rst:1549 +#: ../../reference/compound_stmts.rst:1590 msgid "The following code::" msgstr "以下程式碼: ::" @@ -625,7 +625,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:531 #: ../../reference/compound_stmts.rst:556 -#: ../../reference/compound_stmts.rst:1593 +#: ../../reference/compound_stmts.rst:1595 msgid "is semantically equivalent to::" msgstr "在語義上等同於: ::" @@ -1543,7 +1543,7 @@ msgid ":class:`int`" msgstr ":class:`int`" #: ../../reference/compound_stmts.rst:1160 -#: ../../reference/compound_stmts.rst:1878 +#: ../../reference/compound_stmts.rst:1880 msgid ":class:`list`" msgstr ":class:`list`" @@ -1556,7 +1556,7 @@ msgid ":class:`str`" msgstr ":class:`str`" #: ../../reference/compound_stmts.rst:1163 -#: ../../reference/compound_stmts.rst:1881 +#: ../../reference/compound_stmts.rst:1883 msgid ":class:`tuple`" msgstr ":class:`tuple`" @@ -1606,7 +1606,7 @@ msgid "" "ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1228 +#: ../../reference/compound_stmts.rst:1230 msgid "" "A function definition is an executable statement. Its execution binds the " "function name in the current local namespace to a function object (a wrapper " @@ -1615,13 +1615,13 @@ msgid "" "used when the function is called." msgstr "" -#: ../../reference/compound_stmts.rst:1234 +#: ../../reference/compound_stmts.rst:1236 msgid "" "The function definition does not execute the function body; this gets " "executed only when the function is called. [#]_" msgstr "" -#: ../../reference/compound_stmts.rst:1240 +#: ../../reference/compound_stmts.rst:1242 msgid "" "A function definition may be wrapped by one or more :term:`decorator` " "expressions. Decorator expressions are evaluated when the function is " @@ -1632,7 +1632,7 @@ msgid "" "example, the following code ::" msgstr "" -#: ../../reference/compound_stmts.rst:1247 +#: ../../reference/compound_stmts.rst:1249 msgid "" "@f1(arg)\n" "@f2\n" @@ -1642,12 +1642,12 @@ msgstr "" "@f2\n" "def func(): pass" -#: ../../reference/compound_stmts.rst:1251 -#: ../../reference/compound_stmts.rst:1446 +#: ../../reference/compound_stmts.rst:1253 +#: ../../reference/compound_stmts.rst:1448 msgid "is roughly equivalent to ::" msgstr "大致等價於: ::" -#: ../../reference/compound_stmts.rst:1253 +#: ../../reference/compound_stmts.rst:1255 msgid "" "def func(): pass\n" "func = f1(arg)(f2(func))" @@ -1655,20 +1655,20 @@ msgstr "" "def func(): pass\n" "func = f1(arg)(f2(func))" -#: ../../reference/compound_stmts.rst:1256 +#: ../../reference/compound_stmts.rst:1258 msgid "" "except that the original function is not temporarily bound to the name " "``func``." msgstr "" -#: ../../reference/compound_stmts.rst:1258 +#: ../../reference/compound_stmts.rst:1260 msgid "" "Functions may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1263 +#: ../../reference/compound_stmts.rst:1265 msgid "" "A list of :ref:`type parameters ` may be given in square " "brackets between the function's name and the opening parenthesis for its " @@ -1678,12 +1678,12 @@ msgid "" "functions` for more." msgstr "" -#: ../../reference/compound_stmts.rst:1270 -#: ../../reference/compound_stmts.rst:1465 +#: ../../reference/compound_stmts.rst:1272 +#: ../../reference/compound_stmts.rst:1467 msgid "Type parameter lists are new in Python 3.12." msgstr "" -#: ../../reference/compound_stmts.rst:1278 +#: ../../reference/compound_stmts.rst:1280 msgid "" "When one or more :term:`parameters ` have the form *parameter* " "``=`` *expression*, the function is said to have \"default parameter values." @@ -1694,7 +1694,7 @@ msgid "" "syntactic restriction that is not expressed by the grammar." msgstr "" -#: ../../reference/compound_stmts.rst:1286 +#: ../../reference/compound_stmts.rst:1288 msgid "" "**Default parameter values are evaluated from left to right when the " "function definition is executed.** This means that the expression is " @@ -1707,7 +1707,7 @@ msgid "" "the default, and explicitly test for it in the body of the function, e.g.::" msgstr "" -#: ../../reference/compound_stmts.rst:1296 +#: ../../reference/compound_stmts.rst:1298 msgid "" "def whats_on_the_telly(penguin=None):\n" " if penguin is None:\n" @@ -1716,7 +1716,7 @@ msgid "" " return penguin" msgstr "" -#: ../../reference/compound_stmts.rst:1307 +#: ../../reference/compound_stmts.rst:1309 msgid "" "Function call semantics are described in more detail in section :ref:" "`calls`. A function call always assigns values to all parameters mentioned " @@ -1732,13 +1732,13 @@ msgid "" "positional arguments." msgstr "" -#: ../../reference/compound_stmts.rst:1319 +#: ../../reference/compound_stmts.rst:1321 msgid "" "The ``/`` function parameter syntax may be used to indicate positional-only " "parameters. See :pep:`570` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1328 +#: ../../reference/compound_stmts.rst:1330 msgid "" "Parameters may have an :term:`annotation ` of the form " "\"``: expression``\" following the parameter name. Any parameter may have " @@ -1757,13 +1757,13 @@ msgid "" "in the source code." msgstr "" -#: ../../reference/compound_stmts.rst:1342 +#: ../../reference/compound_stmts.rst:1344 msgid "" "Parameters of the form \"``*identifier``\" may have an annotation \"``: " "*expression``\". See :pep:`646`." msgstr "" -#: ../../reference/compound_stmts.rst:1348 +#: ../../reference/compound_stmts.rst:1350 msgid "" "It is also possible to create anonymous functions (functions not bound to a " "name), for immediate use in expressions. This uses lambda expressions, " @@ -1775,7 +1775,7 @@ msgid "" "execution of multiple statements and annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1356 +#: ../../reference/compound_stmts.rst:1358 msgid "" "**Programmer's note:** Functions are first-class objects. A \"``def``\" " "statement executed inside a function definition defines a local function " @@ -1784,61 +1784,61 @@ msgid "" "See section :ref:`naming` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1364 +#: ../../reference/compound_stmts.rst:1366 msgid ":pep:`3107` - Function Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1365 +#: ../../reference/compound_stmts.rst:1367 msgid "The original specification for function annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:1369 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/compound_stmts.rst:1368 +#: ../../reference/compound_stmts.rst:1370 msgid "Definition of a standard meaning for annotations: type hints." msgstr "" -#: ../../reference/compound_stmts.rst:1370 +#: ../../reference/compound_stmts.rst:1372 msgid ":pep:`526` - Syntax for Variable Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1371 +#: ../../reference/compound_stmts.rst:1373 msgid "" "Ability to type hint variable declarations, including class variables and " "instance variables." msgstr "" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid ":pep:`563` - Postponed Evaluation of Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1375 +#: ../../reference/compound_stmts.rst:1377 msgid "" "Support for forward references within annotations by preserving annotations " "in a string form at runtime instead of eager evaluation." msgstr "" -#: ../../reference/compound_stmts.rst:1378 +#: ../../reference/compound_stmts.rst:1380 msgid ":pep:`318` - Decorators for Functions and Methods" msgstr "" -#: ../../reference/compound_stmts.rst:1379 +#: ../../reference/compound_stmts.rst:1381 msgid "" "Function and method decorators were introduced. Class decorators were " "introduced in :pep:`3129`." msgstr "" -#: ../../reference/compound_stmts.rst:1385 +#: ../../reference/compound_stmts.rst:1387 msgid "Class definitions" msgstr "類別定義" -#: ../../reference/compound_stmts.rst:1400 +#: ../../reference/compound_stmts.rst:1402 msgid "A class definition defines a class object (see section :ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1407 +#: ../../reference/compound_stmts.rst:1409 msgid "" "A class definition is an executable statement. The inheritance list usually " "gives a list of base classes (see :ref:`metaclasses` for more advanced " @@ -1847,7 +1847,7 @@ msgid "" "default, from the base class :class:`object`; hence, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1413 +#: ../../reference/compound_stmts.rst:1415 msgid "" "class Foo:\n" " pass" @@ -1855,11 +1855,11 @@ msgstr "" "class Foo:\n" " pass" -#: ../../reference/compound_stmts.rst:1416 +#: ../../reference/compound_stmts.rst:1418 msgid "is equivalent to ::" msgstr "" -#: ../../reference/compound_stmts.rst:1418 +#: ../../reference/compound_stmts.rst:1420 msgid "" "class Foo(object):\n" " pass" @@ -1867,7 +1867,7 @@ msgstr "" "class Foo(object):\n" " pass" -#: ../../reference/compound_stmts.rst:1421 +#: ../../reference/compound_stmts.rst:1423 msgid "" "The class's suite is then executed in a new execution frame (see :ref:" "`naming`), using a newly created local namespace and the original global " @@ -1879,7 +1879,7 @@ msgid "" "original local namespace." msgstr "" -#: ../../reference/compound_stmts.rst:1430 +#: ../../reference/compound_stmts.rst:1432 msgid "" "The order in which attributes are defined in the class body is preserved in " "the new class's :attr:`~type.__dict__`. Note that this is reliable only " @@ -1887,17 +1887,17 @@ msgid "" "using the definition syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1435 +#: ../../reference/compound_stmts.rst:1437 msgid "" "Class creation can be customized heavily using :ref:`metaclasses " "`." msgstr "" -#: ../../reference/compound_stmts.rst:1440 +#: ../../reference/compound_stmts.rst:1442 msgid "Classes can also be decorated: just like when decorating functions, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1442 +#: ../../reference/compound_stmts.rst:1444 msgid "" "@f1(arg)\n" "@f2\n" @@ -1907,7 +1907,7 @@ msgstr "" "@f2\n" "class Foo: pass" -#: ../../reference/compound_stmts.rst:1448 +#: ../../reference/compound_stmts.rst:1450 msgid "" "class Foo: pass\n" "Foo = f1(arg)(f2(Foo))" @@ -1915,20 +1915,20 @@ msgstr "" "class Foo: pass\n" "Foo = f1(arg)(f2(Foo))" -#: ../../reference/compound_stmts.rst:1451 +#: ../../reference/compound_stmts.rst:1453 msgid "" "The evaluation rules for the decorator expressions are the same as for " "function decorators. The result is then bound to the class name." msgstr "" -#: ../../reference/compound_stmts.rst:1454 +#: ../../reference/compound_stmts.rst:1456 msgid "" "Classes may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1459 +#: ../../reference/compound_stmts.rst:1461 msgid "" "A list of :ref:`type parameters ` may be given in square " "brackets immediately after the class's name. This indicates to static type " @@ -1937,7 +1937,7 @@ msgid "" "`generic-classes` for more." msgstr "" -#: ../../reference/compound_stmts.rst:1468 +#: ../../reference/compound_stmts.rst:1470 msgid "" "**Programmer's note:** Variables defined in the class definition are class " "attributes; they are shared by instances. Instance attributes can be set in " @@ -1950,35 +1950,35 @@ msgid "" "implementation details." msgstr "" -#: ../../reference/compound_stmts.rst:1480 +#: ../../reference/compound_stmts.rst:1482 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/compound_stmts.rst:1481 +#: ../../reference/compound_stmts.rst:1483 msgid "" "The proposal that changed the declaration of metaclasses to the current " "syntax, and the semantics for how classes with metaclasses are constructed." msgstr "" -#: ../../reference/compound_stmts.rst:1485 +#: ../../reference/compound_stmts.rst:1487 msgid ":pep:`3129` - Class Decorators" msgstr ":pep:`3129` - 類別裝飾器" -#: ../../reference/compound_stmts.rst:1486 +#: ../../reference/compound_stmts.rst:1488 msgid "" "The proposal that added class decorators. Function and method decorators " "were introduced in :pep:`318`." msgstr "" -#: ../../reference/compound_stmts.rst:1493 +#: ../../reference/compound_stmts.rst:1495 msgid "Coroutines" msgstr "協程" -#: ../../reference/compound_stmts.rst:1501 +#: ../../reference/compound_stmts.rst:1503 msgid "Coroutine function definition" msgstr "協程函式定義" -#: ../../reference/compound_stmts.rst:1511 +#: ../../reference/compound_stmts.rst:1513 msgid "" "Execution of Python coroutines can be suspended and resumed at many points " "(see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` " @@ -1986,23 +1986,23 @@ msgid "" "function." msgstr "" -#: ../../reference/compound_stmts.rst:1515 +#: ../../reference/compound_stmts.rst:1517 msgid "" "Functions defined with ``async def`` syntax are always coroutine functions, " "even if they do not contain ``await`` or ``async`` keywords." msgstr "" -#: ../../reference/compound_stmts.rst:1518 +#: ../../reference/compound_stmts.rst:1520 msgid "" "It is a :exc:`SyntaxError` to use a ``yield from`` expression inside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1521 +#: ../../reference/compound_stmts.rst:1523 msgid "An example of a coroutine function::" msgstr "一個協程函式範例: ::" -#: ../../reference/compound_stmts.rst:1523 +#: ../../reference/compound_stmts.rst:1525 msgid "" "async def func(param1, param2):\n" " do_stuff()\n" @@ -2012,30 +2012,30 @@ msgstr "" " do_stuff()\n" " await some_coroutine()" -#: ../../reference/compound_stmts.rst:1527 +#: ../../reference/compound_stmts.rst:1529 msgid "" "``await`` and ``async`` are now keywords; previously they were only treated " "as such inside the body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1535 +#: ../../reference/compound_stmts.rst:1537 msgid "The :keyword:`!async for` statement" msgstr ":keyword:`!async for` 陳述式" -#: ../../reference/compound_stmts.rst:1540 +#: ../../reference/compound_stmts.rst:1542 msgid "" "An :term:`asynchronous iterable` provides an ``__aiter__`` method that " "directly returns an :term:`asynchronous iterator`, which can call " "asynchronous code in its ``__anext__`` method." msgstr "" -#: ../../reference/compound_stmts.rst:1544 +#: ../../reference/compound_stmts.rst:1546 msgid "" "The ``async for`` statement allows convenient iteration over asynchronous " "iterables." msgstr "" -#: ../../reference/compound_stmts.rst:1549 +#: ../../reference/compound_stmts.rst:1551 msgid "" "async for TARGET in ITER:\n" " SUITE\n" @@ -2047,11 +2047,11 @@ msgstr "" "else:\n" " SUITE2" -#: ../../reference/compound_stmts.rst:1554 +#: ../../reference/compound_stmts.rst:1556 msgid "Is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1556 +#: ../../reference/compound_stmts.rst:1558 msgid "" "iter = (ITER)\n" "iter = type(iter).__aiter__(iter)\n" @@ -2081,28 +2081,28 @@ msgstr "" "else:\n" " SUITE2" -#: ../../reference/compound_stmts.rst:1570 +#: ../../reference/compound_stmts.rst:1572 msgid "" "See also :meth:`~object.__aiter__` and :meth:`~object.__anext__` for details." msgstr "更多細節請見 :meth:`~object.__aiter__` 與 :meth:`~object.__anext__`。" -#: ../../reference/compound_stmts.rst:1572 +#: ../../reference/compound_stmts.rst:1574 msgid "" "It is a :exc:`SyntaxError` to use an ``async for`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1580 +#: ../../reference/compound_stmts.rst:1582 msgid "The :keyword:`!async with` statement" msgstr ":keyword:`!async with` 陳述式" -#: ../../reference/compound_stmts.rst:1585 +#: ../../reference/compound_stmts.rst:1587 msgid "" "An :term:`asynchronous context manager` is a :term:`context manager` that is " "able to suspend execution in its *enter* and *exit* methods." msgstr "" -#: ../../reference/compound_stmts.rst:1590 +#: ../../reference/compound_stmts.rst:1592 msgid "" "async with EXPRESSION as TARGET:\n" " SUITE" @@ -2110,7 +2110,7 @@ msgstr "" "async with EXPRESSION as TARGET:\n" " SUITE" -#: ../../reference/compound_stmts.rst:1595 +#: ../../reference/compound_stmts.rst:1597 msgid "" "manager = (EXPRESSION)\n" "aenter = type(manager).__aenter__\n" @@ -2146,44 +2146,44 @@ msgstr "" " if not hit_except:\n" " await aexit(manager, None, None, None)" -#: ../../reference/compound_stmts.rst:1612 +#: ../../reference/compound_stmts.rst:1614 msgid "" "See also :meth:`~object.__aenter__` and :meth:`~object.__aexit__` for " "details." msgstr "更多細節請見 :meth:`~object.__aenter__` 與 :meth:`~object.__aexit__`。" -#: ../../reference/compound_stmts.rst:1614 +#: ../../reference/compound_stmts.rst:1616 msgid "" "It is a :exc:`SyntaxError` to use an ``async with`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1619 +#: ../../reference/compound_stmts.rst:1621 msgid ":pep:`492` - Coroutines with async and await syntax" msgstr "" -#: ../../reference/compound_stmts.rst:1620 +#: ../../reference/compound_stmts.rst:1622 msgid "" "The proposal that made coroutines a proper standalone concept in Python, and " "added supporting syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1626 +#: ../../reference/compound_stmts.rst:1628 msgid "Type parameter lists" msgstr "" -#: ../../reference/compound_stmts.rst:1630 +#: ../../reference/compound_stmts.rst:1632 msgid "Support for default values was added (see :pep:`696`)." msgstr "" -#: ../../reference/compound_stmts.rst:1643 +#: ../../reference/compound_stmts.rst:1645 msgid "" ":ref:`Functions ` (including :ref:`coroutines `), :ref:" "`classes ` and :ref:`type aliases ` may contain a type " "parameter list::" msgstr "" -#: ../../reference/compound_stmts.rst:1647 +#: ../../reference/compound_stmts.rst:1649 msgid "" "def max[T](args: list[T]) -> T:\n" " ...\n" @@ -2215,7 +2215,7 @@ msgstr "" "\n" "type ListOrSet[T] = list[T] | set[T]" -#: ../../reference/compound_stmts.rst:1662 +#: ../../reference/compound_stmts.rst:1664 msgid "" "Semantically, this indicates that the function, class, or type alias is " "generic over a type variable. This information is primarily used by static " @@ -2223,7 +2223,7 @@ msgid "" "generic counterparts." msgstr "" -#: ../../reference/compound_stmts.rst:1667 +#: ../../reference/compound_stmts.rst:1669 msgid "" "Type parameters are declared in square brackets (``[]``) immediately after " "the name of the function, class, or type alias. The type parameters are " @@ -2235,36 +2235,36 @@ msgid "" "wraps the creation of the generic object." msgstr "" -#: ../../reference/compound_stmts.rst:1676 +#: ../../reference/compound_stmts.rst:1678 msgid "" "Generic functions, classes, and type aliases have a :attr:`~definition." "__type_params__` attribute listing their type parameters." msgstr "" -#: ../../reference/compound_stmts.rst:1679 +#: ../../reference/compound_stmts.rst:1681 msgid "Type parameters come in three kinds:" msgstr "" -#: ../../reference/compound_stmts.rst:1681 +#: ../../reference/compound_stmts.rst:1683 msgid "" ":data:`typing.TypeVar`, introduced by a plain name (e.g., ``T``). " "Semantically, this represents a single type to a type checker." msgstr "" -#: ../../reference/compound_stmts.rst:1683 +#: ../../reference/compound_stmts.rst:1685 msgid "" ":data:`typing.TypeVarTuple`, introduced by a name prefixed with a single " "asterisk (e.g., ``*Ts``). Semantically, this stands for a tuple of any " "number of types." msgstr "" -#: ../../reference/compound_stmts.rst:1686 +#: ../../reference/compound_stmts.rst:1688 msgid "" ":data:`typing.ParamSpec`, introduced by a name prefixed with two asterisks " "(e.g., ``**P``). Semantically, this stands for the parameters of a callable." msgstr "" -#: ../../reference/compound_stmts.rst:1689 +#: ../../reference/compound_stmts.rst:1691 msgid "" ":data:`typing.TypeVar` declarations can define *bounds* and *constraints* " "with a colon (``:``) followed by an expression. A single expression after " @@ -2276,7 +2276,7 @@ msgid "" "variables can only take on one of the types in the list of constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1698 +#: ../../reference/compound_stmts.rst:1700 msgid "" "For :data:`!typing.TypeVar`\\ s declared using the type parameter list " "syntax, the bound and constraints are not evaluated when the generic object " @@ -2286,13 +2286,13 @@ msgid "" "`." msgstr "" -#: ../../reference/compound_stmts.rst:1704 +#: ../../reference/compound_stmts.rst:1706 msgid "" ":data:`typing.TypeVarTuple`\\ s and :data:`typing.ParamSpec`\\ s cannot have " "bounds or constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1707 +#: ../../reference/compound_stmts.rst:1709 msgid "" "All three flavors of type parameters can also have a *default value*, which " "is used when the type parameter is not explicitly provided. This is added by " @@ -2305,13 +2305,13 @@ msgid "" "attribute is set to the special sentinel object :data:`typing.NoDefault`." msgstr "" -#: ../../reference/compound_stmts.rst:1717 +#: ../../reference/compound_stmts.rst:1719 msgid "" "The following example indicates the full set of allowed type parameter " "declarations::" msgstr "" -#: ../../reference/compound_stmts.rst:1719 +#: ../../reference/compound_stmts.rst:1721 msgid "" "def overly_generic[\n" " SimpleTypeVar,\n" @@ -2343,24 +2343,24 @@ msgstr "" " *e: SimpleTypeVarTuple,\n" "): ..." -#: ../../reference/compound_stmts.rst:1737 +#: ../../reference/compound_stmts.rst:1739 msgid "Generic functions" msgstr "" -#: ../../reference/compound_stmts.rst:1739 +#: ../../reference/compound_stmts.rst:1741 msgid "Generic functions are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1741 +#: ../../reference/compound_stmts.rst:1743 msgid "def func[T](arg: T): ..." msgstr "def func[T](arg: T): ..." -#: ../../reference/compound_stmts.rst:1743 -#: ../../reference/compound_stmts.rst:1803 +#: ../../reference/compound_stmts.rst:1745 +#: ../../reference/compound_stmts.rst:1805 msgid "This syntax is equivalent to::" msgstr "語法大致等價於: ::" -#: ../../reference/compound_stmts.rst:1745 +#: ../../reference/compound_stmts.rst:1747 msgid "" "annotation-def TYPE_PARAMS_OF_func():\n" " T = typing.TypeVar(\"T\")\n" @@ -2376,7 +2376,7 @@ msgstr "" " return func\n" "func = TYPE_PARAMS_OF_func()" -#: ../../reference/compound_stmts.rst:1752 +#: ../../reference/compound_stmts.rst:1754 msgid "" "Here ``annotation-def`` indicates an :ref:`annotation scope `, which is not actually bound to any name at runtime. (One other " @@ -2385,20 +2385,20 @@ msgid "" "data:`typing.TypeVar` directly.)" msgstr "" -#: ../../reference/compound_stmts.rst:1758 +#: ../../reference/compound_stmts.rst:1760 msgid "" "The annotations of generic functions are evaluated within the annotation " "scope used for declaring the type parameters, but the function's defaults " "and decorators are not." msgstr "" -#: ../../reference/compound_stmts.rst:1762 +#: ../../reference/compound_stmts.rst:1764 msgid "" "The following example illustrates the scoping rules for these cases, as well " "as for additional flavors of type parameters::" msgstr "" -#: ../../reference/compound_stmts.rst:1765 +#: ../../reference/compound_stmts.rst:1767 msgid "" "@decorator\n" "def func[T: int, *Ts, **P](*args: *Ts, arg: Callable[P, T] = some_default):\n" @@ -2408,13 +2408,13 @@ msgstr "" "def func[T: int, *Ts, **P](*args: *Ts, arg: Callable[P, T] = some_default):\n" " ..." -#: ../../reference/compound_stmts.rst:1769 +#: ../../reference/compound_stmts.rst:1771 msgid "" "Except for the :ref:`lazy evaluation ` of the :class:" "`~typing.TypeVar` bound, this is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1772 +#: ../../reference/compound_stmts.rst:1774 msgid "" "DEFAULT_OF_arg = some_default\n" "\n" @@ -2436,25 +2436,25 @@ msgid "" "func = decorator(TYPE_PARAMS_OF_func())" msgstr "" -#: ../../reference/compound_stmts.rst:1791 +#: ../../reference/compound_stmts.rst:1793 msgid "" "The capitalized names like ``DEFAULT_OF_arg`` are not actually bound at " "runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1797 +#: ../../reference/compound_stmts.rst:1799 msgid "Generic classes" msgstr "" -#: ../../reference/compound_stmts.rst:1799 +#: ../../reference/compound_stmts.rst:1801 msgid "Generic classes are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1801 +#: ../../reference/compound_stmts.rst:1803 msgid "class Bag[T]: ..." msgstr "class Bag[T]: ..." -#: ../../reference/compound_stmts.rst:1805 +#: ../../reference/compound_stmts.rst:1807 msgid "" "annotation-def TYPE_PARAMS_OF_Bag():\n" " T = typing.TypeVar(\"T\")\n" @@ -2472,14 +2472,14 @@ msgstr "" " return Bag\n" "Bag = TYPE_PARAMS_OF_Bag()" -#: ../../reference/compound_stmts.rst:1813 +#: ../../reference/compound_stmts.rst:1815 msgid "" "Here again ``annotation-def`` (not a real keyword) indicates an :ref:" "`annotation scope `, and the name ``TYPE_PARAMS_OF_Bag`` " "is not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1817 +#: ../../reference/compound_stmts.rst:1819 msgid "" "Generic classes implicitly inherit from :data:`typing.Generic`. The base " "classes and keyword arguments of generic classes are evaluated within the " @@ -2487,7 +2487,7 @@ msgid "" "that scope. This is illustrated by this example::" msgstr "" -#: ../../reference/compound_stmts.rst:1823 +#: ../../reference/compound_stmts.rst:1825 msgid "" "@decorator\n" "class Bag(Base[T], arg=T): ..." @@ -2495,11 +2495,11 @@ msgstr "" "@decorator\n" "class Bag(Base[T], arg=T): ..." -#: ../../reference/compound_stmts.rst:1826 +#: ../../reference/compound_stmts.rst:1828 msgid "This is equivalent to::" msgstr "這等價於: ::" -#: ../../reference/compound_stmts.rst:1828 +#: ../../reference/compound_stmts.rst:1830 msgid "" "annotation-def TYPE_PARAMS_OF_Bag():\n" " T = typing.TypeVar(\"T\")\n" @@ -2517,27 +2517,27 @@ msgstr "" " return Bag\n" "Bag = decorator(TYPE_PARAMS_OF_Bag())" -#: ../../reference/compound_stmts.rst:1839 +#: ../../reference/compound_stmts.rst:1841 msgid "Generic type aliases" msgstr "" -#: ../../reference/compound_stmts.rst:1841 +#: ../../reference/compound_stmts.rst:1843 msgid "" "The :keyword:`type` statement can also be used to create a generic type " "alias::" msgstr "" -#: ../../reference/compound_stmts.rst:1843 +#: ../../reference/compound_stmts.rst:1845 msgid "type ListOrSet[T] = list[T] | set[T]" msgstr "type ListOrSet[T] = list[T] | set[T]" -#: ../../reference/compound_stmts.rst:1845 +#: ../../reference/compound_stmts.rst:1847 msgid "" "Except for the :ref:`lazy evaluation ` of the value, this " "is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1848 +#: ../../reference/compound_stmts.rst:1850 msgid "" "annotation-def TYPE_PARAMS_OF_ListOrSet():\n" " T = typing.TypeVar(\"T\")\n" @@ -2550,105 +2550,105 @@ msgid "" "ListOrSet = TYPE_PARAMS_OF_ListOrSet()" msgstr "" -#: ../../reference/compound_stmts.rst:1857 +#: ../../reference/compound_stmts.rst:1859 msgid "" "Here, ``annotation-def`` (not a real keyword) indicates an :ref:`annotation " "scope `. The capitalized names like " "``TYPE_PARAMS_OF_ListOrSet`` are not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1862 +#: ../../reference/compound_stmts.rst:1864 msgid "Footnotes" msgstr "註解" -#: ../../reference/compound_stmts.rst:1863 +#: ../../reference/compound_stmts.rst:1865 msgid "" "The exception is propagated to the invocation stack unless there is a :" "keyword:`finally` clause which happens to raise another exception. That new " "exception causes the old one to be lost." msgstr "" -#: ../../reference/compound_stmts.rst:1867 +#: ../../reference/compound_stmts.rst:1869 msgid "In pattern matching, a sequence is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1869 +#: ../../reference/compound_stmts.rst:1871 msgid "a class that inherits from :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1870 +#: ../../reference/compound_stmts.rst:1872 msgid "" "a Python class that has been registered as :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1871 +#: ../../reference/compound_stmts.rst:1873 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_SEQUENCE` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1872 -#: ../../reference/compound_stmts.rst:1891 +#: ../../reference/compound_stmts.rst:1874 +#: ../../reference/compound_stmts.rst:1893 msgid "a class that inherits from any of the above" msgstr "" -#: ../../reference/compound_stmts.rst:1874 +#: ../../reference/compound_stmts.rst:1876 msgid "The following standard library classes are sequences:" msgstr "" -#: ../../reference/compound_stmts.rst:1876 +#: ../../reference/compound_stmts.rst:1878 msgid ":class:`array.array`" msgstr ":class:`array.array`" -#: ../../reference/compound_stmts.rst:1877 +#: ../../reference/compound_stmts.rst:1879 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../reference/compound_stmts.rst:1879 +#: ../../reference/compound_stmts.rst:1881 msgid ":class:`memoryview`" msgstr ":class:`memoryview`" -#: ../../reference/compound_stmts.rst:1880 +#: ../../reference/compound_stmts.rst:1882 msgid ":class:`range`" msgstr ":class:`range`" -#: ../../reference/compound_stmts.rst:1883 +#: ../../reference/compound_stmts.rst:1885 msgid "" "Subject values of type ``str``, ``bytes``, and ``bytearray`` do not match " "sequence patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1886 +#: ../../reference/compound_stmts.rst:1888 msgid "In pattern matching, a mapping is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1888 +#: ../../reference/compound_stmts.rst:1890 msgid "a class that inherits from :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1889 +#: ../../reference/compound_stmts.rst:1891 msgid "" "a Python class that has been registered as :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1890 +#: ../../reference/compound_stmts.rst:1892 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_MAPPING` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1893 +#: ../../reference/compound_stmts.rst:1895 msgid "" "The standard library classes :class:`dict` and :class:`types." "MappingProxyType` are mappings." msgstr "" -#: ../../reference/compound_stmts.rst:1896 +#: ../../reference/compound_stmts.rst:1898 msgid "" "A string literal appearing as the first statement in the function body is " "transformed into the function's :attr:`~function.__doc__` attribute and " "therefore the function's :term:`docstring`." msgstr "" -#: ../../reference/compound_stmts.rst:1900 +#: ../../reference/compound_stmts.rst:1902 msgid "" "A string literal appearing as the first statement in the class body is " "transformed into the namespace's :attr:`~type.__doc__` item and therefore " @@ -2670,10 +2670,10 @@ msgstr "compound(複合)" #: ../../reference/compound_stmts.rst:471 #: ../../reference/compound_stmts.rst:588 #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 -#: ../../reference/compound_stmts.rst:1497 -#: ../../reference/compound_stmts.rst:1531 -#: ../../reference/compound_stmts.rst:1576 +#: ../../reference/compound_stmts.rst:1389 +#: ../../reference/compound_stmts.rst:1499 +#: ../../reference/compound_stmts.rst:1533 +#: ../../reference/compound_stmts.rst:1578 msgid "statement" msgstr "statement(陳述式)" @@ -2721,7 +2721,7 @@ msgstr "if" #: ../../reference/compound_stmts.rst:408 #: ../../reference/compound_stmts.rst:471 #: ../../reference/compound_stmts.rst:588 -#: ../../reference/compound_stmts.rst:1507 +#: ../../reference/compound_stmts.rst:1509 msgid "keyword" msgstr "keyword(關鍵字)" @@ -2735,8 +2735,8 @@ msgstr "elif" #: ../../reference/compound_stmts.rst:471 #: ../../reference/compound_stmts.rst:588 #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1323 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1325 +#: ../../reference/compound_stmts.rst:1389 msgid ": (colon)" msgstr ": (冒號)" @@ -2746,7 +2746,7 @@ msgstr ": (冒號)" #: ../../reference/compound_stmts.rst:471 #: ../../reference/compound_stmts.rst:588 #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "compound statement" msgstr "compound statement(複合陳述式)" @@ -2792,7 +2792,7 @@ msgstr "list(串列)" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:298 #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "object" msgstr "object(物件)" @@ -2863,7 +2863,7 @@ msgstr "with statement(with 陳述式)" #: ../../reference/compound_stmts.rst:471 #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid ", (comma)" msgstr ", (逗號)" @@ -2904,15 +2904,15 @@ msgid "AS pattern, OR pattern, capture pattern, wildcard pattern" msgstr "" #: ../../reference/compound_stmts.rst:1186 -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1275 msgid "parameter" msgstr "parameter(參數)" #: ../../reference/compound_stmts.rst:1186 #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1237 -#: ../../reference/compound_stmts.rst:1273 -#: ../../reference/compound_stmts.rst:1302 +#: ../../reference/compound_stmts.rst:1239 +#: ../../reference/compound_stmts.rst:1275 +#: ../../reference/compound_stmts.rst:1304 msgid "function definition" msgstr "function definition(函式定義)" @@ -2921,22 +2921,22 @@ msgid "def" msgstr "def" #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1325 msgid "function" msgstr "function (函式)" #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "definition" msgstr "definition(定義)" #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "name" msgstr "name(名稱)" #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "binding" msgstr "binding(綁定)" @@ -2945,7 +2945,7 @@ msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "() (parentheses)" msgstr "() (圓括號)" @@ -2953,108 +2953,108 @@ msgstr "() (圓括號)" msgid "parameter list" msgstr "parameter list(參數列表)" -#: ../../reference/compound_stmts.rst:1237 -#: ../../reference/compound_stmts.rst:1437 +#: ../../reference/compound_stmts.rst:1239 +#: ../../reference/compound_stmts.rst:1439 msgid "@ (at)" msgstr "@ (在)" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1275 msgid "default" msgstr "default(預設)" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1275 msgid "value" msgstr "value(值)" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1275 msgid "argument" msgstr "argument(引數)" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1275 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/compound_stmts.rst:1302 +#: ../../reference/compound_stmts.rst:1304 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../reference/compound_stmts.rst:1302 +#: ../../reference/compound_stmts.rst:1304 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../reference/compound_stmts.rst:1302 +#: ../../reference/compound_stmts.rst:1304 msgid "**" msgstr "**" -#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1325 msgid "annotations" msgstr "annotations(註釋)" -#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1325 msgid "->" msgstr "->" -#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1325 msgid "function annotations" msgstr "function annotations(函式註釋)" -#: ../../reference/compound_stmts.rst:1346 +#: ../../reference/compound_stmts.rst:1348 msgid "lambda" msgstr "lambda" -#: ../../reference/compound_stmts.rst:1346 +#: ../../reference/compound_stmts.rst:1348 msgid "expression" msgstr "expression(運算式)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "class" msgstr "class(類別)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "execution" msgstr "execution(執行)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "frame" msgstr "frame" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "inheritance" msgstr "inheritance(繼承)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../reference/compound_stmts.rst:1387 -#: ../../reference/compound_stmts.rst:1437 +#: ../../reference/compound_stmts.rst:1389 +#: ../../reference/compound_stmts.rst:1439 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "expression list" msgstr "expression list(表達式列表)" -#: ../../reference/compound_stmts.rst:1497 +#: ../../reference/compound_stmts.rst:1499 msgid "async def" msgstr "async def" -#: ../../reference/compound_stmts.rst:1507 +#: ../../reference/compound_stmts.rst:1509 msgid "async" msgstr "async" -#: ../../reference/compound_stmts.rst:1507 +#: ../../reference/compound_stmts.rst:1509 msgid "await" msgstr "await" -#: ../../reference/compound_stmts.rst:1531 +#: ../../reference/compound_stmts.rst:1533 msgid "async for" msgstr "async for" -#: ../../reference/compound_stmts.rst:1576 +#: ../../reference/compound_stmts.rst:1578 msgid "async with" msgstr "async with" -#: ../../reference/compound_stmts.rst:1633 +#: ../../reference/compound_stmts.rst:1635 msgid "type parameters" msgstr "type parameter(型別參數)" diff --git a/sphinx.po b/sphinx.po index f044d5a9c6..58dbb67f14 100644 --- a/sphinx.po +++ b/sphinx.po @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2025-02-07 15:02+0800\n" "PO-Revision-Date: 2023-03-15 10:19+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -74,8 +74,8 @@ msgid "" "Download " "(ca. %(download_size)s MiB)" msgstr "" -"下載 (ca. " -"%(download_size)s MiB)" +"下載 (ca. %" +"(download_size)s MiB)" #: ../../tools/templates/download.html:32 msgid "" @@ -94,8 +94,8 @@ msgid "" "Download " "(ca. %(download_size)s MiB)" msgstr "" -"下載 (ca. " -"%(download_size)s MiB)" +"下載 (ca. %" +"(download_size)s MiB)" #: ../../tools/templates/download.html:37 msgid "" @@ -114,8 +114,8 @@ msgid "" "Download " "(ca. %(download_size)s MiB)" msgstr "" -"下載 (ca. " -"%(download_size)s MiB)" +"下載 (ca. %" +"(download_size)s MiB)" #: ../../tools/templates/download.html:42 msgid "" @@ -151,11 +151,11 @@ msgstr "EPUB" #: ../../tools/templates/download.html:51 msgid "" -"Download (ca. " -"%(download_size)s MiB)" +"Download (ca. %" +"(download_size)s MiB)" msgstr "" -"下載 (ca. " -"%(download_size)s MiB)" +"下載 (ca. %" +"(download_size)s MiB)" #: ../../tools/templates/download.html:56 msgid "These archives contain all the content in the documentation." @@ -176,9 +176,9 @@ msgid "" "best compression and fastest download times." msgstr "" "Unix 使用者應該下載 .tar.bz2 歸檔;這些是 bzipped tar 歸檔,可以使用 tar 和 " -"bzip2 來處理。如果需要的話,可以使用 Info-ZIP 解壓縮程式來處理 ZIP 歸檔。.tar.bz2 歸檔提供最佳壓縮率和最" -"快的下載時間。" +"bzip2 來處理。如果需要的話,可以使用 Info-ZIP 解壓縮程式來處理 ZIP 歸檔。.tar.bz2 歸" +"檔提供最佳壓縮率和最快的下載時間。" #: ../../tools/templates/download.html:67 msgid "" @@ -198,91 +198,95 @@ msgid "" "send\n" "email to docs@python.org." msgstr "" -"如果你對 Python 說明文件有任何意見或建議,請寄電子郵件至 docs@python.org。" +"如果你對 Python 說明文件有任何意見或建議,請寄電子郵件至 docs@python.org。" #: ../../tools/templates/dummy.html:6 -msgid "CPython implementation detail:" -msgstr "CPython 實作細節:" +msgid "Availability" +msgstr "適用" -#: ../../tools/templates/dummy.html:7 -msgid "" -"Deprecated since version {deprecated}, will be removed in version {removed}" -msgstr "自從版本 {deprecated} 後不推薦使用,將會自版本 {removed} 中移除。" - -#: ../../tools/templates/dummy.html:8 -msgid "Deprecated since version {deprecated}, removed in version {removed}" -msgstr "自從版本 {deprecated} 後不推薦使用,已從版本 {removed} 中移除。" - -#: ../../tools/templates/dummy.html:12 +#: ../../tools/templates/dummy.html:10 msgid "Part of the" msgstr "為" -#: ../../tools/templates/dummy.html:13 +#: ../../tools/templates/dummy.html:11 msgid "Limited API" msgstr "受限 API 的一部分" -#: ../../tools/templates/dummy.html:14 +#: ../../tools/templates/dummy.html:12 msgid "Stable ABI" msgstr "穩定 ABI 的一部分" -#: ../../tools/templates/dummy.html:15 +#: ../../tools/templates/dummy.html:13 msgid "(as an opaque struct)" msgstr "(做為一個不透明結構 (opaque struct))" -#: ../../tools/templates/dummy.html:16 +#: ../../tools/templates/dummy.html:14 msgid "(including all members)" msgstr "(包含所有成員)" -#: ../../tools/templates/dummy.html:17 +#: ../../tools/templates/dummy.html:15 msgid "since version %s" msgstr "自 %s 版本開始" -#: ../../tools/templates/dummy.html:18 +#: ../../tools/templates/dummy.html:16 msgid "(Only some members are part of the stable ABI.)" msgstr "(只有部分成員是穩定 ABI 的一部分。)" -#: ../../tools/templates/dummy.html:19 +#: ../../tools/templates/dummy.html:17 msgid "This is" msgstr "這是" -#: ../../tools/templates/dummy.html:20 +#: ../../tools/templates/dummy.html:18 msgid "Unstable API" msgstr "不穩定 API" -#: ../../tools/templates/dummy.html:21 +#: ../../tools/templates/dummy.html:19 msgid ". It may change without warning in minor releases." msgstr ",它可能在小版本發布中沒有任何警告地被變更。" -#: ../../tools/templates/dummy.html:22 +#: ../../tools/templates/dummy.html:20 msgid "Return value: Always NULL." msgstr "回傳值:總是為 NULL。" -#: ../../tools/templates/dummy.html:23 +#: ../../tools/templates/dummy.html:21 msgid "Return value: New reference." msgstr "回傳值:新的參照。" -#: ../../tools/templates/dummy.html:24 +#: ../../tools/templates/dummy.html:22 msgid "Return value: Borrowed reference." msgstr "回傳值:借用參照。" -#: ../../tools/templates/dummy.html:28 +#: ../../tools/templates/dummy.html:26 +msgid "CPython implementation detail:" +msgstr "CPython 實作細節:" + +#: ../../tools/templates/dummy.html:30 +msgid "" +"Deprecated since version {deprecated}, will be removed in version {removed}" +msgstr "自從版本 {deprecated} 後不推薦使用,將會自版本 {removed} 中移除。" + +#: ../../tools/templates/dummy.html:31 +msgid "Deprecated since version {deprecated}, removed in version {removed}" +msgstr "自從版本 {deprecated} 後不推薦使用,已從版本 {removed} 中移除。" + +#: ../../tools/templates/dummy.html:35 msgid "in development" msgstr "開發中" -#: ../../tools/templates/dummy.html:29 +#: ../../tools/templates/dummy.html:36 msgid "pre-release" msgstr "預發行" -#: ../../tools/templates/dummy.html:30 +#: ../../tools/templates/dummy.html:37 msgid "stable" msgstr "穩定版本" -#: ../../tools/templates/dummy.html:31 +#: ../../tools/templates/dummy.html:38 msgid "security-fixes" msgstr "安全性修護" -#: ../../tools/templates/dummy.html:32 +#: ../../tools/templates/dummy.html:39 msgid "EOL" msgstr "停止維護" @@ -521,8 +525,8 @@ msgstr "當前穩定發行的 Python 版本說明文件" #: ../../tools/templates/layout.html:14 msgid "" -"This is a deploy preview created from a pull request.\n" +"This is a deploy preview created from a pull request.\n" " For authoritative documentation, see" msgstr "" "這是從 pull request(拉取請求)" diff --git a/using/cmdline.po b/using/cmdline.po index 83a4704e76..ee77384f74 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2025-01-24 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1494,8 +1494,8 @@ msgstr "" #: ../../using/cmdline.rst:1200 msgid "" -"If this variable is set to ``1``, the interpreter will not attempt to load " -"the Python-based :term:`REPL` that requires :mod:`curses` and :mod:" +"If this variable is set to any value, the interpreter will not attempt to " +"load the Python-based :term:`REPL` that requires :mod:`curses` and :mod:" "`readline`, and will instead use the traditional parser-based :term:`REPL`." msgstr "" diff --git a/using/configure.po b/using/configure.po index caaba60971..edacd303ff 100644 --- a/using/configure.po +++ b/using/configure.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # @@ -8,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-13 00:13+0000\n" +"POT-Creation-Date: 2025-01-31 00:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,9 +26,8 @@ msgid "Build Requirements" msgstr "建置需求" #: ../../using/configure.rst:10 -#, fuzzy msgid "Features and minimum versions required to build CPython:" -msgstr "建置 CPython 所需的功能:" +msgstr "建置 CPython 所需的功能與最小版本:" #: ../../using/configure.rst:12 msgid "" @@ -45,8 +43,8 @@ msgstr "在 Windows 上需要 Microsoft Visual Studio 2017 或更新版本。" #: ../../using/configure.rst:19 msgid "" "Support for `IEEE 754 `_ floating-" -"point numbers and `floating-point Not-a-Number (NaN) `_." +"point numbers and `floating-point Not-a-Number (NaN) `_." msgstr "" #: ../../using/configure.rst:23 @@ -60,9 +58,8 @@ msgid "" msgstr "" #: ../../using/configure.rst:28 -#, fuzzy msgid "SQLite 3.15.2 for the :mod:`sqlite3` extension module." -msgstr "請見 :mod:`ssl` 模組。" +msgstr "" #: ../../using/configure.rst:30 msgid "Tcl/Tk 8.5.12 for the :mod:`tkinter` module." @@ -70,21 +67,21 @@ msgstr "" #: ../../using/configure.rst:32 msgid "" -"Autoconf 2.71 and aclocal 1.16.5 are required to regenerate the :file:" -"`configure` script." +"Autoconf 2.71 and aclocal 1.16.5 are required to regenerate " +"the :file:`configure` script." msgstr "" #: ../../using/configure.rst:35 -#, fuzzy msgid "Tcl/Tk version 8.3.1 is now required." -msgstr "OpenSSL 1.1.1 現在是必要的。" +msgstr "Tcl/Tk version 8.3.1 現在是必要的。" #: ../../using/configure.rst:38 -#, fuzzy msgid "" "On Windows, Visual Studio 2015 or later is now required. Tcl/Tk version 8.4 " "is now required." -msgstr "在 Windows 上需要 Visual Studio 2015 或更新版本。" +msgstr "" +"在 Windows 上,Visual Studio 2015 或更新版本與 Tcl/Tk version 8.4 現在是必要" +"的。" #: ../../using/configure.rst:42 msgid "" @@ -97,9 +94,8 @@ msgid "Thread support and OpenSSL 1.0.2 are now required." msgstr "對執行緒與 OpenSSL 1.0.2 的支援現在是必要的。" #: ../../using/configure.rst:49 -#, fuzzy msgid "OpenSSL 1.1.1 is now required. Require SQLite 3.7.15." -msgstr "OpenSSL 1.1.1 現在是必要的。" +msgstr "OpenSSL 1.1.1 現在是必要的。需要 SQLite 3.7.15。" #: ../../using/configure.rst:53 msgid "" @@ -178,12 +174,11 @@ msgstr "設定選項" #: ../../using/configure.rst:100 msgid "List all :file:`configure` script options using::" -msgstr "" +msgstr "使用以下命令列出所有 :file:`configure` 腳本選項: ::" #: ../../using/configure.rst:102 -#, fuzzy msgid "./configure --help" -msgstr "設定腳本" +msgstr "./configure --help" #: ../../using/configure.rst:104 msgid "" @@ -203,16 +198,16 @@ msgstr "" #: ../../using/configure.rst:114 msgid "" -"See the :meth:`sqlite3.Connection.enable_load_extension` method of the :mod:" -"`sqlite3` module." +"See the :meth:`sqlite3.Connection.enable_load_extension` method of " +"the :mod:`sqlite3` module." msgstr "" "請見 :mod:`sqlite3` 模組的 :meth:`sqlite3.Connection.enable_load_extension` " "方法。" #: ../../using/configure.rst:121 msgid "" -"Disable IPv6 support (enabled by default if supported), see the :mod:" -"`socket` module." +"Disable IPv6 support (enabled by default if supported), see " +"the :mod:`socket` module." msgstr "停用 IPv6 支援(如果支援的話預設是啟用的),請見 :mod:`socket` 模組。" #: ../../using/configure.rst:126 @@ -238,8 +233,8 @@ msgstr "將 Python 執行檔的後綴設定為 *SUFFIX*。" #: ../../using/configure.rst:138 msgid "" "The default suffix is ``.exe`` on Windows and macOS (``python.exe`` " -"executable), ``.js`` on Emscripten node, ``.html`` on Emscripten browser, ``." -"wasm`` on WASI, and an empty string on other platforms (``python`` " +"executable), ``.js`` on Emscripten node, ``.html`` on Emscripten browser, " +"``.wasm`` on WASI, and an empty string on other platforms (``python`` " "executable)." msgstr "" "在 Windows 和 macOS 上預設的後綴是 ``.exe`` (``python.exe`` 執行檔)、在 " @@ -248,8 +243,8 @@ msgstr "" #: ../../using/configure.rst:143 msgid "" -"The default suffix on WASM platform is one of ``.js``, ``.html`` or ``." -"wasm``." +"The default suffix on WASM platform is one of ``.js``, ``.html`` or " +"``.wasm``." msgstr "在 WASM 平台上預設的後綴是 ``.js``、``.html`` 或 ``.wasm`` 中的一個。" #: ../../using/configure.rst:149 @@ -340,8 +335,8 @@ msgstr "" msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" -"share/python-wheels/`` directory and don't install the :mod:`!ensurepip." -"_bundled` package." +"share/python-wheels/`` directory and don't install the :mod:`!" +"ensurepip._bundled` package." msgstr "" #: ../../using/configure.rst:216 @@ -352,7 +347,7 @@ msgstr "" #: ../../using/configure.rst:219 msgid "``check`` (default): :program:`pkg-config` is optional" -msgstr "``check`` (預設)::program:`pkg-config` 是可選的" +msgstr "``check``\\ (預設)::program:`pkg-config` 是可選的" #: ../../using/configure.rst:220 msgid "``yes``: :program:`pkg-config` is mandatory" @@ -379,46 +374,42 @@ msgid "" "cleared." msgstr "" -#: ../../using/configure.rst:236 ../../using/configure.rst:721 +#: ../../using/configure.rst:236 ../../using/configure.rst:725 msgid "Effects:" msgstr "效果:" #: ../../using/configure.rst:238 -#, fuzzy msgid "Add :option:`-X pystats <-X>` command line option." -msgstr "新增 :option:`-X showrefcount <-X>` 命令列選項。" +msgstr "新增 :option:`-X pystats <-X>` 命令列選項。" #: ../../using/configure.rst:239 -#, fuzzy msgid "Add :envvar:`!PYTHONSTATS` environment variable." -msgstr "新增 :envvar:`PYTHONDUMPREFS` 環境變數。" +msgstr "新增 :envvar:`!PYTHONSTATS` 環境變數。" #: ../../using/configure.rst:240 -#, fuzzy msgid "Define the ``Py_STATS`` macro." -msgstr "定義 ``Py_TRACE_REFS`` 巨集。" +msgstr "定義 ``Py_STATS`` 巨集。" #: ../../using/configure.rst:241 -#, fuzzy msgid "Add functions to the :mod:`sys` module:" -msgstr "請見 :mod:`ssl` 模組。" +msgstr "新增函式到 :mod:`sys` 模組。" #: ../../using/configure.rst:243 msgid ":func:`!sys._stats_on`: Turns on statistics gathering." -msgstr "" +msgstr ":func:`!sys._stats_on`:啟用統計資料收集。" #: ../../using/configure.rst:244 msgid ":func:`!sys._stats_off`: Turns off statistics gathering." -msgstr "" +msgstr ":func:`!sys._stats_off`:關閉統計資料收集。" #: ../../using/configure.rst:245 msgid ":func:`!sys._stats_clear`: Clears the statistics." -msgstr "" +msgstr ":func:`!sys._stats_clear`:清除統計資料。" #: ../../using/configure.rst:246 msgid "" ":func:`!sys._stats_dump`: Dump statistics to file, and clears the statistics." -msgstr "" +msgstr ":func:`!sys._stats_dump`:將統計資料轉儲到檔案,並清除統計資料。" #: ../../using/configure.rst:248 msgid "" @@ -426,6 +417,9 @@ msgid "" "tmp/py_stats/`` (Unix) or ``C:\\temp\\py_stats\\`` (Windows). If that " "directory does not exist, results will be printed on stderr." msgstr "" +"統計資料將被轉儲到 ``/tmp/py_stats/`` (Unix) 或 ``C:\\temp\\py_stats\\`` " +"(Windows) 中的任意(可能是唯一的)檔案。如果該目錄不存在,結果將被列印到 " +"stderr。" #: ../../using/configure.rst:252 msgid "Use ``Tools/scripts/summarize_stats.py`` to read the stats." @@ -510,9 +504,8 @@ msgid "type cache;" msgstr "" #: ../../using/configure.rst:280 -#, fuzzy msgid "optimization attempts;" -msgstr "最佳化旗標。" +msgstr "最佳化嘗試;" #: ../../using/configure.rst:281 msgid "optimization traces created/executed;" @@ -540,14 +533,14 @@ msgstr "" #: ../../using/configure.rst:296 msgid "" -"Enables **experimental** support for running Python without the :term:" -"`global interpreter lock` (GIL): free threading build." +"Enables **experimental** support for running Python without " +"the :term:`global interpreter lock` (GIL): free threading build." msgstr "" #: ../../using/configure.rst:299 msgid "" -"Defines the ``Py_GIL_DISABLED`` macro and adds ``\"t\"`` to :data:`sys." -"abiflags`." +"Defines the ``Py_GIL_DISABLED`` macro and adds ``\"t\"`` " +"to :data:`sys.abiflags`." msgstr "" #: ../../using/configure.rst:302 @@ -584,218 +577,221 @@ msgid "" "experimental-jit=yes``." msgstr "" -#: ../../using/configure.rst:321 +#: ../../using/configure.rst:319 +msgid "" +"When building CPython with JIT enabled, ensure that your system has Python " +"3.11 or later installed." +msgstr "" + +#: ../../using/configure.rst:325 msgid "Path to ``pkg-config`` utility." msgstr "" -#: ../../using/configure.rst:326 -#, fuzzy +#: ../../using/configure.rst:330 msgid "``pkg-config`` options." -msgstr "設定選項" +msgstr "``pkg-config`` 選項。" -#: ../../using/configure.rst:330 -#, fuzzy +#: ../../using/configure.rst:334 msgid "C compiler options" -msgstr "C 編譯器指令。" +msgstr "C 編譯器選項。" -#: ../../using/configure.rst:334 ../../using/configure.rst:1241 +#: ../../using/configure.rst:338 ../../using/configure.rst:1245 msgid "C compiler command." msgstr "C 編譯器指令。" -#: ../../using/configure.rst:338 ../../using/configure.rst:1253 +#: ../../using/configure.rst:342 ../../using/configure.rst:1257 msgid "C compiler flags." msgstr "C 編譯器旗標。" -#: ../../using/configure.rst:342 -#, fuzzy +#: ../../using/configure.rst:346 msgid "C preprocessor command." -msgstr "C 編譯器指令。" +msgstr "C 預處理器指令。" -#: ../../using/configure.rst:346 +#: ../../using/configure.rst:350 msgid "C preprocessor flags, e.g. :samp:`-I{include_dir}`." -msgstr "" +msgstr "C 預處理器旗標,例如::samp:`-I{include_dir}`。" -#: ../../using/configure.rst:350 ../../using/configure.rst:792 +#: ../../using/configure.rst:354 ../../using/configure.rst:796 msgid "Linker options" msgstr "" -#: ../../using/configure.rst:354 +#: ../../using/configure.rst:358 msgid "Linker flags, e.g. :samp:`-L{library_directory}`." msgstr "" -#: ../../using/configure.rst:358 +#: ../../using/configure.rst:362 msgid "Libraries to pass to the linker, e.g. :samp:`-l{library}`." msgstr "" -#: ../../using/configure.rst:362 +#: ../../using/configure.rst:366 msgid "Name for machine-dependent library files." msgstr "" -#: ../../using/configure.rst:366 +#: ../../using/configure.rst:370 msgid "Options for third-party dependencies" msgstr "" -#: ../../using/configure.rst:373 +#: ../../using/configure.rst:377 msgid "" "C compiler and linker flags to link Python to ``libbz2``, used by :mod:`bz2` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:379 +#: ../../using/configure.rst:383 msgid "" -"C compiler and linker flags for ``libncurses`` or ``libncursesw``, used by :" -"mod:`curses` module, overriding ``pkg-config``." +"C compiler and linker flags for ``libncurses`` or ``libncursesw``, used " +"by :mod:`curses` module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:385 +#: ../../using/configure.rst:389 msgid "C compiler and linker flags for ``gdbm``." msgstr "" -#: ../../using/configure.rst:390 +#: ../../using/configure.rst:394 msgid "" "C compiler and linker flags for ``libb2`` (:ref:`BLAKE2 `), " "used by :mod:`hashlib` module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:396 +#: ../../using/configure.rst:400 msgid "" "C compiler and linker flags for ``libedit``, used by :mod:`readline` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:402 +#: ../../using/configure.rst:406 msgid "" "C compiler and linker flags for ``libffi``, used by :mod:`ctypes` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:408 +#: ../../using/configure.rst:412 msgid "" "C compiler and linker flags for ``libmpdec``, used by :mod:`decimal` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:413 +#: ../../using/configure.rst:417 msgid "" "These environment variables have no effect unless :option:`--with-system-" "libmpdec` is specified." msgstr "" -#: ../../using/configure.rst:419 +#: ../../using/configure.rst:423 msgid "" "C compiler and linker flags for ``liblzma``, used by :mod:`lzma` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:425 +#: ../../using/configure.rst:429 msgid "" "C compiler and linker flags for ``libreadline``, used by :mod:`readline` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:431 +#: ../../using/configure.rst:435 msgid "" "C compiler and linker flags for ``libsqlite3``, used by :mod:`sqlite3` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:437 +#: ../../using/configure.rst:441 msgid "" "C compiler and linker flags for ``libuuid``, used by :mod:`uuid` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:443 +#: ../../using/configure.rst:447 msgid "C compiler and linker flags for PANEL, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:445 +#: ../../using/configure.rst:449 msgid "" -"C compiler and linker flags for ``libpanel`` or ``libpanelw``, used by :mod:" -"`curses.panel` module, overriding ``pkg-config``." +"C compiler and linker flags for ``libpanel`` or ``libpanelw``, used " +"by :mod:`curses.panel` module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:451 +#: ../../using/configure.rst:455 msgid "C compiler and linker flags for TCLTK, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:456 +#: ../../using/configure.rst:460 msgid "" "C compiler and linker flags for ``libzlib``, used by :mod:`gzip` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:461 +#: ../../using/configure.rst:465 msgid "WebAssembly Options" msgstr "WebAssembly 選項" -#: ../../using/configure.rst:465 +#: ../../using/configure.rst:469 msgid "Set build flavor for ``wasm32-emscripten``." msgstr "" -#: ../../using/configure.rst:467 +#: ../../using/configure.rst:471 msgid "``browser`` (default): preload minimal stdlib, default MEMFS." msgstr "" -#: ../../using/configure.rst:468 +#: ../../using/configure.rst:472 msgid "``node``: NODERAWFS and pthread support." msgstr "``node``:對 NODERAWFS 和 pthread 支援。" -#: ../../using/configure.rst:474 +#: ../../using/configure.rst:478 msgid "Turn on dynamic linking support for WASM." msgstr "" -#: ../../using/configure.rst:476 +#: ../../using/configure.rst:480 msgid "" "Dynamic linking enables ``dlopen``. File size of the executable increases " "due to limited dead code elimination and additional features." msgstr "" -#: ../../using/configure.rst:483 +#: ../../using/configure.rst:487 msgid "Turn on pthreads support for WASM." msgstr "" -#: ../../using/configure.rst:489 +#: ../../using/configure.rst:493 msgid "Install Options" msgstr "安裝選項" -#: ../../using/configure.rst:493 +#: ../../using/configure.rst:497 msgid "" -"Install architecture-independent files in PREFIX. On Unix, it defaults to :" -"file:`/usr/local`." +"Install architecture-independent files in PREFIX. On Unix, it defaults " +"to :file:`/usr/local`." msgstr "" -#: ../../using/configure.rst:496 +#: ../../using/configure.rst:500 msgid "This value can be retrieved at runtime using :data:`sys.prefix`." msgstr "這個值可以在 runtime 使用 :data:`sys.prefix` 取得。" -#: ../../using/configure.rst:498 +#: ../../using/configure.rst:502 msgid "" "As an example, one can use ``--prefix=\"$HOME/.local/\"`` to install a " "Python in its home directory." msgstr "" -#: ../../using/configure.rst:503 +#: ../../using/configure.rst:507 msgid "" "Install architecture-dependent files in EPREFIX, defaults to :option:`--" "prefix`." msgstr "" -#: ../../using/configure.rst:505 +#: ../../using/configure.rst:509 msgid "This value can be retrieved at runtime using :data:`sys.exec_prefix`." msgstr "這個值可以在 runtime 使用 :data:`sys.exec_prefix` 取得" -#: ../../using/configure.rst:509 +#: ../../using/configure.rst:513 msgid "" -"Don't build nor install test modules, like the :mod:`test` package or the :" -"mod:`!_testcapi` extension module (built and installed by default)." +"Don't build nor install test modules, like the :mod:`test` package or " +"the :mod:`!_testcapi` extension module (built and installed by default)." msgstr "" -#: ../../using/configure.rst:516 +#: ../../using/configure.rst:520 msgid "Select the :mod:`ensurepip` command run on Python installation:" msgstr "選擇在 Python 安裝時執行的 :mod:`ensurepip` 命令:" -#: ../../using/configure.rst:518 +#: ../../using/configure.rst:522 msgid "" "``upgrade`` (default): run ``python -m ensurepip --altinstall --upgrade`` " "command." @@ -803,45 +799,45 @@ msgstr "" "``upgrade`` (預設):執行 ``python -m ensurepip --altinstall --upgrade`` 命" "令。" -#: ../../using/configure.rst:520 +#: ../../using/configure.rst:524 msgid "``install``: run ``python -m ensurepip --altinstall`` command;" msgstr "``install``:執行 ``python -m ensurepip --altinstall`` 命令;" -#: ../../using/configure.rst:521 +#: ../../using/configure.rst:525 msgid "``no``: don't run ensurepip;" msgstr "``no``:不要執行 ensurepip;" -#: ../../using/configure.rst:527 +#: ../../using/configure.rst:531 msgid "Performance options" msgstr "" -#: ../../using/configure.rst:529 +#: ../../using/configure.rst:533 msgid "" "Configuring Python using ``--enable-optimizations --with-lto`` (PGO + LTO) " "is recommended for best performance. The experimental ``--enable-bolt`` flag " "can also be used to improve performance." msgstr "" -#: ../../using/configure.rst:535 +#: ../../using/configure.rst:539 msgid "" "Enable Profile Guided Optimization (PGO) using :envvar:`PROFILE_TASK` " "(disabled by default)." msgstr "" -#: ../../using/configure.rst:538 +#: ../../using/configure.rst:542 msgid "" "The C compiler Clang requires ``llvm-profdata`` program for PGO. On macOS, " "GCC also requires it: GCC is just an alias to Clang on macOS." msgstr "" -#: ../../using/configure.rst:541 +#: ../../using/configure.rst:545 msgid "" "Disable also semantic interposition in libpython if ``--enable-shared`` and " "GCC is used: add ``-fno-semantic-interposition`` to the compiler and linker " "flags." msgstr "" -#: ../../using/configure.rst:547 +#: ../../using/configure.rst:551 msgid "" "During the build, you may encounter compiler warnings about profile data not " "being available for some source files. These warnings are harmless, as only " @@ -850,58 +846,58 @@ msgid "" "profile-instr-unprofiled`` to :envvar:`CFLAGS`." msgstr "" -#: ../../using/configure.rst:556 +#: ../../using/configure.rst:560 msgid "Use ``-fno-semantic-interposition`` on GCC." msgstr "在 GCC 上使用 ``-fno-semantic-interposition``。" -#: ../../using/configure.rst:561 +#: ../../using/configure.rst:565 msgid "" "Environment variable used in the Makefile: Python command line arguments for " "the PGO generation task." msgstr "" -#: ../../using/configure.rst:564 +#: ../../using/configure.rst:568 msgid "Default: ``-m test --pgo --timeout=$(TESTTIMEOUT)``." msgstr "預設值:``-m test --pgo --timeout=$(TESTTIMEOUT)``。" -#: ../../using/configure.rst:568 +#: ../../using/configure.rst:572 msgid "Task failure is no longer ignored silently." msgstr "" -#: ../../using/configure.rst:573 +#: ../../using/configure.rst:577 msgid "Enable Link Time Optimization (LTO) in any build (disabled by default)." msgstr "" -#: ../../using/configure.rst:575 +#: ../../using/configure.rst:579 msgid "" "The C compiler Clang requires ``llvm-ar`` for LTO (``ar`` on macOS), as well " "as an LTO-aware linker (``ld.gold`` or ``lld``)." msgstr "" -#: ../../using/configure.rst:580 +#: ../../using/configure.rst:584 msgid "To use ThinLTO feature, use ``--with-lto=thin`` on Clang." msgstr "" -#: ../../using/configure.rst:583 +#: ../../using/configure.rst:587 msgid "" "Use ThinLTO as the default optimization policy on Clang if the compiler " "accepts the flag." msgstr "" -#: ../../using/configure.rst:588 +#: ../../using/configure.rst:592 msgid "" "Enable usage of the `BOLT post-link binary optimizer `_ (disabled by default)." msgstr "" -#: ../../using/configure.rst:592 +#: ../../using/configure.rst:596 msgid "" "BOLT is part of the LLVM project but is not always included in their binary " "distributions. This flag requires that ``llvm-bolt`` and ``merge-fdata`` are " "available." msgstr "" -#: ../../using/configure.rst:596 +#: ../../using/configure.rst:600 msgid "" "BOLT is still a fairly new project so this flag should be considered " "experimental for now. Because this tool operates on machine code its success " @@ -912,124 +908,124 @@ msgid "" "encouraged." msgstr "" -#: ../../using/configure.rst:604 +#: ../../using/configure.rst:608 msgid "" -"The :envvar:`!BOLT_INSTRUMENT_FLAGS` and :envvar:`!BOLT_APPLY_FLAGS` :" -"program:`configure` variables can be defined to override the default set of " -"arguments for :program:`llvm-bolt` to instrument and apply BOLT data to " -"binaries, respectively." +"The :envvar:`!BOLT_INSTRUMENT_FLAGS` and :envvar:`!" +"BOLT_APPLY_FLAGS` :program:`configure` variables can be defined to override " +"the default set of arguments for :program:`llvm-bolt` to instrument and " +"apply BOLT data to binaries, respectively." msgstr "" -#: ../../using/configure.rst:613 +#: ../../using/configure.rst:617 msgid "" "Arguments to ``llvm-bolt`` when creating a `BOLT optimized binary `_." msgstr "" -#: ../../using/configure.rst:620 +#: ../../using/configure.rst:624 msgid "Arguments to ``llvm-bolt`` when instrumenting binaries." msgstr "" -#: ../../using/configure.rst:626 +#: ../../using/configure.rst:630 msgid "" "Enable computed gotos in evaluation loop (enabled by default on supported " "compilers)." msgstr "" -#: ../../using/configure.rst:631 +#: ../../using/configure.rst:635 msgid "" "Disable the fast :ref:`mimalloc ` allocator (enabled by default)." msgstr "" -#: ../../using/configure.rst:634 ../../using/configure.rst:641 +#: ../../using/configure.rst:638 ../../using/configure.rst:645 msgid "See also :envvar:`PYTHONMALLOC` environment variable." msgstr "另請參閱 :envvar:`PYTHONMALLOC` 環境變數。" -#: ../../using/configure.rst:638 +#: ../../using/configure.rst:642 msgid "" "Disable the specialized Python memory allocator :ref:`pymalloc ` " "(enabled by default)." msgstr "" -#: ../../using/configure.rst:645 +#: ../../using/configure.rst:649 msgid "" "Disable static documentation strings to reduce the memory footprint (enabled " "by default). Documentation strings defined in Python are not affected." msgstr "" -#: ../../using/configure.rst:648 +#: ../../using/configure.rst:652 msgid "Don't define the ``WITH_DOC_STRINGS`` macro." msgstr "不要定義 ``WITH_DOC_STRINGS`` 巨集。" -#: ../../using/configure.rst:650 +#: ../../using/configure.rst:654 msgid "See the ``PyDoc_STRVAR()`` macro." msgstr "請見 ``PyDoc_STRVAR()`` 巨集。" -#: ../../using/configure.rst:654 +#: ../../using/configure.rst:658 msgid "Enable C-level code profiling with ``gprof`` (disabled by default)." msgstr "" -#: ../../using/configure.rst:658 +#: ../../using/configure.rst:662 msgid "" "Add ``-fstrict-overflow`` to the C compiler flags (by default we add ``-fno-" "strict-overflow`` instead)." msgstr "" -#: ../../using/configure.rst:665 +#: ../../using/configure.rst:669 msgid "Python Debug Build" msgstr "" -#: ../../using/configure.rst:667 +#: ../../using/configure.rst:671 msgid "" "A debug build is Python built with the :option:`--with-pydebug` configure " "option." msgstr "" -#: ../../using/configure.rst:670 +#: ../../using/configure.rst:674 msgid "Effects of a debug build:" msgstr "" -#: ../../using/configure.rst:672 +#: ../../using/configure.rst:676 msgid "" "Display all warnings by default: the list of default warning filters is " "empty in the :mod:`warnings` module." msgstr "" -#: ../../using/configure.rst:674 +#: ../../using/configure.rst:678 msgid "Add ``d`` to :data:`sys.abiflags`." msgstr "新增 ``d`` 到 :data:`sys.abiflags`。" -#: ../../using/configure.rst:675 +#: ../../using/configure.rst:679 msgid "Add :func:`!sys.gettotalrefcount` function." msgstr "新增 :func:`!sys.gettotalrefcount` 函式。" -#: ../../using/configure.rst:676 +#: ../../using/configure.rst:680 msgid "Add :option:`-X showrefcount <-X>` command line option." msgstr "新增 :option:`-X showrefcount <-X>` 命令列選項。" -#: ../../using/configure.rst:677 +#: ../../using/configure.rst:681 msgid "" "Add :option:`-d` command line option and :envvar:`PYTHONDEBUG` environment " "variable to debug the parser." msgstr "" -#: ../../using/configure.rst:679 +#: ../../using/configure.rst:683 msgid "" "Add support for the ``__lltrace__`` variable: enable low-level tracing in " "the bytecode evaluation loop if the variable is defined." msgstr "" -#: ../../using/configure.rst:681 +#: ../../using/configure.rst:685 msgid "" "Install :ref:`debug hooks on memory allocators ` " "to detect buffer overflow and other memory errors." msgstr "" -#: ../../using/configure.rst:683 +#: ../../using/configure.rst:687 msgid "Define ``Py_DEBUG`` and ``Py_REF_DEBUG`` macros." msgstr "定義 ``Py_DEBUG`` 和 ``Py_REF_DEBUG`` 巨集。" -#: ../../using/configure.rst:684 +#: ../../using/configure.rst:688 msgid "" "Add runtime checks: code surrounded by ``#ifdef Py_DEBUG`` and ``#endif``. " "Enable ``assert(...)`` and ``_PyObject_ASSERT(...)`` assertions: don't set " @@ -1037,388 +1033,385 @@ msgid "" "option). Main runtime checks:" msgstr "" -#: ../../using/configure.rst:689 +#: ../../using/configure.rst:693 msgid "Add sanity checks on the function arguments." msgstr "" -#: ../../using/configure.rst:690 +#: ../../using/configure.rst:694 msgid "" "Unicode and int objects are created with their memory filled with a pattern " "to detect usage of uninitialized objects." msgstr "" -#: ../../using/configure.rst:692 +#: ../../using/configure.rst:696 msgid "" "Ensure that functions which can clear or replace the current exception are " "not called with an exception raised." msgstr "" -#: ../../using/configure.rst:694 +#: ../../using/configure.rst:698 msgid "Check that deallocator functions don't change the current exception." msgstr "" -#: ../../using/configure.rst:695 +#: ../../using/configure.rst:699 msgid "" "The garbage collector (:func:`gc.collect` function) runs some basic checks " "on objects consistency." msgstr "" -#: ../../using/configure.rst:697 +#: ../../using/configure.rst:701 msgid "" "The :c:macro:`!Py_SAFE_DOWNCAST()` macro checks for integer underflow and " "overflow when downcasting from wide types to narrow types." msgstr "" -#: ../../using/configure.rst:700 +#: ../../using/configure.rst:704 msgid "" "See also the :ref:`Python Development Mode ` and the :option:`--" "with-trace-refs` configure option." msgstr "" -#: ../../using/configure.rst:703 +#: ../../using/configure.rst:707 msgid "" "Release builds and debug builds are now ABI compatible: defining the " -"``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` macro (see the :" -"option:`--with-trace-refs` option)." +"``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` macro (see " +"the :option:`--with-trace-refs` option)." msgstr "" -#: ../../using/configure.rst:710 +#: ../../using/configure.rst:714 msgid "Debug options" msgstr "" -#: ../../using/configure.rst:714 +#: ../../using/configure.rst:718 msgid "" ":ref:`Build Python in debug mode `: define the ``Py_DEBUG`` " "macro (disabled by default)." msgstr "" -#: ../../using/configure.rst:719 +#: ../../using/configure.rst:723 msgid "Enable tracing references for debugging purpose (disabled by default)." msgstr "" -#: ../../using/configure.rst:723 +#: ../../using/configure.rst:727 msgid "Define the ``Py_TRACE_REFS`` macro." msgstr "定義 ``Py_TRACE_REFS`` 巨集。" -#: ../../using/configure.rst:724 -#, fuzzy +#: ../../using/configure.rst:728 msgid "Add :func:`sys.getobjects` function." -msgstr "新增 :func:`!sys.getobjects` 函式。" +msgstr "新增 :func:`sys.getobjects` 函式。" -#: ../../using/configure.rst:725 +#: ../../using/configure.rst:729 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." msgstr "新增 :envvar:`PYTHONDUMPREFS` 環境變數。" -#: ../../using/configure.rst:727 +#: ../../using/configure.rst:731 msgid "" "The :envvar:`PYTHONDUMPREFS` environment variable can be used to dump " "objects and reference counts still alive at Python exit." msgstr "" -#: ../../using/configure.rst:730 +#: ../../using/configure.rst:734 msgid ":ref:`Statically allocated objects ` are not traced." msgstr "" -#: ../../using/configure.rst:734 +#: ../../using/configure.rst:738 msgid "" "This build is now ABI compatible with release build and :ref:`debug build " "`." msgstr "" -#: ../../using/configure.rst:740 +#: ../../using/configure.rst:744 msgid "" "Build with C assertions enabled (default is no): ``assert(...);`` and " "``_PyObject_ASSERT(...);``." msgstr "" -#: ../../using/configure.rst:743 +#: ../../using/configure.rst:747 msgid "" "If set, the ``NDEBUG`` macro is not defined in the :envvar:`OPT` compiler " "variable." msgstr "" -#: ../../using/configure.rst:746 +#: ../../using/configure.rst:750 msgid "" "See also the :option:`--with-pydebug` option (:ref:`debug build `) which also enables assertions." msgstr "" -#: ../../using/configure.rst:753 +#: ../../using/configure.rst:757 msgid "Enable Valgrind support (default is no)." msgstr "啟用 Valgrind 支援(預設不啟用)。" -#: ../../using/configure.rst:757 +#: ../../using/configure.rst:761 msgid "Enable DTrace support (default is no)." msgstr "啟用 DTrace 支援(預設不啟用)。" -#: ../../using/configure.rst:759 +#: ../../using/configure.rst:763 msgid "" "See :ref:`Instrumenting CPython with DTrace and SystemTap `." msgstr "" -#: ../../using/configure.rst:766 +#: ../../using/configure.rst:770 msgid "" "Enable AddressSanitizer memory error detector, ``asan`` (default is no)." msgstr "" -#: ../../using/configure.rst:772 +#: ../../using/configure.rst:776 msgid "" "Enable MemorySanitizer allocation error detector, ``msan`` (default is no)." msgstr "" -#: ../../using/configure.rst:778 +#: ../../using/configure.rst:782 msgid "" "Enable UndefinedBehaviorSanitizer undefined behaviour detector, ``ubsan`` " "(default is no)." msgstr "" -#: ../../using/configure.rst:785 -#, fuzzy +#: ../../using/configure.rst:789 msgid "Enable ThreadSanitizer data race detector, ``tsan`` (default is no)." -msgstr "啟用 DTrace 支援(預設不啟用)。" +msgstr "啟用 ThreadSanitizer 資料競爭偵測器 ``tsan``\\ (預設不啟用)。" -#: ../../using/configure.rst:796 +#: ../../using/configure.rst:800 msgid "Enable building a shared Python library: ``libpython`` (default is no)." msgstr "" -#: ../../using/configure.rst:800 +#: ../../using/configure.rst:804 msgid "" "Do not build ``libpythonMAJOR.MINOR.a`` and do not install ``python.o`` " "(built and enabled by default)." msgstr "" -#: ../../using/configure.rst:807 +#: ../../using/configure.rst:811 msgid "Libraries options" msgstr "函式庫選項" -#: ../../using/configure.rst:811 +#: ../../using/configure.rst:815 msgid "Link against additional libraries (default is no)." msgstr "" -#: ../../using/configure.rst:815 +#: ../../using/configure.rst:819 msgid "" "Build the :mod:`!pyexpat` module using an installed ``expat`` library " "(default is no)." msgstr "" -#: ../../using/configure.rst:820 +#: ../../using/configure.rst:824 msgid "" "Build the ``_decimal`` extension module using an installed ``mpdecimal`` " "library, see the :mod:`decimal` module (default is yes)." msgstr "" -#: ../../using/configure.rst:825 +#: ../../using/configure.rst:829 msgid "Default to using the installed ``mpdecimal`` library." msgstr "" -#: ../../using/configure.rst:828 +#: ../../using/configure.rst:832 msgid "" "A copy of the ``mpdecimal`` library sources will no longer be distributed " "with Python 3.15." msgstr "" -#: ../../using/configure.rst:832 +#: ../../using/configure.rst:836 msgid ":option:`LIBMPDEC_CFLAGS` and :option:`LIBMPDEC_LIBS`." -msgstr "" +msgstr ":option:`LIBMPDEC_CFLAGS` 和 :option:`LIBMPDEC_LIBS`。" -#: ../../using/configure.rst:836 +#: ../../using/configure.rst:840 msgid "Designate a backend library for the :mod:`readline` module." msgstr "" -#: ../../using/configure.rst:838 +#: ../../using/configure.rst:842 msgid "readline: Use readline as the backend." msgstr "" -#: ../../using/configure.rst:839 +#: ../../using/configure.rst:843 msgid "editline: Use editline as the backend." msgstr "" -#: ../../using/configure.rst:845 +#: ../../using/configure.rst:849 msgid "Don't build the :mod:`readline` module (built by default)." -msgstr "" +msgstr "不要建置 :mod:`readline` 模組(預設會建置)。" -#: ../../using/configure.rst:847 +#: ../../using/configure.rst:851 msgid "Don't define the ``HAVE_LIBREADLINE`` macro." msgstr "不要定義 ``HAVE_LIBREADLINE`` 巨集。" -#: ../../using/configure.rst:853 +#: ../../using/configure.rst:857 msgid "" "Override ``libm`` math library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:857 +#: ../../using/configure.rst:861 msgid "Override ``libc`` C library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:861 +#: ../../using/configure.rst:865 msgid "Root of the OpenSSL directory." -msgstr "" +msgstr "OpenSSL 目錄的根目錄。" -#: ../../using/configure.rst:867 +#: ../../using/configure.rst:871 msgid "Set runtime library directory (rpath) for OpenSSL libraries:" msgstr "" -#: ../../using/configure.rst:869 +#: ../../using/configure.rst:873 msgid "``no`` (default): don't set rpath;" msgstr "" -#: ../../using/configure.rst:870 +#: ../../using/configure.rst:874 msgid "" "``auto``: auto-detect rpath from :option:`--with-openssl` and ``pkg-config``;" msgstr "" -#: ../../using/configure.rst:872 +#: ../../using/configure.rst:876 msgid "*DIR*: set an explicit rpath." msgstr "" -#: ../../using/configure.rst:878 +#: ../../using/configure.rst:882 msgid "Security Options" -msgstr "" +msgstr "安全性選項" -#: ../../using/configure.rst:882 +#: ../../using/configure.rst:886 msgid "Select hash algorithm for use in ``Python/pyhash.c``:" msgstr "" -#: ../../using/configure.rst:884 +#: ../../using/configure.rst:888 msgid "``siphash13`` (default);" -msgstr "" +msgstr "``siphash13``\\ (預設);" -#: ../../using/configure.rst:885 +#: ../../using/configure.rst:889 msgid "``siphash24``;" msgstr "``siphash24``;" -#: ../../using/configure.rst:886 +#: ../../using/configure.rst:890 msgid "``fnv``." msgstr "``fnv``。" -#: ../../using/configure.rst:890 +#: ../../using/configure.rst:894 msgid "``siphash13`` is added and it is the new default." msgstr "" -#: ../../using/configure.rst:895 +#: ../../using/configure.rst:899 msgid "Built-in hash modules:" msgstr "內建雜湊模組:" -#: ../../using/configure.rst:897 +#: ../../using/configure.rst:901 msgid "``md5``;" msgstr "``md5``;" -#: ../../using/configure.rst:898 +#: ../../using/configure.rst:902 msgid "``sha1``;" msgstr "``sha1``;" -#: ../../using/configure.rst:899 +#: ../../using/configure.rst:903 msgid "``sha256``;" msgstr "``sha256``;" -#: ../../using/configure.rst:900 +#: ../../using/configure.rst:904 msgid "``sha512``;" msgstr "``sha512``;" -#: ../../using/configure.rst:901 +#: ../../using/configure.rst:905 msgid "``sha3`` (with shake);" msgstr "" -#: ../../using/configure.rst:902 +#: ../../using/configure.rst:906 msgid "``blake2``." msgstr "``blake2``。" -#: ../../using/configure.rst:908 +#: ../../using/configure.rst:912 msgid "Override the OpenSSL default cipher suites string:" msgstr "" -#: ../../using/configure.rst:910 +#: ../../using/configure.rst:914 msgid "``python`` (default): use Python's preferred selection;" msgstr "" -#: ../../using/configure.rst:911 +#: ../../using/configure.rst:915 msgid "``openssl``: leave OpenSSL's defaults untouched;" msgstr "" -#: ../../using/configure.rst:912 +#: ../../using/configure.rst:916 msgid "*STRING*: use a custom string" msgstr "" -#: ../../using/configure.rst:914 +#: ../../using/configure.rst:918 msgid "See the :mod:`ssl` module." msgstr "請見 :mod:`ssl` 模組。" -#: ../../using/configure.rst:920 +#: ../../using/configure.rst:924 msgid "" "The settings ``python`` and *STRING* also set TLS 1.2 as minimum protocol " "version." msgstr "" -#: ../../using/configure.rst:924 +#: ../../using/configure.rst:928 msgid "macOS Options" msgstr "macOS 選項" -#: ../../using/configure.rst:926 -#, fuzzy +#: ../../using/configure.rst:930 msgid "See :source:`Mac/README.rst`." -msgstr "參閱 ``Mac/README.rst``。" +msgstr "參閱 :source:`Mac/README.rst`。" -#: ../../using/configure.rst:931 +#: ../../using/configure.rst:935 msgid "" "Create a universal binary build. *SDKDIR* specifies which macOS SDK should " "be used to perform the build (default is no)." msgstr "" -#: ../../using/configure.rst:937 +#: ../../using/configure.rst:941 msgid "" "Create a Python.framework rather than a traditional Unix install. Optional " "*INSTALLDIR* specifies the installation path (default is no)." msgstr "" -#: ../../using/configure.rst:942 +#: ../../using/configure.rst:946 msgid "" "Specify the kind of universal binary that should be created. This option is " "only valid when :option:`--enable-universalsdk` is set." msgstr "" -#: ../../using/configure.rst:945 +#: ../../using/configure.rst:949 msgid "Options:" msgstr "選項:" -#: ../../using/configure.rst:947 +#: ../../using/configure.rst:951 msgid "``universal2``;" msgstr "``universal2``;" -#: ../../using/configure.rst:948 +#: ../../using/configure.rst:952 msgid "``32-bit``;" msgstr "``32-bit``;" -#: ../../using/configure.rst:949 +#: ../../using/configure.rst:953 msgid "``64-bit``;" msgstr "``64-bit``;" -#: ../../using/configure.rst:950 +#: ../../using/configure.rst:954 msgid "``3-way``;" msgstr "``3-way``;" -#: ../../using/configure.rst:951 +#: ../../using/configure.rst:955 msgid "``intel``;" msgstr "``intel``;" -#: ../../using/configure.rst:952 +#: ../../using/configure.rst:956 msgid "``intel-32``;" msgstr "``intel-32``;" -#: ../../using/configure.rst:953 +#: ../../using/configure.rst:957 msgid "``intel-64``;" msgstr "``intel-64``;" -#: ../../using/configure.rst:954 +#: ../../using/configure.rst:958 msgid "``all``." msgstr "``all``。" -#: ../../using/configure.rst:958 +#: ../../using/configure.rst:962 msgid "" -"Specify the name for the python framework on macOS only valid when :option:" -"`--enable-framework` is set (default: ``Python``)." +"Specify the name for the python framework on macOS only valid " +"when :option:`--enable-framework` is set (default: ``Python``)." msgstr "" -#: ../../using/configure.rst:964 +#: ../../using/configure.rst:968 msgid "" "The Python standard library contains strings that are known to trigger " "automated inspection tool errors when submitted for distribution by the " @@ -1427,31 +1420,29 @@ msgid "" "can also be specified. This option is disabled by default." msgstr "" -#: ../../using/configure.rst:973 -#, fuzzy +#: ../../using/configure.rst:977 msgid "iOS Options" -msgstr "macOS 選項" +msgstr "iOS 選項" -#: ../../using/configure.rst:975 -#, fuzzy +#: ../../using/configure.rst:979 msgid "See :source:`iOS/README.rst`." -msgstr "參閱 ``Mac/README.rst``。" +msgstr "參閱 :source:`iOS/README.rst`。" -#: ../../using/configure.rst:979 +#: ../../using/configure.rst:983 msgid "" "Create a Python.framework. Unlike macOS, the *INSTALLDIR* argument " "specifying the installation path is mandatory." msgstr "" -#: ../../using/configure.rst:984 +#: ../../using/configure.rst:988 msgid "Specify the name for the framework (default: ``Python``)." -msgstr "" +msgstr "指定框架的名稱(預設值:``Python``)。" -#: ../../using/configure.rst:988 +#: ../../using/configure.rst:992 msgid "Cross Compiling Options" msgstr "" -#: ../../using/configure.rst:990 +#: ../../using/configure.rst:994 msgid "" "Cross compiling, also known as cross building, can be used to build Python " "for another CPU architecture or platform. Cross compiling requires a Python " @@ -1459,28 +1450,28 @@ msgid "" "match the version of the cross compiled host Python." msgstr "" -#: ../../using/configure.rst:997 +#: ../../using/configure.rst:1001 msgid "" "configure for building on BUILD, usually guessed by :program:`config.guess`." msgstr "" -#: ../../using/configure.rst:1001 +#: ../../using/configure.rst:1005 msgid "cross-compile to build programs to run on HOST (target platform)" msgstr "" -#: ../../using/configure.rst:1005 +#: ../../using/configure.rst:1009 msgid "path to build ``python`` binary for cross compiling" msgstr "" -#: ../../using/configure.rst:1011 +#: ../../using/configure.rst:1015 msgid "An environment variable that points to a file with configure overrides." msgstr "" -#: ../../using/configure.rst:1013 +#: ../../using/configure.rst:1017 msgid "Example *config.site* file:" msgstr "" -#: ../../using/configure.rst:1015 +#: ../../using/configure.rst:1019 msgid "" "# config.site-aarch64\n" "ac_cv_buggy_getaddrinfo=no\n" @@ -1492,15 +1483,15 @@ msgstr "" "ac_cv_file__dev_ptmx=yes\n" "ac_cv_file__dev_ptc=no" -#: ../../using/configure.rst:1024 +#: ../../using/configure.rst:1028 msgid "Program to run CPython for the host platform for cross-compilation." msgstr "" -#: ../../using/configure.rst:1029 +#: ../../using/configure.rst:1033 msgid "Cross compiling example::" msgstr "" -#: ../../using/configure.rst:1031 +#: ../../using/configure.rst:1035 msgid "" "CONFIG_SITE=config.site-aarch64 ../configure \\\n" " --build=x86_64-pc-linux-gnu \\\n" @@ -1512,64 +1503,65 @@ msgstr "" " --host=aarch64-unknown-linux-gnu \\\n" " --with-build-python=../x86_64/python" -#: ../../using/configure.rst:1038 +#: ../../using/configure.rst:1042 msgid "Python Build System" -msgstr "" +msgstr "Python 建置系統" -#: ../../using/configure.rst:1041 +#: ../../using/configure.rst:1045 msgid "Main files of the build system" -msgstr "" +msgstr "建置系統的主要檔案" -#: ../../using/configure.rst:1043 +#: ../../using/configure.rst:1047 msgid ":file:`configure.ac` => :file:`configure`;" -msgstr ":file:`configure.ac` => :file:`configure`\\ ;" +msgstr ":file:`configure.ac` => :file:`configure`;" -#: ../../using/configure.rst:1044 +#: ../../using/configure.rst:1048 msgid "" ":file:`Makefile.pre.in` => :file:`Makefile` (created by :file:`configure`);" msgstr "" +":file:`Makefile.pre.in` => :file:`Makefile`\\ (由 :file:`configure` 建立);" -#: ../../using/configure.rst:1045 +#: ../../using/configure.rst:1049 msgid ":file:`pyconfig.h` (created by :file:`configure`);" -msgstr ":file:`pyconfig.h` (created by :file:`configure`)\\ ;" +msgstr ":file:`pyconfig.h`\\ (由 :file:`configure` 建立);" -#: ../../using/configure.rst:1046 +#: ../../using/configure.rst:1050 msgid "" -":file:`Modules/Setup`: C extensions built by the Makefile using :file:" -"`Module/makesetup` shell script;" +":file:`Modules/Setup`: C extensions built by the Makefile " +"using :file:`Module/makesetup` shell script;" msgstr "" -#: ../../using/configure.rst:1050 +#: ../../using/configure.rst:1054 msgid "Main build steps" msgstr "主要建置步驟" -#: ../../using/configure.rst:1052 +#: ../../using/configure.rst:1056 msgid "C files (``.c``) are built as object files (``.o``)." msgstr "" -#: ../../using/configure.rst:1053 +#: ../../using/configure.rst:1057 msgid "A static ``libpython`` library (``.a``) is created from objects files." msgstr "" -#: ../../using/configure.rst:1054 +#: ../../using/configure.rst:1058 msgid "" "``python.o`` and the static ``libpython`` library are linked into the final " "``python`` program." msgstr "" -#: ../../using/configure.rst:1056 +#: ../../using/configure.rst:1060 msgid "C extensions are built by the Makefile (see :file:`Modules/Setup`)." msgstr "" -#: ../../using/configure.rst:1059 +#: ../../using/configure.rst:1063 msgid "Main Makefile targets" msgstr "主要 Makefile 目標" -#: ../../using/configure.rst:1062 +#: ../../using/configure.rst:1066 msgid "make" -msgstr "" +msgstr "make" -#: ../../using/configure.rst:1064 +#: ../../using/configure.rst:1068 msgid "" "For the most part, when rebuilding after editing some code or refreshing " "your checkout from upstream, all you need to do is execute ``make``, which " @@ -1580,20 +1572,20 @@ msgid "" "all`` will build. The three choices are:" msgstr "" -#: ../../using/configure.rst:1073 +#: ../../using/configure.rst:1077 msgid "``profile-opt`` (configured with ``--enable-optimizations``)" msgstr "" -#: ../../using/configure.rst:1074 +#: ../../using/configure.rst:1078 msgid "``build_wasm`` (configured with ``--with-emscripten-target``)" msgstr "" -#: ../../using/configure.rst:1075 +#: ../../using/configure.rst:1079 msgid "" "``build_all`` (configured without explicitly using either of the others)" msgstr "" -#: ../../using/configure.rst:1077 +#: ../../using/configure.rst:1081 msgid "" "Depending on the most recent source file changes, Make will rebuild any " "targets (object files and executables) deemed out-of-date, including running " @@ -1606,11 +1598,11 @@ msgid "" "problems, at the expense of longer build times." msgstr "" -#: ../../using/configure.rst:1090 +#: ../../using/configure.rst:1094 msgid "make platform" -msgstr "" +msgstr "make platform" -#: ../../using/configure.rst:1092 +#: ../../using/configure.rst:1096 msgid "" "Build the ``python`` program, but don't build the standard library extension " "modules. This generates a file named ``platform`` which contains a single " @@ -1618,82 +1610,81 @@ msgid "" "arm64-3.12`` or ``linux-x86_64-3.13``." msgstr "" -#: ../../using/configure.rst:1099 +#: ../../using/configure.rst:1103 msgid "make profile-opt" -msgstr "" +msgstr "make profile-opt" -#: ../../using/configure.rst:1101 +#: ../../using/configure.rst:1105 msgid "" "Build Python using profile-guided optimization (PGO). You can use the " "configure :option:`--enable-optimizations` option to make this the default " "target of the ``make`` command (``make all`` or just ``make``)." msgstr "" -#: ../../using/configure.rst:1109 +#: ../../using/configure.rst:1113 msgid "make clean" -msgstr "" +msgstr "make clean" -#: ../../using/configure.rst:1111 +#: ../../using/configure.rst:1115 msgid "Remove built files." -msgstr "" +msgstr "移除建置的檔案。" -#: ../../using/configure.rst:1115 +#: ../../using/configure.rst:1119 msgid "make distclean" -msgstr "" +msgstr "make distclean" -#: ../../using/configure.rst:1117 +#: ../../using/configure.rst:1121 msgid "" "In addition to the work done by ``make clean``, remove files created by the " "configure script. ``configure`` will have to be run before building again. " "[#]_" msgstr "" -#: ../../using/configure.rst:1123 +#: ../../using/configure.rst:1127 msgid "make install" -msgstr "" +msgstr "make install" -#: ../../using/configure.rst:1125 +#: ../../using/configure.rst:1129 msgid "Build the ``all`` target and install Python." -msgstr "" +msgstr "建置 ``all`` 目標並安裝 Python。" -#: ../../using/configure.rst:1129 +#: ../../using/configure.rst:1133 msgid "make test" -msgstr "" +msgstr "make test" -#: ../../using/configure.rst:1131 +#: ../../using/configure.rst:1135 msgid "" "Build the ``all`` target and run the Python test suite with the ``--fast-" "ci`` option. Variables:" msgstr "" -#: ../../using/configure.rst:1134 +#: ../../using/configure.rst:1138 msgid "``TESTOPTS``: additional regrtest command-line options." msgstr "" -#: ../../using/configure.rst:1135 +#: ../../using/configure.rst:1139 msgid "``TESTPYTHONOPTS``: additional Python command-line options." msgstr "" -#: ../../using/configure.rst:1136 +#: ../../using/configure.rst:1140 msgid "``TESTTIMEOUT``: timeout in seconds (default: 10 minutes)." msgstr "" -#: ../../using/configure.rst:1140 -#, fuzzy +#: ../../using/configure.rst:1144 msgid "make buildbottest" -msgstr "主要建置步驟" +msgstr "make buildbottest" -#: ../../using/configure.rst:1142 +#: ../../using/configure.rst:1146 msgid "" "This is similar to ``make test``, but uses the ``--slow-ci`` option and " "default timeout of 20 minutes, instead of ``--fast-ci`` option." msgstr "" -#: ../../using/configure.rst:1147 +#: ../../using/configure.rst:1151 msgid "make regen-all" -msgstr "" +msgstr "make regen-all" -#: ../../using/configure.rst:1149 +#: ../../using/configure.rst:1153 msgid "" "Regenerate (almost) all generated files. These include (but are not limited " "to) bytecode cases, and parser generator file. ``make regen-stdlib-module-" @@ -1701,18 +1692,18 @@ msgid "" "files <#generated-files>`_." msgstr "" -#: ../../using/configure.rst:1156 +#: ../../using/configure.rst:1160 msgid "C extensions" msgstr "C 擴充模組" -#: ../../using/configure.rst:1158 +#: ../../using/configure.rst:1162 msgid "" "Some C extensions are built as built-in modules, like the ``sys`` module. " "They are built with the ``Py_BUILD_CORE_BUILTIN`` macro defined. Built-in " "modules have no ``__file__`` attribute:" msgstr "" -#: ../../using/configure.rst:1162 +#: ../../using/configure.rst:1166 msgid "" ">>> import sys\n" ">>> sys\n" @@ -1722,31 +1713,38 @@ msgid "" " File \"\", line 1, in \n" "AttributeError: module 'sys' has no attribute '__file__'" msgstr "" +">>> import sys\n" +">>> sys\n" +"\n" +">>> sys.__file__\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"AttributeError: module 'sys' has no attribute '__file__'" -#: ../../using/configure.rst:1172 +#: ../../using/configure.rst:1176 msgid "" "Other C extensions are built as dynamic libraries, like the ``_asyncio`` " "module. They are built with the ``Py_BUILD_CORE_MODULE`` macro defined. " "Example on Linux x86-64:" msgstr "" -#: ../../using/configure.rst:1176 +#: ../../using/configure.rst:1180 msgid "" ">>> import _asyncio\n" ">>> _asyncio\n" -"\n" +"\n" ">>> _asyncio.__file__\n" "'/usr/lib64/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so'" msgstr "" ">>> import _asyncio\n" ">>> _asyncio\n" -"\n" +"\n" ">>> _asyncio.__file__\n" "'/usr/lib64/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so'" -#: ../../using/configure.rst:1184 +#: ../../using/configure.rst:1188 msgid "" ":file:`Modules/Setup` is used to generate Makefile targets to build C " "extensions. At the beginning of the files, C extensions are built as built-" @@ -1754,304 +1752,307 @@ msgid "" "dynamic libraries." msgstr "" -#: ../../using/configure.rst:1188 +#: ../../using/configure.rst:1192 msgid "" -"The :c:macro:`!PyAPI_FUNC()`, :c:macro:`!PyAPI_DATA()` and :c:macro:" -"`PyMODINIT_FUNC` macros of :file:`Include/exports.h` are defined differently " -"depending if the ``Py_BUILD_CORE_MODULE`` macro is defined:" +"The :c:macro:`!PyAPI_FUNC()`, :c:macro:`!PyAPI_DATA()` " +"and :c:macro:`PyMODINIT_FUNC` macros of :file:`Include/exports.h` are " +"defined differently depending if the ``Py_BUILD_CORE_MODULE`` macro is " +"defined:" msgstr "" -#: ../../using/configure.rst:1192 +#: ../../using/configure.rst:1196 msgid "Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined" msgstr "如果定義了 ``Py_BUILD_CORE_MODULE``,則使用 ``Py_EXPORTED_SYMBOL``" -#: ../../using/configure.rst:1193 +#: ../../using/configure.rst:1197 msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." msgstr "否則使用 ``Py_IMPORTED_SYMBOL``。" -#: ../../using/configure.rst:1195 +#: ../../using/configure.rst:1199 msgid "" "If the ``Py_BUILD_CORE_BUILTIN`` macro is used by mistake on a C extension " "built as a shared library, its :samp:`PyInit_{xxx}()` function is not " "exported, causing an :exc:`ImportError` on import." msgstr "" -#: ../../using/configure.rst:1201 +#: ../../using/configure.rst:1205 msgid "Compiler and linker flags" msgstr "" -#: ../../using/configure.rst:1203 +#: ../../using/configure.rst:1207 msgid "" "Options set by the ``./configure`` script and environment variables and used " "by ``Makefile``." msgstr "" -#: ../../using/configure.rst:1207 +#: ../../using/configure.rst:1211 msgid "Preprocessor flags" -msgstr "" +msgstr "預處理器旗標" -#: ../../using/configure.rst:1211 +#: ../../using/configure.rst:1215 msgid "" "Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1217 +#: ../../using/configure.rst:1221 msgid "" "(Objective) C/C++ preprocessor flags, e.g. :samp:`-I{include_dir}` if you " "have headers in a nonstandard directory *include_dir*." msgstr "" -#: ../../using/configure.rst:1220 ../../using/configure.rst:1410 +#: ../../using/configure.rst:1224 ../../using/configure.rst:1414 msgid "" "Both :envvar:`CPPFLAGS` and :envvar:`LDFLAGS` need to contain the shell's " "value to be able to build extension modules using the directories specified " "in the environment variables." msgstr "" -#: ../../using/configure.rst:1230 +#: ../../using/configure.rst:1234 msgid "" "Extra preprocessor flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1232 +#: ../../using/configure.rst:1236 msgid "" -"Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " -"$(CPPFLAGS)``." +"Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $" +"(CPPFLAGS)``." msgstr "" -#: ../../using/configure.rst:1237 +#: ../../using/configure.rst:1241 msgid "Compiler flags" msgstr "編譯器旗標" -#: ../../using/configure.rst:1243 +#: ../../using/configure.rst:1247 msgid "Example: ``gcc -pthread``." -msgstr "" +msgstr "範例:``gcc -pthread``。" -#: ../../using/configure.rst:1247 +#: ../../using/configure.rst:1251 msgid "C++ compiler command." msgstr "C++ 編譯器指令。" -#: ../../using/configure.rst:1249 +#: ../../using/configure.rst:1253 msgid "Example: ``g++ -pthread``." msgstr "範例:``g++ -pthread``。" -#: ../../using/configure.rst:1257 +#: ../../using/configure.rst:1261 msgid "" ":envvar:`CFLAGS_NODIST` is used for building the interpreter and stdlib C " -"extensions. Use it when a compiler flag should *not* be part of :envvar:" -"`CFLAGS` once Python is installed (:gh:`65320`)." +"extensions. Use it when a compiler flag should *not* be part " +"of :envvar:`CFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:1261 +#: ../../using/configure.rst:1265 msgid "In particular, :envvar:`CFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:1263 +#: ../../using/configure.rst:1267 msgid "" "the compiler flag ``-I`` (for setting the search path for include files). " -"The ``-I`` flags are processed from left to right, and any flags in :envvar:" -"`CFLAGS` would take precedence over user- and package-supplied ``-I`` flags." +"The ``-I`` flags are processed from left to right, and any flags " +"in :envvar:`CFLAGS` would take precedence over user- and package-supplied ``-" +"I`` flags." msgstr "" -#: ../../using/configure.rst:1268 +#: ../../using/configure.rst:1272 msgid "" "hardening flags such as ``-Werror`` because distributions cannot control " "whether packages installed by users conform to such heightened standards." msgstr "" -#: ../../using/configure.rst:1276 +#: ../../using/configure.rst:1280 msgid "" "Options passed to the :mod:`compileall` command line when building PYC files " "in ``make install``. Default: ``-j0``." msgstr "" -#: ../../using/configure.rst:1283 +#: ../../using/configure.rst:1287 msgid "Extra C compiler flags." msgstr "額外的 C 編譯器旗標。" -#: ../../using/configure.rst:1287 +#: ../../using/configure.rst:1291 msgid "" "Value of :envvar:`CFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1294 +#: ../../using/configure.rst:1298 msgid "" "Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:1301 +#: ../../using/configure.rst:1305 msgid "Base compiler flags." msgstr "基本編譯器旗標。" -#: ../../using/configure.rst:1305 +#: ../../using/configure.rst:1309 msgid "Optimization flags." msgstr "最佳化旗標。" -#: ../../using/configure.rst:1309 +#: ../../using/configure.rst:1313 msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" -#: ../../using/configure.rst:1315 +#: ../../using/configure.rst:1319 msgid "Compiler flags used to build a shared library." msgstr "" -#: ../../using/configure.rst:1317 +#: ../../using/configure.rst:1321 msgid "For example, ``-fPIC`` is used on Linux and on BSD." msgstr "例如說 ``-fPIC`` 被使用於 Linux 與 BSD 上。" -#: ../../using/configure.rst:1321 +#: ../../using/configure.rst:1325 msgid "Extra C flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1323 +#: ../../using/configure.rst:1327 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" -#: ../../using/configure.rst:1328 +#: ../../using/configure.rst:1332 msgid "" -"Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " -"$(EXTRA_CFLAGS)``." +"Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $" +"(EXTRA_CFLAGS)``." msgstr "" -#: ../../using/configure.rst:1332 +#: ../../using/configure.rst:1336 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." msgstr "" -#: ../../using/configure.rst:1338 +#: ../../using/configure.rst:1342 msgid "C flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1340 +#: ../../using/configure.rst:1344 msgid "" -"Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " -"$(CFLAGSFORSHARED)``." +"Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $" +"(CFLAGSFORSHARED)``." msgstr "" -#: ../../using/configure.rst:1346 +#: ../../using/configure.rst:1350 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." msgstr "" -#: ../../using/configure.rst:1352 +#: ../../using/configure.rst:1356 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" -#: ../../using/configure.rst:1355 +#: ../../using/configure.rst:1359 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." msgstr "" -#: ../../using/configure.rst:1361 +#: ../../using/configure.rst:1365 msgid "Purify command. Purify is a memory debugger program." msgstr "" -#: ../../using/configure.rst:1363 +#: ../../using/configure.rst:1367 msgid "Default: empty string (not used)." msgstr "" -#: ../../using/configure.rst:1367 +#: ../../using/configure.rst:1371 msgid "Linker flags" msgstr "" -#: ../../using/configure.rst:1371 +#: ../../using/configure.rst:1375 msgid "" "Linker command used to build programs like ``python`` and ``_testembed``." msgstr "" -#: ../../using/configure.rst:1373 +#: ../../using/configure.rst:1377 msgid "Default: ``$(PURIFY) $(CC)``." msgstr "" -#: ../../using/configure.rst:1377 +#: ../../using/configure.rst:1381 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1379 +#: ../../using/configure.rst:1383 msgid "" "Avoid assigning :envvar:`CFLAGS`, :envvar:`LDFLAGS`, etc. so users can use " "them on the command line to append to these values without stomping the pre-" "set values." msgstr "" -#: ../../using/configure.rst:1387 +#: ../../using/configure.rst:1391 msgid "" -":envvar:`LDFLAGS_NODIST` is used in the same manner as :envvar:" -"`CFLAGS_NODIST`. Use it when a linker flag should *not* be part of :envvar:" -"`LDFLAGS` once Python is installed (:gh:`65320`)." +":envvar:`LDFLAGS_NODIST` is used in the same manner " +"as :envvar:`CFLAGS_NODIST`. Use it when a linker flag should *not* be part " +"of :envvar:`LDFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:1391 +#: ../../using/configure.rst:1395 msgid "In particular, :envvar:`LDFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:1393 +#: ../../using/configure.rst:1397 msgid "" "the compiler flag ``-L`` (for setting the search path for libraries). The ``-" -"L`` flags are processed from left to right, and any flags in :envvar:" -"`LDFLAGS` would take precedence over user- and package-supplied ``-L`` flags." +"L`` flags are processed from left to right, and any flags " +"in :envvar:`LDFLAGS` would take precedence over user- and package-supplied " +"``-L`` flags." msgstr "" -#: ../../using/configure.rst:1400 +#: ../../using/configure.rst:1404 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:1407 +#: ../../using/configure.rst:1411 msgid "" "Linker flags, e.g. :samp:`-L{lib_dir}` if you have libraries in a " "nonstandard directory *lib_dir*." msgstr "" -#: ../../using/configure.rst:1416 +#: ../../using/configure.rst:1420 msgid "" "Linker flags to pass libraries to the linker when linking the Python " "executable." msgstr "" -#: ../../using/configure.rst:1419 +#: ../../using/configure.rst:1423 msgid "Example: ``-lrt``." msgstr "範例:``-lrt``。" -#: ../../using/configure.rst:1423 +#: ../../using/configure.rst:1427 msgid "Command to build a shared library." msgstr "" -#: ../../using/configure.rst:1425 +#: ../../using/configure.rst:1429 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." msgstr "預設值:``@LDSHARED@ $(PY_LDFLAGS)``。" -#: ../../using/configure.rst:1429 +#: ../../using/configure.rst:1433 msgid "Command to build ``libpython`` shared library." msgstr "" -#: ../../using/configure.rst:1431 +#: ../../using/configure.rst:1435 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." msgstr "預設值:``@BLDSHARED@ $(PY_CORE_LDFLAGS)``。" -#: ../../using/configure.rst:1435 +#: ../../using/configure.rst:1439 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``。" -#: ../../using/configure.rst:1439 +#: ../../using/configure.rst:1443 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``。" -#: ../../using/configure.rst:1445 +#: ../../using/configure.rst:1449 msgid "Linker flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1451 +#: ../../using/configure.rst:1455 msgid "Footnotes" msgstr "註腳" -#: ../../using/configure.rst:1452 +#: ../../using/configure.rst:1456 msgid "" "``git clean -fdx`` is an even more extreme way to \"clean\" your checkout. " "It removes all files not known to Git. When bug hunting using ``git " diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index 3173149b94..d2be7edf2d 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2025-02-05 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -501,7 +501,7 @@ msgid "" "Other systems also allow Unicode strings as file names but convert them to " "byte strings before passing them to the system, which can cause a :exc:" "`UnicodeError` to be raised. Applications can test whether arbitrary Unicode " -"strings are supported as file names by checking :attr:`os.path." +"strings are supported as file names by checking :const:`os.path." "supports_unicode_filenames`, a Boolean value." msgstr "" diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 969d821d8b..cc574ea59c 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2025-02-05 00:13+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-" @@ -2345,7 +2345,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:1605 msgid "" -"The :attr:`sys.version_info` value is now a named tuple, with attributes " +"The :data:`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 "" @@ -2980,14 +2980,14 @@ 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:" "`ElementTree.write() ` and :meth:" -"`Element.write` methods now have a *method* parameter that can be \"xml\" " -"(the default), \"html\", or \"text\". HTML mode will output empty elements " -"as ```` instead of ````, and text mode will skip over " -"elements and only output the text chunks. If you set the :attr:`~xml.etree." -"ElementTree.Element.tag` attribute of an element to ``None`` but leave its " -"children in place, the element will be omitted when the tree is written out, " -"so you don't need to do more extensive rearrangement to remove a single " -"element." +"`Element.write` methods now have a *method* parameter that can be " +"\"xml\" (the default), \"html\", or \"text\". HTML mode will output empty " +"elements as ```` instead of ````, and text mode will " +"skip over elements and only output the text chunks. If you set the :attr:" +"`~xml.etree.ElementTree.Element.tag` attribute of an element to ``None`` but " +"leave its children in place, the element will be omitted when the tree is " +"written out, so you don't need to do more extensive rearrangement to remove " +"a single element." msgstr "" #: ../../whatsnew/2.7.rst:2044 diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 8bddce6733..4f0abbe638 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-18 00:15+0000\n" +"POT-Creation-Date: 2025-02-05 00:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,8 +31,8 @@ msgstr "Adam Turner" #: ../../whatsnew/3.12.rst:48 msgid "" "This article explains the new features in Python 3.12, compared to 3.11. " -"Python 3.12 was released on October 2, 2023. For full details, see the :ref:" -"`changelog `." +"Python 3.12 was released on October 2, 2023. For full details, see " +"the :ref:`changelog `." msgstr "" "本文介紹了 Python 3.12 與 3.11 相比多了哪些新功能。 Python 3.12 於 2023 年 " "10 月 2 日發布。完整詳情請見 :ref:`changelog `。" @@ -60,9 +60,9 @@ msgid "" "The language changes focus on usability, as :term:`f-strings ` " "have had many limitations removed and 'Did you mean ...' suggestions " "continue to improve. The new :ref:`type parameter syntax ` and :keyword:`type` statement improve ergonomics for using :term:" -"`generic types ` and :term:`type aliases ` with " -"static type checkers." +"pep695>` and :keyword:`type` statement improve ergonomics for " +"using :term:`generic types ` and :term:`type aliases ` with static type checkers." msgstr "" #: ../../whatsnew/3.12.rst:76 @@ -82,8 +82,8 @@ msgstr "新增語法特性:" #: ../../whatsnew/3.12.rst:92 msgid "" -":ref:`PEP 695 `, type parameter syntax and the :keyword:" -"`type` statement" +":ref:`PEP 695 `, type parameter syntax and " +"the :keyword:`type` statement" msgstr "" ":ref:`PEP 695 `,型別參數語法和 :keyword:`type` 陳述式" @@ -113,8 +113,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:103 msgid "" -"`Improved 'Did you mean ...' suggestions `_ for :" -"exc:`NameError`, :exc:`ImportError`, and :exc:`SyntaxError` exceptions" +"`Improved 'Did you mean ...' suggestions `_ " +"for :exc:`NameError`, :exc:`ImportError`, and :exc:`SyntaxError` exceptions" msgstr "" #: ../../whatsnew/3.12.rst:106 @@ -141,15 +141,15 @@ msgstr "" #: ../../whatsnew/3.12.rst:115 msgid "" -"A :ref:`command-line interface ` has been added to the :mod:" -"`sqlite3` module" +"A :ref:`command-line interface ` has been added to " +"the :mod:`sqlite3` module" msgstr "" "一個\\ :ref:`命令列介面 `\\ 已被加入 :mod:`sqlite3` 模組中" #: ../../whatsnew/3.12.rst:117 msgid "" -":func:`isinstance` checks against :func:`runtime-checkable protocols ` enjoy a speed up of between two and 20 times" +":func:`isinstance` checks against :func:`runtime-checkable protocols " +"` enjoy a speed up of between two and 20 times" msgstr "" #: ../../whatsnew/3.12.rst:119 @@ -220,8 +220,8 @@ msgid "" ":ref:`PEP 692 `, using :class:`~typing.TypedDict` to " "annotate :term:`**kwargs `" msgstr "" -":ref:`PEP 692 `、使用 :class:`~typing.TypedDict` 來標註 :" -"term:`**kwargs `" +":ref:`PEP 692 `、使用 :class:`~typing.TypedDict` 來標" +"註 :term:`**kwargs `" #: ../../whatsnew/3.12.rst:149 msgid ":ref:`PEP 698 `, :func:`typing.override` decorator" @@ -261,9 +261,9 @@ msgid "" "removed, along with several :class:`unittest.TestCase` `method aliases " "`_." msgstr "" -":mod:`!asynchat`、:mod:`!asyncore` 和 :mod:`!imp` 模組以及幾個 :class:" -"`unittest.TestCase` 的\\ `方法別名 `_\\ " -"已被刪除。" +":mod:`!asynchat`、:mod:`!asyncore` 和 :mod:`!imp` 模組以及幾" +"個 :class:`unittest.TestCase` 的\\ `方法別名 `_\\ 已被刪除。" #: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1832 msgid "New Features" @@ -282,8 +282,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:187 msgid "" -":pep:`695` introduces a new, more compact and explicit way to create :ref:" -"`generic classes ` and :ref:`functions ` and :ref:`functions `::" msgstr "" @@ -330,9 +330,9 @@ msgstr "type Point[T] = tuple[T, T]" #: ../../whatsnew/3.12.rst:210 msgid "" -"The new syntax allows declaring :class:`~typing.TypeVarTuple` and :class:" -"`~typing.ParamSpec` parameters, as well as :class:`~typing.TypeVar` " -"parameters with bounds or constraints::" +"The new syntax allows declaring :class:`~typing.TypeVarTuple` " +"and :class:`~typing.ParamSpec` parameters, as well " +"as :class:`~typing.TypeVar` parameters with bounds or constraints::" msgstr "" #: ../../whatsnew/3.12.rst:214 @@ -428,10 +428,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:290 msgid "" "Backslashes and unicode characters: before Python 3.12 f-string expressions " -"couldn't contain any ``\\`` character. This also affected unicode :ref:" -"`escape sequences ` (such as ``\\N{snowman}``) as these " -"contain the ``\\N`` part that previously could not be part of expression " -"components of f-strings. Now, you can define expressions like this:" +"couldn't contain any ``\\`` character. This also affected " +"unicode :ref:`escape sequences ` (such as ``\\N{snowman}" +"``) as these contain the ``\\N`` part that previously could not be part of " +"expression components of f-strings. Now, you can define expressions like " +"this:" msgstr "" #: ../../whatsnew/3.12.rst:303 @@ -567,16 +568,17 @@ msgstr "" #: ../../whatsnew/3.12.rst:386 msgid "" ":pep:`688` introduces a way to use the :ref:`buffer protocol " -"` from Python code. Classes that implement the :meth:`~object." -"__buffer__` method are now usable as buffer types." +"` from Python code. Classes that implement " +"the :meth:`~object.__buffer__` method are now usable as buffer types." msgstr "" #: ../../whatsnew/3.12.rst:390 msgid "" "The new :class:`collections.abc.Buffer` ABC provides a standard way to " -"represent buffer objects, for example in type annotations. The new :class:" -"`inspect.BufferFlags` enum represents the flags that can be used to " -"customize buffer creation. (Contributed by Jelle Zijlstra in :gh:`102500`.)" +"represent buffer objects, for example in type annotations. The " +"new :class:`inspect.BufferFlags` enum represents the flags that can be used " +"to customize buffer creation. (Contributed by Jelle Zijlstra " +"in :gh:`102500`.)" msgstr "" #: ../../whatsnew/3.12.rst:399 @@ -655,8 +657,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:459 msgid "" "Improve the :exc:`SyntaxError` error message when the user types ``import x " -"from y`` instead of ``from y import x``. (Contributed by Pablo Galindo in :" -"gh:`98931`.)" +"from y`` instead of ``from y import x``. (Contributed by Pablo Galindo " +"in :gh:`98931`.)" msgstr "" #: ../../whatsnew/3.12.rst:469 @@ -673,8 +675,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:482 msgid "" -"This section covers major changes affecting :pep:`type hints <484>` and the :" -"mod:`typing` module." +"This section covers major changes affecting :pep:`type hints <484>` and " +"the :mod:`typing` module." msgstr "" #: ../../whatsnew/3.12.rst:488 @@ -780,17 +782,18 @@ msgid "" "a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " "``re.compile(\"\\d+\\.\\d+\")`` now emits a :exc:`SyntaxWarning` " "(``\"\\d\"`` is an invalid escape sequence, use raw strings for regular " -"expression: ``re.compile(r\"\\d+\\.\\d+\")``). In a future Python version, :" -"exc:`SyntaxError` will eventually be raised, instead of :exc:" -"`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" +"expression: ``re.compile(r\"\\d+\\.\\d+\")``). In a future Python " +"version, :exc:`SyntaxError` will eventually be raised, instead " +"of :exc:`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" #: ../../whatsnew/3.12.rst:557 msgid "" "Octal escapes with value larger than ``0o377`` (ex: ``\"\\477\"``), " -"deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :" -"exc:`DeprecationWarning`. In a future Python version they will be eventually " -"a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)" +"deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead " +"of :exc:`DeprecationWarning`. In a future Python version they will be " +"eventually a :exc:`SyntaxError`. (Contributed by Victor Stinner " +"in :gh:`98401`.)" msgstr "" #: ../../whatsnew/3.12.rst:563 @@ -813,9 +816,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:574 msgid "" "When a ``try-except*`` construct handles the entire :exc:`ExceptionGroup` " -"and raises one other exception, that exception is no longer wrapped in an :" -"exc:`ExceptionGroup`. Also changed in version 3.11.4. (Contributed by Irit " -"Katriel in :gh:`103590`.)" +"and raises one other exception, that exception is no longer wrapped in " +"an :exc:`ExceptionGroup`. Also changed in version 3.11.4. (Contributed by " +"Irit Katriel in :gh:`103590`.)" msgstr "" #: ../../whatsnew/3.12.rst:579 @@ -824,8 +827,8 @@ msgid "" "Python bytecode evaluation loop instead of object allocations. The GC can " "also run when :c:func:`PyErr_CheckSignals` is called so C extensions that " "need to run for a long time without executing any Python code also have a " -"chance to execute the GC periodically. (Contributed by Pablo Galindo in :gh:" -"`97922`.)" +"chance to execute the GC periodically. (Contributed by Pablo Galindo " +"in :gh:`97922`.)" msgstr "" #: ../../whatsnew/3.12.rst:586 @@ -881,12 +884,13 @@ msgstr "" #: ../../whatsnew/3.12.rst:616 msgid "" "Add :ref:`support for the perf profiler ` through the new " -"environment variable :envvar:`PYTHONPERFSUPPORT` and command-line option :" -"option:`-X perf <-X>`, as well as the new :func:`sys." -"activate_stack_trampoline`, :func:`sys.deactivate_stack_trampoline`, and :" -"func:`sys.is_stack_trampoline_active` functions. (Design by Pablo Galindo. " -"Contributed by Pablo Galindo and Christian Heimes with contributions from " -"Gregory P. Smith [Google] and Mark Shannon in :gh:`96123`.)" +"environment variable :envvar:`PYTHONPERFSUPPORT` and command-line " +"option :option:`-X perf <-X>`, as well as the " +"new :func:`sys.activate_stack_trampoline`, :func:`sys.deactivate_stack_trampoline`, " +"and :func:`sys.is_stack_trampoline_active` functions. (Design by Pablo " +"Galindo. Contributed by Pablo Galindo and Christian Heimes with " +"contributions from Gregory P. Smith [Google] and Mark Shannon " +"in :gh:`96123`.)" msgstr "" #: ../../whatsnew/3.12.rst:628 @@ -907,8 +911,8 @@ msgstr "array" #: ../../whatsnew/3.12.rst:639 msgid "" -"The :class:`array.array` class now supports subscripting, making it a :term:" -"`generic type`. (Contributed by Jelle Zijlstra in :gh:`98658`.)" +"The :class:`array.array` class now supports subscripting, making it " +"a :term:`generic type`. (Contributed by Jelle Zijlstra in :gh:`98658`.)" msgstr "" #: ../../whatsnew/3.12.rst:643 @@ -925,25 +929,28 @@ msgstr "" #: ../../whatsnew/3.12.rst:650 msgid "" -"Add :func:`asyncio.eager_task_factory` and :func:`asyncio." -"create_eager_task_factory` functions to allow opting an event loop in to " -"eager task execution, making some use-cases 2x to 5x faster. (Contributed by " -"Jacob Bower & Itamar Oren in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" +"Add :func:`asyncio.eager_task_factory` " +"and :func:`asyncio.create_eager_task_factory` functions to allow opting an " +"event loop in to eager task execution, making some use-cases 2x to 5x " +"faster. (Contributed by Jacob Bower & Itamar Oren " +"in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" msgstr "" #: ../../whatsnew/3.12.rst:655 msgid "" "On Linux, :mod:`asyncio` uses :class:`asyncio.PidfdChildWatcher` by default " -"if :func:`os.pidfd_open` is available and functional instead of :class:" -"`asyncio.ThreadedChildWatcher`. (Contributed by Kumar Aditya in :gh:`98024`.)" +"if :func:`os.pidfd_open` is available and functional instead " +"of :class:`asyncio.ThreadedChildWatcher`. (Contributed by Kumar Aditya " +"in :gh:`98024`.)" msgstr "" #: ../../whatsnew/3.12.rst:660 msgid "" -"The event loop now uses the best available child watcher for each platform (:" -"class:`asyncio.PidfdChildWatcher` if supported and :class:`asyncio." -"ThreadedChildWatcher` otherwise), so manually configuring a child watcher is " -"not recommended. (Contributed by Kumar Aditya in :gh:`94597`.)" +"The event loop now uses the best available child watcher for each platform " +"(:class:`asyncio.PidfdChildWatcher` if supported " +"and :class:`asyncio.ThreadedChildWatcher` otherwise), so manually " +"configuring a child watcher is not recommended. (Contributed by Kumar Aditya " +"in :gh:`94597`.)" msgstr "" #: ../../whatsnew/3.12.rst:666 @@ -960,9 +967,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:673 msgid "" -":func:`asyncio.iscoroutine` now returns ``False`` for generators as :mod:" -"`asyncio` does not support legacy generator-based coroutines. (Contributed " -"by Kumar Aditya in :gh:`102748`.)" +":func:`asyncio.iscoroutine` now returns ``False`` for generators " +"as :mod:`asyncio` does not support legacy generator-based coroutines. " +"(Contributed by Kumar Aditya in :gh:`102748`.)" msgstr "" #: ../../whatsnew/3.12.rst:677 @@ -978,8 +985,8 @@ msgstr "calendar" #: ../../whatsnew/3.12.rst:684 msgid "" "Add enums :data:`calendar.Month` and :data:`calendar.Day` defining months of " -"the year and days of the week. (Contributed by Prince Roshan in :gh:" -"`103636`.)" +"the year and days of the week. (Contributed by Prince Roshan " +"in :gh:`103636`.)" msgstr "" #: ../../whatsnew/3.12.rst:689 @@ -989,8 +996,8 @@ msgstr "csv" #: ../../whatsnew/3.12.rst:691 msgid "" "Add :const:`csv.QUOTE_NOTNULL` and :const:`csv.QUOTE_STRINGS` flags to " -"provide finer grained control of ``None`` and empty strings by :class:`~csv." -"reader` and :class:`~csv.writer` objects." +"provide finer grained control of ``None`` and empty strings " +"by :class:`~csv.reader` and :class:`~csv.writer` objects." msgstr "" #: ../../whatsnew/3.12.rst:696 @@ -1000,10 +1007,10 @@ msgstr "dis" #: ../../whatsnew/3.12.rst:698 msgid "" "Pseudo instruction opcodes (which are used by the compiler but do not appear " -"in executable bytecode) are now exposed in the :mod:`dis` module. :opcode:" -"`HAVE_ARGUMENT` is still relevant to real opcodes, but it is not useful for " -"pseudo instructions. Use the new :data:`dis.hasarg` collection instead. " -"(Contributed by Irit Katriel in :gh:`94216`.)" +"in executable bytecode) are now exposed in the :mod:`dis` " +"module. :opcode:`HAVE_ARGUMENT` is still relevant to real opcodes, but it is " +"not useful for pseudo instructions. Use the new :data:`dis.hasarg` " +"collection instead. (Contributed by Irit Katriel in :gh:`94216`.)" msgstr "" #: ../../whatsnew/3.12.rst:706 @@ -1097,8 +1104,8 @@ msgid "" "Add :func:`math.sumprod` for computing a sum of products. (Contributed by " "Raymond Hettinger in :gh:`100485`.)" msgstr "" -"新增 :func:`math.sumprod` 以計算乘積總和。(由 Raymond Hettinger 於 :gh:" -"`100485` 中貢獻。)" +"新增 :func:`math.sumprod` 以計算乘積總和。(由 Raymond Hettinger " +"於 :gh:`100485` 中貢獻。)" #: ../../whatsnew/3.12.rst:752 msgid "" @@ -1113,16 +1120,16 @@ msgstr "os" #: ../../whatsnew/3.12.rst:759 msgid "" -"Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" -"func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar Aditya in :" -"gh:`93312`.)" +"Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process " +"with :func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar " +"Aditya in :gh:`93312`.)" msgstr "" #: ../../whatsnew/3.12.rst:763 msgid "" ":class:`os.DirEntry` now includes an :meth:`os.DirEntry.is_junction` method " -"to check if the entry is a junction. (Contributed by Charles Machalow in :gh:" -"`99547`.)" +"to check if the entry is a junction. (Contributed by Charles Machalow " +"in :gh:`99547`.)" msgstr "" #: ../../whatsnew/3.12.rst:767 @@ -1141,8 +1148,8 @@ msgid "" "with other platforms). ``st_dev`` may be up to 64 bits and ``st_ino`` up to " "128 bits depending on your file system, and ``st_rdev`` is always set to " "zero rather than incorrect values. Both functions may be significantly " -"faster on newer releases of Windows. (Contributed by Steve Dower in :gh:" -"`99726`.)" +"faster on newer releases of Windows. (Contributed by Steve Dower " +"in :gh:`99726`.)" msgstr "" #: ../../whatsnew/3.12.rst:782 @@ -1171,10 +1178,10 @@ msgstr "pathlib" #: ../../whatsnew/3.12.rst:793 msgid "" -"Add support for subclassing :class:`pathlib.PurePath` and :class:`pathlib." -"Path`, plus their Posix- and Windows-specific variants. Subclasses may " -"override the :meth:`pathlib.PurePath.with_segments` method to pass " -"information between path instances." +"Add support for subclassing :class:`pathlib.PurePath` " +"and :class:`pathlib.Path`, plus their Posix- and Windows-specific variants. " +"Subclasses may override the :meth:`pathlib.PurePath.with_segments` method to " +"pass information between path instances." msgstr "" #: ../../whatsnew/3.12.rst:798 @@ -1188,22 +1195,23 @@ msgstr "" msgid "" "Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to` to " "allow the insertion of ``..`` entries in the result; this behavior is more " -"consistent with :func:`os.path.relpath`. (Contributed by Domenico Ragusa in :" -"gh:`84538`.)" +"consistent with :func:`os.path.relpath`. (Contributed by Domenico Ragusa " +"in :gh:`84538`.)" msgstr "" #: ../../whatsnew/3.12.rst:807 msgid "" -"Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." -"isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" +"Add :meth:`pathlib.Path.is_junction` as a proxy " +"to :func:`os.path.isjunction`. (Contributed by Charles Machalow " +"in :gh:`99547`.)" msgstr "" #: ../../whatsnew/3.12.rst:810 msgid "" -"Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" -"`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " -"path's case sensitivity, allowing for more precise control over the matching " -"process." +"Add *case_sensitive* optional parameter " +"to :meth:`pathlib.Path.glob`, :meth:`pathlib.Path.rglob` " +"and :meth:`pathlib.PurePath.match` for matching the path's case sensitivity, " +"allowing for more precise control over the matching process." msgstr "" #: ../../whatsnew/3.12.rst:815 @@ -1223,8 +1231,8 @@ msgstr "random" #: ../../whatsnew/3.12.rst:825 msgid "" -"Add :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :gh:" -"`81620`.)" +"Add :func:`random.binomialvariate`. (Contributed by Raymond Hettinger " +"in :gh:`81620`.)" msgstr "" "新增 :func:`random.binomialvariate`。(由 Raymond Hettinger 於 :gh:`81620` 中" "貢獻。)" @@ -1288,29 +1296,31 @@ msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" msgstr "" -"新增\\ :ref:`命令列介面 `。(由 Erlend E. Aasland 於 :gh:" -"`77617` 中貢獻。)" +"新增\\ :ref:`命令列介面 `。(由 Erlend E. Aasland " +"於 :gh:`77617` 中貢獻。)" #: ../../whatsnew/3.12.rst:866 msgid "" -"Add the :attr:`sqlite3.Connection.autocommit` attribute to :class:`sqlite3." -"Connection` and the *autocommit* parameter to :func:`sqlite3.connect` to " -"control :pep:`249`-compliant :ref:`transaction handling `. (Contributed by Erlend E. Aasland in :gh:`83638`.)" +"Add the :attr:`sqlite3.Connection.autocommit` attribute " +"to :class:`sqlite3.Connection` and the *autocommit* parameter " +"to :func:`sqlite3.connect` to control :pep:`249`-compliant :ref:`transaction " +"handling `. (Contributed by Erlend " +"E. Aasland in :gh:`83638`.)" msgstr "" #: ../../whatsnew/3.12.rst:873 msgid "" -"Add *entrypoint* keyword-only parameter to :meth:`sqlite3.Connection." -"load_extension`, for overriding the SQLite extension entry point. " -"(Contributed by Erlend E. Aasland in :gh:`103015`.)" +"Add *entrypoint* keyword-only parameter " +"to :meth:`sqlite3.Connection.load_extension`, for overriding the SQLite " +"extension entry point. (Contributed by Erlend E. Aasland in :gh:`103015`.)" msgstr "" #: ../../whatsnew/3.12.rst:878 msgid "" -"Add :meth:`sqlite3.Connection.getconfig` and :meth:`sqlite3.Connection." -"setconfig` to :class:`sqlite3.Connection` to make configuration changes to a " -"database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" +"Add :meth:`sqlite3.Connection.getconfig` " +"and :meth:`sqlite3.Connection.setconfig` to :class:`sqlite3.Connection` to " +"make configuration changes to a database connection. (Contributed by Erlend " +"E. Aasland in :gh:`103489`.)" msgstr "" #: ../../whatsnew/3.12.rst:884 @@ -1331,27 +1341,28 @@ msgstr "sys" #: ../../whatsnew/3.12.rst:893 msgid "" "Add the :mod:`sys.monitoring` namespace to expose the new :ref:`PEP 669 " -"` monitoring API. (Contributed by Mark Shannon in :gh:" -"`103082`.)" +"` monitoring API. (Contributed by Mark Shannon " +"in :gh:`103082`.)" msgstr "" #: ../../whatsnew/3.12.rst:897 msgid "" -"Add :func:`sys.activate_stack_trampoline` and :func:`sys." -"deactivate_stack_trampoline` for activating and deactivating stack profiler " -"trampolines, and :func:`sys.is_stack_trampoline_active` for querying if " -"stack profiler trampolines are active. (Contributed by Pablo Galindo and " -"Christian Heimes with contributions from Gregory P. Smith [Google] and Mark " -"Shannon in :gh:`96123`.)" +"Add :func:`sys.activate_stack_trampoline` " +"and :func:`sys.deactivate_stack_trampoline` for activating and deactivating " +"stack profiler trampolines, and :func:`sys.is_stack_trampoline_active` for " +"querying if stack profiler trampolines are active. (Contributed by Pablo " +"Galindo and Christian Heimes with contributions from Gregory P. Smith " +"[Google] and Mark Shannon in :gh:`96123`.)" msgstr "" #: ../../whatsnew/3.12.rst:906 msgid "" "Add :data:`sys.last_exc` which holds the last unhandled exception that was " "raised (for post-mortem debugging use cases). Deprecate the three fields " -"that have the same information in its legacy form: :data:`sys.last_type`, :" -"data:`sys.last_value` and :data:`sys.last_traceback`. (Contributed by Irit " -"Katriel in :gh:`102778`.)" +"that have the same information in its legacy " +"form: :data:`sys.last_type`, :data:`sys.last_value` " +"and :data:`sys.last_traceback`. (Contributed by Irit Katriel " +"in :gh:`102778`.)" msgstr "" #: ../../whatsnew/3.12.rst:912 ../../whatsnew/3.12.rst:1731 @@ -1395,10 +1406,10 @@ msgstr "threading" #: ../../whatsnew/3.12.rst:932 msgid "" -"Add :func:`threading.settrace_all_threads` and :func:`threading." -"setprofile_all_threads` that allow to set tracing and profiling functions in " -"all running threads in addition to the calling one. (Contributed by Pablo " -"Galindo in :gh:`93503`.)" +"Add :func:`threading.settrace_all_threads` " +"and :func:`threading.setprofile_all_threads` that allow to set tracing and " +"profiling functions in all running threads in addition to the calling one. " +"(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" #: ../../whatsnew/3.12.rst:938 @@ -1422,9 +1433,9 @@ msgstr "tokenize" #: ../../whatsnew/3.12.rst:951 msgid "" "The :mod:`tokenize` module includes the changes introduced in :pep:`701`. " -"(Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" -"ref:`whatsnew312-porting-to-python312` for more information on the changes " -"to the :mod:`tokenize` module." +"(Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) " +"See :ref:`whatsnew312-porting-to-python312` for more information on the " +"changes to the :mod:`tokenize` module." msgstr "" #: ../../whatsnew/3.12.rst:957 @@ -1433,9 +1444,9 @@ msgstr "types" #: ../../whatsnew/3.12.rst:959 msgid "" -"Add :func:`types.get_original_bases` to allow for further introspection of :" -"ref:`user-defined-generics` when subclassed. (Contributed by James Hilton-" -"Balfe and Alex Waygood in :gh:`101827`.)" +"Add :func:`types.get_original_bases` to allow for further introspection " +"of :ref:`user-defined-generics` when subclassed. (Contributed by James " +"Hilton-Balfe and Alex Waygood in :gh:`101827`.)" msgstr "" #: ../../whatsnew/3.12.rst:966 @@ -1444,15 +1455,16 @@ msgstr "typing" #: ../../whatsnew/3.12.rst:968 msgid "" -":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" -"`hasattr` to lookup whether attributes exist. This means that descriptors " -"and :meth:`~object.__getattr__` methods are no longer unexpectedly evaluated " -"during ``isinstance()`` checks against runtime-checkable protocols. However, " -"it may also mean that some objects which used to be considered instances of " -"a runtime-checkable protocol may no longer be considered instances of that " -"protocol on Python 3.12+, and vice versa. Most users are unlikely to be " -"affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" +":func:`isinstance` checks against :func:`runtime-checkable protocols " +"` now use :func:`inspect.getattr_static` rather " +"than :func:`hasattr` to lookup whether attributes exist. This means that " +"descriptors and :meth:`~object.__getattr__` methods are no longer " +"unexpectedly evaluated during ``isinstance()`` checks against runtime-" +"checkable protocols. However, it may also mean that some objects which used " +"to be considered instances of a runtime-checkable protocol may no longer be " +"considered instances of that protocol on Python 3.12+, and vice versa. Most " +"users are unlikely to be affected by this change. (Contributed by Alex " +"Waygood in :gh:`102433`.)" msgstr "" #: ../../whatsnew/3.12.rst:979 @@ -1513,8 +1525,8 @@ msgid "" "Most ``isinstance()`` checks against protocols with only a few members " "should be at least 2x faster than in 3.11, and some may be 20x faster or " "more. However, ``isinstance()`` checks against protocols with many members " -"may be slower than in Python 3.11. (Contributed by Alex Waygood in :gh:" -"`74690` and :gh:`103193`.)" +"may be slower than in Python 3.11. (Contributed by Alex Waygood " +"in :gh:`74690` and :gh:`103193`.)" msgstr "" #: ../../whatsnew/3.12.rst:1012 @@ -1617,8 +1629,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:1064 msgid "" -"Speed up the regular expression substitution (functions :func:`re.sub` and :" -"func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " +"Speed up the regular expression substitution (functions :func:`re.sub` " +"and :func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " "replacement strings containing group references by 2--3 times. (Contributed " "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" @@ -1634,16 +1646,16 @@ msgstr "" #: ../../whatsnew/3.12.rst:1072 msgid "" "The :func:`tokenize.tokenize` and :func:`tokenize.generate_tokens` functions " -"are up to 64% faster as a side effect of the changes required to cover :pep:" -"`701` in the :mod:`tokenize` module. (Contributed by Marta Gómez Macías and " -"Pablo Galindo in :gh:`102856`.)" +"are up to 64% faster as a side effect of the changes required to " +"cover :pep:`701` in the :mod:`tokenize` module. (Contributed by Marta Gómez " +"Macías and Pablo Galindo in :gh:`102856`.)" msgstr "" #: ../../whatsnew/3.12.rst:1077 msgid "" -"Speed up :func:`super` method calls and attribute loads via the new :opcode:" -"`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " -"Matveev in :gh:`103497`.)" +"Speed up :func:`super` method calls and attribute loads via the " +"new :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and " +"Vladimir Matveev in :gh:`103497`.)" msgstr "" #: ../../whatsnew/3.12.rst:1083 @@ -1652,28 +1664,29 @@ msgstr "CPython 位元組碼變更" #: ../../whatsnew/3.12.rst:1085 msgid "" -"Remove the :opcode:`!LOAD_METHOD` instruction. It has been merged into :" -"opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" -"`!LOAD_METHOD` instruction if the low bit of its oparg is set. (Contributed " -"by Ken Jin in :gh:`93429`.)" +"Remove the :opcode:`!LOAD_METHOD` instruction. It has been merged " +"into :opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the " +"old :opcode:`!LOAD_METHOD` instruction if the low bit of its oparg is set. " +"(Contributed by Ken Jin in :gh:`93429`.)" msgstr "" -"移除 :opcode:`!LOAD_METHOD` 指令。它已經合併至 :opcode:`LOAD_ATTR`。:opcode:" -"`LOAD_ATTR` 現在會像舊的 :opcode:`!LOAD_METHOD` 指令一樣行為,如果其 oparg 的" -"低位元 (low bit) 有被設定。(由 Ken Jin 於 :gh:`93429` 中貢獻。)" +"移除 :opcode:`!LOAD_METHOD` 指令。它已經合併" +"至 :opcode:`LOAD_ATTR`。:opcode:`LOAD_ATTR` 現在會像舊的 :opcode:`!" +"LOAD_METHOD` 指令一樣行為,如果其 oparg 的低位元 (low bit) 有被設定。(由 " +"Ken Jin 於 :gh:`93429` 中貢獻。)" #: ../../whatsnew/3.12.rst:1090 msgid "" "Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" -"JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" -"`102859`.)" +"JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel " +"in :gh:`102859`.)" msgstr "" "移除 :opcode:`!JUMP_IF_FALSE_OR_POP` 和 :opcode:`!JUMP_IF_TRUE_OR_POP` 指令。" "(由 Irit Katriel 於 :gh:`102859` 中貢獻。)" #: ../../whatsnew/3.12.rst:1093 msgid "" -"Remove the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" -"gh:`92925`.)" +"Remove the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon " +"in :gh:`92925`.)" msgstr "" "移除 :opcode:`!PRECALL` 指令。(由 Mark Shannon 於 :gh:`92925` 中貢獻。)" @@ -1711,8 +1724,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:1108 msgid "" -"Add the :opcode:`!END_SEND` instruction. (Contributed by Mark Shannon in :gh:" -"`103082`.)" +"Add the :opcode:`!END_SEND` instruction. (Contributed by Mark Shannon " +"in :gh:`103082`.)" msgstr "" "新增 :opcode:`!END_SEND` 指令。(由 Mark Shannon 於 :gh:`103082` 中貢獻。)" @@ -1734,30 +1747,31 @@ msgstr "" #: ../../whatsnew/3.12.rst:1117 msgid "" -"Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" -"`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " -"the implementation of :pep:`695`. Remove the :opcode:`!LOAD_CLASSDEREF` " -"opcode, which can be replaced with :opcode:`LOAD_LOCALS` plus :opcode:" -"`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" +"Add " +"the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:`LOAD_FROM_DICT_OR_GLOBALS`, " +"and :opcode:`LOAD_LOCALS` opcodes as part of the implementation " +"of :pep:`695`. Remove the :opcode:`!LOAD_CLASSDEREF` opcode, which can be " +"replaced with :opcode:`LOAD_LOCALS` plus :opcode:`LOAD_FROM_DICT_OR_DEREF`. " +"(Contributed by Jelle Zijlstra in :gh:`103764`.)" msgstr "" "新增 :opcode:`LOAD_FROM_DICT_OR_DEREF`、:opcode:`LOAD_FROM_DICT_OR_GLOBALS` " "和 :opcode:`LOAD_LOCALS` 操作碼作為 :pep:`695` 實作的一部分。移除 :opcode:`!" -"LOAD_CLASSDEREF` 操作碼,可以用 :opcode:`LOAD_LOCALS` 加上 :opcode:" -"`LOAD_FROM_DICT_OR_DEREF` 來取代。(由 Jelle Zijlstra 於 :gh:`103764` 中貢" -"獻。)" +"LOAD_CLASSDEREF` 操作碼,可以用 :opcode:`LOAD_LOCALS` 加" +"上 :opcode:`LOAD_FROM_DICT_OR_DEREF` 來取代。(由 Jelle Zijlstra " +"於 :gh:`103764` 中貢獻。)" #: ../../whatsnew/3.12.rst:1123 msgid "" "Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " "and Vladimir Matveev in :gh:`103497`.)" msgstr "" -"新增 :opcode:`LOAD_SUPER_ATTR` 指令。(由 Carl Meyer 和 Vladimir Matveev 於 :" -"gh:`103497` 中貢獻。)" +"新增 :opcode:`LOAD_SUPER_ATTR` 指令。(由 Carl Meyer 和 Vladimir Matveev " +"於 :gh:`103497` 中貢獻。)" #: ../../whatsnew/3.12.rst:1126 msgid "" -"Add the :opcode:`RETURN_CONST` instruction. (Contributed by Wenyang Wang in :" -"gh:`101632`.)" +"Add the :opcode:`RETURN_CONST` instruction. (Contributed by Wenyang Wang " +"in :gh:`101632`.)" msgstr "" "新增 :opcode:`RETURN_CONST` 指令。(由 Wenyang Wang 於 :gh:`101632` 中貢" "獻。)" @@ -1834,8 +1848,8 @@ msgstr ":class:`!ast.Ellipsis`" #: ../../whatsnew/3.12.rst:1160 #: ../../deprecations/pending-removal-in-3.14.rst:19 msgid "" -"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" -"`90953`.)" +"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka " +"in :gh:`90953`.)" msgstr "" "請改用 :class:`ast.Constant`。(由 Serhiy Storchaka 於 :gh:`90953` 貢獻。)" @@ -1847,24 +1861,23 @@ msgstr ":mod:`asyncio`:" #: ../../whatsnew/3.12.rst:1165 msgid "" -"The child watcher classes :class:`asyncio.MultiLoopChildWatcher`, :class:" -"`asyncio.FastChildWatcher`, :class:`asyncio.AbstractChildWatcher` and :class:" -"`asyncio.SafeChildWatcher` are deprecated and will be removed in Python " -"3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +"The child watcher " +"classes :class:`asyncio.MultiLoopChildWatcher`, :class:`asyncio.FastChildWatcher`, :class:`asyncio.AbstractChildWatcher` " +"and :class:`asyncio.SafeChildWatcher` are deprecated and will be removed in " +"Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" #: ../../whatsnew/3.12.rst:1171 #: ../../deprecations/pending-removal-in-3.14.rst:30 msgid "" -":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" -"`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." -"AbstractEventLoopPolicy.get_child_watcher` are deprecated and will be " -"removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:`asyncio.AbstractEventLoopPolicy.set_child_watcher` " +"and :meth:`asyncio.AbstractEventLoopPolicy.get_child_watcher` are deprecated " +"and will be removed in Python 3.14. (Contributed by Kumar Aditya " +"in :gh:`94597`.)" msgstr "" -":func:`asyncio.set_child_watcher`、:func:`asyncio.get_child_watcher`、:meth:" -"`asyncio.AbstractEventLoopPolicy.set_child_watcher` 和 :meth:`asyncio." -"AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 Python 3.14 中移" -"除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" +":func:`asyncio.set_child_watcher`、:func:`asyncio.get_child_watcher`、:meth:`asyncio.AbstractEventLoopPolicy.set_child_watcher` " +"和 :meth:`asyncio.AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 " +"Python 3.14 中移除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" #: ../../whatsnew/3.12.rst:1177 #: ../../deprecations/pending-removal-in-3.14.rst:36 @@ -1882,8 +1895,9 @@ msgstr "" #: ../../deprecations/pending-removal-in-future.rst:41 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " -"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." -"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" +"are deprecated and replaced by :data:`calendar.JANUARY` " +"and :data:`calendar.FEBRUARY`. (Contributed by Prince Roshan " +"in :gh:`103636`.)" msgstr "" ":mod:`calendar`:``calendar.January`` 和 ``calendar.February`` 常數已被棄用並" "被 :data:`calendar.JANUARY` 和 :data:`calendar.FEBRUARY` 取代。 (由 Prince " @@ -1893,24 +1907,27 @@ msgstr "" msgid "" ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " "Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " -"typing, prefer a union, like ``bytes | bytearray``, or :class:`collections." -"abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" +"typing, prefer a union, like ``bytes | bytearray``, " +"or :class:`collections.abc.Buffer`. (Contributed by Shantanu Jain " +"in :gh:`91896`.)" msgstr "" #: ../../whatsnew/3.12.rst:1191 msgid "" -":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." -"utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " -"will be removed in a future version. Instead, use timezone-aware objects to " -"represent datetimes in UTC: respectively, call :meth:`~datetime.datetime." -"now` and :meth:`~datetime.datetime.fromtimestamp` with the *tz* parameter " -"set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" +":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime.utcnow` " +"and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and will be " +"removed in a future version. Instead, use timezone-aware objects to " +"represent datetimes in UTC: respectively, " +"call :meth:`~datetime.datetime.now` " +"and :meth:`~datetime.datetime.fromtimestamp` with the *tz* parameter set " +"to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" #: ../../whatsnew/3.12.rst:1199 msgid "" -":mod:`email`: Deprecate the *isdst* parameter in :func:`email.utils." -"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" +":mod:`email`: Deprecate the *isdst* parameter " +"in :func:`email.utils.localtime`. (Contributed by Alan Williams " +"in :gh:`72346`.)" msgstr "" ":mod:`email`:棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 中貢獻。)" @@ -1961,8 +1978,8 @@ msgid "" ":mod:`itertools`: Deprecate the support for copy, deepcopy, and pickle " "operations, which is undocumented, inefficient, historically buggy, and " "inconsistent. This will be removed in 3.14 for a significant reduction in " -"code volume and maintenance burden. (Contributed by Raymond Hettinger in :gh:" -"`101588`.)" +"code volume and maintenance burden. (Contributed by Raymond Hettinger " +"in :gh:`101588`.)" msgstr "" #: ../../whatsnew/3.12.rst:1222 @@ -1971,17 +1988,19 @@ msgid "" "start method will change to a safer one on Linux, BSDs, and other non-macOS " "POSIX platforms where ``'fork'`` is currently the default (:gh:`84559`). " "Adding a runtime warning about this was deemed too disruptive as the " -"majority of code is not expected to care. Use the :func:`~multiprocessing." -"get_context` or :func:`~multiprocessing.set_start_method` APIs to explicitly " -"specify when your code *requires* ``'fork'``. See :ref:`contexts and start " -"methods `." +"majority of code is not expected to care. Use " +"the :func:`~multiprocessing.get_context` " +"or :func:`~multiprocessing.set_start_method` APIs to explicitly specify when " +"your code *requires* ``'fork'``. See :ref:`contexts and start methods " +"`." msgstr "" #: ../../whatsnew/3.12.rst:1232 msgid "" ":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " -"are deprecated and will be removed in Python 3.14; use :func:`importlib.util." -"find_spec` instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" +"are deprecated and will be removed in Python 3.14; " +"use :func:`importlib.util.find_spec` instead. (Contributed by Nikita Sobolev " +"in :gh:`97850`.)" msgstr "" ":mod:`pkgutil`::func:`pkgutil.find_loader` 和 :func:`pkgutil.get_loader` 已" "被棄用並將在 Python 3.14 中移除;請改用 :func:`importlib.util.find_spec`。" @@ -2010,30 +2029,31 @@ msgstr "" #: ../../whatsnew/3.12.rst:1250 msgid "" -"On POSIX platforms, :func:`os.fork` can now raise a :exc:" -"`DeprecationWarning` when it can detect being called from a multithreaded " -"process. There has always been a fundamental incompatibility with the POSIX " -"platform when doing so. Even if such code *appeared* to work. We added the " -"warning to raise awareness as issues encountered by code doing this are " -"becoming more frequent. See the :func:`os.fork` documentation for more " -"details along with `this discussion on fork being incompatible with threads " -"`_ for *why* we're now surfacing this longstanding " +"On POSIX platforms, :func:`os.fork` can now raise " +"a :exc:`DeprecationWarning` when it can detect being called from a " +"multithreaded process. There has always been a fundamental incompatibility " +"with the POSIX platform when doing so. Even if such code *appeared* to work. " +"We added the warning to raise awareness as issues encountered by code doing " +"this are becoming more frequent. See the :func:`os.fork` documentation for " +"more details along with `this discussion on fork being incompatible with " +"threads `_ for *why* we're now surfacing this longstanding " "platform compatibility problem to developers." msgstr "" #: ../../whatsnew/3.12.rst:1260 msgid "" -"When this warning appears due to usage of :mod:`multiprocessing` or :mod:" -"`concurrent.futures` the fix is to use a different :mod:`multiprocessing` " -"start method such as ``\"spawn\"`` or ``\"forkserver\"``." +"When this warning appears due to usage of :mod:`multiprocessing` " +"or :mod:`concurrent.futures` the fix is to use a " +"different :mod:`multiprocessing` start method such as ``\"spawn\"`` or " +"``\"forkserver\"``." msgstr "" #: ../../whatsnew/3.12.rst:1264 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is " -"deprecated; use *onexc* instead. (Contributed by Irit Katriel in :gh:" -"`102828`.)" +"deprecated; use *onexc* instead. (Contributed by Irit Katriel " +"in :gh:`102828`.)" msgstr "" ":mod:`shutil`::func:`shutil.rmtree` 的 *onerror* 引數已被棄用,請改用 " "*onexc*。(由 Irit Katriel 於 :gh:`102828` 中貢獻。)" @@ -2062,13 +2082,14 @@ msgstr "" #: ../../whatsnew/3.12.rst:1282 msgid "" -":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." -"last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " -"(Contributed by Irit Katriel in :gh:`102778`.)" +":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` " +"and :data:`sys.last_traceback` fields are deprecated. " +"Use :data:`sys.last_exc` instead. (Contributed by Irit Katriel " +"in :gh:`102778`.)" msgstr "" -":mod:`sys`::data:`sys.last_type`、:data:`sys.last_value` 和 :data:`sys." -"last_traceback` 欄位已被棄用。請改用 :data:`sys.last_exc`。(由 Irit Katriel " -"於 :gh:`102778` 中貢獻。)" +":mod:`sys`::data:`sys.last_type`、:data:`sys.last_value` " +"和 :data:`sys.last_traceback` 欄位已被棄用。請改用 :data:`sys.last_exc`。" +"(由 Irit Katriel 於 :gh:`102778` 中貢獻。)" #: ../../whatsnew/3.12.rst:1286 msgid "" @@ -2084,16 +2105,16 @@ msgstr ":mod:`typing`:" #: ../../whatsnew/3.12.rst:1292 msgid "" -":class:`typing.Hashable` and :class:`typing.Sized`, aliases for :class:" -"`collections.abc.Hashable` and :class:`collections.abc.Sized` respectively, " -"are deprecated. (:gh:`94309`.)" +":class:`typing.Hashable` and :class:`typing.Sized`, aliases " +"for :class:`collections.abc.Hashable` and :class:`collections.abc.Sized` " +"respectively, are deprecated. (:gh:`94309`.)" msgstr "" #: ../../whatsnew/3.12.rst:1296 msgid "" -":class:`typing.ByteString`, deprecated since Python 3.9, now causes a :exc:" -"`DeprecationWarning` to be emitted when it is used. (Contributed by Alex " -"Waygood in :gh:`91896`.)" +":class:`typing.ByteString`, deprecated since Python 3.9, now causes " +"a :exc:`DeprecationWarning` to be emitted when it is used. (Contributed by " +"Alex Waygood in :gh:`91896`.)" msgstr "" #: ../../whatsnew/3.12.rst:1300 @@ -2107,26 +2128,26 @@ msgstr "" #: ../../whatsnew/3.12.rst:1306 msgid "" "The 3-arg signatures (type, value, traceback) of :meth:`coroutine throw() " -"`, :meth:`generator throw() ` and :meth:" -"`async generator throw() ` are deprecated and may be removed in " -"a future version of Python. Use the single-arg versions of these functions " -"instead. (Contributed by Ofey Chan in :gh:`89874`.)" +"`, :meth:`generator throw() ` " +"and :meth:`async generator throw() ` are deprecated and may be " +"removed in a future version of Python. Use the single-arg versions of these " +"functions instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" #: ../../whatsnew/3.12.rst:1312 msgid "" ":exc:`DeprecationWarning` is now raised when :attr:`~module.__package__` on " -"a module differs from :attr:`__spec__.parent ` (previously it was :exc:`ImportWarning`). (Contributed by Brett " -"Cannon in :gh:`65961`.)" +"a module differs from :attr:`__spec__.parent " +"` (previously it " +"was :exc:`ImportWarning`). (Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" #: ../../whatsnew/3.12.rst:1318 msgid "" "Setting :attr:`~module.__package__` or :attr:`~module.__cached__` on a " "module is deprecated, and will cease to be set or taken into consideration " -"by the import system in Python 3.14. (Contributed by Brett Cannon in :gh:" -"`65961`.)" +"by the import system in Python 3.14. (Contributed by Brett Cannon " +"in :gh:`65961`.)" msgstr "" #: ../../whatsnew/3.12.rst:1322 @@ -2141,13 +2162,13 @@ msgstr "" #: ../../whatsnew/3.12.rst:1328 msgid "" "Accessing :attr:`~codeobject.co_lnotab` on code objects was deprecated in " -"Python 3.10 via :pep:`626`, but it only got a proper :exc:" -"`DeprecationWarning` in 3.12. May be removed in 3.15. (Contributed by Nikita " -"Sobolev in :gh:`101866`.)" +"Python 3.10 via :pep:`626`, but it only got a " +"proper :exc:`DeprecationWarning` in 3.12. May be removed in 3.15. " +"(Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" -"自 3.10 起,於程式碼物件存取 :attr:`~codeobject.co_lnotab` 的功能已在 :pep:" -"`626` 中被棄用,但只在 3.12 中於適時發出 :exc:`DeprecationWarning`。可能在 " -"3.15 中移除。(由 Nikita Sobolev 於 :gh:`101866` 貢獻。)" +"自 3.10 起,於程式碼物件存取 :attr:`~codeobject.co_lnotab` 的功能已" +"在 :pep:`626` 中被棄用,但只在 3.12 中於適時發出 :exc:`DeprecationWarning`。" +"可能在 3.15 中移除。(由 Nikita Sobolev 於 :gh:`101866` 貢獻。)" #: ../../deprecations/pending-removal-in-3.13.rst:2 msgid "Pending Removal in Python 3.13" @@ -2339,32 +2360,35 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.14.rst:24 msgid "" -"The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" -"`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" -"class:`~asyncio.SafeChildWatcher` are deprecated and will be removed in " +"The child watcher " +"classes :class:`~asyncio.MultiLoopChildWatcher`, :class:`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` " +"and :class:`~asyncio.SafeChildWatcher` are deprecated and will be removed in " "Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -"已棄用並將在 Python 3.14 中移除的 child watcher 類別::class:`~asyncio." -"MultiLoopChildWatcher`、:class:`~asyncio.FastChildWatcher`、:class:`~asyncio." -"AbstractChildWatcher` 和 :class:`~asyncio.SafeChildWatcher`。 (由 Kumar " -"Aditya 於 :gh:`94597` 貢獻。)" +"已棄用並將在 Python 3.14 中移除的 child watcher 類" +"別::class:`~asyncio.MultiLoopChildWatcher`、:class:`~asyncio.FastChildWatcher`、:class:`~asyncio.AbstractChildWatcher` " +"和 :class:`~asyncio.SafeChildWatcher`。 (由 Kumar Aditya 於 :gh:`94597` 貢" +"獻。)" #: ../../deprecations/pending-removal-in-3.14.rst:41 msgid "" ":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. " "Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " -"typing, prefer a union, like ``bytes | bytearray``, or :class:`collections." -"abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" -msgstr "" -":mod:`collections.abc`:已棄用 :class:`~collections.abc.ByteString`。請改用 :" -"class:`!Sequence` 或 :class:`~collections.abc.Buffer`。在 typing 中使用時,請" -"改用聯集,如 ``bytes | bytearray``,或 :class:`collections.abc.Buffer`。(由 " -"Shantanu Jain 於 :gh:`91896` 貢獻。)" +"typing, prefer a union, like ``bytes | bytearray``, " +"or :class:`collections.abc.Buffer`. (Contributed by Shantanu Jain " +"in :gh:`91896`.)" +msgstr "" +":mod:`collections.abc`:已棄用 :class:`~collections.abc.ByteString`。請改" +"用 :class:`!Sequence` 或 :class:`~collections.abc.Buffer`。在 typing 中使用" +"時,請改用聯集,如 ``bytes | bytearray``," +"或 :class:`collections.abc.Buffer`。(由 Shantanu Jain 於 :gh:`91896` 貢" +"獻。)" #: ../../deprecations/pending-removal-in-3.14.rst:47 msgid "" -":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." -"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" +":mod:`email`: Deprecated the *isdst* parameter " +"in :func:`email.utils.localtime`. (Contributed by Alan Williams " +"in :gh:`72346`.)" msgstr "" ":mod:`email`:已棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 貢獻。)" @@ -2390,24 +2414,25 @@ msgid "" "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " "currently the default (:gh:`84559`). Adding a runtime warning about this was " "deemed too disruptive as the majority of code is not expected to care. Use " -"the :func:`~multiprocessing.get_context` or :func:`~multiprocessing." -"set_start_method` APIs to explicitly specify when your code *requires* " -"``'fork'``. See :ref:`multiprocessing-start-methods`." +"the :func:`~multiprocessing.get_context` " +"or :func:`~multiprocessing.set_start_method` APIs to explicitly specify when " +"your code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" ":mod:`multiprocessing`:預設的啟動方法將在 Linux、BSD 和其他非 macOS POSIX 平" "台上更改為更安全的 方法,目前 ``'fork'`` 是預設值 (:gh:`84559`)。對此增加一" -"個 runtime 警告被認為太過擾人,因為 大多數程式碼不會在意。請使用 :func:" -"`~multiprocessing.get_context` 或 :func:`~multiprocessing.set_start_method` " -"API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:" -"`multiprocessing-start-methods`。" +"個 runtime 警告被認為太過擾人,因為 大多數程式碼不會在意。請使" +"用 :func:`~multiprocessing.get_context` " +"或 :func:`~multiprocessing.set_start_method` API 來明確指定你的程式碼何時\\ *" +"需要* ``'fork'``。請參閱 :ref:`multiprocessing-start-methods`。" #: ../../deprecations/pending-removal-in-3.14.rst:77 msgid "" -":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." -"PurePath.relative_to`: passing additional arguments is deprecated." +":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` " +"and :meth:`~pathlib.PurePath.relative_to`: passing additional arguments is " +"deprecated." msgstr "" -":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:" -"`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" +":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` " +"和 :meth:`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" #: ../../deprecations/pending-removal-in-3.14.rst:81 msgid "" @@ -2416,8 +2441,9 @@ msgid "" "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" ":mod:`pkgutil`::func:`~pkgutil.find_loader` 和 :func:`~pkgutil.get_loader` " -"現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util." -"find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)" +"現在會引發 :exc:`DeprecationWarning`;請改" +"用 :func:`importlib.util.find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢" +"獻。)" #: ../../deprecations/pending-removal-in-3.14.rst:86 msgid ":mod:`pty`:" @@ -2437,9 +2463,9 @@ msgstr ":data:`~sqlite3.version` 和 :data:`~sqlite3.version_info`。" #: ../../deprecations/pending-removal-in-3.14.rst:95 msgid "" -":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" -"ref:`named placeholders ` are used and *parameters* is " -"a sequence instead of a :class:`dict`." +":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` " +"if :ref:`named placeholders ` are used and " +"*parameters* is a sequence instead of a :class:`dict`." msgstr "" ":meth:`~sqlite3.Cursor.execute` 和 :meth:`~sqlite3.Cursor.executemany`,如果" "使用 :ref:`named placeholders ` 且 *parameters* 是序列" @@ -2456,8 +2482,8 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.14.rst:102 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " -"intended to be a public API. (Contributed by Gregory P. Smith in :gh:" -"`88168`.)" +"intended to be a public API. (Contributed by Gregory P. Smith " +"in :gh:`88168`.)" msgstr "" ":mod:`urllib`::class:`!urllib.parse.Quoter` 已被棄用:它並非預期的公開 API。" "(由 Gregory P. Smith 於 :gh:`88168` 貢獻。)" @@ -2474,10 +2500,10 @@ msgstr "引入系統 (import system):" #: ../../deprecations/pending-removal-in-3.15.rst:6 msgid "" -"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" -"`__spec__.cached ` is deprecated. In " -"Python 3.15, :attr:`!__cached__` will cease to be set or take into " -"consideration by the import system or standard library. (:gh:`97879`)" +"Setting :attr:`~module.__cached__` on a module while failing to " +"set :attr:`__spec__.cached ` is " +"deprecated. In Python 3.15, :attr:`!__cached__` will cease to be set or take " +"into consideration by the import system or standard library. (:gh:`97879`)" msgstr "" "在模組上設定 :attr:`~module.__cached__` 而沒有設定 :attr:`__spec__.cached " "` 的做法已被棄用。在 Python 3.15 中," @@ -2485,10 +2511,11 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:11 msgid "" -"Setting :attr:`~module.__package__` on a module while failing to set :attr:" -"`__spec__.parent ` is deprecated. In " -"Python 3.15, :attr:`!__package__` will cease to be set or take into " -"consideration by the import system or standard library. (:gh:`97879`)" +"Setting :attr:`~module.__package__` on a module while failing to " +"set :attr:`__spec__.parent ` is " +"deprecated. In Python 3.15, :attr:`!__package__` will cease to be set or " +"take into consideration by the import system or standard library. " +"(:gh:`97879`)" msgstr "" "在模組上設定 :attr:`~module.__package__` 而沒有設定 :attr:`__spec__.parent " "` 的做法已被棄用。在 Python 3.15 中," @@ -2534,15 +2561,17 @@ msgstr ":class:`locale`:" #: ../../deprecations/pending-removal-in-3.15.rst:34 msgid "" "The :func:`~locale.getdefaultlocale` function has been deprecated since " -"Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" -"`90817`), but has been postponed to Python 3.15. Use :func:`~locale." -"getlocale`, :func:`~locale.setlocale`, and :func:`~locale.getencoding` " -"instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" +"Python 3.11. Its removal was originally planned for Python 3.13 " +"(:gh:`90817`), but has been postponed to Python 3.15. " +"Use :func:`~locale.getlocale`, :func:`~locale.setlocale`, " +"and :func:`~locale.getencoding` instead. (Contributed by Hugo van Kemenade " +"in :gh:`111187`.)" msgstr "" ":func:`~locale.getdefaultlocale` 已在 Python 3.11 中被棄用,原本計劃在 " -"Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改用 :func:" -"`~locale.getlocale`、:func:`~locale.setlocale` 和 :func:`~locale." -"getencoding`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" +"Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改" +"用 :func:`~locale.getlocale`、:func:`~locale.setlocale` " +"和 :func:`~locale.getencoding`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢" +"獻。)" #: ../../deprecations/pending-removal-in-3.15.rst:42 msgid ":mod:`pathlib`:" @@ -2550,11 +2579,11 @@ msgstr ":mod:`pathlib`:" #: ../../deprecations/pending-removal-in-3.15.rst:44 msgid "" -":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" -"func:`os.path.isreserved` to detect reserved paths on Windows." +":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. " +"Use :func:`os.path.isreserved` to detect reserved paths on Windows." msgstr "" -":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請用 :func:`os.path." -"isreserved` 來偵測 Windows 上的保留路徑。" +":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請" +"用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。" #: ../../deprecations/pending-removal-in-3.15.rst:48 msgid ":mod:`platform`:" @@ -2596,16 +2625,16 @@ msgid "" "in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" ":class:`types.CodeType`:自 3.10 起,存取 :attr:`~codeobject.co_lnotab` 已" -"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發出 :" -"exc:`DeprecationWarning`。可能在 3.15 中移除。(由 Nikita Sobolev 於 :gh:" -"`101866` 貢獻。)" +"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發" +"出 :exc:`DeprecationWarning`。可能在 3.15 中移除。(由 Nikita Sobolev " +"於 :gh:`101866` 貢獻。)" #: ../../deprecations/pending-removal-in-3.15.rst:73 msgid "" -"The undocumented keyword argument syntax for creating :class:`~typing." -"NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " -"has been deprecated since Python 3.13. Use the class-based syntax or the " -"functional syntax instead." +"The undocumented keyword argument syntax for " +"creating :class:`~typing.NamedTuple` classes (e.g. ``Point = " +"NamedTuple(\"Point\", x=int, y=int)``) has been deprecated since Python " +"3.13. Use the class-based syntax or the functional syntax instead." msgstr "" "用於建立 :class:`~typing.NamedTuple` 類別的未以文件記錄之關鍵字引數語法 " "(``Point = NamedTuple(\"Point\", x=int, y=int)``) 已自 Python 3.13 棄用。請改" @@ -2627,13 +2656,14 @@ msgstr ":mod:`wave`:" #: ../../deprecations/pending-removal-in-3.15.rst:86 msgid "" -"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." -"Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" -"`~wave.Wave_write` classes have been deprecated since Python 3.13." +"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, " +"and :meth:`~wave.Wave_read.getmarkers` methods of " +"the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes have been " +"deprecated since Python 3.13." msgstr "" -"已棄用 :class:`~wave.Wave_read` 和 :class:`~wave.Wave_write` 類別的 :meth:" -"`~wave.Wave_read.getmark`、:meth:`!setmark` 和 :meth:`~wave.Wave_read." -"getmarkers` 方法自 Python 3.13 被棄用。" +"已棄用 :class:`~wave.Wave_read` 和 :class:`~wave.Wave_write` 類別" +"的 :meth:`~wave.Wave_read.getmark`、:meth:`!setmark` " +"和 :meth:`~wave.Wave_read.getmarkers` 方法自 Python 3.13 被棄用。" #: ../../deprecations/pending-removal-in-3.16.rst:2 msgid "Pending removal in Python 3.16" @@ -2641,10 +2671,10 @@ msgstr "Python 3.16 中待移除的項目" #: ../../deprecations/pending-removal-in-3.16.rst:6 msgid "" -"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" -"`__spec__.loader ` is deprecated. In " -"Python 3.16, :attr:`!__loader__` will cease to be set or taken into " -"consideration by the import system or the standard library." +"Setting :attr:`~module.__loader__` on a module while failing to " +"set :attr:`__spec__.loader ` is " +"deprecated. In Python 3.16, :attr:`!__loader__` will cease to be set or " +"taken into consideration by the import system or the standard library." msgstr "" "在模組上設定 :attr:`~module.__loader__` 而沒有設定 :attr:`__spec__.loader " "` 的做法將於 Python 3.16 被棄用。在 " @@ -2671,8 +2701,8 @@ msgid "" "by Jiahao Li and Kumar Aditya in :gh:`122875`.)" msgstr "" ":func:`!asyncio.iscoroutinefunction` 已被棄用並將在 Python 3.16 中移除,請改" -"用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya 於 :" -"gh:`122875` 貢獻。)" +"用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya " +"於 :gh:`122875` 貢獻。)" #: ../../deprecations/pending-removal-in-3.16.rst:26 #: ../../deprecations/pending-removal-in-future.rst:12 @@ -2782,17 +2812,17 @@ msgid "" "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " "ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as " "``[0x1 for x in y]`` or ``[0x1f or x in y]``). A syntax warning is raised " -"if the numeric literal is immediately followed by one of keywords :keyword:" -"`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :" -"keyword:`is` and :keyword:`or`. In a future release it will be changed to a " -"syntax error. (:gh:`87999`)" +"if the numeric literal is immediately followed by one of " +"keywords :keyword:`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :keyword:`is` " +"and :keyword:`or`. In a future release it will be changed to a syntax " +"error. (:gh:`87999`)" msgstr "" "目前 Python 接受數值字面值後面立即接關鍵字,例如 ``0in x``、``1or x``、``0if " "1else 2``。它讓表達式模糊且容易混淆,如 ``[0x1for x in y]``\\ (可以解釋為 " -"``[0x1 for x in y]`` 或 ``[0x1f or x in y]``)。如果數值字面值後立即接 :" -"keyword:`and`、:keyword:`else`、:keyword:`for`、:keyword:`if`、:keyword:" -"`in`、:keyword:`is` 和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版" -"本中,它將被更改為語法錯誤。(:gh:`87999`)" +"``[0x1 for x in y]`` 或 ``[0x1f or x in y]``)。如果數值字面值後立即" +"接 :keyword:`and`、:keyword:`else`、:keyword:`for`、:keyword:`if`、:keyword:`in`、:keyword:`is` " +"和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版本中,它將被更改為語" +"法錯誤。(:gh:`87999`)" #: ../../deprecations/pending-removal-in-future.rst:26 msgid "" @@ -2805,18 +2835,18 @@ msgstr "" #: ../../deprecations/pending-removal-in-future.rst:29 msgid "" -"Support for ``__float__()`` method returning a strict subclass of :class:" -"`float`: these methods will be required to return an instance of :class:" -"`float`." +"Support for ``__float__()`` method returning a strict subclass " +"of :class:`float`: these methods will be required to return an instance " +"of :class:`float`." msgstr "" "回傳 :class:`float` 嚴格子類別 ``__float__()`` 方法的支援:這些方法將需要回" "傳 :class:`float` 的實例。" #: ../../deprecations/pending-removal-in-future.rst:32 msgid "" -"Support for ``__complex__()`` method returning a strict subclass of :class:" -"`complex`: these methods will be required to return an instance of :class:" -"`complex`." +"Support for ``__complex__()`` method returning a strict subclass " +"of :class:`complex`: these methods will be required to return an instance " +"of :class:`complex`." msgstr "" "回傳 :class:`complex` 嚴格子類別 ``__complex__()`` 方法的支援:這些方法將需要" "回傳 :class:`complex` 的實例。" @@ -2827,10 +2857,10 @@ msgstr "將 ``int()`` 委派給 ``__trunc__()`` 方法。" #: ../../deprecations/pending-removal-in-future.rst:36 msgid "" -"Passing a complex number as the *real* or *imag* argument in the :func:" -"`complex` constructor is now deprecated; it should only be passed as a " -"single positional argument. (Contributed by Serhiy Storchaka in :gh:" -"`109218`.)" +"Passing a complex number as the *real* or *imag* argument in " +"the :func:`complex` constructor is now deprecated; it should only be passed " +"as a single positional argument. (Contributed by Serhiy Storchaka " +"in :gh:`109218`.)" msgstr "" "在 :func:`complex` 建構子中將複數作為 *real* 或 *imag* 引數傳遞現在已被棄用;" "它應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢獻。)" @@ -2848,19 +2878,19 @@ msgstr ":mod:`datetime`:" #: ../../deprecations/pending-removal-in-future.rst:51 msgid "" -":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." -"UTC)``." +":meth:`~datetime.datetime.utcnow`: use " +"``datetime.datetime.now(tz=datetime.UTC)``." msgstr "" -":meth:`~datetime.datetime.utcnow`:請改用 ``datetime.datetime." -"now(tz=datetime.UTC)``。" +":meth:`~datetime.datetime.utcnow`:請改用 " +"``datetime.datetime.now(tz=datetime.UTC)``。" #: ../../deprecations/pending-removal-in-future.rst:53 msgid "" -":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." -"fromtimestamp(timestamp, tz=datetime.UTC)``." +":meth:`~datetime.datetime.utcfromtimestamp`: use " +"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``." msgstr "" -":meth:`~datetime.datetime.utcfromtimestamp`:請改用 ``datetime.datetime." -"fromtimestamp(timestamp, tz=datetime.UTC)``。" +":meth:`~datetime.datetime.utcfromtimestamp`:請改用 " +"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``。" #: ../../deprecations/pending-removal-in-future.rst:56 msgid ":mod:`gettext`: Plural value must be an integer." @@ -2899,8 +2929,8 @@ msgid "" ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " "use :meth:`~logging.warning` instead." msgstr "" -":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改用 :meth:" -"`~logging.warning`。" +":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改" +"用 :meth:`~logging.warning`。" #: ../../deprecations/pending-removal-in-future.rst:72 msgid "" @@ -2957,11 +2987,11 @@ msgstr "不帶協定引數的 :class:`ssl.SSLContext` 已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:95 msgid "" -":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" -"`!selected_npn_protocol` are deprecated: use ALPN instead." +":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` " +"and :meth:`!selected_npn_protocol` are deprecated: use ALPN instead." msgstr "" -":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` 和 :meth:" -"`!selected_npn_protocol` 已被棄用:請改用 ALPN。" +":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` " +"和 :meth:`!selected_npn_protocol` 已被棄用:請改用 ALPN。" #: ../../deprecations/pending-removal-in-future.rst:98 msgid "``ssl.OP_NO_SSL*`` options" @@ -3016,11 +3046,11 @@ msgstr ":mod:`threading` 方法:" #: ../../deprecations/pending-removal-in-future.rst:114 msgid "" -":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." -"notify_all`." +":meth:`!threading.Condition.notifyAll`: " +"use :meth:`~threading.Condition.notify_all`." msgstr "" -":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition." -"notify_all`。" +":meth:`!threading.Condition.notifyAll`:請" +"用 :meth:`~threading.Condition.notify_all`。" #: ../../deprecations/pending-removal-in-future.rst:115 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." @@ -3028,19 +3058,19 @@ msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set` #: ../../deprecations/pending-removal-in-future.rst:116 msgid "" -":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" -"attr:`threading.Thread.daemon` attribute." +":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: " +"use :attr:`threading.Thread.daemon` attribute." msgstr "" ":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請" "用 :attr:`threading.Thread.daemon` 屬性。" #: ../../deprecations/pending-removal-in-future.rst:118 msgid "" -":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" -"attr:`threading.Thread.name` attribute." +":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: " +"use :attr:`threading.Thread.name` attribute." msgstr "" -":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :" -"attr:`threading.Thread.name` 屬性。" +":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請" +"用 :attr:`threading.Thread.name` 屬性。" #: ../../deprecations/pending-removal-in-future.rst:120 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." @@ -3116,13 +3146,13 @@ msgstr "``to_bytes()``" #: ../../deprecations/pending-removal-in-future.rst:142 msgid "" -":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:" -"`~urllib.request.FancyURLopener` style of invoking requests is deprecated. " -"Use newer :func:`~urllib.request.urlopen` functions and methods." +":mod:`urllib.request`: :class:`~urllib.request.URLopener` " +"and :class:`~urllib.request.FancyURLopener` style of invoking requests is " +"deprecated. Use newer :func:`~urllib.request.urlopen` functions and methods." msgstr "" -":mod:`urllib.request`:呼叫請求的 :class:`~urllib.request.URLopener` 和 :" -"class:`~urllib.request.FancyURLopener` 風格已被棄用。請改用更新的 :func:" -"`~urllib.request.urlopen` 函式和方法。" +":mod:`urllib.request`:呼叫請求的 :class:`~urllib.request.URLopener` " +"和 :class:`~urllib.request.FancyURLopener` 風格已被棄用。請改用更新" +"的 :func:`~urllib.request.urlopen` 函式和方法。" #: ../../deprecations/pending-removal-in-future.rst:146 msgid "" @@ -3132,22 +3162,22 @@ msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分 #: ../../deprecations/pending-removal-in-future.rst:149 msgid "" -":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." -"etree.ElementTree.Element` is deprecated. In a future release it will always " -"return ``True``. Prefer explicit ``len(elem)`` or ``elem is not None`` tests " -"instead." +":mod:`xml.etree.ElementTree`: Testing the truth value of " +"an :class:`~xml.etree.ElementTree.Element` is deprecated. In a future " +"release it will always return ``True``. Prefer explicit ``len(elem)`` or " +"``elem is not None`` tests instead." msgstr "" -":mod:`xml.etree.ElementTree`:已棄用對 :class:`~xml.etree.ElementTree." -"Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 " -"``len(elem)`` 或 ``elem is not None`` 測試。" +":mod:`xml.etree.ElementTree`:已棄用" +"對 :class:`~xml.etree.ElementTree.Element` 的真值測試。在未來版本中,它將始終" +"回傳 ``True``。請改用明確的 ``len(elem)`` 或 ``elem is not None`` 測試。" #: ../../deprecations/pending-removal-in-future.rst:154 msgid "" -":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:" -"`~zipimport.zipimporter.exec_module` instead." +":meth:`zipimport.zipimporter.load_module` is deprecated: " +"use :meth:`~zipimport.zipimporter.exec_module` instead." msgstr "" -":meth:`zipimport.zipimporter.load_module` 已被棄用:請改用 :meth:`~zipimport." -"zipimporter.exec_module`。" +":meth:`zipimport.zipimporter.load_module` 已被棄用:請改" +"用 :meth:`~zipimport.zipimporter.exec_module`。" #: ../../whatsnew/3.12.rst:1347 ../../whatsnew/3.12.rst:2229 msgid "Removed" @@ -3188,16 +3218,16 @@ msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -":mod:`configparser` 不再具有 ``SafeConfigParser`` 類別。請改用較短的 :class:" -"`~configparser.ConfigParser` 名稱。" +":mod:`configparser` 不再具有 ``SafeConfigParser`` 類別。請改用較短" +"的 :class:`~configparser.ConfigParser` 名稱。" #: ../../whatsnew/3.12.rst:1368 msgid "" -":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" -"meth:`~configparser.ConfigParser.read_file` instead." +":class:`configparser.ConfigParser` no longer has a ``readfp`` method. " +"Use :meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -":class:`configparser.ConfigParser` 不再具有 ``readfp`` 方法。請改用 :meth:" -"`~configparser.ConfigParser.read_file`。" +":class:`configparser.ConfigParser` 不再具有 ``readfp`` 方法。請改" +"用 :meth:`~configparser.ConfigParser.read_file`。" #: ../../whatsnew/3.12.rst:1374 msgid "distutils" @@ -3277,8 +3307,8 @@ msgid "" "Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " "instead. In write mode, the ``filename`` attribute added ``'.gz'`` file " -"extension if it was not present. (Contributed by Victor Stinner in :gh:" -"`94196`.)" +"extension if it was not present. (Contributed by Victor Stinner " +"in :gh:`94196`.)" msgstr "" #: ../../whatsnew/3.12.rst:1427 @@ -3287,11 +3317,11 @@ msgstr "hashlib" #: ../../whatsnew/3.12.rst:1429 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 " -"OpenSSL 1.1.1 (:pep:`644`): this OpenSSL version provides a C implementation " -"of :func:`~hashlib.pbkdf2_hmac` which is faster. (Contributed by Victor " -"Stinner in :gh:`94199`.)" +"Remove the pure Python implementation " +"of :mod:`hashlib`'s :func:`hashlib.pbkdf2_hmac`, deprecated in Python 3.10. " +"Python 3.10 and newer requires OpenSSL 1.1.1 (:pep:`644`): this OpenSSL " +"version provides a C implementation of :func:`~hashlib.pbkdf2_hmac` which is " +"faster. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" #: ../../whatsnew/3.12.rst:1436 ../../whatsnew/3.12.rst:1465 @@ -3337,8 +3367,8 @@ msgstr "imp" #: ../../whatsnew/3.12.rst:1459 msgid "" -"The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" -"gh:`98040`.)" +"The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw " +"in :gh:`98040`.)" msgstr ":mod:`!imp` 模組已被移除。(由 Barry Warsaw 在 :gh:`98040` 中貢獻。)" #: ../../whatsnew/3.12.rst:1462 @@ -3374,8 +3404,8 @@ msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" #: ../../whatsnew/3.12.rst:1470 -msgid ":attr:`importlib.util.MAGIC_NUMBER`" -msgstr ":attr:`importlib.util.MAGIC_NUMBER`" +msgid ":const:`importlib.util.MAGIC_NUMBER`" +msgstr ":const:`importlib.util.MAGIC_NUMBER`" #: ../../whatsnew/3.12.rst:1471 msgid "``imp.get_suffixes()``" @@ -3383,11 +3413,11 @@ msgstr "``imp.get_suffixes()``" #: ../../whatsnew/3.12.rst:1471 msgid "" -":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." -"EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" +":const:`importlib.machinery.SOURCE_SUFFIXES`, :const:`importlib.machinery.EXTENSION_SUFFIXES`, " +"and :const:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -":attr:`importlib.machinery.SOURCE_SUFFIXES`、:attr:`importlib.machinery." -"EXTENSION_SUFFIXES` 和 :attr:`importlib.machinery.BYTECODE_SUFFIXES`" +":const:`importlib.machinery.SOURCE_SUFFIXES`、:const:`importlib.machinery.EXTENSION_SUFFIXES` " +"和 :const:`importlib.machinery.BYTECODE_SUFFIXES`" #: ../../whatsnew/3.12.rst:1472 msgid "``imp.get_tag()``" @@ -3518,10 +3548,10 @@ msgstr "io" #: ../../whatsnew/3.12.rst:1513 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." -"open`) function is a built-in function. Since Python 3.10, :func:`!_pyio." -"open` is also a static method. (Contributed by Victor Stinner in :gh:" -"`94169`.)" +"in Python 3.10: just use :func:`open` instead. The :func:`open` " +"(:func:`io.open`) function is a built-in function. Since Python " +"3.10, :func:`!_pyio.open` is also a static method. (Contributed by Victor " +"Stinner in :gh:`94169`.)" msgstr "" #: ../../whatsnew/3.12.rst:1520 @@ -3541,10 +3571,10 @@ msgstr "smtpd" #: ../../whatsnew/3.12.rst:1529 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 the :pypi:" -"`aiosmtpd` PyPI module or any other :mod:`asyncio`-based server instead. " -"(Contributed by Oleg Iarygin in :gh:`93243`.)" +"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 " +"the :pypi:`aiosmtpd` PyPI module or any other :mod:`asyncio`-based server " +"instead. (Contributed by Oleg Iarygin in :gh:`93243`.)" msgstr "" #: ../../whatsnew/3.12.rst:1538 @@ -3569,9 +3599,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:1547 msgid "" -"The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" -"`str` since Python 3.3. Code that previously set the text factory to " -"``OptimizedUnicode`` can either use ``str`` explicitly, or rely on the " +"The ``sqlite3.OptimizedUnicode`` text factory has been an alias " +"for :class:`str` since Python 3.3. Code that previously set the text factory " +"to ``OptimizedUnicode`` can either use ``str`` explicitly, or rely on the " "default value which is also ``str``." msgstr "" @@ -3601,12 +3631,12 @@ msgstr "" #: ../../whatsnew/3.12.rst:1567 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." -"SSLContext.wrap_socket` method. Any package that still uses :func:`!ssl." -"wrap_socket` is broken and insecure. The function neither sends a SNI TLS " -"extension nor validates the server hostname. Code is subject to :cwe:`295` " -"(Improper Certificate Validation). (Contributed by Victor Stinner in :gh:" -"`94199`.)" +"instead, create a :class:`ssl.SSLContext` object and call " +"its :class:`ssl.SSLContext.wrap_socket` method. Any package that still " +"uses :func:`!ssl.wrap_socket` is broken and insecure. The function neither " +"sends a SNI TLS extension nor validates the server hostname. Code is subject " +"to :cwe:`295` (Improper Certificate Validation). (Contributed by Victor " +"Stinner in :gh:`94199`.)" msgstr "" #: ../../whatsnew/3.12.rst:1578 @@ -3761,9 +3791,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:1610 msgid "" -"Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " -"since Python 3.5)." +"Undocumented :meth:`TestLoader.loadTestsFromModule " +"` parameter *use_load_tests* " +"(deprecated and ignored since Python 3.5)." msgstr "" #: ../../whatsnew/3.12.rst:1614 @@ -3809,8 +3839,9 @@ msgstr "zipimport" #: ../../whatsnew/3.12.rst:1638 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`.)" +"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:1644 @@ -3819,20 +3850,20 @@ msgstr "其他" #: ../../whatsnew/3.12.rst:1646 msgid "" -"Remove the ``suspicious`` rule from the documentation :file:`Makefile` and :" -"file:`Doc/tools/rstlint.py`, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:" -"`98179`.)" +"Remove the ``suspicious`` rule from the documentation :file:`Makefile` " +"and :file:`Doc/tools/rstlint.py`, both in favor of `sphinx-lint `_. (Contributed by Julien Palard " +"in :gh:`98179`.)" msgstr "" #: ../../whatsnew/3.12.rst:1651 msgid "" -"Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" -"`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " -"*cert_file* and *check_hostname* parameters from the :mod:`http.client` " -"module, all deprecated since Python 3.6. Use the *context* parameter " -"(*ssl_context* in :mod:`imaplib`) instead. (Contributed by Victor Stinner " -"in :gh:`94172`.)" +"Remove the *keyfile* and *certfile* parameters from " +"the :mod:`ftplib`, :mod:`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, " +"and the *key_file*, *cert_file* and *check_hostname* parameters from " +"the :mod:`http.client` module, all deprecated since Python 3.6. Use the " +"*context* parameter (*ssl_context* in :mod:`imaplib`) instead. (Contributed " +"by Victor Stinner in :gh:`94172`.)" msgstr "" #: ../../whatsnew/3.12.rst:1659 @@ -3845,8 +3876,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:1662 msgid "" -"Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" -"`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" +"Remove ``_use_broken_old_ctypes_structure_semantics_`` flag " +"from :mod:`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" msgstr "" "移除 :mod:`ctypes` 模組中的 ``_use_broken_old_ctypes_structure_semantics_`` " "旗標。(由 Nikita Sobolev 於 :gh:`99285` 中貢獻。)" @@ -3882,8 +3913,8 @@ msgid "" "integer values such as ``randrange(10.5)`` or ``randrange('10')`` has been " "changed from :exc:`ValueError` to :exc:`TypeError`. This also prevents bugs " "where ``randrange(1e25)`` would silently select from a larger range than " -"``randrange(10**25)``. (Originally suggested by Serhiy Storchaka :gh:" -"`86388`.)" +"``randrange(10**25)``. (Originally suggested by Serhiy " +"Storchaka :gh:`86388`.)" msgstr "" #: ../../whatsnew/3.12.rst:1693 @@ -3899,8 +3930,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:1699 msgid "" "Remove the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " -"and 3.5.4. A recommended replacement is the :mod:`asyncio`-based :pypi:" -"`aiosmtpd` PyPI module." +"and 3.5.4. A recommended replacement is the :mod:`asyncio`-" +"based :pypi:`aiosmtpd` PyPI module." msgstr "" #: ../../whatsnew/3.12.rst:1703 @@ -3912,10 +3943,10 @@ msgstr "" #: ../../whatsnew/3.12.rst:1708 msgid "" -"The :mod:`os` module no longer accepts bytes-like paths, like :class:" -"`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " -"type is accepted for bytes strings. (Contributed by Victor Stinner in :gh:" -"`98393`.)" +"The :mod:`os` module no longer accepts bytes-like paths, " +"like :class:`bytearray` and :class:`memoryview` types: only the " +"exact :class:`bytes` type is accepted for bytes strings. (Contributed by " +"Victor Stinner in :gh:`98393`.)" msgstr "" #: ../../whatsnew/3.12.rst:1713 @@ -3944,21 +3975,23 @@ msgstr "" #: ../../whatsnew/3.12.rst:1735 msgid "" -"When extracting tar files using :mod:`tarfile` or :func:`shutil." -"unpack_archive`, pass the *filter* argument to limit features that may be " -"surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." +"When extracting tar files using :mod:`tarfile` " +"or :func:`shutil.unpack_archive`, pass the *filter* argument to limit " +"features that may be surprising or dangerous. See :ref:`tarfile-extraction-" +"filter` for details." msgstr "" #: ../../whatsnew/3.12.rst:1740 msgid "" -"The output of the :func:`tokenize.tokenize` and :func:`tokenize." -"generate_tokens` functions is now changed due to the changes introduced in :" -"pep:`701`. This means that ``STRING`` tokens are not emitted any more for f-" -"strings and the tokens described in :pep:`701` are now produced instead: " -"``FSTRING_START``, ``FSTRING_MIDDLE`` and ``FSTRING_END`` are now emitted " -"for f-string \"string\" parts in addition to the appropriate tokens for the " -"tokenization in the expression components. For example for the f-string " -"``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" +"The output of the :func:`tokenize.tokenize` " +"and :func:`tokenize.generate_tokens` functions is now changed due to the " +"changes introduced in :pep:`701`. This means that ``STRING`` tokens are not " +"emitted any more for f-strings and the tokens described in :pep:`701` are " +"now produced instead: ``FSTRING_START``, ``FSTRING_MIDDLE`` and " +"``FSTRING_END`` are now emitted for f-string \"string\" parts in addition to " +"the appropriate tokens for the tokenization in the expression components. " +"For example for the f-string ``f\"start {1+1} end\"`` the old version of the " +"tokenizer emitted::" msgstr "" #: ../../whatsnew/3.12.rst:1749 @@ -4063,11 +4096,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:1805 msgid "" -"Add ``COMPILEALL_OPTS`` variable in :file:`Makefile` to override :mod:" -"`compileall` options (default: ``-j0``) in ``make install``. Also merged the " -"3 ``compileall`` commands into a single command to build .pyc files for all " -"optimization levels (0, 1, 2) at once. (Contributed by Victor Stinner in :gh:" -"`99289`.)" +"Add ``COMPILEALL_OPTS`` variable in :file:`Makefile` to " +"override :mod:`compileall` options (default: ``-j0``) in ``make install``. " +"Also merged the 3 ``compileall`` commands into a single command to " +"build .pyc files for all optimization levels (0, 1, 2) at once. (Contributed " +"by Victor Stinner in :gh:`99289`.)" msgstr "" #: ../../whatsnew/3.12.rst:1811 @@ -4186,8 +4219,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:1865 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`." +"to allow safely extending certain variable-sized types, " +"including :c:var:`PyType_Type`." msgstr "" #: ../../whatsnew/3.12.rst:1868 @@ -4202,10 +4235,10 @@ msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" #: ../../whatsnew/3.12.rst:1873 msgid "" -"Add the new :ref:`limited C API ` function :c:func:" -"`PyType_FromMetaclass`, which generalizes the existing :c:func:" -"`PyType_FromModuleAndSpec` using an additional metaclass argument. " -"(Contributed by Wenzel Jakob in :gh:`93012`.)" +"Add the new :ref:`limited C API ` " +"function :c:func:`PyType_FromMetaclass`, which generalizes the " +"existing :c:func:`PyType_FromModuleAndSpec` using an additional metaclass " +"argument. (Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" #: ../../whatsnew/3.12.rst:1878 @@ -4237,16 +4270,16 @@ msgid "" "makes vectorcall safe to use with mutable types (i.e. heap types without the " "immutable flag, :c:macro:`Py_TPFLAGS_IMMUTABLETYPE`). Mutable types that do " "not override :c:member:`~PyTypeObject.tp_call` now inherit the " -"``Py_TPFLAGS_HAVE_VECTORCALL`` flag. (Contributed by Petr Viktorin in :gh:" -"`93274`.)" +"``Py_TPFLAGS_HAVE_VECTORCALL`` flag. (Contributed by Petr Viktorin " +"in :gh:`93274`.)" msgstr "" #: ../../whatsnew/3.12.rst:1895 msgid "" -"The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" -"`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " -"classes to support object :attr:`~object.__dict__` and weakrefs with less " -"bookkeeping, using less memory and with faster access." +"The :c:macro:`Py_TPFLAGS_MANAGED_DICT` " +"and :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows " +"extensions classes to support object :attr:`~object.__dict__` and weakrefs " +"with less bookkeeping, using less memory and with faster access." msgstr "" #: ../../whatsnew/3.12.rst:1900 @@ -4276,9 +4309,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:1912 msgid "" -"Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" -"func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " -"functions in all running threads in addition to the calling one. " +"Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` " +"and :c:func:`PyEval_SetTraceAllThreads`, that allow to set tracing and " +"profiling functions in all running threads in addition to the calling one. " "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" @@ -4291,11 +4324,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:1922 msgid "" -"The C API now permits registering callbacks via :c:func:" -"`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " -"whenever a dictionary is modified. This is intended for use by optimizing " -"interpreters, JIT compilers, or debuggers. (Contributed by Carl Meyer in :gh:" -"`91052`.)" +"The C API now permits registering callbacks " +"via :c:func:`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to " +"be called whenever a dictionary is modified. This is intended for use by " +"optimizing interpreters, JIT compilers, or debuggers. (Contributed by Carl " +"Meyer in :gh:`91052`.)" msgstr "" #: ../../whatsnew/3.12.rst:1928 @@ -4315,18 +4348,18 @@ msgstr "" #: ../../whatsnew/3.12.rst:1937 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`.)" +"get a frame variable by its name. (Contributed by Victor Stinner " +"in :gh:`91248`.)" msgstr "" #: ../../whatsnew/3.12.rst:1941 msgid "" -"Add :c:func:`PyErr_GetRaisedException` and :c:func:" -"`PyErr_SetRaisedException` for saving and restoring the current exception. " -"These functions return and accept a single exception object, rather than the " -"triple arguments of the now-deprecated :c:func:`PyErr_Fetch` and :c:func:" -"`PyErr_Restore`. This is less error prone and a bit more efficient. " -"(Contributed by Mark Shannon in :gh:`101578`.)" +"Add :c:func:`PyErr_GetRaisedException` " +"and :c:func:`PyErr_SetRaisedException` for saving and restoring the current " +"exception. These functions return and accept a single exception object, " +"rather than the triple arguments of the now-deprecated :c:func:`PyErr_Fetch` " +"and :c:func:`PyErr_Restore`. This is less error prone and a bit more " +"efficient. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" #: ../../whatsnew/3.12.rst:1949 @@ -4339,9 +4372,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:1953 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " -"convenience functions for retrieving and modifying the :attr:`~BaseException." -"args` passed to the exception's constructor. (Contributed by Mark Shannon " -"in :gh:`101578`.)" +"convenience functions for retrieving and modifying " +"the :attr:`~BaseException.args` passed to the exception's constructor. " +"(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" #: ../../whatsnew/3.12.rst:1958 @@ -4410,17 +4443,18 @@ msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" #: ../../whatsnew/3.12.rst:1982 msgid "" -":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function and :" -"c:type:`PyInterpreterConfig`, which may be used to create sub-interpreters " -"with their own GILs. (See :ref:`whatsnew312-pep684` for more info.) " -"(Contributed by Eric Snow in :gh:`104110`.)" +":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function " +"and :c:type:`PyInterpreterConfig`, which may be used to create sub-" +"interpreters with their own GILs. (See :ref:`whatsnew312-pep684` for more " +"info.) (Contributed by Eric Snow in :gh:`104110`.)" msgstr "" #: ../../whatsnew/3.12.rst:1988 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`.)" +"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:1996 @@ -4455,8 +4489,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:2015 msgid "" -"To get a list of subclasses, call the Python method :py:meth:`~type." -"__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." +"To get a list of subclasses, call the Python " +"method :py:meth:`~type.__subclasses__` (using :c:func:`PyObject_CallMethod`, " +"for example)." msgstr "" #: ../../whatsnew/3.12.rst:2019 @@ -4464,37 +4499,38 @@ 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 " "strings, variable width and precision) in :c:func:`PyUnicode_FromFormat` " -"and :c:func:`PyUnicode_FromFormatV`. (Contributed by Serhiy Storchaka in :gh:" -"`98836`.)" +"and :c:func:`PyUnicode_FromFormatV`. (Contributed by Serhiy Storchaka " +"in :gh:`98836`.)" msgstr "" #: ../../whatsnew/3.12.rst:2025 msgid "" -"An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" -"func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " -"versions it caused all the rest of the format string to be copied as-is to " -"the result string, and any extra arguments discarded. (Contributed by Serhiy " -"Storchaka in :gh:`95781`.)" +"An unrecognized format character in :c:func:`PyUnicode_FromFormat` " +"and :c:func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In " +"previous versions it caused all the rest of the format string to be copied " +"as-is to the result string, and any extra arguments discarded. (Contributed " +"by Serhiy Storchaka in :gh:`95781`.)" msgstr "" #: ../../whatsnew/3.12.rst:2031 msgid "" -"Fix wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" -"`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" +"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:2035 msgid "" "Extension classes wanting to add a :attr:`~object.__dict__` or weak " -"reference slot should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" -"`Py_TPFLAGS_MANAGED_WEAKREF` instead of ``tp_dictoffset`` and " +"reference slot should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` " +"and :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` instead of ``tp_dictoffset`` and " "``tp_weaklistoffset``, respectively. The use of ``tp_dictoffset`` and " "``tp_weaklistoffset`` is still supported, but does not fully support " "multiple inheritance (:gh:`95589`), and performance may be worse. Classes " "declaring :c:macro:`Py_TPFLAGS_MANAGED_DICT` must call :c:func:`!" "_PyObject_VisitManagedDict` and :c:func:`!_PyObject_ClearManagedDict` to " -"traverse and clear their instance's dictionaries. To clear weakrefs, call :c:" -"func:`PyObject_ClearWeakRefs`, as before." +"traverse and clear their instance's dictionaries. To clear weakrefs, " +"call :c:func:`PyObject_ClearWeakRefs`, as before." msgstr "" #: ../../whatsnew/3.12.rst:2047 @@ -4515,10 +4551,10 @@ msgstr "" #: ../../whatsnew/3.12.rst:2057 msgid "" -"The interpreter's error indicator is now always normalized. This means that :" -"c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " -"that set the error indicator now normalize the exception before storing it. " -"(Contributed by Mark Shannon in :gh:`101578`.)" +"The interpreter's error indicator is now always normalized. This means " +"that :c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other " +"functions that set the error indicator now normalize the exception before " +"storing it. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" #: ../../whatsnew/3.12.rst:2062 @@ -4558,8 +4594,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:2079 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)." +"disallows creating classes whose metaclass overrides ``tp_new`` " +"(:meth:`~object.__new__` in Python)." msgstr "" #: ../../whatsnew/3.12.rst:2083 @@ -4577,16 +4613,16 @@ msgstr "" #: ../../whatsnew/3.12.rst:2092 msgid "" -"If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." -"tp_init` instead." +"If initialization can be skipped, it can be done " +"in :c:member:`~PyTypeObject.tp_init` instead." msgstr "" #: ../../whatsnew/3.12.rst:2094 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " -"``tp_new`` to ``NULL`` using the :c:macro:" -"`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag. This makes it acceptable for " -"``PyType_From*`` functions." +"``tp_new`` to ``NULL`` using " +"the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag. This makes it " +"acceptable for ``PyType_From*`` functions." msgstr "" #: ../../whatsnew/3.12.rst:2099 @@ -4622,10 +4658,10 @@ msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " "they are used by some extension modules. The internal fields should no " -"longer be accessed directly, instead the API functions beginning ``PyLong_..." -"`` should be used instead. Two new *unstable* API functions are provided for " -"efficient access to the value of :c:struct:`PyLongObject`\\s which fit into " -"a single machine word:" +"longer be accessed directly, instead the API functions beginning " +"``PyLong_...`` should be used instead. Two new *unstable* API functions are " +"provided for efficient access to the value of :c:struct:`PyLongObject`\\s " +"which fit into a single machine word:" msgstr "" #: ../../whatsnew/3.12.rst:2123 @@ -4647,11 +4683,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:2136 msgid "" -"In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" -"`PyDictObject` is deprecated for extension modules. Accessing this field " -"will generate a compiler warning at compile time. This field will be removed " -"in Python 3.14. (Contributed by Ramvikrams and Kumar Aditya in :gh:`101193`. " -"PEP by Ken Jin.)" +"In accordance with :pep:`699`, the ``ma_version_tag`` field " +"in :c:type:`PyDictObject` is deprecated for extension modules. Accessing " +"this field will generate a compiler warning at compile time. This field will " +"be removed in Python 3.14. (Contributed by Ramvikrams and Kumar Aditya " +"in :gh:`101193`. PEP by Ken Jin.)" msgstr "" #: ../../whatsnew/3.12.rst:2141 @@ -4701,8 +4737,8 @@ msgstr "" msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" -":c:var:`Py_IgnoreEnvironmentFlag`: 請改用 :c:member:`PyConfig." -"use_environment`" +":c:var:`Py_IgnoreEnvironmentFlag`: 請改" +"用 :c:member:`PyConfig.use_environment`" #: ../../whatsnew/3.12.rst:2153 msgid "" @@ -4714,8 +4750,8 @@ msgstr "" msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" -":c:var:`Py_NoUserSiteDirectory`: 請改用 :c:member:`PyConfig." -"user_site_directory`" +":c:var:`Py_NoUserSiteDirectory`: 請改" +"用 :c:member:`PyConfig.user_site_directory`" #: ../../whatsnew/3.12.rst:2155 msgid "" @@ -4737,56 +4773,57 @@ msgstr ":c:var:`Py_IsolatedFlag`: 請改用 :c:member:`PyConfig.isolated`" #: ../../whatsnew/3.12.rst:2159 msgid "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." -"legacy_windows_fs_encoding`" +":c:var:`Py_LegacyWindowsFSEncodingFlag`: " +"use :c:member:`PyPreConfig.legacy_windows_fs_encoding`" msgstr "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: 請改用 :c:member:`PyPreConfig." -"legacy_windows_fs_encoding`" +":c:var:`Py_LegacyWindowsFSEncodingFlag`: 請改" +"用 :c:member:`PyPreConfig.legacy_windows_fs_encoding`" #: ../../whatsnew/3.12.rst:2160 msgid "" -":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." -"legacy_windows_stdio`" +":c:var:`Py_LegacyWindowsStdioFlag`: " +"use :c:member:`PyConfig.legacy_windows_stdio`" msgstr "" -":c:var:`Py_LegacyWindowsStdioFlag`: 請改用 :c:member:`PyConfig." -"legacy_windows_stdio`" +":c:var:`Py_LegacyWindowsStdioFlag`: 請改" +"用 :c:member:`PyConfig.legacy_windows_stdio`" #: ../../whatsnew/3.12.rst:2161 msgid "" -":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." -"filesystem_encoding`" +":c:var:`!Py_FileSystemDefaultEncoding`: " +"use :c:member:`PyConfig.filesystem_encoding`" msgstr "" -":c:var:`!Py_FileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." -"filesystem_encoding`" +":c:var:`!Py_FileSystemDefaultEncoding`: 請改" +"用 :c:member:`PyConfig.filesystem_encoding`" #: ../../whatsnew/3.12.rst:2162 msgid "" -":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." -"filesystem_encoding`" +":c:var:`!Py_HasFileSystemDefaultEncoding`: " +"use :c:member:`PyConfig.filesystem_encoding`" msgstr "" -":c:var:`!Py_HasFileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." -"filesystem_encoding`" +":c:var:`!Py_HasFileSystemDefaultEncoding`: 請改" +"用 :c:member:`PyConfig.filesystem_encoding`" #: ../../whatsnew/3.12.rst:2163 msgid "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." -"filesystem_errors`" +":c:var:`!Py_FileSystemDefaultEncodeErrors`: " +"use :c:member:`PyConfig.filesystem_errors`" msgstr "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: 請改用 :c:member:`PyConfig." -"filesystem_errors`" +":c:var:`!Py_FileSystemDefaultEncodeErrors`: 請改" +"用 :c:member:`PyConfig.filesystem_errors`" #: ../../whatsnew/3.12.rst:2164 msgid "" -":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" -"`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` " +"(see :c:func:`Py_PreInitialize`)" msgstr "" -":c:var:`!Py_UTF8Mode`: 請改用 :c:member:`PyPreConfig.utf8_mode`\\ (參見 :c:" -"func:`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`: 請改用 :c:member:`PyPreConfig.utf8_mode`\\ (參" +"見 :c:func:`Py_PreInitialize`)" #: ../../whatsnew/3.12.rst:2166 msgid "" -"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" -"`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" +"The :c:func:`Py_InitializeFromConfig` API should be used " +"with :c:type:`PyConfig` instead. (Contributed by Victor Stinner " +"in :gh:`77782`.)" msgstr "" ":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" "(由 Victor Stinner 於 :gh:`77782` 中貢獻。)" @@ -4811,11 +4848,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:2179 msgid "" -":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" -"`PyMember_SetOne`" +":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` " +"and :c:func:`PyMember_SetOne`" msgstr "" -":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` 和 :c:func:" -"`PyMember_SetOne`" +":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` " +"和 :c:func:`PyMember_SetOne`" #: ../../whatsnew/3.12.rst:2181 msgid "" @@ -4825,11 +4862,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:2183 msgid "" -"The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" -"`Py_AUDIT_READ` (previously all uppercase)" +"The flags :c:macro:`Py_READONLY` (previously ``READONLY``) " +"and :c:macro:`Py_AUDIT_READ` (previously all uppercase)" msgstr "" -":c:macro:`Py_READONLY`\\ (先前為 ``READONLY``)和 :c:macro:" -"`Py_AUDIT_READ`\\ (先前全大寫)旗標" +":c:macro:`Py_READONLY`\\ (先前為 ``READONLY``)" +"和 :c:macro:`Py_AUDIT_READ`\\ (先前全大寫)旗標" #: ../../whatsnew/3.12.rst:2186 msgid "Several items are not exposed from :file:`Python.h`:" @@ -4849,16 +4886,17 @@ msgstr "不做任何事的巨集 ``WRITE_RESTRICTED``。" #: ../../whatsnew/3.12.rst:2191 msgid "" -"The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" -"`Py_AUDIT_READ`." +"The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents " +"of :c:macro:`Py_AUDIT_READ`." msgstr "" -"``RESTRICTED`` 和 ``READ_RESTRICTED`` 這兩個巨集,相當於 :c:macro:" -"`Py_AUDIT_READ`。" +"``RESTRICTED`` 和 ``READ_RESTRICTED`` 這兩個巨集,相當" +"於 :c:macro:`Py_AUDIT_READ`。" #: ../../whatsnew/3.12.rst:2193 msgid "" -"In some configurations, ```` is not included from :file:`Python." -"h`. It should be included manually when using ``offsetof()``." +"In some configurations, ```` is not included " +"from :file:`Python.h`. It should be included manually when using " +"``offsetof()``." msgstr "" #: ../../whatsnew/3.12.rst:2196 @@ -4876,9 +4914,10 @@ msgstr "" #: ../../whatsnew/3.12.rst:2204 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`.)" +":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:2209 @@ -4899,29 +4938,30 @@ msgstr "" #: ../../whatsnew/3.12.rst:2215 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." +"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 "" -"使用 :c:func:`PyType_FromSpec`、:c:func:`PyType_FromSpecWithBases` 或 :c:" -"func:`PyType_FromModuleAndSpec` 建立一個其元類別覆寫 :c:member:" -"`~PyTypeObject.tp_new` 的類別已被棄用。請改為呼叫元類別。" +"使用 :c:func:`PyType_FromSpec`、:c:func:`PyType_FromSpecWithBases` " +"或 :c:func:`PyType_FromModuleAndSpec` 建立一個其元類別覆" +"寫 :c:member:`~PyTypeObject.tp_new` 的類別已被棄用。請改為呼叫元類別。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:4 msgid "" "The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " "(:pep:`699`; :gh:`101193`)." msgstr "" -":c:type:`PyDictObject` 中的 ``ma_version_tag`` 欄位,用於擴充模組 (:pep:" -"`699`;:gh:`101193`)。" +":c:type:`PyDictObject` 中的 ``ma_version_tag`` 欄位,用於擴充模組 " +"(:pep:`699`;:gh:`101193`)。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:7 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases (:gh:`95388`)." msgstr "" -"使用可變基底建立\\ :c:data:`不可變型別 ` (:gh:" -"`95388`)。" +"使用可變基底建立\\ :c:data:`不可變型別 ` " +"(:gh:`95388`)。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:10 msgid "" @@ -4951,8 +4991,8 @@ msgstr ":c:func:`!Py_SetPythonHome()`:請改以 :c:member:`PyConfig.home` 設 #: ../../deprecations/c-api-pending-removal-in-3.14.rst:21 #: ../../deprecations/c-api-pending-removal-in-3.14.rst:71 msgid "" -"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" -"`PyConfig` instead." +"The :c:func:`Py_InitializeFromConfig` API should be used " +"with :c:type:`PyConfig` instead." msgstr "" ":c:func:`Py_InitializeFromConfig` API 應該與 :c:type:`PyConfig` 一起使用。" @@ -5009,24 +5049,24 @@ msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` " "instead." msgstr "" -":c:var:`Py_IgnoreEnvironmentFlag`:請改用 :c:member:`PyConfig." -"use_environment`。" +":c:var:`Py_IgnoreEnvironmentFlag`:請改" +"用 :c:member:`PyConfig.use_environment`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:46 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` " "instead." msgstr "" -":c:var:`Py_DontWriteBytecodeFlag`:請改用 :c:member:`PyConfig." -"write_bytecode`。" +":c:var:`Py_DontWriteBytecodeFlag`:請改" +"用 :c:member:`PyConfig.write_bytecode`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:48 msgid "" -":c:var:`Py_NoUserSiteDirectory`: Use :c:member:`PyConfig." -"user_site_directory` instead." +":c:var:`Py_NoUserSiteDirectory`: " +"Use :c:member:`PyConfig.user_site_directory` instead." msgstr "" -":c:var:`Py_NoUserSiteDirectory`:請改用 :c:member:`PyConfig." -"user_site_directory`。" +":c:var:`Py_NoUserSiteDirectory`:請改" +"用 :c:member:`PyConfig.user_site_directory`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:50 msgid "" @@ -5049,51 +5089,51 @@ msgstr ":c:var:`Py_IsolatedFlag`:請改用 :c:member:`PyConfig.isolated`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:57 msgid "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use :c:member:`PyPreConfig." -"legacy_windows_fs_encoding` instead." +":c:var:`Py_LegacyWindowsFSEncodingFlag`: " +"Use :c:member:`PyPreConfig.legacy_windows_fs_encoding` instead." msgstr "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改用 :c:member:`PyPreConfig." -"legacy_windows_fs_encoding`。" +":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改" +"用 :c:member:`PyPreConfig.legacy_windows_fs_encoding`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:59 msgid "" -":c:var:`Py_LegacyWindowsStdioFlag`: Use :c:member:`PyConfig." -"legacy_windows_stdio` instead." +":c:var:`Py_LegacyWindowsStdioFlag`: " +"Use :c:member:`PyConfig.legacy_windows_stdio` instead." msgstr "" -":c:var:`Py_LegacyWindowsStdioFlag`:請改用 :c:member:`PyConfig." -"legacy_windows_stdio`。" +":c:var:`Py_LegacyWindowsStdioFlag`:請改" +"用 :c:member:`PyConfig.legacy_windows_stdio`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:61 msgid "" -":c:var:`!Py_FileSystemDefaultEncoding`: Use :c:member:`PyConfig." -"filesystem_encoding` instead." +":c:var:`!Py_FileSystemDefaultEncoding`: " +"Use :c:member:`PyConfig.filesystem_encoding` instead." msgstr "" -":c:var:`!Py_FileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." -"filesystem_encoding`。" +":c:var:`!Py_FileSystemDefaultEncoding`:請改" +"用 :c:member:`PyConfig.filesystem_encoding`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:63 msgid "" -":c:var:`!Py_HasFileSystemDefaultEncoding`: Use :c:member:`PyConfig." -"filesystem_encoding` instead." +":c:var:`!Py_HasFileSystemDefaultEncoding`: " +"Use :c:member:`PyConfig.filesystem_encoding` instead." msgstr "" -":c:var:`!Py_HasFileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." -"filesystem_encoding`。" +":c:var:`!Py_HasFileSystemDefaultEncoding`:請改" +"用 :c:member:`PyConfig.filesystem_encoding`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:65 msgid "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use :c:member:`PyConfig." -"filesystem_errors` instead." +":c:var:`!Py_FileSystemDefaultEncodeErrors`: " +"Use :c:member:`PyConfig.filesystem_errors` instead." msgstr "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改用 :c:member:`PyConfig." -"filesystem_errors`。" +":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改" +"用 :c:member:`PyConfig.filesystem_errors`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:67 msgid "" -":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` instead. (see :" -"c:func:`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` instead. " +"(see :c:func:`Py_PreInitialize`)" msgstr "" -":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode`。(請見 :c:" -"func:`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode`。(請" +"見 :c:func:`Py_PreInitialize`)" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:4 msgid "The bundled copy of ``libmpdecimal``." @@ -5101,27 +5141,27 @@ msgstr "``libmpdecimal`` 的打包副本 (bundled copy)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:5 msgid "" -"The :c:func:`PyImport_ImportModuleNoBlock`: Use :c:func:" -"`PyImport_ImportModule` instead." +"The :c:func:`PyImport_ImportModuleNoBlock`: " +"Use :c:func:`PyImport_ImportModule` instead." msgstr "" -":c:func:`PyImport_ImportModuleNoBlock`:請改用 :c:func:" -"`PyImport_ImportModule`。" +":c:func:`PyImport_ImportModuleNoBlock`:請改" +"用 :c:func:`PyImport_ImportModule`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:7 msgid "" -":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:" -"func:`PyWeakref_GetRef` instead." +":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: " +"Use :c:func:`PyWeakref_GetRef` instead." msgstr "" -":c:func:`PyWeakref_GetObject` 和 :c:func:`PyWeakref_GET_OBJECT`:請改用 :c:" -"func:`PyWeakref_GetRef`。" +":c:func:`PyWeakref_GetObject` 和 :c:func:`PyWeakref_GET_OBJECT`:請改" +"用 :c:func:`PyWeakref_GetRef`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:9 msgid "" -":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use :c:" -"type:`wchar_t` instead." +":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: " +"Use :c:type:`wchar_t` instead." msgstr "" -":c:type:`Py_UNICODE` 型別與 :c:macro:`!Py_UNICODE_WIDE` 巨集:請改用 :c:type:" -"`wchar_t`。" +":c:type:`Py_UNICODE` 型別與 :c:macro:`!Py_UNICODE_WIDE` 巨集:請改" +"用 :c:type:`wchar_t`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:11 msgid "Python initialization functions:" @@ -5132,16 +5172,16 @@ msgid "" ":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" "warnings.filters` instead." msgstr "" -":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` 和 :" -"data:`!warnings.filters`。" +":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` " +"和 :data:`!warnings.filters`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 msgid "" -":c:func:`Py_GetExecPrefix`: Get :data:`sys.base_exec_prefix` and :data:`sys." -"exec_prefix` instead." +":c:func:`Py_GetExecPrefix`: Get :data:`sys.base_exec_prefix` " +"and :data:`sys.exec_prefix` instead." msgstr "" -":c:func:`Py_GetExecPrefix`:請改用 :data:`sys.base_exec_prefix` 與 :data:" -"`sys.exec_prefix`。" +":c:func:`Py_GetExecPrefix`:請改用 :data:`sys.base_exec_prefix` " +"與 :data:`sys.exec_prefix`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." @@ -5152,8 +5192,8 @@ msgid "" ":c:func:`Py_GetPrefix`: Get :data:`sys.base_prefix` and :data:`sys.prefix` " "instead." msgstr "" -":c:func:`Py_GetPrefix`:請改用 :data:`sys.base_prefix` 與 :data:`sys." -"prefix`。" +":c:func:`Py_GetPrefix`:請改用 :data:`sys.base_prefix` " +"與 :data:`sys.prefix`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:21 msgid ":c:func:`Py_GetProgramFullPath`: Get :data:`sys.executable` instead." @@ -5165,11 +5205,11 @@ msgstr ":c:func:`Py_GetProgramName`:請改用 :data:`sys.executable`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:25 msgid "" -":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:" -"`PYTHONHOME` environment variable instead." +":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or " +"the :envvar:`PYTHONHOME` environment variable instead." msgstr "" -":c:func:`Py_GetPythonHome`:請改用 :c:member:`PyConfig.home` 或 :envvar:" -"`PYTHONHOME` 環境變數。" +":c:func:`Py_GetPythonHome`:請改用 :c:member:`PyConfig.home` " +"或 :envvar:`PYTHONHOME` 環境變數。" #: ../../deprecations/c-api-pending-removal-in-future.rst:4 msgid "" @@ -5190,8 +5230,8 @@ msgid "" ":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` " "instead." msgstr "" -":c:func:`PyErr_NormalizeException`:請改用 :c:func:" -"`PyErr_GetRaisedException`。" +":c:func:`PyErr_NormalizeException`:請改" +"用 :c:func:`PyErr_GetRaisedException`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:13 msgid "" @@ -5211,11 +5251,11 @@ msgstr ":c:func:`PyOS_AfterFork`:請改用 :c:func:`PyOS_AfterFork_Child`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:19 msgid "" -":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and :c:func:" -"`PySlice_AdjustIndices` instead." +":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` " +"and :c:func:`PySlice_AdjustIndices` instead." msgstr "" -":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` 和 :c:func:" -"`PySlice_AdjustIndices`。" +":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` " +"和 :c:func:`PySlice_AdjustIndices`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:21 msgid "" @@ -5261,8 +5301,8 @@ msgid "" ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " "instead." msgstr "" -":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼叫 :c:func:" -"`PyObject_Hash`。" +":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼" +"叫 :c:func:`PyObject_Hash`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:37 msgid ":c:member:`!PyDictObject.ma_version_tag` member." @@ -5354,5 +5394,5 @@ msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" -"移除 ``PyUnicode_InternImmortal()`` 函式巨集。(由 Victor Stinner 於 :gh:" -"`85858` 中貢獻。)" +"移除 ``PyUnicode_InternImmortal()`` 函式巨集。(由 Victor Stinner " +"於 :gh:`85858` 中貢獻。)" diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index 8515c9a886..fe2d9f58d6 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-29 11:18+0000\n" +"POT-Creation-Date: 2025-02-05 00:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,8 +31,8 @@ msgstr "Adam Turner 和 Thomas Wouters" #: ../../whatsnew/3.13.rst:48 msgid "" "This article explains the new features in Python 3.13, compared to 3.12. " -"Python 3.13 was released on October 7, 2024. For full details, see the :ref:" -"`changelog `." +"Python 3.13 was released on October 7, 2024. For full details, see " +"the :ref:`changelog `." msgstr "" "本文介紹了 Python 3.13 與 3.12 相比多了哪些新功能。Python 3.13 已於 2024 年 " "10 月 7 日發布。完整詳情請見 :ref:`changelog `。" @@ -51,9 +51,9 @@ msgid "" "with a mix of changes to the language, the implementation and the standard " "library. The biggest changes include a new `interactive interpreter " "`_, experimental support for " -"running in a `free-threaded mode `_ (:" -"pep:`703`), and a `Just-In-Time compiler `_ (:pep:" -"`744`)." +"running in a `free-threaded mode `_ " +"(:pep:`703`), and a `Just-In-Time compiler `_ " +"(:pep:`744`)." msgstr "" #: ../../whatsnew/3.13.rst:72 @@ -76,8 +76,8 @@ msgstr "" msgid "" "This article doesn't attempt to provide a complete specification of all new " "features, but instead gives a convenient overview. For full details refer to " -"the documentation, such as the :ref:`Library Reference ` and :" -"ref:`Language Reference `. To understand the complete " +"the documentation, such as the :ref:`Library Reference ` " +"and :ref:`Language Reference `. To understand the complete " "implementation and design rationale for a change, refer to the PEP for a " "particular new feature; but note that PEPs usually are not kept up-to-date " "once a feature has been fully implemented. See `Porting to Python 3.13`_ for " @@ -105,9 +105,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:108 msgid "" -":pep:`703`: CPython 3.13 has experimental support for running with the :term:" -"`global interpreter lock` disabled. See :ref:`Free-threaded CPython " -"` for more details." +":pep:`703`: CPython 3.13 has experimental support for running with " +"the :term:`global interpreter lock` disabled. See :ref:`Free-threaded " +"CPython ` for more details." msgstr "" #: ../../whatsnew/3.13.rst:111 @@ -168,8 +168,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:137 msgid "" "The :mod:`copy` module now has a :func:`copy.replace` function, with support " -"for many builtin types and any class defining the :func:`~object." -"__replace__` method." +"for many builtin types and any class defining " +"the :func:`~object.__replace__` method." msgstr "" #: ../../whatsnew/3.13.rst:140 @@ -195,9 +195,9 @@ msgstr "安全性改進:" #: ../../whatsnew/3.13.rst:147 msgid "" -":func:`ssl.create_default_context` sets :data:`ssl." -"VERIFY_X509_PARTIAL_CHAIN` and :data:`ssl.VERIFY_X509_STRICT` as default " -"flags." +":func:`ssl.create_default_context` " +"sets :data:`ssl.VERIFY_X509_PARTIAL_CHAIN` " +"and :data:`ssl.VERIFY_X509_STRICT` as default flags." msgstr "" #: ../../whatsnew/3.13.rst:150 @@ -223,8 +223,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:157 msgid "" -"There is a new :ref:`suite of functions ` for generating :" -"pep:`669` monitoring events in the C API." +"There is a new :ref:`suite of functions ` for " +"generating :pep:`669` monitoring events in the C API." msgstr "" #: ../../whatsnew/3.13.rst:160 @@ -233,8 +233,9 @@ msgstr "新增型別特性:" #: ../../whatsnew/3.13.rst:162 msgid "" -":pep:`696`: Type parameters (:data:`typing.TypeVar`, :data:`typing." -"ParamSpec`, and :data:`typing.TypeVarTuple`) now support defaults." +":pep:`696`: Type parameters " +"(:data:`typing.TypeVar`, :data:`typing.ParamSpec`, " +"and :data:`typing.TypeVarTuple`) now support defaults." msgstr "" #: ../../whatsnew/3.13.rst:164 @@ -245,8 +246,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:166 msgid "" -":pep:`705`: :data:`typing.ReadOnly` can be used to mark an item of a :class:" -"`typing.TypedDict` as read-only for type checkers." +":pep:`705`: :data:`typing.ReadOnly` can be used to mark an item of " +"a :class:`typing.TypedDict` as read-only for type checkers." msgstr "" #: ../../whatsnew/3.13.rst:168 @@ -290,15 +291,15 @@ msgid "" "(legacy stdlib modules) have been removed from the standard library: :mod:`!" "aifc`, :mod:`!audioop`, :mod:`!cgi`, :mod:`!cgitb`, :mod:`!chunk`, :mod:`!" "crypt`, :mod:`!imghdr`, :mod:`!mailcap`, :mod:`!msilib`, :mod:`!nis`, :mod:`!" -"nntplib`, :mod:`!ossaudiodev`, :mod:`!pipes`, :mod:`!sndhdr`, :mod:`!spwd`, :" -"mod:`!sunau`, :mod:`!telnetlib`, :mod:`!uu` and :mod:`!xdrlib`." +"nntplib`, :mod:`!ossaudiodev`, :mod:`!pipes`, :mod:`!sndhdr`, :mod:`!" +"spwd`, :mod:`!sunau`, :mod:`!telnetlib`, :mod:`!uu` and :mod:`!xdrlib`." msgstr "" ":ref:`PEP 594 `: 剩下的 19 個 \"dead batteries\" (遺留標" "準函式庫模組)已自標準函式庫中移除::mod:`!aifc`、:mod:`!audioop`、:mod:`!" "cgi`、:mod:`!cgitb`、:mod:`!chunk`、:mod:`!crypt`、:mod:`!imghdr`、:mod:`!" "mailcap`、:mod:`!msilib`、:mod:`!nis`、:mod:`!nntplib`、:mod:`!" -"ossaudiodev`、:mod:`!pipes`、:mod:`!sndhdr`、:mod:`!spwd`、:mod:`!sunau`、:" -"mod:`!telnetlib`、:mod:`!uu` 和 :mod:`!xdrlib`." +"ossaudiodev`、:mod:`!pipes`、:mod:`!sndhdr`、:mod:`!spwd`、:mod:`!" +"sunau`、:mod:`!telnetlib`、:mod:`!uu` 和 :mod:`!xdrlib`." #: ../../whatsnew/3.13.rst:188 msgid "" @@ -345,7 +346,7 @@ msgid "" "years of security fixes." msgstr "" -#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:1985 +#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:2037 msgid "New Features" msgstr "新增功能" @@ -383,8 +384,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:228 msgid "" -"History browsing using :kbd:`F2` that skips output as well as the :term:" -"`>>>` and :term:`...` prompts." +"History browsing using :kbd:`F2` that skips output as well as " +"the :term:`>>>` and :term:`...` prompts." msgstr "" #: ../../whatsnew/3.13.rst:230 @@ -548,7 +549,7 @@ msgstr "" #: ../../whatsnew/3.13.rst:336 msgid "" "To check if the current interpreter supports free-threading, :option:`python " -"-VV <-V>` and :attr:`sys.version` contain \"experimental free-threading " +"-VV <-V>` and :data:`sys.version` contain \"experimental free-threading " "build\". The new :func:`!sys._is_gil_enabled` function can be used to check " "whether the GIL is actually disabled in the running process." msgstr "" @@ -699,35 +700,35 @@ msgstr "" #: ../../whatsnew/3.13.rst:432 msgid "" -"Historically, the expected result of mutating the return value of :func:" -"`locals` has been left to individual Python implementations to define. " -"Starting from Python 3.13, :pep:`667` standardises the historical behavior " -"of CPython for most code execution scopes, but changes :term:`optimized " -"scopes ` (functions, generators, coroutines, " -"comprehensions, and generator expressions) to explicitly return independent " -"snapshots of the currently assigned local variables, including locally " -"referenced nonlocal variables captured in closures." +"Historically, the expected result of mutating the return value " +"of :func:`locals` has been left to individual Python implementations to " +"define. Starting from Python 3.13, :pep:`667` standardises the historical " +"behavior of CPython for most code execution scopes, but " +"changes :term:`optimized scopes ` (functions, generators, " +"coroutines, comprehensions, and generator expressions) to explicitly return " +"independent snapshots of the currently assigned local variables, including " +"locally referenced nonlocal variables captured in closures." msgstr "" #: ../../whatsnew/3.13.rst:441 msgid "" "This change to the semantics of :func:`locals` in optimized scopes also " "affects the default behavior of code execution functions that implicitly " -"target :func:`!locals` if no explicit namespace is provided (such as :func:" -"`exec` and :func:`eval`). In previous versions, whether or not changes could " -"be accessed by calling :func:`!locals` after calling the code execution " -"function was implementation-dependent. In CPython specifically, such code " -"would typically appear to work as desired, but could sometimes fail in " -"optimized scopes based on other code (including debuggers and code execution " -"tracing tools) potentially resetting the shared snapshot in that scope. Now, " -"the code will always run against an independent snapshot of the local " -"variables in optimized scopes, and hence the changes will never be visible " -"in subsequent calls to :func:`!locals`. To access the changes made in these " -"cases, an explicit namespace reference must now be passed to the relevant " -"function. Alternatively, it may make sense to update affected code to use a " -"higher level code execution API that returns the resulting code execution " -"namespace (e.g. :func:`runpy.run_path` when executing Python files from " -"disk)." +"target :func:`!locals` if no explicit namespace is provided (such " +"as :func:`exec` and :func:`eval`). In previous versions, whether or not " +"changes could be accessed by calling :func:`!locals` after calling the code " +"execution function was implementation-dependent. In CPython specifically, " +"such code would typically appear to work as desired, but could sometimes " +"fail in optimized scopes based on other code (including debuggers and code " +"execution tracing tools) potentially resetting the shared snapshot in that " +"scope. Now, the code will always run against an independent snapshot of the " +"local variables in optimized scopes, and hence the changes will never be " +"visible in subsequent calls to :func:`!locals`. To access the changes made " +"in these cases, an explicit namespace reference must now be passed to the " +"relevant function. Alternatively, it may make sense to update affected code " +"to use a higher level code execution API that returns the resulting code " +"execution namespace (e.g. :func:`runpy.run_path` when executing Python files " +"from disk)." msgstr "" #: ../../whatsnew/3.13.rst:460 @@ -743,16 +744,16 @@ msgstr "" #: ../../whatsnew/3.13.rst:466 msgid "" "See :pep:`667` for more details, including related C API changes and " -"deprecations. Porting notes are also provided below for the affected :ref:" -"`Python APIs ` and :ref:`C APIs `." +"deprecations. Porting notes are also provided below for the " +"affected :ref:`Python APIs ` and :ref:`C APIs " +"`." msgstr "" #: ../../whatsnew/3.13.rst:471 msgid "" -"(PEP and implementation contributed by Mark Shannon and Tian Gao in :gh:" -"`74929`. Documentation updates provided by Guido van Rossum and Alyssa " -"Coghlan.)" +"(PEP and implementation contributed by Mark Shannon and Tian Gao " +"in :gh:`74929`. Documentation updates provided by Guido van Rossum and " +"Alyssa Coghlan.)" msgstr "" #: ../../whatsnew/3.13.rst:479 @@ -847,8 +848,8 @@ msgstr "" msgid "" ":keyword:`global` declarations are now permitted in :keyword:`except` blocks " "when that global is used in the :keyword:`else` block. Previously this " -"raised an erroneous :exc:`SyntaxError`. (Contributed by Irit Katriel in :gh:" -"`111123`.)" +"raised an erroneous :exc:`SyntaxError`. (Contributed by Irit Katriel " +"in :gh:`111123`.)" msgstr "" #: ../../whatsnew/3.13.rst:549 @@ -864,15 +865,15 @@ msgid "" "Add :ref:`support for the perf profiler ` working without " "`frame pointers `_ through the new " "environment variable :envvar:`PYTHON_PERF_JIT_SUPPORT` and command-line " -"option :option:`-X perf_jit <-X>`. (Contributed by Pablo Galindo in :gh:" -"`118518`.)" +"option :option:`-X perf_jit <-X>`. (Contributed by Pablo Galindo " +"in :gh:`118518`.)" msgstr "" #: ../../whatsnew/3.13.rst:560 msgid "" -"The location of a :file:`.python_history` file can be changed via the new :" -"envvar:`PYTHON_HISTORY` environment variable. (Contributed by Levi Sabah, " -"Zackery Spytz and Hugo van Kemenade in :gh:`73965`.)" +"The location of a :file:`.python_history` file can be changed via the " +"new :envvar:`PYTHON_HISTORY` environment variable. (Contributed by Levi " +"Sabah, Zackery Spytz and Hugo van Kemenade in :gh:`73965`.)" msgstr "" #: ../../whatsnew/3.13.rst:565 @@ -893,15 +894,15 @@ msgstr "" #: ../../whatsnew/3.13.rst:574 msgid "" "The :func:`exec` and :func:`eval` builtins now accept the *globals* and " -"*locals* arguments as keywords. (Contributed by Raphael Gaschignard in :gh:" -"`105879`)" +"*locals* arguments as keywords. (Contributed by Raphael Gaschignard " +"in :gh:`105879`)" msgstr "" #: ../../whatsnew/3.13.rst:578 msgid "" -"The :func:`compile` builtin now accepts a new flag, ``ast." -"PyCF_OPTIMIZED_AST``, which is similar to ``ast.PyCF_ONLY_AST`` except that " -"the returned AST is optimized according to the value of the *optimize* " +"The :func:`compile` builtin now accepts a new flag, " +"``ast.PyCF_OPTIMIZED_AST``, which is similar to ``ast.PyCF_ONLY_AST`` except " +"that the returned AST is optimized according to the value of the *optimize* " "argument. (Contributed by Irit Katriel in :gh:`108113`)." msgstr "" @@ -913,10 +914,10 @@ msgstr "" #: ../../whatsnew/3.13.rst:587 msgid "" -"Add :exc:`PythonFinalizationError`, a new exception derived from :exc:" -"`RuntimeError` and used to signal when operations are blocked during :term:" -"`finalization `. The following callables now raise :" -"exc:`!PythonFinalizationError`, instead of :exc:`RuntimeError`:" +"Add :exc:`PythonFinalizationError`, a new exception derived " +"from :exc:`RuntimeError` and used to signal when operations are blocked " +"during :term:`finalization `. The following callables " +"now raise :exc:`!PythonFinalizationError`, instead of :exc:`RuntimeError`:" msgstr "" #: ../../whatsnew/3.13.rst:593 @@ -944,8 +945,8 @@ msgid "" "Allow the *count* argument of :meth:`str.replace` to be a keyword. " "(Contributed by Hugo van Kemenade in :gh:`106487`.)" msgstr "" -"允許 :meth:`str.replace` 的 *count* 引數為關鍵字。(由 Hugo van Kemenade 在 :" -"gh:`106487` 中貢獻。)" +"允許 :meth:`str.replace` 的 *count* 引數為關鍵字。(由 Hugo van Kemenade " +"在 :gh:`106487` 中貢獻。)" #: ../../whatsnew/3.13.rst:603 msgid "" @@ -957,8 +958,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:608 msgid "" "Added :attr:`!name` and :attr:`!mode` attributes for compressed and archived " -"file-like objects in the :mod:`bz2`, :mod:`lzma`, :mod:`tarfile`, and :mod:" -"`zipfile` modules. (Contributed by Serhiy Storchaka in :gh:`115961`.)" +"file-like objects in the :mod:`bz2`, :mod:`lzma`, :mod:`tarfile`, " +"and :mod:`zipfile` modules. (Contributed by Serhiy Storchaka " +"in :gh:`115961`.)" msgstr "" #: ../../whatsnew/3.13.rst:615 @@ -981,10 +983,10 @@ msgstr "argparse" #: ../../whatsnew/3.13.rst:628 msgid "" -"Add the *deprecated* parameter to the :meth:`~argparse.ArgumentParser." -"add_argument` and :meth:`!add_parser` methods, to enable deprecating command-" -"line options, positional arguments, and subcommands. (Contributed by Serhiy " -"Storchaka in :gh:`83648`.)" +"Add the *deprecated* parameter to " +"the :meth:`~argparse.ArgumentParser.add_argument` and :meth:`!add_parser` " +"methods, to enable deprecating command-line options, positional arguments, " +"and subcommands. (Contributed by Serhiy Storchaka in :gh:`83648`.)" msgstr "" #: ../../whatsnew/3.13.rst:636 @@ -1038,14 +1040,14 @@ msgstr "" #: ../../whatsnew/3.13.rst:669 msgid "" "These changes do not apply to user-defined subclasses of :class:`ast.AST` " -"unless the class opts in to the new behavior by defining the :attr:`.AST." -"_field_types` mapping." +"unless the class opts in to the new behavior by defining " +"the :attr:`.AST._field_types` mapping." msgstr "" #: ../../whatsnew/3.13.rst:673 msgid "" -"(Contributed by Jelle Zijlstra in :gh:`105858`, :gh:`117486`, and :gh:" -"`118851`.)" +"(Contributed by Jelle Zijlstra in :gh:`105858`, :gh:`117486`, " +"and :gh:`118851`.)" msgstr "" #: ../../whatsnew/3.13.rst:675 @@ -1061,19 +1063,19 @@ msgstr "asyncio" #: ../../whatsnew/3.13.rst:684 msgid "" -":func:`asyncio.as_completed` now returns an object that is both an :term:" -"`asynchronous iterator` and a plain :term:`iterator` of :term:`awaitables " -"`. The awaitables yielded by asynchronous iteration include " -"original task or future objects that were passed in, making it easier to " -"associate results with the tasks being completed. (Contributed by Justin " -"Arthur in :gh:`77714`.)" +":func:`asyncio.as_completed` now returns an object that is both " +"an :term:`asynchronous iterator` and a plain :term:`iterator` " +"of :term:`awaitables `. The awaitables yielded by asynchronous " +"iteration include original task or future objects that were passed in, " +"making it easier to associate results with the tasks being completed. " +"(Contributed by Justin Arthur in :gh:`77714`.)" msgstr "" #: ../../whatsnew/3.13.rst:692 msgid "" ":meth:`asyncio.loop.create_unix_server` will now automatically remove the " -"Unix socket when the server is closed. (Contributed by Pierre Ossman in :gh:" -"`111246`.)" +"Unix socket when the server is closed. (Contributed by Pierre Ossman " +"in :gh:`111246`.)" msgstr "" #: ../../whatsnew/3.13.rst:696 @@ -1086,9 +1088,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:702 msgid "" -"Add :meth:`Queue.shutdown ` and :exc:`~asyncio." -"QueueShutDown` to manage queue termination. (Contributed by Laurie Opperman " -"and Yves Duprat in :gh:`104228`.)" +"Add :meth:`Queue.shutdown ` " +"and :exc:`~asyncio.QueueShutDown` to manage queue termination. (Contributed " +"by Laurie Opperman and Yves Duprat in :gh:`104228`.)" msgstr "" #: ../../whatsnew/3.13.rst:706 @@ -1101,8 +1103,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:710 msgid "" "Accept a tuple of separators in :meth:`.StreamReader.readuntil`, stopping " -"when any one of them is encountered. (Contributed by Bruce Merry in :gh:" -"`81322`.)" +"when any one of them is encountered. (Contributed by Bruce Merry " +"in :gh:`81322`.)" msgstr "" #: ../../whatsnew/3.13.rst:714 @@ -1117,9 +1119,10 @@ msgstr "" #: ../../whatsnew/3.13.rst:721 msgid "" "In the case where a task group is cancelled externally and also must raise " -"an :exc:`ExceptionGroup`, it will now call the parent task's :meth:`~asyncio." -"Task.cancel` method. This ensures that a :exc:`~asyncio.CancelledError` will " -"be raised at the next :keyword:`await`, so the cancellation is not lost." +"an :exc:`ExceptionGroup`, it will now call the parent " +"task's :meth:`~asyncio.Task.cancel` method. This ensures that " +"a :exc:`~asyncio.CancelledError` will be raised at the " +"next :keyword:`await`, so the cancellation is not lost." msgstr "" #: ../../whatsnew/3.13.rst:727 @@ -1141,10 +1144,11 @@ msgstr "" #: ../../whatsnew/3.13.rst:736 msgid "" -"When :meth:`.TaskGroup.create_task` is called on an inactive :class:" -"`~asyncio.TaskGroup`, the given coroutine will be closed (which prevents a :" -"exc:`RuntimeWarning` about the given coroutine being never awaited). " -"(Contributed by Arthur Tacca and Jason Zhang in :gh:`115957`.)" +"When :meth:`.TaskGroup.create_task` is called on an " +"inactive :class:`~asyncio.TaskGroup`, the given coroutine will be closed " +"(which prevents a :exc:`RuntimeWarning` about the given coroutine being " +"never awaited). (Contributed by Arthur Tacca and Jason Zhang " +"in :gh:`115957`.)" msgstr "" #: ../../whatsnew/3.13.rst:744 @@ -1154,8 +1158,8 @@ msgstr "base64" #: ../../whatsnew/3.13.rst:746 msgid "" "Add :func:`~base64.z85encode` and :func:`~base64.z85decode` functions for " -"encoding :class:`bytes` as `Z85 data`_ and decoding Z85-encoded data to :" -"class:`!bytes`. (Contributed by Matan Perelman in :gh:`75299`.)" +"encoding :class:`bytes` as `Z85 data`_ and decoding Z85-encoded data " +"to :class:`!bytes`. (Contributed by Matan Perelman in :gh:`75299`.)" msgstr "" #: ../../whatsnew/3.13.rst:755 @@ -1165,16 +1169,16 @@ msgstr "compileall" #: ../../whatsnew/3.13.rst:757 ../../whatsnew/3.13.rst:765 #: ../../whatsnew/3.13.rst:1024 msgid "" -"The default number of worker threads and processes is now selected using :" -"func:`os.process_cpu_count` instead of :func:`os.cpu_count`. (Contributed by " -"Victor Stinner in :gh:`109649`.)" +"The default number of worker threads and processes is now selected " +"using :func:`os.process_cpu_count` instead of :func:`os.cpu_count`. " +"(Contributed by Victor Stinner in :gh:`109649`.)" msgstr "" #: ../../whatsnew/3.13.rst:763 msgid "concurrent.futures" msgstr "concurrent.futures" -#: ../../whatsnew/3.13.rst:771 ../../whatsnew/3.13.rst:1621 +#: ../../whatsnew/3.13.rst:771 ../../whatsnew/3.13.rst:1673 msgid "configparser" msgstr "configparser" @@ -1182,8 +1186,8 @@ msgstr "configparser" msgid "" ":class:`~configparser.ConfigParser` now has support for unnamed sections, " "which allows for top-level key-value pairs. This can be enabled with the new " -"*allow_unnamed_section* parameter. (Contributed by Pedro Sousa Lacerda in :" -"gh:`66449`.)" +"*allow_unnamed_section* parameter. (Contributed by Pedro Sousa Lacerda " +"in :gh:`66449`.)" msgstr "" #: ../../whatsnew/3.13.rst:780 @@ -1208,10 +1212,8 @@ msgid ":class:`dataclasses.dataclass`" msgstr ":class:`dataclasses.dataclass`" #: ../../whatsnew/3.13.rst:790 -msgid "" -":class:`datetime.datetime`, :class:`datetime.date`, :class:`datetime.time`" -msgstr "" -":class:`datetime.datetime`、:class:`datetime.date`、:class:`datetime.time`" +msgid ":class:`datetime.datetime`, :class:`datetime.date`, :class:`datetime.time`" +msgstr ":class:`datetime.datetime`、:class:`datetime.date`、:class:`datetime.time`" #: ../../whatsnew/3.13.rst:791 msgid ":class:`inspect.Signature`, :class:`inspect.Parameter`" @@ -1228,8 +1230,8 @@ msgstr ":ref:`程式碼物件 `" #: ../../whatsnew/3.13.rst:795 msgid "" "Any user-defined class can also support :func:`copy.replace` by defining " -"the :meth:`~object.__replace__` method. (Contributed by Serhiy Storchaka in :" -"gh:`108751`.)" +"the :meth:`~object.__replace__` method. (Contributed by Serhiy Storchaka " +"in :gh:`108751`.)" msgstr "" #: ../../whatsnew/3.13.rst:801 @@ -1264,10 +1266,10 @@ msgstr "" #: ../../whatsnew/3.13.rst:817 msgid "" -":class:`ctypes.Structure` objects have a new :attr:`~ctypes.Structure." -"_align_` attribute which allows the alignment of the structure being packed " -"to/from memory to be specified explicitly. (Contributed by Matt Sanderson " -"in :gh:`112433`)" +":class:`ctypes.Structure` objects have a " +"new :attr:`~ctypes.Structure._align_` attribute which allows the alignment " +"of the structure being packed to/from memory to be specified explicitly. " +"(Contributed by Matt Sanderson in :gh:`112433`)" msgstr "" #: ../../whatsnew/3.13.rst:823 @@ -1283,9 +1285,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:829 msgid "" -"Allow removing all items from the database through the new :meth:`.gdbm." -"clear` and :meth:`.ndbm.clear` methods. (Contributed by Donghee Na in :gh:" -"`107122`.)" +"Allow removing all items from the database through the " +"new :meth:`.gdbm.clear` and :meth:`.ndbm.clear` methods. (Contributed by " +"Donghee Na in :gh:`107122`.)" msgstr "" #: ../../whatsnew/3.13.rst:835 @@ -1303,10 +1305,10 @@ msgstr "" #: ../../whatsnew/3.13.rst:844 msgid "" ":meth:`~dis.get_instructions` no longer represents cache entries as separate " -"instructions. Instead, it returns them as part of the :class:`~dis." -"Instruction`, in the new *cache_info* field. The *show_caches* argument to :" -"meth:`~dis.get_instructions` is deprecated and no longer has any effect. " -"(Contributed by Irit Katriel in :gh:`112962`.)" +"instructions. Instead, it returns them as part of " +"the :class:`~dis.Instruction`, in the new *cache_info* field. The " +"*show_caches* argument to :meth:`~dis.get_instructions` is deprecated and no " +"longer has any effect. (Contributed by Irit Katriel in :gh:`112962`.)" msgstr "" #: ../../whatsnew/3.13.rst:856 @@ -1317,9 +1319,9 @@ msgstr "doctest" msgid "" ":mod:`doctest` output is now colored by default. This can be controlled via " "the new :envvar:`PYTHON_COLORS` environment variable as well as the " -"canonical |NO_COLOR|_ and |FORCE_COLOR|_ environment variables. See also :" -"ref:`using-on-controlling-color`. (Contributed by Hugo van Kemenade in :gh:" -"`117225`.)" +"canonical |NO_COLOR|_ and |FORCE_COLOR|_ environment variables. See " +"also :ref:`using-on-controlling-color`. (Contributed by Hugo van Kemenade " +"in :gh:`117225`.)" msgstr "" #: ../../whatsnew/3.13.rst:865 @@ -1335,12 +1337,13 @@ msgstr "email" #: ../../whatsnew/3.13.rst:873 msgid "" -"Headers with embedded newlines are now quoted on output. The :mod:`~email." -"generator` will now refuse to serialize (write) headers that are improperly " -"folded or delimited, such that they would be parsed as multiple headers or " -"joined with adjacent data. If you need to turn this safety feature off, set :" -"attr:`~email.policy.Policy.verify_generated_headers`. (Contributed by Bas " -"Bloemsaat and Petr Viktorin in :gh:`121650`.)" +"Headers with embedded newlines are now quoted on output. " +"The :mod:`~email.generator` will now refuse to serialize (write) headers " +"that are improperly folded or delimited, such that they would be parsed as " +"multiple headers or joined with adjacent data. If you need to turn this " +"safety feature off, " +"set :attr:`~email.policy.Policy.verify_generated_headers`. (Contributed by " +"Bas Bloemsaat and Petr Viktorin in :gh:`121650`.)" msgstr "" #: ../../whatsnew/3.13.rst:881 @@ -1349,10 +1352,10 @@ msgid "" "return ``('', '')`` pairs in more situations where invalid email addresses " "are encountered instead of potentially inaccurate values. The two functions " "have a new optional *strict* parameter (default ``True``). To get the old " -"behavior (accepting malformed input), use ``strict=False``. ``getattr(email." -"utils, 'supports_strict_parsing', False)`` can be used to check if the " -"*strict* parameter is available. (Contributed by Thomas Dwyer and Victor " -"Stinner for :gh:`102988` to improve the :cve:`2023-27043` fix.)" +"behavior (accepting malformed input), use ``strict=False``. " +"``getattr(email.utils, 'supports_strict_parsing', False)`` can be used to " +"check if the *strict* parameter is available. (Contributed by Thomas Dwyer " +"and Victor Stinner for :gh:`102988` to improve the :cve:`2023-27043` fix.)" msgstr "" #: ../../whatsnew/3.13.rst:893 @@ -1361,8 +1364,8 @@ msgstr "enum" #: ../../whatsnew/3.13.rst:895 msgid "" -":class:`~enum.EnumDict` has been made public to better support subclassing :" -"class:`~enum.EnumType`." +":class:`~enum.EnumDict` has been made public to better support " +"subclassing :class:`~enum.EnumType`." msgstr "" "公開 :class:`~enum.EnumDict` 以更好地支援 :class:`~enum.EnumType` 的子類別。" @@ -1374,8 +1377,8 @@ msgstr "fractions" msgid "" ":class:`~fractions.Fraction` objects now support the standard :ref:`format " "specification mini-language ` rules for fill, alignment, sign " -"handling, minimum width, and grouping. (Contributed by Mark Dickinson in :gh:" -"`111320`.)" +"handling, minimum width, and grouping. (Contributed by Mark Dickinson " +"in :gh:`111320`.)" msgstr "" #: ../../whatsnew/3.13.rst:909 @@ -1435,8 +1438,8 @@ msgstr "" msgid "" ":func:`~importlib.resources.contents` remains deprecated in favor of the " "fully-featured :class:`~importlib.resources.abc.Traversable` API. However, " -"there is now no plan to remove it. (Contributed by Petr Viktorin in :gh:" -"`116608`.)" +"there is now no plan to remove it. (Contributed by Petr Viktorin " +"in :gh:`116608`.)" msgstr "" #: ../../whatsnew/3.13.rst:941 @@ -1445,11 +1448,11 @@ msgstr "io" #: ../../whatsnew/3.13.rst:943 msgid "" -"The :class:`~io.IOBase` finalizer now logs any errors raised by the :meth:" -"`~io.IOBase.close` method with :data:`sys.unraisablehook`. Previously, " -"errors were ignored silently by default, and only logged in :ref:`Python " -"Development Mode ` or when using a :ref:`Python debug build `. (Contributed by Victor Stinner in :gh:`62948`.)" +"The :class:`~io.IOBase` finalizer now logs any errors raised by " +"the :meth:`~io.IOBase.close` method with :data:`sys.unraisablehook`. " +"Previously, errors were ignored silently by default, and only logged " +"in :ref:`Python Development Mode ` or when using a :ref:`Python " +"debug build `. (Contributed by Victor Stinner in :gh:`62948`.)" msgstr "" #: ../../whatsnew/3.13.rst:952 @@ -1464,10 +1467,10 @@ msgstr "" #: ../../whatsnew/3.13.rst:958 msgid "" -"Fix ``is_global`` and ``is_private`` behavior in :class:`~ipaddress." -"IPv4Address`, :class:`~ipaddress.IPv6Address`, :class:`~ipaddress." -"IPv4Network`, and :class:`~ipaddress.IPv6Network`. (Contributed by Jakub " -"Stasiak in :gh:`113171`.)" +"Fix ``is_global`` and ``is_private`` behavior " +"in :class:`~ipaddress.IPv4Address`, :class:`~ipaddress.IPv6Address`, :class:`~ipaddress.IPv4Network`, " +"and :class:`~ipaddress.IPv6Network`. (Contributed by Jakub Stasiak " +"in :gh:`113171`.)" msgstr "" #: ../../whatsnew/3.13.rst:965 @@ -1476,9 +1479,9 @@ msgstr "itertools" #: ../../whatsnew/3.13.rst:967 msgid "" -":func:`~itertools.batched` has a new *strict* parameter, which raises a :exc:" -"`ValueError` if the final batch is shorter than the specified batch size. " -"(Contributed by Raymond Hettinger in :gh:`113202`.)" +":func:`~itertools.batched` has a new *strict* parameter, which raises " +"a :exc:`ValueError` if the final batch is shorter than the specified batch " +"size. (Contributed by Raymond Hettinger in :gh:`113202`.)" msgstr "" #: ../../whatsnew/3.13.rst:974 @@ -1515,8 +1518,8 @@ msgstr "mimetypes" msgid "" "Add the :func:`~mimetypes.guess_file_type` function to guess a MIME type " "from a filesystem path. Using paths with :func:`~mimetypes.guess_type` is " -"now :term:`soft deprecated`. (Contributed by Serhiy Storchaka in :gh:" -"`66543`.)" +"now :term:`soft deprecated`. (Contributed by Serhiy Storchaka " +"in :gh:`66543`.)" msgstr "" #: ../../whatsnew/3.13.rst:1004 @@ -1533,17 +1536,17 @@ msgstr "" #: ../../whatsnew/3.13.rst:1010 msgid "" ":class:`~mmap.mmap` has a new :meth:`~mmap.mmap.seekable` method that can be " -"used when a seekable file-like object is required. The :meth:`~mmap.mmap." -"seek` method now returns the new absolute position. (Contributed by Donghee " -"Na and Sylvie Liberman in :gh:`111835`.)" +"used when a seekable file-like object is required. " +"The :meth:`~mmap.mmap.seek` method now returns the new absolute position. " +"(Contributed by Donghee Na and Sylvie Liberman in :gh:`111835`.)" msgstr "" #: ../../whatsnew/3.13.rst:1015 msgid "" "The new UNIX-only *trackfd* parameter for :class:`~mmap.mmap` controls file " "descriptor duplication; if false, the file descriptor specified by *fileno* " -"will not be duplicated. (Contributed by Zackery Spytz and Petr Viktorin in :" -"gh:`78502`.)" +"will not be duplicated. (Contributed by Zackery Spytz and Petr Viktorin " +"in :gh:`78502`.)" msgstr "" #: ../../whatsnew/3.13.rst:1022 @@ -1574,10 +1577,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:1044 msgid "" "Add a :ref:`low level interface ` to Linux's :manpage:`timer " -"file descriptors ` via :func:`~os.timerfd_create`, :func:" -"`~os.timerfd_settime`, :func:`~os.timerfd_settime_ns`, :func:`~os." -"timerfd_gettime`, :func:`~os.timerfd_gettime_ns`, :const:`~os." -"TFD_NONBLOCK`, :const:`~os.TFD_CLOEXEC`, :const:`~os.TFD_TIMER_ABSTIME`, " +"file descriptors ` " +"via :func:`~os.timerfd_create`, :func:`~os.timerfd_settime`, :func:`~os.timerfd_settime_ns`, :func:`~os.timerfd_gettime`, :func:`~os.timerfd_gettime_ns`, :const:`~os.TFD_NONBLOCK`, :const:`~os.TFD_CLOEXEC`, :const:`~os.TFD_TIMER_ABSTIME`, " "and :const:`~os.TFD_TIMER_CANCEL_ON_SET` (Contributed by Masaru Tsuchiyama " "in :gh:`108277`.)" msgstr "" @@ -1593,17 +1594,17 @@ msgstr "" #: ../../whatsnew/3.13.rst:1059 msgid "" ":func:`~os.fchmod` and support for file descriptors in :func:`~os.chmod` are " -"both now available on Windows. (Contributed by Serhiy Storchaka in :gh:" -"`113191`.)" +"both now available on Windows. (Contributed by Serhiy Storchaka " +"in :gh:`113191`.)" msgstr "" #: ../../whatsnew/3.13.rst:1063 msgid "" "On Windows, :func:`~os.mkdir` and :func:`~os.makedirs` now support passing a " "*mode* value of ``0o700`` to apply access control to the new directory. This " -"implicitly affects :func:`tempfile.mkdtemp` and is a mitigation for :cve:" -"`2024-4030`. Other values for *mode* continue to be ignored. (Contributed by " -"Steve Dower in :gh:`118486`.)" +"implicitly affects :func:`tempfile.mkdtemp` and is a mitigation " +"for :cve:`2024-4030`. Other values for *mode* continue to be ignored. " +"(Contributed by Steve Dower in :gh:`118486`.)" msgstr "" #: ../../whatsnew/3.13.rst:1070 @@ -1615,10 +1616,10 @@ msgstr "" #: ../../whatsnew/3.13.rst:1074 msgid "" -":func:`~os.posix_spawn` can now use the :attr:`~os.POSIX_SPAWN_CLOSEFROM` " -"attribute in the *file_actions* parameter on platforms that support :c:func:" -"`!posix_spawn_file_actions_addclosefrom_np`. (Contributed by Jakub Kulik in :" -"gh:`113117`.)" +":func:`~os.posix_spawn` can now use the :const:`~os.POSIX_SPAWN_CLOSEFROM` " +"attribute in the *file_actions* parameter on platforms that " +"support :c:func:`!posix_spawn_file_actions_addclosefrom_np`. (Contributed by " +"Jakub Kulik in :gh:`113117`.)" msgstr "" #: ../../whatsnew/3.13.rst:1081 @@ -1645,15 +1646,15 @@ msgid "" "file is not accessible. (Contributed by Moonsik Park in :gh:`82367`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1098 ../../whatsnew/3.13.rst:1677 +#: ../../whatsnew/3.13.rst:1098 ../../whatsnew/3.13.rst:1729 msgid "pathlib" msgstr "pathlib" #: ../../whatsnew/3.13.rst:1100 msgid "" -"Add :exc:`~pathlib.UnsupportedOperation`, which is raised instead of :exc:" -"`NotImplementedError` when a path operation isn't supported. (Contributed by " -"Barney Gale in :gh:`89812`.)" +"Add :exc:`~pathlib.UnsupportedOperation`, which is raised instead " +"of :exc:`NotImplementedError` when a path operation isn't supported. " +"(Contributed by Barney Gale in :gh:`89812`.)" msgstr "" #: ../../whatsnew/3.13.rst:1104 @@ -1679,8 +1680,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:1117 msgid "" -"Add *recurse_symlinks* keyword-only argument to :meth:`.Path.glob` and :meth:" -"`~pathlib.Path.rglob`. (Contributed by Barney Gale in :gh:`77609`.)" +"Add *recurse_symlinks* keyword-only argument to :meth:`.Path.glob` " +"and :meth:`~pathlib.Path.rglob`. (Contributed by Barney Gale in :gh:`77609`.)" msgstr "" #: ../../whatsnew/3.13.rst:1121 @@ -1693,9 +1694,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:1126 msgid "" "Add the *follow_symlinks* keyword-only argument to :meth:`Path.is_file " -"`, :meth:`Path.is_dir `, :meth:`." -"Path.owner`, and :meth:`.Path.group`. (Contributed by Barney Gale in :gh:" -"`105793` and Kamil Turek in :gh:`107962`.)" +"`, :meth:`Path.is_dir " +"`, :meth:`.Path.owner`, and :meth:`.Path.group`. " +"(Contributed by Barney Gale in :gh:`105793` and Kamil Turek in :gh:`107962`.)" msgstr "" #: ../../whatsnew/3.13.rst:1134 @@ -1728,8 +1729,8 @@ msgstr "" msgid "" "Add ability to move between chained exceptions during post-mortem debugging " "in :func:`~pdb.pm` using the new :pdbcmd:`exceptions [exc_number] " -"` command for Pdb. (Contributed by Matthias Bussonnier in :gh:" -"`106676`.)" +"` command for Pdb. (Contributed by Matthias Bussonnier " +"in :gh:`106676`.)" msgstr "" #: ../../whatsnew/3.13.rst:1154 @@ -1759,14 +1760,14 @@ msgid "" "Kemenade in :gh:`118131`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1175 ../../whatsnew/3.13.rst:1685 +#: ../../whatsnew/3.13.rst:1175 ../../whatsnew/3.13.rst:1737 msgid "re" msgstr "re" #: ../../whatsnew/3.13.rst:1177 msgid "" -"Rename :exc:`!re.error` to :exc:`~re.PatternError` for improved clarity. :" -"exc:`!re.error` is kept for backward compatibility." +"Rename :exc:`!re.error` to :exc:`~re.PatternError` for improved " +"clarity. :exc:`!re.error` is kept for backward compatibility." msgstr "" #: ../../whatsnew/3.13.rst:1182 @@ -1775,8 +1776,9 @@ msgstr "shutil" #: ../../whatsnew/3.13.rst:1184 msgid "" -"Support the *dir_fd* and *follow_symlinks* keyword arguments in :func:" -"`~shutil.chown`. (Contributed by Berker Peksag and Tahia K in :gh:`62308`)" +"Support the *dir_fd* and *follow_symlinks* keyword arguments " +"in :func:`~shutil.chown`. (Contributed by Berker Peksag and Tahia K " +"in :gh:`62308`)" msgstr "" #: ../../whatsnew/3.13.rst:1190 @@ -1785,9 +1787,9 @@ msgstr "site" #: ../../whatsnew/3.13.rst:1192 msgid "" -":file:`.pth` files are now decoded using UTF-8 first, and then with the :" -"term:`locale encoding` if UTF-8 decoding fails. (Contributed by Inada Naoki " -"in :gh:`117802`.)" +":file:`.pth` files are now decoded using UTF-8 first, and then with " +"the :term:`locale encoding` if UTF-8 decoding fails. (Contributed by Inada " +"Naoki in :gh:`117802`.)" msgstr "" #: ../../whatsnew/3.13.rst:1198 @@ -1804,8 +1806,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:1204 msgid "" "Add the *filter* keyword-only parameter to :meth:`.Connection.iterdump` for " -"filtering database objects to dump. (Contributed by Mariusz Felisiak in :gh:" -"`91602`.)" +"filtering database objects to dump. (Contributed by Mariusz Felisiak " +"in :gh:`91602`.)" msgstr "" #: ../../whatsnew/3.13.rst:1210 @@ -1814,9 +1816,9 @@ msgstr "ssl" #: ../../whatsnew/3.13.rst:1212 msgid "" -"The :func:`~ssl.create_default_context` API now includes :data:`~ssl." -"VERIFY_X509_PARTIAL_CHAIN` and :data:`~ssl.VERIFY_X509_STRICT` in its " -"default flags." +"The :func:`~ssl.create_default_context` API now " +"includes :data:`~ssl.VERIFY_X509_PARTIAL_CHAIN` " +"and :data:`~ssl.VERIFY_X509_STRICT` in its default flags." msgstr "" #: ../../whatsnew/3.13.rst:1218 @@ -1850,8 +1852,8 @@ msgstr "statistics" msgid "" "Add :func:`~statistics.kde` for kernel density estimation. This makes it " "possible to estimate a continuous probability density function from a fixed " -"number of discrete samples. (Contributed by Raymond Hettinger in :gh:" -"`115863`.)" +"number of discrete samples. (Contributed by Raymond Hettinger " +"in :gh:`115863`.)" msgstr "" #: ../../whatsnew/3.13.rst:1241 @@ -1883,14 +1885,14 @@ msgstr "" #: ../../whatsnew/3.13.rst:1261 msgid "" "A private control knob :attr:`!subprocess._USE_POSIX_SPAWN` can be set to " -"``False`` if you need to force :mod:`subprocess` to never use :func:`~os." -"posix_spawn`. Please report your reason and platform details in the :ref:" -"`issue tracker ` if you set this so that we can improve " -"our API selection logic for everyone. (Contributed by Jakub Kulik in :gh:" -"`113117`.)" +"``False`` if you need to force :mod:`subprocess` to never " +"use :func:`~os.posix_spawn`. Please report your reason and platform details " +"in the :ref:`issue tracker ` if you set this so that we " +"can improve our API selection logic for everyone. (Contributed by Jakub " +"Kulik in :gh:`113117`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1271 ../../whatsnew/3.13.rst:2732 +#: ../../whatsnew/3.13.rst:1271 ../../whatsnew/3.13.rst:2811 msgid "sys" msgstr "sys" @@ -1909,8 +1911,8 @@ msgstr "tempfile" msgid "" "On Windows, the default mode ``0o700`` used by :func:`tempfile.mkdtemp` now " "limits access to the new directory due to changes to :func:`os.mkdir`. This " -"is a mitigation for :cve:`2024-4030`. (Contributed by Steve Dower in :gh:" -"`118486`.)" +"is a mitigation for :cve:`2024-4030`. (Contributed by Steve Dower " +"in :gh:`118486`.)" msgstr "" #: ../../whatsnew/3.13.rst:1288 @@ -1930,8 +1932,8 @@ msgid "" "On Windows, :func:`~time.time` now uses the " "``GetSystemTimePreciseAsFileTime()`` clock for a resolution of 1 " "microsecond, instead of the ``GetSystemTimeAsFileTime()`` clock which has a " -"resolution of 15.6 milliseconds. (Contributed by Victor Stinner in :gh:" -"`63207`.)" +"resolution of 15.6 milliseconds. (Contributed by Victor Stinner " +"in :gh:`63207`.)" msgstr "" #: ../../whatsnew/3.13.rst:1304 @@ -1951,8 +1953,9 @@ msgid "" "The :mod:`tkinter` widget method :meth:`!wm_attributes` now accepts the " "attribute name without the minus prefix to get window attributes, for " "example ``w.wm_attributes('alpha')`` and allows specifying attributes and " -"values to set as keyword arguments, for example ``w." -"wm_attributes(alpha=0.5)``. (Contributed by Serhiy Storchaka in :gh:`43457`.)" +"values to set as keyword arguments, for example " +"``w.wm_attributes(alpha=0.5)``. (Contributed by Serhiy Storchaka " +"in :gh:`43457`.)" msgstr "" #: ../../whatsnew/3.13.rst:1319 @@ -1972,9 +1975,10 @@ msgstr "" #: ../../whatsnew/3.13.rst:1328 msgid "" -"Support the \"vsapi\" element type in the :meth:`~tkinter.ttk.Style." -"element_create` method of :class:`tkinter.ttk.Style`. (Contributed by Serhiy " -"Storchaka in :gh:`68166`.)" +"Support the \"vsapi\" element type in " +"the :meth:`~tkinter.ttk.Style.element_create` method " +"of :class:`tkinter.ttk.Style`. (Contributed by Serhiy Storchaka " +"in :gh:`68166`.)" msgstr "" #: ../../whatsnew/3.13.rst:1333 @@ -2012,9 +2016,9 @@ msgstr "traceback" #: ../../whatsnew/3.13.rst:1357 msgid "" -"Add the :attr:`~traceback.TracebackException.exc_type_str` attribute to :" -"class:`~traceback.TracebackException`, which holds a string display of the " -"*exc_type*. Deprecate the :attr:`~traceback.TracebackException.exc_type` " +"Add the :attr:`~traceback.TracebackException.exc_type_str` attribute " +"to :class:`~traceback.TracebackException`, which holds a string display of " +"the *exc_type*. Deprecate the :attr:`~traceback.TracebackException.exc_type` " "attribute, which holds the type object itself. Add parameter *save_exc_type* " "(default ``True``) to indicate whether ``exc_type`` should be saved. " "(Contributed by Irit Katriel in :gh:`112332`.)" @@ -2022,10 +2026,10 @@ msgstr "" #: ../../whatsnew/3.13.rst:1366 msgid "" -"Add a new *show_group* keyword-only parameter to :meth:`.TracebackException." -"format_exception_only` to (recursively) format the nested exceptions of a :" -"exc:`BaseExceptionGroup` instance. (Contributed by Irit Katriel in :gh:" -"`105292`.)" +"Add a new *show_group* keyword-only parameter " +"to :meth:`.TracebackException.format_exception_only` to (recursively) format " +"the nested exceptions of a :exc:`BaseExceptionGroup` instance. (Contributed " +"by Irit Katriel in :gh:`105292`.)" msgstr "" #: ../../whatsnew/3.13.rst:1373 @@ -2036,11 +2040,11 @@ msgstr "types" msgid "" ":class:`~types.SimpleNamespace` can now take a single positional argument to " "initialise the namespace's arguments. This argument must either be a mapping " -"or an iterable of key-value pairs. (Contributed by Serhiy Storchaka in :gh:" -"`108191`.)" +"or an iterable of key-value pairs. (Contributed by Serhiy Storchaka " +"in :gh:`108191`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1382 ../../whatsnew/3.13.rst:1710 +#: ../../whatsnew/3.13.rst:1382 ../../whatsnew/3.13.rst:1762 msgid "typing" msgstr "typing" @@ -2066,14 +2070,14 @@ msgstr "" #: ../../whatsnew/3.13.rst:1394 msgid "" "Add :func:`~typing.get_protocol_members` to return the set of members " -"defining a :class:`typing.Protocol`. (Contributed by Jelle Zijlstra in :gh:" -"`104873`.)" +"defining a :class:`typing.Protocol`. (Contributed by Jelle Zijlstra " +"in :gh:`104873`.)" msgstr "" #: ../../whatsnew/3.13.rst:1398 msgid "" -"Add :func:`~typing.is_protocol` to check whether a class is a :class:" -"`~typing.Protocol`. (Contributed by Jelle Zijlstra in :gh:`104873`.)" +"Add :func:`~typing.is_protocol` to check whether a class is " +"a :class:`~typing.Protocol`. (Contributed by Jelle Zijlstra in :gh:`104873`.)" msgstr "" #: ../../whatsnew/3.13.rst:1402 @@ -2155,9 +2159,9 @@ msgstr "(由 Sebastian Pipping 在 :gh:`115623` 中貢獻。)" #: ../../whatsnew/3.13.rst:1454 msgid "" -"Add the :meth:`!close` method for the iterator returned by :func:`~xml.etree." -"ElementTree.iterparse` for explicit cleanup. (Contributed by Serhiy " -"Storchaka in :gh:`69893`.)" +"Add the :meth:`!close` method for the iterator returned " +"by :func:`~xml.etree.ElementTree.iterparse` for explicit cleanup. " +"(Contributed by Serhiy Storchaka in :gh:`69893`.)" msgstr "" #: ../../whatsnew/3.13.rst:1460 @@ -2178,9 +2182,9 @@ msgstr "最佳化" msgid "" "Several standard library modules have had their import times significantly " "improved. For example, the import time of the :mod:`typing` module has been " -"reduced by around a third by removing dependencies on :mod:`re` and :mod:" -"`contextlib`. Other modules to enjoy import-time speedups include :mod:" -"`email.utils`, :mod:`enum`, :mod:`functools`, :mod:`importlib.metadata`, " +"reduced by around a third by removing dependencies on :mod:`re` " +"and :mod:`contextlib`. Other modules to enjoy import-time speedups " +"include :mod:`email.utils`, :mod:`enum`, :mod:`functools`, :mod:`importlib.metadata`, " "and :mod:`threading`. (Contributed by Alex Waygood, Shantanu Jain, Adam " "Turner, Daniel Hollas, and others in :gh:`109653`.)" msgstr "" @@ -2203,11 +2207,11 @@ msgstr "" #: ../../whatsnew/3.13.rst:1496 msgid "Removed Modules And APIs" -msgstr "" +msgstr "被移除的模組和 API" #: ../../whatsnew/3.13.rst:1502 msgid "PEP 594: Remove \"dead batteries\" from the standard library" -msgstr "" +msgstr "PEP 594:從標準函式庫中移除「用完的電池」" #: ../../whatsnew/3.13.rst:1504 msgid "" @@ -2216,47 +2220,71 @@ msgid "" "obsolete, or insecure status. All of the following modules were deprecated " "in Python 3.11, and are now removed:" msgstr "" +":pep:`594` 提議從標準函式庫中移除因為歷史、過時或不安全狀態而被稱為「用完的電" +"池 (dead batteries)」的 19 個模組。以下所有模組在 Python 3.11 中已被棄用,現" +"在已被移除:" #: ../../whatsnew/3.13.rst:1510 msgid ":mod:`!aifc`" msgstr ":mod:`!aifc`" -#: ../../whatsnew/3.13.rst:1511 +#: ../../whatsnew/3.13.rst:1512 +msgid "" +":pypi:`standard-aifc`: Use the redistribution of ``aifc`` library from PyPI." +msgstr ":pypi:`standard-aifc`:PyPI 上的 ``aifc`` 函式庫重新發布版。" + +#: ../../whatsnew/3.13.rst:1515 msgid ":mod:`!audioop`" msgstr ":mod:`!audioop`" -#: ../../whatsnew/3.13.rst:1512 +#: ../../whatsnew/3.13.rst:1517 +msgid ":pypi:`audioop-lts`: Use ``audioop-lts`` library from PyPI." +msgstr ":pypi:`audioop-lts`:PyPI 上的 ``audioop-lts`` 函式庫。" + +#: ../../whatsnew/3.13.rst:1520 msgid ":mod:`!chunk`" msgstr ":mod:`!chunk`" -#: ../../whatsnew/3.13.rst:1513 +#: ../../whatsnew/3.13.rst:1522 +msgid "" +":pypi:`standard-chunk`: Use the redistribution of ``chunk`` library from " +"PyPI." +msgstr ":pypi:`standard-chunk`:PyPI 上的 ``chunk`` 函式庫重新發布版。" + +#: ../../whatsnew/3.13.rst:1525 msgid ":mod:`!cgi` and :mod:`!cgitb`" msgstr ":mod:`!cgi` 和 :mod:`!cgitb`" -#: ../../whatsnew/3.13.rst:1515 +#: ../../whatsnew/3.13.rst:1527 msgid "" -":class:`!cgi.FieldStorage` can typically be replaced with :func:`urllib." -"parse.parse_qsl` for ``GET`` and ``HEAD`` requests, and the :mod:`email." -"message` module or the :pypi:`multipart` library for ``POST`` and ``PUT`` " -"requests." +":class:`!cgi.FieldStorage` can typically be replaced " +"with :func:`urllib.parse.parse_qsl` for ``GET`` and ``HEAD`` requests, and " +"the :mod:`email.message` module or the :pypi:`multipart` library for " +"``POST`` and ``PUT`` requests." msgstr "" +":class:`!cgi.FieldStorage`,在於``GET`` 和 ``HEAD`` 請求中通常可以" +"被 :func:`urllib.parse.parse_qsl` 取代,而在於 ``POST`` 和 ``PUT`` 請求中可以" +"被 :mod:`email.message` 模組或 :pypi:`multipart` 函式庫取代。" -#: ../../whatsnew/3.13.rst:1520 +#: ../../whatsnew/3.13.rst:1532 msgid "" ":func:`!cgi.parse` can be replaced by calling :func:`urllib.parse.parse_qs` " "directly on the desired query string, unless the input is ``multipart/form-" -"data``, which should be replaced as described below for :func:`!cgi." -"parse_multipart`." +"data``, which should be replaced as described below for :func:`!" +"cgi.parse_multipart`." msgstr "" +":func:`!cgi.parse` 能夠以在所需的查詢字串上直接呼" +"叫 :func:`urllib.parse.parse_qs` 來取代,除非輸入為 ``multipart/form-data``," +"而這種情況則應該如下所述地將 :func:`!cgi.parse_multipart` 給替換掉。" -#: ../../whatsnew/3.13.rst:1525 +#: ../../whatsnew/3.13.rst:1537 msgid "" -":func:`!cgi.parse_header` can be replaced with the functionality in the :mod:" -"`email` package, which implements the same MIME RFCs. For example, with :" -"class:`email.message.EmailMessage`:" +":func:`!cgi.parse_header` can be replaced with the functionality in " +"the :mod:`email` package, which implements the same MIME RFCs. For example, " +"with :class:`email.message.EmailMessage`:" msgstr "" -#: ../../whatsnew/3.13.rst:1529 +#: ../../whatsnew/3.13.rst:1541 msgid "" "from email.message import EmailMessage\n" "\n" @@ -2264,361 +2292,456 @@ msgid "" "msg['content-type'] = 'application/json; charset=\"utf8\"'\n" "main, params = msg.get_content_type(), msg['content-type'].params" msgstr "" +"from email.message import EmailMessage\n" +"\n" +"msg = EmailMessage()\n" +"msg['content-type'] = 'application/json; charset=\"utf8\"'\n" +"main, params = msg.get_content_type(), msg['content-type'].params" + +#: ../../whatsnew/3.13.rst:1549 +msgid "" +":func:`!cgi.parse_multipart` can be replaced with the functionality in " +"the :mod:`email` package, which implements the same MIME RFCs, or with " +"the :pypi:`multipart` library. For example, " +"the :class:`email.message.EmailMessage` and :class:`email.message.Message` " +"classes." +msgstr "" +":func:`!cgi.parse_multipart` 可以被 :mod:`email` 函式庫中實作相同 MIME RFCs " +"的功能取代,或者可以被 :pypi:`multipart` 函式庫取代,例" +"如 :class:`email.message.EmailMessage` 和 :class:`email.message.Message` 類" +"別。" -#: ../../whatsnew/3.13.rst:1537 +#: ../../whatsnew/3.13.rst:1555 msgid "" -":func:`!cgi.parse_multipart` can be replaced with the functionality in the :" -"mod:`email` package, which implements the same MIME RFCs, or with the :pypi:" -"`multipart` library. For example, the :class:`email.message.EmailMessage` " -"and :class:`email.message.Message` classes." +":pypi:`standard-cgi`: and :pypi:`standard-cgitb`: Use the redistribution of " +"``cgi`` and ``cgitb`` library from PyPI." msgstr "" +":pypi:`standard-cgi` 和 :pypi:`standard-cgitb`:PyPI 上的 ``cgi`` 和 " +"``cgitb`` 函式庫重新發布版。" -#: ../../whatsnew/3.13.rst:1543 +#: ../../whatsnew/3.13.rst:1558 msgid "" ":mod:`!crypt` and the private :mod:`!_crypt` extension. The :mod:`hashlib` " "module may be an appropriate replacement when simply hashing a value is " "required. Otherwise, various third-party libraries on PyPI are available:" msgstr "" -#: ../../whatsnew/3.13.rst:1548 +#: ../../whatsnew/3.13.rst:1563 msgid "" ":pypi:`bcrypt`: Modern password hashing for your software and your servers." -msgstr "" +msgstr ":pypi:`bcrypt`:適用於你的軟體與伺服器的現代密碼雜湊演算法。" -#: ../../whatsnew/3.13.rst:1550 +#: ../../whatsnew/3.13.rst:1565 msgid "" ":pypi:`passlib`: Comprehensive password hashing framework supporting over 30 " "schemes." -msgstr "" +msgstr ":pypi:`passlib`:支援超過 30 種方案的廣泛密碼雜湊框架。" -#: ../../whatsnew/3.13.rst:1552 +#: ../../whatsnew/3.13.rst:1567 msgid ":pypi:`argon2-cffi`: The secure Argon2 password hashing algorithm." -msgstr "" +msgstr ":pypi:`argon2-cffi`:安全的 Argon2 密碼雜湊演算法。" -#: ../../whatsnew/3.13.rst:1554 +#: ../../whatsnew/3.13.rst:1569 msgid "" ":pypi:`legacycrypt`: :mod:`ctypes` wrapper to the POSIX crypt library call " "and associated functionality." msgstr "" +":pypi:`legacycrypt`:對 POSIX crypt 函式庫呼叫及相關功能的 :mod:`ctypes` 包" +"裝。" -#: ../../whatsnew/3.13.rst:1557 +#: ../../whatsnew/3.13.rst:1572 +msgid "" +":pypi:`crypt_r`: Fork of the :mod:`!crypt` module, wrapper to " +"the :manpage:`crypt_r(3)` library call and associated functionality." +msgstr "" +":pypi:`crypt_r`:對 :mod:`!crypt` 模組的分支 (fork)," +"對 :manpage:`crypt_r(3)` 函式庫呼叫及相關功能的包裝。" + +#: ../../whatsnew/3.13.rst:1576 msgid "" -":pypi:`crypt_r`: Fork of the :mod:`!crypt` module, wrapper to the :manpage:" -"`crypt_r(3)` library call and associated functionality." +":pypi:`standard-crypt` and :pypi:`deprecated-crypt-alternative`: Use the " +"redistribution of ``crypt`` and reimplementation of ``_crypt`` libraries " +"from PyPI." msgstr "" +":pypi:`standard-crypt` 和 :pypi:`deprecated-crypt-alternative`:PyPI 上的 " +"``crypt`` 函式庫重新發布版和 ``_crypt`` 函式庫的重新實作。" -#: ../../whatsnew/3.13.rst:1562 +#: ../../whatsnew/3.13.rst:1579 msgid "" ":mod:`!imghdr`: The :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-" "magic` libraries should be used as replacements. For example, the :func:`!" "puremagic.what` function can be used to replace the :func:`!imghdr.what` " "function for all file formats that were supported by :mod:`!imghdr`." msgstr "" +":mod:`!imghdr`:請改用 :pypi:`filetype`、:pypi:`puremagic` 或 :pypi:`python-" +"magic` 函式庫。例如 :func:`!puremagic.what` 函式可以取代 :mod:`!imghdr` 過去" +"所支援所有文件格式的 :func:`!imghdr.what` 函式。" + +#: ../../whatsnew/3.13.rst:1586 +msgid "" +":pypi:`standard-imghdr`: Use the redistribution of ``imghdr`` library from " +"PyPI." +msgstr ":pypi:`standard-imghdr`:PyPI 上的 ``imghdr`` 函式庫重新發布版。" -#: ../../whatsnew/3.13.rst:1568 +#: ../../whatsnew/3.13.rst:1589 msgid ":mod:`!mailcap`: Use the :mod:`mimetypes` module instead." -msgstr "" +msgstr ":mod:`!mailcap`:請改用 :mod:`mimetypes` 模組。" + +#: ../../whatsnew/3.13.rst:1592 +msgid "" +":pypi:`standard-mailcap`: Use the redistribution of ``mailcap`` library from " +"PyPI." +msgstr ":pypi:`standard-mailcap`:PyPI 上的 ``mailcap`` 函式庫重新發布版。" -#: ../../whatsnew/3.13.rst:1570 +#: ../../whatsnew/3.13.rst:1595 msgid ":mod:`!msilib`" msgstr ":mod:`!msilib`" -#: ../../whatsnew/3.13.rst:1571 +#: ../../whatsnew/3.13.rst:1596 msgid ":mod:`!nis`" msgstr ":mod:`!nis`" -#: ../../whatsnew/3.13.rst:1572 +#: ../../whatsnew/3.13.rst:1597 msgid ":mod:`!nntplib`: Use the :pypi:`pynntp` library from PyPI instead." -msgstr "" +msgstr ":mod:`!nntplib`:請改用 PyPI 上的 :pypi:`pynntp` 函式庫。" -#: ../../whatsnew/3.13.rst:1574 +#: ../../whatsnew/3.13.rst:1600 +msgid "" +":pypi:`standard-nntplib`: Use the redistribution of ``nntplib`` library from " +"PyPI." +msgstr ":pypi:`standard-nntplib`:PyPI 上的 ``nntplib`` 函式庫重新發布版。" + +#: ../../whatsnew/3.13.rst:1603 msgid "" ":mod:`!ossaudiodev`: For audio playback, use the :pypi:`pygame` library from " "PyPI instead." msgstr "" +":mod:`!ossaudiodev`:音訊播放方面,請改用 PyPI 上的 :pypi:`pygame` 函式庫。" -#: ../../whatsnew/3.13.rst:1576 +#: ../../whatsnew/3.13.rst:1605 msgid "" -":mod:`!pipes`: Use the :mod:`subprocess` module instead. Use :func:`shlex." -"quote` to replace the undocumented ``pipes.quote`` function." +":mod:`!pipes`: Use the :mod:`subprocess` module instead. " +"Use :func:`shlex.quote` to replace the undocumented ``pipes.quote`` function." msgstr "" +":mod:`!pipes`:請改用 :mod:`subprocess` 模組。使用 :func:`shlex.quote` 來取代" +"未以文件紀錄的 ``pipes.quote`` 函式。" + +#: ../../whatsnew/3.13.rst:1610 +msgid "" +":pypi:`standard-pipes`: Use the redistribution of ``pipes`` library from " +"PyPI." +msgstr ":pypi:`standard-pipes`:PyPI 上的 ``pipes`` 函式庫重新發布版。" -#: ../../whatsnew/3.13.rst:1580 +#: ../../whatsnew/3.13.rst:1613 msgid "" ":mod:`!sndhdr`: The :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-" "magic` libraries should be used as replacements." msgstr "" +":mod:`!sndhdr`:請改用 :pypi:`filetype`、:pypi:`puremagic` 或 :pypi:`python-" +"magic` 函式庫。" -#: ../../whatsnew/3.13.rst:1583 +#: ../../whatsnew/3.13.rst:1617 +msgid "" +":pypi:`standard-sndhdr`: Use the redistribution of ``sndhdr`` library from " +"PyPI." +msgstr ":pypi:`standard-sndhdr`:PyPI 上的 ``sndhdr`` 函式庫重新發布版。" + +#: ../../whatsnew/3.13.rst:1620 msgid ":mod:`!spwd`: Use the :pypi:`python-pam` library from PyPI instead." -msgstr "" +msgstr ":mod:`!spwd`:請改用 PyPI 上的 :pypi:`python-pam` 函式庫。" -#: ../../whatsnew/3.13.rst:1585 +#: ../../whatsnew/3.13.rst:1622 msgid ":mod:`!sunau`" msgstr ":mod:`!sunau`" -#: ../../whatsnew/3.13.rst:1586 +#: ../../whatsnew/3.13.rst:1624 +msgid "" +":pypi:`standard-sunau`: Use the redistribution of ``sunau`` library from " +"PyPI." +msgstr ":pypi:`standard-sunau`:PyPI 上的 ``sunau`` 函式庫重新發布版。" + +#: ../../whatsnew/3.13.rst:1627 msgid "" ":mod:`!telnetlib`, Use the :pypi:`telnetlib3` or :pypi:`Exscript` libraries " "from PyPI instead." msgstr "" +":mod:`!telnetlib`:請改用 PyPI 上的 :pypi:`telnetlib3` 或 :pypi:`Exscript` 函" +"式庫。" -#: ../../whatsnew/3.13.rst:1588 +#: ../../whatsnew/3.13.rst:1630 +msgid "" +":pypi:`standard-telnetlib`: Use the redistribution of ``telnetlib`` library " +"from PyPI." +msgstr ":pypi:`standard-telnetlib`:PyPI 上的 ``telnetlib`` 函式庫重新發布版。" + +#: ../../whatsnew/3.13.rst:1633 msgid "" ":mod:`!uu`: Use the :mod:`base64` module instead, as a modern alternative." -msgstr "" +msgstr ":mod:`!uu`:請改用 :mod:`base64` 模組來作為當代的替代方案。" -#: ../../whatsnew/3.13.rst:1590 +#: ../../whatsnew/3.13.rst:1636 +msgid "" +":pypi:`standard-uu`: Use the redistribution of ``uu`` library from PyPI." +msgstr ":pypi:`standard-uu`:PyPI 上的 ``uu`` 函式庫重新發布版。" + +#: ../../whatsnew/3.13.rst:1639 msgid ":mod:`!xdrlib`" msgstr ":mod:`!xdrlib`" -#: ../../whatsnew/3.13.rst:1592 +#: ../../whatsnew/3.13.rst:1641 +msgid "" +":pypi:`standard-xdrlib`: Use the redistribution of ``xdrlib`` library from " +"PyPI." +msgstr ":pypi:`standard-xdrlib`:PyPI 上的 ``xdrlib`` 函式庫重新發布版。" + +#: ../../whatsnew/3.13.rst:1644 msgid "" -"(Contributed by Victor Stinner and Zachary Ware in :gh:`104773` and :gh:" -"`104780`.)" +"(Contributed by Victor Stinner and Zachary Ware in :gh:`104773` " +"and :gh:`104780`.)" msgstr "" "(由 Victor Stinner 和 Zachary Ware 在 :gh:`104773` 和 :gh:`104780` 中貢" "獻。)" -#: ../../whatsnew/3.13.rst:1596 +#: ../../whatsnew/3.13.rst:1648 msgid "2to3" msgstr "2to3" -#: ../../whatsnew/3.13.rst:1598 +#: ../../whatsnew/3.13.rst:1650 msgid "" "Remove the :program:`2to3` program and the :mod:`!lib2to3` module, " -"previously deprecated in Python 3.11. (Contributed by Victor Stinner in :gh:" -"`104780`.)" +"previously deprecated in Python 3.11. (Contributed by Victor Stinner " +"in :gh:`104780`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1604 +#: ../../whatsnew/3.13.rst:1656 msgid "builtins" msgstr "builtins" -#: ../../whatsnew/3.13.rst:1606 +#: ../../whatsnew/3.13.rst:1658 msgid "" -"Remove support for chained :class:`classmethod` descriptors (introduced in :" -"gh:`63272`). These can no longer be used to wrap other descriptors, such as :" -"class:`property`. The core design of this feature was flawed and led to " +"Remove support for chained :class:`classmethod` descriptors (introduced " +"in :gh:`63272`). These can no longer be used to wrap other descriptors, such " +"as :class:`property`. The core design of this feature was flawed and led to " "several problems. To \"pass-through\" a :class:`classmethod`, consider using " "the :attr:`!__wrapped__` attribute that was added in Python 3.10. " "(Contributed by Raymond Hettinger in :gh:`89519`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1615 +#: ../../whatsnew/3.13.rst:1667 msgid "" "Raise a :exc:`RuntimeError` when calling :meth:`frame.clear` on a suspended " "frame (as has always been the case for an executing frame). (Contributed by " "Irit Katriel in :gh:`79932`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1623 +#: ../../whatsnew/3.13.rst:1675 msgid "" "Remove the undocumented :class:`!LegacyInterpolation` class, deprecated in " "the docstring since Python 3.2, and at runtime since Python 3.11. " "(Contributed by Hugo van Kemenade in :gh:`104886`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1630 +#: ../../whatsnew/3.13.rst:1682 msgid "importlib.metadata" msgstr "importlib.metadata" -#: ../../whatsnew/3.13.rst:1632 +#: ../../whatsnew/3.13.rst:1684 msgid "" -"Remove deprecated subscript (:meth:`~object.__getitem__`) access for :ref:" -"`EntryPoint ` objects. (Contributed by Jason R. Coombs in :gh:" -"`113175`.)" +"Remove deprecated subscript (:meth:`~object.__getitem__`) access " +"for :ref:`EntryPoint ` objects. (Contributed by Jason R. " +"Coombs in :gh:`113175`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1638 +#: ../../whatsnew/3.13.rst:1690 msgid "locale" msgstr "locale" -#: ../../whatsnew/3.13.rst:1640 +#: ../../whatsnew/3.13.rst:1692 msgid "" "Remove the :func:`!locale.resetlocale` function, deprecated in Python 3.11. " "Use ``locale.setlocale(locale.LC_ALL, \"\")`` instead. (Contributed by " "Victor Stinner in :gh:`104783`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1646 +#: ../../whatsnew/3.13.rst:1698 msgid "opcode" msgstr "opcode" -#: ../../whatsnew/3.13.rst:1648 +#: ../../whatsnew/3.13.rst:1700 msgid "" -"Move :attr:`!opcode.ENABLE_SPECIALIZATION` to :attr:`!_opcode." -"ENABLE_SPECIALIZATION`. This field was added in 3.12, it was never " +"Move :attr:`!opcode.ENABLE_SPECIALIZATION` to :attr:`!" +"_opcode.ENABLE_SPECIALIZATION`. This field was added in 3.12, it was never " "documented, and is not intended for external use. (Contributed by Irit " "Katriel in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1653 +#: ../../whatsnew/3.13.rst:1705 msgid "" -"Remove :func:`!opcode.is_pseudo`, :attr:`!opcode.MIN_PSEUDO_OPCODE`, and :" -"attr:`!opcode.MAX_PSEUDO_OPCODE`, which were added in Python 3.12, but were " -"neither documented nor exposed through :mod:`dis`, and were not intended to " -"be used externally. (Contributed by Irit Katriel in :gh:`105481`.)" +"Remove :func:`!opcode.is_pseudo`, :attr:`!opcode.MIN_PSEUDO_OPCODE`, " +"and :attr:`!opcode.MAX_PSEUDO_OPCODE`, which were added in Python 3.12, but " +"were neither documented nor exposed through :mod:`dis`, and were not " +"intended to be used externally. (Contributed by Irit Katriel " +"in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1661 +#: ../../whatsnew/3.13.rst:1713 msgid "optparse" msgstr "optparse" -#: ../../whatsnew/3.13.rst:1663 +#: ../../whatsnew/3.13.rst:1715 msgid "" -"This module is no longer considered :term:`soft deprecated`. While :mod:" -"`argparse` remains preferred for new projects that aren't using a third " -"party command line argument processing library, there are aspects of the way " -"``argparse`` works that mean the lower level ``optparse`` module may provide " -"a better foundation for *writing* argument processing libraries, and for " -"implementing command line applications which adhere more strictly than " +"This module is no longer considered :term:`soft deprecated`. " +"While :mod:`argparse` remains preferred for new projects that aren't using a " +"third party command line argument processing library, there are aspects of " +"the way ``argparse`` works that mean the lower level ``optparse`` module may " +"provide a better foundation for *writing* argument processing libraries, and " +"for implementing command line applications which adhere more strictly than " "``argparse`` does to various Unix command line processing conventions that " "originate in the behaviour of the C :c:func:`!getopt` function . " "(Contributed by Alyssa Coghlan and Serhiy Storchaka in :gh:`126180`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1679 +#: ../../whatsnew/3.13.rst:1731 msgid "" "Remove the ability to use :class:`~pathlib.Path` objects as context " "managers. This functionality was deprecated and has had no effect since " "Python 3.9. (Contributed by Barney Gale in :gh:`83863`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1687 +#: ../../whatsnew/3.13.rst:1739 msgid "" "Remove the undocumented, deprecated, and broken :func:`!re.template` " "function and :attr:`!re.TEMPLATE` / :attr:`!re.T` flag. (Contributed by " "Serhiy Storchaka and Nikita Sobolev in :gh:`105687`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1693 +#: ../../whatsnew/3.13.rst:1745 msgid "tkinter.tix" msgstr "tkinter.tix" -#: ../../whatsnew/3.13.rst:1695 +#: ../../whatsnew/3.13.rst:1747 msgid "" "Remove the :mod:`!tkinter.tix` module, deprecated in Python 3.6. The third-" "party Tix library which the module wrapped is unmaintained. (Contributed by " "Zachary Ware in :gh:`75552`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1701 +#: ../../whatsnew/3.13.rst:1753 msgid "turtle" msgstr "turtle" -#: ../../whatsnew/3.13.rst:1703 +#: ../../whatsnew/3.13.rst:1755 msgid "" "Remove the :meth:`!RawTurtle.settiltangle` method, deprecated in the " "documentation since Python 3.1 and at runtime since Python 3.11. " "(Contributed by Hugo van Kemenade in :gh:`104876`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1712 +#: ../../whatsnew/3.13.rst:1764 msgid "" "Remove the :mod:`!typing.io` and :mod:`!typing.re` namespaces, deprecated " "since Python 3.8. The items in those namespaces can be imported directly " -"from the :mod:`typing` module. (Contributed by Sebastian Rittau in :gh:" -"`92871`.)" +"from the :mod:`typing` module. (Contributed by Sebastian Rittau " +"in :gh:`92871`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1718 +#: ../../whatsnew/3.13.rst:1770 msgid "" "Remove the keyword-argument method of creating :class:`~typing.TypedDict` " -"types, deprecated in Python 3.11. (Contributed by Tomas Roun in :gh:" -"`104786`.)" +"types, deprecated in Python 3.11. (Contributed by Tomas Roun " +"in :gh:`104786`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1724 +#: ../../whatsnew/3.13.rst:1776 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.13.rst:1726 +#: ../../whatsnew/3.13.rst:1778 msgid "" "Remove the following :mod:`unittest` functions, deprecated in Python 3.11:" msgstr "移除以下在 Python 3.11 中已被棄用的 :mod:`unittest` 函式:" -#: ../../whatsnew/3.13.rst:1728 +#: ../../whatsnew/3.13.rst:1780 msgid ":func:`!unittest.findTestCases`" msgstr ":func:`!unittest.findTestCases`" -#: ../../whatsnew/3.13.rst:1729 +#: ../../whatsnew/3.13.rst:1781 msgid ":func:`!unittest.makeSuite`" msgstr ":func:`!unittest.makeSuite`" -#: ../../whatsnew/3.13.rst:1730 +#: ../../whatsnew/3.13.rst:1782 msgid ":func:`!unittest.getTestCaseNames`" msgstr ":func:`!unittest.getTestCaseNames`" -#: ../../whatsnew/3.13.rst:1732 +#: ../../whatsnew/3.13.rst:1784 msgid "Use :class:`~unittest.TestLoader` methods instead:" msgstr "" -#: ../../whatsnew/3.13.rst:1734 +#: ../../whatsnew/3.13.rst:1786 msgid ":meth:`~unittest.TestLoader.loadTestsFromModule`" msgstr ":meth:`~unittest.TestLoader.loadTestsFromModule`" -#: ../../whatsnew/3.13.rst:1735 +#: ../../whatsnew/3.13.rst:1787 msgid ":meth:`~unittest.TestLoader.loadTestsFromTestCase`" msgstr ":meth:`~unittest.TestLoader.loadTestsFromTestCase`" -#: ../../whatsnew/3.13.rst:1736 +#: ../../whatsnew/3.13.rst:1788 msgid ":meth:`~unittest.TestLoader.getTestCaseNames`" msgstr ":meth:`~unittest.TestLoader.getTestCaseNames`" -#: ../../whatsnew/3.13.rst:1738 +#: ../../whatsnew/3.13.rst:1790 msgid "(Contributed by Hugo van Kemenade in :gh:`104835`.)" msgstr "(由 Hugo van Kemenade 在 :gh:`104835` 中貢獻。)" -#: ../../whatsnew/3.13.rst:1740 +#: ../../whatsnew/3.13.rst:1792 msgid "" "Remove the untested and undocumented :meth:`!TestProgram.usageExit` method, " -"deprecated in Python 3.11. (Contributed by Hugo van Kemenade in :gh:" -"`104992`.)" +"deprecated in Python 3.11. (Contributed by Hugo van Kemenade " +"in :gh:`104992`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1746 +#: ../../whatsnew/3.13.rst:1798 msgid "urllib" msgstr "urllib" -#: ../../whatsnew/3.13.rst:1748 +#: ../../whatsnew/3.13.rst:1800 msgid "" -"Remove the *cafile*, *capath*, and *cadefault* parameters of the :func:" -"`urllib.request.urlopen` function, deprecated in Python 3.6. Use the " -"*context* parameter instead with an :class:`~ssl.SSLContext` instance. The :" -"meth:`ssl.SSLContext.load_cert_chain` function can be used to load specific " -"certificates, or let :func:`ssl.create_default_context` select the operating " -"system's trusted certificate authority (CA) certificates. (Contributed by " -"Victor Stinner in :gh:`105382`.)" +"Remove the *cafile*, *capath*, and *cadefault* parameters of " +"the :func:`urllib.request.urlopen` function, deprecated in Python 3.6. Use " +"the *context* parameter instead with an :class:`~ssl.SSLContext` instance. " +"The :meth:`ssl.SSLContext.load_cert_chain` function can be used to load " +"specific certificates, or let :func:`ssl.create_default_context` select the " +"operating system's trusted certificate authority (CA) certificates. " +"(Contributed by Victor Stinner in :gh:`105382`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1759 +#: ../../whatsnew/3.13.rst:1811 msgid "webbrowser" msgstr "webbrowser" -#: ../../whatsnew/3.13.rst:1761 +#: ../../whatsnew/3.13.rst:1813 msgid "" "Remove the untested and undocumented :class:`!MacOSX` class, deprecated in " "Python 3.11. Use the :class:`!MacOSXOSAScript` class (introduced in Python " "3.2) instead. (Contributed by Hugo van Kemenade in :gh:`104804`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1766 +#: ../../whatsnew/3.13.rst:1818 msgid "" -"Remove the deprecated :attr:`!MacOSXOSAScript._name` attribute. Use the :" -"attr:`MacOSXOSAScript.name ` attribute instead. " -"(Contributed by Nikita Sobolev in :gh:`105546`.)" +"Remove the deprecated :attr:`!MacOSXOSAScript._name` attribute. Use " +"the :attr:`MacOSXOSAScript.name ` attribute " +"instead. (Contributed by Nikita Sobolev in :gh:`105546`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1773 +#: ../../whatsnew/3.13.rst:1825 msgid "New Deprecations" msgstr "" -#: ../../whatsnew/3.13.rst:1775 +#: ../../whatsnew/3.13.rst:1827 msgid ":ref:`User-defined functions `:" msgstr "" -#: ../../whatsnew/3.13.rst:1777 +#: ../../whatsnew/3.13.rst:1829 msgid "" "Deprecate assignment to a function's :attr:`~function.__code__` attribute, " "where the new code object's type does not match the function's type. The " @@ -2626,88 +2749,89 @@ msgid "" "coroutine. (Contributed by Irit Katriel in :gh:`81137`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1783 +#: ../../whatsnew/3.13.rst:1835 #: ../../deprecations/pending-removal-in-3.16.rst:11 msgid ":mod:`array`:" msgstr ":mod:`array`:" -#: ../../whatsnew/3.13.rst:1785 +#: ../../whatsnew/3.13.rst:1837 msgid "" "Deprecate the ``'u'`` format code (:c:type:`wchar_t`) at runtime. This " "format code has been deprecated in documentation since Python 3.3, and will " "be removed in Python 3.16. Use the ``'w'`` format code (:c:type:`Py_UCS4`) " -"for Unicode characters instead. (Contributed by Hugo van Kemenade in :gh:" -"`80480`.)" +"for Unicode characters instead. (Contributed by Hugo van Kemenade " +"in :gh:`80480`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1792 +#: ../../whatsnew/3.13.rst:1844 #: ../../deprecations/pending-removal-in-3.15.rst:16 msgid ":mod:`ctypes`:" msgstr ":mod:`ctypes`:" -#: ../../whatsnew/3.13.rst:1794 +#: ../../whatsnew/3.13.rst:1846 msgid "" "Deprecate the undocumented :func:`!SetPointerType` function, to be removed " "in Python 3.15. (Contributed by Victor Stinner in :gh:`105733`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1798 +#: ../../whatsnew/3.13.rst:1850 msgid "" ":term:`Soft-deprecate ` the :func:`~ctypes.ARRAY` function " "in favour of ``type * length`` multiplication. (Contributed by Victor " "Stinner in :gh:`105733`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1802 +#: ../../whatsnew/3.13.rst:1854 msgid ":mod:`decimal`:" msgstr ":mod:`decimal`:" -#: ../../whatsnew/3.13.rst:1804 +#: ../../whatsnew/3.13.rst:1856 msgid "" "Deprecate the non-standard and undocumented :class:`~decimal.Decimal` format " "specifier ``'N'``, which is only supported in the :mod:`!decimal` module's C " "implementation. (Contributed by Serhiy Storchaka in :gh:`89902`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1809 +#: ../../whatsnew/3.13.rst:1861 msgid ":mod:`dis`:" msgstr ":mod:`dis`:" -#: ../../whatsnew/3.13.rst:1811 +#: ../../whatsnew/3.13.rst:1863 msgid "" -"Deprecate the :attr:`!HAVE_ARGUMENT` separator. Check membership in :data:" -"`~dis.hasarg` instead. (Contributed by Irit Katriel in :gh:`109319`.)" +"Deprecate the :attr:`!HAVE_ARGUMENT` separator. Check membership " +"in :data:`~dis.hasarg` instead. (Contributed by Irit Katriel " +"in :gh:`109319`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1815 +#: ../../whatsnew/3.13.rst:1867 msgid ":mod:`gettext`:" msgstr ":mod:`gettext`:" -#: ../../whatsnew/3.13.rst:1817 +#: ../../whatsnew/3.13.rst:1869 msgid "" "Deprecate non-integer numbers as arguments to functions and methods that " "consider plural forms in the :mod:`!gettext` module, even if no translation " "was found. (Contributed by Serhiy Storchaka in :gh:`88434`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1822 +#: ../../whatsnew/3.13.rst:1874 msgid ":mod:`glob`:" msgstr ":mod:`glob`:" -#: ../../whatsnew/3.13.rst:1824 +#: ../../whatsnew/3.13.rst:1876 msgid "" -"Deprecate the undocumented :func:`!glob0` and :func:`!glob1` functions. Use :" -"func:`~glob.glob` and pass a :term:`path-like object` specifying the root " -"directory to the *root_dir* parameter instead. (Contributed by Barney Gale " -"in :gh:`117337`.)" +"Deprecate the undocumented :func:`!glob0` and :func:`!glob1` functions. " +"Use :func:`~glob.glob` and pass a :term:`path-like object` specifying the " +"root directory to the *root_dir* parameter instead. (Contributed by Barney " +"Gale in :gh:`117337`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1829 +#: ../../whatsnew/3.13.rst:1881 #: ../../deprecations/pending-removal-in-3.15.rst:21 msgid ":mod:`http.server`:" msgstr ":mod:`http.server`:" -#: ../../whatsnew/3.13.rst:1831 +#: ../../whatsnew/3.13.rst:1883 msgid "" "Deprecate :class:`~http.server.CGIHTTPRequestHandler`, to be removed in " "Python 3.15. Process-based CGI HTTP servers have been out of favor for a " @@ -2716,29 +2840,29 @@ msgid "" "by Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1838 +#: ../../whatsnew/3.13.rst:1890 msgid "" "Deprecate the :option:`!--cgi` flag to the :program:`python -m http.server` " "command-line interface, to be removed in Python 3.15. (Contributed by " "Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1843 +#: ../../whatsnew/3.13.rst:1895 msgid ":mod:`mimetypes`:" msgstr ":mod:`mimetypes`:" -#: ../../whatsnew/3.13.rst:1845 +#: ../../whatsnew/3.13.rst:1897 msgid "" -":term:`Soft-deprecate ` file path arguments to :func:" -"`~mimetypes.guess_type`, use :func:`~mimetypes.guess_file_type` instead. " -"(Contributed by Serhiy Storchaka in :gh:`66543`.)" +":term:`Soft-deprecate ` file path arguments " +"to :func:`~mimetypes.guess_type`, use :func:`~mimetypes.guess_file_type` " +"instead. (Contributed by Serhiy Storchaka in :gh:`66543`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1850 +#: ../../whatsnew/3.13.rst:1902 msgid ":mod:`re`:" msgstr ":mod:`re`:" -#: ../../whatsnew/3.13.rst:1852 +#: ../../whatsnew/3.13.rst:1904 msgid "" "Deprecate passing the optional *maxsplit*, *count*, or *flags* arguments as " "positional arguments to the module-level :func:`~re.split`, :func:`~re.sub`, " @@ -2747,131 +2871,132 @@ msgid "" "by Serhiy Storchaka in :gh:`56166`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1859 +#: ../../whatsnew/3.13.rst:1911 #: ../../deprecations/pending-removal-in-3.15.rst:42 msgid ":mod:`pathlib`:" msgstr ":mod:`pathlib`:" -#: ../../whatsnew/3.13.rst:1861 +#: ../../whatsnew/3.13.rst:1913 msgid "" -"Deprecate :meth:`.PurePath.is_reserved`, to be removed in Python 3.15. Use :" -"func:`os.path.isreserved` to detect reserved paths on Windows. (Contributed " -"by Barney Gale in :gh:`88569`.)" +"Deprecate :meth:`.PurePath.is_reserved`, to be removed in Python 3.15. " +"Use :func:`os.path.isreserved` to detect reserved paths on Windows. " +"(Contributed by Barney Gale in :gh:`88569`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1866 +#: ../../whatsnew/3.13.rst:1918 #: ../../deprecations/pending-removal-in-3.15.rst:48 msgid ":mod:`platform`:" msgstr ":mod:`platform`:" -#: ../../whatsnew/3.13.rst:1868 +#: ../../whatsnew/3.13.rst:1920 msgid "" "Deprecate :func:`~platform.java_ver`, to be removed in Python 3.15. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested. (Contributed by Nikita Sobolev in :gh:`116349`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1874 +#: ../../whatsnew/3.13.rst:1926 msgid ":mod:`pydoc`:" msgstr ":mod:`pydoc`:" -#: ../../whatsnew/3.13.rst:1876 +#: ../../whatsnew/3.13.rst:1928 msgid "" "Deprecate the undocumented :func:`!ispackage` function. (Contributed by " "Zackery Spytz in :gh:`64020`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1879 +#: ../../whatsnew/3.13.rst:1931 #: ../../deprecations/pending-removal-in-3.14.rst:91 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" -#: ../../whatsnew/3.13.rst:1881 +#: ../../whatsnew/3.13.rst:1933 msgid "" -"Deprecate passing more than one positional argument to the :func:`~sqlite3." -"connect` function and the :class:`~sqlite3.Connection` constructor. The " -"remaining parameters will become keyword-only in Python 3.15. (Contributed " -"by Erlend E. Aasland in :gh:`107948`.)" +"Deprecate passing more than one positional argument to " +"the :func:`~sqlite3.connect` function and the :class:`~sqlite3.Connection` " +"constructor. The remaining parameters will become keyword-only in Python " +"3.15. (Contributed by Erlend E. Aasland in :gh:`107948`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1887 +#: ../../whatsnew/3.13.rst:1939 msgid "" "Deprecate passing name, number of arguments, and the callable as keyword " -"arguments for :meth:`.Connection.create_function` and :meth:`.Connection." -"create_aggregate` These parameters will become positional-only in Python " -"3.15. (Contributed by Erlend E. Aasland in :gh:`108278`.)" +"arguments for :meth:`.Connection.create_function` " +"and :meth:`.Connection.create_aggregate` These parameters will become " +"positional-only in Python 3.15. (Contributed by Erlend E. Aasland " +"in :gh:`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1893 +#: ../../whatsnew/3.13.rst:1945 msgid "" -"Deprecate passing the callback callable by keyword for the :meth:`~sqlite3." -"Connection.set_authorizer`, :meth:`~sqlite3.Connection." -"set_progress_handler`, and :meth:`~sqlite3.Connection.set_trace_callback` :" -"class:`~sqlite3.Connection` methods. The callback callables will become " -"positional-only in Python 3.15. (Contributed by Erlend E. Aasland in :gh:" -"`108278`.)" +"Deprecate passing the callback callable by keyword for " +"the :meth:`~sqlite3.Connection.set_authorizer`, :meth:`~sqlite3.Connection.set_progress_handler`, " +"and :meth:`~sqlite3.Connection.set_trace_callback` :class:`~sqlite3.Connection` " +"methods. The callback callables will become positional-only in Python 3.15. " +"(Contributed by Erlend E. Aasland in :gh:`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1901 +#: ../../whatsnew/3.13.rst:1953 #: ../../deprecations/pending-removal-in-3.16.rst:47 msgid ":mod:`sys`:" msgstr ":mod:`sys`:" -#: ../../whatsnew/3.13.rst:1903 +#: ../../whatsnew/3.13.rst:1955 msgid "" "Deprecate the :func:`~sys._enablelegacywindowsfsencoding` function, to be " "removed in Python 3.16. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable instead. (Contributed by Inada Naoki in :gh:`73427`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1908 +#: ../../whatsnew/3.13.rst:1960 #: ../../deprecations/pending-removal-in-3.16.rst:53 msgid ":mod:`tarfile`:" msgstr ":mod:`tarfile`:" -#: ../../whatsnew/3.13.rst:1910 +#: ../../whatsnew/3.13.rst:1962 msgid "" "Deprecate the undocumented and unused :attr:`!TarFile.tarfile` attribute, to " "be removed in Python 3.16. (Contributed in :gh:`115256`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1914 +#: ../../whatsnew/3.13.rst:1966 msgid ":mod:`traceback`:" msgstr ":mod:`traceback`:" -#: ../../whatsnew/3.13.rst:1916 +#: ../../whatsnew/3.13.rst:1968 msgid "" -"Deprecate the :attr:`.TracebackException.exc_type` attribute. Use :attr:`." -"TracebackException.exc_type_str` instead. (Contributed by Irit Katriel in :" -"gh:`112332`.)" +"Deprecate the :attr:`.TracebackException.exc_type` attribute. " +"Use :attr:`.TracebackException.exc_type_str` instead. (Contributed by Irit " +"Katriel in :gh:`112332`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1920 +#: ../../whatsnew/3.13.rst:1972 #: ../../deprecations/pending-removal-in-3.15.rst:71 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" -#: ../../whatsnew/3.13.rst:1922 +#: ../../whatsnew/3.13.rst:1974 msgid "" -"Deprecate the undocumented keyword argument syntax for creating :class:" -"`~typing.NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, " -"y=int)``), to be removed in Python 3.15. Use the class-based syntax or the " -"functional syntax instead. (Contributed by Alex Waygood in :gh:`105566`.)" +"Deprecate the undocumented keyword argument syntax for " +"creating :class:`~typing.NamedTuple` classes (e.g. ``Point = " +"NamedTuple(\"Point\", x=int, y=int)``), to be removed in Python 3.15. Use " +"the class-based syntax or the functional syntax instead. (Contributed by " +"Alex Waygood in :gh:`105566`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1929 +#: ../../whatsnew/3.13.rst:1981 msgid "" -"Deprecate omitting the *fields* parameter when creating a :class:`~typing." -"NamedTuple` or :class:`typing.TypedDict` class, and deprecate passing " -"``None`` to the *fields* parameter of both types. Python 3.15 will require a " -"valid sequence for the *fields* parameter. To create a NamedTuple class with " -"zero fields, use ``class NT(NamedTuple): pass`` or ``NT = NamedTuple(\"NT\", " -"())``. To create a TypedDict class with zero fields, use ``class " -"TD(TypedDict): pass`` or ``TD = TypedDict(\"TD\", {})``. (Contributed by " -"Alex Waygood in :gh:`105566` and :gh:`105570`.)" +"Deprecate omitting the *fields* parameter when creating " +"a :class:`~typing.NamedTuple` or :class:`typing.TypedDict` class, and " +"deprecate passing ``None`` to the *fields* parameter of both types. Python " +"3.15 will require a valid sequence for the *fields* parameter. To create a " +"NamedTuple class with zero fields, use ``class NT(NamedTuple): pass`` or " +"``NT = NamedTuple(\"NT\", ())``. To create a TypedDict class with zero " +"fields, use ``class TD(TypedDict): pass`` or ``TD = TypedDict(\"TD\", {})``. " +"(Contributed by Alex Waygood in :gh:`105566` and :gh:`105570`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1939 +#: ../../whatsnew/3.13.rst:1991 msgid "" "Deprecate the :func:`typing.no_type_check_decorator` decorator function, to " "be removed in in Python 3.15. After eight years in the :mod:`typing` module, " @@ -2879,7 +3004,7 @@ msgid "" "Waygood in :gh:`106309`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1945 +#: ../../whatsnew/3.13.rst:1997 msgid "" "Deprecate :data:`typing.AnyStr`. In Python 3.16, it will be removed from " "``typing.__all__``, and a :exc:`DeprecationWarning` will be emitted at " @@ -2888,17 +3013,17 @@ msgid "" "(Contributed by Michael The in :gh:`107116`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1953 +#: ../../whatsnew/3.13.rst:2005 #: ../../deprecations/pending-removal-in-3.15.rst:84 msgid ":mod:`wave`:" msgstr ":mod:`wave`:" -#: ../../whatsnew/3.13.rst:1955 +#: ../../whatsnew/3.13.rst:2007 msgid "" -"Deprecate the :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:" -"`~wave.Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :" -"class:`~wave.Wave_write` classes, to be removed in Python 3.15. (Contributed " -"by Victor Stinner in :gh:`105096`.)" +"Deprecate the :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, " +"and :meth:`~wave.Wave_read.getmarkers` methods of " +"the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes, to be " +"removed in Python 3.15. (Contributed by Victor Stinner in :gh:`105096`.)" msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:2 @@ -2947,8 +3072,8 @@ msgstr ":class:`!ast.Ellipsis`" #: ../../deprecations/pending-removal-in-3.14.rst:19 msgid "" -"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" -"`90953`.)" +"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka " +"in :gh:`90953`.)" msgstr "" "請改用 :class:`ast.Constant`。(由 Serhiy Storchaka 於 :gh:`90953` 貢獻。)" @@ -2959,27 +3084,26 @@ msgstr ":mod:`asyncio`:" #: ../../deprecations/pending-removal-in-3.14.rst:24 msgid "" -"The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" -"`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" -"class:`~asyncio.SafeChildWatcher` are deprecated and will be removed in " +"The child watcher " +"classes :class:`~asyncio.MultiLoopChildWatcher`, :class:`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` " +"and :class:`~asyncio.SafeChildWatcher` are deprecated and will be removed in " "Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -"已棄用並將在 Python 3.14 中移除的 child watcher 類別::class:`~asyncio." -"MultiLoopChildWatcher`、:class:`~asyncio.FastChildWatcher`、:class:`~asyncio." -"AbstractChildWatcher` 和 :class:`~asyncio.SafeChildWatcher`。 (由 Kumar " -"Aditya 於 :gh:`94597` 貢獻。)" +"已棄用並將在 Python 3.14 中移除的 child watcher 類" +"別::class:`~asyncio.MultiLoopChildWatcher`、:class:`~asyncio.FastChildWatcher`、:class:`~asyncio.AbstractChildWatcher` " +"和 :class:`~asyncio.SafeChildWatcher`。 (由 Kumar Aditya 於 :gh:`94597` 貢" +"獻。)" #: ../../deprecations/pending-removal-in-3.14.rst:30 msgid "" -":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" -"`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." -"AbstractEventLoopPolicy.get_child_watcher` are deprecated and will be " -"removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:`asyncio.AbstractEventLoopPolicy.set_child_watcher` " +"and :meth:`asyncio.AbstractEventLoopPolicy.get_child_watcher` are deprecated " +"and will be removed in Python 3.14. (Contributed by Kumar Aditya " +"in :gh:`94597`.)" msgstr "" -":func:`asyncio.set_child_watcher`、:func:`asyncio.get_child_watcher`、:meth:" -"`asyncio.AbstractEventLoopPolicy.set_child_watcher` 和 :meth:`asyncio." -"AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 Python 3.14 中移" -"除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" +":func:`asyncio.set_child_watcher`、:func:`asyncio.get_child_watcher`、:meth:`asyncio.AbstractEventLoopPolicy.set_child_watcher` " +"和 :meth:`asyncio.AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 " +"Python 3.14 中移除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" #: ../../deprecations/pending-removal-in-3.14.rst:36 msgid "" @@ -2996,18 +3120,21 @@ msgstr "" msgid "" ":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. " "Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " -"typing, prefer a union, like ``bytes | bytearray``, or :class:`collections." -"abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" -msgstr "" -":mod:`collections.abc`:已棄用 :class:`~collections.abc.ByteString`。請改用 :" -"class:`!Sequence` 或 :class:`~collections.abc.Buffer`。在 typing 中使用時,請" -"改用聯集,如 ``bytes | bytearray``,或 :class:`collections.abc.Buffer`。(由 " -"Shantanu Jain 於 :gh:`91896` 貢獻。)" +"typing, prefer a union, like ``bytes | bytearray``, " +"or :class:`collections.abc.Buffer`. (Contributed by Shantanu Jain " +"in :gh:`91896`.)" +msgstr "" +":mod:`collections.abc`:已棄用 :class:`~collections.abc.ByteString`。請改" +"用 :class:`!Sequence` 或 :class:`~collections.abc.Buffer`。在 typing 中使用" +"時,請改用聯集,如 ``bytes | bytearray``," +"或 :class:`collections.abc.Buffer`。(由 Shantanu Jain 於 :gh:`91896` 貢" +"獻。)" #: ../../deprecations/pending-removal-in-3.14.rst:47 msgid "" -":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." -"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" +":mod:`email`: Deprecated the *isdst* parameter " +"in :func:`email.utils.localtime`. (Contributed by Alan Williams " +"in :gh:`72346`.)" msgstr "" ":mod:`email`:已棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 貢獻。)" @@ -3061,24 +3188,25 @@ msgid "" "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " "currently the default (:gh:`84559`). Adding a runtime warning about this was " "deemed too disruptive as the majority of code is not expected to care. Use " -"the :func:`~multiprocessing.get_context` or :func:`~multiprocessing." -"set_start_method` APIs to explicitly specify when your code *requires* " -"``'fork'``. See :ref:`multiprocessing-start-methods`." +"the :func:`~multiprocessing.get_context` " +"or :func:`~multiprocessing.set_start_method` APIs to explicitly specify when " +"your code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" ":mod:`multiprocessing`:預設的啟動方法將在 Linux、BSD 和其他非 macOS POSIX 平" "台上更改為更安全的 方法,目前 ``'fork'`` 是預設值 (:gh:`84559`)。對此增加一" -"個 runtime 警告被認為太過擾人,因為 大多數程式碼不會在意。請使用 :func:" -"`~multiprocessing.get_context` 或 :func:`~multiprocessing.set_start_method` " -"API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:" -"`multiprocessing-start-methods`。" +"個 runtime 警告被認為太過擾人,因為 大多數程式碼不會在意。請使" +"用 :func:`~multiprocessing.get_context` " +"或 :func:`~multiprocessing.set_start_method` API 來明確指定你的程式碼何時\\ *" +"需要* ``'fork'``。請參閱 :ref:`multiprocessing-start-methods`。" #: ../../deprecations/pending-removal-in-3.14.rst:77 msgid "" -":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." -"PurePath.relative_to`: passing additional arguments is deprecated." +":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` " +"and :meth:`~pathlib.PurePath.relative_to`: passing additional arguments is " +"deprecated." msgstr "" -":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:" -"`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" +":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` " +"和 :meth:`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" #: ../../deprecations/pending-removal-in-3.14.rst:81 msgid "" @@ -3087,8 +3215,9 @@ msgid "" "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" ":mod:`pkgutil`::func:`~pkgutil.find_loader` 和 :func:`~pkgutil.get_loader` " -"現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util." -"find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)" +"現在會引發 :exc:`DeprecationWarning`;請改" +"用 :func:`importlib.util.find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢" +"獻。)" #: ../../deprecations/pending-removal-in-3.14.rst:86 msgid ":mod:`pty`:" @@ -3108,9 +3237,9 @@ msgstr ":data:`~sqlite3.version` 和 :data:`~sqlite3.version_info`。" #: ../../deprecations/pending-removal-in-3.14.rst:95 msgid "" -":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" -"ref:`named placeholders ` are used and *parameters* is " -"a sequence instead of a :class:`dict`." +":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` " +"if :ref:`named placeholders ` are used and " +"*parameters* is a sequence instead of a :class:`dict`." msgstr "" ":meth:`~sqlite3.Cursor.execute` 和 :meth:`~sqlite3.Cursor.executemany`,如果" "使用 :ref:`named placeholders ` 且 *parameters* 是序列" @@ -3127,8 +3256,8 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.14.rst:102 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " -"intended to be a public API. (Contributed by Gregory P. Smith in :gh:" -"`88168`.)" +"intended to be a public API. (Contributed by Gregory P. Smith " +"in :gh:`88168`.)" msgstr "" ":mod:`urllib`::class:`!urllib.parse.Quoter` 已被棄用:它並非預期的公開 API。" "(由 Gregory P. Smith 於 :gh:`88168` 貢獻。)" @@ -3145,10 +3274,10 @@ msgstr "引入系統 (import system):" #: ../../deprecations/pending-removal-in-3.15.rst:6 msgid "" -"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" -"`__spec__.cached ` is deprecated. In " -"Python 3.15, :attr:`!__cached__` will cease to be set or take into " -"consideration by the import system or standard library. (:gh:`97879`)" +"Setting :attr:`~module.__cached__` on a module while failing to " +"set :attr:`__spec__.cached ` is " +"deprecated. In Python 3.15, :attr:`!__cached__` will cease to be set or take " +"into consideration by the import system or standard library. (:gh:`97879`)" msgstr "" "在模組上設定 :attr:`~module.__cached__` 而沒有設定 :attr:`__spec__.cached " "` 的做法已被棄用。在 Python 3.15 中," @@ -3156,10 +3285,11 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:11 msgid "" -"Setting :attr:`~module.__package__` on a module while failing to set :attr:" -"`__spec__.parent ` is deprecated. In " -"Python 3.15, :attr:`!__package__` will cease to be set or take into " -"consideration by the import system or standard library. (:gh:`97879`)" +"Setting :attr:`~module.__package__` on a module while failing to " +"set :attr:`__spec__.parent ` is " +"deprecated. In Python 3.15, :attr:`!__package__` will cease to be set or " +"take into consideration by the import system or standard library. " +"(:gh:`97879`)" msgstr "" "在模組上設定 :attr:`~module.__package__` 而沒有設定 :attr:`__spec__.parent " "` 的做法已被棄用。在 Python 3.15 中," @@ -3197,23 +3327,25 @@ msgstr ":class:`locale`:" #: ../../deprecations/pending-removal-in-3.15.rst:34 msgid "" "The :func:`~locale.getdefaultlocale` function has been deprecated since " -"Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" -"`90817`), but has been postponed to Python 3.15. Use :func:`~locale." -"getlocale`, :func:`~locale.setlocale`, and :func:`~locale.getencoding` " -"instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" +"Python 3.11. Its removal was originally planned for Python 3.13 " +"(:gh:`90817`), but has been postponed to Python 3.15. " +"Use :func:`~locale.getlocale`, :func:`~locale.setlocale`, " +"and :func:`~locale.getencoding` instead. (Contributed by Hugo van Kemenade " +"in :gh:`111187`.)" msgstr "" ":func:`~locale.getdefaultlocale` 已在 Python 3.11 中被棄用,原本計劃在 " -"Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改用 :func:" -"`~locale.getlocale`、:func:`~locale.setlocale` 和 :func:`~locale." -"getencoding`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" +"Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改" +"用 :func:`~locale.getlocale`、:func:`~locale.setlocale` " +"和 :func:`~locale.getencoding`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢" +"獻。)" #: ../../deprecations/pending-removal-in-3.15.rst:44 msgid "" -":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" -"func:`os.path.isreserved` to detect reserved paths on Windows." +":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. " +"Use :func:`os.path.isreserved` to detect reserved paths on Windows." msgstr "" -":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請用 :func:`os.path." -"isreserved` 來偵測 Windows 上的保留路徑。" +":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請" +"用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。" #: ../../deprecations/pending-removal-in-3.15.rst:50 msgid "" @@ -3251,16 +3383,16 @@ msgid "" "in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" ":class:`types.CodeType`:自 3.10 起,存取 :attr:`~codeobject.co_lnotab` 已" -"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發出 :" -"exc:`DeprecationWarning`。可能在 3.15 中移除。(由 Nikita Sobolev 於 :gh:" -"`101866` 貢獻。)" +"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發" +"出 :exc:`DeprecationWarning`。可能在 3.15 中移除。(由 Nikita Sobolev " +"於 :gh:`101866` 貢獻。)" #: ../../deprecations/pending-removal-in-3.15.rst:73 msgid "" -"The undocumented keyword argument syntax for creating :class:`~typing." -"NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " -"has been deprecated since Python 3.13. Use the class-based syntax or the " -"functional syntax instead." +"The undocumented keyword argument syntax for " +"creating :class:`~typing.NamedTuple` classes (e.g. ``Point = " +"NamedTuple(\"Point\", x=int, y=int)``) has been deprecated since Python " +"3.13. Use the class-based syntax or the functional syntax instead." msgstr "" "用於建立 :class:`~typing.NamedTuple` 類別的未以文件記錄之關鍵字引數語法 " "(``Point = NamedTuple(\"Point\", x=int, y=int)``) 已自 Python 3.13 棄用。請改" @@ -3278,13 +3410,14 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:86 msgid "" -"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." -"Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" -"`~wave.Wave_write` classes have been deprecated since Python 3.13." +"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, " +"and :meth:`~wave.Wave_read.getmarkers` methods of " +"the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes have been " +"deprecated since Python 3.13." msgstr "" -"已棄用 :class:`~wave.Wave_read` 和 :class:`~wave.Wave_write` 類別的 :meth:" -"`~wave.Wave_read.getmark`、:meth:`!setmark` 和 :meth:`~wave.Wave_read." -"getmarkers` 方法自 Python 3.13 被棄用。" +"已棄用 :class:`~wave.Wave_read` 和 :class:`~wave.Wave_write` 類別" +"的 :meth:`~wave.Wave_read.getmark`、:meth:`!setmark` " +"和 :meth:`~wave.Wave_read.getmarkers` 方法自 Python 3.13 被棄用。" #: ../../deprecations/pending-removal-in-3.16.rst:2 msgid "Pending removal in Python 3.16" @@ -3292,10 +3425,10 @@ msgstr "Python 3.16 中待移除的項目" #: ../../deprecations/pending-removal-in-3.16.rst:6 msgid "" -"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" -"`__spec__.loader ` is deprecated. In " -"Python 3.16, :attr:`!__loader__` will cease to be set or taken into " -"consideration by the import system or the standard library." +"Setting :attr:`~module.__loader__` on a module while failing to " +"set :attr:`__spec__.loader ` is " +"deprecated. In Python 3.16, :attr:`!__loader__` will cease to be set or " +"taken into consideration by the import system or the standard library." msgstr "" "在模組上設定 :attr:`~module.__loader__` 而沒有設定 :attr:`__spec__.loader " "` 的做法將於 Python 3.16 被棄用。在 " @@ -3318,8 +3451,8 @@ msgid "" "by Jiahao Li and Kumar Aditya in :gh:`122875`.)" msgstr "" ":func:`!asyncio.iscoroutinefunction` 已被棄用並將在 Python 3.16 中移除,請改" -"用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya 於 :" -"gh:`122875` 貢獻。)" +"用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya " +"於 :gh:`122875` 貢獻。)" #: ../../deprecations/pending-removal-in-3.16.rst:26 #: ../../deprecations/pending-removal-in-future.rst:12 @@ -3421,17 +3554,17 @@ msgid "" "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " "ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as " "``[0x1 for x in y]`` or ``[0x1f or x in y]``). A syntax warning is raised " -"if the numeric literal is immediately followed by one of keywords :keyword:" -"`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :" -"keyword:`is` and :keyword:`or`. In a future release it will be changed to a " -"syntax error. (:gh:`87999`)" +"if the numeric literal is immediately followed by one of " +"keywords :keyword:`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :keyword:`is` " +"and :keyword:`or`. In a future release it will be changed to a syntax " +"error. (:gh:`87999`)" msgstr "" "目前 Python 接受數值字面值後面立即接關鍵字,例如 ``0in x``、``1or x``、``0if " "1else 2``。它讓表達式模糊且容易混淆,如 ``[0x1for x in y]``\\ (可以解釋為 " -"``[0x1 for x in y]`` 或 ``[0x1f or x in y]``)。如果數值字面值後立即接 :" -"keyword:`and`、:keyword:`else`、:keyword:`for`、:keyword:`if`、:keyword:" -"`in`、:keyword:`is` 和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版" -"本中,它將被更改為語法錯誤。(:gh:`87999`)" +"``[0x1 for x in y]`` 或 ``[0x1f or x in y]``)。如果數值字面值後立即" +"接 :keyword:`and`、:keyword:`else`、:keyword:`for`、:keyword:`if`、:keyword:`in`、:keyword:`is` " +"和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版本中,它將被更改為語" +"法錯誤。(:gh:`87999`)" #: ../../deprecations/pending-removal-in-future.rst:26 msgid "" @@ -3444,18 +3577,18 @@ msgstr "" #: ../../deprecations/pending-removal-in-future.rst:29 msgid "" -"Support for ``__float__()`` method returning a strict subclass of :class:" -"`float`: these methods will be required to return an instance of :class:" -"`float`." +"Support for ``__float__()`` method returning a strict subclass " +"of :class:`float`: these methods will be required to return an instance " +"of :class:`float`." msgstr "" "回傳 :class:`float` 嚴格子類別 ``__float__()`` 方法的支援:這些方法將需要回" "傳 :class:`float` 的實例。" #: ../../deprecations/pending-removal-in-future.rst:32 msgid "" -"Support for ``__complex__()`` method returning a strict subclass of :class:" -"`complex`: these methods will be required to return an instance of :class:" -"`complex`." +"Support for ``__complex__()`` method returning a strict subclass " +"of :class:`complex`: these methods will be required to return an instance " +"of :class:`complex`." msgstr "" "回傳 :class:`complex` 嚴格子類別 ``__complex__()`` 方法的支援:這些方法將需要" "回傳 :class:`complex` 的實例。" @@ -3466,10 +3599,10 @@ msgstr "將 ``int()`` 委派給 ``__trunc__()`` 方法。" #: ../../deprecations/pending-removal-in-future.rst:36 msgid "" -"Passing a complex number as the *real* or *imag* argument in the :func:" -"`complex` constructor is now deprecated; it should only be passed as a " -"single positional argument. (Contributed by Serhiy Storchaka in :gh:" -"`109218`.)" +"Passing a complex number as the *real* or *imag* argument in " +"the :func:`complex` constructor is now deprecated; it should only be passed " +"as a single positional argument. (Contributed by Serhiy Storchaka " +"in :gh:`109218`.)" msgstr "" "在 :func:`complex` 建構子中將複數作為 *real* 或 *imag* 引數傳遞現在已被棄用;" "它應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢獻。)" @@ -3477,8 +3610,9 @@ msgstr "" #: ../../deprecations/pending-removal-in-future.rst:41 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " -"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." -"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" +"are deprecated and replaced by :data:`calendar.JANUARY` " +"and :data:`calendar.FEBRUARY`. (Contributed by Prince Roshan " +"in :gh:`103636`.)" msgstr "" ":mod:`calendar`:``calendar.January`` 和 ``calendar.February`` 常數已被棄用並" "被 :data:`calendar.JANUARY` 和 :data:`calendar.FEBRUARY` 取代。 (由 Prince " @@ -3497,19 +3631,19 @@ msgstr ":mod:`datetime`:" #: ../../deprecations/pending-removal-in-future.rst:51 msgid "" -":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." -"UTC)``." +":meth:`~datetime.datetime.utcnow`: use " +"``datetime.datetime.now(tz=datetime.UTC)``." msgstr "" -":meth:`~datetime.datetime.utcnow`:請改用 ``datetime.datetime." -"now(tz=datetime.UTC)``。" +":meth:`~datetime.datetime.utcnow`:請改用 " +"``datetime.datetime.now(tz=datetime.UTC)``。" #: ../../deprecations/pending-removal-in-future.rst:53 msgid "" -":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." -"fromtimestamp(timestamp, tz=datetime.UTC)``." +":meth:`~datetime.datetime.utcfromtimestamp`: use " +"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``." msgstr "" -":meth:`~datetime.datetime.utcfromtimestamp`:請改用 ``datetime.datetime." -"fromtimestamp(timestamp, tz=datetime.UTC)``。" +":meth:`~datetime.datetime.utcfromtimestamp`:請改用 " +"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``。" #: ../../deprecations/pending-removal-in-future.rst:56 msgid ":mod:`gettext`: Plural value must be an integer." @@ -3548,8 +3682,8 @@ msgid "" ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " "use :meth:`~logging.warning` instead." msgstr "" -":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改用 :meth:" -"`~logging.warning`。" +":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改" +"用 :meth:`~logging.warning`。" #: ../../deprecations/pending-removal-in-future.rst:72 msgid "" @@ -3606,11 +3740,11 @@ msgstr "不帶協定引數的 :class:`ssl.SSLContext` 已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:95 msgid "" -":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" -"`!selected_npn_protocol` are deprecated: use ALPN instead." +":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` " +"and :meth:`!selected_npn_protocol` are deprecated: use ALPN instead." msgstr "" -":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` 和 :meth:" -"`!selected_npn_protocol` 已被棄用:請改用 ALPN。" +":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` " +"和 :meth:`!selected_npn_protocol` 已被棄用:請改用 ALPN。" #: ../../deprecations/pending-removal-in-future.rst:98 msgid "``ssl.OP_NO_SSL*`` options" @@ -3665,11 +3799,11 @@ msgstr ":mod:`threading` 方法:" #: ../../deprecations/pending-removal-in-future.rst:114 msgid "" -":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." -"notify_all`." +":meth:`!threading.Condition.notifyAll`: " +"use :meth:`~threading.Condition.notify_all`." msgstr "" -":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition." -"notify_all`。" +":meth:`!threading.Condition.notifyAll`:請" +"用 :meth:`~threading.Condition.notify_all`。" #: ../../deprecations/pending-removal-in-future.rst:115 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." @@ -3677,19 +3811,19 @@ msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set` #: ../../deprecations/pending-removal-in-future.rst:116 msgid "" -":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" -"attr:`threading.Thread.daemon` attribute." +":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: " +"use :attr:`threading.Thread.daemon` attribute." msgstr "" ":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請" "用 :attr:`threading.Thread.daemon` 屬性。" #: ../../deprecations/pending-removal-in-future.rst:118 msgid "" -":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" -"attr:`threading.Thread.name` attribute." +":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: " +"use :attr:`threading.Thread.name` attribute." msgstr "" -":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :" -"attr:`threading.Thread.name` 屬性。" +":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請" +"用 :attr:`threading.Thread.name` 屬性。" #: ../../deprecations/pending-removal-in-future.rst:120 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." @@ -3765,13 +3899,13 @@ msgstr "``to_bytes()``" #: ../../deprecations/pending-removal-in-future.rst:142 msgid "" -":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:" -"`~urllib.request.FancyURLopener` style of invoking requests is deprecated. " -"Use newer :func:`~urllib.request.urlopen` functions and methods." +":mod:`urllib.request`: :class:`~urllib.request.URLopener` " +"and :class:`~urllib.request.FancyURLopener` style of invoking requests is " +"deprecated. Use newer :func:`~urllib.request.urlopen` functions and methods." msgstr "" -":mod:`urllib.request`:呼叫請求的 :class:`~urllib.request.URLopener` 和 :" -"class:`~urllib.request.FancyURLopener` 風格已被棄用。請改用更新的 :func:" -"`~urllib.request.urlopen` 函式和方法。" +":mod:`urllib.request`:呼叫請求的 :class:`~urllib.request.URLopener` " +"和 :class:`~urllib.request.FancyURLopener` 風格已被棄用。請改用更新" +"的 :func:`~urllib.request.urlopen` 函式和方法。" #: ../../deprecations/pending-removal-in-future.rst:146 msgid "" @@ -3781,268 +3915,269 @@ msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分 #: ../../deprecations/pending-removal-in-future.rst:149 msgid "" -":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." -"etree.ElementTree.Element` is deprecated. In a future release it will always " -"return ``True``. Prefer explicit ``len(elem)`` or ``elem is not None`` tests " -"instead." +":mod:`xml.etree.ElementTree`: Testing the truth value of " +"an :class:`~xml.etree.ElementTree.Element` is deprecated. In a future " +"release it will always return ``True``. Prefer explicit ``len(elem)`` or " +"``elem is not None`` tests instead." msgstr "" -":mod:`xml.etree.ElementTree`:已棄用對 :class:`~xml.etree.ElementTree." -"Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 " -"``len(elem)`` 或 ``elem is not None`` 測試。" +":mod:`xml.etree.ElementTree`:已棄用" +"對 :class:`~xml.etree.ElementTree.Element` 的真值測試。在未來版本中,它將始終" +"回傳 ``True``。請改用明確的 ``len(elem)`` 或 ``elem is not None`` 測試。" #: ../../deprecations/pending-removal-in-future.rst:154 msgid "" -":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:" -"`~zipimport.zipimporter.exec_module` instead." +":meth:`zipimport.zipimporter.load_module` is deprecated: " +"use :meth:`~zipimport.zipimporter.exec_module` instead." msgstr "" -":meth:`zipimport.zipimporter.load_module` 已被棄用:請改用 :meth:`~zipimport." -"zipimporter.exec_module`。" +":meth:`zipimport.zipimporter.load_module` 已被棄用:請改" +"用 :meth:`~zipimport.zipimporter.exec_module`。" -#: ../../whatsnew/3.13.rst:1972 +#: ../../whatsnew/3.13.rst:2024 msgid "CPython Bytecode Changes" msgstr "" -#: ../../whatsnew/3.13.rst:1974 +#: ../../whatsnew/3.13.rst:2026 msgid "" "The oparg of :opcode:`YIELD_VALUE` is now ``1`` if the yield is part of a " "yield-from or await, and ``0`` otherwise. The oparg of :opcode:`RESUME` was " "changed to add a bit indicating if the except-depth is 1, which is needed to " -"optimize closing of generators. (Contributed by Irit Katriel in :gh:" -"`111354`.)" +"optimize closing of generators. (Contributed by Irit Katriel " +"in :gh:`111354`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1982 +#: ../../whatsnew/3.13.rst:2034 msgid "C API Changes" msgstr "C API 變更" -#: ../../whatsnew/3.13.rst:1987 +#: ../../whatsnew/3.13.rst:2039 msgid "" -"Add the :ref:`PyMonitoring C API ` for generating :pep:" -"`669` monitoring events:" +"Add the :ref:`PyMonitoring C API ` for " +"generating :pep:`669` monitoring events:" msgstr "" -#: ../../whatsnew/3.13.rst:1990 +#: ../../whatsnew/3.13.rst:2042 msgid ":c:type:`PyMonitoringState`" msgstr ":c:type:`PyMonitoringState`" -#: ../../whatsnew/3.13.rst:1991 +#: ../../whatsnew/3.13.rst:2043 msgid ":c:func:`PyMonitoring_FirePyStartEvent`" msgstr ":c:func:`PyMonitoring_FirePyStartEvent`" -#: ../../whatsnew/3.13.rst:1992 +#: ../../whatsnew/3.13.rst:2044 msgid ":c:func:`PyMonitoring_FirePyResumeEvent`" msgstr ":c:func:`PyMonitoring_FirePyResumeEvent`" -#: ../../whatsnew/3.13.rst:1993 +#: ../../whatsnew/3.13.rst:2045 msgid ":c:func:`PyMonitoring_FirePyReturnEvent`" msgstr ":c:func:`PyMonitoring_FirePyReturnEvent`" -#: ../../whatsnew/3.13.rst:1994 +#: ../../whatsnew/3.13.rst:2046 msgid ":c:func:`PyMonitoring_FirePyYieldEvent`" msgstr ":c:func:`PyMonitoring_FirePyYieldEvent`" -#: ../../whatsnew/3.13.rst:1995 +#: ../../whatsnew/3.13.rst:2047 msgid ":c:func:`PyMonitoring_FireCallEvent`" msgstr ":c:func:`PyMonitoring_FireCallEvent`" -#: ../../whatsnew/3.13.rst:1996 +#: ../../whatsnew/3.13.rst:2048 msgid ":c:func:`PyMonitoring_FireLineEvent`" msgstr ":c:func:`PyMonitoring_FireLineEvent`" -#: ../../whatsnew/3.13.rst:1997 +#: ../../whatsnew/3.13.rst:2049 msgid ":c:func:`PyMonitoring_FireJumpEvent`" msgstr ":c:func:`PyMonitoring_FireJumpEvent`" -#: ../../whatsnew/3.13.rst:1998 +#: ../../whatsnew/3.13.rst:2050 msgid ":c:func:`PyMonitoring_FireBranchEvent`" msgstr ":c:func:`PyMonitoring_FireBranchEvent`" -#: ../../whatsnew/3.13.rst:1999 +#: ../../whatsnew/3.13.rst:2051 msgid ":c:func:`PyMonitoring_FireCReturnEvent`" msgstr ":c:func:`PyMonitoring_FireCReturnEvent`" -#: ../../whatsnew/3.13.rst:2000 +#: ../../whatsnew/3.13.rst:2052 msgid ":c:func:`PyMonitoring_FirePyThrowEvent`" msgstr ":c:func:`PyMonitoring_FirePyThrowEvent`" -#: ../../whatsnew/3.13.rst:2001 +#: ../../whatsnew/3.13.rst:2053 msgid ":c:func:`PyMonitoring_FireRaiseEvent`" msgstr ":c:func:`PyMonitoring_FireRaiseEvent`" -#: ../../whatsnew/3.13.rst:2002 +#: ../../whatsnew/3.13.rst:2054 msgid ":c:func:`PyMonitoring_FireCRaiseEvent`" msgstr ":c:func:`PyMonitoring_FireCRaiseEvent`" -#: ../../whatsnew/3.13.rst:2003 +#: ../../whatsnew/3.13.rst:2055 msgid ":c:func:`PyMonitoring_FireReraiseEvent`" msgstr ":c:func:`PyMonitoring_FireReraiseEvent`" -#: ../../whatsnew/3.13.rst:2004 +#: ../../whatsnew/3.13.rst:2056 msgid ":c:func:`PyMonitoring_FireExceptionHandledEvent`" msgstr ":c:func:`PyMonitoring_FireExceptionHandledEvent`" -#: ../../whatsnew/3.13.rst:2005 +#: ../../whatsnew/3.13.rst:2057 msgid ":c:func:`PyMonitoring_FirePyUnwindEvent`" msgstr ":c:func:`PyMonitoring_FirePyUnwindEvent`" -#: ../../whatsnew/3.13.rst:2006 +#: ../../whatsnew/3.13.rst:2058 msgid ":c:func:`PyMonitoring_FireStopIterationEvent`" msgstr ":c:func:`PyMonitoring_FireStopIterationEvent`" -#: ../../whatsnew/3.13.rst:2007 +#: ../../whatsnew/3.13.rst:2059 msgid ":c:func:`PyMonitoring_EnterScope`" msgstr ":c:func:`PyMonitoring_EnterScope`" -#: ../../whatsnew/3.13.rst:2008 +#: ../../whatsnew/3.13.rst:2060 msgid ":c:func:`PyMonitoring_ExitScope`" msgstr ":c:func:`PyMonitoring_ExitScope`" -#: ../../whatsnew/3.13.rst:2010 +#: ../../whatsnew/3.13.rst:2062 msgid "(Contributed by Irit Katriel in :gh:`111997`)." msgstr "(由 Irit Katriel 在 :gh:`111997` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2012 +#: ../../whatsnew/3.13.rst:2064 msgid "" "Add :c:type:`PyMutex`, a lightweight mutex that occupies a single byte, and " -"the new :c:func:`PyMutex_Lock` and :c:func:`PyMutex_Unlock` functions. :c:" -"func:`!PyMutex_Lock` will release the :term:`GIL` (if currently held) if the " -"operation needs to block. (Contributed by Sam Gross in :gh:`108724`.)" +"the new :c:func:`PyMutex_Lock` and :c:func:`PyMutex_Unlock` " +"functions. :c:func:`!PyMutex_Lock` will release the :term:`GIL` (if " +"currently held) if the operation needs to block. (Contributed by Sam Gross " +"in :gh:`108724`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2018 +#: ../../whatsnew/3.13.rst:2070 msgid "" "Add the :ref:`PyTime C API ` to provide access to system clocks:" msgstr "" -#: ../../whatsnew/3.13.rst:2020 +#: ../../whatsnew/3.13.rst:2072 msgid ":c:type:`PyTime_t`." msgstr ":c:type:`PyTime_t`。" -#: ../../whatsnew/3.13.rst:2021 +#: ../../whatsnew/3.13.rst:2073 msgid ":c:var:`PyTime_MIN` and :c:var:`PyTime_MAX`." msgstr "" -#: ../../whatsnew/3.13.rst:2022 +#: ../../whatsnew/3.13.rst:2074 msgid ":c:func:`PyTime_AsSecondsDouble`." msgstr ":c:func:`PyTime_AsSecondsDouble`。" -#: ../../whatsnew/3.13.rst:2023 +#: ../../whatsnew/3.13.rst:2075 msgid ":c:func:`PyTime_Monotonic`." msgstr ":c:func:`PyTime_Monotonic`。" -#: ../../whatsnew/3.13.rst:2024 +#: ../../whatsnew/3.13.rst:2076 msgid ":c:func:`PyTime_MonotonicRaw`." msgstr ":c:func:`PyTime_MonotonicRaw`。" -#: ../../whatsnew/3.13.rst:2025 +#: ../../whatsnew/3.13.rst:2077 msgid ":c:func:`PyTime_PerfCounter`." msgstr ":c:func:`PyTime_PerfCounter`。" -#: ../../whatsnew/3.13.rst:2026 +#: ../../whatsnew/3.13.rst:2078 msgid ":c:func:`PyTime_PerfCounterRaw`." msgstr ":c:func:`PyTime_PerfCounterRaw`。" -#: ../../whatsnew/3.13.rst:2027 +#: ../../whatsnew/3.13.rst:2079 msgid ":c:func:`PyTime_Time`." msgstr ":c:func:`PyTime_Time`。" -#: ../../whatsnew/3.13.rst:2028 +#: ../../whatsnew/3.13.rst:2080 msgid ":c:func:`PyTime_TimeRaw`." msgstr ":c:func:`PyTime_TimeRaw`。" -#: ../../whatsnew/3.13.rst:2030 +#: ../../whatsnew/3.13.rst:2082 msgid "(Contributed by Victor Stinner and Petr Viktorin in :gh:`110850`.)" msgstr "(由 Victor Stinner 和 Petr Viktorin 在 :gh:`110850` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2032 +#: ../../whatsnew/3.13.rst:2084 msgid "" -"Add the :c:func:`PyDict_ContainsString` function with the same behavior as :" -"c:func:`PyDict_Contains`, but *key* is specified as a :c:expr:`const char*` " -"UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`. (Contributed " -"by Victor Stinner in :gh:`108314`.)" +"Add the :c:func:`PyDict_ContainsString` function with the same behavior " +"as :c:func:`PyDict_Contains`, but *key* is specified as a :c:expr:`const " +"char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`. " +"(Contributed by Victor Stinner in :gh:`108314`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2038 +#: ../../whatsnew/3.13.rst:2090 msgid "" "Add the :c:func:`PyDict_GetItemRef` and :c:func:`PyDict_GetItemStringRef` " "functions, which behave similarly to :c:func:`PyDict_GetItemWithError`, but " "return a :term:`strong reference` instead of a :term:`borrowed reference`. " "Moreover, these functions return ``-1`` on error, removing the need to " -"check :c:func:`!PyErr_Occurred`. (Contributed by Victor Stinner in :gh:" -"`106004`.)" +"check :c:func:`!PyErr_Occurred`. (Contributed by Victor Stinner " +"in :gh:`106004`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2046 +#: ../../whatsnew/3.13.rst:2098 msgid "" -"Add the :c:func:`PyDict_SetDefaultRef` function, which behaves similarly to :" -"c:func:`PyDict_SetDefault`, but returns a :term:`strong reference` instead " -"of a :term:`borrowed reference`. This function returns ``-1`` on error, " -"``0`` on insertion, and ``1`` if the key was already present in the " +"Add the :c:func:`PyDict_SetDefaultRef` function, which behaves similarly " +"to :c:func:`PyDict_SetDefault`, but returns a :term:`strong reference` " +"instead of a :term:`borrowed reference`. This function returns ``-1`` on " +"error, ``0`` on insertion, and ``1`` if the key was already present in the " "dictionary. (Contributed by Sam Gross in :gh:`112066`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2054 +#: ../../whatsnew/3.13.rst:2106 msgid "" "Add the :c:func:`PyDict_Pop` and :c:func:`PyDict_PopString` functions to " "remove a key from a dictionary and optionally return the removed value. This " -"is similar to :meth:`dict.pop`, though there is no default value, and :exc:" -"`KeyError` is not raised for missing keys. (Contributed by Stefan Behnel and " -"Victor Stinner in :gh:`111262`.)" +"is similar to :meth:`dict.pop`, though there is no default value, " +"and :exc:`KeyError` is not raised for missing keys. (Contributed by Stefan " +"Behnel and Victor Stinner in :gh:`111262`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2061 +#: ../../whatsnew/3.13.rst:2113 msgid "" -"Add the :c:func:`PyMapping_GetOptionalItem` and :c:func:" -"`PyMapping_GetOptionalItemString` functions as alternatives to :c:func:" -"`PyObject_GetItem` and :c:func:`PyMapping_GetItemString` respectively. The " -"new functions do not raise :exc:`KeyError` if the requested key is missing " -"from the mapping. These variants are more convenient and faster if a missing " -"key should not be treated as a failure. (Contributed by Serhiy Storchaka in :" -"gh:`106307`.)" +"Add the :c:func:`PyMapping_GetOptionalItem` " +"and :c:func:`PyMapping_GetOptionalItemString` functions as alternatives " +"to :c:func:`PyObject_GetItem` and :c:func:`PyMapping_GetItemString` " +"respectively. The new functions do not raise :exc:`KeyError` if the " +"requested key is missing from the mapping. These variants are more " +"convenient and faster if a missing key should not be treated as a failure. " +"(Contributed by Serhiy Storchaka in :gh:`106307`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2071 +#: ../../whatsnew/3.13.rst:2123 msgid "" -"Add the :c:func:`PyObject_GetOptionalAttr` and :c:func:" -"`PyObject_GetOptionalAttrString` functions as alternatives to :c:func:" -"`PyObject_GetAttr` and :c:func:`PyObject_GetAttrString` respectively. The " -"new functions do not raise :exc:`AttributeError` if the requested attribute " -"is not found on the object. These variants are more convenient and faster if " -"the missing attribute should not be treated as a failure. (Contributed by " -"Serhiy Storchaka in :gh:`106521`.)" +"Add the :c:func:`PyObject_GetOptionalAttr` " +"and :c:func:`PyObject_GetOptionalAttrString` functions as alternatives " +"to :c:func:`PyObject_GetAttr` and :c:func:`PyObject_GetAttrString` " +"respectively. The new functions do not raise :exc:`AttributeError` if the " +"requested attribute is not found on the object. These variants are more " +"convenient and faster if the missing attribute should not be treated as a " +"failure. (Contributed by Serhiy Storchaka in :gh:`106521`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2081 +#: ../../whatsnew/3.13.rst:2133 msgid "" -"Add the :c:func:`PyErr_FormatUnraisable` function as an extension to :c:func:" -"`PyErr_WriteUnraisable` that allows customizing the warning message. " -"(Contributed by Serhiy Storchaka in :gh:`108082`.)" +"Add the :c:func:`PyErr_FormatUnraisable` function as an extension " +"to :c:func:`PyErr_WriteUnraisable` that allows customizing the warning " +"message. (Contributed by Serhiy Storchaka in :gh:`108082`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2086 +#: ../../whatsnew/3.13.rst:2138 msgid "" -"Add new functions that return a :term:`strong reference` instead of a :term:" -"`borrowed reference` for frame locals, globals, and builtins, as part of :" -"ref:`PEP 667 `:" +"Add new functions that return a :term:`strong reference` instead of " +"a :term:`borrowed reference` for frame locals, globals, and builtins, as " +"part of :ref:`PEP 667 `:" msgstr "" -#: ../../whatsnew/3.13.rst:2090 +#: ../../whatsnew/3.13.rst:2142 msgid ":c:func:`PyEval_GetFrameBuiltins` replaces :c:func:`PyEval_GetBuiltins`" msgstr ":c:func:`PyEval_GetFrameBuiltins` 取代 :c:func:`PyEval_GetBuiltins`" -#: ../../whatsnew/3.13.rst:2091 +#: ../../whatsnew/3.13.rst:2143 msgid ":c:func:`PyEval_GetFrameGlobals` replaces :c:func:`PyEval_GetGlobals`" msgstr ":c:func:`PyEval_GetFrameGlobals` 取代 :c:func:`PyEval_GetGlobals`" -#: ../../whatsnew/3.13.rst:2092 +#: ../../whatsnew/3.13.rst:2144 msgid ":c:func:`PyEval_GetFrameLocals` replaces :c:func:`PyEval_GetLocals`" msgstr ":c:func:`PyEval_GetFrameLocals` 取代 :c:func:`PyEval_GetLocals`" -#: ../../whatsnew/3.13.rst:2094 +#: ../../whatsnew/3.13.rst:2146 msgid "(Contributed by Mark Shannon and Tian Gao in :gh:`74929`.)" msgstr "(由 Mark Shannon 和 Tian Gao 在 :gh:`74929` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2096 +#: ../../whatsnew/3.13.rst:2148 msgid "" "Add the :c:func:`Py_GetConstant` and :c:func:`Py_GetConstantBorrowed` " "functions to get :term:`strong ` or :term:`borrowed " @@ -4051,43 +4186,44 @@ msgid "" "constant zero. (Contributed by Victor Stinner in :gh:`115754`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2103 +#: ../../whatsnew/3.13.rst:2155 msgid "" -"Add the :c:func:`PyImport_AddModuleRef` function as a replacement for :c:" -"func:`PyImport_AddModule` that returns a :term:`strong reference` instead of " -"a :term:`borrowed reference`. (Contributed by Victor Stinner in :gh:" -"`105922`.)" +"Add the :c:func:`PyImport_AddModuleRef` function as a replacement " +"for :c:func:`PyImport_AddModule` that returns a :term:`strong reference` " +"instead of a :term:`borrowed reference`. (Contributed by Victor Stinner " +"in :gh:`105922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2108 +#: ../../whatsnew/3.13.rst:2160 msgid "" "Add the :c:func:`Py_IsFinalizing` function to check whether the main Python " "interpreter is :term:`shutting down `. (Contributed by " "Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2113 +#: ../../whatsnew/3.13.rst:2165 msgid "" -"Add the :c:func:`PyList_GetItemRef` function as a replacement for :c:func:" -"`PyList_GetItem` that returns a :term:`strong reference` instead of a :term:" -"`borrowed reference`. (Contributed by Sam Gross in :gh:`114329`.)" +"Add the :c:func:`PyList_GetItemRef` function as a replacement " +"for :c:func:`PyList_GetItem` that returns a :term:`strong reference` instead " +"of a :term:`borrowed reference`. (Contributed by Sam Gross in :gh:`114329`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2118 +#: ../../whatsnew/3.13.rst:2170 msgid "" "Add the :c:func:`PyList_Extend` and :c:func:`PyList_Clear` functions, " "mirroring the Python :meth:`!list.extend` and :meth:`!list.clear` methods. " "(Contributed by Victor Stinner in :gh:`111138`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2122 +#: ../../whatsnew/3.13.rst:2174 msgid "" -"Add the :c:func:`PyLong_AsInt` function. It behaves similarly to :c:func:" -"`PyLong_AsLong`, but stores the result in a C :c:expr:`int` instead of a C :" -"c:expr:`long`. (Contributed by Victor Stinner in :gh:`108014`.)" +"Add the :c:func:`PyLong_AsInt` function. It behaves similarly " +"to :c:func:`PyLong_AsLong`, but stores the result in a C :c:expr:`int` " +"instead of a C :c:expr:`long`. (Contributed by Victor Stinner " +"in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2127 +#: ../../whatsnew/3.13.rst:2179 msgid "" "Add the :c:func:`PyLong_AsNativeBytes`, :c:func:`PyLong_FromNativeBytes`, " "and :c:func:`PyLong_FromUnsignedNativeBytes` functions to simplify " @@ -4095,36 +4231,38 @@ msgid "" "(Contributed by Steve Dower in :gh:`111140`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2133 +#: ../../whatsnew/3.13.rst:2185 msgid "" -"Add :c:func:`PyModule_Add` function, which is similar to :c:func:" -"`PyModule_AddObjectRef` and :c:func:`PyModule_AddObject`, but always steals " -"a reference to the value. (Contributed by Serhiy Storchaka in :gh:`86493`.)" +"Add :c:func:`PyModule_Add` function, which is similar " +"to :c:func:`PyModule_AddObjectRef` and :c:func:`PyModule_AddObject`, but " +"always steals a reference to the value. (Contributed by Serhiy Storchaka " +"in :gh:`86493`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2138 +#: ../../whatsnew/3.13.rst:2190 msgid "" "Add the :c:func:`PyObject_GenericHash` function that implements the default " -"hashing function of a Python object. (Contributed by Serhiy Storchaka in :gh:" -"`113024`.)" +"hashing function of a Python object. (Contributed by Serhiy Storchaka " +"in :gh:`113024`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2142 +#: ../../whatsnew/3.13.rst:2194 msgid "" "Add the :c:func:`Py_HashPointer` function to hash a raw pointer. " "(Contributed by Victor Stinner in :gh:`111545`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2145 +#: ../../whatsnew/3.13.rst:2197 msgid "" -"Add the :c:func:`PyObject_VisitManagedDict` and :c:func:" -"`PyObject_ClearManagedDict` functions. which must be called by the traverse " -"and clear functions of a type using the :c:macro:`Py_TPFLAGS_MANAGED_DICT` " -"flag. The `pythoncapi-compat project`_ can be used to use these functions " -"with Python 3.11 and 3.12. (Contributed by Victor Stinner in :gh:`107073`.)" +"Add the :c:func:`PyObject_VisitManagedDict` " +"and :c:func:`PyObject_ClearManagedDict` functions. which must be called by " +"the traverse and clear functions of a type using " +"the :c:macro:`Py_TPFLAGS_MANAGED_DICT` flag. The `pythoncapi-compat " +"project`_ can be used to use these functions with Python 3.11 and 3.12. " +"(Contributed by Victor Stinner in :gh:`107073`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2153 +#: ../../whatsnew/3.13.rst:2205 msgid "" "Add the :c:func:`PyRefTracer_SetTracer` and :c:func:`PyRefTracer_GetTracer` " "functions, which enable tracking object creation and destruction in the same " @@ -4132,14 +4270,14 @@ msgid "" "in :gh:`93502`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2159 +#: ../../whatsnew/3.13.rst:2211 msgid "" -"Add the :c:func:`PySys_AuditTuple` function as an alternative to :c:func:" -"`PySys_Audit` that takes event arguments as a Python :class:`tuple` object. " -"(Contributed by Victor Stinner in :gh:`85283`.)" +"Add the :c:func:`PySys_AuditTuple` function as an alternative " +"to :c:func:`PySys_Audit` that takes event arguments as a " +"Python :class:`tuple` object. (Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2164 +#: ../../whatsnew/3.13.rst:2216 msgid "" "Add the :c:func:`PyThreadState_GetUnchecked()` function as an alternative " "to :c:func:`PyThreadState_Get()` that doesn't kill the process with a fatal " @@ -4147,219 +4285,219 @@ msgid "" "result is ``NULL``. (Contributed by Victor Stinner in :gh:`108867`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2170 +#: ../../whatsnew/3.13.rst:2222 msgid "" "Add the :c:func:`PyType_GetFullyQualifiedName` function to get the type's " -"fully qualified name. The module name is prepended if :attr:`type." -"__module__` is a string and is not equal to either ``'builtins'`` or " -"``'__main__'``. (Contributed by Victor Stinner in :gh:`111696`.)" +"fully qualified name. The module name is prepended " +"if :attr:`type.__module__` is a string and is not equal to either " +"``'builtins'`` or ``'__main__'``. (Contributed by Victor Stinner " +"in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2176 +#: ../../whatsnew/3.13.rst:2228 msgid "" "Add the :c:func:`PyType_GetModuleName` function to get the type's module " "name. This is equivalent to getting the :attr:`type.__module__` attribute. " "(Contributed by Eric Snow and Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2181 +#: ../../whatsnew/3.13.rst:2233 msgid "" -"Add the :c:func:`PyUnicode_EqualToUTF8AndSize` and :c:func:" -"`PyUnicode_EqualToUTF8` functions to compare a Unicode object with a :c:expr:" -"`const char*` UTF-8 encoded string and ``1`` if they are equal or ``0`` " -"otherwise. These functions do not raise exceptions. (Contributed by Serhiy " -"Storchaka in :gh:`110289`.)" +"Add the :c:func:`PyUnicode_EqualToUTF8AndSize` " +"and :c:func:`PyUnicode_EqualToUTF8` functions to compare a Unicode object " +"with a :c:expr:`const char*` UTF-8 encoded string and ``1`` if they are " +"equal or ``0`` otherwise. These functions do not raise exceptions. " +"(Contributed by Serhiy Storchaka in :gh:`110289`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2188 +#: ../../whatsnew/3.13.rst:2240 msgid "" -"Add the :c:func:`PyWeakref_GetRef` function as an alternative to :c:func:" -"`PyWeakref_GetObject` that returns a :term:`strong reference` or ``NULL`` if " -"the referent is no longer live. (Contributed by Victor Stinner in :gh:" -"`105927`.)" +"Add the :c:func:`PyWeakref_GetRef` function as an alternative " +"to :c:func:`PyWeakref_GetObject` that returns a :term:`strong reference` or " +"``NULL`` if the referent is no longer live. (Contributed by Victor Stinner " +"in :gh:`105927`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2194 +#: ../../whatsnew/3.13.rst:2246 msgid "Add fixed variants of functions which silently ignore errors:" msgstr "" -#: ../../whatsnew/3.13.rst:2196 +#: ../../whatsnew/3.13.rst:2248 msgid "" ":c:func:`PyObject_HasAttrWithError` replaces :c:func:`PyObject_HasAttr`." msgstr ":c:func:`PyObject_HasAttrWithError` 取代 :c:func:`PyObject_HasAttr`。" -#: ../../whatsnew/3.13.rst:2197 +#: ../../whatsnew/3.13.rst:2249 msgid "" -":c:func:`PyObject_HasAttrStringWithError` replaces :c:func:" -"`PyObject_HasAttrString`." +":c:func:`PyObject_HasAttrStringWithError` " +"replaces :c:func:`PyObject_HasAttrString`." msgstr "" -":c:func:`PyObject_HasAttrStringWithError` 取代 :c:func:" -"`PyObject_HasAttrString`。" +":c:func:`PyObject_HasAttrStringWithError` 取" +"代 :c:func:`PyObject_HasAttrString`。" -#: ../../whatsnew/3.13.rst:2199 +#: ../../whatsnew/3.13.rst:2251 msgid "" ":c:func:`PyMapping_HasKeyWithError` replaces :c:func:`PyMapping_HasKey`." msgstr ":c:func:`PyMapping_HasKeyWithError` 取代 :c:func:`PyMapping_HasKey`。" -#: ../../whatsnew/3.13.rst:2200 +#: ../../whatsnew/3.13.rst:2252 msgid "" -":c:func:`PyMapping_HasKeyStringWithError` replaces :c:func:" -"`PyMapping_HasKeyString`." +":c:func:`PyMapping_HasKeyStringWithError` " +"replaces :c:func:`PyMapping_HasKeyString`." msgstr "" -":c:func:`PyMapping_HasKeyStringWithError` 取代 :c:func:" -"`PyMapping_HasKeyString`。" +":c:func:`PyMapping_HasKeyStringWithError` 取" +"代 :c:func:`PyMapping_HasKeyString`。" -#: ../../whatsnew/3.13.rst:2203 +#: ../../whatsnew/3.13.rst:2255 msgid "" "The new functions return ``-1`` for errors and the standard ``1`` for true " "and ``0`` for false." msgstr "" -#: ../../whatsnew/3.13.rst:2206 +#: ../../whatsnew/3.13.rst:2258 msgid "(Contributed by Serhiy Storchaka in :gh:`108511`.)" msgstr "(由 Serhiy Storchaka 在 :gh:`108511` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2210 +#: ../../whatsnew/3.13.rst:2262 msgid "Changed C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2212 +#: ../../whatsnew/3.13.rst:2264 msgid "" -"The *keywords* parameter of :c:func:`PyArg_ParseTupleAndKeywords` and :c:" -"func:`PyArg_VaParseTupleAndKeywords` now has type :c:expr:`char * const *` " -"in C and :c:expr:`const char * const *` in C++, instead of :c:expr:`char " -"**`. In C++, this makes these functions compatible with arguments of type :c:" -"expr:`const char * const *`, :c:expr:`const char **`, or :c:expr:`char * " -"const *` without an explicit type cast. In C, the functions only support " -"arguments of type :c:expr:`char * const *`. This can be overridden with the :" -"c:macro:`PY_CXX_CONST` macro. (Contributed by Serhiy Storchaka in :gh:" -"`65210`.)" +"The *keywords* parameter of :c:func:`PyArg_ParseTupleAndKeywords` " +"and :c:func:`PyArg_VaParseTupleAndKeywords` now has type :c:expr:`char * " +"const *` in C and :c:expr:`const char * const *` in C++, instead " +"of :c:expr:`char **`. In C++, this makes these functions compatible with " +"arguments of type :c:expr:`const char * const *`, :c:expr:`const char **`, " +"or :c:expr:`char * const *` without an explicit type cast. In C, the " +"functions only support arguments of type :c:expr:`char * const *`. This can " +"be overridden with the :c:macro:`PY_CXX_CONST` macro. (Contributed by Serhiy " +"Storchaka in :gh:`65210`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2224 +#: ../../whatsnew/3.13.rst:2276 msgid "" ":c:func:`PyArg_ParseTupleAndKeywords` now supports non-ASCII keyword " "parameter names. (Contributed by Serhiy Storchaka in :gh:`110815`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2228 +#: ../../whatsnew/3.13.rst:2280 msgid "" "The :c:func:`!PyCode_GetFirstFree` function is now unstable API and is now " "named :c:func:`PyUnstable_Code_GetFirstFree`. (Contributed by Bogdan " "Romanyuk in :gh:`115781`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2232 +#: ../../whatsnew/3.13.rst:2284 msgid "" -"The :c:func:`PyDict_GetItem`, :c:func:`PyDict_GetItemString`, :c:func:" -"`PyMapping_HasKey`, :c:func:`PyMapping_HasKeyString`, :c:func:" -"`PyObject_HasAttr`, :c:func:`PyObject_HasAttrString`, and :c:func:" -"`PySys_GetObject` functions, each of which clears all errors which occurred " -"when calling them now reports these errors using :func:`sys.unraisablehook`. " -"You may replace them with other functions as recommended in the " -"documentation. (Contributed by Serhiy Storchaka in :gh:`106672`.)" +"The :c:func:`PyDict_GetItem`, :c:func:`PyDict_GetItemString`, :c:func:`PyMapping_HasKey`, :c:func:`PyMapping_HasKeyString`, :c:func:`PyObject_HasAttr`, :c:func:`PyObject_HasAttrString`, " +"and :c:func:`PySys_GetObject` functions, each of which clears all errors " +"which occurred when calling them now reports these errors " +"using :func:`sys.unraisablehook`. You may replace them with other functions " +"as recommended in the documentation. (Contributed by Serhiy Storchaka " +"in :gh:`106672`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2241 +#: ../../whatsnew/3.13.rst:2293 msgid "" -"Add support for the ``%T``, ``%#T``, ``%N`` and ``%#N`` formats to :c:func:" -"`PyUnicode_FromFormat`:" +"Add support for the ``%T``, ``%#T``, ``%N`` and ``%#N`` formats " +"to :c:func:`PyUnicode_FromFormat`:" msgstr "" -#: ../../whatsnew/3.13.rst:2244 +#: ../../whatsnew/3.13.rst:2296 msgid "``%T``: Get the fully qualified name of an object type" msgstr "" -#: ../../whatsnew/3.13.rst:2245 +#: ../../whatsnew/3.13.rst:2297 msgid "``%#T``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2246 +#: ../../whatsnew/3.13.rst:2298 msgid "``%N``: Get the fully qualified name of a type" msgstr "" -#: ../../whatsnew/3.13.rst:2247 +#: ../../whatsnew/3.13.rst:2299 msgid "``%#N``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2249 +#: ../../whatsnew/3.13.rst:2301 msgid "" -"See :pep:`737` for more information. (Contributed by Victor Stinner in :gh:" -"`111696`.)" +"See :pep:`737` for more information. (Contributed by Victor Stinner " +"in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2252 +#: ../../whatsnew/3.13.rst:2304 msgid "" "You no longer have to define the ``PY_SSIZE_T_CLEAN`` macro before " "including :file:`Python.h` when using ``#`` formats in :ref:`format codes " "`. APIs accepting the format codes always " -"use ``Py_ssize_t`` for ``#`` formats. (Contributed by Inada Naoki in :gh:" -"`104922`.)" +"use ``Py_ssize_t`` for ``#`` formats. (Contributed by Inada Naoki " +"in :gh:`104922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2258 +#: ../../whatsnew/3.13.rst:2310 msgid "" "If Python is built in :ref:`debug mode ` or :option:`with " -"assertions <--with-assertions>`, :c:func:`PyTuple_SET_ITEM` and :c:func:" -"`PyList_SET_ITEM` now check the index argument with an assertion. " -"(Contributed by Victor Stinner in :gh:`106168`.)" +"assertions <--with-assertions>`, :c:func:`PyTuple_SET_ITEM` " +"and :c:func:`PyList_SET_ITEM` now check the index argument with an " +"assertion. (Contributed by Victor Stinner in :gh:`106168`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2266 +#: ../../whatsnew/3.13.rst:2318 msgid "Limited C API Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2268 +#: ../../whatsnew/3.13.rst:2320 msgid "The following functions are now included in the Limited C API:" msgstr "" -#: ../../whatsnew/3.13.rst:2270 +#: ../../whatsnew/3.13.rst:2322 msgid ":c:func:`PyMem_RawMalloc`" msgstr ":c:func:`PyMem_RawMalloc`" -#: ../../whatsnew/3.13.rst:2271 +#: ../../whatsnew/3.13.rst:2323 msgid ":c:func:`PyMem_RawCalloc`" msgstr ":c:func:`PyMem_RawCalloc`" -#: ../../whatsnew/3.13.rst:2272 +#: ../../whatsnew/3.13.rst:2324 msgid ":c:func:`PyMem_RawRealloc`" msgstr ":c:func:`PyMem_RawRealloc`" -#: ../../whatsnew/3.13.rst:2273 +#: ../../whatsnew/3.13.rst:2325 msgid ":c:func:`PyMem_RawFree`" msgstr ":c:func:`PyMem_RawFree`" -#: ../../whatsnew/3.13.rst:2274 +#: ../../whatsnew/3.13.rst:2326 msgid ":c:func:`PySys_Audit`" msgstr ":c:func:`PySys_Audit`" -#: ../../whatsnew/3.13.rst:2275 +#: ../../whatsnew/3.13.rst:2327 msgid ":c:func:`PySys_AuditTuple`" msgstr ":c:func:`PySys_AuditTuple`" -#: ../../whatsnew/3.13.rst:2276 +#: ../../whatsnew/3.13.rst:2328 msgid ":c:func:`PyType_GetModuleByDef`" msgstr ":c:func:`PyType_GetModuleByDef`" -#: ../../whatsnew/3.13.rst:2278 +#: ../../whatsnew/3.13.rst:2330 msgid "" -"(Contributed by Victor Stinner in :gh:`85283`, :gh:`85283`, and :gh:" -"`116936`.)" +"(Contributed by Victor Stinner in :gh:`85283`, :gh:`85283`, " +"and :gh:`116936`.)" msgstr "" "(由 Victor Stinner 貢獻於 :gh:`85283`、:gh:`85283` 和 :gh:`116936`。)" -#: ../../whatsnew/3.13.rst:2280 +#: ../../whatsnew/3.13.rst:2332 msgid "" "Python built with :option:`--with-trace-refs` (tracing references) now " "supports the :ref:`Limited API `. (Contributed by Victor " "Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2286 +#: ../../whatsnew/3.13.rst:2338 msgid "Removed C APIs" msgstr "移除的 C API" -#: ../../whatsnew/3.13.rst:2288 +#: ../../whatsnew/3.13.rst:2340 msgid "" "Remove several functions, macros, variables, etc with names prefixed by " "``_Py`` or ``_PY`` (which are considered private). If your project is " @@ -4369,30 +4507,30 @@ msgid "" "Victor Stinner. (Contributed by Victor Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2296 +#: ../../whatsnew/3.13.rst:2348 msgid "" -"Remove old buffer protocols deprecated in Python 3.0. Use :ref:" -"`bufferobjects` instead." +"Remove old buffer protocols deprecated in Python 3.0. " +"Use :ref:`bufferobjects` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2299 +#: ../../whatsnew/3.13.rst:2351 msgid "" ":c:func:`!PyObject_CheckReadBuffer`: Use :c:func:`PyObject_CheckBuffer` to " -"test whether the object supports the buffer protocol. Note that :c:func:" -"`PyObject_CheckBuffer` doesn't guarantee that :c:func:`PyObject_GetBuffer` " -"will succeed. To test if the object is actually readable, see the next " -"example of :c:func:`PyObject_GetBuffer`." +"test whether the object supports the buffer protocol. Note " +"that :c:func:`PyObject_CheckBuffer` doesn't guarantee " +"that :c:func:`PyObject_GetBuffer` will succeed. To test if the object is " +"actually readable, see the next example of :c:func:`PyObject_GetBuffer`." msgstr "" -#: ../../whatsnew/3.13.rst:2307 +#: ../../whatsnew/3.13.rst:2359 msgid "" -":c:func:`!PyObject_AsCharBuffer`, :c:func:`!PyObject_AsReadBuffer`: Use :c:" -"func:`PyObject_GetBuffer` and :c:func:`PyBuffer_Release` instead:" +":c:func:`!PyObject_AsCharBuffer`, :c:func:`!PyObject_AsReadBuffer`: " +"Use :c:func:`PyObject_GetBuffer` and :c:func:`PyBuffer_Release` instead:" msgstr "" -":c:func:`!PyObject_AsCharBuffer`、:c:func:`!PyObject_AsReadBuffer`:請改用 :" -"c:func:`PyObject_GetBuffer` 和 :c:func:`PyBuffer_Release`。" +":c:func:`!PyObject_AsCharBuffer`、:c:func:`!PyObject_AsReadBuffer`:請改" +"用 :c:func:`PyObject_GetBuffer` 和 :c:func:`PyBuffer_Release`。" -#: ../../whatsnew/3.13.rst:2310 +#: ../../whatsnew/3.13.rst:2362 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_SIMPLE) < 0) {\n" @@ -4403,15 +4541,15 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2320 +#: ../../whatsnew/3.13.rst:2372 msgid "" -":c:func:`!PyObject_AsWriteBuffer`: Use :c:func:`PyObject_GetBuffer` and :c:" -"func:`PyBuffer_Release` instead:" +":c:func:`!PyObject_AsWriteBuffer`: Use :c:func:`PyObject_GetBuffer` " +"and :c:func:`PyBuffer_Release` instead:" msgstr "" -":c:func:`!PyObject_AsWriteBuffer`:請改用 :c:func:`PyObject_GetBuffer` 和 :c:" -"func:`PyBuffer_Release`。" +":c:func:`!PyObject_AsWriteBuffer`:請改用 :c:func:`PyObject_GetBuffer` " +"和 :c:func:`PyBuffer_Release`。" -#: ../../whatsnew/3.13.rst:2323 +#: ../../whatsnew/3.13.rst:2375 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_WRITABLE) < 0) {\n" @@ -4421,123 +4559,123 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2332 +#: ../../whatsnew/3.13.rst:2384 msgid "(Contributed by Inada Naoki in :gh:`85275`.)" msgstr "(由 Inada Naoki 貢獻於 :gh:`85275`。)" -#: ../../whatsnew/3.13.rst:2334 +#: ../../whatsnew/3.13.rst:2386 msgid "Remove various functions deprecated in Python 3.9:" msgstr "" -#: ../../whatsnew/3.13.rst:2336 +#: ../../whatsnew/3.13.rst:2388 msgid "" -":c:func:`!PyEval_CallObject`, :c:func:`!PyEval_CallObjectWithKeywords`: Use :" -"c:func:`PyObject_CallNoArgs` or :c:func:`PyObject_Call` instead." +":c:func:`!PyEval_CallObject`, :c:func:`!PyEval_CallObjectWithKeywords`: " +"Use :c:func:`PyObject_CallNoArgs` or :c:func:`PyObject_Call` instead." msgstr "" ":c:func:`!PyEval_CallObject`、:c:func:`!PyEval_CallObjectWithKeywords`:請改" "用 :c:func:`PyObject_CallNoArgs` 或 :c:func:`PyObject_Call`。" -#: ../../whatsnew/3.13.rst:2341 +#: ../../whatsnew/3.13.rst:2393 msgid "" "In :c:func:`PyObject_Call`, positional arguments must be a :class:`tuple` " "and must not be ``NULL``, and keyword arguments must be a :class:`dict` or " "``NULL``, whereas the removed functions checked argument types and accepted " "``NULL`` positional and keyword arguments. To replace " -"``PyEval_CallObjectWithKeywords(func, NULL, kwargs)`` with :c:func:" -"`PyObject_Call`, pass an empty tuple as positional arguments using :c:func:" -"`PyTuple_New(0) `." +"``PyEval_CallObjectWithKeywords(func, NULL, kwargs)`` " +"with :c:func:`PyObject_Call`, pass an empty tuple as positional arguments " +"using :c:func:`PyTuple_New(0) `." msgstr "" -#: ../../whatsnew/3.13.rst:2351 +#: ../../whatsnew/3.13.rst:2403 msgid "" ":c:func:`!PyEval_CallFunction`: Use :c:func:`PyObject_CallFunction` instead." msgstr "" ":c:func:`!PyEval_CallFunction`:請改用 :c:func:`PyObject_CallFunction`。" -#: ../../whatsnew/3.13.rst:2353 +#: ../../whatsnew/3.13.rst:2405 msgid "" ":c:func:`!PyEval_CallMethod`: Use :c:func:`PyObject_CallMethod` instead." msgstr ":c:func:`!PyEval_CallMethod`:請改用 :c:func:`PyObject_CallMethod`。" -#: ../../whatsnew/3.13.rst:2355 +#: ../../whatsnew/3.13.rst:2407 msgid ":c:func:`!PyCFunction_Call`: Use :c:func:`PyObject_Call` instead." msgstr ":c:func:`!PyCFunction_Call`:請改用 :c:func:`PyCFunction_Call`。" -#: ../../whatsnew/3.13.rst:2358 +#: ../../whatsnew/3.13.rst:2410 msgid "(Contributed by Victor Stinner in :gh:`105107`.)" msgstr "(由 Victor Stinner 貢獻於 :gh:`105107`。)" -#: ../../whatsnew/3.13.rst:2360 +#: ../../whatsnew/3.13.rst:2412 msgid "" "Remove the following old functions to configure the Python initialization, " "deprecated in Python 3.11:" msgstr "" -#: ../../whatsnew/3.13.rst:2363 +#: ../../whatsnew/3.13.rst:2415 msgid "" ":c:func:`!PySys_AddWarnOptionUnicode`: Use :c:member:`PyConfig.warnoptions` " "instead." msgstr "" -":c:func:`!PySys_AddWarnOptionUnicode`:請改用 :c:member:`PyConfig." -"warnoptions`。" +":c:func:`!PySys_AddWarnOptionUnicode`:請改" +"用 :c:member:`PyConfig.warnoptions`。" -#: ../../whatsnew/3.13.rst:2365 +#: ../../whatsnew/3.13.rst:2417 msgid "" ":c:func:`!PySys_AddWarnOption`: Use :c:member:`PyConfig.warnoptions` instead." msgstr "" ":c:func:`!PySys_AddWarnOption`:請改用 :c:member:`PyConfig.warnoptions`。" -#: ../../whatsnew/3.13.rst:2367 +#: ../../whatsnew/3.13.rst:2419 msgid ":c:func:`!PySys_AddXOption`: Use :c:member:`PyConfig.xoptions` instead." msgstr ":c:func:`!PySys_AddXOption`:請改用 :c:member:`PyConfig.xoptions`。" -#: ../../whatsnew/3.13.rst:2369 +#: ../../whatsnew/3.13.rst:2421 msgid "" ":c:func:`!PySys_HasWarnOptions`: Use :c:member:`PyConfig.xoptions` instead." msgstr "" ":c:func:`!PySys_HasWarnOptions`:請改用 :c:member:`PyConfig.xoptions`。" -#: ../../whatsnew/3.13.rst:2371 +#: ../../whatsnew/3.13.rst:2423 msgid "" ":c:func:`!PySys_SetPath`: Set :c:member:`PyConfig.module_search_paths` " "instead." msgstr "" ":c:func:`!PySys_SetPath`:請改用 :c:member:`PyConfig.module_search_paths`。" -#: ../../whatsnew/3.13.rst:2373 +#: ../../whatsnew/3.13.rst:2425 msgid "" ":c:func:`!Py_SetPath`: Set :c:member:`PyConfig.module_search_paths` instead." msgstr "" ":c:func:`!Py_SetPath`:請改用 :c:member:`PyConfig.module_search_paths`。" -#: ../../whatsnew/3.13.rst:2375 +#: ../../whatsnew/3.13.rst:2427 msgid "" -":c:func:`!Py_SetStandardStreamEncoding`: Set :c:member:`PyConfig." -"stdio_encoding` instead, and set also maybe :c:member:`PyConfig." -"legacy_windows_stdio` (on Windows)." +":c:func:`!Py_SetStandardStreamEncoding`: " +"Set :c:member:`PyConfig.stdio_encoding` instead, and set also " +"maybe :c:member:`PyConfig.legacy_windows_stdio` (on Windows)." msgstr "" -":c:func:`!Py_SetStandardStreamEncoding`:請改用 :c:member:`PyConfig." -"stdio_encoding` 並設定可能的 :c:member:`PyConfig.legacy_windows_stdio`\\ " -"(在 Windows 上)。" +":c:func:`!Py_SetStandardStreamEncoding`:請改" +"用 :c:member:`PyConfig.stdio_encoding` 並設定可能" +"的 :c:member:`PyConfig.legacy_windows_stdio`\\ (在 Windows 上)。" -#: ../../whatsnew/3.13.rst:2378 +#: ../../whatsnew/3.13.rst:2430 msgid "" ":c:func:`!_Py_SetProgramFullPath`: Set :c:member:`PyConfig.executable` " "instead." msgstr "" ":c:func:`!_Py_SetProgramFullPath`:請改用 :c:member:`PyConfig.executable`。" -#: ../../whatsnew/3.13.rst:2381 +#: ../../whatsnew/3.13.rst:2433 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration ` instead (:pep:`587`), added to Python 3.8. " "(Contributed by Victor Stinner in :gh:`105145`.)" msgstr "" "請改用 :ref:`Python 初始化設定 `\\ 的新 :c:type:`PyConfig` API " -"(:pep:`587`),這是在 Python 3.8 中新增的。(由 Victor Stinner 於 :gh:" -"`105145` 貢獻。)" +"(:pep:`587`),這是在 Python 3.8 中新增的。(由 Victor Stinner " +"於 :gh:`105145` 貢獻。)" -#: ../../whatsnew/3.13.rst:2385 +#: ../../whatsnew/3.13.rst:2437 msgid "" "Remove :c:func:`!PyEval_AcquireLock` and :c:func:`!PyEval_ReleaseLock` " "functions, deprecated in Python 3.2. They didn't update the current thread " @@ -4547,25 +4685,25 @@ msgstr "" "些函式在 Python 3.2 中已被廢棄。它們不會更新目前的執行緒狀態。可以用以下函式" "取代:" -#: ../../whatsnew/3.13.rst:2390 +#: ../../whatsnew/3.13.rst:2442 msgid ":c:func:`PyEval_SaveThread` and :c:func:`PyEval_RestoreThread`;" msgstr ":c:func:`PyEval_SaveThread` 和 :c:func:`PyEval_RestoreThread`;" -#: ../../whatsnew/3.13.rst:2391 +#: ../../whatsnew/3.13.rst:2443 msgid "" "low-level :c:func:`PyEval_AcquireThread` and :c:func:`PyEval_RestoreThread`;" msgstr "" "低階的 :c:func:`PyEval_AcquireThread` 和 :c:func:`PyEval_RestoreThread`;" -#: ../../whatsnew/3.13.rst:2392 +#: ../../whatsnew/3.13.rst:2444 msgid "or :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`." msgstr "或 :c:func:`PyGILState_Ensure` 與 :c:func:`PyGILState_Release`。" -#: ../../whatsnew/3.13.rst:2394 +#: ../../whatsnew/3.13.rst:2446 msgid "(Contributed by Victor Stinner in :gh:`105182`.)" msgstr "(由 Victor Stinner 貢獻於 :gh:`105182`。)" -#: ../../whatsnew/3.13.rst:2396 +#: ../../whatsnew/3.13.rst:2448 msgid "" "Remove the :c:func:`!PyEval_ThreadsInitialized` function, deprecated in " "Python 3.9. Since Python 3.7, :c:func:`!Py_Initialize` always creates the " @@ -4574,37 +4712,37 @@ msgid "" "Stinner in :gh:`105182`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2403 +#: ../../whatsnew/3.13.rst:2455 msgid "" -"Remove the :c:func:`!_PyInterpreterState_Get` alias to :c:func:" -"`PyInterpreterState_Get()` which was kept for backward compatibility with " -"Python 3.8. The `pythoncapi-compat project`_ can be used to get :c:func:" -"`PyInterpreterState_Get()` on Python 3.8 and older. (Contributed by Victor " -"Stinner in :gh:`106320`.)" +"Remove the :c:func:`!_PyInterpreterState_Get` alias " +"to :c:func:`PyInterpreterState_Get()` which was kept for backward " +"compatibility with Python 3.8. The `pythoncapi-compat project`_ can be used " +"to get :c:func:`PyInterpreterState_Get()` on Python 3.8 and older. " +"(Contributed by Victor Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2410 +#: ../../whatsnew/3.13.rst:2462 msgid "" "Remove the private :c:func:`!_PyObject_FastCall` function: use :c:func:`!" "PyObject_Vectorcall` which is available since Python 3.8 (:pep:`590`). " "(Contributed by Victor Stinner in :gh:`106023`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2415 +#: ../../whatsnew/3.13.rst:2467 msgid "" "Remove the ``cpython/pytime.h`` header file, which only contained private " "functions. (Contributed by Victor Stinner in :gh:`106316`.)" msgstr "" -"移除只包含私有函式的 ``cpython/pytime.h`` 標頭檔。(由 Victor Stinner 於 :gh:" -"`106316` 貢獻。)" +"移除只包含私有函式的 ``cpython/pytime.h`` 標頭檔。(由 Victor Stinner " +"於 :gh:`106316` 貢獻。)" -#: ../../whatsnew/3.13.rst:2419 +#: ../../whatsnew/3.13.rst:2471 msgid "" "Remove the undocumented ``PY_TIMEOUT_MAX`` constant from the limited C API. " "(Contributed by Victor Stinner in :gh:`110014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2422 +#: ../../whatsnew/3.13.rst:2474 msgid "" "Remove the old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " "``Py_TRASHCAN_SAFE_END``. Replace both with the new macros " @@ -4612,97 +4750,99 @@ msgid "" "in :gh:`105111`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2429 +#: ../../whatsnew/3.13.rst:2481 msgid "Deprecated C APIs" msgstr "器用的 C API" -#: ../../whatsnew/3.13.rst:2431 +#: ../../whatsnew/3.13.rst:2483 msgid "Deprecate old Python initialization functions:" msgstr "" -#: ../../whatsnew/3.13.rst:2433 +#: ../../whatsnew/3.13.rst:2485 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:13 msgid "" ":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" "warnings.filters` instead." msgstr "" -":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` 和 :" -"data:`!warnings.filters`。" +":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` " +"和 :data:`!warnings.filters`。" -#: ../../whatsnew/3.13.rst:2435 +#: ../../whatsnew/3.13.rst:2487 msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." msgstr ":c:func:`Py_GetExecPrefix`:請改用 :data:`sys.exec_prefix`。" -#: ../../whatsnew/3.13.rst:2437 +#: ../../whatsnew/3.13.rst:2489 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." msgstr ":c:func:`Py_GetPath`:請改用 :data:`sys.path`。" -#: ../../whatsnew/3.13.rst:2439 +#: ../../whatsnew/3.13.rst:2491 msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." msgstr ":c:func:`Py_GetPrefix`:請改用 :data:`sys.prefix`。" -#: ../../whatsnew/3.13.rst:2441 +#: ../../whatsnew/3.13.rst:2493 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:21 msgid ":c:func:`Py_GetProgramFullPath`: Get :data:`sys.executable` instead." msgstr ":c:func:`Py_GetProgramFullPath`:請改用 :data:`sys.executable`。" -#: ../../whatsnew/3.13.rst:2443 +#: ../../whatsnew/3.13.rst:2495 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:23 msgid ":c:func:`Py_GetProgramName`: Get :data:`sys.executable` instead." msgstr ":c:func:`Py_GetProgramName`:請改用 :data:`sys.executable`。" -#: ../../whatsnew/3.13.rst:2445 +#: ../../whatsnew/3.13.rst:2497 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:25 msgid "" -":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:" -"`PYTHONHOME` environment variable instead." +":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or " +"the :envvar:`PYTHONHOME` environment variable instead." msgstr "" -":c:func:`Py_GetPythonHome`:請改用 :c:member:`PyConfig.home` 或 :envvar:" -"`PYTHONHOME` 環境變數。" +":c:func:`Py_GetPythonHome`:請改用 :c:member:`PyConfig.home` " +"或 :envvar:`PYTHONHOME` 環境變數。" -#: ../../whatsnew/3.13.rst:2449 +#: ../../whatsnew/3.13.rst:2501 msgid "(Contributed by Victor Stinner in :gh:`105145`.)" msgstr "(由 Victor Stinner 在 :gh:`105145` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2451 +#: ../../whatsnew/3.13.rst:2503 msgid "" -":term:`Soft deprecate ` the :c:func:`PyEval_GetBuiltins`, :" -"c:func:`PyEval_GetGlobals`, and :c:func:`PyEval_GetLocals` functions, which " -"return a :term:`borrowed reference`. (Soft deprecated as part of :pep:`667`.)" +":term:`Soft deprecate ` " +"the :c:func:`PyEval_GetBuiltins`, :c:func:`PyEval_GetGlobals`, " +"and :c:func:`PyEval_GetLocals` functions, which return a :term:`borrowed " +"reference`. (Soft deprecated as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2457 +#: ../../whatsnew/3.13.rst:2509 msgid "" "Deprecate the :c:func:`PyImport_ImportModuleNoBlock` function, which is just " "an alias to :c:func:`PyImport_ImportModule` since Python 3.3. (Contributed " "by Victor Stinner in :gh:`105396`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2461 +#: ../../whatsnew/3.13.rst:2513 msgid "" ":term:`Soft deprecate ` the :c:func:`PyModule_AddObject` " -"function. It should be replaced with :c:func:`PyModule_Add` or :c:func:" -"`PyModule_AddObjectRef`. (Contributed by Serhiy Storchaka in :gh:`86493`.)" +"function. It should be replaced with :c:func:`PyModule_Add` " +"or :c:func:`PyModule_AddObjectRef`. (Contributed by Serhiy Storchaka " +"in :gh:`86493`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2467 +#: ../../whatsnew/3.13.rst:2519 msgid "" -"Deprecate the old ``Py_UNICODE`` and ``PY_UNICODE_TYPE`` types and the :c:" -"macro:`!Py_UNICODE_WIDE` define. Use the :c:type:`wchar_t` type directly " -"instead. Since Python 3.3, ``Py_UNICODE`` and ``PY_UNICODE_TYPE`` are just " -"aliases to :c:type:`!wchar_t`. (Contributed by Victor Stinner in :gh:" -"`105156`.)" +"Deprecate the old ``Py_UNICODE`` and ``PY_UNICODE_TYPE`` types and " +"the :c:macro:`!Py_UNICODE_WIDE` define. Use the :c:type:`wchar_t` type " +"directly instead. Since Python 3.3, ``Py_UNICODE`` and ``PY_UNICODE_TYPE`` " +"are just aliases to :c:type:`!wchar_t`. (Contributed by Victor Stinner " +"in :gh:`105156`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2474 +#: ../../whatsnew/3.13.rst:2526 msgid "" -"Deprecate the :c:func:`PyWeakref_GetObject` and :c:func:" -"`PyWeakref_GET_OBJECT` functions, which return a :term:`borrowed reference`. " -"Replace them with the new :c:func:`PyWeakref_GetRef` function, which returns " -"a :term:`strong reference`. The `pythoncapi-compat project`_ can be used to " -"get :c:func:`PyWeakref_GetRef` on Python 3.12 and older. (Contributed by " -"Victor Stinner in :gh:`105927`.)" +"Deprecate the :c:func:`PyWeakref_GetObject` " +"and :c:func:`PyWeakref_GET_OBJECT` functions, which return a :term:`borrowed " +"reference`. Replace them with the new :c:func:`PyWeakref_GetRef` function, " +"which returns a :term:`strong reference`. The `pythoncapi-compat project`_ " +"can be used to get :c:func:`PyWeakref_GetRef` on Python 3.12 and older. " +"(Contributed by Victor Stinner in :gh:`105927`.)" msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:4 @@ -4710,16 +4850,16 @@ msgid "" "The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " "(:pep:`699`; :gh:`101193`)." msgstr "" -":c:type:`PyDictObject` 中的 ``ma_version_tag`` 欄位,用於擴充模組 (:pep:" -"`699`;:gh:`101193`)。" +":c:type:`PyDictObject` 中的 ``ma_version_tag`` 欄位,用於擴充模組 " +"(:pep:`699`;:gh:`101193`)。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:7 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases (:gh:`95388`)." msgstr "" -"使用可變基底建立\\ :c:data:`不可變型別 ` (:gh:" -"`95388`)。" +"使用可變基底建立\\ :c:data:`不可變型別 ` " +"(:gh:`95388`)。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:10 msgid "" @@ -4749,8 +4889,8 @@ msgstr ":c:func:`!Py_SetPythonHome()`:請改以 :c:member:`PyConfig.home` 設 #: ../../deprecations/c-api-pending-removal-in-3.14.rst:21 #: ../../deprecations/c-api-pending-removal-in-3.14.rst:71 msgid "" -"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" -"`PyConfig` instead." +"The :c:func:`Py_InitializeFromConfig` API should be used " +"with :c:type:`PyConfig` instead." msgstr "" ":c:func:`Py_InitializeFromConfig` API 應該與 :c:type:`PyConfig` 一起使用。" @@ -4807,24 +4947,24 @@ msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` " "instead." msgstr "" -":c:var:`Py_IgnoreEnvironmentFlag`:請改用 :c:member:`PyConfig." -"use_environment`。" +":c:var:`Py_IgnoreEnvironmentFlag`:請改" +"用 :c:member:`PyConfig.use_environment`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:46 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` " "instead." msgstr "" -":c:var:`Py_DontWriteBytecodeFlag`:請改用 :c:member:`PyConfig." -"write_bytecode`。" +":c:var:`Py_DontWriteBytecodeFlag`:請改" +"用 :c:member:`PyConfig.write_bytecode`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:48 msgid "" -":c:var:`Py_NoUserSiteDirectory`: Use :c:member:`PyConfig." -"user_site_directory` instead." +":c:var:`Py_NoUserSiteDirectory`: " +"Use :c:member:`PyConfig.user_site_directory` instead." msgstr "" -":c:var:`Py_NoUserSiteDirectory`:請改用 :c:member:`PyConfig." -"user_site_directory`。" +":c:var:`Py_NoUserSiteDirectory`:請改" +"用 :c:member:`PyConfig.user_site_directory`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:50 msgid "" @@ -4847,51 +4987,51 @@ msgstr ":c:var:`Py_IsolatedFlag`:請改用 :c:member:`PyConfig.isolated`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:57 msgid "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use :c:member:`PyPreConfig." -"legacy_windows_fs_encoding` instead." +":c:var:`Py_LegacyWindowsFSEncodingFlag`: " +"Use :c:member:`PyPreConfig.legacy_windows_fs_encoding` instead." msgstr "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改用 :c:member:`PyPreConfig." -"legacy_windows_fs_encoding`。" +":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改" +"用 :c:member:`PyPreConfig.legacy_windows_fs_encoding`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:59 msgid "" -":c:var:`Py_LegacyWindowsStdioFlag`: Use :c:member:`PyConfig." -"legacy_windows_stdio` instead." +":c:var:`Py_LegacyWindowsStdioFlag`: " +"Use :c:member:`PyConfig.legacy_windows_stdio` instead." msgstr "" -":c:var:`Py_LegacyWindowsStdioFlag`:請改用 :c:member:`PyConfig." -"legacy_windows_stdio`。" +":c:var:`Py_LegacyWindowsStdioFlag`:請改" +"用 :c:member:`PyConfig.legacy_windows_stdio`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:61 msgid "" -":c:var:`!Py_FileSystemDefaultEncoding`: Use :c:member:`PyConfig." -"filesystem_encoding` instead." +":c:var:`!Py_FileSystemDefaultEncoding`: " +"Use :c:member:`PyConfig.filesystem_encoding` instead." msgstr "" -":c:var:`!Py_FileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." -"filesystem_encoding`。" +":c:var:`!Py_FileSystemDefaultEncoding`:請改" +"用 :c:member:`PyConfig.filesystem_encoding`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:63 msgid "" -":c:var:`!Py_HasFileSystemDefaultEncoding`: Use :c:member:`PyConfig." -"filesystem_encoding` instead." +":c:var:`!Py_HasFileSystemDefaultEncoding`: " +"Use :c:member:`PyConfig.filesystem_encoding` instead." msgstr "" -":c:var:`!Py_HasFileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." -"filesystem_encoding`。" +":c:var:`!Py_HasFileSystemDefaultEncoding`:請改" +"用 :c:member:`PyConfig.filesystem_encoding`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:65 msgid "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use :c:member:`PyConfig." -"filesystem_errors` instead." +":c:var:`!Py_FileSystemDefaultEncodeErrors`: " +"Use :c:member:`PyConfig.filesystem_errors` instead." msgstr "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改用 :c:member:`PyConfig." -"filesystem_errors`。" +":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改" +"用 :c:member:`PyConfig.filesystem_errors`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:67 msgid "" -":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` instead. (see :" -"c:func:`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` instead. " +"(see :c:func:`Py_PreInitialize`)" msgstr "" -":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode`。(請見 :c:" -"func:`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode`。(請" +"見 :c:func:`Py_PreInitialize`)" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:4 msgid "The bundled copy of ``libmpdecimal``." @@ -4899,27 +5039,27 @@ msgstr "``libmpdecimal`` 的打包副本 (bundled copy)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:5 msgid "" -"The :c:func:`PyImport_ImportModuleNoBlock`: Use :c:func:" -"`PyImport_ImportModule` instead." +"The :c:func:`PyImport_ImportModuleNoBlock`: " +"Use :c:func:`PyImport_ImportModule` instead." msgstr "" -":c:func:`PyImport_ImportModuleNoBlock`:請改用 :c:func:" -"`PyImport_ImportModule`。" +":c:func:`PyImport_ImportModuleNoBlock`:請改" +"用 :c:func:`PyImport_ImportModule`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:7 msgid "" -":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:" -"func:`PyWeakref_GetRef` instead." +":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: " +"Use :c:func:`PyWeakref_GetRef` instead." msgstr "" -":c:func:`PyWeakref_GetObject` 和 :c:func:`PyWeakref_GET_OBJECT`:請改用 :c:" -"func:`PyWeakref_GetRef`。" +":c:func:`PyWeakref_GetObject` 和 :c:func:`PyWeakref_GET_OBJECT`:請改" +"用 :c:func:`PyWeakref_GetRef`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:9 msgid "" -":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use :c:" -"type:`wchar_t` instead." +":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: " +"Use :c:type:`wchar_t` instead." msgstr "" -":c:type:`Py_UNICODE` 型別與 :c:macro:`!Py_UNICODE_WIDE` 巨集:請改用 :c:type:" -"`wchar_t`。" +":c:type:`Py_UNICODE` 型別與 :c:macro:`!Py_UNICODE_WIDE` 巨集:請改" +"用 :c:type:`wchar_t`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:11 msgid "Python initialization functions:" @@ -4927,19 +5067,19 @@ msgstr "Python 初始化函式:" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 msgid "" -":c:func:`Py_GetExecPrefix`: Get :data:`sys.base_exec_prefix` and :data:`sys." -"exec_prefix` instead." +":c:func:`Py_GetExecPrefix`: Get :data:`sys.base_exec_prefix` " +"and :data:`sys.exec_prefix` instead." msgstr "" -":c:func:`Py_GetExecPrefix`:請改用 :data:`sys.base_exec_prefix` 與 :data:" -"`sys.exec_prefix`。" +":c:func:`Py_GetExecPrefix`:請改用 :data:`sys.base_exec_prefix` " +"與 :data:`sys.exec_prefix`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:19 msgid "" ":c:func:`Py_GetPrefix`: Get :data:`sys.base_prefix` and :data:`sys.prefix` " "instead." msgstr "" -":c:func:`Py_GetPrefix`:請改用 :data:`sys.base_prefix` 與 :data:`sys." -"prefix`。" +":c:func:`Py_GetPrefix`:請改用 :data:`sys.base_prefix` " +"與 :data:`sys.prefix`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:4 msgid "" @@ -4960,8 +5100,8 @@ msgid "" ":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` " "instead." msgstr "" -":c:func:`PyErr_NormalizeException`:請改用 :c:func:" -"`PyErr_GetRaisedException`。" +":c:func:`PyErr_NormalizeException`:請改" +"用 :c:func:`PyErr_GetRaisedException`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:13 msgid "" @@ -4981,11 +5121,11 @@ msgstr ":c:func:`PyOS_AfterFork`:請改用 :c:func:`PyOS_AfterFork_Child`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:19 msgid "" -":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and :c:func:" -"`PySlice_AdjustIndices` instead." +":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` " +"and :c:func:`PySlice_AdjustIndices` instead." msgstr "" -":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` 和 :c:func:" -"`PySlice_AdjustIndices`。" +":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` " +"和 :c:func:`PySlice_AdjustIndices`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:21 msgid "" @@ -5031,8 +5171,8 @@ msgid "" ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " "instead." msgstr "" -":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼叫 :c:func:" -"`PyObject_Hash`。" +":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼" +"叫 :c:func:`PyObject_Hash`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:37 msgid ":c:member:`!PyDictObject.ma_version_tag` member." @@ -5072,56 +5212,57 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" -#: ../../whatsnew/3.13.rst:2494 +#: ../../whatsnew/3.13.rst:2546 msgid "Build Changes" msgstr "建置變更" -#: ../../whatsnew/3.13.rst:2496 +#: ../../whatsnew/3.13.rst:2548 msgid "" "``arm64-apple-ios`` and ``arm64-apple-ios-simulator`` are both now :pep:`11` " "tier 3 platforms. (:ref:`PEP 730 ` written and " "implementation contributed by Russell Keith-Magee in :gh:`114099`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2501 +#: ../../whatsnew/3.13.rst:2553 msgid "" -"``aarch64-linux-android`` and ``x86_64-linux-android`` are both now :pep:" -"`11` tier 3 platforms. (:ref:`PEP 738 ` " -"written and implementation contributed by Malcolm Smith in :gh:`116622`.)" +"``aarch64-linux-android`` and ``x86_64-linux-android`` are both " +"now :pep:`11` tier 3 platforms. (:ref:`PEP 738 ` written and implementation contributed by Malcolm Smith " +"in :gh:`116622`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2506 +#: ../../whatsnew/3.13.rst:2558 msgid "" "``wasm32-wasi`` is now a :pep:`11` tier 2 platform. (Contributed by Brett " "Cannon in :gh:`115192`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2509 +#: ../../whatsnew/3.13.rst:2561 msgid "" "``wasm32-emscripten`` is no longer a :pep:`11` supported platform. " "(Contributed by Brett Cannon in :gh:`115192`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2512 +#: ../../whatsnew/3.13.rst:2564 msgid "" "Building CPython now requires a compiler with support for the C11 atomic " "library, GCC built-in atomic functions, or MSVC interlocked intrinsics." msgstr "" -#: ../../whatsnew/3.13.rst:2515 +#: ../../whatsnew/3.13.rst:2567 msgid "" -"Autoconf 2.71 and aclocal 1.16.5 are now required to regenerate the :file:" -"`configure` script. (Contributed by Christian Heimes in :gh:`89886` and by " -"Victor Stinner in :gh:`112090`.)" +"Autoconf 2.71 and aclocal 1.16.5 are now required to regenerate " +"the :file:`configure` script. (Contributed by Christian Heimes " +"in :gh:`89886` and by Victor Stinner in :gh:`112090`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2519 +#: ../../whatsnew/3.13.rst:2571 msgid "" "SQLite 3.15.2 or newer is required to build the :mod:`sqlite3` extension " "module. (Contributed by Erlend Aasland in :gh:`105875`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2523 +#: ../../whatsnew/3.13.rst:2575 msgid "" "CPython now bundles the `mimalloc library`_ by default. It is licensed under " "the MIT license; see :ref:`mimalloc license `. The bundled " @@ -5129,58 +5270,59 @@ msgid "" "Dino Viehland in :gh:`109914`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2531 +#: ../../whatsnew/3.13.rst:2583 msgid "" "The :file:`configure` option :option:`--with-system-libmpdec` now defaults " "to ``yes``. The bundled copy of ``libmpdecimal`` will be removed in Python " "3.15." msgstr "" -#: ../../whatsnew/3.13.rst:2535 +#: ../../whatsnew/3.13.rst:2587 msgid "" "Python built with :file:`configure` :option:`--with-trace-refs` (tracing " -"references) is now ABI compatible with the Python release build and :ref:" -"`debug build `. (Contributed by Victor Stinner in :gh:`108634`.)" +"references) is now ABI compatible with the Python release build " +"and :ref:`debug build `. (Contributed by Victor Stinner " +"in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2540 +#: ../../whatsnew/3.13.rst:2592 msgid "" "On POSIX systems, the pkg-config (``.pc``) filenames now include the ABI " "flags. For example, the free-threaded build generates ``python-3.13t.pc`` " "and the debug build generates ``python-3.13d.pc``." msgstr "" -#: ../../whatsnew/3.13.rst:2544 +#: ../../whatsnew/3.13.rst:2596 msgid "" "The ``errno``, ``fcntl``, ``grp``, ``md5``, ``pwd``, ``resource``, " -"``termios``, ``winsound``, ``_ctypes_test``, ``_multiprocessing." -"posixshmem``, ``_scproxy``, ``_stat``, ``_statistics``, ``_testconsole``, " -"``_testimportmultiple`` and ``_uuid`` C extensions are now built with the :" -"ref:`limited C API `. (Contributed by Victor Stinner in :gh:" -"`85283`.)" +"``termios``, ``winsound``, ``_ctypes_test``, " +"``_multiprocessing.posixshmem``, ``_scproxy``, ``_stat``, ``_statistics``, " +"``_testconsole``, ``_testimportmultiple`` and ``_uuid`` C extensions are now " +"built with the :ref:`limited C API `. (Contributed by Victor " +"Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2553 +#: ../../whatsnew/3.13.rst:2605 msgid "Porting to Python 3.13" msgstr "移植至 Python 3.13" -#: ../../whatsnew/3.13.rst:2555 +#: ../../whatsnew/3.13.rst:2607 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.13.rst:2559 +#: ../../whatsnew/3.13.rst:2611 msgid "Changes in the Python API" msgstr "Python API 的變更" -#: ../../whatsnew/3.13.rst:2563 +#: ../../whatsnew/3.13.rst:2615 msgid "" ":ref:`PEP 667 ` introduces several changes to " "the semantics of :func:`locals` and :attr:`f_locals `:" msgstr "" -#: ../../whatsnew/3.13.rst:2566 +#: ../../whatsnew/3.13.rst:2618 msgid "" "Calling :func:`locals` in an :term:`optimized scope` now produces an " "independent snapshot on each call, and hence no longer implicitly updates " @@ -5192,7 +5334,7 @@ msgid "" "scope. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2575 +#: ../../whatsnew/3.13.rst:2627 msgid "" "Calling :func:`locals` from a comprehension at module or class scope " "(including via ``exec`` or ``eval``) once more behaves as if the " @@ -5202,7 +5344,7 @@ msgid "" "implementing :pep:`709`. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2582 +#: ../../whatsnew/3.13.rst:2634 msgid "" "Accessing :attr:`FrameType.f_locals ` in an :term:`optimized " "scope` now returns a write-through proxy rather than a snapshot that gets " @@ -5211,22 +5353,22 @@ msgid "" "of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2588 +#: ../../whatsnew/3.13.rst:2640 msgid "" ":class:`functools.partial` now emits a :exc:`FutureWarning` when used as a " -"method. The behavior will change in future Python versions. Wrap it in :func:" -"`staticmethod` if you want to preserve the old behavior. (Contributed by " -"Serhiy Storchaka in :gh:`121027`.)" +"method. The behavior will change in future Python versions. Wrap it " +"in :func:`staticmethod` if you want to preserve the old behavior. " +"(Contributed by Serhiy Storchaka in :gh:`121027`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2594 +#: ../../whatsnew/3.13.rst:2646 msgid "" "An :exc:`OSError` is now raised by :func:`getpass.getuser` for any failure " "to retrieve a username, instead of :exc:`ImportError` on non-Unix platforms " "or :exc:`KeyError` on Unix platforms where the password database is empty." msgstr "" -#: ../../whatsnew/3.13.rst:2599 +#: ../../whatsnew/3.13.rst:2651 msgid "" "The value of the :attr:`!mode` attribute of :class:`gzip.GzipFile` is now a " "string (``'rb'`` or ``'wb'``) instead of an integer (``1`` or ``2``). The " @@ -5235,13 +5377,13 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`115961`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2605 +#: ../../whatsnew/3.13.rst:2657 msgid "" ":class:`mailbox.Maildir` now ignores files with a leading dot (``.``). " "(Contributed by Zackery Spytz in :gh:`65559`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2608 +#: ../../whatsnew/3.13.rst:2660 msgid "" ":meth:`pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` now return both " "files and directories if a pattern that ends with \"``**``\" is given, " @@ -5249,45 +5391,45 @@ msgid "" "behavior and only match directories." msgstr "" -#: ../../whatsnew/3.13.rst:2613 +#: ../../whatsnew/3.13.rst:2665 msgid "" "The :mod:`threading` module now expects the :mod:`!_thread` module to have " "an :func:`!_is_main_interpreter` function. This function takes no arguments " "and returns ``True`` if the current interpreter is the main interpreter." msgstr "" -#: ../../whatsnew/3.13.rst:2618 +#: ../../whatsnew/3.13.rst:2670 msgid "" "Any library or application that provides a custom :mod:`!_thread` module " "must provide :func:`!_is_main_interpreter`, just like the module's other " "\"private\" attributes. (:gh:`112826`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2625 +#: ../../whatsnew/3.13.rst:2677 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.13.rst:2627 +#: ../../whatsnew/3.13.rst:2679 msgid "" "``Python.h`` no longer includes the ```` standard header. It was " "included for the :c:func:`!finite` function which is now provided by the " "```` header. It should now be included explicitly if needed. Remove " -"also the ``HAVE_IEEEFP_H`` macro. (Contributed by Victor Stinner in :gh:" -"`108765`.)" +"also the ``HAVE_IEEEFP_H`` macro. (Contributed by Victor Stinner " +"in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2633 +#: ../../whatsnew/3.13.rst:2685 msgid "" "``Python.h`` no longer includes these standard header files: ````, " "```` and ````. If needed, they should now be " "included explicitly. For example, ```` provides the :c:func:`!clock` " "and :c:func:`!gmtime` functions, ```` provides the :c:func:`!" -"select` function, and ```` provides the :c:func:`!futimes`, :c:" -"func:`!gettimeofday` and :c:func:`!setitimer` functions. (Contributed by " -"Victor Stinner in :gh:`108765`.)" +"select` function, and ```` provides the :c:func:`!" +"futimes`, :c:func:`!gettimeofday` and :c:func:`!setitimer` functions. " +"(Contributed by Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2641 +#: ../../whatsnew/3.13.rst:2693 msgid "" "On Windows, ``Python.h`` no longer includes the ```` standard " "header file. If needed, it should now be included explicitly. For example, " @@ -5297,7 +5439,7 @@ msgid "" "(Contributed by Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2648 +#: ../../whatsnew/3.13.rst:2700 msgid "" "If the :c:macro:`Py_LIMITED_API` macro is defined, :c:macro:`!" "Py_BUILD_CORE`, :c:macro:`!Py_BUILD_CORE_BUILTIN` and :c:macro:`!" @@ -5305,18 +5447,18 @@ msgid "" "(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2653 +#: ../../whatsnew/3.13.rst:2705 msgid "" "The old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " "``Py_TRASHCAN_SAFE_END`` were removed. They should be replaced by the new " "macros ``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``." msgstr "" -#: ../../whatsnew/3.13.rst:2657 +#: ../../whatsnew/3.13.rst:2709 msgid "A ``tp_dealloc`` function that has the old macros, such as::" msgstr "有舊巨集的 ``tp_dealloc`` 函式,例如: ::" -#: ../../whatsnew/3.13.rst:2659 +#: ../../whatsnew/3.13.rst:2711 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -5336,11 +5478,11 @@ msgstr "" " Py_TRASHCAN_SAFE_END\n" "}" -#: ../../whatsnew/3.13.rst:2668 +#: ../../whatsnew/3.13.rst:2720 msgid "should migrate to the new macros as follows::" msgstr "應該改為使用新的巨集,如下所示: ::" -#: ../../whatsnew/3.13.rst:2670 +#: ../../whatsnew/3.13.rst:2722 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -5360,7 +5502,7 @@ msgstr "" " Py_TRASHCAN_END\n" "}" -#: ../../whatsnew/3.13.rst:2679 +#: ../../whatsnew/3.13.rst:2731 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in. The new macros were added in Python 3.8 and " @@ -5368,67 +5510,177 @@ msgid "" "in :gh:`105111`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2686 +#: ../../whatsnew/3.13.rst:2738 msgid "" ":ref:`PEP 667 ` introduces several changes to " "frame-related functions:" msgstr "" -#: ../../whatsnew/3.13.rst:2689 +#: ../../whatsnew/3.13.rst:2741 msgid "" -"The effects of mutating the dictionary returned from :c:func:" -"`PyEval_GetLocals` in an :term:`optimized scope` have changed. New dict " -"entries added this way will now *only* be visible to subsequent :c:func:" -"`PyEval_GetLocals` calls in that frame, as :c:func:`PyFrame_GetLocals`, :" -"func:`locals`, and :attr:`FrameType.f_locals ` no longer " -"access the same underlying cached dictionary. Changes made to entries for " -"actual variable names and names added via the write-through proxy interfaces " -"will be overwritten on subsequent calls to :c:func:`PyEval_GetLocals` in " -"that frame. The recommended code update depends on how the function was " -"being used, so refer to the deprecation notice on the function for details." +"The effects of mutating the dictionary returned " +"from :c:func:`PyEval_GetLocals` in an :term:`optimized scope` have changed. " +"New dict entries added this way will now *only* be visible to " +"subsequent :c:func:`PyEval_GetLocals` calls in that frame, " +"as :c:func:`PyFrame_GetLocals`, :func:`locals`, " +"and :attr:`FrameType.f_locals ` no longer access the same " +"underlying cached dictionary. Changes made to entries for actual variable " +"names and names added via the write-through proxy interfaces will be " +"overwritten on subsequent calls to :c:func:`PyEval_GetLocals` in that frame. " +"The recommended code update depends on how the function was being used, so " +"refer to the deprecation notice on the function for details." msgstr "" -#: ../../whatsnew/3.13.rst:2702 +#: ../../whatsnew/3.13.rst:2754 msgid "" "Calling :c:func:`PyFrame_GetLocals` in an :term:`optimized scope` now " "returns a write-through proxy rather than a snapshot that gets updated at " "ill-specified times. If a snapshot is desired, it must be created explicitly " -"(e.g. with :c:func:`PyDict_Copy`), or by calling the new :c:func:" -"`PyEval_GetFrameLocals` API." +"(e.g. with :c:func:`PyDict_Copy`), or by calling the " +"new :c:func:`PyEval_GetFrameLocals` API." msgstr "" -#: ../../whatsnew/3.13.rst:2709 +#: ../../whatsnew/3.13.rst:2761 msgid "" ":c:func:`!PyFrame_FastToLocals` and :c:func:`!PyFrame_FastToLocalsWithError` " "no longer have any effect. Calling these functions has been redundant since " "Python 3.11, when :c:func:`PyFrame_GetLocals` was first introduced." msgstr "" -#: ../../whatsnew/3.13.rst:2714 +#: ../../whatsnew/3.13.rst:2766 msgid "" ":c:func:`!PyFrame_LocalsToFast` no longer has any effect. Calling this " "function is redundant now that :c:func:`PyFrame_GetLocals` returns a write-" "through proxy for :term:`optimized scopes `." msgstr "" -#: ../../whatsnew/3.13.rst:2719 +#: ../../whatsnew/3.13.rst:2770 +msgid "" +"Python 3.13 removed many private functions. Some of them can be replaced " +"using these alternatives:" +msgstr "" + +#: ../../whatsnew/3.13.rst:2773 +msgid "``_PyDict_Pop()``: :c:func:`PyDict_Pop` or :c:func:`PyDict_PopString`;" +msgstr "" +"``_PyDict_Pop()``::c:func:`PyDict_Pop` 或 :c:func:`PyDict_PopString`;" + +#: ../../whatsnew/3.13.rst:2774 +msgid "``_PyDict_GetItemWithError()``: :c:func:`PyDict_GetItemRef`;" +msgstr "``_PyDict_GetItemWithError()``::c:func:`PyDict_GetItemRef`;" + +#: ../../whatsnew/3.13.rst:2775 +msgid "``_PyErr_WriteUnraisableMsg()``: :c:func:`PyErr_FormatUnraisable`;" +msgstr "``_PyErr_WriteUnraisableMsg()``::c:func:`PyErr_FormatUnraisable`;" + +#: ../../whatsnew/3.13.rst:2776 +msgid "" +"``_PyEval_SetTrace()``: :c:func:`PyEval_SetTrace` " +"or :c:func:`PyEval_SetTraceAllThreads`;" +msgstr "" +"``_PyEval_SetTrace()``::c:func:`PyEval_SetTrace` " +"或 :c:func:`PyEval_SetTraceAllThreads`;" + +#: ../../whatsnew/3.13.rst:2777 +msgid "``_PyList_Extend()``: :c:func:`PyList_Extend`;" +msgstr "``_PyList_Extend()``::c:func:`PyList_Extend`;" + +#: ../../whatsnew/3.13.rst:2778 +msgid "``_PyLong_AsInt()``: :c:func:`PyLong_AsInt`;" +msgstr "``_PyLong_AsInt()``::c:func:`PyLong_AsInt`;" + +#: ../../whatsnew/3.13.rst:2779 +msgid "``_PyMem_RawStrdup()``: ``strdup()``;" +msgstr "``_PyMem_RawStrdup()``:``strdup()``;" + +#: ../../whatsnew/3.13.rst:2780 +msgid "``_PyMem_Strdup()``: ``strdup()``;" +msgstr "``_PyMem_Strdup()``:``strdup()``;" + +#: ../../whatsnew/3.13.rst:2781 +msgid "``_PyObject_ClearManagedDict()``: :c:func:`PyObject_ClearManagedDict`;" +msgstr "``_PyObject_ClearManagedDict()``::c:func:`PyObject_ClearManagedDict`;" + +#: ../../whatsnew/3.13.rst:2782 +msgid "``_PyObject_VisitManagedDict()``: :c:func:`PyObject_VisitManagedDict`;" +msgstr "``_PyObject_VisitManagedDict()``::c:func:`PyObject_VisitManagedDict`;" + +#: ../../whatsnew/3.13.rst:2783 +msgid "``_PyThreadState_UncheckedGet()``: :c:func:`PyThreadState_GetUnchecked()`;" +msgstr "``_PyThreadState_UncheckedGet()``::c:func:`PyThreadState_GetUnchecked()`;" + +#: ../../whatsnew/3.13.rst:2784 +msgid "``_PyTime_AsSecondsDouble()``: :c:func:`PyTime_AsSecondsDouble`;" +msgstr "``_PyTime_AsSecondsDouble()``::c:func:`PyTime_AsSecondsDouble`;" + +#: ../../whatsnew/3.13.rst:2785 +msgid "" +"``_PyTime_GetMonotonicClock()``: :c:func:`PyTime_Monotonic` " +"or :c:func:`PyTime_MonotonicRaw`;" +msgstr "" +"``_PyTime_GetMonotonicClock()``::c:func:`PyTime_Monotonic` " +"或 :c:func:`PyTime_MonotonicRaw`;" + +#: ../../whatsnew/3.13.rst:2786 +msgid "" +"``_PyTime_GetPerfCounter()``: :c:func:`PyTime_PerfCounter` " +"or :c:func:`PyTime_PerfCounterRaw`;" +msgstr "" +"``_PyTime_GetPerfCounter()``::c:func:`PyTime_PerfCounter` " +"或 :c:func:`PyTime_PerfCounterRaw`;" + +#: ../../whatsnew/3.13.rst:2787 +msgid "" +"``_PyTime_GetSystemClock()``: :c:func:`PyTime_Time` " +"or :c:func:`PyTime_TimeRaw`;" +msgstr "" +"``_PyTime_GetSystemClock()``::c:func:`PyTime_Time` " +"或 :c:func:`PyTime_TimeRaw`;" + +#: ../../whatsnew/3.13.rst:2788 +msgid "``_PyTime_MAX``: :c:var:`PyTime_MAX`;" +msgstr "``_PyTime_MAX``::c:var:`PyTime_MAX`;" + +#: ../../whatsnew/3.13.rst:2789 +msgid "``_PyTime_MIN``: :c:var:`PyTime_MIN`;" +msgstr "``_PyTime_MIN``::c:var:`PyTime_MIN`;" + +#: ../../whatsnew/3.13.rst:2790 +msgid "``_PyTime_t``: :c:type:`PyTime_t`;" +msgstr "``_PyTime_t``::c:type:`PyTime_t`;" + +#: ../../whatsnew/3.13.rst:2791 +msgid "``_Py_HashPointer()``: :c:func:`Py_HashPointer`;" +msgstr "``_Py_HashPointer()``::c:func:`Py_HashPointer`;" + +#: ../../whatsnew/3.13.rst:2792 +msgid "``_Py_IsFinalizing()``: :c:func:`Py_IsFinalizing`." +msgstr "``_Py_IsFinalizing()``::c:func:`Py_IsFinalizing`。" + +#: ../../whatsnew/3.13.rst:2794 +msgid "" +"The `pythoncapi-compat project`_ can be used to get most of these new " +"functions on Python 3.12 and older." +msgstr "" + +#: ../../whatsnew/3.13.rst:2798 msgid "Regression Test Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2721 +#: ../../whatsnew/3.13.rst:2800 msgid "" -"Python built with :file:`configure` :option:`--with-pydebug` now supports a :" -"option:`-X presite=package.module <-X>` command-line option. If used, it " +"Python built with :file:`configure` :option:`--with-pydebug` now supports " +"a :option:`-X presite=package.module <-X>` command-line option. If used, it " "specifies a module that should be imported early in the lifecycle of the " "interpreter, before ``site.py`` is executed. (Contributed by Łukasz Langa " "in :gh:`110769`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2729 +#: ../../whatsnew/3.13.rst:2808 msgid "Notable changes in 3.13.1" msgstr "Python 3.13.1 中顯著的變更" -#: ../../whatsnew/3.13.rst:2734 +#: ../../whatsnew/3.13.rst:2813 msgid "" "The previously undocumented special function :func:`sys.getobjects`, which " "only exists in specialized builds of Python, may now return objects from " diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index bd3546dee4..32c61f5ff3 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2025-01-03 00:13+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-" @@ -1942,8 +1942,8 @@ msgstr "``-999999999999999999``" #: ../../whatsnew/3.3.rst:1150 msgid "" -"In the context templates (:class:`~decimal.DefaultContext`, :class:`~decimal." -"BasicContext` and :class:`~decimal.ExtendedContext`) the magnitude of :attr:" +"In the context templates (:const:`~decimal.DefaultContext`, :const:`~decimal." +"BasicContext` and :const:`~decimal.ExtendedContext`) the magnitude of :attr:" "`~decimal.Context.Emax` and :attr:`~decimal.Context.Emin` has changed to " "``999999``." msgstr "" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index 8bdcc0eaaf..2d40afa84d 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-26 00:14+0000\n" +"POT-Creation-Date: 2025-02-05 00:13+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-" @@ -1461,7 +1461,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:997 msgid "" -":mod:`importlib.util` now has a :data:`~importlib.util.MAGIC_NUMBER` " +":mod:`importlib.util` now has a :const:`~importlib.util.MAGIC_NUMBER` " "attribute providing access to the bytecode version number. This replaces " "the :func:`!get_magic` function in the deprecated :mod:`!imp` module. " "(Contributed by Brett Cannon in :issue:`18192`.)" diff --git a/whatsnew/changelog.po b/whatsnew/changelog.po index 62347d8849..bbbdb4ce13 100644 --- a/whatsnew/changelog.po +++ b/whatsnew/changelog.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2025-02-03 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:21+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,6 +20,6 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../whatsnew/changelog.rst:5 +#: ../../whatsnew/changelog.rst:7 msgid "Changelog" msgstr "Changelog(更動日誌)"