From cd67d707212b140012450d2f13c6091b4a05d523 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 8 Feb 2024 00:04:50 +0000 Subject: [PATCH 01/33] sync with cpython 3a67d327 --- c-api/intro.po | 25 ++++++++++++++----------- library/test.po | 7 +++---- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/c-api/intro.po b/c-api/intro.po index c755198b70..113cd116d4 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2024-02-08 00:03+0000\n" "PO-Revision-Date: 2023-04-25 18:01+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -245,9 +245,11 @@ msgstr "" "大小增加)。在成本/收益分析方面,編譯器通常比開發人員更聰明。" #: ../../c-api/intro.rst:151 +#, fuzzy msgid "" -"If Python is :ref:`built in debug mode ` (if the ``Py_DEBUG`` " -"macro is defined), the :c:macro:`Py_ALWAYS_INLINE` macro does nothing." +"If Python is :ref:`built in debug mode ` (if the :c:macro:" +"`Py_DEBUG` macro is defined), the :c:macro:`Py_ALWAYS_INLINE` macro does " +"nothing." msgstr "" "如果 Python 是\\ :ref:`在除錯模式下建置 `\\ (如果 ``Py_DEBUG`` " "巨集有被定義),:c:macro:`Py_ALWAYS_INLINE` 巨集就什麼都不會做。" @@ -1039,14 +1041,15 @@ msgstr "" "錯構置的完整列表,為支援追蹤參照計數、為記憶體分配器除錯或對主直譯器迴圈進行" "低階分析的建置。本節的其餘部分將僅描述最常用的建置。" -#: ../../c-api/intro.rst:815 +#: ../../c-api/intro.rst:817 +#, fuzzy msgid "" -"Compiling the interpreter with the :c:macro:`Py_DEBUG` macro defined " +"Compiling the interpreter with the :c:macro:`!Py_DEBUG` macro defined " "produces what is generally meant by :ref:`a debug build of Python `. :c:macro:`Py_DEBUG` is enabled in the Unix build by adding :option:" +"build>`. :c:macro:`!Py_DEBUG` is enabled in the Unix build by adding :option:" "`--with-pydebug` to the :file:`./configure` command. It is also implied by " -"the presence of the not-Python-specific :c:macro:`_DEBUG` macro. When :c:" -"macro:`Py_DEBUG` is enabled in the Unix build, compiler optimization is " +"the presence of the not-Python-specific :c:macro:`!_DEBUG` macro. When :c:" +"macro:`!Py_DEBUG` is enabled in the Unix build, compiler optimization is " "disabled." msgstr "" "使用定義的 :c:macro:`Py_DEBUG` 巨集編譯直譯器會生成 :ref:`Python 的除錯建置 " @@ -1055,7 +1058,7 @@ msgstr "" "macro:`_DEBUG` 巨集的存在也暗示了這一點。當 :c:macro:`Py_DEBUG` 在 Unix 建置" "中啟用時,編譯器最佳化會被禁用。" -#: ../../c-api/intro.rst:823 +#: ../../c-api/intro.rst:825 msgid "" "In addition to the reference count debugging described below, extra checks " "are performed, see :ref:`Python Debug Build `." @@ -1063,7 +1066,7 @@ msgstr "" "除了下面描述的參照計數除錯之外,還會執行額外的檢查,請參閱 :ref:`Python 除錯" "建置 `。" -#: ../../c-api/intro.rst:826 +#: ../../c-api/intro.rst:828 msgid "" "Defining :c:macro:`Py_TRACE_REFS` enables reference tracing (see the :option:" "`configure --with-trace-refs option <--with-trace-refs>`). When defined, a " @@ -1078,7 +1081,7 @@ msgstr "" "linked list)。全體分配也有被追蹤。退出時將印出所有現行參照。(在交互模式下," "這發生在直譯器運行的每個陳述句之後。)" -#: ../../c-api/intro.rst:833 +#: ../../c-api/intro.rst:835 msgid "" "Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution for more detailed information." diff --git a/library/test.po b/library/test.po index dba179fe77..80b7970795 100644 --- a/library/test.po +++ b/library/test.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-01 00:03+0000\n" +"POT-Creation-Date: 2024-02-08 00:03+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-" @@ -386,9 +386,8 @@ msgstr "" #: ../../library/test.rst:327 msgid "" -"True if Python is built with the :c:macro:`Py_DEBUG` macro defined: if " -"Python is :ref:`built in debug mode ` (:option:`./configure --" -"with-pydebug <--with-pydebug>`)." +"True if Python was built with the :c:macro:`Py_DEBUG` macro defined, that " +"is, if Python was :ref:`built in debug mode `." msgstr "" #: ../../library/test.rst:336 From d403cebe6151b3faf44c5603862965ece5c2d7e9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 9 Feb 2024 00:05:24 +0000 Subject: [PATCH 02/33] sync with cpython 235c54fe --- library/enum.po | 212 +++++++++++++++++++++++++++--------------------- 1 file changed, 118 insertions(+), 94 deletions(-) diff --git a/library/enum.po b/library/enum.po index e963f76171..9e71dc45c9 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 00:03+0000\n" +"POT-Creation-Date: 2024-02-09 00:03+0000\n" "PO-Revision-Date: 2023-09-11 14:08+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -542,11 +542,23 @@ msgstr "一個 *staticmethod*,用來決定 :class:`auto` 下一個要回傳的 #: ../../library/enum.rst:328 msgid "" +"By default, does nothing. If multiple values are given in the member " +"assignment, those values become separate arguments to ``__init__``; e.g." +msgstr "" + +#: ../../library/enum.rst:335 +msgid "" +"``Weekday.__init__()`` would be called as ``Weekday.__init__(self, 1, " +"'Mon')``" +msgstr "" + +#: ../../library/enum.rst:339 +msgid "" "A *classmethod* that is used to further configure subsequent subclasses. By " "default, does nothing." msgstr "一個 *classmethod*,用來進一步設定後續的子類別,預設不做任何事。" -#: ../../library/enum.rst:333 +#: ../../library/enum.rst:344 msgid "" "A *classmethod* for looking up values not found in *cls*. By default it " "does nothing, but can be overridden to implement custom search behavior::" @@ -554,7 +566,19 @@ msgstr "" "一個 *classmethod*,用來查詢在 *cls* 裡找不到的值。預設不做任何事,但可以被覆" "寫以實作客製化的搜尋行為: ::" -#: ../../library/enum.rst:355 +#: ../../library/enum.rst:366 +msgid "" +"By default, doesn't exist. If specified, either in the enum class " +"definition or in a mixin class (such as ``int``), all values given in the " +"member assignment will be passed; e.g." +msgstr "" + +#: ../../library/enum.rst:374 +msgid "" +"results in the call ``int('1a', 16)`` and a value of ``17`` for the member." +msgstr "" + +#: ../../library/enum.rst:378 msgid "" "Returns the string used for *repr()* calls. By default, returns the *Enum* " "name, member name, and value, but can be overridden::" @@ -562,7 +586,7 @@ msgstr "" "回傳呼叫 *repr()* 時使用的字串。預設回傳 *Enum* 名稱、成員名稱及值,但可以被" "覆寫: ::" -#: ../../library/enum.rst:371 +#: ../../library/enum.rst:394 msgid "" "Returns the string used for *str()* calls. By default, returns the *Enum* " "name and member name, but can be overridden::" @@ -570,7 +594,7 @@ msgstr "" "回傳呼叫 *str()* 時使用的字串。預設回傳 *Enum* 名稱及成員名稱,但可以被覆" "寫: ::" -#: ../../library/enum.rst:386 +#: ../../library/enum.rst:409 msgid "" "Returns the string used for *format()* and *f-string* calls. By default, " "returns :meth:`__str__` return value, but can be overridden::" @@ -578,17 +602,17 @@ msgstr "" "回傳呼叫 *format()* 及 *f-string* 時使用的字串。預設回傳 :meth:`__str__` 的回" "傳值,但可以被覆寫: ::" -#: ../../library/enum.rst:401 +#: ../../library/enum.rst:424 msgid "" "Using :class:`auto` with :class:`Enum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`Enum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:404 +#: ../../library/enum.rst:427 msgid "Added :ref:`enum-dataclass-support`" msgstr "新增 :ref:`enum-dataclass-support`" -#: ../../library/enum.rst:409 +#: ../../library/enum.rst:432 msgid "" "*IntEnum* is the same as *Enum*, but its members are also integers and can " "be used anywhere that an integer can be used. If any integer operation is " @@ -598,13 +622,13 @@ msgstr "" "*IntEnum* 和 *Enum* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" "方。如果 *IntEnum* 成員經過任何整數運算,其結果會失去列舉狀態。" -#: ../../library/enum.rst:430 +#: ../../library/enum.rst:453 msgid "" "Using :class:`auto` with :class:`IntEnum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`IntEnum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:433 +#: ../../library/enum.rst:456 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` was " @@ -614,7 +638,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:440 +#: ../../library/enum.rst:463 msgid "" "*StrEnum* is the same as *Enum*, but its members are also strings and can be " "used in most of the same places that a string can be used. The result of " @@ -624,7 +648,7 @@ msgstr "" "*StrEnum* 和 *Enum* 一樣,但其成員同時也是字串而可以被用在幾乎所有使用字串的" "地方。*StrEnum* 成員經過任何字串操作的結果會不再是列舉的一部份。" -#: ../../library/enum.rst:446 +#: ../../library/enum.rst:469 msgid "" "There are places in the stdlib that check for an exact :class:`str` instead " "of a :class:`str` subclass (i.e. ``type(unknown) == str`` instead of " @@ -635,13 +659,13 @@ msgstr "" "是 ``type(unknown) == str`` 而不是 ``isinstance(unknown, str)``),在這些地方" "你需要使用 ``str(StrEnum.member)``。" -#: ../../library/enum.rst:453 +#: ../../library/enum.rst:476 msgid "" "Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " "name as the value." msgstr ":class:`StrEnum` 使用 :class:`auto` 會產生小寫的成員名稱當作值。" -#: ../../library/enum.rst:458 +#: ../../library/enum.rst:481 msgid "" ":meth:`~object.__str__` is :meth:`!str.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` is " @@ -651,52 +675,49 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!str.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 也會是 :meth:`!str.__format__`。" -#: ../../library/enum.rst:466 +#: ../../library/enum.rst:489 +#, fuzzy msgid "" -"*Flag* members support the bitwise operators ``&`` (*AND*), ``|`` (*OR*), " -"``^`` (*XOR*), and ``~`` (*INVERT*); the results of those operators are " -"members of the enumeration." +"``Flag`` is the same as :class:`Enum`, but its members support the bitwise " +"operators ``&`` (*AND*), ``|`` (*OR*), ``^`` (*XOR*), and ``~`` (*INVERT*); " +"the results of those operators are members of the enumeration." msgstr "" "*Flag* 成員支援位元操作 ``&`` (*AND*)、``|`` (*OR*)、``^`` (*XOR*) 及 ``~`` " "(*INVERT*);這些操作的結果會是列舉成員。" -#: ../../library/enum.rst:472 +#: ../../library/enum.rst:495 msgid "Returns *True* if value is in self::" msgstr "如果 value 在 self 裡則回傳 *True*: ::" -#: ../../library/enum.rst:493 +#: ../../library/enum.rst:516 msgid "Returns all contained non-alias members::" msgstr "回傳所有包含的非別名成員: ::" -#: ../../library/enum.rst:502 -msgid "Aliases are no longer returned during iteration." -msgstr "疊代時不會再回傳別名。" - -#: ../../library/enum.rst:506 +#: ../../library/enum.rst:527 msgid "Returns number of members in flag::" msgstr "回傳旗標裡的成員數量: ::" -#: ../../library/enum.rst:515 +#: ../../library/enum.rst:536 msgid "Returns *True* if any members in flag, *False* otherwise::" msgstr "如果成員在旗標裡則回傳 *True*,否則回傳 *False*: ::" -#: ../../library/enum.rst:527 +#: ../../library/enum.rst:548 msgid "Returns current flag binary or'ed with other::" msgstr "回傳和 other 做 OR 過後的二進位旗標: ::" -#: ../../library/enum.rst:534 +#: ../../library/enum.rst:555 msgid "Returns current flag binary and'ed with other::" msgstr "回傳和 other 做 AND 過後的二進位旗標: ::" -#: ../../library/enum.rst:543 +#: ../../library/enum.rst:564 msgid "Returns current flag binary xor'ed with other::" msgstr "回傳和 other 做 XOR 過後的二進位旗標: ::" -#: ../../library/enum.rst:552 +#: ../../library/enum.rst:573 msgid "Returns all the flags in *type(self)* that are not in self::" msgstr "回傳所有在 *type(self)* 但不在 self 裡的旗標: ::" -#: ../../library/enum.rst:563 +#: ../../library/enum.rst:584 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." @@ -704,17 +725,17 @@ msgstr "" "用來格式化任何剩下未命名數值的函式。預設是值的 repr,常見選擇是 :func:`hex` " "和 :func:`oct`。" -#: ../../library/enum.rst:568 +#: ../../library/enum.rst:589 msgid "" "Using :class:`auto` with :class:`Flag` results in integers that are powers " "of two, starting with ``1``." msgstr ":class:`Flag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:571 +#: ../../library/enum.rst:592 msgid "The *repr()* of zero-valued flags has changed. It is now::" msgstr "值為 0 的旗標的 *repr()* 已改變。現在是: ::" -#: ../../library/enum.rst:579 +#: ../../library/enum.rst:600 msgid "" "*IntFlag* is the same as *Flag*, but its members are also integers and can " "be used anywhere that an integer can be used." @@ -722,38 +743,38 @@ msgstr "" "*IntFlag* 和 *Flag* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" "方。" -#: ../../library/enum.rst:593 +#: ../../library/enum.rst:614 msgid "" "If any integer operation is performed with an *IntFlag* member, the result " "is not an *IntFlag*::" msgstr "如果 *IntFlag* 成員經過任何整數運算,其結果不是 *IntFlag*: ::" -#: ../../library/enum.rst:599 +#: ../../library/enum.rst:620 msgid "If a *Flag* operation is performed with an *IntFlag* member and:" msgstr "如果 *IntFlag* 成員經過 *Flag* 操作且:" -#: ../../library/enum.rst:601 +#: ../../library/enum.rst:622 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" msgstr "結果是合法的 *IntFlag*:回傳 *IntFlag*" -#: ../../library/enum.rst:602 +#: ../../library/enum.rst:623 msgid "" "the result is not a valid *IntFlag*: the result depends on the " "*FlagBoundary* setting" msgstr "結果不是合法的 *IntFlag*:結果會根據 *FlagBoundary* 的設定" -#: ../../library/enum.rst:604 +#: ../../library/enum.rst:625 msgid "The *repr()* of unnamed zero-valued flags has changed. It is now:" msgstr "未命名且值為 0 的旗標的 *repr()* 已改變。現在是: ::" -#: ../../library/enum.rst:611 +#: ../../library/enum.rst:632 msgid "" "Using :class:`auto` with :class:`IntFlag` results in integers that are " "powers of two, starting with ``1``." msgstr "" ":class:`IntFlag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:616 +#: ../../library/enum.rst:637 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` " @@ -763,7 +784,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:620 +#: ../../library/enum.rst:641 msgid "" "Inversion of an :class:`!IntFlag` now returns a positive value that is the " "union of all flags not in the given flag, rather than a negative value. This " @@ -772,7 +793,7 @@ msgstr "" ":class:`!IntFlag` 的反轉 (inversion) 現在會回傳正值,該值是不在給定旗標的所有" "旗標聯集,而不是一個負值。這符合現有 :class:`Flag` 的行為。" -#: ../../library/enum.rst:626 +#: ../../library/enum.rst:647 msgid "" ":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" @@ -780,15 +801,15 @@ msgstr "" ":class:`!ReprEnum` 使用 :class:`Enum` 的 :meth:`repr() `,但使" "用混合資料類型的 :class:`str() `:" -#: ../../library/enum.rst:629 +#: ../../library/enum.rst:650 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" msgstr "對 :class:`IntEnum` 和 :class:`IntFlag` 是 :meth:`!int.__str__`" -#: ../../library/enum.rst:630 +#: ../../library/enum.rst:651 msgid ":meth:`!str.__str__` for :class:`StrEnum`" msgstr "對 :class:`StrEnum` 是 :meth:`!str.__str__`" -#: ../../library/enum.rst:632 +#: ../../library/enum.rst:653 msgid "" "Inherit from :class:`!ReprEnum` to keep the :class:`str() ` / :func:" "`format` of the mixed-in data type instead of using the :class:`Enum`-" @@ -797,7 +818,7 @@ msgstr "" "繼承 :class:`!ReprEnum` 來保留混合資料類型的 :class:`str() ` / :func:" "`format`,而不是使用 :class:`Enum` 預設的 :meth:`str() `。" -#: ../../library/enum.rst:641 +#: ../../library/enum.rst:662 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." @@ -805,17 +826,17 @@ msgstr "" "*EnumCheck* 包含 :func:`verify` 裝飾器使用的選項,以確保多樣的限制,不符合限" "制會產生 :exc:`ValueError`。" -#: ../../library/enum.rst:646 +#: ../../library/enum.rst:667 msgid "Ensure that each value has only one name::" msgstr "確保每個值只有一個名稱: ::" -#: ../../library/enum.rst:662 +#: ../../library/enum.rst:683 msgid "" "Ensure that there are no missing values between the lowest-valued member and " "the highest-valued member::" msgstr "確保在最小值成員跟最大值成員間沒有缺少值: ::" -#: ../../library/enum.rst:677 +#: ../../library/enum.rst:698 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`::" @@ -823,35 +844,35 @@ msgstr "" "確保任何旗標群組 / 遮罩只包含命名旗標 -- 當值是用指定而不是透過 :func:`auto` " "產生時是很實用的: ::" -#: ../../library/enum.rst:694 +#: ../../library/enum.rst:715 msgid "" "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." msgstr "CONTINUOUS 和 NAMED_FLAGS 是設計用來運作在整數值的成員上。" -#: ../../library/enum.rst:700 +#: ../../library/enum.rst:721 msgid "" "*FlagBoundary* controls how out-of-range values are handled in *Flag* and " "its subclasses." msgstr "*FlagBoundary* 控制在 *Flag* 及其子類別中如何處理範圍外的值。" -#: ../../library/enum.rst:705 +#: ../../library/enum.rst:726 msgid "" "Out-of-range values cause a :exc:`ValueError` to be raised. This is the " "default for :class:`Flag`::" msgstr "範圍外的值會引發 :exc:`ValueError`。這是 :class:`Flag` 的預設行為: ::" -#: ../../library/enum.rst:723 +#: ../../library/enum.rst:744 msgid "" "Out-of-range values have invalid values removed, leaving a valid *Flag* " "value::" msgstr "範圍外的值會移除非法值,留下合法的 *Flag* 值: ::" -#: ../../library/enum.rst:737 +#: ../../library/enum.rst:758 msgid "" "Out-of-range values lose their *Flag* membership and revert to :class:`int`." msgstr "範圍外的值會失去它們的 *Flag* 成員資格且恢復成 :class:`int`。" -#: ../../library/enum.rst:750 +#: ../../library/enum.rst:771 msgid "" "Out-of-range values are kept, and the *Flag* membership is kept. This is the " "default for :class:`IntFlag`::" @@ -859,11 +880,11 @@ msgstr "" "範圍外的值會被保留,*Flag* 成員資格也會被保留。這是 :class:`IntFlag` 的預設行" "為: ::" -#: ../../library/enum.rst:767 +#: ../../library/enum.rst:788 msgid "Supported ``__dunder__`` names" msgstr "支援 ``__dunder__`` 名稱" -#: ../../library/enum.rst:769 +#: ../../library/enum.rst:790 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." @@ -871,7 +892,7 @@ msgstr "" ":attr:`~EnumType.__members__` 是一個唯讀有序的\\ ``成員名稱``:``成員``\\ 項" "目的對映。只有在類別上可用。" -#: ../../library/enum.rst:772 +#: ../../library/enum.rst:793 msgid "" ":meth:`~object.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`!_value_` " @@ -881,26 +902,26 @@ msgstr "" "的 :attr:`!_value_` 也是一個很好的主意。一旦所有成員都建立之後就不會再被用" "到。" -#: ../../library/enum.rst:778 +#: ../../library/enum.rst:799 msgid "Supported ``_sunder_`` names" msgstr "支援 ``_sunder_`` 名稱" -#: ../../library/enum.rst:780 +#: ../../library/enum.rst:801 msgid "``_name_`` -- name of the member" msgstr "``_name_`` -- 成員名稱" -#: ../../library/enum.rst:781 +#: ../../library/enum.rst:802 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "``_value_`` -- 成員的值;可以在 ``__new__`` 設定或修改" -#: ../../library/enum.rst:783 +#: ../../library/enum.rst:804 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "``_missing_`` -- 當值沒有被找到時會使用的查詢函式;可以被覆寫" -#: ../../library/enum.rst:785 +#: ../../library/enum.rst:806 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " @@ -909,7 +930,7 @@ msgstr "" "``_ignore_`` -- 可以是 :class:`list` 或 :class:`str` 的名稱串列,它不會被轉換" "成成員,且在最後的類別上會被移除" -#: ../../library/enum.rst:788 +#: ../../library/enum.rst:809 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" @@ -917,20 +938,20 @@ msgstr "" "``_order_`` -- 在 Python 2/3 的程式裡用來確保成員順序是一致的(類別屬性,在類" "別建立時移除)" -#: ../../library/enum.rst:790 +#: ../../library/enum.rst:811 msgid "" "``_generate_next_value_`` -- used to get an appropriate value for an enum " "member; may be overridden" msgstr "``_generate_next_value_`` -- 用來為列舉成員取得合適的值;可以被覆寫" -#: ../../library/enum.rst:795 +#: ../../library/enum.rst:816 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" "對標準的 :class:`Enum` 類別來說,下一個被選擇的值是最後一個看見的值加一。" -#: ../../library/enum.rst:798 +#: ../../library/enum.rst:819 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." @@ -938,19 +959,19 @@ msgstr "" "對 :class:`Flag` 類別來說,下一個被選擇的值是下一個最大的 2 的次方,不管最後" "一個看見的值是什麼。" -#: ../../library/enum.rst:801 +#: ../../library/enum.rst:822 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``\\ 、\\ ``_order_``\\ 、\\ ``_generate_next_value_``" -#: ../../library/enum.rst:802 +#: ../../library/enum.rst:823 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:807 +#: ../../library/enum.rst:828 msgid "Utilities and Decorators" msgstr "通用項目與裝飾器" -#: ../../library/enum.rst:811 +#: ../../library/enum.rst:832 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an *Enum*'s :meth:`~Enum._generate_next_value_` to get an appropriate " @@ -966,16 +987,16 @@ msgstr "" "2 的次方的數字;對 *StrEnum* 來說,是成員名稱的小寫版本。如果混用 *auto()* 和" "手動指定值的話要特別注意。" -#: ../../library/enum.rst:819 +#: ../../library/enum.rst:840 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "*auto* 實例只有在最上層的賦值時才會被解析:" -#: ../../library/enum.rst:821 +#: ../../library/enum.rst:842 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "``FIRST = auto()`` 可以運作(auto() 會被取代成 ``1``)" -#: ../../library/enum.rst:822 +#: ../../library/enum.rst:843 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is used to create the ``SECOND`` enum member;" @@ -983,7 +1004,7 @@ msgstr "" "``SECOND = auto(), -2`` 可以運作(auto 會被取代成 ``2``, 因此 ``2, -2`` 會被" "用來建立列舉成員 ``SECOND``;" -#: ../../library/enum.rst:824 +#: ../../library/enum.rst:845 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" @@ -991,19 +1012,19 @@ msgstr "" "``THREE = [auto(), -3]`` *無法*\\ 運作(\\ ``, -3`` 會被用來建立列" "舉成員 ``THREE``)" -#: ../../library/enum.rst:829 +#: ../../library/enum.rst:850 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "在之前的版本中,``auto()`` 必須是賦值行裡的唯一內容才能運作正確。" -#: ../../library/enum.rst:832 +#: ../../library/enum.rst:853 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "可以覆寫 ``_generate_next_value_`` 來客製 *auto* 使用的值。" -#: ../../library/enum.rst:835 +#: ../../library/enum.rst:856 msgid "" "in 3.13 the default ``_generate_next_value_`` will always return the highest " "member value incremented by 1, and will fail if any member is an " @@ -1012,7 +1033,7 @@ msgstr "" "在 3.13 預設 ``_generate_next_value_`` 總是回傳最大的成員值加一,如果任何成員" "是不相容的類型就會失敗。" -#: ../../library/enum.rst:841 +#: ../../library/enum.rst:862 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " @@ -1021,7 +1042,7 @@ msgstr "" "和內建的 *property* 相似的裝飾器,但只專門針對列舉。它允許成員屬性和成員本身" "有相同名稱。" -#: ../../library/enum.rst:845 +#: ../../library/enum.rst:866 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -1031,7 +1052,7 @@ msgstr "" "*屬性*\\ 和成員必須定義在分開的類別裡;例如 *value* 和 *name* 屬性定義在 " "*Enum* 類別而 *Enum* 子類別可以定義成員名稱為 ``value`` 和 ``name``。" -#: ../../library/enum.rst:854 +#: ../../library/enum.rst:875 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " @@ -1041,7 +1062,7 @@ msgstr "" "__members__`,蒐集任何它找到的別名;如果有找到任何別名則引發 :exc:" "`ValueError` 並附上細節: ::" -#: ../../library/enum.rst:872 +#: ../../library/enum.rst:893 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " @@ -1050,15 +1071,15 @@ msgstr "" "專門針對列舉的 :keyword:`class` 裝飾器。使用 :class:`EnumCheck` 裡的成員來指" "定在裝飾的列舉上應該檢查什麼限制。" -#: ../../library/enum.rst:880 +#: ../../library/enum.rst:901 msgid "A decorator for use in enums: its target will become a member." msgstr "列舉所使用的裝飾器:其目標會變成成員。" -#: ../../library/enum.rst:886 +#: ../../library/enum.rst:907 msgid "A decorator for use in enums: its target will not become a member." msgstr "列舉所使用的裝飾器:其目標不會變成成員。" -#: ../../library/enum.rst:892 +#: ../../library/enum.rst:913 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -1069,19 +1090,19 @@ msgstr "" "組而不是其類別。應該只有當列舉成員被匯出到模組的全域命名空間才使用(範例請參" "考 :class:`re.RegexFlag`)。" -#: ../../library/enum.rst:902 +#: ../../library/enum.rst:923 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "回傳在旗標\\ *值*\\ 中包含的所有 2 的次方的整數串列。" -#: ../../library/enum.rst:909 +#: ../../library/enum.rst:930 msgid "Notes" msgstr "備註" -#: ../../library/enum.rst:911 +#: ../../library/enum.rst:932 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr ":class:`IntEnum`、:class:`StrEnum` 及 :class:`IntFlag`" -#: ../../library/enum.rst:913 +#: ../../library/enum.rst:934 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" @@ -1089,17 +1110,17 @@ msgstr "" "這三種列舉類型是設計來直接取代現有以整數及字串為基底的值;因此它們有額外的限" "制:" -#: ../../library/enum.rst:916 +#: ../../library/enum.rst:937 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "``__str__`` 使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:918 +#: ../../library/enum.rst:939 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "``__format__`` 因為使用 ``__str__``,也會使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:921 +#: ../../library/enum.rst:942 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" @@ -1107,6 +1128,9 @@ msgstr "" "如果你不需要或不想要這些限制,你可以透過混合 ``int`` 或 ``str`` 類型來建立自" "己的基礎類別: ::" -#: ../../library/enum.rst:928 +#: ../../library/enum.rst:949 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "或者你也可以在你的列舉重新給定合適的 :meth:`str`: ::" + +#~ msgid "Aliases are no longer returned during iteration." +#~ msgstr "疊代時不會再回傳別名。" From d5147a230ad86f1ad5e9d2f734b2a48f7c884031 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 10 Feb 2024 00:04:52 +0000 Subject: [PATCH 03/33] sync with cpython 321ec5e0 --- c-api/code.po | 108 ++++++++++---------- library/enum.po | 262 +++++++++++++++++++++++++++--------------------- 2 files changed, 199 insertions(+), 171 deletions(-) diff --git a/c-api/code.po b/c-api/code.po index 3ffca4a8c2..e2673a6d1c 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-30 00:03+0000\n" +"POT-Creation-Date: 2024-02-10 00:03+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,124 +37,124 @@ msgstr "" #: ../../c-api/code.rst:24 msgid "" -"This is an instance of :c:type:`PyTypeObject` representing the Python :class:" -"`code` type." +"This is an instance of :c:type:`PyTypeObject` representing the Python :ref:" +"`code object `." msgstr "" #: ../../c-api/code.rst:30 msgid "" -"Return true if *co* is a :class:`code` object. This function always " -"succeeds." +"Return true if *co* is a :ref:`code object `. This function " +"always succeeds." msgstr "" -#: ../../c-api/code.rst:34 +#: ../../c-api/code.rst:35 msgid "Return the number of free variables in *co*." msgstr "" -#: ../../c-api/code.rst:38 +#: ../../c-api/code.rst:39 msgid "" "Return a new code object. If you need a dummy code object to create a " "frame, use :c:func:`PyCode_NewEmpty` instead." msgstr "" -#: ../../c-api/code.rst:41 +#: ../../c-api/code.rst:42 msgid "" "Since the definition of the bytecode changes often, calling :c:func:" "`PyUnstable_Code_New` directly can bind you to a precise Python version." msgstr "" -#: ../../c-api/code.rst:44 +#: ../../c-api/code.rst:45 msgid "" "The many arguments of this function are inter-dependent in complex ways, " "meaning that subtle changes to values are likely to result in incorrect " "execution or VM crashes. Use this function only with extreme care." msgstr "" -#: ../../c-api/code.rst:48 +#: ../../c-api/code.rst:49 msgid "Added ``qualname`` and ``exceptiontable`` parameters." msgstr "新增 ``qualname`` 和 ``exceptiontable`` 參數。" -#: ../../c-api/code.rst:55 +#: ../../c-api/code.rst:56 msgid "" "Renamed from ``PyCode_New`` as part of :ref:`unstable-c-api`. The old name " "is deprecated, but will remain available until the signature changes again." msgstr "" -#: ../../c-api/code.rst:61 +#: ../../c-api/code.rst:62 msgid "" "Similar to :c:func:`PyUnstable_Code_New`, but with an extra " "\"posonlyargcount\" for positional-only arguments. The same caveats that " "apply to ``PyUnstable_Code_New`` also apply to this function." msgstr "" -#: ../../c-api/code.rst:66 +#: ../../c-api/code.rst:67 msgid "as ``PyCode_NewWithPosOnlyArgs``" msgstr "" -#: ../../c-api/code.rst:68 +#: ../../c-api/code.rst:69 msgid "Added ``qualname`` and ``exceptiontable`` parameters." msgstr "新增 ``qualname`` 和 ``exceptiontable`` 參數。" -#: ../../c-api/code.rst:73 +#: ../../c-api/code.rst:74 msgid "" "Renamed to ``PyUnstable_Code_NewWithPosOnlyArgs``. The old name is " "deprecated, but will remain available until the signature changes again." msgstr "" -#: ../../c-api/code.rst:79 +#: ../../c-api/code.rst:80 msgid "" "Return a new empty code object with the specified filename, function name, " "and first line number. The resulting code object will raise an ``Exception`` " "if executed." msgstr "" -#: ../../c-api/code.rst:85 +#: ../../c-api/code.rst:86 msgid "" "Return the line number of the instruction that occurs on or before " "``byte_offset`` and ends after it. If you just need the line number of a " "frame, use :c:func:`PyFrame_GetLineNumber` instead." msgstr "" -#: ../../c-api/code.rst:88 +#: ../../c-api/code.rst:89 msgid "" "For efficiently iterating over the line numbers in a code object, use `the " "API described in PEP 626 `_." msgstr "" -#: ../../c-api/code.rst:93 +#: ../../c-api/code.rst:94 msgid "" "Sets the passed ``int`` pointers to the source code line and column numbers " "for the instruction at ``byte_offset``. Sets the value to ``0`` when " "information is not available for any particular element." msgstr "" -#: ../../c-api/code.rst:97 +#: ../../c-api/code.rst:98 msgid "Returns ``1`` if the function succeeds and 0 otherwise." msgstr "" -#: ../../c-api/code.rst:103 +#: ../../c-api/code.rst:104 msgid "" "Equivalent to the Python code ``getattr(co, 'co_code')``. Returns a strong " "reference to a :c:type:`PyBytesObject` representing the bytecode in a code " "object. On error, ``NULL`` is returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:108 +#: ../../c-api/code.rst:109 msgid "" "This ``PyBytesObject`` may be created on-demand by the interpreter and does " "not necessarily represent the bytecode actually executed by CPython. The " "primary use case for this function is debuggers and profilers." msgstr "" -#: ../../c-api/code.rst:116 +#: ../../c-api/code.rst:117 msgid "" "Equivalent to the Python code ``getattr(co, 'co_varnames')``. Returns a new " "reference to a :c:type:`PyTupleObject` containing the names of the local " "variables. On error, ``NULL`` is returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:125 +#: ../../c-api/code.rst:126 msgid "" "Equivalent to the Python code ``getattr(co, 'co_cellvars')``. Returns a new " "reference to a :c:type:`PyTupleObject` containing the names of the local " @@ -162,14 +162,14 @@ msgid "" "returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:134 +#: ../../c-api/code.rst:135 msgid "" "Equivalent to the Python code ``getattr(co, 'co_freevars')``. Returns a new " "reference to a :c:type:`PyTupleObject` containing the names of the free " "variables. On error, ``NULL`` is returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:142 +#: ../../c-api/code.rst:143 msgid "" "Register *callback* as a code object watcher for the current interpreter. " "Return an ID which may be passed to :c:func:`PyCode_ClearWatcher`. In case " @@ -177,7 +177,7 @@ msgid "" "exception." msgstr "" -#: ../../c-api/code.rst:151 +#: ../../c-api/code.rst:152 msgid "" "Clear watcher identified by *watcher_id* previously returned from :c:func:" "`PyCode_AddWatcher` for the current interpreter. Return ``0`` on success, or " @@ -185,17 +185,17 @@ msgid "" "never registered.)" msgstr "" -#: ../../c-api/code.rst:160 +#: ../../c-api/code.rst:161 msgid "" "Enumeration of possible code object watcher events: - " "``PY_CODE_EVENT_CREATE`` - ``PY_CODE_EVENT_DESTROY``" msgstr "" -#: ../../c-api/code.rst:168 +#: ../../c-api/code.rst:169 msgid "Type of a code object watcher callback function." msgstr "" -#: ../../c-api/code.rst:170 +#: ../../c-api/code.rst:171 msgid "" "If *event* is ``PY_CODE_EVENT_CREATE``, then the callback is invoked after " "`co` has been fully initialized. Otherwise, the callback is invoked before " @@ -203,7 +203,7 @@ msgid "" "inspected." msgstr "" -#: ../../c-api/code.rst:175 +#: ../../c-api/code.rst:176 msgid "" "If *event* is ``PY_CODE_EVENT_DESTROY``, taking a reference in the callback " "to the about-to-be-destroyed code object will resurrect it and prevent it " @@ -211,7 +211,7 @@ msgid "" "later, any watcher callbacks active at that time will be called again." msgstr "" -#: ../../c-api/code.rst:180 +#: ../../c-api/code.rst:181 msgid "" "Users of this API should not rely on internal runtime implementation " "details. Such details may include, but are not limited to, the exact order " @@ -221,14 +221,14 @@ msgid "" "the Python code being executed." msgstr "" -#: ../../c-api/code.rst:187 +#: ../../c-api/code.rst:188 msgid "" "If the callback sets an exception, it must return ``-1``; this exception " "will be printed as an unraisable exception using :c:func:" "`PyErr_WriteUnraisable`. Otherwise it should return ``0``." msgstr "" -#: ../../c-api/code.rst:191 +#: ../../c-api/code.rst:192 msgid "" "There may already be a pending exception set on entry to the callback. In " "this case, the callback should return ``0`` with the same exception still " @@ -237,85 +237,85 @@ msgid "" "it before returning." msgstr "" -#: ../../c-api/code.rst:201 +#: ../../c-api/code.rst:202 msgid "Extra information" msgstr "" -#: ../../c-api/code.rst:203 +#: ../../c-api/code.rst:204 msgid "" "To support low-level extensions to frame evaluation, such as external just-" "in-time compilers, it is possible to attach arbitrary extra data to code " "objects." msgstr "" -#: ../../c-api/code.rst:207 +#: ../../c-api/code.rst:208 msgid "" "These functions are part of the unstable C API tier: this functionality is a " "CPython implementation detail, and the API may change without deprecation " "warnings." msgstr "" -#: ../../c-api/code.rst:213 +#: ../../c-api/code.rst:214 msgid "Return a new an opaque index value used to adding data to code objects." msgstr "" -#: ../../c-api/code.rst:215 +#: ../../c-api/code.rst:216 msgid "" "You generally call this function once (per interpreter) and use the result " "with ``PyCode_GetExtra`` and ``PyCode_SetExtra`` to manipulate data on " "individual code objects." msgstr "" -#: ../../c-api/code.rst:219 +#: ../../c-api/code.rst:220 msgid "" "If *free* is not ``NULL``: when a code object is deallocated, *free* will be " "called on non-``NULL`` data stored under the new index. Use :c:func:" "`Py_DecRef` when storing :c:type:`PyObject`." msgstr "" -#: ../../c-api/code.rst:225 +#: ../../c-api/code.rst:226 msgid "as ``_PyEval_RequestCodeExtraIndex``" msgstr "" -#: ../../c-api/code.rst:229 +#: ../../c-api/code.rst:230 msgid "" "Renamed to ``PyUnstable_Eval_RequestCodeExtraIndex``. The old private name " "is deprecated, but will be available until the API changes." msgstr "" -#: ../../c-api/code.rst:235 +#: ../../c-api/code.rst:236 msgid "" "Set *extra* to the extra data stored under the given index. Return 0 on " "success. Set an exception and return -1 on failure." msgstr "" -#: ../../c-api/code.rst:238 +#: ../../c-api/code.rst:239 msgid "" "If no data was set under the index, set *extra* to ``NULL`` and return 0 " "without setting an exception." msgstr "" -#: ../../c-api/code.rst:243 +#: ../../c-api/code.rst:244 msgid "as ``_PyCode_GetExtra``" msgstr "" -#: ../../c-api/code.rst:247 +#: ../../c-api/code.rst:248 msgid "" "Renamed to ``PyUnstable_Code_GetExtra``. The old private name is deprecated, " "but will be available until the API changes." msgstr "" -#: ../../c-api/code.rst:253 +#: ../../c-api/code.rst:254 msgid "" "Set the extra data stored under the given index to *extra*. Return 0 on " "success. Set an exception and return -1 on failure." msgstr "" -#: ../../c-api/code.rst:258 +#: ../../c-api/code.rst:259 msgid "as ``_PyCode_SetExtra``" msgstr "" -#: ../../c-api/code.rst:262 +#: ../../c-api/code.rst:263 msgid "" "Renamed to ``PyUnstable_Code_SetExtra``. The old private name is deprecated, " "but will be available until the API changes." @@ -333,22 +333,22 @@ msgstr "code(程式碼)" msgid "code object" msgstr "code object(程式碼物件)" -#: ../../c-api/code.rst:51 +#: ../../c-api/code.rst:52 msgid "PyCode_New" msgstr "PyCode_New" -#: ../../c-api/code.rst:64 +#: ../../c-api/code.rst:65 msgid "PyCode_NewWithPosOnlyArgs" msgstr "PyCode_NewWithPosOnlyArgs" -#: ../../c-api/code.rst:223 +#: ../../c-api/code.rst:224 msgid "_PyEval_RequestCodeExtraIndex" msgstr "_PyEval_RequestCodeExtraIndex" -#: ../../c-api/code.rst:241 +#: ../../c-api/code.rst:242 msgid "_PyCode_GetExtra" msgstr "_PyCode_GetExtra" -#: ../../c-api/code.rst:256 +#: ../../c-api/code.rst:257 msgid "_PyCode_SetExtra" msgstr "_PyCode_SetExtra" diff --git a/library/enum.po b/library/enum.po index 9e71dc45c9..bb0f15eaa9 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-09 00:03+0000\n" +"POT-Creation-Date: 2024-02-10 00:03+0000\n" "PO-Revision-Date: 2023-09-11 14:08+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -449,31 +449,35 @@ msgid "Returns the number of member in *cls*::" msgstr "回傳 *cls* 的成員數量: ::" #: ../../library/enum.rst:240 +msgid "Returns a mapping of every enum name to its member, including aliases" +msgstr "" + +#: ../../library/enum.rst:244 msgid "Returns each member in *cls* in reverse definition order::" msgstr "以跟定義相反的順序回傳 *cls* 的每個成員: ::" -#: ../../library/enum.rst:247 +#: ../../library/enum.rst:251 msgid "Before 3.11 ``enum`` used ``EnumMeta`` type, which is kept as an alias." msgstr "" "在 3.11 之前,``enum`` 使用 ``EnumMeta`` 類型,目前保留此類型當作別名。" -#: ../../library/enum.rst:252 +#: ../../library/enum.rst:256 msgid "*Enum* is the base class for all *enum* enumerations." msgstr "*Enum* 是所有 *enum* 列舉的基礎類別。" -#: ../../library/enum.rst:256 +#: ../../library/enum.rst:260 msgid "The name used to define the ``Enum`` member::" msgstr "用來定義 ``Enum`` 成員的名稱: ::" -#: ../../library/enum.rst:263 +#: ../../library/enum.rst:267 msgid "The value given to the ``Enum`` member::" msgstr "``Enum`` 成員給定的值: ::" -#: ../../library/enum.rst:268 +#: ../../library/enum.rst:272 msgid "Enum member values" msgstr "列舉成員的值" -#: ../../library/enum.rst:270 +#: ../../library/enum.rst:274 msgid "" "Member values can be anything: :class:`int`, :class:`str`, etc. If the " "exact value is unimportant you may use :class:`auto` instances and an " @@ -483,13 +487,32 @@ msgstr "" "重要,你可以使用 :class:`auto` 實例,它會為你選擇合適的值。更多細節請參考 :" "class:`auto`。" -#: ../../library/enum.rst:277 +#: ../../library/enum.rst:281 +#, fuzzy +msgid "Name of the member." +msgstr "``_name_`` -- 成員名稱" + +#: ../../library/enum.rst:285 +#, fuzzy +msgid "Value of the member, can be set in :meth:`~object.__new__`." +msgstr "``_value_`` -- 成員的值;可以在 ``__new__`` 設定或修改" + +#: ../../library/enum.rst:289 +#, fuzzy +msgid "" +"No longer used, kept for backward compatibility. (class attribute, removed " +"during class creation)." +msgstr "" +"``_order_`` -- 在 Python 2/3 的程式裡用來確保成員順序是一致的(類別屬性,在類" +"別建立時移除)" + +#: ../../library/enum.rst:294 msgid "" "``_ignore_`` is only used during creation and is removed from the " "enumeration once creation is complete." msgstr "``_ignore_`` 只有在建立的時候用到,在列舉建立完成後會被移除。" -#: ../../library/enum.rst:280 +#: ../../library/enum.rst:297 msgid "" "``_ignore_`` is a list of names that will not become members, and whose " "names will also be removed from the completed enumeration. See :ref:" @@ -498,7 +521,7 @@ msgstr "" "``_ignore_`` 是一個不會變成成員的名稱串列,在列舉建立完成後其名稱會被移除。範" "例請參考 :ref:`TimePeriod `。" -#: ../../library/enum.rst:286 +#: ../../library/enum.rst:303 msgid "" "Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any " "public methods defined on *self.__class__*::" @@ -510,11 +533,11 @@ msgstr "" msgid "name" msgstr "name" -#: ../../library/enum.rst:307 +#: ../../library/enum.rst:324 msgid "The name of the member being defined (e.g. 'RED')." msgstr "定義的成員名稱(例如 'RED')。" -#: ../../library/enum.rst:308 +#: ../../library/enum.rst:325 msgid "The start value for the Enum; the default is 1." msgstr "列舉的開始值,預設為 1。" @@ -522,7 +545,7 @@ msgstr "列舉的開始值,預設為 1。" msgid "count" msgstr "count" -#: ../../library/enum.rst:309 +#: ../../library/enum.rst:326 msgid "The number of members currently defined, not including this one." msgstr "已定義的成員數量,不包含目前這一個。" @@ -530,35 +553,35 @@ msgstr "已定義的成員數量,不包含目前這一個。" msgid "last_values" msgstr "last_values" -#: ../../library/enum.rst:310 +#: ../../library/enum.rst:327 msgid "A list of the previous values." msgstr "一個之前值的串列。" -#: ../../library/enum.rst:312 +#: ../../library/enum.rst:329 msgid "" "A *staticmethod* that is used to determine the next value returned by :class:" "`auto`::" msgstr "一個 *staticmethod*,用來決定 :class:`auto` 下一個要回傳的值的: ::" -#: ../../library/enum.rst:328 +#: ../../library/enum.rst:345 msgid "" "By default, does nothing. If multiple values are given in the member " "assignment, those values become separate arguments to ``__init__``; e.g." msgstr "" -#: ../../library/enum.rst:335 +#: ../../library/enum.rst:352 msgid "" "``Weekday.__init__()`` would be called as ``Weekday.__init__(self, 1, " "'Mon')``" msgstr "" -#: ../../library/enum.rst:339 +#: ../../library/enum.rst:356 msgid "" "A *classmethod* that is used to further configure subsequent subclasses. By " "default, does nothing." msgstr "一個 *classmethod*,用來進一步設定後續的子類別,預設不做任何事。" -#: ../../library/enum.rst:344 +#: ../../library/enum.rst:361 msgid "" "A *classmethod* for looking up values not found in *cls*. By default it " "does nothing, but can be overridden to implement custom search behavior::" @@ -566,19 +589,19 @@ msgstr "" "一個 *classmethod*,用來查詢在 *cls* 裡找不到的值。預設不做任何事,但可以被覆" "寫以實作客製化的搜尋行為: ::" -#: ../../library/enum.rst:366 +#: ../../library/enum.rst:383 msgid "" "By default, doesn't exist. If specified, either in the enum class " "definition or in a mixin class (such as ``int``), all values given in the " "member assignment will be passed; e.g." msgstr "" -#: ../../library/enum.rst:374 +#: ../../library/enum.rst:391 msgid "" "results in the call ``int('1a', 16)`` and a value of ``17`` for the member." msgstr "" -#: ../../library/enum.rst:378 +#: ../../library/enum.rst:395 msgid "" "Returns the string used for *repr()* calls. By default, returns the *Enum* " "name, member name, and value, but can be overridden::" @@ -586,7 +609,7 @@ msgstr "" "回傳呼叫 *repr()* 時使用的字串。預設回傳 *Enum* 名稱、成員名稱及值,但可以被" "覆寫: ::" -#: ../../library/enum.rst:394 +#: ../../library/enum.rst:411 msgid "" "Returns the string used for *str()* calls. By default, returns the *Enum* " "name and member name, but can be overridden::" @@ -594,7 +617,7 @@ msgstr "" "回傳呼叫 *str()* 時使用的字串。預設回傳 *Enum* 名稱及成員名稱,但可以被覆" "寫: ::" -#: ../../library/enum.rst:409 +#: ../../library/enum.rst:426 msgid "" "Returns the string used for *format()* and *f-string* calls. By default, " "returns :meth:`__str__` return value, but can be overridden::" @@ -602,17 +625,17 @@ msgstr "" "回傳呼叫 *format()* 及 *f-string* 時使用的字串。預設回傳 :meth:`__str__` 的回" "傳值,但可以被覆寫: ::" -#: ../../library/enum.rst:424 +#: ../../library/enum.rst:441 msgid "" "Using :class:`auto` with :class:`Enum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`Enum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:427 +#: ../../library/enum.rst:444 msgid "Added :ref:`enum-dataclass-support`" msgstr "新增 :ref:`enum-dataclass-support`" -#: ../../library/enum.rst:432 +#: ../../library/enum.rst:449 msgid "" "*IntEnum* is the same as *Enum*, but its members are also integers and can " "be used anywhere that an integer can be used. If any integer operation is " @@ -622,13 +645,13 @@ msgstr "" "*IntEnum* 和 *Enum* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" "方。如果 *IntEnum* 成員經過任何整數運算,其結果會失去列舉狀態。" -#: ../../library/enum.rst:453 +#: ../../library/enum.rst:470 msgid "" "Using :class:`auto` with :class:`IntEnum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`IntEnum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:456 +#: ../../library/enum.rst:473 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` was " @@ -638,7 +661,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:463 +#: ../../library/enum.rst:480 msgid "" "*StrEnum* is the same as *Enum*, but its members are also strings and can be " "used in most of the same places that a string can be used. The result of " @@ -648,7 +671,7 @@ msgstr "" "*StrEnum* 和 *Enum* 一樣,但其成員同時也是字串而可以被用在幾乎所有使用字串的" "地方。*StrEnum* 成員經過任何字串操作的結果會不再是列舉的一部份。" -#: ../../library/enum.rst:469 +#: ../../library/enum.rst:486 msgid "" "There are places in the stdlib that check for an exact :class:`str` instead " "of a :class:`str` subclass (i.e. ``type(unknown) == str`` instead of " @@ -659,13 +682,13 @@ msgstr "" "是 ``type(unknown) == str`` 而不是 ``isinstance(unknown, str)``),在這些地方" "你需要使用 ``str(StrEnum.member)``。" -#: ../../library/enum.rst:476 +#: ../../library/enum.rst:493 msgid "" "Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " "name as the value." msgstr ":class:`StrEnum` 使用 :class:`auto` 會產生小寫的成員名稱當作值。" -#: ../../library/enum.rst:481 +#: ../../library/enum.rst:498 msgid "" ":meth:`~object.__str__` is :meth:`!str.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` is " @@ -675,7 +698,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!str.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 也會是 :meth:`!str.__format__`。" -#: ../../library/enum.rst:489 +#: ../../library/enum.rst:506 #, fuzzy msgid "" "``Flag`` is the same as :class:`Enum`, but its members support the bitwise " @@ -685,39 +708,39 @@ msgstr "" "*Flag* 成員支援位元操作 ``&`` (*AND*)、``|`` (*OR*)、``^`` (*XOR*) 及 ``~`` " "(*INVERT*);這些操作的結果會是列舉成員。" -#: ../../library/enum.rst:495 +#: ../../library/enum.rst:512 msgid "Returns *True* if value is in self::" msgstr "如果 value 在 self 裡則回傳 *True*: ::" -#: ../../library/enum.rst:516 +#: ../../library/enum.rst:533 msgid "Returns all contained non-alias members::" msgstr "回傳所有包含的非別名成員: ::" -#: ../../library/enum.rst:527 +#: ../../library/enum.rst:544 msgid "Returns number of members in flag::" msgstr "回傳旗標裡的成員數量: ::" -#: ../../library/enum.rst:536 +#: ../../library/enum.rst:553 msgid "Returns *True* if any members in flag, *False* otherwise::" msgstr "如果成員在旗標裡則回傳 *True*,否則回傳 *False*: ::" -#: ../../library/enum.rst:548 +#: ../../library/enum.rst:565 msgid "Returns current flag binary or'ed with other::" msgstr "回傳和 other 做 OR 過後的二進位旗標: ::" -#: ../../library/enum.rst:555 +#: ../../library/enum.rst:572 msgid "Returns current flag binary and'ed with other::" msgstr "回傳和 other 做 AND 過後的二進位旗標: ::" -#: ../../library/enum.rst:564 +#: ../../library/enum.rst:581 msgid "Returns current flag binary xor'ed with other::" msgstr "回傳和 other 做 XOR 過後的二進位旗標: ::" -#: ../../library/enum.rst:573 +#: ../../library/enum.rst:590 msgid "Returns all the flags in *type(self)* that are not in self::" msgstr "回傳所有在 *type(self)* 但不在 self 裡的旗標: ::" -#: ../../library/enum.rst:584 +#: ../../library/enum.rst:601 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." @@ -725,17 +748,17 @@ msgstr "" "用來格式化任何剩下未命名數值的函式。預設是值的 repr,常見選擇是 :func:`hex` " "和 :func:`oct`。" -#: ../../library/enum.rst:589 +#: ../../library/enum.rst:606 msgid "" "Using :class:`auto` with :class:`Flag` results in integers that are powers " "of two, starting with ``1``." msgstr ":class:`Flag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:592 +#: ../../library/enum.rst:609 msgid "The *repr()* of zero-valued flags has changed. It is now::" msgstr "值為 0 的旗標的 *repr()* 已改變。現在是: ::" -#: ../../library/enum.rst:600 +#: ../../library/enum.rst:617 msgid "" "*IntFlag* is the same as *Flag*, but its members are also integers and can " "be used anywhere that an integer can be used." @@ -743,38 +766,38 @@ msgstr "" "*IntFlag* 和 *Flag* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" "方。" -#: ../../library/enum.rst:614 +#: ../../library/enum.rst:631 msgid "" "If any integer operation is performed with an *IntFlag* member, the result " "is not an *IntFlag*::" msgstr "如果 *IntFlag* 成員經過任何整數運算,其結果不是 *IntFlag*: ::" -#: ../../library/enum.rst:620 +#: ../../library/enum.rst:637 msgid "If a *Flag* operation is performed with an *IntFlag* member and:" msgstr "如果 *IntFlag* 成員經過 *Flag* 操作且:" -#: ../../library/enum.rst:622 +#: ../../library/enum.rst:639 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" msgstr "結果是合法的 *IntFlag*:回傳 *IntFlag*" -#: ../../library/enum.rst:623 +#: ../../library/enum.rst:640 msgid "" "the result is not a valid *IntFlag*: the result depends on the " "*FlagBoundary* setting" msgstr "結果不是合法的 *IntFlag*:結果會根據 *FlagBoundary* 的設定" -#: ../../library/enum.rst:625 +#: ../../library/enum.rst:642 msgid "The *repr()* of unnamed zero-valued flags has changed. It is now:" msgstr "未命名且值為 0 的旗標的 *repr()* 已改變。現在是: ::" -#: ../../library/enum.rst:632 +#: ../../library/enum.rst:649 msgid "" "Using :class:`auto` with :class:`IntFlag` results in integers that are " "powers of two, starting with ``1``." msgstr "" ":class:`IntFlag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:637 +#: ../../library/enum.rst:654 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` " @@ -784,7 +807,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:641 +#: ../../library/enum.rst:658 msgid "" "Inversion of an :class:`!IntFlag` now returns a positive value that is the " "union of all flags not in the given flag, rather than a negative value. This " @@ -793,7 +816,7 @@ msgstr "" ":class:`!IntFlag` 的反轉 (inversion) 現在會回傳正值,該值是不在給定旗標的所有" "旗標聯集,而不是一個負值。這符合現有 :class:`Flag` 的行為。" -#: ../../library/enum.rst:647 +#: ../../library/enum.rst:664 msgid "" ":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" @@ -801,15 +824,15 @@ msgstr "" ":class:`!ReprEnum` 使用 :class:`Enum` 的 :meth:`repr() `,但使" "用混合資料類型的 :class:`str() `:" -#: ../../library/enum.rst:650 +#: ../../library/enum.rst:667 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" msgstr "對 :class:`IntEnum` 和 :class:`IntFlag` 是 :meth:`!int.__str__`" -#: ../../library/enum.rst:651 +#: ../../library/enum.rst:668 msgid ":meth:`!str.__str__` for :class:`StrEnum`" msgstr "對 :class:`StrEnum` 是 :meth:`!str.__str__`" -#: ../../library/enum.rst:653 +#: ../../library/enum.rst:670 msgid "" "Inherit from :class:`!ReprEnum` to keep the :class:`str() ` / :func:" "`format` of the mixed-in data type instead of using the :class:`Enum`-" @@ -818,7 +841,7 @@ msgstr "" "繼承 :class:`!ReprEnum` 來保留混合資料類型的 :class:`str() ` / :func:" "`format`,而不是使用 :class:`Enum` 預設的 :meth:`str() `。" -#: ../../library/enum.rst:662 +#: ../../library/enum.rst:679 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." @@ -826,17 +849,17 @@ msgstr "" "*EnumCheck* 包含 :func:`verify` 裝飾器使用的選項,以確保多樣的限制,不符合限" "制會產生 :exc:`ValueError`。" -#: ../../library/enum.rst:667 +#: ../../library/enum.rst:684 msgid "Ensure that each value has only one name::" msgstr "確保每個值只有一個名稱: ::" -#: ../../library/enum.rst:683 +#: ../../library/enum.rst:700 msgid "" "Ensure that there are no missing values between the lowest-valued member and " "the highest-valued member::" msgstr "確保在最小值成員跟最大值成員間沒有缺少值: ::" -#: ../../library/enum.rst:698 +#: ../../library/enum.rst:715 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`::" @@ -844,35 +867,35 @@ msgstr "" "確保任何旗標群組 / 遮罩只包含命名旗標 -- 當值是用指定而不是透過 :func:`auto` " "產生時是很實用的: ::" -#: ../../library/enum.rst:715 +#: ../../library/enum.rst:732 msgid "" "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." msgstr "CONTINUOUS 和 NAMED_FLAGS 是設計用來運作在整數值的成員上。" -#: ../../library/enum.rst:721 +#: ../../library/enum.rst:738 msgid "" "*FlagBoundary* controls how out-of-range values are handled in *Flag* and " "its subclasses." msgstr "*FlagBoundary* 控制在 *Flag* 及其子類別中如何處理範圍外的值。" -#: ../../library/enum.rst:726 +#: ../../library/enum.rst:743 msgid "" "Out-of-range values cause a :exc:`ValueError` to be raised. This is the " "default for :class:`Flag`::" msgstr "範圍外的值會引發 :exc:`ValueError`。這是 :class:`Flag` 的預設行為: ::" -#: ../../library/enum.rst:744 +#: ../../library/enum.rst:761 msgid "" "Out-of-range values have invalid values removed, leaving a valid *Flag* " "value::" msgstr "範圍外的值會移除非法值,留下合法的 *Flag* 值: ::" -#: ../../library/enum.rst:758 +#: ../../library/enum.rst:775 msgid "" "Out-of-range values lose their *Flag* membership and revert to :class:`int`." msgstr "範圍外的值會失去它們的 *Flag* 成員資格且恢復成 :class:`int`。" -#: ../../library/enum.rst:771 +#: ../../library/enum.rst:788 msgid "" "Out-of-range values are kept, and the *Flag* membership is kept. This is the " "default for :class:`IntFlag`::" @@ -880,11 +903,11 @@ msgstr "" "範圍外的值會被保留,*Flag* 成員資格也會被保留。這是 :class:`IntFlag` 的預設行" "為: ::" -#: ../../library/enum.rst:788 +#: ../../library/enum.rst:805 msgid "Supported ``__dunder__`` names" msgstr "支援 ``__dunder__`` 名稱" -#: ../../library/enum.rst:790 +#: ../../library/enum.rst:807 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." @@ -892,7 +915,7 @@ msgstr "" ":attr:`~EnumType.__members__` 是一個唯讀有序的\\ ``成員名稱``:``成員``\\ 項" "目的對映。只有在類別上可用。" -#: ../../library/enum.rst:793 +#: ../../library/enum.rst:810 msgid "" ":meth:`~object.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`!_value_` " @@ -902,56 +925,61 @@ msgstr "" "的 :attr:`!_value_` 也是一個很好的主意。一旦所有成員都建立之後就不會再被用" "到。" -#: ../../library/enum.rst:799 +#: ../../library/enum.rst:816 msgid "Supported ``_sunder_`` names" msgstr "支援 ``_sunder_`` 名稱" -#: ../../library/enum.rst:801 -msgid "``_name_`` -- name of the member" +#: ../../library/enum.rst:818 +#, fuzzy +msgid ":attr:`~Enum._name_` -- name of the member" msgstr "``_name_`` -- 成員名稱" -#: ../../library/enum.rst:802 -msgid "" -"``_value_`` -- value of the member; can be set / modified in ``__new__``" +#: ../../library/enum.rst:819 +#, fuzzy +msgid ":attr:`~Enum._value_` -- value of the member; can be set in ``__new__``" msgstr "``_value_`` -- 成員的值;可以在 ``__new__`` 設定或修改" -#: ../../library/enum.rst:804 +#: ../../library/enum.rst:820 +#, fuzzy msgid "" -"``_missing_`` -- a lookup function used when a value is not found; may be " -"overridden" +":meth:`~Enum._missing_` -- a lookup function used when a value is not found; " +"may be overridden" msgstr "``_missing_`` -- 當值沒有被找到時會使用的查詢函式;可以被覆寫" -#: ../../library/enum.rst:806 +#: ../../library/enum.rst:822 +#, fuzzy msgid "" -"``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" -"`str`, that will not be transformed into members, and will be removed from " -"the final class" +":attr:`~Enum._ignore_` -- a list of names, either as a :class:`list` or a :" +"class:`str`, that will not be transformed into members, and will be removed " +"from the final class" msgstr "" "``_ignore_`` -- 可以是 :class:`list` 或 :class:`str` 的名稱串列,它不會被轉換" "成成員,且在最後的類別上會被移除" -#: ../../library/enum.rst:809 +#: ../../library/enum.rst:825 +#, fuzzy msgid "" -"``_order_`` -- used in Python 2/3 code to ensure member order is consistent " +":attr:`~Enum._order_` -- no longer used, kept for backward compatibility " "(class attribute, removed during class creation)" msgstr "" "``_order_`` -- 在 Python 2/3 的程式裡用來確保成員順序是一致的(類別屬性,在類" "別建立時移除)" -#: ../../library/enum.rst:811 +#: ../../library/enum.rst:827 +#, fuzzy msgid "" -"``_generate_next_value_`` -- used to get an appropriate value for an enum " -"member; may be overridden" +":meth:`~Enum._generate_next_value_` -- used to get an appropriate value for " +"an enum member; may be overridden" msgstr "``_generate_next_value_`` -- 用來為列舉成員取得合適的值;可以被覆寫" -#: ../../library/enum.rst:816 +#: ../../library/enum.rst:832 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" "對標準的 :class:`Enum` 類別來說,下一個被選擇的值是最後一個看見的值加一。" -#: ../../library/enum.rst:819 +#: ../../library/enum.rst:835 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." @@ -959,19 +987,19 @@ msgstr "" "對 :class:`Flag` 類別來說,下一個被選擇的值是下一個最大的 2 的次方,不管最後" "一個看見的值是什麼。" -#: ../../library/enum.rst:822 +#: ../../library/enum.rst:838 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``\\ 、\\ ``_order_``\\ 、\\ ``_generate_next_value_``" -#: ../../library/enum.rst:823 +#: ../../library/enum.rst:839 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:828 +#: ../../library/enum.rst:844 msgid "Utilities and Decorators" msgstr "通用項目與裝飾器" -#: ../../library/enum.rst:832 +#: ../../library/enum.rst:848 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an *Enum*'s :meth:`~Enum._generate_next_value_` to get an appropriate " @@ -987,16 +1015,16 @@ msgstr "" "2 的次方的數字;對 *StrEnum* 來說,是成員名稱的小寫版本。如果混用 *auto()* 和" "手動指定值的話要特別注意。" -#: ../../library/enum.rst:840 +#: ../../library/enum.rst:856 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "*auto* 實例只有在最上層的賦值時才會被解析:" -#: ../../library/enum.rst:842 +#: ../../library/enum.rst:858 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "``FIRST = auto()`` 可以運作(auto() 會被取代成 ``1``)" -#: ../../library/enum.rst:843 +#: ../../library/enum.rst:859 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is used to create the ``SECOND`` enum member;" @@ -1004,7 +1032,7 @@ msgstr "" "``SECOND = auto(), -2`` 可以運作(auto 會被取代成 ``2``, 因此 ``2, -2`` 會被" "用來建立列舉成員 ``SECOND``;" -#: ../../library/enum.rst:845 +#: ../../library/enum.rst:861 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" @@ -1012,19 +1040,19 @@ msgstr "" "``THREE = [auto(), -3]`` *無法*\\ 運作(\\ ``, -3`` 會被用來建立列" "舉成員 ``THREE``)" -#: ../../library/enum.rst:850 +#: ../../library/enum.rst:866 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "在之前的版本中,``auto()`` 必須是賦值行裡的唯一內容才能運作正確。" -#: ../../library/enum.rst:853 +#: ../../library/enum.rst:869 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "可以覆寫 ``_generate_next_value_`` 來客製 *auto* 使用的值。" -#: ../../library/enum.rst:856 +#: ../../library/enum.rst:872 msgid "" "in 3.13 the default ``_generate_next_value_`` will always return the highest " "member value incremented by 1, and will fail if any member is an " @@ -1033,7 +1061,7 @@ msgstr "" "在 3.13 預設 ``_generate_next_value_`` 總是回傳最大的成員值加一,如果任何成員" "是不相容的類型就會失敗。" -#: ../../library/enum.rst:862 +#: ../../library/enum.rst:878 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " @@ -1042,7 +1070,7 @@ msgstr "" "和內建的 *property* 相似的裝飾器,但只專門針對列舉。它允許成員屬性和成員本身" "有相同名稱。" -#: ../../library/enum.rst:866 +#: ../../library/enum.rst:882 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -1052,7 +1080,7 @@ msgstr "" "*屬性*\\ 和成員必須定義在分開的類別裡;例如 *value* 和 *name* 屬性定義在 " "*Enum* 類別而 *Enum* 子類別可以定義成員名稱為 ``value`` 和 ``name``。" -#: ../../library/enum.rst:875 +#: ../../library/enum.rst:891 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " @@ -1062,7 +1090,7 @@ msgstr "" "__members__`,蒐集任何它找到的別名;如果有找到任何別名則引發 :exc:" "`ValueError` 並附上細節: ::" -#: ../../library/enum.rst:893 +#: ../../library/enum.rst:909 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " @@ -1071,15 +1099,15 @@ msgstr "" "專門針對列舉的 :keyword:`class` 裝飾器。使用 :class:`EnumCheck` 裡的成員來指" "定在裝飾的列舉上應該檢查什麼限制。" -#: ../../library/enum.rst:901 +#: ../../library/enum.rst:917 msgid "A decorator for use in enums: its target will become a member." msgstr "列舉所使用的裝飾器:其目標會變成成員。" -#: ../../library/enum.rst:907 +#: ../../library/enum.rst:923 msgid "A decorator for use in enums: its target will not become a member." msgstr "列舉所使用的裝飾器:其目標不會變成成員。" -#: ../../library/enum.rst:913 +#: ../../library/enum.rst:929 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -1090,19 +1118,19 @@ msgstr "" "組而不是其類別。應該只有當列舉成員被匯出到模組的全域命名空間才使用(範例請參" "考 :class:`re.RegexFlag`)。" -#: ../../library/enum.rst:923 +#: ../../library/enum.rst:939 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "回傳在旗標\\ *值*\\ 中包含的所有 2 的次方的整數串列。" -#: ../../library/enum.rst:930 +#: ../../library/enum.rst:946 msgid "Notes" msgstr "備註" -#: ../../library/enum.rst:932 +#: ../../library/enum.rst:948 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr ":class:`IntEnum`、:class:`StrEnum` 及 :class:`IntFlag`" -#: ../../library/enum.rst:934 +#: ../../library/enum.rst:950 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" @@ -1110,17 +1138,17 @@ msgstr "" "這三種列舉類型是設計來直接取代現有以整數及字串為基底的值;因此它們有額外的限" "制:" -#: ../../library/enum.rst:937 +#: ../../library/enum.rst:953 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "``__str__`` 使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:939 +#: ../../library/enum.rst:955 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "``__format__`` 因為使用 ``__str__``,也會使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:942 +#: ../../library/enum.rst:958 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" @@ -1128,7 +1156,7 @@ msgstr "" "如果你不需要或不想要這些限制,你可以透過混合 ``int`` 或 ``str`` 類型來建立自" "己的基礎類別: ::" -#: ../../library/enum.rst:949 +#: ../../library/enum.rst:965 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "或者你也可以在你的列舉重新給定合適的 :meth:`str`: ::" From 287bdd20abba57519098080d3be7b8c1076c26df Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 11 Feb 2024 00:04:48 +0000 Subject: [PATCH 04/33] sync with cpython a5f49ce6 --- reference/datamodel.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/datamodel.po b/reference/datamodel.po index ad793621a6..21c5f944e7 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-22 00:03+0000\n" +"POT-Creation-Date: 2024-02-11 00:03+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-" @@ -2248,8 +2248,8 @@ msgstr "" #: ../../reference/datamodel.rst:1986 msgid "" -"Called when :func:`dir` is called on the object. A sequence must be " -"returned. :func:`dir` converts the returned sequence to a list and sorts it." +"Called when :func:`dir` is called on the object. An iterable must be " +"returned. :func:`dir` converts the returned iterable to a list and sorts it." msgstr "" #: ../../reference/datamodel.rst:1991 @@ -2270,7 +2270,7 @@ msgstr "" #: ../../reference/datamodel.rst:2007 msgid "" -"The ``__dir__`` function should accept no arguments, and return a sequence " +"The ``__dir__`` function should accept no arguments, and return an iterable " "of strings that represents the names accessible on module. If present, this " "function overrides the standard :func:`dir` search on a module." msgstr "" From 3ff29bd7809ef4cb84951de1f532edc153b1c827 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 12 Feb 2024 00:04:42 +0000 Subject: [PATCH 05/33] sync with cpython 67688609 --- c-api/buffer.po | 5 +- c-api/code.po | 17 +- c-api/exceptions.po | 231 ++++++++++++------ c-api/file.po | 5 +- c-api/init.po | 536 +++++++++++++++++++++-------------------- c-api/intro.po | 59 +++-- c-api/long.po | 14 +- c-api/memory.po | 26 +- c-api/structures.po | 108 ++++++--- c-api/sys.po | 198 ++++++++------- c-api/veryhigh.po | 5 +- extending/extending.po | 11 +- extending/newtypes.po | 8 +- library/bdb.po | 101 ++++---- library/re.po | 9 +- 15 files changed, 770 insertions(+), 563 deletions(-) diff --git a/c-api/buffer.po b/c-api/buffer.po index a154f8edbe..8b7baf4704 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-17 00:04+0000\n" +"POT-Creation-Date: 2024-02-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:30+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -710,7 +710,8 @@ msgid "buffer object" msgstr "buffer object(緩衝物件)" #: ../../c-api/buffer.rst:32 -msgid "PyBufferProcs" +#, fuzzy +msgid "PyBufferProcs (C type)" msgstr "PyBufferProcs" #: ../../c-api/buffer.rst:294 diff --git a/c-api/code.po b/c-api/code.po index e2673a6d1c..cecb3fec8c 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-10 00:03+0000\n" +"POT-Creation-Date: 2024-02-12 00:03+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -334,21 +334,26 @@ msgid "code object" msgstr "code object(程式碼物件)" #: ../../c-api/code.rst:52 -msgid "PyCode_New" +#, fuzzy +msgid "PyCode_New (C function)" msgstr "PyCode_New" #: ../../c-api/code.rst:65 -msgid "PyCode_NewWithPosOnlyArgs" +#, fuzzy +msgid "PyCode_NewWithPosOnlyArgs (C function)" msgstr "PyCode_NewWithPosOnlyArgs" #: ../../c-api/code.rst:224 -msgid "_PyEval_RequestCodeExtraIndex" +#, fuzzy +msgid "_PyEval_RequestCodeExtraIndex (C function)" msgstr "_PyEval_RequestCodeExtraIndex" #: ../../c-api/code.rst:242 -msgid "_PyCode_GetExtra" +#, fuzzy +msgid "_PyCode_GetExtra (C function)" msgstr "_PyCode_GetExtra" #: ../../c-api/code.rst:257 -msgid "_PyCode_SetExtra" +#, fuzzy +msgid "_PyCode_SetExtra (C function)" msgstr "_PyCode_SetExtra" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 18e986259e..c8be8bb09f 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-01 00:03+0000\n" +"POT-Creation-Date: 2024-02-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -408,7 +408,8 @@ msgstr "" #: ../../c-api/exceptions.rst:385 msgid "" "Function similar to :c:func:`PyErr_WarnFormat`, but *category* is :exc:" -"`ResourceWarning` and it passes *source* to :func:`warnings.WarningMessage`." +"`ResourceWarning` and it passes *source* to :class:`!warnings." +"WarningMessage`." msgstr "" #: ../../c-api/exceptions.rst:392 @@ -740,7 +741,7 @@ msgstr "" #: ../../c-api/exceptions.rst:722 msgid "" -"The :attr:`__module__` attribute of the new class is set to the first part " +"The :attr:`!__module__` attribute of the new class is set to the first part " "(up to the last dot) of the *name* argument, and the class name is set to " "the last part (after the last dot). The *base* argument can be used to " "specify alternate base classes; it can either be only one class or a tuple " @@ -909,8 +910,8 @@ msgstr "" #: ../../c-api/exceptions.rst:894 msgid "" -"If :c:macro:`USE_STACKCHECK` is defined, this function checks if the OS " -"stack overflowed using :c:func:`PyOS_CheckStack`. In this is the case, it " +"If :c:macro:`!USE_STACKCHECK` is defined, this function checks if the OS " +"stack overflowed using :c:func:`PyOS_CheckStack`. If this is the case, it " "sets a :exc:`MemoryError` and returns a nonzero value." msgstr "" @@ -1472,15 +1473,18 @@ msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:" msgstr "" #: ../../c-api/exceptions.rst:1148 -msgid ":c:data:`PyExc_EnvironmentError`" +#, fuzzy +msgid ":c:data:`!PyExc_EnvironmentError`" msgstr ":c:data:`PyExc_EnvironmentError`" #: ../../c-api/exceptions.rst:1150 -msgid ":c:data:`PyExc_IOError`" +#, fuzzy +msgid ":c:data:`!PyExc_IOError`" msgstr ":c:data:`PyExc_IOError`" #: ../../c-api/exceptions.rst:1152 -msgid ":c:data:`PyExc_WindowsError`" +#, fuzzy +msgid ":c:data:`!PyExc_WindowsError`" msgstr ":c:data:`PyExc_WindowsError`" #: ../../c-api/exceptions.rst:1152 @@ -1618,7 +1622,8 @@ msgid "This is a base class for other standard warning categories." msgstr "" #: ../../c-api/exceptions.rst:170 -msgid "strerror()" +#, fuzzy +msgid "strerror (C function)" msgstr "strerror()" #: ../../c-api/exceptions.rst:623 ../../c-api/exceptions.rst:654 @@ -1632,8 +1637,8 @@ msgid "signal" msgstr "signal(訊號)" #: ../../c-api/exceptions.rst:623 ../../c-api/exceptions.rst:654 -msgid "SIGINT" -msgstr "SIGINT" +msgid "SIGINT (C macro)" +msgstr "" #: ../../c-api/exceptions.rst:623 ../../c-api/exceptions.rst:654 #: ../../c-api/exceptions.rst:669 @@ -1641,269 +1646,339 @@ msgid "KeyboardInterrupt (built-in exception)" msgstr "KeyboardInterrupt(內建例外)" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_BaseException" +#, fuzzy +msgid "PyExc_BaseException (C var)" msgstr "PyExc_BaseException" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_Exception" +#, fuzzy +msgid "PyExc_Exception (C var)" msgstr "PyExc_Exception" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_ArithmeticError" +#, fuzzy +msgid "PyExc_ArithmeticError (C var)" msgstr "PyExc_ArithmeticError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_AssertionError" +#, fuzzy +msgid "PyExc_AssertionError (C var)" msgstr "PyExc_AssertionError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_AttributeError" +#, fuzzy +msgid "PyExc_AttributeError (C var)" msgstr "PyExc_AttributeError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_BlockingIOError" +#, fuzzy +msgid "PyExc_BlockingIOError (C var)" msgstr "PyExc_BlockingIOError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_BrokenPipeError" +#, fuzzy +msgid "PyExc_BrokenPipeError (C var)" msgstr "PyExc_BrokenPipeError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_BufferError" +#, fuzzy +msgid "PyExc_BufferError (C var)" msgstr "PyExc_BufferError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_ChildProcessError" +#, fuzzy +msgid "PyExc_ChildProcessError (C var)" msgstr "PyExc_ChildProcessError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_ConnectionAbortedError" +#, fuzzy +msgid "PyExc_ConnectionAbortedError (C var)" msgstr "PyExc_ConnectionAbortedError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_ConnectionError" +#, fuzzy +msgid "PyExc_ConnectionError (C var)" msgstr "PyExc_ConnectionError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_ConnectionRefusedError" +#, fuzzy +msgid "PyExc_ConnectionRefusedError (C var)" msgstr "PyExc_ConnectionRefusedError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_ConnectionResetError" +#, fuzzy +msgid "PyExc_ConnectionResetError (C var)" msgstr "PyExc_ConnectionResetError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_EOFError" +#, fuzzy +msgid "PyExc_EOFError (C var)" msgstr "PyExc_EOFError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_FileExistsError" +#, fuzzy +msgid "PyExc_FileExistsError (C var)" msgstr "PyExc_FileExistsError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_FileNotFoundError" +#, fuzzy +msgid "PyExc_FileNotFoundError (C var)" msgstr "PyExc_FileNotFoundError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_FloatingPointError" +#, fuzzy +msgid "PyExc_FloatingPointError (C var)" msgstr "PyExc_FloatingPointError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_GeneratorExit" +#, fuzzy +msgid "PyExc_GeneratorExit (C var)" msgstr "PyExc_GeneratorExit" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_ImportError" +#, fuzzy +msgid "PyExc_ImportError (C var)" msgstr "PyExc_ImportError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_IndentationError" +#, fuzzy +msgid "PyExc_IndentationError (C var)" msgstr "PyExc_IndentationError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_IndexError" +#, fuzzy +msgid "PyExc_IndexError (C var)" msgstr "PyExc_IndexError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_InterruptedError" +#, fuzzy +msgid "PyExc_InterruptedError (C var)" msgstr "PyExc_InterruptedError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_IsADirectoryError" +#, fuzzy +msgid "PyExc_IsADirectoryError (C var)" msgstr "PyExc_IsADirectoryError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_KeyError" +#, fuzzy +msgid "PyExc_KeyError (C var)" msgstr "PyExc_KeyError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_KeyboardInterrupt" +#, fuzzy +msgid "PyExc_KeyboardInterrupt (C var)" msgstr "PyExc_KeyboardInterrupt" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_LookupError" +#, fuzzy +msgid "PyExc_LookupError (C var)" msgstr "PyExc_LookupError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_MemoryError" +#, fuzzy +msgid "PyExc_MemoryError (C var)" msgstr "PyExc_MemoryError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_ModuleNotFoundError" +#, fuzzy +msgid "PyExc_ModuleNotFoundError (C var)" msgstr "PyExc_ModuleNotFoundError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_NameError" +#, fuzzy +msgid "PyExc_NameError (C var)" msgstr "PyExc_NameError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_NotADirectoryError" +#, fuzzy +msgid "PyExc_NotADirectoryError (C var)" msgstr "PyExc_NotADirectoryError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_NotImplementedError" +#, fuzzy +msgid "PyExc_NotImplementedError (C var)" msgstr "PyExc_NotImplementedError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_OSError" +#, fuzzy +msgid "PyExc_OSError (C var)" msgstr "PyExc_OSError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_OverflowError" +#, fuzzy +msgid "PyExc_OverflowError (C var)" msgstr "PyExc_OverflowError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_PermissionError" +#, fuzzy +msgid "PyExc_PermissionError (C var)" msgstr "PyExc_PermissionError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_ProcessLookupError" +#, fuzzy +msgid "PyExc_ProcessLookupError (C var)" msgstr "PyExc_ProcessLookupError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_RecursionError" +#, fuzzy +msgid "PyExc_RecursionError (C var)" msgstr "PyExc_RecursionError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_ReferenceError" +#, fuzzy +msgid "PyExc_ReferenceError (C var)" msgstr "PyExc_ReferenceError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_RuntimeError" +#, fuzzy +msgid "PyExc_RuntimeError (C var)" msgstr "PyExc_RuntimeError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_StopAsyncIteration" +#, fuzzy +msgid "PyExc_StopAsyncIteration (C var)" msgstr "PyExc_StopAsyncIteration" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_StopIteration" +#, fuzzy +msgid "PyExc_StopIteration (C var)" msgstr "PyExc_StopIteration" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_SyntaxError" +#, fuzzy +msgid "PyExc_SyntaxError (C var)" msgstr "PyExc_SyntaxError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_SystemError" +#, fuzzy +msgid "PyExc_SystemError (C var)" msgstr "PyExc_SystemError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_SystemExit" +#, fuzzy +msgid "PyExc_SystemExit (C var)" msgstr "PyExc_SystemExit" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_TabError" +#, fuzzy +msgid "PyExc_TabError (C var)" msgstr "PyExc_TabError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_TimeoutError" +#, fuzzy +msgid "PyExc_TimeoutError (C var)" msgstr "PyExc_TimeoutError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_TypeError" +#, fuzzy +msgid "PyExc_TypeError (C var)" msgstr "PyExc_TypeError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_UnboundLocalError" +#, fuzzy +msgid "PyExc_UnboundLocalError (C var)" msgstr "PyExc_UnboundLocalError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_UnicodeDecodeError" +#, fuzzy +msgid "PyExc_UnicodeDecodeError (C var)" msgstr "PyExc_UnicodeDecodeError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_UnicodeEncodeError" +#, fuzzy +msgid "PyExc_UnicodeEncodeError (C var)" msgstr "PyExc_UnicodeEncodeError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_UnicodeError" +#, fuzzy +msgid "PyExc_UnicodeError (C var)" msgstr "PyExc_UnicodeError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_UnicodeTranslateError" +#, fuzzy +msgid "PyExc_UnicodeTranslateError (C var)" msgstr "PyExc_UnicodeTranslateError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_ValueError" +#, fuzzy +msgid "PyExc_ValueError (C var)" msgstr "PyExc_ValueError" #: ../../c-api/exceptions.rst:957 -msgid "PyExc_ZeroDivisionError" +#, fuzzy +msgid "PyExc_ZeroDivisionError (C var)" msgstr "PyExc_ZeroDivisionError" #: ../../c-api/exceptions.rst:1140 -msgid "PyExc_EnvironmentError" +#, fuzzy +msgid "PyExc_EnvironmentError (C var)" msgstr "PyExc_EnvironmentError" #: ../../c-api/exceptions.rst:1140 -msgid "PyExc_IOError" +#, fuzzy +msgid "PyExc_IOError (C var)" msgstr "PyExc_IOError" #: ../../c-api/exceptions.rst:1140 -msgid "PyExc_WindowsError" +#, fuzzy +msgid "PyExc_WindowsError (C var)" msgstr "PyExc_WindowsError" #: ../../c-api/exceptions.rst:1177 -msgid "PyExc_Warning" +#, fuzzy +msgid "PyExc_Warning (C var)" msgstr "PyExc_Warning" #: ../../c-api/exceptions.rst:1177 -msgid "PyExc_BytesWarning" +#, fuzzy +msgid "PyExc_BytesWarning (C var)" msgstr "PyExc_BytesWarning" #: ../../c-api/exceptions.rst:1177 -msgid "PyExc_DeprecationWarning" +#, fuzzy +msgid "PyExc_DeprecationWarning (C var)" msgstr "PyExc_DeprecationWarning" #: ../../c-api/exceptions.rst:1177 -msgid "PyExc_FutureWarning" +#, fuzzy +msgid "PyExc_FutureWarning (C var)" msgstr "PyExc_FutureWarning" #: ../../c-api/exceptions.rst:1177 -msgid "PyExc_ImportWarning" +#, fuzzy +msgid "PyExc_ImportWarning (C var)" msgstr "PyExc_ImportWarning" #: ../../c-api/exceptions.rst:1177 -msgid "PyExc_PendingDeprecationWarning" +#, fuzzy +msgid "PyExc_PendingDeprecationWarning (C var)" msgstr "PyExc_PendingDeprecationWarning" #: ../../c-api/exceptions.rst:1177 -msgid "PyExc_ResourceWarning" +#, fuzzy +msgid "PyExc_ResourceWarning (C var)" msgstr "PyExc_ResourceWarning" #: ../../c-api/exceptions.rst:1177 -msgid "PyExc_RuntimeWarning" +#, fuzzy +msgid "PyExc_RuntimeWarning (C var)" msgstr "PyExc_RuntimeWarning" #: ../../c-api/exceptions.rst:1177 -msgid "PyExc_SyntaxWarning" +#, fuzzy +msgid "PyExc_SyntaxWarning (C var)" msgstr "PyExc_SyntaxWarning" #: ../../c-api/exceptions.rst:1177 -msgid "PyExc_UnicodeWarning" +#, fuzzy +msgid "PyExc_UnicodeWarning (C var)" msgstr "PyExc_UnicodeWarning" #: ../../c-api/exceptions.rst:1177 -msgid "PyExc_UserWarning" +#, fuzzy +msgid "PyExc_UserWarning (C var)" msgstr "PyExc_UserWarning" + +#~ msgid "SIGINT" +#~ msgstr "SIGINT" diff --git a/c-api/file.po b/c-api/file.po index a2ef204a16..6cebb19e90 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-05 00:03+0000\n" +"POT-Creation-Date: 2024-02-12 00:03+0000\n" "PO-Revision-Date: 2023-04-24 20:38+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -196,5 +196,6 @@ msgid "EOFError (built-in exception)" msgstr "EOFError(內建例外)" #: ../../c-api/file.rst:98 -msgid "Py_PRINT_RAW" +#, fuzzy +msgid "Py_PRINT_RAW (C macro)" msgstr "Py_PRINT_RAW" diff --git a/c-api/init.po b/c-api/init.po index 248a092daf..06e27d8dd3 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-06 00:03+0000\n" +"POT-Creation-Date: 2024-02-12 00:03+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-" @@ -1033,7 +1033,7 @@ msgid "" "a file, so that other Python threads can run in the meantime." msgstr "" -#: ../../c-api/init.rst:865 +#: ../../c-api/init.rst:864 msgid "" "The Python interpreter keeps some thread-specific bookkeeping information " "inside a data structure called :c:type:`PyThreadState`. There's also one " @@ -1041,32 +1041,32 @@ msgid "" "retrieved using :c:func:`PyThreadState_Get`." msgstr "" -#: ../../c-api/init.rst:871 +#: ../../c-api/init.rst:870 msgid "Releasing the GIL from extension code" msgstr "" -#: ../../c-api/init.rst:873 +#: ../../c-api/init.rst:872 msgid "" "Most extension code manipulating the :term:`GIL` has the following simple " "structure::" msgstr "" -#: ../../c-api/init.rst:882 +#: ../../c-api/init.rst:881 msgid "This is so common that a pair of macros exists to simplify it::" msgstr "" -#: ../../c-api/init.rst:892 +#: ../../c-api/init.rst:891 msgid "" "The :c:macro:`Py_BEGIN_ALLOW_THREADS` macro opens a new block and declares a " "hidden local variable; the :c:macro:`Py_END_ALLOW_THREADS` macro closes the " "block." msgstr "" -#: ../../c-api/init.rst:896 +#: ../../c-api/init.rst:895 msgid "The block above expands to the following code::" msgstr "" -#: ../../c-api/init.rst:908 +#: ../../c-api/init.rst:907 msgid "" "Here is how these functions work: the global interpreter lock is used to " "protect the pointer to the current thread state. When releasing the lock " @@ -1077,7 +1077,7 @@ msgid "" "state, the lock must be acquired before storing the thread state pointer." msgstr "" -#: ../../c-api/init.rst:917 +#: ../../c-api/init.rst:916 msgid "" "Calling system I/O functions is the most common use case for releasing the " "GIL, but it can also be useful before calling long-running computations " @@ -1087,11 +1087,11 @@ msgid "" "compressing or hashing data." msgstr "" -#: ../../c-api/init.rst:928 +#: ../../c-api/init.rst:927 msgid "Non-Python created threads" msgstr "" -#: ../../c-api/init.rst:930 +#: ../../c-api/init.rst:929 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 " @@ -1101,7 +1101,7 @@ msgid "" "for them." msgstr "" -#: ../../c-api/init.rst:937 +#: ../../c-api/init.rst:936 msgid "" "If you need to call Python code from these threads (often this will be part " "of a callback API provided by the aforementioned third-party library), you " @@ -1112,14 +1112,14 @@ msgid "" "finally free the thread state data structure." msgstr "" -#: ../../c-api/init.rst:945 +#: ../../c-api/init.rst:944 msgid "" "The :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release` functions " "do all of the above automatically. The typical idiom for calling into " "Python from a C thread is::" msgstr "" -#: ../../c-api/init.rst:959 +#: ../../c-api/init.rst:958 msgid "" "Note that the ``PyGILState_*`` functions assume there is only one global " "interpreter (created automatically by :c:func:`Py_Initialize`). Python " @@ -1128,11 +1128,11 @@ msgid "" "``PyGILState_*`` API is unsupported." msgstr "" -#: ../../c-api/init.rst:969 +#: ../../c-api/init.rst:968 msgid "Cautions about fork()" msgstr "" -#: ../../c-api/init.rst:971 +#: ../../c-api/init.rst:970 msgid "" "Another important thing to note about threads is their behaviour in the face " "of the C :c:func:`fork` call. On most systems with :c:func:`fork`, after a " @@ -1141,7 +1141,7 @@ msgid "" "CPython's runtime." msgstr "" -#: ../../c-api/init.rst:977 +#: ../../c-api/init.rst:976 msgid "" "The fact that only the \"current\" thread remains means any locks held by " "other threads will never be released. Python solves this for :func:`os.fork` " @@ -1158,7 +1158,7 @@ msgid "" "locks, but is not always able to." msgstr "" -#: ../../c-api/init.rst:992 +#: ../../c-api/init.rst:991 msgid "" "The fact that all other threads go away also means that CPython's runtime " "state there must be cleaned up properly, which :func:`os.fork` does. This " @@ -1171,17 +1171,17 @@ msgid "" "called immediately after." msgstr "" -#: ../../c-api/init.rst:1005 +#: ../../c-api/init.rst:1004 msgid "High-level API" msgstr "高階 API" -#: ../../c-api/init.rst:1007 +#: ../../c-api/init.rst:1006 msgid "" "These are the most commonly used types and functions when writing C " "extension code, or when embedding the Python interpreter:" msgstr "" -#: ../../c-api/init.rst:1012 +#: ../../c-api/init.rst:1011 msgid "" "This data structure represents the state shared by a number of cooperating " "threads. Threads belonging to the same interpreter share their module " @@ -1189,7 +1189,7 @@ msgid "" "in this structure." msgstr "" -#: ../../c-api/init.rst:1017 +#: ../../c-api/init.rst:1016 msgid "" "Threads belonging to different interpreters initially share nothing, except " "process state like available memory, open file descriptors and such. The " @@ -1197,52 +1197,52 @@ msgid "" "which interpreter they belong." msgstr "" -#: ../../c-api/init.rst:1025 +#: ../../c-api/init.rst:1024 msgid "" "This data structure represents the state of a single thread. The only " "public data member is:" msgstr "" -#: ../../c-api/init.rst:1030 +#: ../../c-api/init.rst:1029 msgid "This thread's interpreter state." msgstr "" -#: ../../c-api/init.rst:1041 +#: ../../c-api/init.rst:1040 msgid "Deprecated function which does nothing." msgstr "" -#: ../../c-api/init.rst:1043 +#: ../../c-api/init.rst:1042 msgid "" "In Python 3.6 and older, this function created the GIL if it didn't exist." msgstr "" -#: ../../c-api/init.rst:1045 +#: ../../c-api/init.rst:1044 msgid "The function now does nothing." msgstr "此函式現在不會做任何事情。" -#: ../../c-api/init.rst:1048 +#: ../../c-api/init.rst:1047 msgid "" "This function is now called by :c:func:`Py_Initialize()`, so you don't have " "to call it yourself anymore." msgstr "" -#: ../../c-api/init.rst:1052 +#: ../../c-api/init.rst:1051 msgid "" "This function cannot be called before :c:func:`Py_Initialize()` anymore." msgstr "" -#: ../../c-api/init.rst:1062 +#: ../../c-api/init.rst:1061 msgid "" "Returns a non-zero value if :c:func:`PyEval_InitThreads` has been called. " "This function can be called without holding the GIL, and therefore can be " "used to avoid calls to the locking API when running single-threaded." msgstr "" -#: ../../c-api/init.rst:1066 +#: ../../c-api/init.rst:1065 msgid "The :term:`GIL` is now initialized by :c:func:`Py_Initialize()`." msgstr "" -#: ../../c-api/init.rst:1074 +#: ../../c-api/init.rst:1073 msgid "" "Release the global interpreter lock (if it has been created) and reset the " "thread state to ``NULL``, returning the previous thread state (which is not " @@ -1250,7 +1250,7 @@ msgid "" "acquired it." msgstr "" -#: ../../c-api/init.rst:1082 +#: ../../c-api/init.rst:1081 msgid "" "Acquire the global interpreter lock (if it has been created) and set the " "thread state to *tstate*, which must not be ``NULL``. If the lock has been " @@ -1258,8 +1258,8 @@ msgid "" "ensues." msgstr "" -#: ../../c-api/init.rst:1088 ../../c-api/init.rst:1134 -#: ../../c-api/init.rst:1416 +#: ../../c-api/init.rst:1087 ../../c-api/init.rst:1133 +#: ../../c-api/init.rst:1415 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 " @@ -1268,27 +1268,27 @@ msgid "" "avoid unwanted termination." msgstr "" -#: ../../c-api/init.rst:1096 +#: ../../c-api/init.rst:1095 msgid "" "Return the current thread state. The global interpreter lock must be held. " "When the current thread state is ``NULL``, this issues a fatal error (so " "that the caller needn't check for ``NULL``)." msgstr "" -#: ../../c-api/init.rst:1103 +#: ../../c-api/init.rst:1102 msgid "" "Swap the current thread state with the thread state given by the argument " "*tstate*, which may be ``NULL``. The global interpreter lock must be held " "and is not released." msgstr "" -#: ../../c-api/init.rst:1108 +#: ../../c-api/init.rst:1107 msgid "" "The following functions use thread-local storage, and are not compatible " "with sub-interpreters:" msgstr "" -#: ../../c-api/init.rst:1113 +#: ../../c-api/init.rst:1112 msgid "" "Ensure that the current thread is ready to call the Python C API regardless " "of the current state of Python, or of the global interpreter lock. This may " @@ -1301,7 +1301,7 @@ msgid "" "is acceptable." msgstr "" -#: ../../c-api/init.rst:1123 +#: ../../c-api/init.rst:1122 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:" @@ -1311,13 +1311,13 @@ msgid "" "func:`PyGILState_Release`." msgstr "" -#: ../../c-api/init.rst:1130 +#: ../../c-api/init.rst:1129 msgid "" "When the function returns, the current thread will hold the GIL and be able " "to call arbitrary Python code. Failure is a fatal error." msgstr "" -#: ../../c-api/init.rst:1142 +#: ../../c-api/init.rst:1141 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:" @@ -1325,13 +1325,13 @@ msgid "" "caller, hence the use of the GILState API)." msgstr "" -#: ../../c-api/init.rst:1147 +#: ../../c-api/init.rst:1146 msgid "" "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:1153 +#: ../../c-api/init.rst:1152 msgid "" "Get the current thread state for this thread. May return ``NULL`` if no " "GILState API has been used on the current thread. Note that the main thread " @@ -1339,7 +1339,7 @@ msgid "" "made on the main thread. This is mainly a helper/diagnostic function." msgstr "" -#: ../../c-api/init.rst:1161 +#: ../../c-api/init.rst:1160 msgid "" "Return ``1`` if the current thread is holding the GIL and ``0`` otherwise. " "This function can be called from any thread at any time. Only if it has had " @@ -1350,13 +1350,13 @@ msgid "" "otherwise behave differently." msgstr "" -#: ../../c-api/init.rst:1173 +#: ../../c-api/init.rst:1172 msgid "" "The following macros are normally used without a trailing semicolon; look " "for example usage in the Python source distribution." msgstr "" -#: ../../c-api/init.rst:1179 +#: ../../c-api/init.rst:1178 msgid "" "This macro expands to ``{ PyThreadState *_save; _save = PyEval_SaveThread();" "``. Note that it contains an opening brace; it must be matched with a " @@ -1364,7 +1364,7 @@ msgid "" "discussion of this macro." msgstr "" -#: ../../c-api/init.rst:1187 +#: ../../c-api/init.rst:1186 msgid "" "This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it " "contains a closing brace; it must be matched with an earlier :c:macro:" @@ -1372,40 +1372,40 @@ msgid "" "macro." msgstr "" -#: ../../c-api/init.rst:1195 +#: ../../c-api/init.rst:1194 msgid "" "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:1201 +#: ../../c-api/init.rst:1200 msgid "" "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 "" -#: ../../c-api/init.rst:1207 +#: ../../c-api/init.rst:1206 msgid "Low-level API" msgstr "低階 API" -#: ../../c-api/init.rst:1209 +#: ../../c-api/init.rst:1208 msgid "" "All of the following functions must be called after :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/init.rst:1211 +#: ../../c-api/init.rst:1210 msgid ":c:func:`Py_Initialize()` now initializes the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:1217 +#: ../../c-api/init.rst:1216 msgid "" "Create a new interpreter state object. The global interpreter lock need not " "be held, but may be held if it is necessary to serialize calls to this " "function." msgstr "" -#: ../../c-api/init.rst:1221 +#: ../../c-api/init.rst:1220 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_New`` with no arguments." @@ -1413,13 +1413,13 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." "PyInterpreterState_New``。" -#: ../../c-api/init.rst:1226 +#: ../../c-api/init.rst:1225 msgid "" "Reset all information in an interpreter state object. The global " "interpreter lock must be held." msgstr "" -#: ../../c-api/init.rst:1229 +#: ../../c-api/init.rst:1228 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_Clear`` with no arguments." @@ -1427,40 +1427,40 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." "PyInterpreterState_Clear``。" -#: ../../c-api/init.rst:1234 +#: ../../c-api/init.rst:1233 msgid "" "Destroy an interpreter state object. The global interpreter lock need not " "be held. The interpreter state must have been reset with a previous call " "to :c:func:`PyInterpreterState_Clear`." msgstr "" -#: ../../c-api/init.rst:1241 +#: ../../c-api/init.rst:1240 msgid "" "Create a new thread state object belonging to the given interpreter object. " "The global interpreter lock need not be held, but may be held if it is " "necessary to serialize calls to this function." msgstr "" -#: ../../c-api/init.rst:1248 +#: ../../c-api/init.rst:1247 msgid "" "Reset all information in a thread state object. The global interpreter lock " "must be held." msgstr "" -#: ../../c-api/init.rst:1251 +#: ../../c-api/init.rst:1250 msgid "" "This function now calls the :c:member:`PyThreadState.on_delete` callback. " "Previously, that happened in :c:func:`PyThreadState_Delete`." msgstr "" -#: ../../c-api/init.rst:1258 +#: ../../c-api/init.rst:1257 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`." msgstr "" -#: ../../c-api/init.rst:1265 +#: ../../c-api/init.rst:1264 msgid "" "Destroy the current thread state and release the global interpreter lock. " "Like :c:func:`PyThreadState_Delete`, the global interpreter lock need not be " @@ -1468,119 +1468,119 @@ msgid "" "`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1273 +#: ../../c-api/init.rst:1272 msgid "Get the current frame of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1275 +#: ../../c-api/init.rst:1274 msgid "" "Return a :term:`strong reference`. Return ``NULL`` if no frame is currently " "executing." msgstr "" -#: ../../c-api/init.rst:1278 +#: ../../c-api/init.rst:1277 msgid "See also :c:func:`PyEval_GetFrame`." msgstr "也請見 :c:func:`PyEval_GetFrame`\\ 。" -#: ../../c-api/init.rst:1280 ../../c-api/init.rst:1289 -#: ../../c-api/init.rst:1298 +#: ../../c-api/init.rst:1279 ../../c-api/init.rst:1288 +#: ../../c-api/init.rst:1297 msgid "*tstate* must not be ``NULL``." msgstr "*tstate* 不可為 ``NULL``。" -#: ../../c-api/init.rst:1287 +#: ../../c-api/init.rst:1286 msgid "" "Get the unique thread state identifier of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1296 +#: ../../c-api/init.rst:1295 msgid "Get the interpreter of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1305 +#: ../../c-api/init.rst:1304 msgid "Suspend tracing and profiling in the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1307 +#: ../../c-api/init.rst:1306 msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function." msgstr "" -#: ../../c-api/init.rst:1314 +#: ../../c-api/init.rst:1313 msgid "" "Resume tracing and profiling in the Python thread state *tstate* suspended " "by the :c:func:`PyThreadState_EnterTracing` function." msgstr "" -#: ../../c-api/init.rst:1317 +#: ../../c-api/init.rst:1316 msgid "" "See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions." msgstr "" -#: ../../c-api/init.rst:1325 +#: ../../c-api/init.rst:1324 msgid "Get the current interpreter." msgstr "" -#: ../../c-api/init.rst:1327 +#: ../../c-api/init.rst:1326 msgid "" "Issue a fatal error if there no current Python thread state or no current " "interpreter. It cannot return NULL." msgstr "" -#: ../../c-api/init.rst:1330 ../../c-api/init.rst:1340 +#: ../../c-api/init.rst:1329 ../../c-api/init.rst:1339 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/init.rst:1337 +#: ../../c-api/init.rst:1336 msgid "" "Return the interpreter's unique ID. If there was any error in doing so then " "``-1`` is returned and an error is set." msgstr "" -#: ../../c-api/init.rst:1347 +#: ../../c-api/init.rst:1346 msgid "" "Return a dictionary in which interpreter-specific data may be stored. If " "this function returns ``NULL`` then no exception has been raised and the " "caller should assume no interpreter-specific dict is available." msgstr "" -#: ../../c-api/init.rst:1351 +#: ../../c-api/init.rst:1350 msgid "" "This is not a replacement for :c:func:`PyModule_GetState()`, which " "extensions should use to store interpreter-specific state information." msgstr "" -#: ../../c-api/init.rst:1358 +#: ../../c-api/init.rst:1357 msgid "Type of a frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1360 +#: ../../c-api/init.rst:1359 msgid "" "The *throwflag* parameter is used by the ``throw()`` method of generators: " "if non-zero, handle the current exception." msgstr "" -#: ../../c-api/init.rst:1363 +#: ../../c-api/init.rst:1362 msgid "The function now takes a *tstate* parameter." msgstr "" -#: ../../c-api/init.rst:1366 +#: ../../c-api/init.rst:1365 msgid "" "The *frame* parameter changed from ``PyFrameObject*`` to " "``_PyInterpreterFrame*``." msgstr "" -#: ../../c-api/init.rst:1371 +#: ../../c-api/init.rst:1370 msgid "Get the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1373 ../../c-api/init.rst:1381 +#: ../../c-api/init.rst:1372 ../../c-api/init.rst:1380 msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." msgstr "" -#: ../../c-api/init.rst:1379 +#: ../../c-api/init.rst:1378 msgid "Set the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1388 +#: ../../c-api/init.rst:1387 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 " @@ -1589,7 +1589,7 @@ msgid "" "raised and the caller should assume no current thread state is available." msgstr "" -#: ../../c-api/init.rst:1397 +#: ../../c-api/init.rst:1396 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. " @@ -1601,33 +1601,33 @@ msgid "" "raises no exceptions." msgstr "" -#: ../../c-api/init.rst:1405 +#: ../../c-api/init.rst:1404 msgid "" "The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" "`unsigned long`." msgstr "" -#: ../../c-api/init.rst:1411 +#: ../../c-api/init.rst:1410 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:1422 ../../c-api/init.rst:1460 +#: ../../c-api/init.rst:1421 ../../c-api/init.rst:1459 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." msgstr "" -#: ../../c-api/init.rst:1427 +#: ../../c-api/init.rst:1426 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:1433 +#: ../../c-api/init.rst:1432 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 " @@ -1636,25 +1636,25 @@ msgid "" "isn't, a fatal error is reported." msgstr "" -#: ../../c-api/init.rst:1439 +#: ../../c-api/init.rst:1438 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:1445 +#: ../../c-api/init.rst:1444 msgid "" "Acquire the global interpreter lock. The lock must have been created " "earlier. If this thread already has the lock, a deadlock ensues." msgstr "" -#: ../../c-api/init.rst:1448 +#: ../../c-api/init.rst:1447 msgid "" "This function does not update the current thread state. Please use :c:func:" "`PyEval_RestoreThread` or :c:func:`PyEval_AcquireThread` instead." msgstr "" -#: ../../c-api/init.rst:1454 +#: ../../c-api/init.rst:1453 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 " @@ -1663,23 +1663,23 @@ msgid "" "avoid unwanted termination." msgstr "" -#: ../../c-api/init.rst:1468 +#: ../../c-api/init.rst:1467 msgid "" "Release the global interpreter lock. The lock must have been created " "earlier." msgstr "" -#: ../../c-api/init.rst:1470 +#: ../../c-api/init.rst:1469 msgid "" "This function does not update the current thread state. Please use :c:func:" "`PyEval_SaveThread` or :c:func:`PyEval_ReleaseThread` instead." msgstr "" -#: ../../c-api/init.rst:1479 +#: ../../c-api/init.rst:1478 msgid "Sub-interpreter support" msgstr "" -#: ../../c-api/init.rst:1481 +#: ../../c-api/init.rst:1480 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 " @@ -1687,7 +1687,7 @@ msgid "" "to do that." msgstr "" -#: ../../c-api/init.rst:1486 +#: ../../c-api/init.rst:1485 msgid "" "The \"main\" interpreter is the first one created when the runtime " "initializes. It is usually the only Python interpreter in a process. Unlike " @@ -1698,31 +1698,31 @@ msgid "" "returns a pointer to its state." msgstr "" -#: ../../c-api/init.rst:1493 +#: ../../c-api/init.rst:1492 msgid "" "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:1499 +#: ../../c-api/init.rst:1498 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:1505 +#: ../../c-api/init.rst:1504 msgid "Structure fields:" msgstr "" -#: ../../c-api/init.rst:1509 +#: ../../c-api/init.rst:1508 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:1513 +#: ../../c-api/init.rst:1512 msgid "" "If this is ``0`` then :c:member:`~PyInterpreterConfig." "check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` " @@ -1730,44 +1730,44 @@ msgid "" "`PyInterpreterConfig_OWN_GIL`." msgstr "" -#: ../../c-api/init.rst:1521 +#: ../../c-api/init.rst:1520 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:1525 +#: ../../c-api/init.rst:1524 msgid "" "Note that the :mod:`subprocess` module still works when fork is disallowed." msgstr "" -#: ../../c-api/init.rst:1530 +#: ../../c-api/init.rst:1529 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:1535 +#: ../../c-api/init.rst:1534 msgid "" "Note that the :mod:`subprocess` module still works when exec is disallowed." msgstr "" -#: ../../c-api/init.rst:1540 +#: ../../c-api/init.rst:1539 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:1546 +#: ../../c-api/init.rst:1545 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)." msgstr "" -#: ../../c-api/init.rst:1553 +#: ../../c-api/init.rst:1552 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 " @@ -1776,37 +1776,37 @@ msgid "" "`Py_mod_multiple_interpreters`.)" msgstr "" -#: ../../c-api/init.rst:1560 +#: ../../c-api/init.rst:1559 msgid "" "This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." "use_main_obmalloc` is ``0``." msgstr "" -#: ../../c-api/init.rst:1565 +#: ../../c-api/init.rst:1564 msgid "" "This determines the operation of the GIL for the sub-interpreter. It may be " "one of the following:" msgstr "" -#: ../../c-api/init.rst:1572 +#: ../../c-api/init.rst:1571 msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." msgstr "" -#: ../../c-api/init.rst:1576 +#: ../../c-api/init.rst:1575 msgid "Use (share) the main interpreter's GIL." msgstr "" -#: ../../c-api/init.rst:1580 +#: ../../c-api/init.rst:1579 msgid "Use the sub-interpreter's own GIL." msgstr "" -#: ../../c-api/init.rst:1582 +#: ../../c-api/init.rst:1581 msgid "" "If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" "`PyInterpreterConfig.use_main_obmalloc` must be ``0``." msgstr "" -#: ../../c-api/init.rst:1596 +#: ../../c-api/init.rst:1595 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " @@ -1819,13 +1819,13 @@ msgid "" "underlying file descriptors)." msgstr "" -#: ../../c-api/init.rst:1606 +#: ../../c-api/init.rst:1605 msgid "" "The given *config* controls the options with which the interpreter is " "initialized." msgstr "" -#: ../../c-api/init.rst:1609 +#: ../../c-api/init.rst:1608 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 " @@ -1836,7 +1836,7 @@ msgid "" "state." msgstr "" -#: ../../c-api/init.rst:1618 +#: ../../c-api/init.rst:1617 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. " @@ -1848,13 +1848,13 @@ msgid "" "released here." msgstr "" -#: ../../c-api/init.rst:1629 +#: ../../c-api/init.rst:1628 msgid "" "Sub-interpreters are most effective when isolated from each other, with " "certain functionality restricted::" msgstr "" -#: ../../c-api/init.rst:1643 +#: ../../c-api/init.rst:1642 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:" @@ -1862,11 +1862,11 @@ msgid "" "internally on the :c:type:`PyInterpreterState`." msgstr "" -#: ../../c-api/init.rst:1652 +#: ../../c-api/init.rst:1651 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1654 +#: ../../c-api/init.rst:1653 msgid "" "For modules using multi-phase initialization, e.g. :c:func:" "`PyModule_FromDefAndSpec`, a separate module object is created and " @@ -1874,7 +1874,7 @@ msgid "" "are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1660 +#: ../../c-api/init.rst:1659 msgid "" "For modules using single-phase initialization, e.g. :c:func:" "`PyModule_Create`, the first time a particular extension is imported, it is " @@ -1886,7 +1886,7 @@ msgid "" "might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1671 +#: ../../c-api/init.rst:1670 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:" @@ -1896,7 +1896,7 @@ msgid "" "shared between these modules." msgstr "" -#: ../../c-api/init.rst:1691 +#: ../../c-api/init.rst:1690 msgid "" "Create a new sub-interpreter. This is essentially just a wrapper around :c:" "func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " @@ -1905,7 +1905,7 @@ msgid "" "single-phase init modules." msgstr "" -#: ../../c-api/init.rst:1703 +#: ../../c-api/init.rst:1702 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 " @@ -1915,17 +1915,17 @@ msgid "" "be held before calling this function. No GIL is held when it returns." msgstr "" -#: ../../c-api/init.rst:1711 +#: ../../c-api/init.rst:1710 msgid "" ":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " "explicitly destroyed at that point." msgstr "" -#: ../../c-api/init.rst:1716 +#: ../../c-api/init.rst:1715 msgid "A Per-Interpreter GIL" msgstr "" -#: ../../c-api/init.rst:1718 +#: ../../c-api/init.rst:1717 msgid "" "Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " "that is completely isolated from other interpreters, including having its " @@ -1937,7 +1937,7 @@ msgid "" "just using threads. (See :pep:`554`.)" msgstr "" -#: ../../c-api/init.rst:1728 +#: ../../c-api/init.rst:1727 msgid "" "Using an isolated interpreter requires vigilance in preserving that " "isolation. That especially means not sharing any objects or mutable state " @@ -1951,7 +1951,7 @@ msgid "" "builtin objects." msgstr "" -#: ../../c-api/init.rst:1739 +#: ../../c-api/init.rst:1738 msgid "" "If you preserve isolation then you will have access to proper multi-core " "computing without the complications that come with free-threading. Failure " @@ -1959,7 +1959,7 @@ msgid "" "threading, including races and hard-to-debug crashes." msgstr "" -#: ../../c-api/init.rst:1744 +#: ../../c-api/init.rst:1743 msgid "" "Aside from that, one of the main challenges of using multiple isolated " "interpreters is how to communicate between them safely (not break isolation) " @@ -1969,11 +1969,11 @@ msgid "" "sharing) data between interpreters." msgstr "" -#: ../../c-api/init.rst:1755 +#: ../../c-api/init.rst:1754 msgid "Bugs and caveats" msgstr "" -#: ../../c-api/init.rst:1757 +#: ../../c-api/init.rst:1756 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -1986,7 +1986,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1767 +#: ../../c-api/init.rst:1766 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -1995,7 +1995,7 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1773 +#: ../../c-api/init.rst:1772 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " @@ -2007,25 +2007,25 @@ msgid "" "created threads will probably be broken when using sub-interpreters." msgstr "" -#: ../../c-api/init.rst:1784 +#: ../../c-api/init.rst:1783 msgid "Asynchronous Notifications" msgstr "" -#: ../../c-api/init.rst:1786 +#: ../../c-api/init.rst:1785 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:1795 +#: ../../c-api/init.rst:1792 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:1799 +#: ../../c-api/init.rst:1796 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -2033,17 +2033,17 @@ msgid "" "these conditions met:" msgstr "" -#: ../../c-api/init.rst:1804 +#: ../../c-api/init.rst:1801 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: ../../c-api/init.rst:1805 +#: ../../c-api/init.rst:1802 msgid "" "with the main thread holding the :term:`global interpreter lock` (*func* can " "therefore use the full C API)." msgstr "" -#: ../../c-api/init.rst:1808 +#: ../../c-api/init.rst:1805 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -2051,20 +2051,20 @@ msgid "" "if the global interpreter lock is released." msgstr "" -#: ../../c-api/init.rst:1813 +#: ../../c-api/init.rst:1810 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:1816 +#: ../../c-api/init.rst:1813 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:1821 +#: ../../c-api/init.rst:1818 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 " @@ -2074,7 +2074,7 @@ msgid "" "`PyGILState API`." msgstr "" -#: ../../c-api/init.rst:1828 +#: ../../c-api/init.rst:1825 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 " @@ -2082,18 +2082,18 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:1839 +#: ../../c-api/init.rst:1836 msgid "Profiling and Tracing" msgstr "" -#: ../../c-api/init.rst:1844 +#: ../../c-api/init.rst:1841 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:1848 +#: ../../c-api/init.rst:1845 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 " @@ -2103,7 +2103,7 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: ../../c-api/init.rst:1858 +#: ../../c-api/init.rst:1855 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 " @@ -2115,66 +2115,66 @@ msgid "" "value of *what*:" msgstr "" -#: ../../c-api/init.rst:1867 +#: ../../c-api/init.rst:1864 msgid "Value of *what*" msgstr "" -#: ../../c-api/init.rst:1867 +#: ../../c-api/init.rst:1864 msgid "Meaning of *arg*" msgstr "" -#: ../../c-api/init.rst:1869 +#: ../../c-api/init.rst:1866 msgid ":c:data:`PyTrace_CALL`" msgstr ":c:data:`PyTrace_CALL`" -#: ../../c-api/init.rst:1869 ../../c-api/init.rst:1874 -#: ../../c-api/init.rst:1885 +#: ../../c-api/init.rst:1866 ../../c-api/init.rst:1871 +#: ../../c-api/init.rst:1882 msgid "Always :c:data:`Py_None`." msgstr "" -#: ../../c-api/init.rst:1871 +#: ../../c-api/init.rst:1868 msgid ":c:data:`PyTrace_EXCEPTION`" msgstr ":c:data:`PyTrace_EXCEPTION`" -#: ../../c-api/init.rst:1871 +#: ../../c-api/init.rst:1868 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: ../../c-api/init.rst:1874 +#: ../../c-api/init.rst:1871 msgid ":c:data:`PyTrace_LINE`" msgstr ":c:data:`PyTrace_LINE`" -#: ../../c-api/init.rst:1876 +#: ../../c-api/init.rst:1873 msgid ":c:data:`PyTrace_RETURN`" msgstr ":c:data:`PyTrace_RETURN`" -#: ../../c-api/init.rst:1876 +#: ../../c-api/init.rst:1873 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: ../../c-api/init.rst:1879 +#: ../../c-api/init.rst:1876 msgid ":c:data:`PyTrace_C_CALL`" msgstr ":c:data:`PyTrace_C_CALL`" -#: ../../c-api/init.rst:1879 ../../c-api/init.rst:1881 -#: ../../c-api/init.rst:1883 +#: ../../c-api/init.rst:1876 ../../c-api/init.rst:1878 +#: ../../c-api/init.rst:1880 msgid "Function object being called." msgstr "" -#: ../../c-api/init.rst:1881 +#: ../../c-api/init.rst:1878 msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr ":c:data:`PyTrace_C_EXCEPTION`" -#: ../../c-api/init.rst:1883 +#: ../../c-api/init.rst:1880 msgid ":c:data:`PyTrace_C_RETURN`" msgstr ":c:data:`PyTrace_C_RETURN`" -#: ../../c-api/init.rst:1885 +#: ../../c-api/init.rst:1882 msgid ":c:data:`PyTrace_OPCODE`" msgstr ":c:data:`PyTrace_OPCODE`" -#: ../../c-api/init.rst:1890 +#: ../../c-api/init.rst:1887 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 " @@ -2183,7 +2183,7 @@ msgid "" "the corresponding frame." msgstr "" -#: ../../c-api/init.rst:1899 +#: ../../c-api/init.rst:1896 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 " @@ -2195,7 +2195,7 @@ msgid "" "profiler." msgstr "" -#: ../../c-api/init.rst:1910 +#: ../../c-api/init.rst:1907 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 " @@ -2203,31 +2203,31 @@ msgid "" "f_trace_lines` to *0* on that frame." msgstr "" -#: ../../c-api/init.rst:1918 +#: ../../c-api/init.rst:1915 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:1924 +#: ../../c-api/init.rst:1921 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:1930 +#: ../../c-api/init.rst:1927 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:1936 +#: ../../c-api/init.rst:1933 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:1942 +#: ../../c-api/init.rst:1939 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 " @@ -2235,7 +2235,7 @@ msgid "" "attr:`~frame.f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:1950 +#: ../../c-api/init.rst:1947 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``. " @@ -2245,29 +2245,29 @@ msgid "" "`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:1957 +#: ../../c-api/init.rst:1954 msgid "See also the :func:`sys.setprofile` function." msgstr "" -#: ../../c-api/init.rst:1959 ../../c-api/init.rst:1966 -#: ../../c-api/init.rst:1985 ../../c-api/init.rst:1992 +#: ../../c-api/init.rst:1956 ../../c-api/init.rst:1963 +#: ../../c-api/init.rst:1982 ../../c-api/init.rst:1989 msgid "The caller must hold the :term:`GIL`." msgstr "呼叫者必須持有 :term:`GIL`。" -#: ../../c-api/init.rst:1963 +#: ../../c-api/init.rst:1960 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:1968 +#: ../../c-api/init.rst:1965 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:1976 +#: ../../c-api/init.rst:1973 msgid "" "Set the tracing function to *func*. This is similar to :c:func:" "`PyEval_SetProfile`, except the tracing function does receive line-number " @@ -2278,65 +2278,65 @@ msgid "" "*what* parameter." msgstr "" -#: ../../c-api/init.rst:1983 +#: ../../c-api/init.rst:1980 msgid "See also the :func:`sys.settrace` function." msgstr "也請見 :func:`sys.settrace` 函式。" -#: ../../c-api/init.rst:1989 +#: ../../c-api/init.rst:1986 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:1994 +#: ../../c-api/init.rst:1991 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:2003 +#: ../../c-api/init.rst:2000 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:2008 +#: ../../c-api/init.rst:2005 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:2013 +#: ../../c-api/init.rst:2010 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:2018 +#: ../../c-api/init.rst:2015 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:2023 +#: ../../c-api/init.rst:2020 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:2029 +#: ../../c-api/init.rst:2026 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:2035 +#: ../../c-api/init.rst:2032 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:2042 +#: ../../c-api/init.rst:2039 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:2046 +#: ../../c-api/init.rst:2043 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2346,19 +2346,19 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:2053 +#: ../../c-api/init.rst:2050 msgid "" "The GIL does *not* need to be held when calling these functions; they supply " "their own locking." msgstr "" -#: ../../c-api/init.rst:2056 +#: ../../c-api/init.rst:2053 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:2060 +#: ../../c-api/init.rst:2057 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 " @@ -2366,22 +2366,22 @@ msgid "" "don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:2068 +#: ../../c-api/init.rst:2065 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:2070 +#: ../../c-api/init.rst:2067 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:2076 +#: ../../c-api/init.rst:2073 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:2081 +#: ../../c-api/init.rst:2078 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 " @@ -2389,52 +2389,52 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:2086 +#: ../../c-api/init.rst:2083 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:2092 +#: ../../c-api/init.rst:2089 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:2097 +#: ../../c-api/init.rst:2094 msgid "Dynamic Allocation" msgstr "" -#: ../../c-api/init.rst:2099 +#: ../../c-api/init.rst:2096 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:2106 +#: ../../c-api/init.rst:2103 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." msgstr "" -#: ../../c-api/init.rst:2113 +#: ../../c-api/init.rst:2110 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:2119 +#: ../../c-api/init.rst:2116 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:2124 +#: ../../c-api/init.rst:2121 msgid "Methods" msgstr "方法" -#: ../../c-api/init.rst:2126 +#: ../../c-api/init.rst:2123 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 " @@ -2442,13 +2442,13 @@ msgid "" "func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2134 +#: ../../c-api/init.rst:2131 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:2140 +#: ../../c-api/init.rst:2137 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 " @@ -2457,7 +2457,7 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: ../../c-api/init.rst:2149 +#: ../../c-api/init.rst:2146 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 " @@ -2466,31 +2466,31 @@ msgid "" "key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:2158 +#: ../../c-api/init.rst:2155 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:2165 +#: ../../c-api/init.rst:2162 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:2173 +#: ../../c-api/init.rst:2170 msgid "Thread Local Storage (TLS) API" msgstr "" -#: ../../c-api/init.rst:2175 +#: ../../c-api/init.rst:2172 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: ../../c-api/init.rst:2180 +#: ../../c-api/init.rst:2177 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 " @@ -2499,7 +2499,7 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2185 +#: ../../c-api/init.rst:2182 msgid "" "Due to the compatibility problem noted above, this version of the API should " "not be used in new code." @@ -2522,20 +2522,20 @@ msgid "path (in module sys)" msgstr "path(sys 模組中)" #: ../../c-api/init.rst:334 ../../c-api/init.rst:589 ../../c-api/init.rst:615 -#: ../../c-api/init.rst:1057 ../../c-api/init.rst:1588 -#: ../../c-api/init.rst:1683 +#: ../../c-api/init.rst:1056 ../../c-api/init.rst:1587 +#: ../../c-api/init.rst:1682 msgid "module" msgstr "模組" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1588 ../../c-api/init.rst:1683 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1588 ../../c-api/init.rst:1683 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 msgid "__main__" msgstr "__main__" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1588 ../../c-api/init.rst:1683 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 msgid "sys" msgstr "sys" @@ -2548,18 +2548,21 @@ msgid "path" msgstr "path(路徑)" #: ../../c-api/init.rst:334 -msgid "PySys_SetArgv()" +#, fuzzy +msgid "PySys_SetArgv (C function)" msgstr "PySys_SetArgv()" #: ../../c-api/init.rst:334 -msgid "PySys_SetArgvEx()" +#, fuzzy +msgid "PySys_SetArgvEx (C function)" msgstr "PySys_SetArgvEx()" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1648 ../../c-api/init.rst:1701 -msgid "Py_FinalizeEx()" +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1647 ../../c-api/init.rst:1700 +#, fuzzy +msgid "Py_FinalizeEx (C function)" msgstr "Py_FinalizeEx()" -#: ../../c-api/init.rst:430 ../../c-api/init.rst:467 ../../c-api/init.rst:1648 +#: ../../c-api/init.rst:430 ../../c-api/init.rst:467 msgid "Py_Initialize()" msgstr "Py_Initialize()" @@ -2624,57 +2627,76 @@ msgid "lock, interpreter" msgstr "lock, interpreter(鎖、直譯器)" #: ../../c-api/init.rst:852 -msgid "setswitchinterval() (in module sys)" +#, fuzzy +msgid "setswitchinterval (in module sys)" msgstr "setswitchinterval() (sys 模組中)" #: ../../c-api/init.rst:861 -msgid "PyThreadState" +#, fuzzy +msgid "PyThreadState (C type)" msgstr "PyThreadState" -#: ../../c-api/init.rst:888 -msgid "Py_BEGIN_ALLOW_THREADS" +#: ../../c-api/init.rst:887 +#, fuzzy +msgid "Py_BEGIN_ALLOW_THREADS (C macro)" msgstr "Py_BEGIN_ALLOW_THREADS" -#: ../../c-api/init.rst:888 -msgid "Py_END_ALLOW_THREADS" +#: ../../c-api/init.rst:887 +#, fuzzy +msgid "Py_END_ALLOW_THREADS (C macro)" msgstr "Py_END_ALLOW_THREADS" -#: ../../c-api/init.rst:904 ../../c-api/init.rst:1035 -msgid "PyEval_RestoreThread()" +#: ../../c-api/init.rst:903 +#, fuzzy +msgid "PyEval_RestoreThread (C function)" msgstr "PyEval_RestoreThread()" -#: ../../c-api/init.rst:904 ../../c-api/init.rst:1035 -msgid "PyEval_SaveThread()" +#: ../../c-api/init.rst:903 +#, fuzzy +msgid "PyEval_SaveThread (C function)" msgstr "PyEval_SaveThread()" -#: ../../c-api/init.rst:1035 +#: ../../c-api/init.rst:1034 msgid "PyEval_AcquireThread()" msgstr "PyEval_AcquireThread()" -#: ../../c-api/init.rst:1035 +#: ../../c-api/init.rst:1034 msgid "PyEval_ReleaseThread()" msgstr "PyEval_ReleaseThread()" -#: ../../c-api/init.rst:1057 +#: ../../c-api/init.rst:1034 +msgid "PyEval_SaveThread()" +msgstr "PyEval_SaveThread()" + +#: ../../c-api/init.rst:1034 +msgid "PyEval_RestoreThread()" +msgstr "PyEval_RestoreThread()" + +#: ../../c-api/init.rst:1056 msgid "_thread" msgstr "_thread" -#: ../../c-api/init.rst:1588 ../../c-api/init.rst:1683 +#: ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 msgid "stdout (in module sys)" msgstr "stdout(sys 模組中)" -#: ../../c-api/init.rst:1588 ../../c-api/init.rst:1683 +#: ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 msgid "stderr (in module sys)" msgstr "stderr(sys 模組中)" -#: ../../c-api/init.rst:1588 ../../c-api/init.rst:1683 +#: ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 msgid "stdin (in module sys)" msgstr "stdin(sys 模組中)" -#: ../../c-api/init.rst:1678 -msgid "close() (in module os)" +#: ../../c-api/init.rst:1647 +#, fuzzy +msgid "Py_Initialize (C function)" +msgstr "Py_Initialize()" + +#: ../../c-api/init.rst:1677 +#, fuzzy +msgid "close (in module os)" msgstr "close()(sys 模組中)" -#: ../../c-api/init.rst:1793 -msgid "Py_AddPendingCall()" -msgstr "Py_AddPendingCall()" +#~ msgid "Py_AddPendingCall()" +#~ msgstr "Py_AddPendingCall()" diff --git a/c-api/intro.po b/c-api/intro.po index 113cd116d4..df40c84a89 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-08 00:03+0000\n" +"POT-Creation-Date: 2024-02-12 00:03+0000\n" "PO-Revision-Date: 2023-04-25 18:01+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1098,19 +1098,23 @@ msgid "type" msgstr "type(型別)" #: ../../c-api/intro.rst:327 -msgid "Py_INCREF()" +#, fuzzy +msgid "Py_INCREF (C function)" msgstr "Py_INCREF()" #: ../../c-api/intro.rst:327 -msgid "Py_DECREF()" +#, fuzzy +msgid "Py_DECREF (C function)" msgstr "Py_DECREF()" #: ../../c-api/intro.rst:403 -msgid "PyList_SetItem()" +#, fuzzy +msgid "PyList_SetItem (C function)" msgstr "PyList_SetItem()" #: ../../c-api/intro.rst:403 -msgid "PyTuple_SetItem()" +#, fuzzy +msgid "PyTuple_SetItem (C function)" msgstr "PyTuple_SetItem()" #: ../../c-api/intro.rst:474 @@ -1118,11 +1122,13 @@ msgid "set_all()" msgstr "set_all()" #: ../../c-api/intro.rst:493 -msgid "PyList_GetItem()" +#, fuzzy +msgid "PyList_GetItem (C function)" msgstr "PyList_GetItem()" #: ../../c-api/intro.rst:493 -msgid "PySequence_GetItem()" +#, fuzzy +msgid "PySequence_GetItem (C function)" msgstr "PySequence_GetItem()" #: ../../c-api/intro.rst:523 @@ -1134,19 +1140,23 @@ msgid "sum_sequence()" msgstr "sum_sequence()" #: ../../c-api/intro.rst:590 -msgid "PyErr_Occurred()" +#, fuzzy +msgid "PyErr_Occurred (C function)" msgstr "PyErr_Occurred()" #: ../../c-api/intro.rst:603 -msgid "PyErr_SetString()" +#, fuzzy +msgid "PyErr_SetString (C function)" msgstr "PyErr_SetString()" #: ../../c-api/intro.rst:603 ../../c-api/intro.rst:711 -msgid "PyErr_Clear()" +#, fuzzy +msgid "PyErr_Clear (C function)" msgstr "PyErr_Clear()" #: ../../c-api/intro.rst:627 -msgid "exc_info() (in module sys)" +#, fuzzy +msgid "exc_info (in module sys)" msgstr "exc_info() (sys 模組中)" #: ../../c-api/intro.rst:662 ../../c-api/intro.rst:709 @@ -1154,15 +1164,18 @@ msgid "incr_item()" msgstr "incr_item()" #: ../../c-api/intro.rst:711 -msgid "PyErr_ExceptionMatches()" +#, fuzzy +msgid "PyErr_ExceptionMatches (C function)" msgstr "PyErr_ExceptionMatches()" #: ../../c-api/intro.rst:711 -msgid "Py_XDECREF()" +#, fuzzy +msgid "Py_XDECREF (C function)" msgstr "Py_XDECREF()" #: ../../c-api/intro.rst:737 -msgid "Py_Initialize()" +#, fuzzy +msgid "Py_Initialize (C function)" msgstr "Py_Initialize()" #: ../../c-api/intro.rst:737 @@ -1194,25 +1207,31 @@ msgid "path (in module sys)" msgstr "path(sys 模組中)" #: ../../c-api/intro.rst:772 -msgid "Py_SetProgramName()" +#, fuzzy +msgid "Py_SetProgramName (C function)" msgstr "Py_SetProgramName()" #: ../../c-api/intro.rst:772 -msgid "Py_GetPath()" +#, fuzzy +msgid "Py_GetPath (C function)" msgstr "Py_GetPath()" #: ../../c-api/intro.rst:772 -msgid "Py_GetPrefix()" +#, fuzzy +msgid "Py_GetPrefix (C function)" msgstr "Py_GetPrefix()" #: ../../c-api/intro.rst:772 -msgid "Py_GetExecPrefix()" +#, fuzzy +msgid "Py_GetExecPrefix (C function)" msgstr "Py_GetExecPrefix()" #: ../../c-api/intro.rst:772 -msgid "Py_GetProgramFullPath()" +#, fuzzy +msgid "Py_GetProgramFullPath (C function)" msgstr "Py_GetProgramFullPath()" #: ../../c-api/intro.rst:787 -msgid "Py_IsInitialized()" +#, fuzzy +msgid "Py_IsInitialized (C function)" msgstr "Py_IsInitialized()" diff --git a/c-api/long.po b/c-api/long.po index 61e8cfc2db..61d3cbc925 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2024-02-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -381,7 +381,8 @@ msgid "integer" msgstr "integer(整数)" #: ../../c-api/long.rst:119 -msgid "LONG_MAX" +#, fuzzy +msgid "LONG_MAX (C macro)" msgstr "LONG_MAX" #: ../../c-api/long.rst:119 ../../c-api/long.rst:161 ../../c-api/long.rst:204 @@ -390,13 +391,16 @@ msgid "OverflowError (built-in exception)" msgstr "OverflowError(内建例外)" #: ../../c-api/long.rst:204 -msgid "PY_SSIZE_T_MAX" +#, fuzzy +msgid "PY_SSIZE_T_MAX (C macro)" msgstr "PY_SSIZE_T_MAX" #: ../../c-api/long.rst:219 -msgid "ULONG_MAX" +#, fuzzy +msgid "ULONG_MAX (C macro)" msgstr "ULONG_MAX" #: ../../c-api/long.rst:235 -msgid "SIZE_MAX" +#, fuzzy +msgid "SIZE_MAX (C macro)" msgstr "SIZE_MAX" diff --git a/c-api/memory.po b/c-api/memory.po index 53604c3883..881779e18d 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-22 00:03+0000\n" +"POT-Creation-Date: 2024-02-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1074,17 +1074,27 @@ msgid "" msgstr "" #: ../../c-api/memory.rst:43 -msgid "malloc()" -msgstr "malloc()" +msgid "malloc (C function)" +msgstr "" #: ../../c-api/memory.rst:43 -msgid "calloc()" -msgstr "calloc()" +msgid "calloc (C function)" +msgstr "" #: ../../c-api/memory.rst:43 -msgid "realloc()" +#, fuzzy +msgid "realloc (C function)" msgstr "realloc()" #: ../../c-api/memory.rst:43 -msgid "free()" -msgstr "free()" +msgid "free (C function)" +msgstr "" + +#~ msgid "malloc()" +#~ msgstr "malloc()" + +#~ msgid "calloc()" +#~ msgstr "calloc()" + +#~ msgid "free()" +#~ msgstr "free()" diff --git a/c-api/structures.po b/c-api/structures.po index 8133a2ccdb..38d4aec16d 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-25 06:20+0000\n" +"POT-Creation-Date: 2024-02-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -852,93 +852,135 @@ msgid "staticmethod" msgstr "staticmethod" #: ../../c-api/structures.rst:563 -msgid "READ_RESTRICTED" +#, fuzzy +msgid "READ_RESTRICTED (C macro)" msgstr "READ_RESTRICTED" #: ../../c-api/structures.rst:563 -msgid "WRITE_RESTRICTED" +#, fuzzy +msgid "WRITE_RESTRICTED (C macro)" msgstr "WRITE_RESTRICTED" #: ../../c-api/structures.rst:563 -msgid "RESTRICTED" +#, fuzzy +msgid "RESTRICTED (C macro)" msgstr "RESTRICTED" #: ../../c-api/structures.rst:576 -msgid "READONLY" +#, fuzzy +msgid "READONLY (C macro)" msgstr "READONLY" #: ../../c-api/structures.rst:639 -msgid "T_BYTE" -msgstr "T_BYTE" +msgid "T_BYTE (C macro)" +msgstr "" #: ../../c-api/structures.rst:639 -msgid "T_SHORT" -msgstr "T_SHORT" +msgid "T_SHORT (C macro)" +msgstr "" #: ../../c-api/structures.rst:639 -msgid "T_INT" -msgstr "T_INT" +msgid "T_INT (C macro)" +msgstr "" #: ../../c-api/structures.rst:639 -msgid "T_LONG" -msgstr "T_LONG" +msgid "T_LONG (C macro)" +msgstr "" #: ../../c-api/structures.rst:639 -msgid "T_LONGLONG" +#, fuzzy +msgid "T_LONGLONG (C macro)" msgstr "T_LONGLONG" #: ../../c-api/structures.rst:639 -msgid "T_UBYTE" -msgstr "T_UBYTE" +msgid "T_UBYTE (C macro)" +msgstr "" #: ../../c-api/structures.rst:639 -msgid "T_USHORT" +#, fuzzy +msgid "T_USHORT (C macro)" msgstr "T_USHORT" #: ../../c-api/structures.rst:639 -msgid "T_UINT" -msgstr "T_UINT" +msgid "T_UINT (C macro)" +msgstr "" #: ../../c-api/structures.rst:639 -msgid "T_ULONG" -msgstr "T_ULONG" +msgid "T_ULONG (C macro)" +msgstr "" #: ../../c-api/structures.rst:639 -msgid "T_ULONGULONG" +#, fuzzy +msgid "T_ULONGULONG (C macro)" msgstr "T_ULONGULONG" #: ../../c-api/structures.rst:639 -msgid "T_PYSSIZET" +#, fuzzy +msgid "T_PYSSIZET (C macro)" msgstr "T_PYSSIZET" #: ../../c-api/structures.rst:639 -msgid "T_FLOAT" -msgstr "T_FLOAT" +msgid "T_FLOAT (C macro)" +msgstr "" #: ../../c-api/structures.rst:639 -msgid "T_DOUBLE" +#, fuzzy +msgid "T_DOUBLE (C macro)" msgstr "T_DOUBLE" #: ../../c-api/structures.rst:639 -msgid "T_BOOL" -msgstr "T_BOOL" +msgid "T_BOOL (C macro)" +msgstr "" #: ../../c-api/structures.rst:639 -msgid "T_CHAR" -msgstr "T_CHAR" +msgid "T_CHAR (C macro)" +msgstr "" #: ../../c-api/structures.rst:639 -msgid "T_STRING" +#, fuzzy +msgid "T_STRING (C macro)" msgstr "T_STRING" #: ../../c-api/structures.rst:639 -msgid "T_STRING_INPLACE" +#, fuzzy +msgid "T_STRING_INPLACE (C macro)" msgstr "T_STRING_INPLACE" #: ../../c-api/structures.rst:639 -msgid "T_OBJECT_EX" +#, fuzzy +msgid "T_OBJECT_EX (C macro)" msgstr "T_OBJECT_EX" #: ../../c-api/structures.rst:639 msgid "structmember.h" msgstr "structmember.h" + +#~ msgid "T_BYTE" +#~ msgstr "T_BYTE" + +#~ msgid "T_SHORT" +#~ msgstr "T_SHORT" + +#~ msgid "T_INT" +#~ msgstr "T_INT" + +#~ msgid "T_LONG" +#~ msgstr "T_LONG" + +#~ msgid "T_UBYTE" +#~ msgstr "T_UBYTE" + +#~ msgid "T_UINT" +#~ msgstr "T_UINT" + +#~ msgid "T_ULONG" +#~ msgstr "T_ULONG" + +#~ msgid "T_FLOAT" +#~ msgstr "T_FLOAT" + +#~ msgid "T_BOOL" +#~ msgstr "T_BOOL" + +#~ msgid "T_CHAR" +#~ msgstr "T_CHAR" diff --git a/c-api/sys.po b/c-api/sys.po index ba49aadc7f..66cea5506b 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2024-02-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,7 +25,7 @@ msgstr "" msgid "Operating System Utilities" msgstr "作業系統工具" -#: ../../c-api/sys.rst:10 +#: ../../c-api/sys.rst:11 msgid "" "Return the file system representation for *path*. If the object is a :class:" "`str` or :class:`bytes` object, then a new :term:`strong reference` is " @@ -35,7 +35,7 @@ msgid "" "is returned." msgstr "" -#: ../../c-api/sys.rst:23 +#: ../../c-api/sys.rst:24 msgid "" "Return true (nonzero) if the standard I/O file *fp* with name *filename* is " "deemed interactive. This is the case for files for which " @@ -45,11 +45,11 @@ msgid "" "``'???'``." msgstr "" -#: ../../c-api/sys.rst:29 +#: ../../c-api/sys.rst:30 msgid "This function must not be called before Python is initialized." msgstr "" -#: ../../c-api/sys.rst:34 +#: ../../c-api/sys.rst:35 msgid "" "Function to prepare some internal state before a process fork. This should " "be called before calling :c:func:`fork` or any similar function that clones " @@ -57,14 +57,14 @@ msgid "" "defined." msgstr "" -#: ../../c-api/sys.rst:40 +#: ../../c-api/sys.rst:41 msgid "" "The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread " "` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_BeforeFork()``." msgstr "" -#: ../../c-api/sys.rst:50 +#: ../../c-api/sys.rst:51 msgid "" "Function to update some internal state after a process fork. This should be " "called from the parent process after calling :c:func:`fork` or any similar " @@ -73,14 +73,14 @@ msgid "" "defined." msgstr "" -#: ../../c-api/sys.rst:57 +#: ../../c-api/sys.rst:58 msgid "" "The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread " "` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_AfterFork_Parent()``." msgstr "" -#: ../../c-api/sys.rst:67 +#: ../../c-api/sys.rst:68 msgid "" "Function to update internal interpreter state after a process fork. This " "must be called from the child process after calling :c:func:`fork`, or any " @@ -89,21 +89,21 @@ msgid "" "systems where :c:func:`fork` is defined." msgstr "" -#: ../../c-api/sys.rst:74 +#: ../../c-api/sys.rst:75 msgid "" "The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread " "` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_AfterFork_Child()``." msgstr "" -#: ../../c-api/sys.rst:82 +#: ../../c-api/sys.rst:83 msgid "" ":func:`os.register_at_fork` allows registering custom Python functions to be " "called by :c:func:`PyOS_BeforeFork()`, :c:func:`PyOS_AfterFork_Parent` and :" "c:func:`PyOS_AfterFork_Child`." msgstr "" -#: ../../c-api/sys.rst:89 +#: ../../c-api/sys.rst:90 msgid "" "Function to update some internal state after a process fork; this should be " "called in the new process if the Python interpreter will continue to be " @@ -111,50 +111,48 @@ msgid "" "not need to be called." msgstr "" -#: ../../c-api/sys.rst:94 +#: ../../c-api/sys.rst:95 msgid "This function is superseded by :c:func:`PyOS_AfterFork_Child()`." msgstr "" -#: ../../c-api/sys.rst:100 +#: ../../c-api/sys.rst:103 msgid "" "Return true when the interpreter runs out of stack space. This is a " -"reliable check, but is only available when :c:macro:`USE_STACKCHECK` is " +"reliable check, but is only available when :c:macro:`!USE_STACKCHECK` is " "defined (currently on certain versions of Windows using the Microsoft Visual " -"C++ compiler). :c:macro:`USE_STACKCHECK` will be defined automatically; you " +"C++ compiler). :c:macro:`!USE_STACKCHECK` will be defined automatically; you " "should never change the definition in your own code." msgstr "" -#: ../../c-api/sys.rst:109 +#: ../../c-api/sys.rst:115 msgid "" "Return the current signal handler for signal *i*. This is a thin wrapper " "around either :c:func:`!sigaction` or :c:func:`!signal`. Do not call those " -"functions directly! :c:type:`PyOS_sighandler_t` is a typedef alias for :c:" -"expr:`void (\\*)(int)`." +"functions directly!" msgstr "" -#: ../../c-api/sys.rst:117 +#: ../../c-api/sys.rst:122 msgid "" "Set the signal handler for signal *i* to be *h*; return the old signal " "handler. This is a thin wrapper around either :c:func:`!sigaction` or :c:" -"func:`!signal`. Do not call those functions directly! :c:type:" -"`PyOS_sighandler_t` is a typedef alias for :c:expr:`void (\\*)(int)`." +"func:`!signal`. Do not call those functions directly!" msgstr "" -#: ../../c-api/sys.rst:125 +#: ../../c-api/sys.rst:129 msgid "" "This function should not be called directly: use the :c:type:`PyConfig` API " "with the :c:func:`PyConfig_SetBytesString` function which ensures that :ref:" "`Python is preinitialized `." msgstr "" -#: ../../c-api/sys.rst:129 ../../c-api/sys.rst:196 +#: ../../c-api/sys.rst:133 ../../c-api/sys.rst:200 msgid "" "This function must not be called before :ref:`Python is preinitialized ` and so that the LC_CTYPE locale is properly configured: see the :c:" "func:`Py_PreInitialize` function." msgstr "" -#: ../../c-api/sys.rst:133 +#: ../../c-api/sys.rst:137 msgid "" "Decode a byte string from the :term:`filesystem encoding and error handler`. " "If the error handler is :ref:`surrogateescape error handler " @@ -164,57 +162,57 @@ msgid "" "instead of decoding them." msgstr "" -#: ../../c-api/sys.rst:140 +#: ../../c-api/sys.rst:144 msgid "" "Return a pointer to a newly allocated wide character string, use :c:func:" "`PyMem_RawFree` to free the memory. If size is not ``NULL``, write the " "number of wide characters excluding the null character into ``*size``" msgstr "" -#: ../../c-api/sys.rst:144 +#: ../../c-api/sys.rst:148 msgid "" "Return ``NULL`` on decoding error or memory allocation error. If *size* is " "not ``NULL``, ``*size`` is set to ``(size_t)-1`` on memory error or set to " "``(size_t)-2`` on decoding error." msgstr "" -#: ../../c-api/sys.rst:148 ../../c-api/sys.rst:188 +#: ../../c-api/sys.rst:152 ../../c-api/sys.rst:192 msgid "" "The :term:`filesystem encoding and error handler` are selected by :c:func:" "`PyConfig_Read`: see :c:member:`~PyConfig.filesystem_encoding` and :c:member:" "`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." msgstr "" -#: ../../c-api/sys.rst:152 +#: ../../c-api/sys.rst:156 msgid "" "Decoding errors should never happen, unless there is a bug in the C library." msgstr "" -#: ../../c-api/sys.rst:155 +#: ../../c-api/sys.rst:159 msgid "" "Use the :c:func:`Py_EncodeLocale` function to encode the character string " "back to a byte string." msgstr "" -#: ../../c-api/sys.rst:160 +#: ../../c-api/sys.rst:164 msgid "" "The :c:func:`PyUnicode_DecodeFSDefaultAndSize` and :c:func:" "`PyUnicode_DecodeLocaleAndSize` functions." msgstr "" -#: ../../c-api/sys.rst:165 ../../c-api/sys.rst:207 +#: ../../c-api/sys.rst:169 ../../c-api/sys.rst:211 msgid "" "The function now uses the UTF-8 encoding in the :ref:`Python UTF-8 Mode " "`." msgstr "" -#: ../../c-api/sys.rst:169 +#: ../../c-api/sys.rst:173 msgid "" "The function now uses the UTF-8 encoding on Windows if :c:member:" "`PyPreConfig.legacy_windows_fs_encoding` is zero;" msgstr "" -#: ../../c-api/sys.rst:176 +#: ../../c-api/sys.rst:180 msgid "" "Encode a wide character string to the :term:`filesystem encoding and error " "handler`. If the error handler is :ref:`surrogateescape error handler " @@ -222,42 +220,42 @@ msgid "" "converted to bytes 0x80..0xFF." msgstr "" -#: ../../c-api/sys.rst:181 +#: ../../c-api/sys.rst:185 msgid "" "Return a pointer to a newly allocated byte string, use :c:func:`PyMem_Free` " "to free the memory. Return ``NULL`` on encoding error or memory allocation " "error." msgstr "" -#: ../../c-api/sys.rst:185 +#: ../../c-api/sys.rst:189 msgid "" "If error_pos is not ``NULL``, ``*error_pos`` is set to ``(size_t)-1`` on " "success, or set to the index of the invalid character on encoding error." msgstr "" -#: ../../c-api/sys.rst:192 +#: ../../c-api/sys.rst:196 msgid "" "Use the :c:func:`Py_DecodeLocale` function to decode the bytes string back " "to a wide character string." msgstr "" -#: ../../c-api/sys.rst:202 +#: ../../c-api/sys.rst:206 msgid "" "The :c:func:`PyUnicode_EncodeFSDefault` and :c:func:`PyUnicode_EncodeLocale` " "functions." msgstr "" -#: ../../c-api/sys.rst:211 +#: ../../c-api/sys.rst:215 msgid "" "The function now uses the UTF-8 encoding on Windows if :c:member:" "`PyPreConfig.legacy_windows_fs_encoding` is zero." msgstr "" -#: ../../c-api/sys.rst:219 +#: ../../c-api/sys.rst:223 msgid "System Functions" msgstr "系統函式" -#: ../../c-api/sys.rst:221 +#: ../../c-api/sys.rst:225 msgid "" "These are utility functions that make functionality from the :mod:`sys` " "module accessible to C code. They all work with the current interpreter " @@ -265,43 +263,43 @@ msgid "" "state structure." msgstr "" -#: ../../c-api/sys.rst:227 +#: ../../c-api/sys.rst:231 msgid "" "Return the object *name* from the :mod:`sys` module or ``NULL`` if it does " "not exist, without setting an exception." msgstr "" -#: ../../c-api/sys.rst:232 +#: ../../c-api/sys.rst:236 msgid "" "Set *name* in the :mod:`sys` module to *v* unless *v* is ``NULL``, in which " "case *name* is deleted from the sys module. Returns ``0`` on success, ``-1`` " "on error." msgstr "" -#: ../../c-api/sys.rst:238 +#: ../../c-api/sys.rst:242 msgid "" "Reset :data:`sys.warnoptions` to an empty list. This function may be called " "prior to :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/sys.rst:243 ../../c-api/sys.rst:254 +#: ../../c-api/sys.rst:247 ../../c-api/sys.rst:258 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "warnoptions` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/sys.rst:247 +#: ../../c-api/sys.rst:251 msgid "" "Append *s* to :data:`sys.warnoptions`. This function must be called prior " "to :c:func:`Py_Initialize` in order to affect the warnings filter list." msgstr "" -#: ../../c-api/sys.rst:258 +#: ../../c-api/sys.rst:262 msgid "Append *unicode* to :data:`sys.warnoptions`." msgstr "" -#: ../../c-api/sys.rst:260 +#: ../../c-api/sys.rst:264 msgid "" "Note: this function is not currently usable from outside the CPython " "implementation, as it must be called prior to the implicit import of :mod:" @@ -310,7 +308,7 @@ msgid "" "Unicode objects." msgstr "" -#: ../../c-api/sys.rst:270 +#: ../../c-api/sys.rst:274 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "module_search_paths` and :c:member:`PyConfig.module_search_paths_set` should " @@ -318,20 +316,20 @@ msgid "" "config>`." msgstr "" -#: ../../c-api/sys.rst:275 +#: ../../c-api/sys.rst:279 msgid "" "Set :data:`sys.path` to a list object of paths found in *path* which should " "be a list of paths separated with the platform's search path delimiter (``:" "`` on Unix, ``;`` on Windows)." msgstr "" -#: ../../c-api/sys.rst:283 +#: ../../c-api/sys.rst:287 msgid "" "Write the output string described by *format* to :data:`sys.stdout`. No " "exceptions are raised, even if truncation occurs (see below)." msgstr "" -#: ../../c-api/sys.rst:286 +#: ../../c-api/sys.rst:290 msgid "" "*format* should limit the total size of the formatted output string to 1000 " "bytes or less -- after 1000 bytes, the output string is truncated. In " @@ -342,58 +340,58 @@ msgid "" "of digits for very large numbers." msgstr "" -#: ../../c-api/sys.rst:294 +#: ../../c-api/sys.rst:298 msgid "" "If a problem occurs, or :data:`sys.stdout` is unset, the formatted message " "is written to the real (C level) *stdout*." msgstr "" -#: ../../c-api/sys.rst:299 +#: ../../c-api/sys.rst:303 msgid "" "As :c:func:`PySys_WriteStdout`, but write to :data:`sys.stderr` or *stderr* " "instead." msgstr "" -#: ../../c-api/sys.rst:304 +#: ../../c-api/sys.rst:308 msgid "" "Function similar to PySys_WriteStdout() but format the message using :c:func:" "`PyUnicode_FromFormatV` and don't truncate the message to an arbitrary " "length." msgstr "" -#: ../../c-api/sys.rst:312 +#: ../../c-api/sys.rst:316 msgid "" "As :c:func:`PySys_FormatStdout`, but write to :data:`sys.stderr` or *stderr* " "instead." msgstr "" -#: ../../c-api/sys.rst:319 +#: ../../c-api/sys.rst:323 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "xoptions` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/sys.rst:323 +#: ../../c-api/sys.rst:327 msgid "" "Parse *s* as a set of :option:`-X` options and add them to the current " "options mapping as returned by :c:func:`PySys_GetXOptions`. This function " "may be called prior to :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/sys.rst:333 +#: ../../c-api/sys.rst:337 msgid "" "Return the current dictionary of :option:`-X` options, similarly to :data:" "`sys._xoptions`. On error, ``NULL`` is returned and an exception is set." msgstr "" -#: ../../c-api/sys.rst:342 +#: ../../c-api/sys.rst:346 msgid "" "Raise an auditing event with any active hooks. Return zero for success and " "non-zero with an exception set on failure." msgstr "" -#: ../../c-api/sys.rst:345 +#: ../../c-api/sys.rst:349 msgid "" "If any hooks have been added, *format* and other arguments will be used to " "construct a tuple to pass. Apart from ``N``, the same format characters as " @@ -404,23 +402,23 @@ msgid "" "leaks.)" msgstr "" -#: ../../c-api/sys.rst:353 +#: ../../c-api/sys.rst:357 msgid "" "Note that ``#`` format characters should always be treated as :c:type:" "`Py_ssize_t`, regardless of whether ``PY_SSIZE_T_CLEAN`` was defined." msgstr "" -#: ../../c-api/sys.rst:356 +#: ../../c-api/sys.rst:360 msgid ":func:`sys.audit` performs the same function from Python code." msgstr "" -#: ../../c-api/sys.rst:362 +#: ../../c-api/sys.rst:366 msgid "" "Require :c:type:`Py_ssize_t` for ``#`` format characters. Previously, an " "unavoidable deprecation warning was raised." msgstr "" -#: ../../c-api/sys.rst:368 +#: ../../c-api/sys.rst:372 msgid "" "Append the callable *hook* to the list of active auditing hooks. Return zero " "on success and non-zero on failure. If the runtime has been initialized, " @@ -428,14 +426,14 @@ msgid "" "all interpreters created by the runtime." msgstr "" -#: ../../c-api/sys.rst:374 +#: ../../c-api/sys.rst:378 msgid "" "The *userData* pointer is passed into the hook function. Since hook " "functions may be called from different runtimes, this pointer should not " "refer directly to Python state." msgstr "" -#: ../../c-api/sys.rst:378 +#: ../../c-api/sys.rst:382 msgid "" "This function is safe to call before :c:func:`Py_Initialize`. When called " "after runtime initialization, existing audit hooks are notified and may " @@ -443,42 +441,47 @@ msgid "" "`Exception` (other errors will not be silenced)." msgstr "" -#: ../../c-api/sys.rst:383 +#: ../../c-api/sys.rst:387 msgid "" -"The hook function is of type :c:expr:`int (*)(const char *event, PyObject " -"*args, void *userData)`, where *args* is guaranteed to be a :c:type:" -"`PyTupleObject`. The hook function is always called with the GIL held by the " -"Python interpreter that raised the event." +"The hook function is always called with the GIL held by the Python " +"interpreter that raised the event." msgstr "" -#: ../../c-api/sys.rst:388 +#: ../../c-api/sys.rst:390 msgid "" "See :pep:`578` for a detailed description of auditing. Functions in the " "runtime and standard library that raise events are listed in the :ref:`audit " "events table `. Details are in each function's documentation." msgstr "" -#: ../../c-api/sys.rst:393 +#: ../../c-api/sys.rst:395 msgid "" "Raises an :ref:`auditing event ` ``sys.addaudithook`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.addaudithook``。" -#: ../../c-api/sys.rst:395 +#: ../../c-api/sys.rst:397 msgid "" -"If the interpreter is initialized, this function raises a auditing event " +"If the interpreter is initialized, this function raises an auditing event " "``sys.addaudithook`` with no arguments. If any existing hooks raise an " "exception derived from :class:`Exception`, the new hook will not be added " "and the exception is cleared. As a result, callers cannot assume that their " "hook has been added unless they control all existing hooks." msgstr "" -#: ../../c-api/sys.rst:407 +#: ../../c-api/sys.rst:406 +msgid "" +"The type of the hook function. *event* is the C string event argument passed " +"to :c:func:`PySys_Audit`. *args* is guaranteed to be a :c:type:" +"`PyTupleObject`. *userData* is the argument passed to PySys_AddAuditHook()." +msgstr "" + +#: ../../c-api/sys.rst:417 msgid "Process Control" msgstr "行程控制" -#: ../../c-api/sys.rst:414 +#: ../../c-api/sys.rst:424 msgid "" "Print a fatal error message and kill the process. No cleanup is performed. " "This function should only be invoked when a condition is detected that would " @@ -488,29 +491,29 @@ msgid "" "file:`core` file." msgstr "" -#: ../../c-api/sys.rst:421 +#: ../../c-api/sys.rst:431 msgid "" "The ``Py_FatalError()`` function is replaced with a macro which logs " "automatically the name of the current function, unless the " "``Py_LIMITED_API`` macro is defined." msgstr "" -#: ../../c-api/sys.rst:425 +#: ../../c-api/sys.rst:435 msgid "Log the function name automatically." msgstr "" -#: ../../c-api/sys.rst:435 +#: ../../c-api/sys.rst:445 msgid "" "Exit the current process. This calls :c:func:`Py_FinalizeEx` and then calls " "the standard C library function ``exit(status)``. If :c:func:" "`Py_FinalizeEx` indicates an error, the exit status is set to 120." msgstr "" -#: ../../c-api/sys.rst:439 +#: ../../c-api/sys.rst:449 msgid "Errors from finalization no longer ignored." msgstr "" -#: ../../c-api/sys.rst:449 +#: ../../c-api/sys.rst:459 msgid "" "Register a cleanup function to be called by :c:func:`Py_FinalizeEx`. The " "cleanup function will be called with no arguments and should return no " @@ -522,18 +525,29 @@ msgid "" "should be called by *func*." msgstr "" -#: ../../c-api/sys.rst:412 -msgid "abort()" -msgstr "abort()" +#: ../../c-api/sys.rst:101 +msgid "USE_STACKCHECK (C macro)" +msgstr "" -#: ../../c-api/sys.rst:431 ../../c-api/sys.rst:445 -msgid "Py_FinalizeEx()" +#: ../../c-api/sys.rst:422 +msgid "abort (C function)" +msgstr "" + +#: ../../c-api/sys.rst:441 ../../c-api/sys.rst:455 +#, fuzzy +msgid "Py_FinalizeEx (C function)" msgstr "Py_FinalizeEx()" -#: ../../c-api/sys.rst:431 -msgid "exit()" -msgstr "exit()" +#: ../../c-api/sys.rst:441 +msgid "exit (C function)" +msgstr "" -#: ../../c-api/sys.rst:445 +#: ../../c-api/sys.rst:455 msgid "cleanup functions" msgstr "cleanup functions(清理函式)" + +#~ msgid "abort()" +#~ msgstr "abort()" + +#~ msgid "exit()" +#~ msgstr "exit()" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 2179083511..c55d84f47e 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-28 00:03+0000\n" +"POT-Creation-Date: 2024-02-12 00:03+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-" @@ -422,5 +422,6 @@ msgstr "" #: ../../c-api/veryhigh.rst:325 ../../c-api/veryhigh.rst:333 #: ../../c-api/veryhigh.rst:342 -msgid "Py_CompileString()" +#, fuzzy +msgid "Py_CompileString (C function)" msgstr "Py_CompileString()" diff --git a/extending/extending.po b/extending/extending.po index 3df03f58c9..55cde47b9f 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2024-02-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:34+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1298,15 +1298,18 @@ msgid "" msgstr "" #: ../../extending/extending.rst:539 -msgid "PyObject_CallObject()" +#, fuzzy +msgid "PyObject_CallObject (C function)" msgstr "PyObject_CallObject()" #: ../../extending/extending.rst:630 -msgid "PyArg_ParseTuple()" +#, fuzzy +msgid "PyArg_ParseTuple (C function)" msgstr "PyArg_ParseTuple()" #: ../../extending/extending.rst:722 -msgid "PyArg_ParseTupleAndKeywords()" +#, fuzzy +msgid "PyArg_ParseTupleAndKeywords (C function)" msgstr "PyArg_ParseTupleAndKeywords()" #: ../../extending/extending.rst:743 diff --git a/extending/newtypes.po b/extending/newtypes.po index 453468b4ca..1af0b0002c 100644 --- a/extending/newtypes.po +++ b/extending/newtypes.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-27 00:03+0000\n" +"POT-Creation-Date: 2024-02-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:34+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -605,11 +605,13 @@ msgid "finalization, of objects" msgstr "" #: ../../extending/newtypes.rst:91 -msgid "PyErr_Fetch()" +#, fuzzy +msgid "PyErr_Fetch (C function)" msgstr "PyErr_Fetch()" #: ../../extending/newtypes.rst:91 -msgid "PyErr_Restore()" +#, fuzzy +msgid "PyErr_Restore (C function)" msgstr "PyErr_Restore()" #: ../../extending/newtypes.rst:150 diff --git a/library/bdb.po b/library/bdb.po index 88e6a80fd5..ad7a36f4dd 100644 --- a/library/bdb.po +++ b/library/bdb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-24 00:03+0000\n" +"POT-Creation-Date: 2024-02-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -213,8 +213,9 @@ msgstr "" #: ../../library/bdb.rst:151 msgid "" -"Set the :attr:`botframe`, :attr:`stopframe`, :attr:`returnframe` and :attr:" -"`quitting` attributes with values ready to start debugging." +"Set the :attr:`!botframe`, :attr:`!stopframe`, :attr:`!returnframe` and :" +"attr:`quitting ` attributes with values ready to start " +"debugging." msgstr "" #: ../../library/bdb.rst:156 @@ -281,8 +282,8 @@ msgstr "" msgid "" "If the debugger should stop on the current line, invoke the :meth:" "`user_line` method (which should be overridden in subclasses). Raise a :exc:" -"`BdbQuit` exception if the :attr:`Bdb.quitting` flag is set (which can be " -"set from :meth:`user_line`). Return a reference to the :meth:" +"`BdbQuit` exception if the :attr:`quitting ` flag is set " +"(which can be set from :meth:`user_line`). Return a reference to the :meth:" "`trace_dispatch` method for further tracing in that scope." msgstr "" @@ -290,8 +291,8 @@ msgstr "" msgid "" "If the debugger should stop on this function call, invoke the :meth:" "`user_call` method (which should be overridden in subclasses). Raise a :exc:" -"`BdbQuit` exception if the :attr:`Bdb.quitting` flag is set (which can be " -"set from :meth:`user_call`). Return a reference to the :meth:" +"`BdbQuit` exception if the :attr:`quitting ` flag is set " +"(which can be set from :meth:`user_call`). Return a reference to the :meth:" "`trace_dispatch` method for further tracing in that scope." msgstr "" @@ -299,18 +300,18 @@ msgstr "" msgid "" "If the debugger should stop on this function return, invoke the :meth:" "`user_return` method (which should be overridden in subclasses). Raise a :" -"exc:`BdbQuit` exception if the :attr:`Bdb.quitting` flag is set (which can " -"be set from :meth:`user_return`). Return a reference to the :meth:" -"`trace_dispatch` method for further tracing in that scope." +"exc:`BdbQuit` exception if the :attr:`quitting ` flag is set " +"(which can be set from :meth:`user_return`). Return a reference to the :" +"meth:`trace_dispatch` method for further tracing in that scope." msgstr "" #: ../../library/bdb.rst:207 msgid "" "If the debugger should stop at this exception, invokes the :meth:" "`user_exception` method (which should be overridden in subclasses). Raise a :" -"exc:`BdbQuit` exception if the :attr:`Bdb.quitting` flag is set (which can " -"be set from :meth:`user_exception`). Return a reference to the :meth:" -"`trace_dispatch` method for further tracing in that scope." +"exc:`BdbQuit` exception if the :attr:`quitting ` flag is set " +"(which can be set from :meth:`user_exception`). Return a reference to the :" +"meth:`trace_dispatch` method for further tracing in that scope." msgstr "" #: ../../library/bdb.rst:213 @@ -414,51 +415,51 @@ msgid "" "the system trace function to ``None``." msgstr "" -#: ../../library/bdb.rst:296 +#: ../../library/bdb.rst:298 msgid "" -"Set the :attr:`quitting` attribute to ``True``. This raises :exc:`BdbQuit` " +"Set the :attr:`!quitting` attribute to ``True``. This raises :exc:`BdbQuit` " "in the next call to one of the :meth:`!dispatch_\\*` methods." msgstr "" -#: ../../library/bdb.rst:300 +#: ../../library/bdb.rst:302 msgid "" "Derived classes and clients can call the following methods to manipulate " "breakpoints. These methods return a string containing an error message if " "something went wrong, or ``None`` if all is well." msgstr "" -#: ../../library/bdb.rst:306 +#: ../../library/bdb.rst:308 msgid "" "Set a new breakpoint. If the *lineno* line doesn't exist for the *filename* " "passed as argument, return an error message. The *filename* should be in " "canonical form, as described in the :meth:`canonic` method." msgstr "" -#: ../../library/bdb.rst:312 +#: ../../library/bdb.rst:314 msgid "" "Delete the breakpoints in *filename* and *lineno*. If none were set, return " "an error message." msgstr "" -#: ../../library/bdb.rst:317 +#: ../../library/bdb.rst:319 msgid "" "Delete the breakpoint which has the index *arg* in the :attr:`Breakpoint." "bpbynumber`. If *arg* is not numeric or out of range, return an error " "message." msgstr "" -#: ../../library/bdb.rst:323 +#: ../../library/bdb.rst:325 msgid "" "Delete all breakpoints in *filename*. If none were set, return an error " "message." msgstr "" -#: ../../library/bdb.rst:328 +#: ../../library/bdb.rst:330 msgid "" "Delete all existing breakpoints. If none were set, return an error message." msgstr "" -#: ../../library/bdb.rst:333 +#: ../../library/bdb.rst:335 msgid "" "Return a breakpoint specified by the given number. If *arg* is a string, it " "will be converted to a number. If *arg* is a non-numeric string, if the " @@ -466,103 +467,103 @@ msgid "" "raised." msgstr "" -#: ../../library/bdb.rst:342 +#: ../../library/bdb.rst:344 msgid "Return True if there is a breakpoint for *lineno* in *filename*." msgstr "" -#: ../../library/bdb.rst:346 +#: ../../library/bdb.rst:348 msgid "" "Return all breakpoints for *lineno* in *filename*, or an empty list if none " "are set." msgstr "" -#: ../../library/bdb.rst:351 +#: ../../library/bdb.rst:353 msgid "Return all breakpoints in *filename*, or an empty list if none are set." msgstr "" -#: ../../library/bdb.rst:355 +#: ../../library/bdb.rst:357 msgid "Return all breakpoints that are set." msgstr "" -#: ../../library/bdb.rst:358 +#: ../../library/bdb.rst:360 msgid "" "Derived classes and clients can call the following methods to get a data " "structure representing a stack trace." msgstr "" -#: ../../library/bdb.rst:363 +#: ../../library/bdb.rst:365 msgid "Return a list of (frame, lineno) tuples in a stack trace, and a size." msgstr "" -#: ../../library/bdb.rst:365 +#: ../../library/bdb.rst:367 msgid "" "The most recently called frame is last in the list. The size is the number " "of frames below the frame where the debugger was invoked." msgstr "" -#: ../../library/bdb.rst:370 +#: ../../library/bdb.rst:372 msgid "" "Return a string with information about a stack entry, which is a ``(frame, " "lineno)`` tuple. The return string contains:" msgstr "" -#: ../../library/bdb.rst:373 +#: ../../library/bdb.rst:375 msgid "The canonical filename which contains the frame." msgstr "" -#: ../../library/bdb.rst:374 +#: ../../library/bdb.rst:376 msgid "The function name or ``\"\"``." msgstr "函式名稱或 ``\"\"``。" -#: ../../library/bdb.rst:375 +#: ../../library/bdb.rst:377 msgid "The input arguments." msgstr "輸入引數。" -#: ../../library/bdb.rst:376 +#: ../../library/bdb.rst:378 msgid "The return value." msgstr "回傳值。" -#: ../../library/bdb.rst:377 +#: ../../library/bdb.rst:379 msgid "The line of code (if it exists)." msgstr "" -#: ../../library/bdb.rst:380 +#: ../../library/bdb.rst:382 msgid "" "The following two methods can be called by clients to use a debugger to " "debug a :term:`statement`, given as a string." msgstr "" -#: ../../library/bdb.rst:385 +#: ../../library/bdb.rst:387 msgid "" "Debug a statement executed via the :func:`exec` function. *globals* " -"defaults to :attr:`__main__.__dict__`, *locals* defaults to *globals*." +"defaults to :attr:`!__main__.__dict__`, *locals* defaults to *globals*." msgstr "" -#: ../../library/bdb.rst:390 +#: ../../library/bdb.rst:392 msgid "" "Debug an expression executed via the :func:`eval` function. *globals* and " "*locals* have the same meaning as in :meth:`run`." msgstr "" -#: ../../library/bdb.rst:395 +#: ../../library/bdb.rst:397 msgid "For backwards compatibility. Calls the :meth:`run` method." msgstr "" -#: ../../library/bdb.rst:399 +#: ../../library/bdb.rst:401 msgid "Debug a single function call, and return its result." msgstr "" -#: ../../library/bdb.rst:402 +#: ../../library/bdb.rst:404 msgid "Finally, the module defines the following functions:" msgstr "" -#: ../../library/bdb.rst:406 +#: ../../library/bdb.rst:408 msgid "" "Return True if we should break here, depending on the way the :class:" "`Breakpoint` *b* was set." msgstr "" -#: ../../library/bdb.rst:409 +#: ../../library/bdb.rst:411 msgid "" "If it was set via line number, it checks if :attr:`b.line ` is the same as the one in *frame*. If the breakpoint was set via :" @@ -571,13 +572,13 @@ msgid "" "line." msgstr "" -#: ../../library/bdb.rst:418 +#: ../../library/bdb.rst:420 msgid "" "Return ``(active breakpoint, delete temporary flag)`` or ``(None, None)`` as " "the breakpoint to act upon." msgstr "" -#: ../../library/bdb.rst:421 +#: ../../library/bdb.rst:423 msgid "" "The *active breakpoint* is the first entry in :attr:`bplist ` for the (:attr:`file `, :attr:`line ` count is ignored)." msgstr "" -#: ../../library/bdb.rst:432 +#: ../../library/bdb.rst:434 msgid "If no such entry exists, then (None, None) is returned." msgstr "" -#: ../../library/bdb.rst:437 +#: ../../library/bdb.rst:439 msgid "Start debugging with a :class:`Bdb` instance from caller's frame." msgstr "" + +#: ../../library/bdb.rst:296 +msgid "quitting (bdb.Bdb attribute)" +msgstr "" diff --git a/library/re.po b/library/re.po index ce320c5ec8..1633d10d6b 100644 --- a/library/re.po +++ b/library/re.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-21 00:03+0000\n" +"POT-Creation-Date: 2024-02-12 00:03+0000\n" "PO-Revision-Date: 2023-09-16 14:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2305,5 +2305,8 @@ msgid "\\g" msgstr "\\g" #: ../../library/re.rst:1594 -msgid "scanf()" -msgstr "scanf()" +msgid "scanf (C function)" +msgstr "" + +#~ msgid "scanf()" +#~ msgstr "scanf()" From 2474569c4cdadcc082028cc0c6f36be1d4bd91ec Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 13 Feb 2024 00:05:10 +0000 Subject: [PATCH 06/33] sync with cpython 09c98e46 --- howto/logging-cookbook.po | 348 ++++++++-------- library/asyncio-protocol.po | 7 +- library/asyncio-subprocess.po | 8 +- library/msvcrt.po | 18 +- library/multiprocessing.po | 8 +- library/subprocess.po | 8 +- whatsnew/2.6.po | 13 +- whatsnew/2.7.po | 737 +++++++++++++++++----------------- whatsnew/3.1.po | 4 +- whatsnew/3.2.po | 9 +- 10 files changed, 593 insertions(+), 567 deletions(-) diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index bba180be1c..fabf89e2ee 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-04 00:03+0000\n" +"POT-Creation-Date: 2024-02-13 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -924,17 +924,17 @@ msgid "" "effect to the above, as in the following example::" msgstr "" -#: ../../howto/logging-cookbook.rst:1764 +#: ../../howto/logging-cookbook.rst:1762 msgid "" "The above script should log the message ``Hello, world!`` when run with " -"Python 3.2 or later." +"Python 3.8 or later." msgstr "" -#: ../../howto/logging-cookbook.rst:1773 +#: ../../howto/logging-cookbook.rst:1771 msgid "Customizing ``LogRecord``" msgstr "" -#: ../../howto/logging-cookbook.rst:1775 +#: ../../howto/logging-cookbook.rst:1773 msgid "" "Every logging event is represented by a :class:`LogRecord` instance. When an " "event is logged and not filtered out by a logger's level, a :class:" @@ -945,13 +945,13 @@ msgid "" "was done:" msgstr "" -#: ../../howto/logging-cookbook.rst:1782 +#: ../../howto/logging-cookbook.rst:1780 msgid "" ":meth:`Logger.makeRecord`, which is called in the normal process of logging " "an event. This invoked :class:`LogRecord` directly to create an instance." msgstr "" -#: ../../howto/logging-cookbook.rst:1785 +#: ../../howto/logging-cookbook.rst:1783 msgid "" ":func:`makeLogRecord`, which is called with a dictionary containing " "attributes to be added to the LogRecord. This is typically invoked when a " @@ -960,27 +960,27 @@ msgid "" "`~handlers.HTTPHandler`)." msgstr "" -#: ../../howto/logging-cookbook.rst:1791 +#: ../../howto/logging-cookbook.rst:1789 msgid "" "This has usually meant that if you need to do anything special with a :class:" "`LogRecord`, you've had to do one of the following." msgstr "" -#: ../../howto/logging-cookbook.rst:1794 +#: ../../howto/logging-cookbook.rst:1792 msgid "" "Create your own :class:`Logger` subclass, which overrides :meth:`Logger." "makeRecord`, and set it using :func:`~logging.setLoggerClass` before any " "loggers that you care about are instantiated." msgstr "" -#: ../../howto/logging-cookbook.rst:1797 +#: ../../howto/logging-cookbook.rst:1795 msgid "" "Add a :class:`Filter` to a logger or handler, which does the necessary " "special manipulation you need when its :meth:`~Filter.filter` method is " "called." msgstr "" -#: ../../howto/logging-cookbook.rst:1801 +#: ../../howto/logging-cookbook.rst:1799 msgid "" "The first approach would be a little unwieldy in the scenario where (say) " "several different libraries wanted to do different things. Each would " @@ -988,7 +988,7 @@ msgid "" "last would win." msgstr "" -#: ../../howto/logging-cookbook.rst:1806 +#: ../../howto/logging-cookbook.rst:1804 msgid "" "The second approach works reasonably well for many cases, but does not allow " "you to e.g. use a specialized subclass of :class:`LogRecord`. Library " @@ -997,7 +997,7 @@ msgid "" "would do simply by adding new packages or modules and doing ::" msgstr "" -#: ../../howto/logging-cookbook.rst:1814 +#: ../../howto/logging-cookbook.rst:1812 msgid "" "at module level). It's probably one too many things to think about. " "Developers could also add the filter to a :class:`~logging.NullHandler` " @@ -1007,7 +1007,7 @@ msgid "" "developer." msgstr "" -#: ../../howto/logging-cookbook.rst:1820 +#: ../../howto/logging-cookbook.rst:1818 msgid "" "In Python 3.2 and later, :class:`~logging.LogRecord` creation is done " "through a factory, which you can specify. The factory is just a callable you " @@ -1017,7 +1017,7 @@ msgid "" "`LogRecord` is the default setting for the factory." msgstr "" -#: ../../howto/logging-cookbook.rst:1827 +#: ../../howto/logging-cookbook.rst:1825 msgid "" "This approach allows a custom factory to control all aspects of LogRecord " "creation. For example, you could return a subclass, or just add some " @@ -1025,7 +1025,7 @@ msgid "" "this::" msgstr "" -#: ../../howto/logging-cookbook.rst:1840 +#: ../../howto/logging-cookbook.rst:1838 msgid "" "This pattern allows different libraries to chain factories together, and as " "long as they don't overwrite each other's attributes or unintentionally " @@ -1035,70 +1035,70 @@ msgid "" "used when the use of a :class:`Filter` does not provide the desired result." msgstr "" -#: ../../howto/logging-cookbook.rst:1852 +#: ../../howto/logging-cookbook.rst:1850 msgid "Subclassing QueueHandler - a ZeroMQ example" msgstr "" -#: ../../howto/logging-cookbook.rst:1854 +#: ../../howto/logging-cookbook.rst:1852 msgid "" "You can use a :class:`QueueHandler` subclass to send messages to other kinds " "of queues, for example a ZeroMQ 'publish' socket. In the example below,the " "socket is created separately and passed to the handler (as its 'queue')::" msgstr "" -#: ../../howto/logging-cookbook.rst:1873 +#: ../../howto/logging-cookbook.rst:1871 msgid "" "Of course there are other ways of organizing this, for example passing in " "the data needed by the handler to create the socket::" msgstr "" -#: ../../howto/logging-cookbook.rst:1891 +#: ../../howto/logging-cookbook.rst:1889 msgid "Subclassing QueueListener - a ZeroMQ example" msgstr "" -#: ../../howto/logging-cookbook.rst:1893 +#: ../../howto/logging-cookbook.rst:1891 msgid "" "You can also subclass :class:`QueueListener` to get messages from other " "kinds of queues, for example a ZeroMQ 'subscribe' socket. Here's an example::" msgstr "" -#: ../../howto/logging-cookbook.rst:1912 ../../howto/logging-cookbook.rst:3952 +#: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3950 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../howto/logging-cookbook.rst:1912 ../../howto/logging-cookbook.rst:3952 +#: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3950 msgid "API reference for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1915 ../../howto/logging-cookbook.rst:3955 +#: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3953 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../howto/logging-cookbook.rst:1915 ../../howto/logging-cookbook.rst:3955 +#: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3953 msgid "Configuration API for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1918 ../../howto/logging-cookbook.rst:3958 +#: ../../howto/logging-cookbook.rst:1916 ../../howto/logging-cookbook.rst:3956 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../howto/logging-cookbook.rst:1918 ../../howto/logging-cookbook.rst:3958 +#: ../../howto/logging-cookbook.rst:1916 ../../howto/logging-cookbook.rst:3956 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1920 +#: ../../howto/logging-cookbook.rst:1918 msgid ":ref:`A basic logging tutorial `" msgstr ":ref:`基本的 logging 教學 `" -#: ../../howto/logging-cookbook.rst:1922 +#: ../../howto/logging-cookbook.rst:1920 msgid ":ref:`A more advanced logging tutorial `" msgstr ":ref:`進階的 logging 教學 `" -#: ../../howto/logging-cookbook.rst:1928 +#: ../../howto/logging-cookbook.rst:1926 msgid "An example dictionary-based configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:1930 +#: ../../howto/logging-cookbook.rst:1928 msgid "" "Below is an example of a logging configuration dictionary - it's taken from " "the `documentation on the Django project `_ of the Django documentation." msgstr "" -#: ../../howto/logging-cookbook.rst:1990 +#: ../../howto/logging-cookbook.rst:1988 msgid "Using a rotator and namer to customize log rotation processing" msgstr "" -#: ../../howto/logging-cookbook.rst:1992 +#: ../../howto/logging-cookbook.rst:1990 msgid "" "An example of how you can define a namer and rotator is given in the " "following runnable script, which shows gzip compression of the log file::" msgstr "" -#: ../../howto/logging-cookbook.rst:2023 +#: ../../howto/logging-cookbook.rst:2021 msgid "" "After running this, you will see six new files, five of which are compressed:" msgstr "" -#: ../../howto/logging-cookbook.rst:2036 +#: ../../howto/logging-cookbook.rst:2034 msgid "A more elaborate multiprocessing example" msgstr "" -#: ../../howto/logging-cookbook.rst:2038 +#: ../../howto/logging-cookbook.rst:2036 msgid "" "The following working example shows how logging can be used with " "multiprocessing using configuration files. The configurations are fairly " @@ -1140,7 +1140,7 @@ msgid "" "in a real multiprocessing scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:2043 +#: ../../howto/logging-cookbook.rst:2041 msgid "" "In the example, the main process spawns a listener process and some worker " "processes. Each of the main process, the listener and the workers have three " @@ -1153,17 +1153,17 @@ msgid "" "own scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:2053 +#: ../../howto/logging-cookbook.rst:2051 msgid "" "Here's the script - the docstrings and the comments hopefully explain how it " "works::" msgstr "" -#: ../../howto/logging-cookbook.rst:2265 +#: ../../howto/logging-cookbook.rst:2263 msgid "Inserting a BOM into messages sent to a SysLogHandler" msgstr "" -#: ../../howto/logging-cookbook.rst:2267 +#: ../../howto/logging-cookbook.rst:2265 msgid "" ":rfc:`5424` requires that a Unicode message be sent to a syslog daemon as a " "set of bytes which have the following structure: an optional pure-ASCII " @@ -1172,7 +1172,7 @@ msgid "" "<5424#section-6>`.)" msgstr "" -#: ../../howto/logging-cookbook.rst:2273 +#: ../../howto/logging-cookbook.rst:2271 msgid "" "In Python 3.1, code was added to :class:`~logging.handlers.SysLogHandler` to " "insert a BOM into the message, but unfortunately, it was implemented " @@ -1180,7 +1180,7 @@ msgid "" "hence not allowing any pure-ASCII component to appear before it." msgstr "" -#: ../../howto/logging-cookbook.rst:2279 +#: ../../howto/logging-cookbook.rst:2277 msgid "" "As this behaviour is broken, the incorrect BOM insertion code is being " "removed from Python 3.2.4 and later. However, it is not being replaced, and " @@ -1189,33 +1189,33 @@ msgid "" "encoded using UTF-8, then you need to do the following:" msgstr "" -#: ../../howto/logging-cookbook.rst:2285 +#: ../../howto/logging-cookbook.rst:2283 msgid "" "Attach a :class:`~logging.Formatter` instance to your :class:`~logging." "handlers.SysLogHandler` instance, with a format string such as::" msgstr "" -#: ../../howto/logging-cookbook.rst:2291 +#: ../../howto/logging-cookbook.rst:2289 msgid "" "The Unicode code point U+FEFF, when encoded using UTF-8, will be encoded as " "a UTF-8 BOM -- the byte-string ``b'\\xef\\xbb\\xbf'``." msgstr "" -#: ../../howto/logging-cookbook.rst:2294 +#: ../../howto/logging-cookbook.rst:2292 msgid "" "Replace the ASCII section with whatever placeholders you like, but make sure " "that the data that appears in there after substitution is always ASCII (that " "way, it will remain unchanged after UTF-8 encoding)." msgstr "" -#: ../../howto/logging-cookbook.rst:2298 +#: ../../howto/logging-cookbook.rst:2296 msgid "" "Replace the Unicode section with whatever placeholders you like; if the data " "which appears there after substitution contains characters outside the ASCII " "range, that's fine -- it will be encoded using UTF-8." msgstr "" -#: ../../howto/logging-cookbook.rst:2302 +#: ../../howto/logging-cookbook.rst:2300 msgid "" "The formatted message *will* be encoded using UTF-8 encoding by " "``SysLogHandler``. If you follow the above rules, you should be able to " @@ -1224,11 +1224,11 @@ msgid "" "daemon may complain." msgstr "" -#: ../../howto/logging-cookbook.rst:2309 +#: ../../howto/logging-cookbook.rst:2307 msgid "Implementing structured logging" msgstr "" -#: ../../howto/logging-cookbook.rst:2311 +#: ../../howto/logging-cookbook.rst:2309 msgid "" "Although most logging messages are intended for reading by humans, and thus " "not readily machine-parseable, there might be circumstances where you want " @@ -1240,31 +1240,31 @@ msgid "" "machine-parseable manner::" msgstr "" -#: ../../howto/logging-cookbook.rst:2335 +#: ../../howto/logging-cookbook.rst:2333 msgid "If the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2341 ../../howto/logging-cookbook.rst:2383 +#: ../../howto/logging-cookbook.rst:2339 ../../howto/logging-cookbook.rst:2381 msgid "" "Note that the order of items might be different according to the version of " "Python used." msgstr "" -#: ../../howto/logging-cookbook.rst:2344 +#: ../../howto/logging-cookbook.rst:2342 msgid "" "If you need more specialised processing, you can use a custom JSON encoder, " "as in the following complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2377 +#: ../../howto/logging-cookbook.rst:2375 msgid "When the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2392 +#: ../../howto/logging-cookbook.rst:2390 msgid "Customizing handlers with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2394 +#: ../../howto/logging-cookbook.rst:2392 msgid "" "There are times when you want to customize logging handlers in particular " "ways, and if you use :func:`dictConfig` you may be able to do this without " @@ -1274,24 +1274,24 @@ msgid "" "customize handler creation using a plain function such as::" msgstr "" -#: ../../howto/logging-cookbook.rst:2408 +#: ../../howto/logging-cookbook.rst:2406 msgid "" "You can then specify, in a logging configuration passed to :func:" "`dictConfig`, that a logging handler be created by calling this function::" msgstr "" -#: ../../howto/logging-cookbook.rst:2441 +#: ../../howto/logging-cookbook.rst:2439 msgid "" "In this example I am setting the ownership using the ``pulse`` user and " "group, just for the purposes of illustration. Putting it together into a " "working script, ``chowntest.py``::" msgstr "" -#: ../../howto/logging-cookbook.rst:2488 +#: ../../howto/logging-cookbook.rst:2486 msgid "To run this, you will probably need to run as ``root``:" msgstr "" -#: ../../howto/logging-cookbook.rst:2498 +#: ../../howto/logging-cookbook.rst:2496 msgid "" "Note that this example uses Python 3.3 because that's where :func:`shutil." "chown` makes an appearance. This approach should work with any Python " @@ -1300,17 +1300,17 @@ msgid "" "change using e.g. :func:`os.chown`." msgstr "" -#: ../../howto/logging-cookbook.rst:2504 +#: ../../howto/logging-cookbook.rst:2502 msgid "" "In practice, the handler-creating function may be in a utility module " "somewhere in your project. Instead of the line in the configuration::" msgstr "" -#: ../../howto/logging-cookbook.rst:2509 +#: ../../howto/logging-cookbook.rst:2507 msgid "you could use e.g.::" msgstr "" -#: ../../howto/logging-cookbook.rst:2513 +#: ../../howto/logging-cookbook.rst:2511 msgid "" "where ``project.util`` can be replaced with the actual name of the package " "where the function resides. In the above working script, using ``'ext://" @@ -1318,25 +1318,25 @@ msgid "" "resolved by :func:`dictConfig` from the ``ext://`` specification." msgstr "" -#: ../../howto/logging-cookbook.rst:2518 +#: ../../howto/logging-cookbook.rst:2516 msgid "" "This example hopefully also points the way to how you could implement other " "types of file change - e.g. setting specific POSIX permission bits - in the " "same way, using :func:`os.chmod`." msgstr "" -#: ../../howto/logging-cookbook.rst:2522 +#: ../../howto/logging-cookbook.rst:2520 msgid "" "Of course, the approach could also be extended to types of handler other " "than a :class:`~logging.FileHandler` - for example, one of the rotating file " "handlers, or a different type of handler altogether." msgstr "" -#: ../../howto/logging-cookbook.rst:2532 +#: ../../howto/logging-cookbook.rst:2530 msgid "Using particular formatting styles throughout your application" msgstr "" -#: ../../howto/logging-cookbook.rst:2534 +#: ../../howto/logging-cookbook.rst:2532 msgid "" "In Python 3.2, the :class:`~logging.Formatter` gained a ``style`` keyword " "parameter which, while defaulting to ``%`` for backward compatibility, " @@ -1347,7 +1347,7 @@ msgid "" "is constructed." msgstr "" -#: ../../howto/logging-cookbook.rst:2541 +#: ../../howto/logging-cookbook.rst:2539 msgid "" "Logging calls (:meth:`~Logger.debug`, :meth:`~Logger.info` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -1362,7 +1362,7 @@ msgid "" "calls which are out there in existing code will be using %-format strings." msgstr "" -#: ../../howto/logging-cookbook.rst:2553 +#: ../../howto/logging-cookbook.rst:2551 msgid "" "There have been suggestions to associate format styles with specific " "loggers, but that approach also runs into backward compatibility problems " @@ -1370,7 +1370,7 @@ msgid "" "formatting." msgstr "" -#: ../../howto/logging-cookbook.rst:2557 +#: ../../howto/logging-cookbook.rst:2555 msgid "" "For logging to work interoperably between any third-party libraries and your " "code, decisions about formatting need to be made at the level of the " @@ -1378,11 +1378,11 @@ msgid "" "formatting styles can be accommodated." msgstr "" -#: ../../howto/logging-cookbook.rst:2564 +#: ../../howto/logging-cookbook.rst:2562 msgid "Using LogRecord factories" msgstr "" -#: ../../howto/logging-cookbook.rst:2566 +#: ../../howto/logging-cookbook.rst:2564 msgid "" "In Python 3.2, along with the :class:`~logging.Formatter` changes mentioned " "above, the logging package gained the ability to allow users to set their " @@ -1397,17 +1397,17 @@ msgid "" "implementation does." msgstr "" -#: ../../howto/logging-cookbook.rst:2577 +#: ../../howto/logging-cookbook.rst:2575 msgid "" "Refer to the reference documentation on :func:`setLogRecordFactory` and :" "class:`LogRecord` for more information." msgstr "" -#: ../../howto/logging-cookbook.rst:2582 +#: ../../howto/logging-cookbook.rst:2580 msgid "Using custom message objects" msgstr "" -#: ../../howto/logging-cookbook.rst:2584 +#: ../../howto/logging-cookbook.rst:2582 msgid "" "There is another, perhaps simpler way that you can use {}- and $- formatting " "to construct your individual log messages. You may recall (from :ref:" @@ -1417,7 +1417,7 @@ msgid "" "following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:2609 +#: ../../howto/logging-cookbook.rst:2607 msgid "" "Either of these can be used in place of a format string, to allow {}- or $-" "formatting to be used to build the actual \"message\" part which appears in " @@ -1428,17 +1428,17 @@ msgid "" "using ``_`` for localization)." msgstr "" -#: ../../howto/logging-cookbook.rst:2617 +#: ../../howto/logging-cookbook.rst:2615 msgid "" "Examples of this approach are given below. Firstly, formatting with :meth:" "`str.format`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2631 +#: ../../howto/logging-cookbook.rst:2629 msgid "Secondly, formatting with :class:`string.Template`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2638 +#: ../../howto/logging-cookbook.rst:2636 msgid "" "One thing to note is that you pay no significant performance penalty with " "this approach: the actual formatting happens not when you make the logging " @@ -1450,11 +1450,11 @@ msgid "" "shown above." msgstr "" -#: ../../howto/logging-cookbook.rst:2652 +#: ../../howto/logging-cookbook.rst:2650 msgid "Configuring filters with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2654 +#: ../../howto/logging-cookbook.rst:2652 msgid "" "You *can* configure filters using :func:`~logging.config.dictConfig`, though " "it might not be obvious at first glance how to do it (hence this recipe). " @@ -1469,22 +1469,22 @@ msgid "" "complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2707 +#: ../../howto/logging-cookbook.rst:2705 msgid "" "This example shows how you can pass configuration data to the callable which " "constructs the instance, in the form of keyword parameters. When run, the " "above script will print:" msgstr "" -#: ../../howto/logging-cookbook.rst:2715 +#: ../../howto/logging-cookbook.rst:2713 msgid "which shows that the filter is working as configured." msgstr "" -#: ../../howto/logging-cookbook.rst:2717 +#: ../../howto/logging-cookbook.rst:2715 msgid "A couple of extra points to note:" msgstr "" -#: ../../howto/logging-cookbook.rst:2719 +#: ../../howto/logging-cookbook.rst:2717 msgid "" "If you can't refer to the callable directly in the configuration (e.g. if it " "lives in a different module, and you can't import it directly where the " @@ -1494,7 +1494,7 @@ msgid "" "the above example." msgstr "" -#: ../../howto/logging-cookbook.rst:2726 +#: ../../howto/logging-cookbook.rst:2724 msgid "" "As well as for filters, this technique can also be used to configure custom " "handlers and formatters. See :ref:`logging-config-dict-userdef` for more " @@ -1503,11 +1503,11 @@ msgid "" "above." msgstr "" -#: ../../howto/logging-cookbook.rst:2735 +#: ../../howto/logging-cookbook.rst:2733 msgid "Customized exception formatting" msgstr "" -#: ../../howto/logging-cookbook.rst:2737 +#: ../../howto/logging-cookbook.rst:2735 msgid "" "There might be times when you want to do customized exception formatting - " "for argument's sake, let's say you want exactly one line per logged event, " @@ -1515,22 +1515,22 @@ msgid "" "formatter class, as shown in the following example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2778 +#: ../../howto/logging-cookbook.rst:2776 msgid "When run, this produces a file with exactly two lines:" msgstr "" -#: ../../howto/logging-cookbook.rst:2785 +#: ../../howto/logging-cookbook.rst:2783 msgid "" "While the above treatment is simplistic, it points the way to how exception " "information can be formatted to your liking. The :mod:`traceback` module may " "be helpful for more specialized needs." msgstr "" -#: ../../howto/logging-cookbook.rst:2792 +#: ../../howto/logging-cookbook.rst:2790 msgid "Speaking logging messages" msgstr "" -#: ../../howto/logging-cookbook.rst:2794 +#: ../../howto/logging-cookbook.rst:2792 msgid "" "There might be situations when it is desirable to have logging messages " "rendered in an audible rather than a visible format. This is easy to do if " @@ -1547,24 +1547,24 @@ msgid "" "approach, which assumes that the ``espeak`` TTS package is available::" msgstr "" -#: ../../howto/logging-cookbook.rst:2836 +#: ../../howto/logging-cookbook.rst:2834 msgid "" "When run, this script should say \"Hello\" and then \"Goodbye\" in a female " "voice." msgstr "" -#: ../../howto/logging-cookbook.rst:2838 +#: ../../howto/logging-cookbook.rst:2836 msgid "" "The above approach can, of course, be adapted to other TTS systems and even " "other systems altogether which can process messages via external programs " "run from a command line." msgstr "" -#: ../../howto/logging-cookbook.rst:2846 +#: ../../howto/logging-cookbook.rst:2844 msgid "Buffering logging messages and outputting them conditionally" msgstr "" -#: ../../howto/logging-cookbook.rst:2848 +#: ../../howto/logging-cookbook.rst:2846 msgid "" "There might be situations where you want to log messages in a temporary area " "and only output them if a certain condition occurs. For example, you may " @@ -1574,7 +1574,7 @@ msgid "" "debug information to be output as well as the error." msgstr "" -#: ../../howto/logging-cookbook.rst:2855 +#: ../../howto/logging-cookbook.rst:2853 msgid "" "Here is an example which shows how you could do this using a decorator for " "your functions where you want logging to behave this way. It makes use of " @@ -1587,7 +1587,7 @@ msgid "" "subclass of ``MemoryHandler`` if you want custom flushing behavior." msgstr "" -#: ../../howto/logging-cookbook.rst:2865 +#: ../../howto/logging-cookbook.rst:2863 msgid "" "The example script has a simple function, ``foo``, which just cycles through " "all the logging levels, writing to ``sys.stderr`` to say what level it's " @@ -1596,7 +1596,7 @@ msgid "" "levels - otherwise, it only logs at DEBUG, INFO and WARNING levels." msgstr "" -#: ../../howto/logging-cookbook.rst:2871 +#: ../../howto/logging-cookbook.rst:2869 msgid "" "The script just arranges to decorate ``foo`` with a decorator which will do " "the conditional logging that's required. The decorator takes a logger as a " @@ -1608,30 +1608,30 @@ msgid "" "respectively." msgstr "" -#: ../../howto/logging-cookbook.rst:2879 +#: ../../howto/logging-cookbook.rst:2877 msgid "Here's the script::" msgstr "" -#: ../../howto/logging-cookbook.rst:2942 +#: ../../howto/logging-cookbook.rst:2940 msgid "When this script is run, the following output should be observed:" msgstr "" -#: ../../howto/logging-cookbook.rst:2972 +#: ../../howto/logging-cookbook.rst:2970 msgid "" "As you can see, actual logging output only occurs when an event is logged " "whose severity is ERROR or greater, but in that case, any previous events at " "lower severities are also logged." msgstr "" -#: ../../howto/logging-cookbook.rst:2976 +#: ../../howto/logging-cookbook.rst:2974 msgid "You can of course use the conventional means of decoration::" msgstr "" -#: ../../howto/logging-cookbook.rst:2986 +#: ../../howto/logging-cookbook.rst:2984 msgid "Sending logging messages to email, with buffering" msgstr "" -#: ../../howto/logging-cookbook.rst:2988 +#: ../../howto/logging-cookbook.rst:2986 msgid "" "To illustrate how you can send log messages via email, so that a set number " "of messages are sent per email, you can subclass :class:`~logging.handlers." @@ -1642,7 +1642,7 @@ msgid "" "argument to see the required and optional arguments.)" msgstr "" -#: ../../howto/logging-cookbook.rst:3060 +#: ../../howto/logging-cookbook.rst:3058 msgid "" "If you run this script and your SMTP server is correctly set up, you should " "find that it sends eleven emails to the addressee you specify. The first ten " @@ -1650,17 +1650,17 @@ msgid "" "messages. That makes up 102 messages as specified in the script." msgstr "" -#: ../../howto/logging-cookbook.rst:3068 +#: ../../howto/logging-cookbook.rst:3066 msgid "Formatting times using UTC (GMT) via configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:3070 +#: ../../howto/logging-cookbook.rst:3068 msgid "" "Sometimes you want to format times using UTC, which can be done using a " "class such as ``UTCFormatter``, shown below::" msgstr "" -#: ../../howto/logging-cookbook.rst:3079 +#: ../../howto/logging-cookbook.rst:3077 msgid "" "and you can then use the ``UTCFormatter`` in your code instead of :class:" "`~logging.Formatter`. If you want to do that via configuration, you can use " @@ -1668,21 +1668,21 @@ msgid "" "the following complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:3122 +#: ../../howto/logging-cookbook.rst:3120 msgid "When this script is run, it should print something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:3129 +#: ../../howto/logging-cookbook.rst:3127 msgid "" "showing how the time is formatted both as local time and UTC, one for each " "handler." msgstr "" -#: ../../howto/logging-cookbook.rst:3136 +#: ../../howto/logging-cookbook.rst:3134 msgid "Using a context manager for selective logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3138 +#: ../../howto/logging-cookbook.rst:3136 msgid "" "There are times when it would be useful to temporarily change the logging " "configuration and revert it back after doing something. For this, a context " @@ -1692,7 +1692,7 @@ msgid "" "scope of the context manager::" msgstr "" -#: ../../howto/logging-cookbook.rst:3171 +#: ../../howto/logging-cookbook.rst:3169 msgid "" "If you specify a level value, the logger's level is set to that value in the " "scope of the with block covered by the context manager. If you specify a " @@ -1701,13 +1701,13 @@ msgid "" "block exit - you could do this if you don't need the handler any more." msgstr "" -#: ../../howto/logging-cookbook.rst:3177 +#: ../../howto/logging-cookbook.rst:3175 msgid "" "To illustrate how it works, we can add the following block of code to the " "above::" msgstr "" -#: ../../howto/logging-cookbook.rst:3195 +#: ../../howto/logging-cookbook.rst:3193 msgid "" "We initially set the logger's level to ``INFO``, so message #1 appears and " "message #2 doesn't. We then change the level to ``DEBUG`` temporarily in the " @@ -1720,56 +1720,56 @@ msgid "" "(like message #1) whereas message #7 doesn't (just like message #2)." msgstr "" -#: ../../howto/logging-cookbook.rst:3205 +#: ../../howto/logging-cookbook.rst:3203 msgid "If we run the resulting script, the result is as follows:" msgstr "" -#: ../../howto/logging-cookbook.rst:3216 +#: ../../howto/logging-cookbook.rst:3214 msgid "" "If we run it again, but pipe ``stderr`` to ``/dev/null``, we see the " "following, which is the only message written to ``stdout``:" msgstr "" -#: ../../howto/logging-cookbook.rst:3224 +#: ../../howto/logging-cookbook.rst:3222 msgid "Once again, but piping ``stdout`` to ``/dev/null``, we get:" msgstr "" -#: ../../howto/logging-cookbook.rst:3234 +#: ../../howto/logging-cookbook.rst:3232 msgid "" "In this case, the message #5 printed to ``stdout`` doesn't appear, as " "expected." msgstr "" -#: ../../howto/logging-cookbook.rst:3236 +#: ../../howto/logging-cookbook.rst:3234 msgid "" "Of course, the approach described here can be generalised, for example to " "attach logging filters temporarily. Note that the above code works in Python " "2 as well as Python 3." msgstr "" -#: ../../howto/logging-cookbook.rst:3244 +#: ../../howto/logging-cookbook.rst:3242 msgid "A CLI application starter template" msgstr "" -#: ../../howto/logging-cookbook.rst:3246 +#: ../../howto/logging-cookbook.rst:3244 msgid "Here's an example which shows how you can:" msgstr "" -#: ../../howto/logging-cookbook.rst:3248 +#: ../../howto/logging-cookbook.rst:3246 msgid "Use a logging level based on command-line arguments" msgstr "" -#: ../../howto/logging-cookbook.rst:3249 +#: ../../howto/logging-cookbook.rst:3247 msgid "" "Dispatch to multiple subcommands in separate files, all logging at the same " "level in a consistent way" msgstr "" -#: ../../howto/logging-cookbook.rst:3251 +#: ../../howto/logging-cookbook.rst:3249 msgid "Make use of simple, minimal configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:3253 +#: ../../howto/logging-cookbook.rst:3251 msgid "" "Suppose we have a command-line application whose job is to stop, start or " "restart some services. This could be organised for the purposes of " @@ -1780,53 +1780,53 @@ msgid "" "``logging.INFO``. Here's one way that ``app.py`` could be written::" msgstr "" -#: ../../howto/logging-cookbook.rst:3302 +#: ../../howto/logging-cookbook.rst:3300 msgid "" "And the ``start``, ``stop`` and ``restart`` commands can be implemented in " "separate modules, like so for starting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3315 +#: ../../howto/logging-cookbook.rst:3313 msgid "and thus for stopping::" msgstr "" -#: ../../howto/logging-cookbook.rst:3336 +#: ../../howto/logging-cookbook.rst:3334 msgid "and similarly for restarting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3357 +#: ../../howto/logging-cookbook.rst:3355 msgid "" "If we run this application with the default log level, we get output like " "this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3370 +#: ../../howto/logging-cookbook.rst:3368 msgid "" "The first word is the logging level, and the second word is the module or " "package name of the place where the event was logged." msgstr "" -#: ../../howto/logging-cookbook.rst:3373 +#: ../../howto/logging-cookbook.rst:3371 msgid "" "If we change the logging level, then we can change the information sent to " "the log. For example, if we want more information:" msgstr "" -#: ../../howto/logging-cookbook.rst:3390 +#: ../../howto/logging-cookbook.rst:3388 msgid "And if we want less:" msgstr "" -#: ../../howto/logging-cookbook.rst:3398 +#: ../../howto/logging-cookbook.rst:3396 msgid "" "In this case, the commands don't print anything to the console, since " "nothing at ``WARNING`` level or above is logged by them." msgstr "" -#: ../../howto/logging-cookbook.rst:3404 +#: ../../howto/logging-cookbook.rst:3402 msgid "A Qt GUI for logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3406 +#: ../../howto/logging-cookbook.rst:3404 msgid "" "A question that comes up from time to time is about how to log to a GUI " "application. The `Qt `_ framework is a popular cross-" @@ -1834,7 +1834,7 @@ msgid "" "project/PySide2/>`_ or `PyQt5 `_ libraries." msgstr "" -#: ../../howto/logging-cookbook.rst:3412 +#: ../../howto/logging-cookbook.rst:3410 msgid "" "The following example shows how to log to a Qt GUI. This introduces a simple " "``QtHandler`` class which takes a callable, which should be a slot in the " @@ -1844,14 +1844,14 @@ msgid "" "logging messages at random levels with random short delays in between)." msgstr "" -#: ../../howto/logging-cookbook.rst:3419 +#: ../../howto/logging-cookbook.rst:3417 msgid "" "The worker thread is implemented using Qt's ``QThread`` class rather than " "the :mod:`threading` module, as there are circumstances where one has to use " "``QThread``, which offers better integration with other ``Qt`` components." msgstr "" -#: ../../howto/logging-cookbook.rst:3423 +#: ../../howto/logging-cookbook.rst:3421 msgid "" "The code should work with recent releases of either ``PySide2`` or " "``PyQt5``. You should be able to adapt the approach to earlier versions of " @@ -1859,11 +1859,11 @@ msgid "" "information." msgstr "" -#: ../../howto/logging-cookbook.rst:3637 +#: ../../howto/logging-cookbook.rst:3635 msgid "Logging to syslog with RFC5424 support" msgstr "" -#: ../../howto/logging-cookbook.rst:3639 +#: ../../howto/logging-cookbook.rst:3637 msgid "" "Although :rfc:`5424` dates from 2009, most syslog servers are configured by " "default to use the older :rfc:`3164`, which hails from 2001. When " @@ -1873,14 +1873,14 @@ msgid "" "handlers.SysLogHandler` functionality has not been updated." msgstr "" -#: ../../howto/logging-cookbook.rst:3646 +#: ../../howto/logging-cookbook.rst:3644 msgid "" "RFC 5424 contains some useful features such as support for structured data, " "and if you need to be able to log to a syslog server with support for it, " "you can do so with a subclassed handler which looks something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3712 +#: ../../howto/logging-cookbook.rst:3710 msgid "" "You'll need to be familiar with RFC 5424 to fully understand the above code, " "and it may be that you have slightly different needs (e.g. for how you pass " @@ -1889,11 +1889,11 @@ msgid "" "using something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3726 +#: ../../howto/logging-cookbook.rst:3724 msgid "How to treat a logger like an output stream" msgstr "" -#: ../../howto/logging-cookbook.rst:3728 +#: ../../howto/logging-cookbook.rst:3726 msgid "" "Sometimes, you need to interface to a third-party API which expects a file-" "like object to write to, but you want to direct the API's output to a " @@ -1901,17 +1901,17 @@ msgid "" "API. Here's a short script illustrating such a class:" msgstr "" -#: ../../howto/logging-cookbook.rst:3768 +#: ../../howto/logging-cookbook.rst:3766 msgid "When this script is run, it prints" msgstr "" -#: ../../howto/logging-cookbook.rst:3775 +#: ../../howto/logging-cookbook.rst:3773 msgid "" "You could also use ``LoggerWriter`` to redirect ``sys.stdout`` and ``sys." "stderr`` by doing something like this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3785 +#: ../../howto/logging-cookbook.rst:3783 msgid "" "You should do this *after* configuring logging for your needs. In the above " "example, the :func:`~logging.basicConfig` call does this (using the ``sys." @@ -1919,25 +1919,25 @@ msgid "" "Then, you'd get this kind of result:" msgstr "" -#: ../../howto/logging-cookbook.rst:3798 +#: ../../howto/logging-cookbook.rst:3796 msgid "" "Of course, the examples above show output according to the format used by :" "func:`~logging.basicConfig`, but you can use a different formatter when you " "configure logging." msgstr "" -#: ../../howto/logging-cookbook.rst:3802 +#: ../../howto/logging-cookbook.rst:3800 msgid "" "Note that with the above scheme, you are somewhat at the mercy of buffering " "and the sequence of write calls which you are intercepting. For example, " "with the definition of ``LoggerWriter`` above, if you have the snippet" msgstr "" -#: ../../howto/logging-cookbook.rst:3811 +#: ../../howto/logging-cookbook.rst:3809 msgid "then running the script results in" msgstr "" -#: ../../howto/logging-cookbook.rst:3829 +#: ../../howto/logging-cookbook.rst:3827 msgid "" "As you can see, this output isn't ideal. That's because the underlying code " "which writes to ``sys.stderr`` makes multiple writes, each of which results " @@ -1947,17 +1947,17 @@ msgid "" "``LoggerWriter``:" msgstr "" -#: ../../howto/logging-cookbook.rst:3854 +#: ../../howto/logging-cookbook.rst:3852 msgid "" "This just buffers up stuff until a newline is seen, and then logs complete " "lines. With this approach, you get better output:" msgstr "" -#: ../../howto/logging-cookbook.rst:3870 +#: ../../howto/logging-cookbook.rst:3868 msgid "Patterns to avoid" msgstr "" -#: ../../howto/logging-cookbook.rst:3872 +#: ../../howto/logging-cookbook.rst:3870 msgid "" "Although the preceding sections have described ways of doing things you " "might need to do or deal with, it is worth mentioning some usage patterns " @@ -1965,11 +1965,11 @@ msgid "" "The following sections are in no particular order." msgstr "" -#: ../../howto/logging-cookbook.rst:3878 +#: ../../howto/logging-cookbook.rst:3876 msgid "Opening the same log file multiple times" msgstr "" -#: ../../howto/logging-cookbook.rst:3880 +#: ../../howto/logging-cookbook.rst:3878 msgid "" "On Windows, you will generally not be able to open the same file multiple " "times as this will lead to a \"file is in use by another process\" error. " @@ -1977,32 +1977,32 @@ msgid "" "file multiple times. This could be done accidentally, for example by:" msgstr "" -#: ../../howto/logging-cookbook.rst:3885 +#: ../../howto/logging-cookbook.rst:3883 msgid "" "Adding a file handler more than once which references the same file (e.g. by " "a copy/paste/forget-to-change error)." msgstr "" -#: ../../howto/logging-cookbook.rst:3888 +#: ../../howto/logging-cookbook.rst:3886 msgid "" "Opening two files that look different, as they have different names, but are " "the same because one is a symbolic link to the other." msgstr "" -#: ../../howto/logging-cookbook.rst:3891 +#: ../../howto/logging-cookbook.rst:3889 msgid "" "Forking a process, following which both parent and child have a reference to " "the same file. This might be through use of the :mod:`multiprocessing` " "module, for example." msgstr "" -#: ../../howto/logging-cookbook.rst:3895 +#: ../../howto/logging-cookbook.rst:3893 msgid "" "Opening a file multiple times might *appear* to work most of the time, but " "can lead to a number of problems in practice:" msgstr "" -#: ../../howto/logging-cookbook.rst:3898 +#: ../../howto/logging-cookbook.rst:3896 msgid "" "Logging output can be garbled because multiple threads or processes try to " "write to the same file. Although logging guards against concurrent use of " @@ -2011,7 +2011,7 @@ msgid "" "different handler instances which happen to point to the same file." msgstr "" -#: ../../howto/logging-cookbook.rst:3904 +#: ../../howto/logging-cookbook.rst:3902 msgid "" "An attempt to delete a file (e.g. during file rotation) silently fails, " "because there is another reference pointing to it. This can lead to " @@ -2021,17 +2021,17 @@ msgid "" "being supposedly in place." msgstr "" -#: ../../howto/logging-cookbook.rst:3911 +#: ../../howto/logging-cookbook.rst:3909 msgid "" "Use the techniques outlined in :ref:`multiple-processes` to circumvent such " "issues." msgstr "" -#: ../../howto/logging-cookbook.rst:3915 +#: ../../howto/logging-cookbook.rst:3913 msgid "Using loggers as attributes in a class or passing them as parameters" msgstr "" -#: ../../howto/logging-cookbook.rst:3917 +#: ../../howto/logging-cookbook.rst:3915 msgid "" "While there might be unusual cases where you'll need to do this, in general " "there is no point because loggers are singletons. Code can always access a " @@ -2042,13 +2042,13 @@ msgid "" "module (and not the class) is the unit of software decomposition." msgstr "" -#: ../../howto/logging-cookbook.rst:3926 +#: ../../howto/logging-cookbook.rst:3924 msgid "" "Adding handlers other than :class:`~logging.NullHandler` to a logger in a " "library" msgstr "" -#: ../../howto/logging-cookbook.rst:3928 +#: ../../howto/logging-cookbook.rst:3926 msgid "" "Configuring logging by adding handlers, formatters and filters is the " "responsibility of the application developer, not the library developer. If " @@ -2056,11 +2056,11 @@ msgid "" "your loggers other than a :class:`~logging.NullHandler` instance." msgstr "" -#: ../../howto/logging-cookbook.rst:3934 +#: ../../howto/logging-cookbook.rst:3932 msgid "Creating a lot of loggers" msgstr "" -#: ../../howto/logging-cookbook.rst:3936 +#: ../../howto/logging-cookbook.rst:3934 msgid "" "Loggers are singletons that are never freed during a script execution, and " "so creating lots of loggers will use up memory which can't then be freed. " @@ -2071,14 +2071,14 @@ msgid "" "occasionally slightly more fine-grained than that)." msgstr "" -#: ../../howto/logging-cookbook.rst:3947 +#: ../../howto/logging-cookbook.rst:3945 msgid "Other resources" msgstr "" -#: ../../howto/logging-cookbook.rst:3960 +#: ../../howto/logging-cookbook.rst:3958 msgid ":ref:`Basic Tutorial `" msgstr ":ref:`基礎教學 `" -#: ../../howto/logging-cookbook.rst:3962 +#: ../../howto/logging-cookbook.rst:3960 msgid ":ref:`Advanced Tutorial `" msgstr ":ref:`進階教學 `" diff --git a/library/asyncio-protocol.po b/library/asyncio-protocol.po index c9cf7bfefb..6f8eaaa1ad 100644 --- a/library/asyncio-protocol.po +++ b/library/asyncio-protocol.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2024-02-13 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -568,8 +568,9 @@ msgstr "" #: ../../library/asyncio-protocol.rst:420 msgid "" -"On POSIX systems, this method sends SIGTERM to the subprocess. On Windows, " -"the Windows API function TerminateProcess() is called to stop the subprocess." +"On POSIX systems, this method sends :py:const:`~signal.SIGTERM` to the " +"subprocess. On Windows, the Windows API function :c:func:`!TerminateProcess` " +"is called to stop the subprocess." msgstr "" #: ../../library/asyncio-protocol.rst:424 diff --git a/library/asyncio-subprocess.po b/library/asyncio-subprocess.po index fc8767f5fe..e87d715cb8 100644 --- a/library/asyncio-subprocess.po +++ b/library/asyncio-subprocess.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2024-02-13 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -297,7 +297,7 @@ msgstr "" #: ../../library/asyncio-subprocess.rst:243 msgid "" -"On Windows, :py:data:`SIGTERM` is an alias for :meth:`terminate`. " +"On Windows, :py:const:`~signal.SIGTERM` is an alias for :meth:`terminate`. " "``CTRL_C_EVENT`` and ``CTRL_BREAK_EVENT`` can be sent to processes started " "with a *creationflags* parameter which includes ``CREATE_NEW_PROCESS_GROUP``." msgstr "" @@ -308,13 +308,13 @@ msgstr "" #: ../../library/asyncio-subprocess.rst:252 msgid "" -"On POSIX systems this method sends :py:const:`signal.SIGTERM` to the child " +"On POSIX systems this method sends :py:const:`~signal.SIGTERM` to the child " "process." msgstr "" #: ../../library/asyncio-subprocess.rst:255 msgid "" -"On Windows the Win32 API function :c:func:`TerminateProcess` is called to " +"On Windows the Win32 API function :c:func:`!TerminateProcess` is called to " "stop the child process." msgstr "" diff --git a/library/msvcrt.po b/library/msvcrt.po index 570c0ff35c..a63f21de9a 100644 --- a/library/msvcrt.po +++ b/library/msvcrt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2024-02-13 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -184,5 +184,19 @@ msgstr "" #: ../../library/msvcrt.rst:159 msgid "" "Force the :c:func:`malloc` heap to clean itself up and return unused blocks " -"to the operating system. On failure, this raises :exc:`OSError`." +"to the operating system. On failure, this raises :exc:`OSError`." +msgstr "" + +#: ../../library/msvcrt.rst:164 +msgid "The CRT Assembly version, from the :file:`crtassem.h` header file." +msgstr "" + +#: ../../library/msvcrt.rst:169 +msgid "" +"The VC Assembly public key token, from the :file:`crtassem.h` header file." +msgstr "" + +#: ../../library/msvcrt.rst:174 +msgid "" +"The Libraries Assembly name prefix, from the :file:`crtassem.h` header file." msgstr "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index ae00e0cc2c..f9dc7a6263 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-24 00:03+0000\n" +"POT-Creation-Date: 2024-02-13 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -660,9 +660,9 @@ msgstr "" #: ../../library/multiprocessing.rst:652 msgid "" -"Terminate the process. On POSIX this is done using the ``SIGTERM`` signal; " -"on Windows :c:func:`TerminateProcess` is used. Note that exit handlers and " -"finally clauses, etc., will not be executed." +"Terminate the process. On POSIX this is done using the :py:const:`~signal." +"SIGTERM` signal; on Windows :c:func:`!TerminateProcess` is used. Note that " +"exit handlers and finally clauses, etc., will not be executed." msgstr "" #: ../../library/multiprocessing.rst:656 diff --git a/library/subprocess.po b/library/subprocess.po index a7fe00377d..f81be61790 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-03 00:03+0000\n" +"POT-Creation-Date: 2024-02-13 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1088,9 +1088,9 @@ msgstr "" #: ../../library/subprocess.rst:860 msgid "" -"Stop the child. On POSIX OSs the method sends SIGTERM to the child. On " -"Windows the Win32 API function :c:func:`TerminateProcess` is called to stop " -"the child." +"Stop the child. On POSIX OSs the method sends :py:const:`~signal.SIGTERM` to " +"the child. On Windows the Win32 API function :c:func:`!TerminateProcess` is " +"called to stop the child." msgstr "" #: ../../library/subprocess.rst:867 diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 56ed2f75f3..7b42f6b920 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-05 00:03+0000\n" +"POT-Creation-Date: 2024-02-13 00:03+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-" @@ -2693,11 +2693,12 @@ msgstr "" #: ../../whatsnew/2.6.rst:2391 msgid "" -"The :class:`Popen` objects provided by the :mod:`subprocess` module now " -"have :meth:`terminate`, :meth:`kill`, and :meth:`send_signal` methods. On " -"Windows, :meth:`send_signal` only supports the :const:`SIGTERM` signal, and " -"all these methods are aliases for the Win32 API function :c:func:" -"`TerminateProcess`. (Contributed by Christian Heimes.)" +"The :class:`~subprocess.Popen` objects provided by the :mod:`subprocess` " +"module now have :meth:`~subprocess.Popen.terminate`, :meth:`~subprocess." +"Popen.kill`, and :meth:`~subprocess.Popen.send_signal` methods. On Windows, :" +"meth:`!send_signal` only supports the :py:const:`~signal.SIGTERM` signal, " +"and all these methods are aliases for the Win32 API function :c:func:`!" +"TerminateProcess`. (Contributed by Christian Heimes.)" msgstr "" #: ../../whatsnew/2.6.rst:2398 diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 8c18c4215d..4c81374906 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-05 00:03+0000\n" +"POT-Creation-Date: 2024-02-13 00:03+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-" @@ -268,8 +268,8 @@ msgstr "" #: ../../whatsnew/2.7.rst:199 msgid "" -":func:`operator.isCallable` and :func:`operator.sequenceIncludes`, which are " -"not supported in 3.x, now trigger warnings." +":func:`!operator.isCallable` and :func:`!operator.sequenceIncludes`, which " +"are not supported in 3.x, now trigger warnings." msgstr "" #: ../../whatsnew/2.7.rst:201 @@ -527,14 +527,14 @@ msgid "" "All this flexibility can require a lot of configuration. You can write " "Python statements to create objects and set their properties, but a complex " "set-up requires verbose but boring code. :mod:`logging` also supports a :" -"func:`~logging.fileConfig` function that parses a file, but the file format " -"doesn't support configuring filters, and it's messier to generate " +"func:`~logging.config.fileConfig` function that parses a file, but the file " +"format doesn't support configuring filters, and it's messier to generate " "programmatically." msgstr "" #: ../../whatsnew/2.7.rst:462 msgid "" -"Python 2.7 adds a :func:`~logging.dictConfig` function that uses a " +"Python 2.7 adds a :func:`~logging.config.dictConfig` function that uses a " "dictionary to configure logging. There are many ways to produce a " "dictionary from different sources: construct one with code; parse a file " "containing JSON; or use a YAML parsing library if one is installed. For " @@ -575,9 +575,9 @@ msgstr "" #: ../../whatsnew/2.7.rst:535 msgid "" -"The :class:`~logging.LoggerAdapter` class gained an :meth:`~logging." -"LoggerAdapter.isEnabledFor` method that takes a *level* and returns whether " -"the underlying logger would process a message of that level of importance." +"The :class:`~logging.LoggerAdapter` class gained an :meth:`~logging.Logger." +"isEnabledFor` method that takes a *level* and returns whether the underlying " +"logger would process a message of that level of importance." msgstr "" #: ../../whatsnew/2.7.rst:544 @@ -604,7 +604,7 @@ msgid "" "It's not possible to change the return values of :meth:`~dict.keys`, :meth:" "`~dict.values`, and :meth:`~dict.items` in Python 2.7 because too much code " "would break. Instead the 3.x versions were added under the new names :meth:" -"`~dict.viewkeys`, :meth:`~dict.viewvalues`, and :meth:`~dict.viewitems`." +"`!viewkeys`, :meth:`!viewvalues`, and :meth:`!viewitems`." msgstr "" #: ../../whatsnew/2.7.rst:568 @@ -719,7 +719,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:723 msgid "" -"The :func:`contextlib.nested` function provides a very similar function, so " +"The :func:`!contextlib.nested` function provides a very similar function, so " "it's no longer necessary and has been deprecated." msgstr "" @@ -793,7 +793,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:787 msgid "" "Implicit coercion for complex numbers has been removed; the interpreter will " -"no longer ever attempt to call a :meth:`__coerce__` method on complex " +"no longer ever attempt to call a :meth:`!__coerce__` method on complex " "objects. (Removed by Meador Inge and Mark Dickinson; :issue:`5211`.)" msgstr "" @@ -834,17 +834,17 @@ msgstr "" msgid "" "A low-level change: the :meth:`object.__format__` method now triggers a :exc:" "`PendingDeprecationWarning` if it's passed a format string, because the :" -"meth:`__format__` method for :class:`object` converts the object to a string " -"representation and formats that. Previously the method silently applied the " -"format string to the string representation, but that could hide mistakes in " -"Python code. If you're supplying formatting information such as an " -"alignment or precision, presumably you're expecting the formatting to be " +"meth:`!__format__` method for :class:`object` converts the object to a " +"string representation and formats that. Previously the method silently " +"applied the format string to the string representation, but that could hide " +"mistakes in Python code. If you're supplying formatting information such as " +"an alignment or precision, presumably you're expecting the formatting to be " "applied in some object-specific way. (Fixed by Eric Smith; :issue:`7994`.)" msgstr "" #: ../../whatsnew/2.7.rst:828 msgid "" -"The :func:`int` and :func:`long` types gained a ``bit_length`` method that " +"The :func:`int` and :func:`!long` types gained a ``bit_length`` method that " "returns the number of bits necessary to represent its argument in binary::" msgstr "" @@ -862,8 +862,8 @@ msgstr "" #: ../../whatsnew/2.7.rst:851 msgid "" -"It's now possible for a subclass of the built-in :class:`unicode` type to " -"override the :meth:`__unicode__` method. (Implemented by Victor Stinner; :" +"It's now possible for a subclass of the built-in :class:`!unicode` type to " +"override the :meth:`!__unicode__` method. (Implemented by Victor Stinner; :" "issue:`1583863`.)" msgstr "" @@ -883,7 +883,7 @@ msgid "" "George Sakkis; :issue:`5982`.)" msgstr "" -#: ../../whatsnew/2.7.rst:869 ../../whatsnew/2.7.rst:2465 +#: ../../whatsnew/2.7.rst:869 ../../whatsnew/2.7.rst:2468 msgid "" "When a restricted set of attributes were set using ``__slots__``, deleting " "an unset attribute would not raise :exc:`AttributeError` as you would " @@ -900,11 +900,12 @@ msgstr "" #: ../../whatsnew/2.7.rst:879 msgid "" -"The :class:`file` object will now set the :attr:`filename` attribute on the :" -"exc:`IOError` exception when trying to open a directory on POSIX platforms " -"(noted by Jan Kaliszewski; :issue:`4764`), and now explicitly checks for and " -"forbids writing to read-only file objects instead of trusting the C library " -"to catch and report the error (fixed by Stefan Krah; :issue:`5677`)." +"The :class:`!file` object will now set the :attr:`!filename` attribute on " +"the :exc:`IOError` exception when trying to open a directory on POSIX " +"platforms (noted by Jan Kaliszewski; :issue:`4764`), and now explicitly " +"checks for and forbids writing to read-only file objects instead of trusting " +"the C library to catch and report the error (fixed by Stefan Krah; :issue:" +"`5677`)." msgstr "" #: ../../whatsnew/2.7.rst:886 @@ -1012,7 +1013,7 @@ msgstr "" msgid "" "Apart from the performance improvements this change should be invisible to " "end users, with one exception: for testing and debugging purposes there's a " -"new structseq :data:`sys.long_info` that provides information about the " +"new structseq :data:`!sys.long_info` that provides information about the " "internal format, giving the number of bits per digit and the size in bytes " "of the C type used to store each digit::" msgstr "" @@ -1062,11 +1063,11 @@ msgstr "" #: ../../whatsnew/2.7.rst:1008 msgid "" -"The :meth:`split`, :meth:`replace`, :meth:`rindex`, :meth:`rpartition`, and :" -"meth:`rsplit` methods of string-like types (strings, Unicode strings, and :" -"class:`bytearray` objects) now use a fast reverse-search algorithm instead " -"of a character-by-character scan. This is sometimes faster by a factor of " -"10. (Added by Florent Xicluna; :issue:`7462` and :issue:`7622`.)" +"The :meth:`!split`, :meth:`!replace`, :meth:`!rindex`, :meth:`!rpartition`, " +"and :meth:`!rsplit` methods of string-like types (strings, Unicode strings, " +"and :class:`bytearray` objects) now use a fast reverse-search algorithm " +"instead of a character-by-character scan. This is sometimes faster by a " +"factor of 10. (Added by Florent Xicluna; :issue:`7462` and :issue:`7622`.)" msgstr "" #: ../../whatsnew/2.7.rst:1015 @@ -1115,8 +1116,8 @@ msgstr "" #: ../../whatsnew/2.7.rst:1047 msgid "" -"Updated module: the :mod:`bsddb` module has been updated from 4.7.2devel9 to " -"version 4.8.4 of `the pybsddb package `__. The new version features better Python 3.x compatibility, " "various bug fixes, and adds several new BerkeleyDB flags and methods. " "(Updated by Jesús Cea Avión; :issue:`8156`. The pybsddb changelog can be " @@ -1184,9 +1185,9 @@ msgstr "" #: ../../whatsnew/2.7.rst:1132 msgid "" -"Finally, the :class:`~collections.Mapping` abstract base class now returns :" -"const:`NotImplemented` if a mapping is compared to another type that isn't " -"a :class:`Mapping`. (Fixed by Daniel Stutzbach; :issue:`8729`.)" +"Finally, the :class:`~collections.abc.Mapping` abstract base class now " +"returns :const:`NotImplemented` if a mapping is compared to another type " +"that isn't a :class:`Mapping`. (Fixed by Daniel Stutzbach; :issue:`8729`.)" msgstr "" #: ../../whatsnew/2.7.rst:1137 @@ -1202,7 +1203,7 @@ msgstr "(由 Mats Kindahl 貢獻;:issue:`7005`。)" #: ../../whatsnew/2.7.rst:1161 msgid "" -"Deprecated function: :func:`contextlib.nested`, which allows handling more " +"Deprecated function: :func:`!contextlib.nested`, which allows handling more " "than one context manager with a single :keyword:`with` statement, has been " "deprecated, because the :keyword:`!with` statement now supports multiple " "context managers." @@ -1242,11 +1243,10 @@ msgstr "" msgid "" "New method: the :class:`~decimal.Decimal` class gained a :meth:`~decimal." "Decimal.from_float` class method that performs an exact conversion of a " -"floating-point number to a :class:`~decimal.Decimal`. This exact conversion " -"strives for the closest decimal approximation to the floating-point " -"representation's value; the resulting decimal value will therefore still " -"include the inaccuracy, if any. For example, ``Decimal.from_float(0.1)`` " -"returns " +"floating-point number to a :class:`!Decimal`. This exact conversion strives " +"for the closest decimal approximation to the floating-point representation's " +"value; the resulting decimal value will therefore still include the " +"inaccuracy, if any. For example, ``Decimal.from_float(0.1)`` returns " "``Decimal('0.1000000000000000055511151231257827021181583404541015625')``. " "(Implemented by Raymond Hettinger; :issue:`4796`.)" msgstr "" @@ -1257,9 +1257,9 @@ msgid "" "now produces sensible results based on the numeric values of the operands. " "Previously such comparisons would fall back to Python's default rules for " "comparing objects, which produced arbitrary results based on their type. " -"Note that you still cannot combine :class:`Decimal` and floating-point in " +"Note that you still cannot combine :class:`!Decimal` and floating-point in " "other operations such as addition, since you should be explicitly choosing " -"how to convert between float and :class:`~decimal.Decimal`. (Fixed by Mark " +"how to convert between float and :class:`!Decimal`. (Fixed by Mark " "Dickinson; :issue:`2531`.)" msgstr "" @@ -1287,12 +1287,12 @@ msgid "" "types. (Changed by Mark Dickinson; :issue:`6857`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1220 +#: ../../whatsnew/2.7.rst:1220 ../../whatsnew/2.7.rst:2486 msgid "" "Comparisons involving a signaling NaN value (or ``sNAN``) now signal :const:" -"`InvalidOperation` instead of silently returning a true or false value " -"depending on the comparison operator. Quiet NaN values (or ``NaN``) are now " -"hashable. (Fixed by Mark Dickinson; :issue:`7279`.)" +"`~decimal.InvalidOperation` instead of silently returning a true or false " +"value depending on the comparison operator. Quiet NaN values (or ``NaN``) " +"are now hashable. (Fixed by Mark Dickinson; :issue:`7279`.)" msgstr "" #: ../../whatsnew/2.7.rst:1226 @@ -1313,16 +1313,16 @@ msgstr "" #: ../../whatsnew/2.7.rst:1238 msgid "" -"The :mod:`doctest` module's :const:`IGNORE_EXCEPTION_DETAIL` flag will now " -"ignore the name of the module containing the exception being tested. (Patch " -"by Lennart Regebro; :issue:`7490`.)" +"The :mod:`doctest` module's :const:`~doctest.IGNORE_EXCEPTION_DETAIL` flag " +"will now ignore the name of the module containing the exception being " +"tested. (Patch by Lennart Regebro; :issue:`7490`.)" msgstr "" #: ../../whatsnew/2.7.rst:1242 msgid "" "The :mod:`email` module's :class:`~email.message.Message` class will now " "accept a Unicode-valued payload, automatically converting the payload to the " -"encoding specified by :attr:`output_charset`. (Added by R. David Murray; :" +"encoding specified by :attr:`!output_charset`. (Added by R. David Murray; :" "issue:`1368247`.)" msgstr "" @@ -1359,11 +1359,12 @@ msgstr "" #: ../../whatsnew/2.7.rst:1270 msgid "" "New class decorator: :func:`~functools.total_ordering` in the :mod:" -"`functools` module takes a class that defines an :meth:`__eq__` method and " -"one of :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, or :meth:`__ge__`, " -"and generates the missing comparison methods. Since the :meth:`__cmp__` " -"method is being deprecated in Python 3.x, this decorator makes it easier to " -"define ordered classes. (Added by Raymond Hettinger; :issue:`5479`.)" +"`functools` module takes a class that defines an :meth:`~object.__eq__` " +"method and one of :meth:`~object.__lt__`, :meth:`~object.__le__`, :meth:" +"`~object.__gt__`, or :meth:`~object.__ge__`, and generates the missing " +"comparison methods. Since the :meth:`!__cmp__` method is being deprecated " +"in Python 3.x, this decorator makes it easier to define ordered classes. " +"(Added by Raymond Hettinger; :issue:`5479`.)" msgstr "" #: ../../whatsnew/2.7.rst:1278 @@ -1404,10 +1405,10 @@ msgstr "" #: ../../whatsnew/2.7.rst:1303 msgid "" -"New attribute: the :mod:`hashlib` module now has an :attr:`~hashlib.hashlib." -"algorithms` attribute containing a tuple naming the supported algorithms. In " -"Python 2.7, ``hashlib.algorithms`` contains ``('md5', 'sha1', 'sha224', " -"'sha256', 'sha384', 'sha512')``. (Contributed by Carl Chenet; :issue:`7418`.)" +"New attribute: the :mod:`hashlib` module now has an :attr:`!algorithms` " +"attribute containing a tuple naming the supported algorithms. In Python 2.7, " +"``hashlib.algorithms`` contains ``('md5', 'sha1', 'sha224', 'sha256', " +"'sha384', 'sha512')``. (Contributed by Carl Chenet; :issue:`7418`.)" msgstr "" #: ../../whatsnew/2.7.rst:1309 @@ -1457,14 +1458,15 @@ msgid "" "Updated module: The :mod:`io` library has been upgraded to the version " "shipped with Python 3.1. For 3.1, the I/O library was entirely rewritten in " "C and is 2 to 20 times faster depending on the task being performed. The " -"original Python version was renamed to the :mod:`_pyio` module." +"original Python version was renamed to the :mod:`!_pyio` module." msgstr "" #: ../../whatsnew/2.7.rst:1353 msgid "" "One minor resulting change: the :class:`io.TextIOBase` class now has an :" -"attr:`errors` attribute giving the error setting used for encoding and " -"decoding errors (one of ``'strict'``, ``'replace'``, ``'ignore'``)." +"attr:`~io.TextIOBase.errors` attribute giving the error setting used for " +"encoding and decoding errors (one of ``'strict'``, ``'replace'``, " +"``'ignore'``)." msgstr "" #: ../../whatsnew/2.7.rst:1358 @@ -1559,12 +1561,12 @@ msgstr "" #: ../../whatsnew/2.7.rst:1426 msgid "" -"The :class:`~multiprocessing.Pool` class, which controls a pool of worker " -"processes, now has an optional *maxtasksperchild* parameter. Worker " +"The :class:`~multiprocessing.pool.Pool` class, which controls a pool of " +"worker processes, now has an optional *maxtasksperchild* parameter. Worker " "processes will perform the specified number of tasks and then exit, causing " -"the :class:`~multiprocessing.Pool` to start a new worker. This is useful if " -"tasks may leak memory or other resources, or if some tasks will cause the " -"worker to become very large. (Contributed by Charles Cazabon; :issue:`6963`.)" +"the :class:`!Pool` to start a new worker. This is useful if tasks may leak " +"memory or other resources, or if some tasks will cause the worker to become " +"very large. (Contributed by Charles Cazabon; :issue:`6963`.)" msgstr "" #: ../../whatsnew/2.7.rst:1434 @@ -1660,9 +1662,9 @@ msgid "" "site- and user-specific paths. :func:`~site.getsitepackages` returns a list " "containing all global site-packages directories, :func:`~site." "getusersitepackages` returns the path of the user's site-packages directory, " -"and :func:`~site.getuserbase` returns the value of the :envvar:`USER_BASE` " -"environment variable, giving the path to a directory that can be used to " -"store data. (Contributed by Tarek Ziadé; :issue:`6693`.)" +"and :func:`~site.getuserbase` returns the value of the :data:`~site." +"USER_BASE` environment variable, giving the path to a directory that can be " +"used to store data. (Contributed by Tarek Ziadé; :issue:`6693`.)" msgstr "" #: ../../whatsnew/2.7.rst:1506 @@ -1718,18 +1720,18 @@ msgstr "" msgid "" "The :mod:`ssl` module's :class:`~ssl.SSLSocket` objects now support the " "buffer API, which fixed a test suite failure (fix by Antoine Pitrou; :issue:" -"`7133`) and automatically set OpenSSL's :c:macro:`SSL_MODE_AUTO_RETRY`, " +"`7133`) and automatically set OpenSSL's :c:macro:`!SSL_MODE_AUTO_RETRY`, " "which will prevent an error code being returned from :meth:`recv` operations " "that trigger an SSL renegotiation (fix by Antoine Pitrou; :issue:`8222`)." msgstr "" #: ../../whatsnew/2.7.rst:1547 msgid "" -"The :func:`ssl.wrap_socket` constructor function now takes a *ciphers* " -"argument that's a string listing the encryption algorithms to be allowed; " -"the format of the string is described `in the OpenSSL documentation `__. (Added by Antoine " -"Pitrou; :issue:`8322`.)" +"The :func:`~ssl.SSLContext.wrap_socket` constructor function now takes a " +"*ciphers* argument that's a string listing the encryption algorithms to be " +"allowed; the format of the string is described `in the OpenSSL documentation " +"`__. (Added by " +"Antoine Pitrou; :issue:`8322`.)" msgstr "" #: ../../whatsnew/2.7.rst:1554 @@ -1754,9 +1756,9 @@ msgid "" "a value is too large for a particular integer format code (one of " "``bBhHiIlLqQ``); it now always raises a :exc:`struct.error` exception. " "(Changed by Mark Dickinson; :issue:`1523`.) The :func:`~struct.pack` " -"function will also attempt to use :meth:`__index__` to convert and pack non-" -"integers before trying the :meth:`__int__` method or reporting an error. " -"(Changed by Mark Dickinson; :issue:`8300`.)" +"function will also attempt to use :meth:`~object.__index__` to convert and " +"pack non-integers before trying the :meth:`~object.__int__` method or " +"reporting an error. (Changed by Mark Dickinson; :issue:`8300`.)" msgstr "" #: ../../whatsnew/2.7.rst:1575 @@ -1774,8 +1776,8 @@ msgstr "(由 Gregory P. Smith 所貢獻。)" #: ../../whatsnew/2.7.rst:1592 msgid "" "The :mod:`subprocess` module will now retry its internal system calls on " -"receiving an :const:`EINTR` signal. (Reported by several people; final " -"patch by Gregory P. Smith in :issue:`1068268`.)" +"receiving an :const:`~errno.EINTR` signal. (Reported by several people; " +"final patch by Gregory P. Smith in :issue:`1068268`.)" msgstr "" #: ../../whatsnew/2.7.rst:1596 @@ -1786,7 +1788,7 @@ msgid "" "Hylton.)" msgstr "" -#: ../../whatsnew/2.7.rst:1601 ../../whatsnew/2.7.rst:2499 +#: ../../whatsnew/2.7.rst:1601 ../../whatsnew/2.7.rst:2502 msgid "" "The :mod:`syslog` module will now use the value of ``sys.argv[0]`` as the " "identifier instead of the previous default value of ``'python'``. (Changed " @@ -1795,21 +1797,21 @@ msgstr "" #: ../../whatsnew/2.7.rst:1605 msgid "" -"The ``sys.version_info`` value is now a named tuple, with attributes named :" -"attr:`major`, :attr:`minor`, :attr:`micro`, :attr:`releaselevel`, and :attr:" -"`serial`. (Contributed by Ross Light; :issue:`4285`.)" +"The :attr:`sys.version_info` value is now a named tuple, with attributes " +"named :attr:`!major`, :attr:`!minor`, :attr:`!micro`, :attr:`!releaselevel`, " +"and :attr:`!serial`. (Contributed by Ross Light; :issue:`4285`.)" msgstr "" #: ../../whatsnew/2.7.rst:1610 msgid "" ":func:`sys.getwindowsversion` also returns a named tuple, with attributes " -"named :attr:`major`, :attr:`minor`, :attr:`build`, :attr:`platform`, :attr:" -"`service_pack`, :attr:`service_pack_major`, :attr:`service_pack_minor`, :" -"attr:`suite_mask`, and :attr:`product_type`. (Contributed by Brian Curtin; :" -"issue:`7766`.)" +"named :attr:`!major`, :attr:`!minor`, :attr:`!build`, :attr:`!platform`, :" +"attr:`!service_pack`, :attr:`!service_pack_major`, :attr:`!" +"service_pack_minor`, :attr:`!suite_mask`, and :attr:`!product_type`. " +"(Contributed by Brian Curtin; :issue:`7766`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1616 ../../whatsnew/2.7.rst:2503 +#: ../../whatsnew/2.7.rst:1616 ../../whatsnew/2.7.rst:2506 msgid "" "The :mod:`tarfile` module's default error handling has changed, to no longer " "suppress fatal errors. The default error level was previously 0, which " @@ -1853,7 +1855,7 @@ msgid "" "Florent Xicluna; :issue:`8024`)." msgstr "" -#: ../../whatsnew/2.7.rst:1651 ../../whatsnew/2.7.rst:2511 +#: ../../whatsnew/2.7.rst:1651 ../../whatsnew/2.7.rst:2514 msgid "" "The :mod:`urlparse ` module's :func:`~urllib.parse.urlsplit` " "now handles unknown URL schemes in a fashion compliant with :rfc:`3986`: if " @@ -1863,11 +1865,11 @@ msgid "" "behaviour. For example, Python 2.6.4 or 2.5 will return the following:" msgstr "" -#: ../../whatsnew/2.7.rst:1666 ../../whatsnew/2.7.rst:2526 +#: ../../whatsnew/2.7.rst:1666 ../../whatsnew/2.7.rst:2529 msgid "Python 2.7 (and Python 2.6.5) will return:" msgstr "" -#: ../../whatsnew/2.7.rst:1675 ../../whatsnew/2.7.rst:2535 +#: ../../whatsnew/2.7.rst:1675 ../../whatsnew/2.7.rst:2538 msgid "" "(Python 2.7 actually produces slightly different output, since it returns a " "named tuple instead of a standard tuple.)" @@ -1889,9 +1891,9 @@ msgid "" "Michael Foord.)" msgstr "" -#: ../../whatsnew/2.7.rst:1694 ../../whatsnew/2.7.rst:2489 +#: ../../whatsnew/2.7.rst:1694 msgid "" -"The ElementTree library, :mod:`xml.etree`, no longer escapes ampersands and " +"The :mod:`xml.etree.ElementTree` library, no longer escapes ampersands and " "angle brackets when outputting an XML processing instruction (which looks " "like ````) or comment (which looks like " "````). (Patch by Neil Muller; :issue:`2746`.)" @@ -1903,10 +1905,10 @@ msgid "" "client>` and :mod:`SimpleXMLRPCServer ` modules, have " "improved performance by supporting HTTP/1.1 keep-alive and by optionally " "using gzip encoding to compress the XML being exchanged. The gzip " -"compression is controlled by the :attr:`encode_threshold` attribute of :" -"class:`SimpleXMLRPCRequestHandler`, which contains a size in bytes; " -"responses larger than this will be compressed. (Contributed by Kristján " -"Valur Jónsson; :issue:`6267`.)" +"compression is controlled by the :attr:`!encode_threshold` attribute of :" +"class:`~xmlrpc.server.SimpleXMLRPCRequestHandler`, which contains a size in " +"bytes; responses larger than this will be compressed. (Contributed by " +"Kristján Valur Jónsson; :issue:`6267`.)" msgstr "" #: ../../whatsnew/2.7.rst:1709 @@ -1920,19 +1922,19 @@ msgstr "" msgid "" ":mod:`zipfile` now also supports archiving empty directories and extracts " "them correctly. (Fixed by Kuba Wieczorek; :issue:`4710`.) Reading files out " -"of an archive is faster, and interleaving :meth:`~zipfile.ZipFile.read` and :" -"meth:`~zipfile.ZipFile.readline` now works correctly. (Contributed by Nir " -"Aides; :issue:`7610`.)" +"of an archive is faster, and interleaving :meth:`read() ` and :meth:`readline() ` now works correctly. " +"(Contributed by Nir Aides; :issue:`7610`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1719 +#: ../../whatsnew/2.7.rst:1720 msgid "" "The :func:`~zipfile.is_zipfile` function now accepts a file object, in " "addition to the path names accepted in earlier versions. (Contributed by " "Gabriel Genellina; :issue:`4756`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1723 +#: ../../whatsnew/2.7.rst:1724 msgid "" "The :meth:`~zipfile.ZipFile.writestr` method now has an optional " "*compress_type* parameter that lets you override the default compression " @@ -1940,11 +1942,11 @@ msgid "" "by Ronald Oussoren; :issue:`6003`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1736 +#: ../../whatsnew/2.7.rst:1737 msgid "New module: importlib" msgstr "" -#: ../../whatsnew/2.7.rst:1738 +#: ../../whatsnew/2.7.rst:1739 msgid "" "Python 3.1 includes the :mod:`importlib` package, a re-implementation of the " "logic underlying Python's :keyword:`import` statement. :mod:`importlib` is " @@ -1955,7 +1957,7 @@ msgid "" "import_module`." msgstr "" -#: ../../whatsnew/2.7.rst:1746 +#: ../../whatsnew/2.7.rst:1747 msgid "" "``import_module(name, package=None)`` imports a module. *name* is a string " "containing the module or package's name. It's possible to do relative " @@ -1966,24 +1968,24 @@ msgid "" "imported module into ``sys.modules`` and returns the module object." msgstr "" -#: ../../whatsnew/2.7.rst:1755 +#: ../../whatsnew/2.7.rst:1756 msgid "Here are some examples::" msgstr "" "以下是一些範例:\n" "\n" "::" -#: ../../whatsnew/2.7.rst:1766 +#: ../../whatsnew/2.7.rst:1767 msgid "" ":mod:`importlib` was implemented by Brett Cannon and introduced in Python " "3.1." msgstr "" -#: ../../whatsnew/2.7.rst:1771 +#: ../../whatsnew/2.7.rst:1772 msgid "New module: sysconfig" msgstr "" -#: ../../whatsnew/2.7.rst:1773 +#: ../../whatsnew/2.7.rst:1774 msgid "" "The :mod:`sysconfig` module has been pulled out of the Distutils package, " "becoming a new top-level module in its own right. :mod:`sysconfig` provides " @@ -1992,42 +1994,42 @@ msgid "" "running from its source directory." msgstr "" -#: ../../whatsnew/2.7.rst:1780 +#: ../../whatsnew/2.7.rst:1781 msgid "Some of the functions in the module are:" msgstr "" -#: ../../whatsnew/2.7.rst:1782 +#: ../../whatsnew/2.7.rst:1783 msgid "" ":func:`~sysconfig.get_config_var` returns variables from Python's Makefile " "and the :file:`pyconfig.h` file." msgstr "" -#: ../../whatsnew/2.7.rst:1784 +#: ../../whatsnew/2.7.rst:1785 msgid "" ":func:`~sysconfig.get_config_vars` returns a dictionary containing all of " "the configuration variables." msgstr "" -#: ../../whatsnew/2.7.rst:1786 +#: ../../whatsnew/2.7.rst:1787 msgid "" ":func:`~sysconfig.get_path` returns the configured path for a particular " "type of module: the standard library, site-specific modules, platform-" "specific modules, etc." msgstr "" -#: ../../whatsnew/2.7.rst:1789 +#: ../../whatsnew/2.7.rst:1790 msgid "" ":func:`~sysconfig.is_python_build` returns true if you're running a binary " "from a Python source tree, and false otherwise." msgstr "" -#: ../../whatsnew/2.7.rst:1792 +#: ../../whatsnew/2.7.rst:1793 msgid "" "Consult the :mod:`sysconfig` documentation for more details and for a " "complete list of functions." msgstr "" -#: ../../whatsnew/2.7.rst:1795 +#: ../../whatsnew/2.7.rst:1796 msgid "" "The Distutils package and :mod:`sysconfig` are now maintained by Tarek " "Ziadé, who has also started a Distutils2 package (source repository at " @@ -2035,11 +2037,11 @@ msgid "" "of Distutils." msgstr "" -#: ../../whatsnew/2.7.rst:1802 +#: ../../whatsnew/2.7.rst:1803 msgid "ttk: Themed Widgets for Tk" msgstr "" -#: ../../whatsnew/2.7.rst:1804 +#: ../../whatsnew/2.7.rst:1805 msgid "" "Tcl/Tk 8.5 includes a set of themed widgets that re-implement basic Tk " "widgets but have a more customizable appearance and can therefore more " @@ -2048,37 +2050,38 @@ msgid "" "added to Tcl/Tck release 8.5." msgstr "" -#: ../../whatsnew/2.7.rst:1810 +#: ../../whatsnew/2.7.rst:1811 msgid "" -"To learn more, read the :mod:`ttk` module documentation. You may also wish " -"to read the Tcl/Tk manual page describing the Ttk theme engine, available at " -"https://www.tcl.tk/man/tcl8.5/TkCmd/ttk_intro.htm. Some screenshots of the " -"Python/Ttk code in use are at https://code.google.com/archive/p/python-ttk/" -"wikis/Screenshots.wiki." +"To learn more, read the :mod:`~tkinter.ttk` module documentation. You may " +"also wish to read the Tcl/Tk manual page describing the Ttk theme engine, " +"available at https://www.tcl.tk/man/tcl8.5/TkCmd/ttk_intro.html. Some " +"screenshots of the Python/Ttk code in use are at https://code.google.com/" +"archive/p/python-ttk/wikis/Screenshots.wiki." msgstr "" -#: ../../whatsnew/2.7.rst:1817 +#: ../../whatsnew/2.7.rst:1818 msgid "" -"The :mod:`ttk` module was written by Guilherme Polo and added in :issue:" -"`2983`. An alternate version called ``Tile.py``, written by Martin Franklin " -"and maintained by Kevin Walzer, was proposed for inclusion in :issue:`2618`, " -"but the authors argued that Guilherme Polo's work was more comprehensive." +"The :mod:`tkinter.ttk` module was written by Guilherme Polo and added in :" +"issue:`2983`. An alternate version called ``Tile.py``, written by Martin " +"Franklin and maintained by Kevin Walzer, was proposed for inclusion in :" +"issue:`2618`, but the authors argued that Guilherme Polo's work was more " +"comprehensive." msgstr "" -#: ../../whatsnew/2.7.rst:1827 +#: ../../whatsnew/2.7.rst:1828 msgid "Updated module: unittest" msgstr "" -#: ../../whatsnew/2.7.rst:1829 +#: ../../whatsnew/2.7.rst:1830 msgid "" "The :mod:`unittest` module was greatly enhanced; many new features were " "added. Most of these features were implemented by Michael Foord, unless " "otherwise noted. The enhanced version of the module is downloadable " -"separately for use with Python versions 2.4 to 2.6, packaged as the :mod:" -"`unittest2` package, from https://pypi.org/project/unittest2." +"separately for use with Python versions 2.4 to 2.6, packaged as the :mod:`!" +"unittest2` package, from https://pypi.org/project/unittest2." msgstr "" -#: ../../whatsnew/2.7.rst:1836 +#: ../../whatsnew/2.7.rst:1837 msgid "" "When used from the command line, the module can automatically discover " "tests. It's not as fancy as `py.test `__ or `nose " @@ -2088,17 +2091,17 @@ msgid "" "files named ``test*.py``::" msgstr "" -#: ../../whatsnew/2.7.rst:1845 +#: ../../whatsnew/2.7.rst:1846 msgid "" "Consult the :mod:`unittest` module documentation for more details. " "(Developed in :issue:`6001`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1848 +#: ../../whatsnew/2.7.rst:1849 msgid "The :func:`~unittest.main` function supports some other new options:" msgstr "" -#: ../../whatsnew/2.7.rst:1850 +#: ../../whatsnew/2.7.rst:1851 msgid "" ":option:`-b ` or :option:`!--buffer` will buffer the standard " "output and standard error streams during each test. If the test passes, any " @@ -2106,7 +2109,7 @@ msgid "" "displayed." msgstr "" -#: ../../whatsnew/2.7.rst:1855 +#: ../../whatsnew/2.7.rst:1856 msgid "" ":option:`-c ` or :option:`!--catch` will cause the control-C " "interrupt to be handled more gracefully. Instead of interrupting the test " @@ -2115,7 +2118,7 @@ msgid "" "impatient, a second press of control-C will cause an immediate interruption." msgstr "" -#: ../../whatsnew/2.7.rst:1862 +#: ../../whatsnew/2.7.rst:1863 msgid "" "This control-C handler tries to avoid causing problems when the code being " "tested or the tests being run have defined a signal handler of their own, by " @@ -2125,7 +2128,7 @@ msgid "" "disabled." msgstr "" -#: ../../whatsnew/2.7.rst:1869 +#: ../../whatsnew/2.7.rst:1870 msgid "" ":option:`-f ` or :option:`!--failfast` makes test execution " "stop immediately when a test fails instead of continuing to execute further " @@ -2133,20 +2136,20 @@ msgid "" "`8074`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1874 +#: ../../whatsnew/2.7.rst:1875 msgid "" "The progress messages now show 'x' for expected failures and 'u' for " "unexpected successes when run in verbose mode. (Contributed by Benjamin " "Peterson.)" msgstr "" -#: ../../whatsnew/2.7.rst:1878 +#: ../../whatsnew/2.7.rst:1879 msgid "" "Test cases can raise the :exc:`~unittest.SkipTest` exception to skip a test " "(:issue:`1034053`)." msgstr "" -#: ../../whatsnew/2.7.rst:1881 +#: ../../whatsnew/2.7.rst:1882 msgid "" "The error messages for :meth:`~unittest.TestCase.assertEqual`, :meth:" "`~unittest.TestCase.assertTrue`, and :meth:`~unittest.TestCase.assertFalse` " @@ -2157,18 +2160,18 @@ msgid "" "`5663`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1888 +#: ../../whatsnew/2.7.rst:1889 msgid "" "The :meth:`~unittest.TestCase.assertRaises` method now returns a context " "handler when called without providing a callable object to run. For " "example, you can write this::" msgstr "" -#: ../../whatsnew/2.7.rst:1895 +#: ../../whatsnew/2.7.rst:1896 msgid "(Implemented by Antoine Pitrou; :issue:`4444`.)" msgstr "(由 Antoine Pitrou 實作;:issue:`4444`。)" -#: ../../whatsnew/2.7.rst:1899 +#: ../../whatsnew/2.7.rst:1900 msgid "" "Module- and class-level setup and teardown fixtures are now supported. " "Modules can contain :func:`~unittest.setUpModule` and :func:`~unittest." @@ -2179,7 +2182,7 @@ msgid "" "case in a different module or class." msgstr "" -#: ../../whatsnew/2.7.rst:1907 +#: ../../whatsnew/2.7.rst:1908 msgid "" "The methods :meth:`~unittest.TestCase.addCleanup` and :meth:`~unittest." "TestCase.doCleanups` were added. :meth:`~unittest.TestCase.addCleanup` lets " @@ -2189,7 +2192,7 @@ msgid "" "simpler resource allocation and deallocation during tests (:issue:`5679`)." msgstr "" -#: ../../whatsnew/2.7.rst:1915 +#: ../../whatsnew/2.7.rst:1916 msgid "" "A number of new methods were added that provide more specialized tests. " "Many of these methods were written by Google engineers for use in their test " @@ -2197,21 +2200,21 @@ msgid "" "Python's version of :mod:`unittest`." msgstr "" -#: ../../whatsnew/2.7.rst:1920 +#: ../../whatsnew/2.7.rst:1921 msgid "" ":meth:`~unittest.TestCase.assertIsNone` and :meth:`~unittest.TestCase." "assertIsNotNone` take one expression and verify that the result is or is not " "``None``." msgstr "" -#: ../../whatsnew/2.7.rst:1923 +#: ../../whatsnew/2.7.rst:1924 msgid "" ":meth:`~unittest.TestCase.assertIs` and :meth:`~unittest.TestCase." "assertIsNot` take two values and check whether the two values evaluate to " "the same object or not. (Added by Michael Foord; :issue:`2578`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1927 +#: ../../whatsnew/2.7.rst:1928 msgid "" ":meth:`~unittest.TestCase.assertIsInstance` and :meth:`~unittest.TestCase." "assertNotIsInstance` check whether the resulting object is an instance of a " @@ -2219,14 +2222,14 @@ msgid "" "issue:`7031`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1932 +#: ../../whatsnew/2.7.rst:1933 msgid "" ":meth:`~unittest.TestCase.assertGreater`, :meth:`~unittest.TestCase." "assertGreaterEqual`, :meth:`~unittest.TestCase.assertLess`, and :meth:" "`~unittest.TestCase.assertLessEqual` compare two quantities." msgstr "" -#: ../../whatsnew/2.7.rst:1936 +#: ../../whatsnew/2.7.rst:1937 msgid "" ":meth:`~unittest.TestCase.assertMultiLineEqual` compares two strings, and if " "they're not equal, displays a helpful comparison that highlights the " @@ -2234,40 +2237,41 @@ msgid "" "Unicode strings are compared with :meth:`~unittest.TestCase.assertEqual`." msgstr "" -#: ../../whatsnew/2.7.rst:1941 +#: ../../whatsnew/2.7.rst:1942 msgid "" -":meth:`~unittest.TestCase.assertRegexpMatches` and :meth:`~unittest.TestCase." -"assertNotRegexpMatches` checks whether the first argument is a string " -"matching or not matching the regular expression provided as the second " -"argument (:issue:`8038`)." +":meth:`assertRegexpMatches() ` and :meth:" +"`assertNotRegexpMatches() ` checks whether " +"the first argument is a string matching or not matching the regular " +"expression provided as the second argument (:issue:`8038`)." msgstr "" -#: ../../whatsnew/2.7.rst:1946 +#: ../../whatsnew/2.7.rst:1947 msgid "" -":meth:`~unittest.TestCase.assertRaisesRegexp` checks whether a particular " -"exception is raised, and then also checks that the string representation of " -"the exception matches the provided regular expression." +":meth:`assertRaisesRegexp() ` checks " +"whether a particular exception is raised, and then also checks that the " +"string representation of the exception matches the provided regular " +"expression." msgstr "" -#: ../../whatsnew/2.7.rst:1950 +#: ../../whatsnew/2.7.rst:1952 msgid "" ":meth:`~unittest.TestCase.assertIn` and :meth:`~unittest.TestCase." "assertNotIn` tests whether *first* is or is not in *second*." msgstr "" -#: ../../whatsnew/2.7.rst:1953 +#: ../../whatsnew/2.7.rst:1955 msgid "" -":meth:`~unittest.TestCase.assertItemsEqual` tests whether two provided " -"sequences contain the same elements." +":meth:`assertItemsEqual() ` tests " +"whether two provided sequences contain the same elements." msgstr "" -#: ../../whatsnew/2.7.rst:1956 +#: ../../whatsnew/2.7.rst:1958 msgid "" ":meth:`~unittest.TestCase.assertSetEqual` compares whether two sets are " "equal, and only reports the differences between the sets in case of error." msgstr "" -#: ../../whatsnew/2.7.rst:1959 +#: ../../whatsnew/2.7.rst:1961 msgid "" "Similarly, :meth:`~unittest.TestCase.assertListEqual` and :meth:`~unittest." "TestCase.assertTupleEqual` compare the specified types and explain any " @@ -2278,16 +2282,16 @@ msgid "" "both sequences are of a particular type." msgstr "" -#: ../../whatsnew/2.7.rst:1967 +#: ../../whatsnew/2.7.rst:1969 msgid "" ":meth:`~unittest.TestCase.assertDictEqual` compares two dictionaries and " "reports the differences; it's now used by default when you compare two " -"dictionaries using :meth:`~unittest.TestCase.assertEqual`. :meth:`~unittest." -"TestCase.assertDictContainsSubset` checks whether all of the key/value pairs " -"in *first* are found in *second*." +"dictionaries using :meth:`~unittest.TestCase.assertEqual`. :meth:`!" +"assertDictContainsSubset` checks whether all of the key/value pairs in " +"*first* are found in *second*." msgstr "" -#: ../../whatsnew/2.7.rst:1972 +#: ../../whatsnew/2.7.rst:1974 msgid "" ":meth:`~unittest.TestCase.assertAlmostEqual` and :meth:`~unittest.TestCase." "assertNotAlmostEqual` test whether *first* and *second* are approximately " @@ -2296,14 +2300,14 @@ msgid "" "require the difference to be smaller than a supplied *delta* value." msgstr "" -#: ../../whatsnew/2.7.rst:1978 +#: ../../whatsnew/2.7.rst:1980 msgid "" ":meth:`~unittest.TestLoader.loadTestsFromName` properly honors the :attr:" "`~unittest.TestLoader.suiteClass` attribute of the :class:`~unittest." "TestLoader`. (Fixed by Mark Roddy; :issue:`6866`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1982 +#: ../../whatsnew/2.7.rst:1984 msgid "" "A new hook lets you extend the :meth:`~unittest.TestCase.assertEqual` method " "to handle new data types. The :meth:`~unittest.TestCase." @@ -2315,7 +2319,7 @@ msgid "" "sequence comparison methods do." msgstr "" -#: ../../whatsnew/2.7.rst:1991 +#: ../../whatsnew/2.7.rst:1993 msgid "" ":func:`unittest.main` now takes an optional ``exit`` argument. If false, :" "func:`~unittest.main` doesn't call :func:`sys.exit`, allowing :func:" @@ -2323,7 +2327,7 @@ msgid "" "by J. Pablo Fernández; :issue:`3379`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1996 +#: ../../whatsnew/2.7.rst:1998 msgid "" ":class:`~unittest.TestResult` has new :meth:`~unittest.TestResult." "startTestRun` and :meth:`~unittest.TestResult.stopTestRun` methods that are " @@ -2331,7 +2335,7 @@ msgid "" "Collins; :issue:`5728`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2000 +#: ../../whatsnew/2.7.rst:2002 msgid "" "With all these changes, the :file:`unittest.py` was becoming awkwardly " "large, so the module was turned into a package and the code split into " @@ -2339,7 +2343,7 @@ msgid "" "imported or used." msgstr "" -#: ../../whatsnew/2.7.rst:2008 +#: ../../whatsnew/2.7.rst:2010 msgid "" "https://web.archive.org/web/20210619163128/http://www.voidspace.org.uk/" "python/articles/unittest2.shtml" @@ -2347,37 +2351,37 @@ msgstr "" "https://web.archive.org/web/20210619163128/http://www.voidspace.org.uk/" "python/articles/unittest2.shtml" -#: ../../whatsnew/2.7.rst:2008 +#: ../../whatsnew/2.7.rst:2010 msgid "" "Describes the new features, how to use them, and the rationale for various " "design decisions. (By Michael Foord.)" msgstr "" -#: ../../whatsnew/2.7.rst:2014 +#: ../../whatsnew/2.7.rst:2016 msgid "Updated module: ElementTree 1.3" msgstr "" -#: ../../whatsnew/2.7.rst:2016 +#: ../../whatsnew/2.7.rst:2018 msgid "" "The version of the ElementTree library included with Python was updated to " "version 1.3. Some of the new features are:" msgstr "" -#: ../../whatsnew/2.7.rst:2019 +#: ../../whatsnew/2.7.rst:2021 msgid "" "The various parsing functions now take a *parser* keyword argument giving " "an :class:`~xml.etree.ElementTree.XMLParser` instance that will be used. " "This makes it possible to override the file's internal encoding::" msgstr "" -#: ../../whatsnew/2.7.rst:2026 +#: ../../whatsnew/2.7.rst:2028 msgid "" -"Errors in parsing XML now raise a :exc:`ParseError` exception, whose " -"instances have a :attr:`position` attribute containing a (*line*, *column*) " -"tuple giving the location of the problem." +"Errors in parsing XML now raise a :exc:`~xml.etree.ElementTree.ParseError` " +"exception, whose instances have a :attr:`!position` attribute containing a " +"(*line*, *column*) tuple giving the location of the problem." msgstr "" -#: ../../whatsnew/2.7.rst:2030 +#: ../../whatsnew/2.7.rst:2032 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:" @@ -2386,12 +2390,13 @@ msgid "" "\"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:" -"`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." +"`~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:2042 +#: ../../whatsnew/2.7.rst:2045 msgid "" "Namespace handling has also been improved. All ``xmlns:`` " "declarations are now output on the root element, not scattered throughout " @@ -2401,7 +2406,7 @@ msgid "" "the true/false *xml_declaration* parameter to suppress the XML declaration." msgstr "" -#: ../../whatsnew/2.7.rst:2050 +#: ../../whatsnew/2.7.rst:2053 msgid "" "New :class:`~xml.etree.ElementTree.Element` method: :meth:`~xml.etree." "ElementTree.Element.extend` appends the items from a sequence to the " @@ -2409,22 +2414,24 @@ msgid "" "to move children from one element to another::" msgstr "" -#: ../../whatsnew/2.7.rst:2067 +#: ../../whatsnew/2.7.rst:2070 msgid "" -"New :class:`Element` method: :meth:`~xml.etree.ElementTree.Element.iter` " -"yields the children of the element as a generator. It's also possible to " -"write ``for child in elem:`` to loop over an element's children. The " -"existing method :meth:`getiterator` is now deprecated, as is :meth:" -"`getchildren` which constructs and returns a list of children." +"New :class:`~xml.etree.ElementTree.Element` method: :meth:`~xml.etree." +"ElementTree.Element.iter` yields the children of the element as a " +"generator. It's also possible to write ``for child in elem:`` to loop over " +"an element's children. The existing method :meth:`!getiterator` is now " +"deprecated, as is :meth:`!getchildren` which constructs and returns a list " +"of children." msgstr "" -#: ../../whatsnew/2.7.rst:2074 +#: ../../whatsnew/2.7.rst:2077 msgid "" -"New :class:`Element` method: :meth:`~xml.etree.ElementTree.Element.itertext` " -"yields all chunks of text that are descendants of the element. For example::" +"New :class:`~xml.etree.ElementTree.Element` method: :meth:`~xml.etree." +"ElementTree.Element.itertext` yields all chunks of text that are descendants " +"of the element. For example::" msgstr "" -#: ../../whatsnew/2.7.rst:2085 +#: ../../whatsnew/2.7.rst:2088 msgid "" "Deprecated: using an element as a Boolean (i.e., ``if elem:``) would return " "true if the element had any children, or false if there were no children. " @@ -2434,7 +2441,7 @@ msgid "" "number of children, or ``elem is not None``." msgstr "" -#: ../../whatsnew/2.7.rst:2093 +#: ../../whatsnew/2.7.rst:2096 msgid "" "Fredrik Lundh develops ElementTree and produced the 1.3 version; you can " "read his article describing 1.3 at https://web.archive.org/" @@ -2443,15 +2450,15 @@ msgid "" "python-dev and in :issue:`6472`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2103 +#: ../../whatsnew/2.7.rst:2106 msgid "Build and C API Changes" msgstr "" -#: ../../whatsnew/2.7.rst:2105 +#: ../../whatsnew/2.7.rst:2108 msgid "Changes to Python's build process and to the C API include:" msgstr "" -#: ../../whatsnew/2.7.rst:2107 +#: ../../whatsnew/2.7.rst:2110 msgid "" "The latest release of the GNU Debugger, GDB 7, can be `scripted using Python " "`_; discussed in :issue:`5753`, and fixed by " "Antoine Pitrou." msgstr "" -#: ../../whatsnew/2.7.rst:2182 +#: ../../whatsnew/2.7.rst:2185 msgid "" "New macros: the Python header files now define the following macros: :c:" "macro:`Py_ISALNUM`, :c:macro:`Py_ISALPHA`, :c:macro:`Py_ISDIGIT`, :c:macro:" @@ -2570,7 +2577,7 @@ msgid "" "Eric Smith; :issue:`5793`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2200 +#: ../../whatsnew/2.7.rst:2203 msgid "" "Removed function: :c:func:`!PyEval_CallObject` is now only available as a " "macro. A function version was being kept around to preserve ABI linking " @@ -2578,7 +2585,7 @@ msgid "" "(Removed by Antoine Pitrou; :issue:`8276`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2205 +#: ../../whatsnew/2.7.rst:2208 msgid "" "New format codes: the :c:func:`!PyString_FromFormat`, :c:func:`!" "PyString_FromFormatV`, and :c:func:`PyErr_Format` functions now accept " @@ -2586,7 +2593,7 @@ msgid "" "types. (Contributed by Mark Dickinson; :issue:`7228`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2211 +#: ../../whatsnew/2.7.rst:2214 msgid "" "The complicated interaction between threads and process forking has been " "changed. Previously, the child process created by :func:`os.fork` might " @@ -2598,7 +2605,7 @@ msgid "" "replicated, and the child process would no longer be able to perform imports." msgstr "" -#: ../../whatsnew/2.7.rst:2221 +#: ../../whatsnew/2.7.rst:2224 msgid "" "Python 2.7 acquires the import lock before performing an :func:`os.fork`, " "and will also clean up any locks created using the :mod:`threading` module. " @@ -2606,38 +2613,39 @@ msgid "" "themselves, will not benefit from this clean-up." msgstr "" -#: ../../whatsnew/2.7.rst:2227 +#: ../../whatsnew/2.7.rst:2230 msgid "(Fixed by Thomas Wouters; :issue:`1590864`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2229 +#: ../../whatsnew/2.7.rst:2232 msgid "" -"The :c:func:`Py_Finalize` function now calls the internal :func:`threading." +"The :c:func:`Py_Finalize` function now calls the internal :func:`!threading." "_shutdown` function; this prevents some exceptions from being raised when an " "interpreter shuts down. (Patch by Adam Olsen; :issue:`1722344`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2234 +#: ../../whatsnew/2.7.rst:2237 msgid "" "When using the :c:type:`PyMemberDef` structure to define attributes of a " "type, Python will no longer let you try to delete or set a :c:macro:" "`T_STRING_INPLACE` attribute." msgstr "" -#: ../../whatsnew/2.7.rst:2240 +#: ../../whatsnew/2.7.rst:2243 msgid "" "Global symbols defined by the :mod:`ctypes` module are now prefixed with " "``Py``, or with ``_ctypes``. (Implemented by Thomas Heller; :issue:`3102`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2244 +#: ../../whatsnew/2.7.rst:2247 msgid "" "New configure option: the :option:`!--with-system-expat` switch allows " -"building the :mod:`pyexpat` module to use the system Expat library. " -"(Contributed by Arfrever Frehtes Taifersar Arahesis; :issue:`7609`.)" +"building the :mod:`pyexpat ` module to use the system " +"Expat library. (Contributed by Arfrever Frehtes Taifersar Arahesis; :issue:" +"`7609`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2248 +#: ../../whatsnew/2.7.rst:2251 msgid "" "New configure option: the :option:`!--with-valgrind` option will now disable " "the pymalloc allocator, which is difficult for the Valgrind memory-error " @@ -2646,14 +2654,14 @@ msgid "" "issue:`2422`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2255 +#: ../../whatsnew/2.7.rst:2258 msgid "" "New configure option: you can now supply an empty string to :option:`!--with-" "dbmliborder=` in order to disable all of the various DBM modules. (Added by " "Arfrever Frehtes Taifersar Arahesis; :issue:`6491`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2260 +#: ../../whatsnew/2.7.rst:2263 msgid "" "The :program:`configure` script now checks for floating-point rounding bugs " "on certain 32-bit Intel chips and defines a :c:macro:`X87_DOUBLE_ROUNDING` " @@ -2662,30 +2670,30 @@ msgid "" "`2937`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2266 +#: ../../whatsnew/2.7.rst:2269 msgid "" ":program:`configure` also now sets a :envvar:`LDCXXSHARED` Makefile variable " "for supporting C++ linking. (Contributed by Arfrever Frehtes Taifersar " "Arahesis; :issue:`1222585`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2270 +#: ../../whatsnew/2.7.rst:2273 msgid "" "The build process now creates the necessary files for pkg-config support. " "(Contributed by Clinton Roy; :issue:`3585`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2273 +#: ../../whatsnew/2.7.rst:2276 msgid "" "The build process now supports Subversion 1.7. (Contributed by Arfrever " "Frehtes Taifersar Arahesis; :issue:`6094`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2280 +#: ../../whatsnew/2.7.rst:2283 msgid "Capsules" msgstr "" -#: ../../whatsnew/2.7.rst:2282 +#: ../../whatsnew/2.7.rst:2285 msgid "" "Python 3.1 adds a new C datatype, :c:type:`PyCapsule`, for providing a C API " "to an extension module. A capsule is essentially the holder of a C ``void " @@ -2697,7 +2705,7 @@ msgid "" "module's various API functions." msgstr "" -#: ../../whatsnew/2.7.rst:2291 +#: ../../whatsnew/2.7.rst:2294 msgid "" "There is an existing data type already used for this, :c:type:`!PyCObject`, " "but it doesn't provide type safety. Evil code written in pure Python could " @@ -2707,7 +2715,7 @@ msgid "" "name:" msgstr "" -#: ../../whatsnew/2.7.rst:2309 +#: ../../whatsnew/2.7.rst:2312 msgid "" "You are assured that ``vtable`` points to whatever you're expecting. If a " "different capsule was passed in, :c:func:`PyCapsule_IsValid` would detect " @@ -2715,7 +2723,7 @@ msgid "" "more information on using these objects." msgstr "" -#: ../../whatsnew/2.7.rst:2314 +#: ../../whatsnew/2.7.rst:2317 msgid "" "Python 2.7 now uses capsules internally to provide various extension-module " "APIs, but the :c:func:`!PyCObject_AsVoidPtr` was modified to handle " @@ -2724,25 +2732,26 @@ msgid "" "exc:`PendingDeprecationWarning`, which is silent by default." msgstr "" -#: ../../whatsnew/2.7.rst:2321 +#: ../../whatsnew/2.7.rst:2324 msgid "" "Implemented in Python 3.1 and backported to 2.7 by Larry Hastings; discussed " "in :issue:`5630`." msgstr "" -#: ../../whatsnew/2.7.rst:2328 +#: ../../whatsnew/2.7.rst:2331 msgid "Port-Specific Changes: Windows" msgstr "" -#: ../../whatsnew/2.7.rst:2330 +#: ../../whatsnew/2.7.rst:2333 msgid "" "The :mod:`msvcrt` module now contains some constants from the :file:" -"`crtassem.h` header file: :data:`CRT_ASSEMBLY_VERSION`, :data:" -"`VC_ASSEMBLY_PUBLICKEYTOKEN`, and :data:`LIBRARIES_ASSEMBLY_NAME_PREFIX`. " -"(Contributed by David Cournapeau; :issue:`4365`.)" +"`crtassem.h` header file: :data:`~msvcrt.CRT_ASSEMBLY_VERSION`, :data:" +"`~msvcrt.VC_ASSEMBLY_PUBLICKEYTOKEN`, and :data:`~msvcrt." +"LIBRARIES_ASSEMBLY_NAME_PREFIX`. (Contributed by David Cournapeau; :issue:" +"`4365`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2337 +#: ../../whatsnew/2.7.rst:2340 msgid "" "The :mod:`_winreg ` module for accessing the registry now implements " "the :func:`~winreg.CreateKeyEx` and :func:`~winreg.DeleteKeyEx` functions, " @@ -2752,40 +2761,40 @@ msgid "" "tested and documented. (Implemented by Brian Curtin: :issue:`7347`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2345 +#: ../../whatsnew/2.7.rst:2348 msgid "" -"The new :c:func:`_beginthreadex` API is used to start threads, and the " +"The new :c:func:`!_beginthreadex` API is used to start threads, and the " "native thread-local storage functions are now used. (Contributed by Kristján " "Valur Jónsson; :issue:`3582`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2349 +#: ../../whatsnew/2.7.rst:2352 msgid "" "The :func:`os.kill` function now works on Windows. The signal value can be " -"the constants :const:`CTRL_C_EVENT`, :const:`CTRL_BREAK_EVENT`, or any " -"integer. The first two constants will send :kbd:`Control-C` and :kbd:" -"`Control-Break` keystroke events to subprocesses; any other value will use " -"the :c:func:`TerminateProcess` API. (Contributed by Miki Tebeka; :issue:" -"`1220212`.)" +"the constants :const:`~signal.CTRL_C_EVENT`, :const:`~signal." +"CTRL_BREAK_EVENT`, or any integer. The first two constants will send :kbd:" +"`Control-C` and :kbd:`Control-Break` keystroke events to subprocesses; any " +"other value will use the :c:func:`!TerminateProcess` API. (Contributed by " +"Miki Tebeka; :issue:`1220212`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2356 +#: ../../whatsnew/2.7.rst:2359 msgid "" "The :func:`os.listdir` function now correctly fails for an empty path. " "(Fixed by Hirokazu Yamamoto; :issue:`5913`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2359 +#: ../../whatsnew/2.7.rst:2362 msgid "" -"The :mod:`mimelib` module will now read the MIME database from the Windows " +"The :mod:`mimetypes` module will now read the MIME database from the Windows " "registry when initializing. (Patch by Gabriel Genellina; :issue:`4969`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2366 +#: ../../whatsnew/2.7.rst:2369 msgid "Port-Specific Changes: Mac OS X" msgstr "" -#: ../../whatsnew/2.7.rst:2368 +#: ../../whatsnew/2.7.rst:2371 msgid "" "The path ``/Library/Python/2.7/site-packages`` is now appended to ``sys." "path``, in order to share added packages between the system installation and " @@ -2793,7 +2802,7 @@ msgid "" "issue:`4865`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2375 +#: ../../whatsnew/2.7.rst:2378 msgid "" "As of 2.7.13, this change was removed. ``/Library/Python/2.7/site-" "packages``, the site-packages directory used by the Apple-supplied system " @@ -2805,23 +2814,23 @@ msgid "" "Pythons. (:issue:`28440`)" msgstr "" -#: ../../whatsnew/2.7.rst:2386 +#: ../../whatsnew/2.7.rst:2389 msgid "Port-Specific Changes: FreeBSD" msgstr "" -#: ../../whatsnew/2.7.rst:2388 +#: ../../whatsnew/2.7.rst:2391 msgid "" -"FreeBSD 7.1's :const:`SO_SETFIB` constant, used with the :func:`~socket." +"FreeBSD 7.1's :const:`!SO_SETFIB` constant, used with the :func:`~socket." "socket` methods :func:`~socket.socket.getsockopt`/:func:`~socket.socket." "setsockopt` to select an alternate routing table, is now available in the :" "mod:`socket` module. (Added by Kyle VanderBeek; :issue:`8235`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2394 +#: ../../whatsnew/2.7.rst:2397 msgid "Other Changes and Fixes" msgstr "" -#: ../../whatsnew/2.7.rst:2396 +#: ../../whatsnew/2.7.rst:2399 msgid "" "Two benchmark scripts, :file:`iobench` and :file:`ccbench`, were added to " "the :file:`Tools` directory. :file:`iobench` measures the speed of the " @@ -2831,13 +2840,13 @@ msgid "" "bandwidth when performing several tasks using a varying number of threads." msgstr "" -#: ../../whatsnew/2.7.rst:2404 +#: ../../whatsnew/2.7.rst:2407 msgid "" "The :file:`Tools/i18n/msgfmt.py` script now understands plural forms in :" "file:`.po` files. (Fixed by Martin von Löwis; :issue:`5464`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2408 +#: ../../whatsnew/2.7.rst:2411 msgid "" "When importing a module from a :file:`.pyc` or :file:`.pyo` file with an " "existing :file:`.py` counterpart, the :attr:`~codeobject.co_filename` " @@ -2847,7 +2856,7 @@ msgid "" "Paul Calderone; :issue:`1180193`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2415 +#: ../../whatsnew/2.7.rst:2418 msgid "" "The :file:`regrtest.py` script now takes a :option:`!--randseed=` switch " "that takes an integer that will be used as the random seed for the :option:" @@ -2855,7 +2864,7 @@ msgid "" "also reports the seed that was used (Added by Collin Winter.)" msgstr "" -#: ../../whatsnew/2.7.rst:2421 +#: ../../whatsnew/2.7.rst:2424 msgid "" "Another :file:`regrtest.py` switch is :option:`!-j`, which takes an integer " "specifying how many tests run in parallel. This allows reducing the total " @@ -2866,31 +2875,31 @@ msgid "" "they fail. (Added by Antoine Pitrou; :issue:`7312`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2430 +#: ../../whatsnew/2.7.rst:2433 msgid "" "When executed as a script, the :file:`py_compile.py` module now accepts " "``'-'`` as an argument, which will read standard input for the list of " "filenames to be compiled. (Contributed by Piotr Ożarowski; :issue:`8233`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2438 +#: ../../whatsnew/2.7.rst:2441 msgid "Porting to Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2440 +#: ../../whatsnew/2.7.rst:2443 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code:" msgstr "" -#: ../../whatsnew/2.7.rst:2443 +#: ../../whatsnew/2.7.rst:2446 msgid "" "The :func:`range` function processes its arguments more consistently; it " -"will now call :meth:`__int__` on non-float, non-integer arguments that are " -"supplied to it. (Fixed by Alexander Belopolsky; :issue:`1533`.)" +"will now call :meth:`~object.__int__` on non-float, non-integer arguments " +"that are supplied to it. (Fixed by Alexander Belopolsky; :issue:`1533`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2448 +#: ../../whatsnew/2.7.rst:2451 msgid "" "The string :meth:`format` method changed the default precision used for " "floating-point and complex numbers from 6 decimal places to 12, which " @@ -2898,7 +2907,7 @@ msgid "" "`5920`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2453 +#: ../../whatsnew/2.7.rst:2456 msgid "" "Because of an optimization for the :keyword:`with` statement, the special " "methods :meth:`~object.__enter__` and :meth:`~object.__exit__` must belong " @@ -2907,7 +2916,7 @@ msgid "" "C extension types. (:issue:`6101`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2459 +#: ../../whatsnew/2.7.rst:2462 msgid "" "Due to a bug in Python 2.6, the *exc_value* parameter to :meth:`~object." "__exit__` methods was often the string representation of the exception, not " @@ -2915,11 +2924,11 @@ msgid "" "expected. (Fixed by Florent Xicluna; :issue:`7853`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2469 +#: ../../whatsnew/2.7.rst:2472 msgid "In the standard library:" msgstr "" -#: ../../whatsnew/2.7.rst:2471 +#: ../../whatsnew/2.7.rst:2474 msgid "" "Operations with :class:`~datetime.datetime` instances that resulted in a " "year falling outside the supported range didn't always raise :exc:" @@ -2928,7 +2937,7 @@ msgid "" "Alexander Belopolsky; :issue:`7150`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2477 +#: ../../whatsnew/2.7.rst:2480 msgid "" "When using :class:`~decimal.Decimal` instances with a string's :meth:" "`format` method, the default alignment was previously left-alignment. This " @@ -2936,44 +2945,44 @@ msgid "" "programs. (Changed by Mark Dickinson; :issue:`6857`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2483 +#: ../../whatsnew/2.7.rst:2492 msgid "" -"Comparisons involving a signaling NaN value (or ``sNAN``) now signal :const:" -"`~decimal.InvalidOperation` instead of silently returning a true or false " -"value depending on the comparison operator. Quiet NaN values (or ``NaN``) " -"are now hashable. (Fixed by Mark Dickinson; :issue:`7279`.)" +"The :mod:`xml.etree.ElementTree` library no longer escapes ampersands and " +"angle brackets when outputting an XML processing instruction (which looks " +"like ````) or comment (which looks like " +"````). (Patch by Neil Muller; :issue:`2746`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2495 +#: ../../whatsnew/2.7.rst:2498 msgid "" -"The :meth:`~StringIO.StringIO.readline` method of :class:`~StringIO." -"StringIO` objects now does nothing when a negative length is requested, as " -"other file-like objects do. (:issue:`7348`)." +"The :meth:`!readline` method of :class:`~io.StringIO` objects now does " +"nothing when a negative length is requested, as other file-like objects do. " +"(:issue:`7348`)." msgstr "" -#: ../../whatsnew/2.7.rst:2538 +#: ../../whatsnew/2.7.rst:2541 msgid "For C extensions:" msgstr "" -#: ../../whatsnew/2.7.rst:2540 +#: ../../whatsnew/2.7.rst:2543 msgid "" "C extensions that use integer format codes with the ``PyArg_Parse*`` family " "of functions will now raise a :exc:`TypeError` exception instead of " "triggering a :exc:`DeprecationWarning` (:issue:`5080`)." msgstr "" -#: ../../whatsnew/2.7.rst:2544 +#: ../../whatsnew/2.7.rst:2547 msgid "" "Use the new :c:func:`PyOS_string_to_double` function instead of the old :c:" "func:`!PyOS_ascii_strtod` and :c:func:`!PyOS_ascii_atof` functions, which " "are now deprecated." msgstr "" -#: ../../whatsnew/2.7.rst:2548 +#: ../../whatsnew/2.7.rst:2551 msgid "For applications that embed Python:" msgstr "" -#: ../../whatsnew/2.7.rst:2550 +#: ../../whatsnew/2.7.rst:2553 msgid "" "The :c:func:`PySys_SetArgvEx` function was added, letting applications close " "a security hole when the existing :c:func:`PySys_SetArgv` function was " @@ -2982,11 +2991,11 @@ msgid "" "with *updatepath* set to false." msgstr "" -#: ../../whatsnew/2.7.rst:2563 +#: ../../whatsnew/2.7.rst:2566 msgid "New Features Added to Python 2.7 Maintenance Releases" msgstr "" -#: ../../whatsnew/2.7.rst:2565 +#: ../../whatsnew/2.7.rst:2568 msgid "" "New features may be added to Python 2.7 maintenance releases when the " "situation genuinely calls for it. Any such additions must go through the " @@ -2995,38 +3004,38 @@ msgid "" "Python 3, or else by publishing it on the Python Package Index." msgstr "" -#: ../../whatsnew/2.7.rst:2571 +#: ../../whatsnew/2.7.rst:2574 msgid "" "In addition to the specific proposals listed below, there is a general " "exemption allowing new ``-3`` warnings to be added in any Python 2.7 " "maintenance release." msgstr "" -#: ../../whatsnew/2.7.rst:2577 +#: ../../whatsnew/2.7.rst:2580 msgid "Two new environment variables for debug mode" msgstr "" -#: ../../whatsnew/2.7.rst:2579 +#: ../../whatsnew/2.7.rst:2582 msgid "" "In debug mode, the ``[xxx refs]`` statistic is not written by default, the :" -"envvar:`PYTHONSHOWREFCOUNT` environment variable now must also be set. " +"envvar:`!PYTHONSHOWREFCOUNT` environment variable now must also be set. " "(Contributed by Victor Stinner; :issue:`31733`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2583 +#: ../../whatsnew/2.7.rst:2586 msgid "" "When Python is compiled with ``COUNT_ALLOC`` defined, allocation counts are " -"no longer dumped by default anymore: the :envvar:`PYTHONSHOWALLOCCOUNT` " +"no longer dumped by default anymore: the :envvar:`!PYTHONSHOWALLOCCOUNT` " "environment variable must now also be set. Moreover, allocation counts are " "now dumped into stderr, rather than stdout. (Contributed by Victor Stinner; :" "issue:`31692`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2592 +#: ../../whatsnew/2.7.rst:2595 msgid "PEP 434: IDLE Enhancement Exception for All Branches" msgstr "" -#: ../../whatsnew/2.7.rst:2594 +#: ../../whatsnew/2.7.rst:2597 msgid "" ":pep:`434` describes a general exemption for changes made to the IDLE " "development environment shipped along with Python. This exemption makes it " @@ -3034,62 +3043,62 @@ msgid "" "experience across all supported versions of Python 2 and 3." msgstr "" -#: ../../whatsnew/2.7.rst:2599 +#: ../../whatsnew/2.7.rst:2602 msgid "" "For details of any IDLE changes, refer to the NEWS file for the specific " "release." msgstr "" -#: ../../whatsnew/2.7.rst:2604 +#: ../../whatsnew/2.7.rst:2607 msgid "PEP 466: Network Security Enhancements for Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2606 +#: ../../whatsnew/2.7.rst:2609 msgid "" ":pep:`466` describes a number of network security enhancement proposals that " "have been approved for inclusion in Python 2.7 maintenance releases, with " "the first of those changes appearing in the Python 2.7.7 release." msgstr "" -#: ../../whatsnew/2.7.rst:2610 +#: ../../whatsnew/2.7.rst:2613 msgid ":pep:`466` related features added in Python 2.7.7:" msgstr "" -#: ../../whatsnew/2.7.rst:2612 +#: ../../whatsnew/2.7.rst:2615 msgid "" ":func:`hmac.compare_digest` was backported from Python 3 to make a timing " "attack resistant comparison operation available to Python 2 applications. " "(Contributed by Alex Gaynor; :issue:`21306`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2616 +#: ../../whatsnew/2.7.rst:2619 msgid "" "OpenSSL 1.0.1g was upgraded in the official Windows installers published on " "python.org. (Contributed by Zachary Ware; :issue:`21462`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2619 +#: ../../whatsnew/2.7.rst:2622 msgid ":pep:`466` related features added in Python 2.7.8:" msgstr "" -#: ../../whatsnew/2.7.rst:2621 +#: ../../whatsnew/2.7.rst:2624 msgid "" ":func:`hashlib.pbkdf2_hmac` was backported from Python 3 to make a hashing " "algorithm suitable for secure password storage broadly available to Python 2 " "applications. (Contributed by Alex Gaynor; :issue:`21304`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2625 +#: ../../whatsnew/2.7.rst:2628 msgid "" "OpenSSL 1.0.1h was upgraded for the official Windows installers published on " "python.org. (contributed by Zachary Ware in :issue:`21671` for CVE-2014-0224)" msgstr "" -#: ../../whatsnew/2.7.rst:2628 +#: ../../whatsnew/2.7.rst:2631 msgid ":pep:`466` related features added in Python 2.7.9:" msgstr "" -#: ../../whatsnew/2.7.rst:2630 +#: ../../whatsnew/2.7.rst:2633 msgid "" "Most of Python 3.4's :mod:`ssl` module was backported. This means :mod:`ssl` " "now supports Server Name Indication, TLS1.x settings, access to the platform " @@ -3097,20 +3106,20 @@ msgid "" "(Contributed by Alex Gaynor and David Reid; :issue:`21308`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2635 +#: ../../whatsnew/2.7.rst:2638 msgid "" "Refer to the \"Version added: 2.7.9\" notes in the module documentation for " "specific details." msgstr "" -#: ../../whatsnew/2.7.rst:2638 +#: ../../whatsnew/2.7.rst:2641 msgid "" ":func:`os.urandom` was changed to cache a file descriptor to ``/dev/" "urandom`` instead of reopening ``/dev/urandom`` on every call. (Contributed " "by Alex Gaynor; :issue:`21305`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2642 +#: ../../whatsnew/2.7.rst:2645 msgid "" ":data:`hashlib.algorithms_guaranteed` and :data:`hashlib." "algorithms_available` were backported from Python 3 to make it easier for " @@ -3118,22 +3127,22 @@ msgid "" "(Contributed by Alex Gaynor in :issue:`21307`)" msgstr "" -#: ../../whatsnew/2.7.rst:2649 +#: ../../whatsnew/2.7.rst:2652 msgid "PEP 477: Backport ensurepip (PEP 453) to Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2651 +#: ../../whatsnew/2.7.rst:2654 msgid "" ":pep:`477` approves the inclusion of the :pep:`453` ensurepip module and the " "improved documentation that was enabled by it in the Python 2.7 maintenance " "releases, appearing first in the Python 2.7.9 release." msgstr "" -#: ../../whatsnew/2.7.rst:2657 +#: ../../whatsnew/2.7.rst:2660 msgid "Bootstrapping pip By Default" msgstr "" -#: ../../whatsnew/2.7.rst:2659 +#: ../../whatsnew/2.7.rst:2662 msgid "" "The new :mod:`ensurepip` module (defined in :pep:`453`) provides a standard " "cross-platform mechanism to bootstrap the pip installer into Python " @@ -3143,14 +3152,14 @@ msgid "" "the release candidate." msgstr "" -#: ../../whatsnew/2.7.rst:2666 +#: ../../whatsnew/2.7.rst:2669 msgid "" "By default, the commands ``pip``, ``pipX`` and ``pipX.Y`` will be installed " "on all platforms (where X.Y stands for the version of the Python " "installation), along with the ``pip`` Python package and its dependencies." msgstr "" -#: ../../whatsnew/2.7.rst:2670 +#: ../../whatsnew/2.7.rst:2673 msgid "" "For CPython :ref:`source builds on POSIX systems `, " "the ``make install`` and ``make altinstall`` commands do not bootstrap " @@ -3158,7 +3167,7 @@ msgid "" "options, and overridden through Makefile options." msgstr "" -#: ../../whatsnew/2.7.rst:2675 +#: ../../whatsnew/2.7.rst:2678 msgid "" "On Windows and Mac OS X, the CPython installers now default to installing " "``pip`` along with CPython itself (users may opt out of installing it during " @@ -3168,7 +3177,7 @@ msgid "" "Windows as ``py -m pip``." msgstr "" -#: ../../whatsnew/2.7.rst:2682 +#: ../../whatsnew/2.7.rst:2685 msgid "" "As `discussed in the PEP`__, platform packagers may choose not to install " "these commands by default, as long as, when invoked, they provide clear and " @@ -3176,11 +3185,11 @@ msgid "" "system package manager)." msgstr "" -#: ../../whatsnew/2.7.rst:2691 +#: ../../whatsnew/2.7.rst:2694 msgid "Documentation Changes" msgstr "" -#: ../../whatsnew/2.7.rst:2693 +#: ../../whatsnew/2.7.rst:2696 msgid "" "As part of this change, the :ref:`installing-index` and :ref:`distributing-" "index` sections of the documentation have been completely redesigned as " @@ -3190,49 +3199,49 @@ msgid "" "of the individual projects." msgstr "" -#: ../../whatsnew/2.7.rst:2701 +#: ../../whatsnew/2.7.rst:2704 msgid "" "However, as this migration is currently still incomplete, the legacy " "versions of those guides remaining available as :ref:`install-index` and :" "ref:`setuptools-index`." msgstr "" -#: ../../whatsnew/2.7.rst:2708 +#: ../../whatsnew/2.7.rst:2711 msgid ":pep:`453` -- Explicit bootstrapping of pip in Python installations" msgstr "" -#: ../../whatsnew/2.7.rst:2708 +#: ../../whatsnew/2.7.rst:2711 msgid "" "PEP written by Donald Stufft and Nick Coghlan, implemented by Donald Stufft, " "Nick Coghlan, Martin von Löwis and Ned Deily." msgstr "" -#: ../../whatsnew/2.7.rst:2712 +#: ../../whatsnew/2.7.rst:2715 msgid "" "PEP 476: Enabling certificate verification by default for stdlib http clients" msgstr "" -#: ../../whatsnew/2.7.rst:2714 +#: ../../whatsnew/2.7.rst:2717 msgid "" ":pep:`476` updated :mod:`httplib ` and modules which use it, such as :" -"mod:`urllib2 ` and :mod:`xmlrpclib`, to now verify that the " -"server presents a certificate which is signed by a Certificate Authority in " -"the platform trust store and whose hostname matches the hostname being " -"requested by default, significantly improving security for many " -"applications. This change was made in the Python 2.7.9 release." +"mod:`urllib2 ` and :mod:`xmlrpclib `, to now " +"verify that the server presents a certificate which is signed by a " +"Certificate Authority in the platform trust store and whose hostname matches " +"the hostname being requested by default, significantly improving security " +"for many applications. This change was made in the Python 2.7.9 release." msgstr "" -#: ../../whatsnew/2.7.rst:2721 +#: ../../whatsnew/2.7.rst:2725 msgid "" "For applications which require the old previous behavior, they can pass an " "alternate context::" msgstr "" -#: ../../whatsnew/2.7.rst:2738 +#: ../../whatsnew/2.7.rst:2742 msgid "PEP 493: HTTPS verification migration tools for Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2740 +#: ../../whatsnew/2.7.rst:2744 msgid "" ":pep:`493` provides additional migration tools to support a more incremental " "infrastructure upgrade process for environments containing applications and " @@ -3241,14 +3250,14 @@ msgid "" "were made in the Python 2.7.12 release." msgstr "" -#: ../../whatsnew/2.7.rst:2746 +#: ../../whatsnew/2.7.rst:2750 msgid "" "These tools are intended for use in cases where affected applications and " "services can't be modified to explicitly pass a more permissive SSL context " "when establishing the connection." msgstr "" -#: ../../whatsnew/2.7.rst:2750 +#: ../../whatsnew/2.7.rst:2754 msgid "" "For applications and services which can't be modified at all, the new " "``PYTHONHTTPSVERIFY`` environment variable may be set to ``0`` to revert an " @@ -3256,18 +3265,18 @@ msgid "" "2.7.8 and earlier." msgstr "" -#: ../../whatsnew/2.7.rst:2755 +#: ../../whatsnew/2.7.rst:2759 msgid "" "For cases where the connection establishment code can't be modified, but the " -"overall application can be, the new :func:`ssl._https_verify_certificates` " +"overall application can be, the new :func:`!ssl._https_verify_certificates` " "function can be used to adjust the default behaviour at runtime." msgstr "" -#: ../../whatsnew/2.7.rst:2761 +#: ../../whatsnew/2.7.rst:2765 msgid "New ``make regen-all`` build target" msgstr "" -#: ../../whatsnew/2.7.rst:2763 +#: ../../whatsnew/2.7.rst:2767 msgid "" "To simplify cross-compilation, and to ensure that CPython can reliably be " "compiled without requiring an existing version of Python to already be " @@ -3275,43 +3284,43 @@ msgid "" "recompile generated files based on file modification times." msgstr "" -#: ../../whatsnew/2.7.rst:2768 +#: ../../whatsnew/2.7.rst:2772 msgid "" "Instead, a new ``make regen-all`` command has been added to force " "regeneration of these files when desired (e.g. after an initial version of " "Python has already been built based on the pregenerated versions)." msgstr "" -#: ../../whatsnew/2.7.rst:2772 +#: ../../whatsnew/2.7.rst:2776 msgid "" "More selective regeneration targets are also defined - see :source:`Makefile." "pre.in` for details." msgstr "" -#: ../../whatsnew/2.7.rst:2775 ../../whatsnew/2.7.rst:2788 +#: ../../whatsnew/2.7.rst:2779 ../../whatsnew/2.7.rst:2792 msgid "(Contributed by Victor Stinner in :issue:`23404`.)" msgstr "(由 Victor Stinner 於 :issue:`23404` 中貢獻。)" -#: ../../whatsnew/2.7.rst:2781 +#: ../../whatsnew/2.7.rst:2785 msgid "Removal of ``make touch`` build target" msgstr "" -#: ../../whatsnew/2.7.rst:2783 +#: ../../whatsnew/2.7.rst:2787 msgid "" "The ``make touch`` build target previously used to request implicit " "regeneration of generated files by updating their modification times has " "been removed." msgstr "" -#: ../../whatsnew/2.7.rst:2786 +#: ../../whatsnew/2.7.rst:2790 msgid "It has been replaced by the new ``make regen-all`` target." msgstr "" -#: ../../whatsnew/2.7.rst:2797 +#: ../../whatsnew/2.7.rst:2801 msgid "Acknowledgements" msgstr "致謝" -#: ../../whatsnew/2.7.rst:2799 +#: ../../whatsnew/2.7.rst:2803 msgid "" "The author would like to thank the following people for offering " "suggestions, corrections and assistance with various drafts of this article: " diff --git a/whatsnew/3.1.po b/whatsnew/3.1.po index 12436bb343..6a2d52cda4 100644 --- a/whatsnew/3.1.po +++ b/whatsnew/3.1.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2024-02-13 00:03+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-" @@ -185,7 +185,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:172 msgid "" -"With the new syntax, the :func:`contextlib.nested` function is no longer " +"With the new syntax, the :func:`!contextlib.nested` function is no longer " "needed and is now deprecated." msgstr "" diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index ae3ebb26ac..45c638c559 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-03 20:44+0000\n" +"POT-Creation-Date: 2024-02-13 00:03+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-" @@ -818,11 +818,12 @@ msgid "Two methods have been deprecated:" msgstr "" #: ../../whatsnew/3.2.rst:746 -msgid ":meth:`xml.etree.ElementTree.getchildren` use ``list(elem)`` instead." +msgid ":meth:`!xml.etree.ElementTree.getchildren` use ``list(elem)`` instead." msgstr "" #: ../../whatsnew/3.2.rst:747 -msgid ":meth:`xml.etree.ElementTree.getiterator` use ``Element.iter`` instead." +msgid "" +":meth:`!xml.etree.ElementTree.getiterator` use ``Element.iter`` instead." msgstr "" #: ../../whatsnew/3.2.rst:749 @@ -3172,7 +3173,7 @@ msgstr "(由 Georg Brandl 貢獻;:issue:`5675`。)" #: ../../whatsnew/3.2.rst:2685 msgid "" -"The previously deprecated :func:`contextlib.nested` function has been " +"The previously deprecated :func:`!contextlib.nested` function has been " "removed in favor of a plain :keyword:`with` statement which can accept " "multiple context managers. The latter technique is faster (because it is " "built-in), and it does a better job finalizing multiple context managers " From 33bbd3119c372d0f76fc439aff8ba674f32d3082 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 14 Feb 2024 00:05:01 +0000 Subject: [PATCH 07/33] sync with cpython 45e55991 --- c-api/gcsupport.po | 76 ++-- reference/datamodel.po | 978 ++++++++++++++++++++--------------------- using/mac.po | 191 ++++---- 3 files changed, 639 insertions(+), 606 deletions(-) diff --git a/c-api/gcsupport.po b/c-api/gcsupport.po index 6e8d0434fb..7dc8ed2ce2 100644 --- a/c-api/gcsupport.po +++ b/c-api/gcsupport.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2024-02-14 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:31+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -139,12 +139,18 @@ msgstr "" #: ../../c-api/gcsupport.rst:88 msgid "" -"Resize an object allocated by :c:macro:`PyObject_NewVar`. Returns the " -"resized object or ``NULL`` on failure. *op* must not be tracked by the " -"collector yet." +"Resize an object allocated by :c:macro:`PyObject_NewVar`. Returns the " +"resized object of type ``TYPE*`` (refers to any C type) or ``NULL`` on " +"failure." msgstr "" -#: ../../c-api/gcsupport.rst:94 +#: ../../c-api/gcsupport.rst:92 +msgid "" +"*op* must be of type :c:expr:`PyVarObject *` and must not be tracked by the " +"collector yet. *newsize* must be of type :c:type:`Py_ssize_t`." +msgstr "" + +#: ../../c-api/gcsupport.rst:99 msgid "" "Adds the object *op* to the set of container objects tracked by the " "collector. The collector can run at unexpected times so objects must be " @@ -153,45 +159,45 @@ msgid "" "usually near the end of the constructor." msgstr "" -#: ../../c-api/gcsupport.rst:103 +#: ../../c-api/gcsupport.rst:108 msgid "" "Returns non-zero if the object implements the garbage collector protocol, " "otherwise returns 0." msgstr "" -#: ../../c-api/gcsupport.rst:106 +#: ../../c-api/gcsupport.rst:111 msgid "" "The object cannot be tracked by the garbage collector if this function " "returns 0." msgstr "" -#: ../../c-api/gcsupport.rst:111 +#: ../../c-api/gcsupport.rst:116 msgid "" "Returns 1 if the object type of *op* implements the GC protocol and *op* is " "being currently tracked by the garbage collector and 0 otherwise." msgstr "" -#: ../../c-api/gcsupport.rst:114 +#: ../../c-api/gcsupport.rst:119 msgid "This is analogous to the Python function :func:`gc.is_tracked`." msgstr "" -#: ../../c-api/gcsupport.rst:121 +#: ../../c-api/gcsupport.rst:126 msgid "" "Returns 1 if the object type of *op* implements the GC protocol and *op* has " "been already finalized by the garbage collector and 0 otherwise." msgstr "" -#: ../../c-api/gcsupport.rst:124 +#: ../../c-api/gcsupport.rst:129 msgid "This is analogous to the Python function :func:`gc.is_finalized`." msgstr "" -#: ../../c-api/gcsupport.rst:131 +#: ../../c-api/gcsupport.rst:136 msgid "" "Releases memory allocated to an object using :c:macro:`PyObject_GC_New` or :" "c:macro:`PyObject_GC_NewVar`." msgstr "" -#: ../../c-api/gcsupport.rst:137 +#: ../../c-api/gcsupport.rst:142 msgid "" "Remove the object *op* from the set of container objects tracked by the " "collector. Note that :c:func:`PyObject_GC_Track` can be called again on " @@ -201,19 +207,19 @@ msgid "" "handler become invalid." msgstr "" -#: ../../c-api/gcsupport.rst:146 +#: ../../c-api/gcsupport.rst:151 msgid "" "The :c:func:`!_PyObject_GC_TRACK` and :c:func:`!_PyObject_GC_UNTRACK` macros " "have been removed from the public C API." msgstr "" -#: ../../c-api/gcsupport.rst:149 +#: ../../c-api/gcsupport.rst:154 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` handler accepts a function " "parameter of this type:" msgstr "" -#: ../../c-api/gcsupport.rst:154 +#: ../../c-api/gcsupport.rst:159 msgid "" "Type of the visitor function passed to the :c:member:`~PyTypeObject." "tp_traverse` handler. The function should be called with an object to " @@ -223,13 +229,13 @@ msgid "" "users will need to write their own visitor functions." msgstr "" -#: ../../c-api/gcsupport.rst:161 +#: ../../c-api/gcsupport.rst:166 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` handler must have the following " "type:" msgstr "" -#: ../../c-api/gcsupport.rst:166 +#: ../../c-api/gcsupport.rst:171 msgid "" "Traversal function for a container object. Implementations must call the " "*visit* function for each object directly contained by *self*, with the " @@ -239,7 +245,7 @@ msgid "" "returned immediately." msgstr "" -#: ../../c-api/gcsupport.rst:173 +#: ../../c-api/gcsupport.rst:178 msgid "" "To simplify writing :c:member:`~PyTypeObject.tp_traverse` handlers, a :c:" "func:`Py_VISIT` macro is provided. In order to use this macro, the :c:" @@ -247,20 +253,20 @@ msgid "" "exactly *visit* and *arg*:" msgstr "" -#: ../../c-api/gcsupport.rst:180 +#: ../../c-api/gcsupport.rst:185 msgid "" "If *o* is not ``NULL``, call the *visit* callback, with arguments *o* and " "*arg*. If *visit* returns a non-zero value, then return it. Using this " "macro, :c:member:`~PyTypeObject.tp_traverse` handlers look like::" msgstr "" -#: ../../c-api/gcsupport.rst:193 +#: ../../c-api/gcsupport.rst:198 msgid "" "The :c:member:`~PyTypeObject.tp_clear` handler must be of the :c:type:" "`inquiry` type, or ``NULL`` if the object is immutable." msgstr "" -#: ../../c-api/gcsupport.rst:199 +#: ../../c-api/gcsupport.rst:204 msgid "" "Drop references that may have created reference cycles. Immutable objects " "do not have to define this method since they can never directly create " @@ -270,23 +276,23 @@ msgid "" "in a reference cycle." msgstr "" -#: ../../c-api/gcsupport.rst:208 +#: ../../c-api/gcsupport.rst:213 msgid "Controlling the Garbage Collector State" msgstr "" -#: ../../c-api/gcsupport.rst:210 +#: ../../c-api/gcsupport.rst:215 msgid "" "The C-API provides the following functions for controlling garbage " "collection runs." msgstr "" -#: ../../c-api/gcsupport.rst:215 +#: ../../c-api/gcsupport.rst:220 msgid "" "Perform a full garbage collection, if the garbage collector is enabled. " "(Note that :func:`gc.collect` runs it unconditionally.)" msgstr "" -#: ../../c-api/gcsupport.rst:218 +#: ../../c-api/gcsupport.rst:223 msgid "" "Returns the number of collected + unreachable objects which cannot be " "collected. If the garbage collector is disabled or already collecting, " @@ -294,54 +300,54 @@ msgid "" "data:`sys.unraisablehook`. This function does not raise exceptions." msgstr "" -#: ../../c-api/gcsupport.rst:228 +#: ../../c-api/gcsupport.rst:233 msgid "" "Enable the garbage collector: similar to :func:`gc.enable`. Returns the " "previous state, 0 for disabled and 1 for enabled." msgstr "" -#: ../../c-api/gcsupport.rst:236 +#: ../../c-api/gcsupport.rst:241 msgid "" "Disable the garbage collector: similar to :func:`gc.disable`. Returns the " "previous state, 0 for disabled and 1 for enabled." msgstr "" -#: ../../c-api/gcsupport.rst:244 +#: ../../c-api/gcsupport.rst:249 msgid "" "Query the state of the garbage collector: similar to :func:`gc.isenabled`. " "Returns the current state, 0 for disabled and 1 for enabled." msgstr "" -#: ../../c-api/gcsupport.rst:251 +#: ../../c-api/gcsupport.rst:256 msgid "Querying Garbage Collector State" msgstr "" -#: ../../c-api/gcsupport.rst:253 +#: ../../c-api/gcsupport.rst:258 msgid "" "The C-API provides the following interface for querying information about " "the garbage collector." msgstr "" -#: ../../c-api/gcsupport.rst:258 +#: ../../c-api/gcsupport.rst:263 msgid "" "Run supplied *callback* on all live GC-capable objects. *arg* is passed " "through to all invocations of *callback*." msgstr "" -#: ../../c-api/gcsupport.rst:262 +#: ../../c-api/gcsupport.rst:267 msgid "" "If new objects are (de)allocated by the callback it is undefined if they " "will be visited." msgstr "" -#: ../../c-api/gcsupport.rst:265 +#: ../../c-api/gcsupport.rst:270 msgid "" "Garbage collection is disabled during operation. Explicitly running a " "collection in the callback may lead to undefined behaviour e.g. visiting the " "same objects multiple times or not at all." msgstr "" -#: ../../c-api/gcsupport.rst:273 +#: ../../c-api/gcsupport.rst:278 msgid "" "Type of the visitor function to be passed to :c:func:" "`PyUnstable_GC_VisitObjects`. *arg* is the same as the *arg* passed to " diff --git a/reference/datamodel.po b/reference/datamodel.po index 21c5f944e7..2cba446389 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-11 00:03+0000\n" +"POT-Creation-Date: 2024-02-14 00:03+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-" @@ -598,7 +598,7 @@ msgid "" msgstr "" #: ../../reference/datamodel.rst:538 ../../reference/datamodel.rst:1127 -#: ../../reference/datamodel.rst:1314 +#: ../../reference/datamodel.rst:1316 msgid "Special read-only attributes" msgstr "特殊唯讀屬性" @@ -629,7 +629,7 @@ msgid "" "the value of the cell, as well as set the value." msgstr "" -#: ../../reference/datamodel.rst:564 ../../reference/datamodel.rst:1351 +#: ../../reference/datamodel.rst:564 ../../reference/datamodel.rst:1353 msgid "Special writable attributes" msgstr "特殊可寫屬性" @@ -731,7 +731,7 @@ msgid "" "callable object (normally a user-defined function)." msgstr "" -#: ../../reference/datamodel.rst:669 ../../reference/datamodel.rst:1442 +#: ../../reference/datamodel.rst:669 ../../reference/datamodel.rst:1444 msgid "Special read-only attributes:" msgstr "特殊唯讀屬性:" @@ -1235,95 +1235,95 @@ msgstr "函式名稱" msgid "The fully qualified function name" msgstr "" -#: ../../reference/datamodel.rst:1138 +#: ../../reference/datamodel.rst:1140 msgid "" "The total number of positional :term:`parameters ` (including " "positional-only parameters and parameters with default values) that the " "function has" msgstr "" -#: ../../reference/datamodel.rst:1143 +#: ../../reference/datamodel.rst:1145 msgid "" "The number of positional-only :term:`parameters ` (including " "arguments with default values) that the function has" msgstr "" -#: ../../reference/datamodel.rst:1147 +#: ../../reference/datamodel.rst:1149 msgid "" "The number of keyword-only :term:`parameters ` (including " "arguments with default values) that the function has" msgstr "" -#: ../../reference/datamodel.rst:1151 +#: ../../reference/datamodel.rst:1153 msgid "" "The number of :ref:`local variables ` used by the function " "(including parameters)" msgstr "" -#: ../../reference/datamodel.rst:1155 +#: ../../reference/datamodel.rst:1157 msgid "" "A :class:`tuple` containing the names of the local variables in the function " "(starting with the parameter names)" msgstr "" -#: ../../reference/datamodel.rst:1159 +#: ../../reference/datamodel.rst:1161 msgid "" "A :class:`tuple` containing the names of :ref:`local variables ` " "that are referenced by nested functions inside the function" msgstr "" -#: ../../reference/datamodel.rst:1163 +#: ../../reference/datamodel.rst:1165 msgid "A :class:`tuple` containing the names of free variables in the function" msgstr "" -#: ../../reference/datamodel.rst:1166 +#: ../../reference/datamodel.rst:1168 msgid "" "A string representing the sequence of :term:`bytecode` instructions in the " "function" msgstr "" -#: ../../reference/datamodel.rst:1170 +#: ../../reference/datamodel.rst:1172 msgid "" "A :class:`tuple` containing the literals used by the :term:`bytecode` in the " "function" msgstr "" -#: ../../reference/datamodel.rst:1174 +#: ../../reference/datamodel.rst:1176 msgid "" "A :class:`tuple` containing the names used by the :term:`bytecode` in the " "function" msgstr "" -#: ../../reference/datamodel.rst:1178 +#: ../../reference/datamodel.rst:1180 msgid "The name of the file from which the code was compiled" msgstr "" -#: ../../reference/datamodel.rst:1181 +#: ../../reference/datamodel.rst:1183 msgid "The line number of the first line of the function" msgstr "" -#: ../../reference/datamodel.rst:1184 +#: ../../reference/datamodel.rst:1186 msgid "" "A string encoding the mapping from :term:`bytecode` offsets to line numbers. " "For details, see the source code of the interpreter." msgstr "" -#: ../../reference/datamodel.rst:1187 +#: ../../reference/datamodel.rst:1189 msgid "" "This attribute of code objects is deprecated, and may be removed in Python " "3.14." msgstr "" -#: ../../reference/datamodel.rst:1192 +#: ../../reference/datamodel.rst:1194 msgid "The required stack size of the code object" msgstr "" -#: ../../reference/datamodel.rst:1195 +#: ../../reference/datamodel.rst:1197 msgid "" "An :class:`integer ` encoding a number of flags for the interpreter." msgstr "" -#: ../../reference/datamodel.rst:1200 +#: ../../reference/datamodel.rst:1202 msgid "" "The following flag bits are defined for :attr:`~codeobject.co_flags`: bit " "``0x04`` is set if the function uses the ``*arguments`` syntax to accept an " @@ -1334,7 +1334,7 @@ msgid "" "might be present." msgstr "" -#: ../../reference/datamodel.rst:1208 +#: ../../reference/datamodel.rst:1210 msgid "" "Future feature declarations (``from __future__ import division``) also use " "bits in :attr:`~codeobject.co_flags` to indicate whether a code object was " @@ -1343,29 +1343,29 @@ msgid "" "``0x1000`` were used in earlier versions of Python." msgstr "" -#: ../../reference/datamodel.rst:1214 +#: ../../reference/datamodel.rst:1216 msgid "" "Other bits in :attr:`~codeobject.co_flags` are reserved for internal use." msgstr "" -#: ../../reference/datamodel.rst:1218 +#: ../../reference/datamodel.rst:1220 msgid "" "If a code object represents a function, the first item in :attr:`~codeobject." "co_consts` is the documentation string of the function, or ``None`` if " "undefined." msgstr "" -#: ../../reference/datamodel.rst:1223 +#: ../../reference/datamodel.rst:1225 msgid "Methods on code objects" msgstr "用於程式碼物件的方法" -#: ../../reference/datamodel.rst:1227 +#: ../../reference/datamodel.rst:1229 msgid "" "Returns an iterable over the source code positions of each :term:`bytecode` " "instruction in the code object." msgstr "" -#: ../../reference/datamodel.rst:1230 +#: ../../reference/datamodel.rst:1232 msgid "" "The iterator returns :class:`tuple`\\s containing the ``(start_line, " "end_line, start_column, end_column)``. The *i-th* tuple corresponds to the " @@ -1373,37 +1373,37 @@ msgid "" "information is 0-indexed utf-8 byte offsets on the given source line." msgstr "" -#: ../../reference/datamodel.rst:1236 +#: ../../reference/datamodel.rst:1238 msgid "" "This positional information can be missing. A non-exhaustive lists of cases " "where this may happen:" msgstr "" -#: ../../reference/datamodel.rst:1239 +#: ../../reference/datamodel.rst:1241 msgid "Running the interpreter with :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1240 +#: ../../reference/datamodel.rst:1242 msgid "" "Loading a pyc file compiled while using :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1241 +#: ../../reference/datamodel.rst:1243 msgid "Position tuples corresponding to artificial instructions." msgstr "" -#: ../../reference/datamodel.rst:1242 +#: ../../reference/datamodel.rst:1244 msgid "" "Line and column numbers that can't be represented due to implementation " "specific limitations." msgstr "" -#: ../../reference/datamodel.rst:1245 +#: ../../reference/datamodel.rst:1247 msgid "" "When this occurs, some or all of the tuple elements can be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:1251 +#: ../../reference/datamodel.rst:1253 msgid "" "This feature requires storing column positions in code objects which may " "result in a small increase of disk usage of compiled Python files or " @@ -1413,90 +1413,90 @@ msgid "" "environment variable can be used." msgstr "" -#: ../../reference/datamodel.rst:1260 +#: ../../reference/datamodel.rst:1262 msgid "" "Returns an iterator that yields information about successive ranges of :term:" "`bytecode`\\s. Each item yielded is a ``(start, end, lineno)`` :class:" "`tuple`:" msgstr "" -#: ../../reference/datamodel.rst:1264 +#: ../../reference/datamodel.rst:1266 msgid "" "``start`` (an :class:`int`) represents the offset (inclusive) of the start " "of the :term:`bytecode` range" msgstr "" -#: ../../reference/datamodel.rst:1266 +#: ../../reference/datamodel.rst:1268 msgid "" "``end`` (an :class:`int`) represents the offset (exclusive) of the end of " "the :term:`bytecode` range" msgstr "" -#: ../../reference/datamodel.rst:1268 +#: ../../reference/datamodel.rst:1270 msgid "" "``lineno`` is an :class:`int` representing the line number of the :term:" "`bytecode` range, or ``None`` if the bytecodes in the given range have no " "line number" msgstr "" -#: ../../reference/datamodel.rst:1272 +#: ../../reference/datamodel.rst:1274 msgid "The items yielded will have the following properties:" msgstr "" -#: ../../reference/datamodel.rst:1274 +#: ../../reference/datamodel.rst:1276 msgid "The first range yielded will have a ``start`` of 0." msgstr "" -#: ../../reference/datamodel.rst:1275 +#: ../../reference/datamodel.rst:1277 msgid "" "The ``(start, end)`` ranges will be non-decreasing and consecutive. That is, " "for any pair of :class:`tuple`\\s, the ``start`` of the second will be equal " "to the ``end`` of the first." msgstr "" -#: ../../reference/datamodel.rst:1278 +#: ../../reference/datamodel.rst:1280 msgid "No range will be backwards: ``end >= start`` for all triples." msgstr "" -#: ../../reference/datamodel.rst:1279 +#: ../../reference/datamodel.rst:1281 msgid "" "The last :class:`tuple` yielded will have ``end`` equal to the size of the :" "term:`bytecode`." msgstr "" -#: ../../reference/datamodel.rst:1282 +#: ../../reference/datamodel.rst:1284 msgid "" "Zero-width ranges, where ``start == end``, are allowed. Zero-width ranges " "are used for lines that are present in the source code, but have been " "eliminated by the :term:`bytecode` compiler." msgstr "" -#: ../../reference/datamodel.rst:1290 +#: ../../reference/datamodel.rst:1292 msgid ":pep:`626` - Precise line numbers for debugging and other tools." msgstr "" -#: ../../reference/datamodel.rst:1291 +#: ../../reference/datamodel.rst:1293 msgid "The PEP that introduced the :meth:`!co_lines` method." msgstr "" -#: ../../reference/datamodel.rst:1297 +#: ../../reference/datamodel.rst:1299 msgid "Frame objects" msgstr "" -#: ../../reference/datamodel.rst:1301 +#: ../../reference/datamodel.rst:1303 msgid "" "Frame objects represent execution frames. They may occur in :ref:`traceback " "objects `, and are also passed to registered trace " "functions." msgstr "" -#: ../../reference/datamodel.rst:1319 +#: ../../reference/datamodel.rst:1321 msgid "" "Points to the previous stack frame (towards the caller), or ``None`` if this " "is the bottom stack frame" msgstr "" -#: ../../reference/datamodel.rst:1323 +#: ../../reference/datamodel.rst:1325 msgid "" "The :ref:`code object ` being executed in this frame. " "Accessing this attribute raises an :ref:`auditing event ` ``object." @@ -1506,49 +1506,49 @@ msgstr "" "這個屬性會引發一個附帶引數 ``obj`` 與 ``\"f_code\"`` 的\\ :ref:`稽核事件 " "` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1328 +#: ../../reference/datamodel.rst:1330 msgid "" "The dictionary used by the frame to look up :ref:`local variables `" msgstr "" -#: ../../reference/datamodel.rst:1332 +#: ../../reference/datamodel.rst:1334 msgid "" "The dictionary used by the frame to look up :ref:`global variables `" msgstr "" -#: ../../reference/datamodel.rst:1336 +#: ../../reference/datamodel.rst:1338 msgid "" "The dictionary used by the frame to look up :ref:`built-in (intrinsic) names " "`" msgstr "" -#: ../../reference/datamodel.rst:1340 +#: ../../reference/datamodel.rst:1342 msgid "" "The \"precise instruction\" of the frame object (this is an index into the :" "term:`bytecode` string of the :ref:`code object `)" msgstr "" -#: ../../reference/datamodel.rst:1356 +#: ../../reference/datamodel.rst:1358 msgid "" "If not ``None``, this is a function called for various events during code " "execution (this is used by debuggers). Normally an event is triggered for " "each new source line (see :attr:`~frame.f_trace_lines`)." msgstr "" -#: ../../reference/datamodel.rst:1361 +#: ../../reference/datamodel.rst:1363 msgid "" "Set this attribute to :const:`False` to disable triggering a tracing event " "for each source line." msgstr "" -#: ../../reference/datamodel.rst:1365 +#: ../../reference/datamodel.rst:1367 msgid "" "Set this attribute to :const:`True` to allow per-opcode events to be " "requested. Note that this may lead to undefined interpreter behaviour if " "exceptions raised by the trace function escape to the function being traced." msgstr "" -#: ../../reference/datamodel.rst:1371 +#: ../../reference/datamodel.rst:1373 msgid "" "The current line number of the frame -- writing to this from within a trace " "function jumps to the given line (only for the bottom-most frame). A " @@ -1556,15 +1556,15 @@ msgid "" "this attribute." msgstr "" -#: ../../reference/datamodel.rst:1377 +#: ../../reference/datamodel.rst:1379 msgid "Frame object methods" msgstr "" -#: ../../reference/datamodel.rst:1379 +#: ../../reference/datamodel.rst:1381 msgid "Frame objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1383 +#: ../../reference/datamodel.rst:1385 msgid "" "This method clears all references to :ref:`local variables ` held by " "the frame. Also, if the frame belonged to a :term:`generator`, the " @@ -1573,26 +1573,26 @@ msgid "" "and storing its :ref:`traceback ` for later use)." msgstr "" -#: ../../reference/datamodel.rst:1389 +#: ../../reference/datamodel.rst:1391 msgid ":exc:`RuntimeError` is raised if the frame is currently executing." msgstr "" -#: ../../reference/datamodel.rst:1397 +#: ../../reference/datamodel.rst:1399 msgid "Traceback objects" msgstr "" -#: ../../reference/datamodel.rst:1410 +#: ../../reference/datamodel.rst:1412 msgid "" "Traceback objects represent the stack trace of an :ref:`exception `. A traceback object is implicitly created when an exception occurs, " "and may also be explicitly created by calling :class:`types.TracebackType`." msgstr "" -#: ../../reference/datamodel.rst:1415 +#: ../../reference/datamodel.rst:1417 msgid "Traceback objects can now be explicitly instantiated from Python code." msgstr "" -#: ../../reference/datamodel.rst:1418 +#: ../../reference/datamodel.rst:1420 msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " @@ -1603,7 +1603,7 @@ msgid "" "the caught exception." msgstr "" -#: ../../reference/datamodel.rst:1427 +#: ../../reference/datamodel.rst:1429 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " @@ -1611,19 +1611,19 @@ msgid "" "last_traceback`." msgstr "" -#: ../../reference/datamodel.rst:1432 +#: ../../reference/datamodel.rst:1434 msgid "" "For explicitly created tracebacks, it is up to the creator of the traceback " "to determine how the :attr:`~traceback.tb_next` attributes should be linked " "to form a full stack trace." msgstr "" -#: ../../reference/datamodel.rst:1447 +#: ../../reference/datamodel.rst:1449 msgid "" "Points to the execution :ref:`frame ` of the current level." msgstr "" -#: ../../reference/datamodel.rst:1450 +#: ../../reference/datamodel.rst:1452 msgid "" "Accessing this attribute raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." @@ -1631,15 +1631,15 @@ msgstr "" "存取此屬性會引發一個附帶引數 ``obj`` 與 ``\"tb_frame\"`` 的\\ :ref:`稽核事件 " "` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1455 +#: ../../reference/datamodel.rst:1457 msgid "Gives the line number where the exception occurred" msgstr "" -#: ../../reference/datamodel.rst:1458 +#: ../../reference/datamodel.rst:1460 msgid "Indicates the \"precise instruction\"." msgstr "" -#: ../../reference/datamodel.rst:1460 +#: ../../reference/datamodel.rst:1462 msgid "" "The line number and last instruction in the traceback may differ from the " "line number of its :ref:`frame object ` if the exception " @@ -1647,39 +1647,39 @@ msgid "" "with a :keyword:`finally` clause." msgstr "" -#: ../../reference/datamodel.rst:1471 +#: ../../reference/datamodel.rst:1473 msgid "" "The special writable attribute :attr:`!tb_next` is the next level in the " "stack trace (towards the frame where the exception occurred), or ``None`` if " "there is no next level." msgstr "" -#: ../../reference/datamodel.rst:1475 +#: ../../reference/datamodel.rst:1477 msgid "This attribute is now writable" msgstr "" -#: ../../reference/datamodel.rst:1480 +#: ../../reference/datamodel.rst:1482 msgid "Slice objects" msgstr "" -#: ../../reference/datamodel.rst:1484 +#: ../../reference/datamodel.rst:1486 msgid "" "Slice objects are used to represent slices for :meth:`~object.__getitem__` " "methods. They are also created by the built-in :func:`slice` function." msgstr "" -#: ../../reference/datamodel.rst:1493 +#: ../../reference/datamodel.rst:1495 msgid "" "Special read-only attributes: :attr:`~slice.start` is the lower bound; :attr:" "`~slice.stop` is the upper bound; :attr:`~slice.step` is the step value; " "each is ``None`` if omitted. These attributes can have any type." msgstr "" -#: ../../reference/datamodel.rst:1497 +#: ../../reference/datamodel.rst:1499 msgid "Slice objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1501 +#: ../../reference/datamodel.rst:1503 msgid "" "This method takes a single integer argument *length* and computes " "information about the slice that the slice object would describe if applied " @@ -1689,11 +1689,11 @@ msgid "" "a manner consistent with regular slices." msgstr "" -#: ../../reference/datamodel.rst:1510 +#: ../../reference/datamodel.rst:1512 msgid "Static method objects" msgstr "" -#: ../../reference/datamodel.rst:1512 +#: ../../reference/datamodel.rst:1514 msgid "" "Static method objects provide a way of defeating the transformation of " "function objects to method objects described above. A static method object " @@ -1704,11 +1704,11 @@ msgid "" "method objects are created by the built-in :func:`staticmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1522 +#: ../../reference/datamodel.rst:1524 msgid "Class method objects" msgstr "" -#: ../../reference/datamodel.rst:1524 +#: ../../reference/datamodel.rst:1526 msgid "" "A class method object, like a static method object, is a wrapper around " "another object that alters the way in which that object is retrieved from " @@ -1718,11 +1718,11 @@ msgid "" "`classmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1534 +#: ../../reference/datamodel.rst:1536 msgid "Special method names" msgstr "" -#: ../../reference/datamodel.rst:1540 +#: ../../reference/datamodel.rst:1542 msgid "" "A class can implement certain operations that are invoked by special syntax " "(such as arithmetic operations or subscripting and slicing) by defining " @@ -1736,7 +1736,7 @@ msgid "" "`TypeError`)." msgstr "" -#: ../../reference/datamodel.rst:1551 +#: ../../reference/datamodel.rst:1553 msgid "" "Setting a special method to ``None`` indicates that the corresponding " "operation is not available. For example, if a class sets :meth:`~object." @@ -1745,7 +1745,7 @@ msgid "" "`~object.__getitem__`). [#]_" msgstr "" -#: ../../reference/datamodel.rst:1557 +#: ../../reference/datamodel.rst:1559 msgid "" "When implementing a class that emulates any built-in type, it is important " "that the emulation only be implemented to the degree that it makes sense for " @@ -1755,11 +1755,11 @@ msgid "" "the W3C's Document Object Model.)" msgstr "" -#: ../../reference/datamodel.rst:1568 +#: ../../reference/datamodel.rst:1570 msgid "Basic customization" msgstr "" -#: ../../reference/datamodel.rst:1574 +#: ../../reference/datamodel.rst:1576 msgid "" "Called to create a new instance of class *cls*. :meth:`__new__` is a static " "method (special-cased so you need not declare it as such) that takes the " @@ -1769,7 +1769,7 @@ msgid "" "new object instance (usually an instance of *cls*)." msgstr "" -#: ../../reference/datamodel.rst:1581 +#: ../../reference/datamodel.rst:1583 msgid "" "Typical implementations create a new instance of the class by invoking the " "superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` " @@ -1777,7 +1777,7 @@ msgid "" "necessary before returning it." msgstr "" -#: ../../reference/datamodel.rst:1586 +#: ../../reference/datamodel.rst:1588 msgid "" "If :meth:`__new__` is invoked during object construction and it returns an " "instance of *cls*, then the new instance’s :meth:`__init__` method will be " @@ -1786,13 +1786,13 @@ msgid "" "constructor." msgstr "" -#: ../../reference/datamodel.rst:1591 +#: ../../reference/datamodel.rst:1593 msgid "" "If :meth:`__new__` does not return an instance of *cls*, then the new " "instance's :meth:`__init__` method will not be invoked." msgstr "" -#: ../../reference/datamodel.rst:1594 +#: ../../reference/datamodel.rst:1596 msgid "" ":meth:`__new__` is intended mainly to allow subclasses of immutable types " "(like int, str, or tuple) to customize instance creation. It is also " @@ -1800,7 +1800,7 @@ msgid "" "creation." msgstr "" -#: ../../reference/datamodel.rst:1603 +#: ../../reference/datamodel.rst:1605 msgid "" "Called after the instance has been created (by :meth:`__new__`), but before " "it is returned to the caller. The arguments are those passed to the class " @@ -1810,7 +1810,7 @@ msgid "" "example: ``super().__init__([args...])``." msgstr "" -#: ../../reference/datamodel.rst:1610 +#: ../../reference/datamodel.rst:1612 msgid "" "Because :meth:`__new__` and :meth:`__init__` work together in constructing " "objects (:meth:`__new__` to create it, and :meth:`__init__` to customize " @@ -1818,7 +1818,7 @@ msgid "" "will cause a :exc:`TypeError` to be raised at runtime." msgstr "" -#: ../../reference/datamodel.rst:1623 +#: ../../reference/datamodel.rst:1625 msgid "" "Called when the instance is about to be destroyed. This is also called a " "finalizer or (improperly) a destructor. If a base class has a :meth:" @@ -1827,7 +1827,7 @@ msgid "" "instance." msgstr "" -#: ../../reference/datamodel.rst:1629 +#: ../../reference/datamodel.rst:1631 msgid "" "It is possible (though not recommended!) for the :meth:`__del__` method to " "postpone destruction of the instance by creating a new reference to it. " @@ -1837,20 +1837,20 @@ msgid "" "it once." msgstr "" -#: ../../reference/datamodel.rst:1636 +#: ../../reference/datamodel.rst:1638 msgid "" "It is not guaranteed that :meth:`__del__` methods are called for objects " "that still exist when the interpreter exits." msgstr "" -#: ../../reference/datamodel.rst:1641 +#: ../../reference/datamodel.rst:1643 msgid "" "``del x`` doesn't directly call ``x.__del__()`` --- the former decrements " "the reference count for ``x`` by one, and the latter is only called when " "``x``'s reference count reaches zero." msgstr "" -#: ../../reference/datamodel.rst:1646 +#: ../../reference/datamodel.rst:1648 msgid "" "It is possible for a reference cycle to prevent the reference count of an " "object from going to zero. In this case, the cycle will be later detected " @@ -1861,18 +1861,18 @@ msgid "" "caught in the traceback." msgstr "" -#: ../../reference/datamodel.rst:1656 +#: ../../reference/datamodel.rst:1658 msgid "Documentation for the :mod:`gc` module." msgstr "" -#: ../../reference/datamodel.rst:1660 +#: ../../reference/datamodel.rst:1662 msgid "" "Due to the precarious circumstances under which :meth:`__del__` methods are " "invoked, exceptions that occur during their execution are ignored, and a " "warning is printed to ``sys.stderr`` instead. In particular:" msgstr "" -#: ../../reference/datamodel.rst:1664 +#: ../../reference/datamodel.rst:1666 msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " @@ -1881,7 +1881,7 @@ msgid "" "`__del__`." msgstr "" -#: ../../reference/datamodel.rst:1670 +#: ../../reference/datamodel.rst:1672 msgid "" ":meth:`__del__` can be executed during interpreter shutdown. As a " "consequence, the global variables it needs to access (including other " @@ -1892,7 +1892,7 @@ msgid "" "still available at the time when the :meth:`__del__` method is called." msgstr "" -#: ../../reference/datamodel.rst:1685 +#: ../../reference/datamodel.rst:1687 msgid "" "Called by the :func:`repr` built-in function to compute the \"official\" " "string representation of an object. If at all possible, this should look " @@ -1904,13 +1904,13 @@ msgid "" "an \"informal\" string representation of instances of that class is required." msgstr "" -#: ../../reference/datamodel.rst:1694 +#: ../../reference/datamodel.rst:1696 msgid "" "This is typically used for debugging, so it is important that the " "representation is information-rich and unambiguous." msgstr "" -#: ../../reference/datamodel.rst:1705 +#: ../../reference/datamodel.rst:1707 msgid "" "Called by :func:`str(object) ` and the built-in functions :func:" "`format` and :func:`print` to compute the \"informal\" or nicely printable " @@ -1918,26 +1918,26 @@ msgid "" "` object." msgstr "" -#: ../../reference/datamodel.rst:1710 +#: ../../reference/datamodel.rst:1712 msgid "" "This method differs from :meth:`object.__repr__` in that there is no " "expectation that :meth:`__str__` return a valid Python expression: a more " "convenient or concise representation can be used." msgstr "" -#: ../../reference/datamodel.rst:1714 +#: ../../reference/datamodel.rst:1716 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:1724 +#: ../../reference/datamodel.rst:1726 msgid "" "Called by :ref:`bytes ` to compute a byte-string representation " "of an object. This should return a :class:`bytes` object." msgstr "" -#: ../../reference/datamodel.rst:1735 +#: ../../reference/datamodel.rst:1737 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -1949,28 +1949,28 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:1745 +#: ../../reference/datamodel.rst:1747 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:1747 +#: ../../reference/datamodel.rst:1749 msgid "The return value must be a string object." msgstr "" -#: ../../reference/datamodel.rst:1749 +#: ../../reference/datamodel.rst:1751 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:1753 +#: ../../reference/datamodel.rst:1755 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:1769 +#: ../../reference/datamodel.rst:1771 msgid "" "These are the so-called \"rich comparison\" methods. The correspondence " "between operator symbols and method names is as follows: ``x.__hash__``." msgstr "" -#: ../../reference/datamodel.rst:1858 +#: ../../reference/datamodel.rst:1860 msgid "" "If a class that does not override :meth:`__eq__` wishes to suppress hash " "support, it should include ``__hash__ = None`` in the class definition. A " @@ -2089,7 +2089,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:1867 +#: ../../reference/datamodel.rst:1869 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -2097,7 +2097,7 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:1872 +#: ../../reference/datamodel.rst:1874 msgid "" "This is intended to provide protection against a denial-of-service caused by " "carefully chosen inputs that exploit the worst case performance of a dict " @@ -2105,22 +2105,22 @@ msgid "" "advisories/ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:1877 +#: ../../reference/datamodel.rst:1879 msgid "" "Changing hash values affects the iteration order of sets. Python has never " "made guarantees about this ordering (and it typically varies between 32-bit " "and 64-bit builds)." msgstr "" -#: ../../reference/datamodel.rst:1881 +#: ../../reference/datamodel.rst:1883 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`\\ 。" -#: ../../reference/datamodel.rst:1883 +#: ../../reference/datamodel.rst:1885 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:1891 +#: ../../reference/datamodel.rst:1893 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -2129,18 +2129,18 @@ msgid "" "meth:`!__len__` nor :meth:`!__bool__`, all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:1902 +#: ../../reference/datamodel.rst:1904 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:1904 +#: ../../reference/datamodel.rst:1906 msgid "" "The following methods can be defined to customize the meaning of attribute " "access (use of, assignment to, or deletion of ``x.name``) for class " "instances." msgstr "" -#: ../../reference/datamodel.rst:1912 +#: ../../reference/datamodel.rst:1914 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -2150,7 +2150,7 @@ msgid "" "attribute value or raise an :exc:`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1919 +#: ../../reference/datamodel.rst:1921 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -2163,7 +2163,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:1932 +#: ../../reference/datamodel.rst:1934 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -2175,14 +2175,14 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:1943 +#: ../../reference/datamodel.rst:1945 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or :ref:`built-in " "functions `. See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:1948 +#: ../../reference/datamodel.rst:1950 msgid "" "Raises an :ref:`auditing event ` ``object.__getattr__`` with " "arguments ``obj``, ``name``." @@ -2190,27 +2190,27 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__getattr__``。" -#: ../../reference/datamodel.rst:1950 +#: ../../reference/datamodel.rst:1952 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1957 +#: ../../reference/datamodel.rst:1959 msgid "" "Called when an attribute assignment is attempted. This is called instead of " "the normal mechanism (i.e. store the value in the instance dictionary). " "*name* is the attribute name, *value* is the value to be assigned to it." msgstr "" -#: ../../reference/datamodel.rst:1961 +#: ../../reference/datamodel.rst:1963 msgid "" "If :meth:`__setattr__` wants to assign to an instance attribute, it should " "call the base class method with the same name, for example, ``object." "__setattr__(self, name, value)``." msgstr "" -#: ../../reference/datamodel.rst:1965 +#: ../../reference/datamodel.rst:1967 msgid "" "Raises an :ref:`auditing event ` ``object.__setattr__`` with " "arguments ``obj``, ``name``, ``value``." @@ -2218,21 +2218,21 @@ msgstr "" "引發一個附帶引數 ``obj``、``name``、``value`` 的\\ :ref:`稽核事件 " "` ``object.__setattr__``。" -#: ../../reference/datamodel.rst:1967 +#: ../../reference/datamodel.rst:1969 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:1974 +#: ../../reference/datamodel.rst:1976 msgid "" "Like :meth:`__setattr__` but for attribute deletion instead of assignment. " "This should only be implemented if ``del obj.name`` is meaningful for the " "object." msgstr "" -#: ../../reference/datamodel.rst:1977 +#: ../../reference/datamodel.rst:1979 msgid "" "Raises an :ref:`auditing event ` ``object.__delattr__`` with " "arguments ``obj``, ``name``." @@ -2240,23 +2240,23 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__delattr__``。" -#: ../../reference/datamodel.rst:1979 +#: ../../reference/datamodel.rst:1981 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1986 +#: ../../reference/datamodel.rst:1988 msgid "" "Called when :func:`dir` is called on the object. An iterable must be " "returned. :func:`dir` converts the returned iterable to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:1991 +#: ../../reference/datamodel.rst:1993 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:1998 +#: ../../reference/datamodel.rst:2000 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2268,21 +2268,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:2007 +#: ../../reference/datamodel.rst:2009 msgid "" "The ``__dir__`` function should accept no arguments, and return an iterable " "of strings that represents the names accessible on module. If present, this " "function overrides the standard :func:`dir` search on a module." msgstr "" -#: ../../reference/datamodel.rst:2011 +#: ../../reference/datamodel.rst:2013 msgid "" "For a more fine grained customization of the module behavior (setting " "attributes, properties, etc.), one can set the ``__class__`` attribute of a " "module object to a subclass of :class:`types.ModuleType`. For example::" msgstr "" -#: ../../reference/datamodel.rst:2029 +#: ../../reference/datamodel.rst:2031 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2290,27 +2290,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:2034 +#: ../../reference/datamodel.rst:2036 msgid "``__class__`` module attribute is now writable." msgstr "" -#: ../../reference/datamodel.rst:2037 +#: ../../reference/datamodel.rst:2039 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "" -#: ../../reference/datamodel.rst:2042 +#: ../../reference/datamodel.rst:2044 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:2043 +#: ../../reference/datamodel.rst:2045 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:2049 +#: ../../reference/datamodel.rst:2051 msgid "Implementing Descriptors" msgstr "" -#: ../../reference/datamodel.rst:2051 +#: ../../reference/datamodel.rst:2053 msgid "" "The following methods only apply when an instance of the class containing " "the method (a so-called *descriptor* class) appears in an *owner* class (the " @@ -2320,7 +2320,7 @@ msgid "" "the owner class' :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:2061 +#: ../../reference/datamodel.rst:2063 msgid "" "Called to get the attribute of the owner class (class attribute access) or " "of an instance of that class (instance attribute access). The optional " @@ -2329,13 +2329,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:2067 +#: ../../reference/datamodel.rst:2069 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:2070 +#: ../../reference/datamodel.rst:2072 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2345,31 +2345,31 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:2079 +#: ../../reference/datamodel.rst:2081 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:2082 +#: ../../reference/datamodel.rst:2084 msgid "" "Note, adding :meth:`__set__` or :meth:`__delete__` changes the kind of " "descriptor to a \"data descriptor\". See :ref:`descriptor-invocation` for " "more details." msgstr "" -#: ../../reference/datamodel.rst:2088 +#: ../../reference/datamodel.rst:2090 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:2090 +#: ../../reference/datamodel.rst:2092 msgid "" "Instances of descriptors may also have the :attr:`!__objclass__` attribute " "present:" msgstr "" -#: ../../reference/datamodel.rst:2095 +#: ../../reference/datamodel.rst:2097 msgid "" "The attribute :attr:`!__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2380,11 +2380,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:2106 +#: ../../reference/datamodel.rst:2108 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:2108 +#: ../../reference/datamodel.rst:2110 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2393,7 +2393,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:2114 +#: ../../reference/datamodel.rst:2116 msgid "" "The default behavior for attribute access is to get, set, or delete the " "attribute from an object's dictionary. For instance, ``a.x`` has a lookup " @@ -2401,7 +2401,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:2119 +#: ../../reference/datamodel.rst:2121 msgid "" "However, if the looked-up value is an object defining one of the descriptor " "methods, then Python may override the default behavior and invoke the " @@ -2409,54 +2409,54 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:2124 +#: ../../reference/datamodel.rst:2126 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:2129 +#: ../../reference/datamodel.rst:2131 msgid "Direct Call" msgstr "" -#: ../../reference/datamodel.rst:2128 +#: ../../reference/datamodel.rst:2130 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:2133 +#: ../../reference/datamodel.rst:2135 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:2132 +#: ../../reference/datamodel.rst:2134 msgid "" "If binding to an object instance, ``a.x`` is transformed into the call: " "``type(a).__dict__['x'].__get__(a, type(a))``." msgstr "" -#: ../../reference/datamodel.rst:2137 +#: ../../reference/datamodel.rst:2139 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:2136 +#: ../../reference/datamodel.rst:2138 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:2143 +#: ../../reference/datamodel.rst:2145 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:2140 +#: ../../reference/datamodel.rst:2142 msgid "" "A dotted lookup such as ``super(A, a).x`` searches ``a.__class__.__mro__`` " "for a base class ``B`` following ``A`` and then returns ``B.__dict__['x']." "__get__(a, A)``. If not a descriptor, ``x`` is returned unchanged." msgstr "" -#: ../../reference/datamodel.rst:2177 +#: ../../reference/datamodel.rst:2179 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " @@ -2474,7 +2474,7 @@ msgid "" "instances." msgstr "" -#: ../../reference/datamodel.rst:2192 +#: ../../reference/datamodel.rst:2194 msgid "" "Python methods (including those decorated with :func:`@staticmethod " "` and :func:`@classmethod `) are implemented as " @@ -2483,30 +2483,30 @@ msgid "" "from other instances of the same class." msgstr "" -#: ../../reference/datamodel.rst:2198 +#: ../../reference/datamodel.rst:2200 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:2205 +#: ../../reference/datamodel.rst:2207 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:2207 +#: ../../reference/datamodel.rst:2209 msgid "" "*__slots__* allow us to explicitly declare data members (like properties) " "and deny the creation of :attr:`~object.__dict__` and *__weakref__* (unless " "explicitly declared in *__slots__* or available in a parent.)" msgstr "" -#: ../../reference/datamodel.rst:2211 +#: ../../reference/datamodel.rst:2213 msgid "" "The space saved over using :attr:`~object.__dict__` can be significant. " "Attribute lookup speed can be significantly improved as well." msgstr "" -#: ../../reference/datamodel.rst:2216 +#: ../../reference/datamodel.rst:2218 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -2514,18 +2514,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:2225 +#: ../../reference/datamodel.rst:2227 msgid "Notes on using *__slots__*:" msgstr "" -#: ../../reference/datamodel.rst:2227 +#: ../../reference/datamodel.rst:2229 msgid "" "When inheriting from a class without *__slots__*, the :attr:`~object." "__dict__` and *__weakref__* attribute of the instances will always be " "accessible." msgstr "" -#: ../../reference/datamodel.rst:2231 +#: ../../reference/datamodel.rst:2233 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -2534,7 +2534,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2238 +#: ../../reference/datamodel.rst:2240 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -2542,7 +2542,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2244 +#: ../../reference/datamodel.rst:2246 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -2550,7 +2550,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:2250 +#: ../../reference/datamodel.rst:2252 msgid "" "The action of a *__slots__* declaration is not limited to the class where it " "is defined. *__slots__* declared in parents are available in child classes. " @@ -2559,7 +2559,7 @@ msgid "" "names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:2256 +#: ../../reference/datamodel.rst:2258 msgid "" "If a class defines a slot also defined in a base class, the instance " "variable defined by the base class slot is inaccessible (except by " @@ -2568,7 +2568,7 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:2261 +#: ../../reference/datamodel.rst:2263 msgid "" ":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " "class derived from a :c:member:`\"variable-length\" built-in type " @@ -2576,11 +2576,11 @@ msgid "" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:2266 +#: ../../reference/datamodel.rst:2268 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2268 +#: ../../reference/datamodel.rst:2270 msgid "" "If a :class:`dictionary ` is used to assign *__slots__*, the " "dictionary keys will be used as the slot names. The values of the dictionary " @@ -2588,13 +2588,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:2273 +#: ../../reference/datamodel.rst:2275 msgid "" ":attr:`~instance.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2276 +#: ../../reference/datamodel.rst:2278 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2602,18 +2602,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2282 +#: ../../reference/datamodel.rst:2284 msgid "" "If an :term:`iterator` is used for *__slots__* then a :term:`descriptor` is " "created for each of the iterator's values. However, the *__slots__* " "attribute will be an empty iterator." msgstr "" -#: ../../reference/datamodel.rst:2290 +#: ../../reference/datamodel.rst:2292 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:2292 +#: ../../reference/datamodel.rst:2294 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2623,14 +2623,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:2301 +#: ../../reference/datamodel.rst:2303 msgid "" "This method is called whenever the containing class is subclassed. *cls* is " "then the new subclass. If defined as a normal instance method, this method " "is implicitly converted to a class method." msgstr "" -#: ../../reference/datamodel.rst:2305 +#: ../../reference/datamodel.rst:2307 msgid "" "Keyword arguments which are given to a new class are passed to the parent " "class's ``__init_subclass__``. For compatibility with other classes using " @@ -2638,13 +2638,13 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2319 +#: ../../reference/datamodel.rst:2321 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2324 +#: ../../reference/datamodel.rst:2326 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2652,41 +2652,41 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2332 +#: ../../reference/datamodel.rst:2334 msgid "" "When a class is created, :meth:`type.__new__` scans the class variables and " "makes callbacks to those with a :meth:`~object.__set_name__` hook." msgstr "" -#: ../../reference/datamodel.rst:2337 +#: ../../reference/datamodel.rst:2339 msgid "" "Automatically called at the time the owning class *owner* is created. The " "object has been assigned to *name* in that class::" msgstr "" -#: ../../reference/datamodel.rst:2343 +#: ../../reference/datamodel.rst:2345 msgid "" "If the class variable is assigned after the class is created, :meth:" "`__set_name__` will not be called automatically. If needed, :meth:" "`__set_name__` can be called directly::" msgstr "" -#: ../../reference/datamodel.rst:2354 +#: ../../reference/datamodel.rst:2356 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`\\ 。" -#: ../../reference/datamodel.rst:2362 +#: ../../reference/datamodel.rst:2364 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2369 +#: ../../reference/datamodel.rst:2371 msgid "" "By default, classes are constructed using :func:`type`. The class body is " "executed in a new namespace and the class name is bound locally to the " "result of ``type(name, bases, namespace)``." msgstr "" -#: ../../reference/datamodel.rst:2373 +#: ../../reference/datamodel.rst:2375 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2694,41 +2694,41 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2387 +#: ../../reference/datamodel.rst:2389 msgid "" "Any other keyword arguments that are specified in the class definition are " "passed through to all metaclass operations described below." msgstr "" -#: ../../reference/datamodel.rst:2390 +#: ../../reference/datamodel.rst:2392 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2392 +#: ../../reference/datamodel.rst:2394 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2393 +#: ../../reference/datamodel.rst:2395 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2394 +#: ../../reference/datamodel.rst:2396 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2395 +#: ../../reference/datamodel.rst:2397 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2396 +#: ../../reference/datamodel.rst:2398 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2400 +#: ../../reference/datamodel.rst:2402 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2404 +#: ../../reference/datamodel.rst:2406 msgid "" "If a base that appears in a class definition is not an instance of :class:" "`type`, then an :meth:`!__mro_entries__` method is searched on the base. If " @@ -2740,59 +2740,59 @@ msgid "" "is ignored." msgstr "" -#: ../../reference/datamodel.rst:2416 +#: ../../reference/datamodel.rst:2418 msgid ":func:`types.resolve_bases`" msgstr ":func:`types.resolve_bases`" -#: ../../reference/datamodel.rst:2416 +#: ../../reference/datamodel.rst:2418 msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" -#: ../../reference/datamodel.rst:2420 +#: ../../reference/datamodel.rst:2422 msgid ":func:`types.get_original_bases`" msgstr ":func:`types.get_original_bases`" -#: ../../reference/datamodel.rst:2419 +#: ../../reference/datamodel.rst:2421 msgid "" "Retrieve a class's \"original bases\" prior to modifications by :meth:" "`~object.__mro_entries__`." msgstr "" -#: ../../reference/datamodel.rst:2422 +#: ../../reference/datamodel.rst:2424 msgid ":pep:`560`" msgstr ":pep:`560`" -#: ../../reference/datamodel.rst:2423 +#: ../../reference/datamodel.rst:2425 msgid "Core support for typing module and generic types." msgstr "" -#: ../../reference/datamodel.rst:2427 +#: ../../reference/datamodel.rst:2429 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2431 +#: ../../reference/datamodel.rst:2433 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2433 +#: ../../reference/datamodel.rst:2435 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2434 +#: ../../reference/datamodel.rst:2436 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:2436 +#: ../../reference/datamodel.rst:2438 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:2439 +#: ../../reference/datamodel.rst:2441 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2801,11 +2801,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2449 +#: ../../reference/datamodel.rst:2451 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2454 +#: ../../reference/datamodel.rst:2456 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2817,25 +2817,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2463 +#: ../../reference/datamodel.rst:2465 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2468 +#: ../../reference/datamodel.rst:2470 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2469 +#: ../../reference/datamodel.rst:2471 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2473 +#: ../../reference/datamodel.rst:2475 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2478 +#: ../../reference/datamodel.rst:2480 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2844,7 +2844,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2484 +#: ../../reference/datamodel.rst:2486 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -2853,11 +2853,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2493 +#: ../../reference/datamodel.rst:2495 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2500 +#: ../../reference/datamodel.rst:2502 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2865,7 +2865,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2505 +#: ../../reference/datamodel.rst:2507 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -2876,7 +2876,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2515 +#: ../../reference/datamodel.rst:2517 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -2885,39 +2885,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2521 +#: ../../reference/datamodel.rst:2523 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customization " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2525 +#: ../../reference/datamodel.rst:2527 msgid "" "The ``type.__new__`` method collects all of the attributes in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2527 +#: ../../reference/datamodel.rst:2529 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2529 +#: ../../reference/datamodel.rst:2531 msgid "" "The :meth:`~object.__init_subclass__` hook is called on the immediate parent " "of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2532 +#: ../../reference/datamodel.rst:2534 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2536 +#: ../../reference/datamodel.rst:2538 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -2925,19 +2925,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2543 +#: ../../reference/datamodel.rst:2545 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2544 +#: ../../reference/datamodel.rst:2546 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2548 +#: ../../reference/datamodel.rst:2550 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2550 +#: ../../reference/datamodel.rst:2552 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2945,17 +2945,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2557 +#: ../../reference/datamodel.rst:2559 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2559 +#: ../../reference/datamodel.rst:2561 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2562 +#: ../../reference/datamodel.rst:2564 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2963,21 +2963,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2569 +#: ../../reference/datamodel.rst:2571 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2576 +#: ../../reference/datamodel.rst:2578 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2581 +#: ../../reference/datamodel.rst:2583 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -2985,11 +2985,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2592 +#: ../../reference/datamodel.rst:2594 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2589 +#: ../../reference/datamodel.rst:2591 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2998,11 +2998,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2597 +#: ../../reference/datamodel.rst:2599 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2599 +#: ../../reference/datamodel.rst:2601 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -3010,65 +3010,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2607 +#: ../../reference/datamodel.rst:2609 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2607 +#: ../../reference/datamodel.rst:2609 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2610 +#: ../../reference/datamodel.rst:2612 msgid ":ref:`Generic Alias Types`" msgstr ":ref:`泛型別名型別 `" -#: ../../reference/datamodel.rst:2610 +#: ../../reference/datamodel.rst:2612 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2613 +#: ../../reference/datamodel.rst:2615 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2613 +#: ../../reference/datamodel.rst:2615 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2616 +#: ../../reference/datamodel.rst:2618 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2621 +#: ../../reference/datamodel.rst:2623 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2624 +#: ../../reference/datamodel.rst:2626 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " "method. As such, there is no need for it to be decorated with :func:" "`@classmethod` when it is defined." msgstr "" -#: ../../reference/datamodel.rst:2630 +#: ../../reference/datamodel.rst:2632 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2632 +#: ../../reference/datamodel.rst:2634 msgid "" "The purpose of :meth:`~object.__class_getitem__` is to allow runtime " "parameterization of standard-library generic classes in order to more easily " "apply :term:`type hints` to these classes." msgstr "" -#: ../../reference/datamodel.rst:2636 +#: ../../reference/datamodel.rst:2638 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -3077,7 +3077,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2642 +#: ../../reference/datamodel.rst:2644 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -3085,11 +3085,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2652 +#: ../../reference/datamodel.rst:2654 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2654 +#: ../../reference/datamodel.rst:2656 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -3099,14 +3099,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2661 +#: ../../reference/datamodel.rst:2663 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " "follows something like the following process to decide whether :meth:" "`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" -#: ../../reference/datamodel.rst:2689 +#: ../../reference/datamodel.rst:2691 msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " @@ -3116,40 +3116,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2708 +#: ../../reference/datamodel.rst:2710 msgid "" "However, if a class has a custom metaclass that defines :meth:`~object." "__getitem__`, subscribing the class may result in different behaviour. An " "example of this can be found in the :mod:`enum` module::" msgstr "" -#: ../../reference/datamodel.rst:2733 +#: ../../reference/datamodel.rst:2735 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2732 +#: ../../reference/datamodel.rst:2734 msgid "" "Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" "`subscription` results in ``__class_getitem__()`` being " "called instead of :meth:`~object.__getitem__`" msgstr "" -#: ../../reference/datamodel.rst:2740 +#: ../../reference/datamodel.rst:2742 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2747 +#: ../../reference/datamodel.rst:2749 msgid "" "Called when the instance is \"called\" as a function; if this method is " "defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " "arg1, ...)``." msgstr "" -#: ../../reference/datamodel.rst:2754 +#: ../../reference/datamodel.rst:2756 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2756 +#: ../../reference/datamodel.rst:2758 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -3185,7 +3185,7 @@ msgid "" "should iterate through the values." msgstr "" -#: ../../reference/datamodel.rst:2797 +#: ../../reference/datamodel.rst:2799 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -3193,7 +3193,7 @@ msgid "" "returns zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2804 +#: ../../reference/datamodel.rst:2806 msgid "" "In CPython, the length is required to be at most :data:`sys.maxsize`. If the " "length is larger than :data:`!sys.maxsize` some features (such as :func:" @@ -3202,7 +3202,7 @@ msgid "" "`~object.__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2813 +#: ../../reference/datamodel.rst:2815 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -3212,20 +3212,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2827 +#: ../../reference/datamodel.rst:2829 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2831 +#: ../../reference/datamodel.rst:2833 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2835 +#: ../../reference/datamodel.rst:2837 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2840 +#: ../../reference/datamodel.rst:2842 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers. Optionally, they may support :class:" @@ -3237,20 +3237,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2852 +#: ../../reference/datamodel.rst:2854 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:2857 +#: ../../reference/datamodel.rst:2859 msgid "" "When :ref:`subscripting` a *class*, the special class method :" "meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " "See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:2865 +#: ../../reference/datamodel.rst:2867 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3259,7 +3259,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2874 +#: ../../reference/datamodel.rst:2876 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3268,13 +3268,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2883 +#: ../../reference/datamodel.rst:2885 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:2889 +#: ../../reference/datamodel.rst:2891 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3282,14 +3282,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2897 +#: ../../reference/datamodel.rst:2899 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:2901 +#: ../../reference/datamodel.rst:2903 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -3298,7 +3298,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2908 +#: ../../reference/datamodel.rst:2910 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3306,14 +3306,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2915 +#: ../../reference/datamodel.rst:2917 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:2919 +#: ../../reference/datamodel.rst:2921 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3321,11 +3321,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2928 +#: ../../reference/datamodel.rst:2930 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2930 +#: ../../reference/datamodel.rst:2932 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3333,7 +3333,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2956 +#: ../../reference/datamodel.rst:2958 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3347,13 +3347,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2967 +#: ../../reference/datamodel.rst:2969 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2990 +#: ../../reference/datamodel.rst:2992 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3366,13 +3366,13 @@ msgid "" "*NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:3002 +#: ../../reference/datamodel.rst:3004 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:3007 +#: ../../reference/datamodel.rst:3009 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -3381,7 +3381,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:3028 +#: ../../reference/datamodel.rst:3030 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3397,19 +3397,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:3049 +#: ../../reference/datamodel.rst:3051 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:3062 +#: ../../reference/datamodel.rst:3064 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:3069 +#: ../../reference/datamodel.rst:3071 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3418,14 +3418,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:3075 +#: ../../reference/datamodel.rst:3077 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:3087 +#: ../../reference/datamodel.rst:3089 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3434,21 +3434,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:3093 +#: ../../reference/datamodel.rst:3095 msgid "" "The built-in function :func:`int` falls back to :meth:`__trunc__` if " "neither :meth:`__int__` nor :meth:`__index__` is defined." msgstr "" -#: ../../reference/datamodel.rst:3096 +#: ../../reference/datamodel.rst:3098 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:3103 +#: ../../reference/datamodel.rst:3105 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3105 +#: ../../reference/datamodel.rst:3107 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -3458,32 +3458,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:3116 +#: ../../reference/datamodel.rst:3118 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:3119 +#: ../../reference/datamodel.rst:3121 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:3124 +#: ../../reference/datamodel.rst:3126 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:3131 +#: ../../reference/datamodel.rst:3133 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:3135 +#: ../../reference/datamodel.rst:3137 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -3491,27 +3491,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:3139 +#: ../../reference/datamodel.rst:3141 msgid "" "Note that :meth:`~object.__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:3146 +#: ../../reference/datamodel.rst:3148 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:3146 +#: ../../reference/datamodel.rst:3148 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3153 +#: ../../reference/datamodel.rst:3155 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:3155 +#: ../../reference/datamodel.rst:3157 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -3519,7 +3519,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:3162 +#: ../../reference/datamodel.rst:3164 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -3528,7 +3528,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:3168 +#: ../../reference/datamodel.rst:3170 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3538,19 +3538,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:3178 +#: ../../reference/datamodel.rst:3180 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:3179 +#: ../../reference/datamodel.rst:3181 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:3185 +#: ../../reference/datamodel.rst:3187 msgid "Emulating buffer types" msgstr "" -#: ../../reference/datamodel.rst:3187 +#: ../../reference/datamodel.rst:3189 msgid "" "The :ref:`buffer protocol ` provides a way for Python objects " "to expose efficient access to a low-level memory array. This protocol is " @@ -3558,13 +3558,13 @@ msgid "" "and third-party libraries may define additional buffer types." msgstr "" -#: ../../reference/datamodel.rst:3192 +#: ../../reference/datamodel.rst:3194 msgid "" "While buffer types are usually implemented in C, it is also possible to " "implement the protocol in Python." msgstr "" -#: ../../reference/datamodel.rst:3197 +#: ../../reference/datamodel.rst:3199 msgid "" "Called when a buffer is requested from *self* (for example, by the :class:" "`memoryview` constructor). The *flags* argument is an integer representing " @@ -3574,7 +3574,7 @@ msgid "" "`memoryview` object." msgstr "" -#: ../../reference/datamodel.rst:3206 +#: ../../reference/datamodel.rst:3208 msgid "" "Called when a buffer is no longer needed. The *buffer* argument is a :class:" "`memoryview` object that was previously returned by :meth:`~object." @@ -3583,28 +3583,28 @@ msgid "" "to perform any cleanup are not required to implement this method." msgstr "" -#: ../../reference/datamodel.rst:3218 +#: ../../reference/datamodel.rst:3220 msgid ":pep:`688` - Making the buffer protocol accessible in Python" msgstr "" -#: ../../reference/datamodel.rst:3218 +#: ../../reference/datamodel.rst:3220 msgid "" "Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3220 +#: ../../reference/datamodel.rst:3222 msgid ":class:`collections.abc.Buffer`" msgstr ":class:`collections.abc.Buffer`" -#: ../../reference/datamodel.rst:3221 +#: ../../reference/datamodel.rst:3223 msgid "ABC for buffer types." msgstr "" -#: ../../reference/datamodel.rst:3226 +#: ../../reference/datamodel.rst:3228 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:3228 +#: ../../reference/datamodel.rst:3230 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -3612,7 +3612,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:3243 +#: ../../reference/datamodel.rst:3245 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3621,21 +3621,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:3257 +#: ../../reference/datamodel.rst:3259 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:3266 +#: ../../reference/datamodel.rst:3268 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:3292 +#: ../../reference/datamodel.rst:3294 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3644,36 +3644,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:3303 +#: ../../reference/datamodel.rst:3305 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:3307 +#: ../../reference/datamodel.rst:3309 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:3309 +#: ../../reference/datamodel.rst:3311 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:3315 +#: ../../reference/datamodel.rst:3317 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:3321 +#: ../../reference/datamodel.rst:3323 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " "method to be compatible with the :keyword:`await` expression." msgstr "" -#: ../../reference/datamodel.rst:3327 +#: ../../reference/datamodel.rst:3329 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -3681,15 +3681,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:3335 +#: ../../reference/datamodel.rst:3337 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:3341 +#: ../../reference/datamodel.rst:3343 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:3343 +#: ../../reference/datamodel.rst:3345 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3700,18 +3700,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:3351 +#: ../../reference/datamodel.rst:3353 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:3355 +#: ../../reference/datamodel.rst:3357 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3361 +#: ../../reference/datamodel.rst:3363 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3722,7 +3722,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3372 +#: ../../reference/datamodel.rst:3374 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3733,13 +3733,13 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3383 +#: ../../reference/datamodel.rst:3385 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:3388 +#: ../../reference/datamodel.rst:3390 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3749,99 +3749,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3396 +#: ../../reference/datamodel.rst:3398 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3402 +#: ../../reference/datamodel.rst:3404 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3404 +#: ../../reference/datamodel.rst:3406 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3407 +#: ../../reference/datamodel.rst:3409 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3411 +#: ../../reference/datamodel.rst:3413 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3415 +#: ../../reference/datamodel.rst:3417 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3418 +#: ../../reference/datamodel.rst:3420 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3435 +#: ../../reference/datamodel.rst:3437 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3440 +#: ../../reference/datamodel.rst:3442 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3448 +#: ../../reference/datamodel.rst:3450 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3450 +#: ../../reference/datamodel.rst:3452 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3453 +#: ../../reference/datamodel.rst:3455 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3457 +#: ../../reference/datamodel.rst:3459 msgid "" "Semantically similar to :meth:`~object.__enter__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3462 +#: ../../reference/datamodel.rst:3464 msgid "" "Semantically similar to :meth:`~object.__exit__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3465 +#: ../../reference/datamodel.rst:3467 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3478 +#: ../../reference/datamodel.rst:3480 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3479 +#: ../../reference/datamodel.rst:3481 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3483 +#: ../../reference/datamodel.rst:3485 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3849,7 +3849,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3489 +#: ../../reference/datamodel.rst:3491 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns ``NotImplemented``. Do not set the method to ``None`` if you " @@ -3857,7 +3857,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3495 +#: ../../reference/datamodel.rst:3497 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method -- such as :meth:`~object.__add__` -- fails then the overall " @@ -3878,9 +3878,9 @@ msgstr "" #: ../../reference/datamodel.rst:799 ../../reference/datamodel.rst:823 #: ../../reference/datamodel.rst:856 ../../reference/datamodel.rst:938 #: ../../reference/datamodel.rst:1007 ../../reference/datamodel.rst:1034 -#: ../../reference/datamodel.rst:1096 ../../reference/datamodel.rst:1198 -#: ../../reference/datamodel.rst:1299 ../../reference/datamodel.rst:1399 -#: ../../reference/datamodel.rst:1808 ../../reference/datamodel.rst:2823 +#: ../../reference/datamodel.rst:1096 ../../reference/datamodel.rst:1200 +#: ../../reference/datamodel.rst:1301 ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1810 ../../reference/datamodel.rst:2825 msgid "object" msgstr "object(物件)" @@ -3891,13 +3891,13 @@ msgstr "data(資料)" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:292 #: ../../reference/datamodel.rst:336 ../../reference/datamodel.rst:420 #: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:799 -#: ../../reference/datamodel.rst:1053 ../../reference/datamodel.rst:1482 -#: ../../reference/datamodel.rst:1722 ../../reference/datamodel.rst:1727 -#: ../../reference/datamodel.rst:1808 ../../reference/datamodel.rst:2364 -#: ../../reference/datamodel.rst:2793 ../../reference/datamodel.rst:2951 -#: ../../reference/datamodel.rst:2986 ../../reference/datamodel.rst:3000 -#: ../../reference/datamodel.rst:3047 ../../reference/datamodel.rst:3057 -#: ../../reference/datamodel.rst:3085 +#: ../../reference/datamodel.rst:1053 ../../reference/datamodel.rst:1484 +#: ../../reference/datamodel.rst:1724 ../../reference/datamodel.rst:1729 +#: ../../reference/datamodel.rst:1810 ../../reference/datamodel.rst:2366 +#: ../../reference/datamodel.rst:2795 ../../reference/datamodel.rst:2953 +#: ../../reference/datamodel.rst:2988 ../../reference/datamodel.rst:3002 +#: ../../reference/datamodel.rst:3049 ../../reference/datamodel.rst:3059 +#: ../../reference/datamodel.rst:3087 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -3906,7 +3906,7 @@ msgid "id" msgstr "id" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:122 -#: ../../reference/datamodel.rst:2364 +#: ../../reference/datamodel.rst:2366 msgid "type" msgstr "type(型別)" @@ -4030,12 +4030,12 @@ msgstr "number(數字)" msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:3057 +#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:3059 msgid "complex" msgstr "complex(複數)" #: ../../reference/datamodel.rst:292 ../../reference/datamodel.rst:420 -#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2793 +#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2795 msgid "len" msgstr "len" @@ -4068,8 +4068,8 @@ msgstr "immutable sequence(不可變序列)" msgid "immutable" msgstr "immutable(不可變)" -#: ../../reference/datamodel.rst:332 ../../reference/datamodel.rst:1697 -#: ../../reference/datamodel.rst:1727 +#: ../../reference/datamodel.rst:332 ../../reference/datamodel.rst:1699 +#: ../../reference/datamodel.rst:1729 msgid "string" msgstr "string(字串)" @@ -4105,7 +4105,7 @@ msgstr "singleton(單例)" msgid "empty" msgstr "empty(空的)" -#: ../../reference/datamodel.rst:369 ../../reference/datamodel.rst:1722 +#: ../../reference/datamodel.rst:369 ../../reference/datamodel.rst:1724 msgid "bytes" msgstr "bytes(位元組)" @@ -4127,8 +4127,8 @@ msgid "assignment" msgstr "assignment(賦值)" #: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:856 -#: ../../reference/datamodel.rst:1436 ../../reference/datamodel.rst:1618 -#: ../../reference/datamodel.rst:3112 +#: ../../reference/datamodel.rst:1438 ../../reference/datamodel.rst:1620 +#: ../../reference/datamodel.rst:3114 msgid "statement" msgstr "statement(陳述式)" @@ -4165,7 +4165,7 @@ msgid "mapping" msgstr "mapping(對映)" #: ../../reference/datamodel.rst:476 ../../reference/datamodel.rst:938 -#: ../../reference/datamodel.rst:1808 +#: ../../reference/datamodel.rst:1810 msgid "dictionary" msgstr "dictionary(字典)" @@ -4188,7 +4188,7 @@ msgid "function" msgstr "function (函式)" #: ../../reference/datamodel.rst:512 ../../reference/datamodel.rst:938 -#: ../../reference/datamodel.rst:961 ../../reference/datamodel.rst:2745 +#: ../../reference/datamodel.rst:961 ../../reference/datamodel.rst:2747 msgid "call" msgstr "call(呼叫)" @@ -4288,7 +4288,7 @@ msgstr "__name__ (方法屬性)" msgid "__module__ (method attribute)" msgstr "__module__ (方法屬性)" -#: ../../reference/datamodel.rst:743 ../../reference/datamodel.rst:1198 +#: ../../reference/datamodel.rst:743 ../../reference/datamodel.rst:1200 msgid "generator" msgstr "generator(產生器)" @@ -4296,7 +4296,7 @@ msgstr "generator(產生器)" msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:761 ../../reference/datamodel.rst:3299 +#: ../../reference/datamodel.rst:761 ../../reference/datamodel.rst:3301 msgid "coroutine" msgstr "coroutine(協程)" @@ -4341,8 +4341,8 @@ msgid "__dict__ (module attribute)" msgstr "__dict__ (模組屬性)" #: ../../reference/datamodel.rst:938 ../../reference/datamodel.rst:956 -#: ../../reference/datamodel.rst:1007 ../../reference/datamodel.rst:1601 -#: ../../reference/datamodel.rst:2475 +#: ../../reference/datamodel.rst:1007 ../../reference/datamodel.rst:1603 +#: ../../reference/datamodel.rst:2477 msgid "class" msgstr "class(類別)" @@ -4352,7 +4352,7 @@ msgid "class instance" msgstr "class instance(類別實例)" #: ../../reference/datamodel.rst:938 ../../reference/datamodel.rst:1007 -#: ../../reference/datamodel.rst:2745 +#: ../../reference/datamodel.rst:2747 msgid "instance" msgstr "instance(實例)" @@ -4528,291 +4528,291 @@ msgstr "co_freevars (程式碼物件屬性)" msgid "co_qualname (code object attribute)" msgstr "co_qualname (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1216 +#: ../../reference/datamodel.rst:1218 msgid "documentation string" msgstr "documentation string(文件字串)" -#: ../../reference/datamodel.rst:1299 +#: ../../reference/datamodel.rst:1301 msgid "frame" msgstr "frame" -#: ../../reference/datamodel.rst:1305 +#: ../../reference/datamodel.rst:1307 msgid "f_back (frame attribute)" msgstr "f_back (frame 屬性)" -#: ../../reference/datamodel.rst:1305 +#: ../../reference/datamodel.rst:1307 msgid "f_code (frame attribute)" msgstr "f_code (frame 屬性)" -#: ../../reference/datamodel.rst:1305 +#: ../../reference/datamodel.rst:1307 msgid "f_globals (frame attribute)" msgstr "f_globals (frame 屬性)" -#: ../../reference/datamodel.rst:1305 +#: ../../reference/datamodel.rst:1307 msgid "f_locals (frame attribute)" msgstr "f_locals (frame 屬性)" -#: ../../reference/datamodel.rst:1305 +#: ../../reference/datamodel.rst:1307 msgid "f_lasti (frame attribute)" msgstr "f_lasti (frame 屬性)" -#: ../../reference/datamodel.rst:1305 +#: ../../reference/datamodel.rst:1307 msgid "f_builtins (frame attribute)" msgstr "f_builtins (frame 屬性)" -#: ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:1346 msgid "f_trace (frame attribute)" msgstr "f_trace (frame 屬性)" -#: ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:1346 msgid "f_trace_lines (frame attribute)" msgstr "f_trace_lines (frame 屬性)" -#: ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:1346 msgid "f_trace_opcodes (frame attribute)" msgstr "f_trace_opcodes (frame 屬性)" -#: ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:1346 msgid "f_lineno (frame attribute)" msgstr "f_lineno (frame 屬性)" -#: ../../reference/datamodel.rst:1399 +#: ../../reference/datamodel.rst:1401 msgid "traceback" msgstr "traceback" -#: ../../reference/datamodel.rst:1399 +#: ../../reference/datamodel.rst:1401 msgid "stack" msgstr "stack(堆疊)" -#: ../../reference/datamodel.rst:1399 +#: ../../reference/datamodel.rst:1401 msgid "trace" msgstr "trace(追蹤)" -#: ../../reference/datamodel.rst:1399 +#: ../../reference/datamodel.rst:1401 msgid "exception" msgstr "exception(例外)" -#: ../../reference/datamodel.rst:1399 +#: ../../reference/datamodel.rst:1401 msgid "handler" msgstr "handler(處理器)" -#: ../../reference/datamodel.rst:1399 +#: ../../reference/datamodel.rst:1401 msgid "execution" msgstr "execution(執行)" -#: ../../reference/datamodel.rst:1399 +#: ../../reference/datamodel.rst:1401 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../reference/datamodel.rst:1399 +#: ../../reference/datamodel.rst:1401 msgid "last_traceback (in module sys)" msgstr "last_traceback (sys 模組中)" -#: ../../reference/datamodel.rst:1399 +#: ../../reference/datamodel.rst:1401 msgid "sys.exc_info" msgstr "sys.exc_info" -#: ../../reference/datamodel.rst:1399 +#: ../../reference/datamodel.rst:1401 msgid "sys.exception" msgstr "sys.exception" -#: ../../reference/datamodel.rst:1399 +#: ../../reference/datamodel.rst:1401 msgid "sys.last_traceback" msgstr "sys.last_traceback" -#: ../../reference/datamodel.rst:1436 +#: ../../reference/datamodel.rst:1438 msgid "tb_frame (traceback attribute)" msgstr "tb_frame (traceback 屬性)" -#: ../../reference/datamodel.rst:1436 +#: ../../reference/datamodel.rst:1438 msgid "tb_lineno (traceback attribute)" msgstr "tb_lineno (traceback 屬性)" -#: ../../reference/datamodel.rst:1436 +#: ../../reference/datamodel.rst:1438 msgid "tb_lasti (traceback attribute)" msgstr "tb_lasti (traceback 屬性)" -#: ../../reference/datamodel.rst:1436 +#: ../../reference/datamodel.rst:1438 msgid "try" msgstr "try" -#: ../../reference/datamodel.rst:1466 +#: ../../reference/datamodel.rst:1468 msgid "tb_next (traceback attribute)" msgstr "tb_next (traceback 屬性)" -#: ../../reference/datamodel.rst:1482 ../../reference/datamodel.rst:2823 +#: ../../reference/datamodel.rst:1484 ../../reference/datamodel.rst:2825 msgid "slice" msgstr "slice(切片)" -#: ../../reference/datamodel.rst:1488 +#: ../../reference/datamodel.rst:1490 msgid "start (slice object attribute)" msgstr "start (slice 物件屬性)" -#: ../../reference/datamodel.rst:1488 +#: ../../reference/datamodel.rst:1490 msgid "stop (slice object attribute)" msgstr "stop (slice 物件屬性)" -#: ../../reference/datamodel.rst:1488 +#: ../../reference/datamodel.rst:1490 msgid "step (slice object attribute)" msgstr "step (slice 物件屬性)" -#: ../../reference/datamodel.rst:1536 +#: ../../reference/datamodel.rst:1538 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/datamodel.rst:1536 +#: ../../reference/datamodel.rst:1538 msgid "overloading" msgstr "overloading(多載)" -#: ../../reference/datamodel.rst:1536 +#: ../../reference/datamodel.rst:1538 msgid "__getitem__() (mapping object method)" msgstr "__getitem__() (對映物件方法)" -#: ../../reference/datamodel.rst:1572 +#: ../../reference/datamodel.rst:1574 msgid "subclassing" msgstr "subclassing(子類別化)" -#: ../../reference/datamodel.rst:1572 +#: ../../reference/datamodel.rst:1574 msgid "immutable types" msgstr "immutable types(不可變型別)" -#: ../../reference/datamodel.rst:1601 +#: ../../reference/datamodel.rst:1603 msgid "constructor" msgstr "constructor(建構函式)" -#: ../../reference/datamodel.rst:1618 +#: ../../reference/datamodel.rst:1620 msgid "destructor" msgstr "destructor(解構函式)" -#: ../../reference/datamodel.rst:1618 +#: ../../reference/datamodel.rst:1620 msgid "finalizer" msgstr "finalizer(終結函式)" -#: ../../reference/datamodel.rst:1618 +#: ../../reference/datamodel.rst:1620 msgid "del" msgstr "del" -#: ../../reference/datamodel.rst:1680 +#: ../../reference/datamodel.rst:1682 msgid "repr() (built-in function)" msgstr "repr() (內建函式)" -#: ../../reference/datamodel.rst:1680 +#: ../../reference/datamodel.rst:1682 msgid "__repr__() (object method)" msgstr "__repr__() (物件方法)" -#: ../../reference/datamodel.rst:1697 +#: ../../reference/datamodel.rst:1699 msgid "__str__() (object method)" msgstr "__str__() (物件方法)" -#: ../../reference/datamodel.rst:1697 +#: ../../reference/datamodel.rst:1699 msgid "format() (built-in function)" msgstr "format() (內建函式)" -#: ../../reference/datamodel.rst:1697 +#: ../../reference/datamodel.rst:1699 msgid "print() (built-in function)" msgstr "print() (內建函式)" -#: ../../reference/datamodel.rst:1727 +#: ../../reference/datamodel.rst:1729 msgid "__format__() (object method)" msgstr "__format__() (物件方法)" -#: ../../reference/datamodel.rst:1727 +#: ../../reference/datamodel.rst:1729 msgid "conversion" msgstr "conversion" -#: ../../reference/datamodel.rst:1727 +#: ../../reference/datamodel.rst:1729 msgid "print" msgstr "print" -#: ../../reference/datamodel.rst:1766 +#: ../../reference/datamodel.rst:1768 msgid "comparisons" msgstr "comparison(比較)" -#: ../../reference/datamodel.rst:1808 +#: ../../reference/datamodel.rst:1810 msgid "hash" msgstr "hash(雜湊)" -#: ../../reference/datamodel.rst:1889 +#: ../../reference/datamodel.rst:1891 msgid "__len__() (mapping object method)" msgstr "__len__() (對映物件方法)" -#: ../../reference/datamodel.rst:1993 +#: ../../reference/datamodel.rst:1995 msgid "__getattr__ (module attribute)" msgstr "__getattr__ (模組屬性)" -#: ../../reference/datamodel.rst:1993 +#: ../../reference/datamodel.rst:1995 msgid "__dir__ (module attribute)" msgstr "__dir__ (模組屬性)" -#: ../../reference/datamodel.rst:1993 +#: ../../reference/datamodel.rst:1995 msgid "__class__ (module attribute)" msgstr "__class__ (模組屬性)" -#: ../../reference/datamodel.rst:2364 +#: ../../reference/datamodel.rst:2366 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../reference/datamodel.rst:2364 +#: ../../reference/datamodel.rst:2366 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/datamodel.rst:2364 +#: ../../reference/datamodel.rst:2366 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/datamodel.rst:2428 +#: ../../reference/datamodel.rst:2430 msgid "metaclass hint" msgstr "metaclass hint(元類別提示)" -#: ../../reference/datamodel.rst:2451 +#: ../../reference/datamodel.rst:2453 msgid "__prepare__ (metaclass method)" msgstr "__prepare__ (元類別方法)" -#: ../../reference/datamodel.rst:2475 +#: ../../reference/datamodel.rst:2477 msgid "body" msgstr "body" -#: ../../reference/datamodel.rst:2495 +#: ../../reference/datamodel.rst:2497 msgid "__class__ (method cell)" msgstr "__class__ (方法 cell)" -#: ../../reference/datamodel.rst:2495 +#: ../../reference/datamodel.rst:2497 msgid "__classcell__ (class namespace entry)" msgstr "__classcell__ (類別命名空間項目)" -#: ../../reference/datamodel.rst:2793 +#: ../../reference/datamodel.rst:2795 msgid "__bool__() (object method)" msgstr "__bool__() (物件方法)" -#: ../../reference/datamodel.rst:2951 ../../reference/datamodel.rst:2986 +#: ../../reference/datamodel.rst:2953 ../../reference/datamodel.rst:2988 msgid "divmod" msgstr "divmod" -#: ../../reference/datamodel.rst:2951 ../../reference/datamodel.rst:2986 -#: ../../reference/datamodel.rst:3000 +#: ../../reference/datamodel.rst:2953 ../../reference/datamodel.rst:2988 +#: ../../reference/datamodel.rst:3002 msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:3047 +#: ../../reference/datamodel.rst:3049 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:3057 +#: ../../reference/datamodel.rst:3059 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:3057 +#: ../../reference/datamodel.rst:3059 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:3085 +#: ../../reference/datamodel.rst:3087 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:3112 +#: ../../reference/datamodel.rst:3114 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:3112 +#: ../../reference/datamodel.rst:3114 msgid "context manager" msgstr "context manager(情境管理器)" diff --git a/using/mac.po b/using/mac.po index 9b4760d661..644ebf5398 100644 --- a/using/mac.po +++ b/using/mac.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-17 00:04+0000\n" +"POT-Creation-Date: 2024-02-14 00:03+0000\n" "PO-Revision-Date: 2022-08-31 22:26+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,26 +35,31 @@ msgid "Bob Savage " msgstr "Bob Savage " #: ../../using/mac.rst:11 +#, fuzzy msgid "" "Python on a Mac running macOS is in principle very similar to Python on any " "other Unix platform, but there are a number of additional features such as " -"the IDE and the Package Manager that are worth pointing out." +"the integrated development environment (IDE) and the Package Manager that " +"are worth pointing out." msgstr "" "Python 在 Mac 的 macOS 上執行和在其他 Unix 平台上執行的原理非常相似,\\ 但值" "得一提的是在 macOS 上有其他額外的功能,例如 IDE 與套件管理。" -#: ../../using/mac.rst:18 -msgid "Getting and Installing MacPython" +#: ../../using/mac.rst:21 +#, fuzzy +msgid "Getting and Installing Python" msgstr "取得和安裝 MacPython" -#: ../../using/mac.rst:20 +#: ../../using/mac.rst:23 +#, fuzzy msgid "" "macOS used to come with Python 2.7 pre-installed between versions 10.8 and " "`12.3 `_. You are invited to install the most " -"recent version of Python 3 from the Python website (https://www.python." -"org). A current \"universal binary\" build of Python, which runs natively " -"on the Mac's new Intel and legacy PPC CPU's, is available there." +"recent version of Python 3 from the `Python website `__. A current \"universal2 binary\" build of Python, which " +"runs natively on the Mac's new Apple Silicon and legacy Intel processors, is " +"available there." msgstr "" "macOS 自 10.8 版本開始至 `12.3 版本 `_\\ 之間預" @@ -62,42 +67,46 @@ msgstr "" "的 Python 3 版本。你可以找到建立在\"通用二進位 (universal binary)\" 上的 " "Python 建置版本,它能夠原生地運行在 Mac 新的 Intel CPU 與過去的 PPC CPU 上。" -#: ../../using/mac.rst:27 +#: ../../using/mac.rst:30 msgid "What you get after installing is a number of things:" msgstr "在安裝後你必須要做幾件事:" -#: ../../using/mac.rst:29 +#: ../../using/mac.rst:32 +#, fuzzy msgid "" -"A :file:`Python 3.12` folder in your :file:`Applications` folder. In here " -"you find IDLE, the development environment that is a standard part of " -"official Python distributions; and PythonLauncher, which handles double-" -"clicking Python scripts from the Finder." +"A |python_version_literal| folder in your :file:`Applications` folder. In " +"here you find IDLE, the development environment that is a standard part of " +"official Python distributions; and :program:`Python Launcher`, which handles " +"double-clicking Python scripts from the Finder." msgstr "" "會有一個 :file:`Python 3.12` 資料夾在你的 :file:`Applications` 資料夾中。在這" "裡你可以找到 IDLE,它是作為官方 Python 發行版標準組成的開發環境;以及 " "PythonLauncher,它負責處理在 Finder 中雙擊 Python 腳本的操作。" -#: ../../using/mac.rst:34 +#: ../../using/mac.rst:37 +#, fuzzy msgid "" "A framework :file:`/Library/Frameworks/Python.framework`, which includes the " "Python executable and libraries. The installer adds this location to your " -"shell path. To uninstall MacPython, you can simply remove these three " -"things. A symlink to the Python executable is placed in /usr/local/bin/." +"shell path. To uninstall Python, you can remove these three things. A " +"symlink to the Python executable is placed in :file:`/usr/local/bin/`." msgstr "" ":file:`/Library/Frameworks/Python.framework` 框架,包括 Python 可執行檔案 " "(executable) 和函式庫 (library)。安裝程式將此位置新增到 shell 路徑。要解除安" "裝 MacPython ,你可以簡單地移除這三個專案。Python 可執行檔案的符號連結 " "(symlink) 則放在 /usr/local/bin/ 中。" -#: ../../using/mac.rst:39 +#: ../../using/mac.rst:44 +#, fuzzy msgid "" -"The Apple-provided build of Python is installed in :file:`/System/Library/" -"Frameworks/Python.framework` and :file:`/usr/bin/python`, respectively. You " -"should never modify or delete these, as they are Apple-controlled and are " -"used by Apple- or third-party software. Remember that if you choose to " -"install a newer Python version from python.org, you will have two different " -"but functional Python installations on your computer, so it will be " -"important that your paths and usages are consistent with what you want to do." +"On macOS 10.8-12.3, the Apple-provided build of Python is installed in :file:" +"`/System/Library/Frameworks/Python.framework` and :file:`/usr/bin/python`, " +"respectively. You should never modify or delete these, as they are Apple-" +"controlled and are used by Apple- or third-party software. Remember that if " +"you choose to install a newer Python version from python.org, you will have " +"two different but functional Python installations on your computer, so it " +"will be important that your paths and usages are consistent with what you " +"want to do." msgstr "" "Apple 提供的 Python 建置版本分別安裝在 :file:`/System/Library/Frameworks/" "Python.framework` 和 :file:`/usr/bin/python` 中。你不應該去修改或刪除這些內" @@ -105,16 +114,17 @@ msgstr "" "python.org 安裝較新的 Python 版本,那麼你的計算機上將安裝兩個不同但都可運作" "的 Python,因此你的路徑和用法與你想要執行的操作一致非常重要。" -#: ../../using/mac.rst:47 +#: ../../using/mac.rst:52 +#, fuzzy msgid "" -"IDLE includes a help menu that allows you to access Python documentation. If " +"IDLE includes a Help menu that allows you to access Python documentation. If " "you are completely new to Python you should start reading the tutorial " "introduction in that document." msgstr "" "IDLE 包含一個幫助選單,讓你可以參閱 Python 文件。如果你是 Python 的新手,你應" "該開始閱讀該文件中的教學介紹。" -#: ../../using/mac.rst:51 +#: ../../using/mac.rst:56 msgid "" "If you are familiar with Python on other Unix platforms you should read the " "section on running Python scripts from the Unix shell." @@ -122,30 +132,31 @@ msgstr "" "如果你熟悉其他 Unix 平臺上的 Python,那麼你應該閱讀有關從 Unix shell 執行 " "Python 腳本的部分。" -#: ../../using/mac.rst:56 +#: ../../using/mac.rst:61 msgid "How to run a Python script" msgstr "如何執行 Python 腳本" -#: ../../using/mac.rst:58 +#: ../../using/mac.rst:63 +#, fuzzy msgid "" "Your best way to get started with Python on macOS is through the IDLE " -"integrated development environment, see section :ref:`ide` and use the Help " +"integrated development environment; see section :ref:`ide` and use the Help " "menu when the IDE is running." msgstr "" "在 macOS 上開始使用 Python 的最佳方法是透過 IDLE 整合開發環境,參見\\ :ref:" "`ide` 部分,並在 IDE 執行時使用幫助選單。" -#: ../../using/mac.rst:62 +#: ../../using/mac.rst:67 +#, fuzzy msgid "" "If you want to run Python scripts from the Terminal window command line or " "from the Finder you first need an editor to create your script. macOS comes " -"with a number of standard Unix command line editors, :program:`vim` and :" -"program:`emacs` among them. If you want a more Mac-like editor, :program:" -"`BBEdit` or :program:`TextWrangler` from Bare Bones Software (see http://www." -"barebones.com/products/bbedit/index.html) are good choices, as is :program:" -"`TextMate` (see https://macromates.com/). Other editors include :program:" -"`Gvim` (https://macvim.org/macvim/) and :program:`Aquamacs` (http://aquamacs." -"org/)." +"with a number of standard Unix command line editors, :program:`vim` :program:" +"`nano` among them. If you want a more Mac-like editor, :program:`BBEdit` " +"from Bare Bones Software (see https://www.barebones.com/products/bbedit/" +"index.html) are good choices, as is :program:`TextMate` (see https://" +"macromates.com). Other editors include :program:`MacVim` (https://macvim." +"org) and :program:`Aquamacs` (https://aquamacs.org)." msgstr "" "如果要從終端機視窗命令列或 Finder 執行 Python 腳本,首先需要一個編輯器來建立" "腳本。macOS 附帶了許多標準的 Unix 命令列編輯器,如 :program:`vim` 和 :" @@ -155,7 +166,7 @@ msgstr "" "(參見 https://macromates.com/)也是個選擇。其他編輯器包括 :program:`Gvim` " "(https://macvim.org/macvim/) 和 :program:`Aquamacs` (https://aquamacs.org/)。" -#: ../../using/mac.rst:72 +#: ../../using/mac.rst:77 msgid "" "To run your script from the Terminal window you must make sure that :file:`/" "usr/local/bin` is in your shell search path." @@ -163,20 +174,22 @@ msgstr "" "要從終端機視窗執行腳本,你必須確保 :file:`/usr/local/bin` 位於 shell 搜尋路徑" "中。" -#: ../../using/mac.rst:75 +#: ../../using/mac.rst:80 msgid "To run your script from the Finder you have two options:" msgstr "從 Finder 執行你的腳本時,你有兩個選項:" -#: ../../using/mac.rst:77 -msgid "Drag it to :program:`PythonLauncher`" +#: ../../using/mac.rst:82 +#, fuzzy +msgid "Drag it to :program:`Python Launcher`." msgstr "把它拖曳到 :program:`PythonLauncher`" -#: ../../using/mac.rst:79 +#: ../../using/mac.rst:84 +#, fuzzy msgid "" -"Select :program:`PythonLauncher` as the default application to open your " -"script (or any .py script) through the finder Info window and double-click " -"it. :program:`PythonLauncher` has various preferences to control how your " -"script is launched. Option-dragging allows you to change these for one " +"Select :program:`Python Launcher` as the default application to open your " +"script (or any ``.py`` script) through the finder Info window and double-" +"click it. :program:`Python Launcher` has various preferences to control how " +"your script is launched. Option-dragging allows you to change these for one " "invocation, or use its Preferences menu to change things globally." msgstr "" "透過 finder Info 視窗選擇 :program:`PythonLauncher` 作為開啟腳本(或任何 .py " @@ -184,11 +197,11 @@ msgstr "" "制腳本啟動方式的選項。拖曳選項可以讓你一次更改多個選項,或使用其偏好設定選單" "以全域性地更改內容。" -#: ../../using/mac.rst:89 +#: ../../using/mac.rst:94 msgid "Running scripts with a GUI" msgstr "透過 GUI 執行腳本" -#: ../../using/mac.rst:91 +#: ../../using/mac.rst:96 msgid "" "With older versions of Python, there is one macOS quirk that you need to be " "aware of: programs that talk to the Aqua window manager (in other words, " @@ -199,23 +212,25 @@ msgstr "" "的程式(換而言之,任何具有 GUI(圖形化使用者介面)的程式)需要以特殊方式執" "行。使用 :program:`pythonw` 而不是 :program:`python` 來啟動這樣的腳本。" -#: ../../using/mac.rst:96 +#: ../../using/mac.rst:101 msgid "" "With Python 3.9, you can use either :program:`python` or :program:`pythonw`." msgstr "" "Python 3.9 上,你可以使用 :program:`python` 或者 :program:`pythonw`\\ 。" -#: ../../using/mac.rst:100 +#: ../../using/mac.rst:105 msgid "Configuration" msgstr "設定" -#: ../../using/mac.rst:102 +#: ../../using/mac.rst:107 +#, fuzzy msgid "" "Python on macOS honors all standard Unix environment variables such as :" "envvar:`PYTHONPATH`, but setting these variables for programs started from " "the Finder is non-standard as the Finder does not read your :file:`.profile` " "or :file:`.cshrc` at startup. You need to create a file :file:`~/.MacOSX/" -"environment.plist`. See Apple's Technical Document QA1067 for details." +"environment.plist`. See Apple's `Technical Q&A QA1067 `__ for details." msgstr "" "macOS 上的 Python 遵循所有標準的 Unix 環境變數,例如 :envvar:" "`PYTHONPATH`\\ ,但是為 Finder 啟動的程式設定這些變數並非是標準做法,因為 " @@ -223,46 +238,49 @@ msgstr "" "一個檔案 :file:`~/.MacOSX/environment.plist`\\ 。相關資訊請參閱 Apple 的技術" "文件 QA1067。" -#: ../../using/mac.rst:109 +#: ../../using/mac.rst:115 +#, fuzzy msgid "" -"For more information on installation Python packages in MacPython, see " -"section :ref:`mac-package-manager`." +"For more information on installation Python packages, see section :ref:`mac-" +"package-manager`." msgstr "" "更多關於在 MacPython 中安裝 Python 套件的資訊,參閱 :ref:`mac-package-" "manager` 部分。" -#: ../../using/mac.rst:116 +#: ../../using/mac.rst:122 msgid "The IDE" msgstr "整合化開發工具 (IDE)" -#: ../../using/mac.rst:118 +#: ../../using/mac.rst:124 +#, fuzzy msgid "" -"MacPython ships with the standard IDLE development environment. A good " -"introduction to using IDLE can be found at http://www.hashcollision.org/hkn/" +"Python ships with the standard IDLE development environment. A good " +"introduction to using IDLE can be found at https://www.hashcollision.org/hkn/" "python/idle_intro/index.html." msgstr "" "MacPython 附帶標準的 IDLE 開發環境。有關使用 IDLE 的詳細介紹,請見 http://" "www.hashcollision.org/hkn/python/idle_intro/index.html\\ 。" -#: ../../using/mac.rst:126 +#: ../../using/mac.rst:132 msgid "Installing Additional Python Packages" msgstr "安裝額外的 Python 套件" -#: ../../using/mac.rst:128 +#: ../../using/mac.rst:134 msgid "This section has moved to the `Python Packaging User Guide`_." msgstr "這個章節已經被移動到 `Python Packaging User Guide`_。" -#: ../../using/mac.rst:134 -msgid "GUI Programming on the Mac" +#: ../../using/mac.rst:142 +#, fuzzy +msgid "GUI Programming" msgstr "於 Mac 上開發 GUI 程式" -#: ../../using/mac.rst:136 +#: ../../using/mac.rst:144 msgid "" "There are several options for building GUI applications on the Mac with " "Python." msgstr "於 Mac 上使用 Python 來建立 GUI 應用程式有許多選項。" -#: ../../using/mac.rst:138 +#: ../../using/mac.rst:146 msgid "" "*PyObjC* is a Python binding to Apple's Objective-C/Cocoa framework, which " "is the foundation of most modern Mac development. Information on PyObjC is " @@ -272,7 +290,7 @@ msgstr "" "多數現代 Mac 開發的基礎。有關 PyObjC 的資訊,請見 https://pypi.org/project/" "pyobjc/。" -#: ../../using/mac.rst:142 +#: ../../using/mac.rst:150 msgid "" "The standard Python GUI toolkit is :mod:`tkinter`, based on the cross-" "platform Tk toolkit (https://www.tcl.tk). An Aqua-native version of Tk is " @@ -283,7 +301,7 @@ msgstr "" "(https://www.tcl.tk)。Apple 的 macOS 包含了 Aqua 原生版本的 Tk,最新版本可以" "從 https://www.activestate.com 下載和安裝;它也可以從原始碼開始建置。" -#: ../../using/mac.rst:147 +#: ../../using/mac.rst:155 msgid "" "*wxPython* is another popular cross-platform GUI toolkit that runs natively " "on macOS. Packages and documentation are available from https://www.wxpython." @@ -292,7 +310,7 @@ msgstr "" "*wxPython* 是另一種流行的跨平臺 GUI 工具套件,可在 macOS 上本機執行。套件和文" "件可從 https://www.wxpython.org 獲得。" -#: ../../using/mac.rst:150 +#: ../../using/mac.rst:158 msgid "" "*PyQt* is another popular cross-platform GUI toolkit that runs natively on " "macOS. More information can be found at https://riverbankcomputing.com/" @@ -301,38 +319,47 @@ msgstr "" "*PyQt* 是另一種流行的跨平臺 GUI 工具套件,可在原生 macOS 上執行。更多資訊可" "在 https://riverbankcomputing.com/software/pyqt/intro 上找到。" -#: ../../using/mac.rst:156 -msgid "Distributing Python Applications on the Mac" +#: ../../using/mac.rst:162 +msgid "" +"*PySide* is another cross-platform Qt-based toolkit. More information at " +"https://www.qt.io/qt-for-python." +msgstr "" + +#: ../../using/mac.rst:169 +#, fuzzy +msgid "Distributing Python Applications" msgstr "於 Mac 上發行 Python 應用程式" -#: ../../using/mac.rst:158 +#: ../../using/mac.rst:171 +#, fuzzy msgid "" "The standard tool for deploying standalone Python applications on the Mac " -"is :program:`py2app`. More information on installing and using py2app can be " -"found at https://pypi.org/project/py2app/." +"is :program:`py2app`. More information on installing and using :program:" +"`py2app` can be found at https://pypi.org/project/py2app/." msgstr "" "在 Mac 上部署獨立 Python 應用程式的標準工具是 :program:`py2app`\\ 。有關安裝" "和使用 py2app 的更多資訊,請參考 https://pypi.org/project/py2app/\\ 。" -#: ../../using/mac.rst:164 +#: ../../using/mac.rst:177 msgid "Other Resources" msgstr "其他資源" -#: ../../using/mac.rst:166 +#: ../../using/mac.rst:179 +#, fuzzy msgid "" -"The MacPython mailing list is an excellent support resource for Python users " -"and developers on the Mac:" +"The Pythonmac-SIG mailing list is an excellent support resource for Python " +"users and developers on the Mac:" msgstr "" "MacPython 郵件清單對於 Mac 上的 Python 使用者和開發者是一個極佳的支援資源:" -#: ../../using/mac.rst:169 +#: ../../using/mac.rst:182 msgid "https://www.python.org/community/sigs/current/pythonmac-sig/" msgstr "https://www.python.org/community/sigs/current/pythonmac-sig/" -#: ../../using/mac.rst:171 +#: ../../using/mac.rst:184 msgid "Another useful resource is the MacPython wiki:" msgstr "另一個好用資源是 MacPython wiki:" -#: ../../using/mac.rst:173 +#: ../../using/mac.rst:186 msgid "https://wiki.python.org/moin/MacPython" msgstr "https://wiki.python.org/moin/MacPython" From f1f88f47a8d4ed4866e6e993366d1668aa3229c1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 15 Feb 2024 00:04:58 +0000 Subject: [PATCH 08/33] sync with cpython 14930acf --- c-api/unicode.po | 239 +++++++++++++++++++++++--------------------- library/datetime.po | 12 ++- library/dbm.po | 194 +++++++++++++++++------------------ 3 files changed, 227 insertions(+), 218 deletions(-) diff --git a/c-api/unicode.po b/c-api/unicode.po index a045f75d2a..b46ad9a6e3 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-06 00:03+0000\n" +"POT-Creation-Date: 2024-02-15 00:03+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-" @@ -1047,15 +1047,26 @@ 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. 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 null characters, which " -"would cause the string to be truncated when used with most C functions." +"`wchar_t` characters copied or ``-1`` in case of an error." msgstr "" -#: ../../c-api/unicode.rst:874 +#: ../../c-api/unicode.rst:866 +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:869 +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 " +"null characters, which would cause the string to be truncated when used with " +"most C functions." +msgstr "" + +#: ../../c-api/unicode.rst:879 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 " @@ -1066,37 +1077,37 @@ msgid "" "`wchar_t*` string contains null characters a :exc:`ValueError` is raised." msgstr "" -#: ../../c-api/unicode.rst:882 +#: ../../c-api/unicode.rst:887 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:889 +#: ../../c-api/unicode.rst:894 msgid "" "Raises a :exc:`ValueError` if *size* is ``NULL`` and the :c:expr:`wchar_t*` " "string contains null characters." msgstr "" -#: ../../c-api/unicode.rst:897 +#: ../../c-api/unicode.rst:902 msgid "Built-in Codecs" msgstr "" -#: ../../c-api/unicode.rst:899 +#: ../../c-api/unicode.rst:904 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:902 +#: ../../c-api/unicode.rst:907 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:906 +#: ../../c-api/unicode.rst:911 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 " @@ -1104,28 +1115,28 @@ msgid "" "handler` internally." msgstr "" -#: ../../c-api/unicode.rst:911 +#: ../../c-api/unicode.rst:916 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:915 +#: ../../c-api/unicode.rst:920 msgid "" "The codecs all use a similar interface. Only deviations from the following " "generic ones are documented for simplicity." msgstr "" -#: ../../c-api/unicode.rst:920 +#: ../../c-api/unicode.rst:925 msgid "Generic Codecs" msgstr "" -#: ../../c-api/unicode.rst:922 +#: ../../c-api/unicode.rst:927 msgid "These are the generic codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:928 +#: ../../c-api/unicode.rst:933 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 " @@ -1134,7 +1145,7 @@ msgid "" "was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:938 +#: ../../c-api/unicode.rst:943 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 " @@ -1143,21 +1154,21 @@ msgid "" "was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:946 +#: ../../c-api/unicode.rst:951 msgid "UTF-8 Codecs" msgstr "UTF-8 編解碼器" -#: ../../c-api/unicode.rst:948 +#: ../../c-api/unicode.rst:953 msgid "These are the UTF-8 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:953 +#: ../../c-api/unicode.rst:958 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:960 +#: ../../c-api/unicode.rst:965 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF8`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-8 byte sequences will " @@ -1165,14 +1176,14 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:968 +#: ../../c-api/unicode.rst:973 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:975 +#: ../../c-api/unicode.rst:980 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* " @@ -1181,13 +1192,13 @@ msgid "" "regardless of whether there are any other null code points." msgstr "" -#: ../../c-api/unicode.rst:981 +#: ../../c-api/unicode.rst:986 msgid "" "In the case of an error, ``NULL`` is returned with an exception set and no " "*size* is stored." msgstr "" -#: ../../c-api/unicode.rst:984 +#: ../../c-api/unicode.rst:989 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 " @@ -1196,40 +1207,40 @@ msgid "" "collected." msgstr "" -#: ../../c-api/unicode.rst:991 ../../c-api/unicode.rst:1004 +#: ../../c-api/unicode.rst:996 ../../c-api/unicode.rst:1009 msgid "The return type is now ``const char *`` rather of ``char *``." msgstr "" -#: ../../c-api/unicode.rst:994 +#: ../../c-api/unicode.rst:999 msgid "This function is a part of the :ref:`limited API `." msgstr "" -#: ../../c-api/unicode.rst:1000 +#: ../../c-api/unicode.rst:1005 msgid "As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size." msgstr "" -#: ../../c-api/unicode.rst:1009 +#: ../../c-api/unicode.rst:1014 msgid "UTF-32 Codecs" msgstr "UTF-32 編解碼器" -#: ../../c-api/unicode.rst:1011 +#: ../../c-api/unicode.rst:1016 msgid "These are the UTF-32 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1017 +#: ../../c-api/unicode.rst:1022 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:1021 ../../c-api/unicode.rst:1071 +#: ../../c-api/unicode.rst:1026 ../../c-api/unicode.rst:1076 msgid "" "If *byteorder* is non-``NULL``, the decoder starts decoding using the given " "byte order::" msgstr "" -#: ../../c-api/unicode.rst:1028 +#: ../../c-api/unicode.rst:1033 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 " @@ -1237,21 +1248,21 @@ msgid "" "``-1`` or ``1``, any byte order mark is copied to the output." msgstr "" -#: ../../c-api/unicode.rst:1033 +#: ../../c-api/unicode.rst:1038 msgid "" "After completion, *\\*byteorder* is set to the current byte order at the end " "of input data." msgstr "" -#: ../../c-api/unicode.rst:1036 ../../c-api/unicode.rst:1087 +#: ../../c-api/unicode.rst:1041 ../../c-api/unicode.rst:1092 msgid "If *byteorder* is ``NULL``, the codec starts in native order mode." msgstr "" -#: ../../c-api/unicode.rst:1038 ../../c-api/unicode.rst:1089 +#: ../../c-api/unicode.rst:1043 ../../c-api/unicode.rst:1094 msgid "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1044 +#: ../../c-api/unicode.rst:1049 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF32`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF32Stateful` will not " @@ -1260,29 +1271,29 @@ msgid "" "number of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1053 +#: ../../c-api/unicode.rst:1058 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:1059 +#: ../../c-api/unicode.rst:1064 msgid "UTF-16 Codecs" msgstr "UTF-16 編解碼器" -#: ../../c-api/unicode.rst:1061 +#: ../../c-api/unicode.rst:1066 msgid "These are the UTF-16 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1067 +#: ../../c-api/unicode.rst:1072 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:1078 +#: ../../c-api/unicode.rst:1083 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 " @@ -1291,13 +1302,13 @@ msgid "" "result in either a ``\\ufeff`` or a ``\\ufffe`` character)." msgstr "" -#: ../../c-api/unicode.rst:1084 +#: ../../c-api/unicode.rst:1089 msgid "" "After completion, ``*byteorder`` is set to the current byte order at the end " "of input data." msgstr "" -#: ../../c-api/unicode.rst:1095 +#: ../../c-api/unicode.rst:1100 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF16`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF16Stateful` will not " @@ -1307,28 +1318,28 @@ msgid "" "*consumed*." msgstr "" -#: ../../c-api/unicode.rst:1104 +#: ../../c-api/unicode.rst:1109 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:1110 +#: ../../c-api/unicode.rst:1115 msgid "UTF-7 Codecs" msgstr "UTF-7 編解碼器" -#: ../../c-api/unicode.rst:1112 +#: ../../c-api/unicode.rst:1117 msgid "These are the UTF-7 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1117 +#: ../../c-api/unicode.rst:1122 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:1124 +#: ../../c-api/unicode.rst:1129 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF7`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-7 base-64 sections will " @@ -1336,101 +1347,101 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1131 +#: ../../c-api/unicode.rst:1136 msgid "Unicode-Escape Codecs" msgstr "" -#: ../../c-api/unicode.rst:1133 +#: ../../c-api/unicode.rst:1138 msgid "These are the \"Unicode Escape\" codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1139 +#: ../../c-api/unicode.rst:1144 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:1145 +#: ../../c-api/unicode.rst:1150 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:1151 +#: ../../c-api/unicode.rst:1156 msgid "Raw-Unicode-Escape Codecs" msgstr "" -#: ../../c-api/unicode.rst:1153 +#: ../../c-api/unicode.rst:1158 msgid "These are the \"Raw Unicode Escape\" codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1159 +#: ../../c-api/unicode.rst:1164 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:1165 +#: ../../c-api/unicode.rst:1170 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:1171 +#: ../../c-api/unicode.rst:1176 msgid "Latin-1 Codecs" msgstr "Latin-1 編解碼器" -#: ../../c-api/unicode.rst:1173 +#: ../../c-api/unicode.rst:1178 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:1179 +#: ../../c-api/unicode.rst:1184 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:1185 +#: ../../c-api/unicode.rst:1190 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:1191 +#: ../../c-api/unicode.rst:1196 msgid "ASCII Codecs" msgstr "ASCII 編解碼器" -#: ../../c-api/unicode.rst:1193 +#: ../../c-api/unicode.rst:1198 msgid "" "These are the ASCII codec APIs. Only 7-bit ASCII data is accepted. All " "other codes generate errors." msgstr "" -#: ../../c-api/unicode.rst:1199 +#: ../../c-api/unicode.rst:1204 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:1205 +#: ../../c-api/unicode.rst:1210 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:1211 +#: ../../c-api/unicode.rst:1216 msgid "Character Map Codecs" msgstr "" -#: ../../c-api/unicode.rst:1213 +#: ../../c-api/unicode.rst:1218 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 " @@ -1440,18 +1451,18 @@ msgid "" "sequences work well." msgstr "" -#: ../../c-api/unicode.rst:1219 +#: ../../c-api/unicode.rst:1224 msgid "These are the mapping codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1224 +#: ../../c-api/unicode.rst:1229 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:1228 +#: ../../c-api/unicode.rst:1233 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 " @@ -1461,14 +1472,14 @@ msgid "" "treated as undefined mappings and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1239 +#: ../../c-api/unicode.rst:1244 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:1243 +#: ../../c-api/unicode.rst:1248 msgid "" "The *mapping* object must map Unicode ordinal integers to bytes objects, " "integers in the range from 0 to 255 or ``None``. Unmapped character " @@ -1476,41 +1487,41 @@ msgid "" "``None`` are treated as \"undefined mapping\" and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1249 +#: ../../c-api/unicode.rst:1254 msgid "The following codec API is special in that maps Unicode to Unicode." msgstr "" -#: ../../c-api/unicode.rst:1253 +#: ../../c-api/unicode.rst:1258 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:1257 +#: ../../c-api/unicode.rst:1262 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:1260 +#: ../../c-api/unicode.rst:1265 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:1264 +#: ../../c-api/unicode.rst:1269 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:1269 +#: ../../c-api/unicode.rst:1274 msgid "MBCS codecs for Windows" msgstr "" -#: ../../c-api/unicode.rst:1271 +#: ../../c-api/unicode.rst:1276 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 " @@ -1518,13 +1529,13 @@ msgid "" "is defined by the user settings on the machine running the codec." msgstr "" -#: ../../c-api/unicode.rst:1278 +#: ../../c-api/unicode.rst:1283 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:1285 +#: ../../c-api/unicode.rst:1290 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeMBCS`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeMBCSStateful` will not " @@ -1532,44 +1543,44 @@ msgid "" "will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1293 +#: ../../c-api/unicode.rst:1298 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:1300 +#: ../../c-api/unicode.rst:1305 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." msgstr "" -#: ../../c-api/unicode.rst:1308 +#: ../../c-api/unicode.rst:1313 msgid "Methods & Slots" msgstr "" -#: ../../c-api/unicode.rst:1314 +#: ../../c-api/unicode.rst:1319 msgid "Methods and Slot Functions" msgstr "" -#: ../../c-api/unicode.rst:1316 +#: ../../c-api/unicode.rst:1321 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:1320 +#: ../../c-api/unicode.rst:1325 msgid "They all return ``NULL`` or ``-1`` if an exception occurs." msgstr "" -#: ../../c-api/unicode.rst:1325 +#: ../../c-api/unicode.rst:1330 msgid "Concat two strings giving a new Unicode string." msgstr "" -#: ../../c-api/unicode.rst:1330 +#: ../../c-api/unicode.rst:1335 msgid "" "Split a string giving a list of Unicode strings. If *sep* is ``NULL``, " "splitting will be done at all whitespace substrings. Otherwise, splits " @@ -1578,27 +1589,27 @@ msgid "" "list." msgstr "" -#: ../../c-api/unicode.rst:1338 +#: ../../c-api/unicode.rst:1343 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:1345 +#: ../../c-api/unicode.rst:1350 msgid "" "Join a sequence of strings using the given *separator* and return the " "resulting Unicode string." msgstr "" -#: ../../c-api/unicode.rst:1352 +#: ../../c-api/unicode.rst:1357 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:1360 +#: ../../c-api/unicode.rst:1365 msgid "" "Return the first position of *substr* in ``unicode[start:end]`` using the " "given *direction* (*direction* == ``1`` means to do a forward search, " @@ -1607,7 +1618,7 @@ msgid "" "``-2`` indicates that an error occurred and an exception has been set." msgstr "" -#: ../../c-api/unicode.rst:1370 +#: ../../c-api/unicode.rst:1375 msgid "" "Return the first position of the character *ch* in ``unicode[start:end]`` " "using the given *direction* (*direction* == ``1`` means to do a forward " @@ -1617,37 +1628,37 @@ msgid "" "set." msgstr "" -#: ../../c-api/unicode.rst:1378 +#: ../../c-api/unicode.rst:1383 msgid "" "*start* and *end* are now adjusted to behave like ``unicode[start:end]``." msgstr "" -#: ../../c-api/unicode.rst:1385 +#: ../../c-api/unicode.rst:1390 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:1392 +#: ../../c-api/unicode.rst:1397 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:1399 +#: ../../c-api/unicode.rst:1404 msgid "" "Compare two strings and return ``-1``, ``0``, ``1`` for less than, equal, " "and greater than, respectively." msgstr "" -#: ../../c-api/unicode.rst:1402 +#: ../../c-api/unicode.rst:1407 msgid "" "This function returns ``-1`` upon failure, so one should call :c:func:" "`PyErr_Occurred` to check for errors." msgstr "" -#: ../../c-api/unicode.rst:1408 +#: ../../c-api/unicode.rst:1413 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 " @@ -1655,51 +1666,51 @@ msgid "" "string as ISO-8859-1 if it contains non-ASCII characters." msgstr "" -#: ../../c-api/unicode.rst:1413 +#: ../../c-api/unicode.rst:1418 msgid "This function does not raise exceptions." msgstr "" -#: ../../c-api/unicode.rst:1418 +#: ../../c-api/unicode.rst:1423 msgid "Rich compare two Unicode strings and return one of the following:" msgstr "" -#: ../../c-api/unicode.rst:1420 +#: ../../c-api/unicode.rst:1425 msgid "``NULL`` in case an exception was raised" msgstr "" -#: ../../c-api/unicode.rst:1421 +#: ../../c-api/unicode.rst:1426 msgid ":c:data:`Py_True` or :c:data:`Py_False` for successful comparisons" msgstr "" -#: ../../c-api/unicode.rst:1422 +#: ../../c-api/unicode.rst:1427 msgid ":c:data:`Py_NotImplemented` in case the type combination is unknown" msgstr "" -#: ../../c-api/unicode.rst:1424 +#: ../../c-api/unicode.rst:1429 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`." msgstr "" -#: ../../c-api/unicode.rst:1430 +#: ../../c-api/unicode.rst:1435 msgid "" "Return a new string object from *format* and *args*; this is analogous to " "``format % args``." msgstr "" -#: ../../c-api/unicode.rst:1436 +#: ../../c-api/unicode.rst:1441 msgid "" "Check whether *substr* is contained in *unicode* and return true or false " "accordingly." msgstr "" -#: ../../c-api/unicode.rst:1439 +#: ../../c-api/unicode.rst:1444 msgid "" "*substr* has to coerce to a one element Unicode string. ``-1`` is returned " "if there was an error." msgstr "" -#: ../../c-api/unicode.rst:1445 +#: ../../c-api/unicode.rst:1450 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. " @@ -1713,7 +1724,7 @@ msgid "" "owned it before the call.)" msgstr "" -#: ../../c-api/unicode.rst:1458 +#: ../../c-api/unicode.rst:1463 msgid "" "A combination of :c:func:`PyUnicode_FromString` and :c:func:" "`PyUnicode_InternInPlace`, returning either a new Unicode string object that " diff --git a/library/datetime.po b/library/datetime.po index 04ae62f5a1..d931eaf751 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-03 00:03+0000\n" +"POT-Creation-Date: 2024-02-15 00:03+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-" @@ -795,7 +795,7 @@ msgid "Ordinal dates are not currently supported (``YYYY-OOO``)." msgstr "" #: ../../library/datetime.rst:524 ../../library/datetime.rst:1011 -#: ../../library/datetime.rst:1446 ../../library/datetime.rst:1788 +#: ../../library/datetime.rst:1446 msgid "Examples::" msgstr "" "範例:\n" @@ -2043,6 +2043,14 @@ msgid "" "truncated)." msgstr "" +#: ../../library/datetime.rst:1788 +#, fuzzy +msgid "Examples:" +msgstr "" +"範例:\n" +"\n" +"::" + #: ../../library/datetime.rst:1812 msgid "" "Previously, this method only supported formats that could be emitted by :" diff --git a/library/dbm.po b/library/dbm.po index 6dfd960489..cf988388da 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-01 00:03+0000\n" +"POT-Creation-Date: 2024-02-15 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -68,11 +68,11 @@ msgid "" "``'dbm.gnu'``" msgstr "" -#: ../../library/dbm.rst:37 ../../library/dbm.rst:207 ../../library/dbm.rst:392 +#: ../../library/dbm.rst:37 ../../library/dbm.rst:202 ../../library/dbm.rst:386 msgid "*filename* accepts a :term:`path-like object`." msgstr "" -#: ../../library/dbm.rst:65 +#: ../../library/dbm.rst:61 msgid "Open a database and return the corresponding database object." msgstr "" @@ -80,7 +80,7 @@ msgstr "" msgid "Parameters" msgstr "參數" -#: ../../library/dbm.rst:67 +#: ../../library/dbm.rst:63 msgid "" "The database file to open. If the database file already exists, the :func:" "`whichdb` function is used to determine its type and the appropriate module " @@ -88,18 +88,18 @@ msgid "" "imported is used." msgstr "" -#: ../../library/dbm.rst:68 ../../library/dbm.rst:179 +#: ../../library/dbm.rst:64 ../../library/dbm.rst:174 msgid "The database file to open." msgstr "要打開的資料庫檔案" -#: ../../library/dbm.rst:70 +#: ../../library/dbm.rst:66 msgid "" "If the database file already exists, the :func:`whichdb` function is used to " "determine its type and the appropriate module is used; if it does not exist, " "the first submodule listed above that can be imported is used." msgstr "" -#: ../../library/dbm.rst:75 ../../library/dbm.rst:302 +#: ../../library/dbm.rst:71 ../../library/dbm.rst:297 msgid "" "* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " "``'n'``: |flag_n|" @@ -107,34 +107,34 @@ msgstr "" "* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " "``'n'``: |flag_n|" -#: ../../library/dbm.rst:76 ../../library/dbm.rst:184 ../../library/dbm.rst:303 +#: ../../library/dbm.rst:72 ../../library/dbm.rst:179 ../../library/dbm.rst:298 msgid "``'r'`` (default): |flag_r|" msgstr "``'r'`` (default): |flag_r|" -#: ../../library/dbm.rst:77 ../../library/dbm.rst:185 ../../library/dbm.rst:304 -#: ../../library/dbm.rst:373 +#: ../../library/dbm.rst:73 ../../library/dbm.rst:180 ../../library/dbm.rst:299 +#: ../../library/dbm.rst:367 msgid "``'w'``: |flag_w|" msgstr "``'w'``: |flag_w|" -#: ../../library/dbm.rst:78 ../../library/dbm.rst:186 ../../library/dbm.rst:305 +#: ../../library/dbm.rst:74 ../../library/dbm.rst:181 ../../library/dbm.rst:300 msgid "``'c'``: |flag_c|" msgstr "``'c'``: |flag_c|" -#: ../../library/dbm.rst:79 ../../library/dbm.rst:187 ../../library/dbm.rst:306 -#: ../../library/dbm.rst:375 +#: ../../library/dbm.rst:75 ../../library/dbm.rst:182 ../../library/dbm.rst:301 +#: ../../library/dbm.rst:369 msgid "``'n'``: |flag_n|" msgstr "``'n'``: |flag_n|" -#: ../../library/dbm.rst:81 ../../library/dbm.rst:201 ../../library/dbm.rst:308 -#: ../../library/dbm.rst:377 +#: ../../library/dbm.rst:77 ../../library/dbm.rst:196 ../../library/dbm.rst:303 +#: ../../library/dbm.rst:371 msgid "|mode_param_doc|" msgstr "|mode_param_doc|" -#: ../../library/dbm.rst:84 +#: ../../library/dbm.rst:80 msgid "*file* accepts a :term:`path-like object`." msgstr "*file* 接受一個\\ :term:`類路徑物件 `。" -#: ../../library/dbm.rst:87 +#: ../../library/dbm.rst:83 msgid "" "The object returned by :func:`~dbm.open` supports the same basic " "functionality as a :class:`dict`; keys and their corresponding values can be " @@ -143,93 +143,88 @@ msgid "" "setdefault` methods." msgstr "" -#: ../../library/dbm.rst:92 +#: ../../library/dbm.rst:88 msgid "" "Key and values are always stored as :class:`bytes`. This means that when " "strings are used they are implicitly converted to the default encoding " "before being stored." msgstr "" -#: ../../library/dbm.rst:96 +#: ../../library/dbm.rst:92 msgid "" "These objects also support being used in a :keyword:`with` statement, which " "will automatically close them when done." msgstr "" -#: ../../library/dbm.rst:99 +#: ../../library/dbm.rst:95 msgid "" ":meth:`!get` and :meth:`!setdefault` methods are now available for all :mod:" "`dbm` backends." msgstr "" -#: ../../library/dbm.rst:103 +#: ../../library/dbm.rst:99 msgid "" "Added native support for the context management protocol to the objects " "returned by :func:`~dbm.open`." msgstr "" -#: ../../library/dbm.rst:107 +#: ../../library/dbm.rst:103 msgid "" "Deleting a key from a read-only database raises a database module specific " "exception instead of :exc:`KeyError`." msgstr "" -#: ../../library/dbm.rst:111 +#: ../../library/dbm.rst:107 msgid "" "The following example records some hostnames and a corresponding title, and " "then prints out the contents of the database::" msgstr "" -#: ../../library/dbm.rst:141 +#: ../../library/dbm.rst:137 msgid "Module :mod:`shelve`" msgstr ":mod:`shelve` 模組" -#: ../../library/dbm.rst:142 +#: ../../library/dbm.rst:138 msgid "Persistence module which stores non-string data." msgstr "" -#: ../../library/dbm.rst:145 +#: ../../library/dbm.rst:141 msgid "The individual submodules are described in the following sections." msgstr "" -#: ../../library/dbm.rst:149 +#: ../../library/dbm.rst:145 msgid ":mod:`dbm.gnu` --- GNU database manager" msgstr ":mod:`dbm.gnu` --- GNU 資料庫管理器" -#: ../../library/dbm.rst:155 +#: ../../library/dbm.rst:151 msgid "**Source code:** :source:`Lib/dbm/gnu.py`" msgstr "**原始碼:**\\ :source:`Lib/dbm/gnu.py`" -#: ../../library/dbm.rst:159 +#: ../../library/dbm.rst:155 msgid "" "The :mod:`dbm.gnu` module provides an interface to the :abbr:`GDBM (GNU " "dbm)` library, similar to the :mod:`dbm.ndbm` module, but with additional " "functionality like crash tolerance." msgstr "" -#: ../../library/dbm.rst:163 +#: ../../library/dbm.rst:161 ../../library/dbm.rst:267 msgid "" -":class:`!gdbm` objects behave similar to :term:`mappings `, except " -"that keys and values are always converted to :class:`bytes` before storing, " -"and the :meth:`!items` and :meth:`!values` methods are not supported." +"The file formats created by :mod:`dbm.gnu` and :mod:`dbm.ndbm` are " +"incompatible and can not be used interchangeably." msgstr "" -#: ../../library/dbm.rst:167 ../../library/dbm.rst:273 -msgid "|incompat_note|" -msgstr "|incompat_note|" - -#: ../../library/dbm.rst:171 +#: ../../library/dbm.rst:166 msgid "" "Raised on :mod:`dbm.gnu`-specific errors, such as I/O errors. :exc:" "`KeyError` is raised for general mapping errors like specifying an incorrect " "key." msgstr "" -#: ../../library/dbm.rst:177 +#: ../../library/dbm.rst:172 msgid "Open a GDBM database and return a :class:`!gdbm` object." msgstr "" -#: ../../library/dbm.rst:183 +#: ../../library/dbm.rst:178 msgid "" "* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " "``'n'``: |flag_n| The following additional characters may be appended to " @@ -241,29 +236,29 @@ msgid "" "flag characters." msgstr "" -#: ../../library/dbm.rst:189 +#: ../../library/dbm.rst:184 msgid "" "The following additional characters may be appended to control how the " "database is opened:" msgstr "" -#: ../../library/dbm.rst:192 +#: ../../library/dbm.rst:187 msgid "" "``'f'``: Open the database in fast mode. Writes to the database will not be " "synchronized." msgstr "" -#: ../../library/dbm.rst:194 +#: ../../library/dbm.rst:189 msgid "" "``'s'``: Synchronized mode. Changes to the database will be written " "immediately to the file." msgstr "" -#: ../../library/dbm.rst:196 +#: ../../library/dbm.rst:191 msgid "``'u'``: Do not lock database." msgstr "``'u'``: 不要鎖住資料庫。" -#: ../../library/dbm.rst:198 +#: ../../library/dbm.rst:193 msgid "" "Not all flags are valid for all versions of GDBM. See the :data:`open_flags` " "member for a list of supported flag characters." @@ -273,23 +268,24 @@ msgstr "" msgid "Raises" msgstr "引發" -#: ../../library/dbm.rst:204 +#: ../../library/dbm.rst:199 msgid "If an invalid *flag* argument is passed." msgstr "如果一個無效的 *flag* 引數被傳入。" -#: ../../library/dbm.rst:212 +#: ../../library/dbm.rst:207 msgid "" "A string of characters the *flag* parameter of :meth:`~dbm.gnu.open` " "supports." msgstr "" -#: ../../library/dbm.rst:214 +#: ../../library/dbm.rst:209 msgid "" -"In addition to the dictionary-like methods, :class:`gdbm` objects have the " -"following methods and attributes:" +":class:`!gdbm` objects behave similar to :term:`mappings `, but :" +"meth:`!items` and :meth:`!values` methods are not supported. The following " +"methods are also provided:" msgstr "" -#: ../../library/dbm.rst:219 +#: ../../library/dbm.rst:215 msgid "" "It's possible to loop over every key in the database using this method and " "the :meth:`nextkey` method. The traversal is ordered by GDBM's internal " @@ -297,14 +293,14 @@ msgid "" "starting key." msgstr "" -#: ../../library/dbm.rst:226 +#: ../../library/dbm.rst:222 msgid "" "Returns the key that follows *key* in the traversal. The following code " "prints every key in the database ``db``, without having to create a list in " "memory that contains them all::" msgstr "" -#: ../../library/dbm.rst:237 +#: ../../library/dbm.rst:233 msgid "" "If you have carried out a lot of deletions and would like to shrink the " "space used by the GDBM file, this routine will reorganize the database. :" @@ -313,40 +309,32 @@ msgid "" "reused as new (key, value) pairs are added." msgstr "" -#: ../../library/dbm.rst:245 +#: ../../library/dbm.rst:241 msgid "" "When the database has been opened in fast mode, this method forces any " "unwritten data to be written to the disk." msgstr "" -#: ../../library/dbm.rst:250 +#: ../../library/dbm.rst:246 msgid "Close the GDBM database." msgstr "關閉 GDBM 資料庫。" -#: ../../library/dbm.rst:254 +#: ../../library/dbm.rst:250 msgid ":mod:`dbm.ndbm` --- New Database Manager" msgstr ":mod:`dbm.ndbm` --- 新資料庫管理器" -#: ../../library/dbm.rst:260 +#: ../../library/dbm.rst:256 msgid "**Source code:** :source:`Lib/dbm/ndbm.py`" msgstr "**原始碼:**\\ :source:`Lib/dbm/ndbm.py`" -#: ../../library/dbm.rst:264 +#: ../../library/dbm.rst:260 msgid "" "The :mod:`dbm.ndbm` module provides an interface to the :abbr:`NDBM (New " -"Database Manager)` library. :class:`!ndbm` objects behave similar to :term:" -"`mappings `, except that keys and values are always stored as :" -"class:`bytes`, and the :meth:`!items` and :meth:`!values` methods are not " -"supported." -msgstr "" - -#: ../../library/dbm.rst:270 -msgid "" -"This module can be used with the \"classic\" NDBM interface or the :abbr:" -"`GDBM (GNU dbm)` compatibility interface." +"Database Manager)` library. This module can be used with the \"classic\" " +"NDBM interface or the :abbr:`GDBM (GNU dbm)` compatibility interface." msgstr "" -#: ../../library/dbm.rst:277 +#: ../../library/dbm.rst:272 msgid "" "The NDBM library shipped as part of macOS has an undocumented limitation on " "the size of values, which can result in corrupted database files when " @@ -354,50 +342,51 @@ msgid "" "result in a hard crash (segmentation fault)." msgstr "" -#: ../../library/dbm.rst:284 +#: ../../library/dbm.rst:279 msgid "" "Raised on :mod:`dbm.ndbm`-specific errors, such as I/O errors. :exc:" "`KeyError` is raised for general mapping errors like specifying an incorrect " "key." msgstr "" -#: ../../library/dbm.rst:290 +#: ../../library/dbm.rst:285 msgid "Name of the NDBM implementation library used." msgstr "" -#: ../../library/dbm.rst:295 +#: ../../library/dbm.rst:290 msgid "Open an NDBM database and return an :class:`!ndbm` object." msgstr "" -#: ../../library/dbm.rst:297 +#: ../../library/dbm.rst:292 msgid "" "The basename of the database file (without the :file:`.dir` or :file:`.pag` " "extensions)." msgstr "" -#: ../../library/dbm.rst:311 +#: ../../library/dbm.rst:306 msgid "" -"In addition to the dictionary-like methods, :class:`!ndbm` objects provide " -"the following method:" +":class:`!ndbm` objects behave similar to :term:`mappings `, but :" +"meth:`!items` and :meth:`!values` methods are not supported. The following " +"methods are also provided:" msgstr "" -#: ../../library/dbm.rst:314 +#: ../../library/dbm.rst:310 msgid "Accepts :term:`path-like object` for filename." msgstr "" -#: ../../library/dbm.rst:319 +#: ../../library/dbm.rst:315 msgid "Close the NDBM database." msgstr "關閉 NDBM 資料庫。" -#: ../../library/dbm.rst:323 +#: ../../library/dbm.rst:319 msgid ":mod:`dbm.dumb` --- Portable DBM implementation" msgstr ":mod:`dbm.dumb` --- 可攜式 DBM 實作" -#: ../../library/dbm.rst:328 +#: ../../library/dbm.rst:324 msgid "**Source code:** :source:`Lib/dbm/dumb.py`" msgstr "**原始碼:**\\ :source:`Lib/dbm/dumb.py`" -#: ../../library/dbm.rst:334 +#: ../../library/dbm.rst:330 msgid "" "The :mod:`dbm.dumb` module is intended as a last resort fallback for the :" "mod:`dbm` module when a more robust module is not available. The :mod:`dbm." @@ -405,55 +394,53 @@ msgid "" "the other database modules." msgstr "" -#: ../../library/dbm.rst:341 +#: ../../library/dbm.rst:337 msgid "" "The :mod:`dbm.dumb` module provides a persistent :class:`dict`-like " "interface which is written entirely in Python. Unlike other :mod:`dbm` " -"backends, such as :mod:`dbm.gnu`, no external library is required. As with " -"other :mod:`dbm` backends, the keys and values are always stored as :class:" -"`bytes`." +"backends, such as :mod:`dbm.gnu`, no external library is required." msgstr "" -#: ../../library/dbm.rst:348 +#: ../../library/dbm.rst:342 msgid "The :mod:`!dbm.dumb` module defines the following:" msgstr ":mod:`!dbm.dumb` 模組定義了以下項目:" -#: ../../library/dbm.rst:352 +#: ../../library/dbm.rst:346 msgid "" "Raised on :mod:`dbm.dumb`-specific errors, such as I/O errors. :exc:" "`KeyError` is raised for general mapping errors like specifying an incorrect " "key." msgstr "" -#: ../../library/dbm.rst:358 +#: ../../library/dbm.rst:352 msgid "" "Open a :mod:`!dbm.dumb` database. The returned database object behaves " "similar to a :term:`mapping`, in addition to providing :meth:`~dumbdbm.sync` " "and :meth:`~dumbdbm.close` methods." msgstr "" -#: ../../library/dbm.rst:363 +#: ../../library/dbm.rst:357 msgid "" "The basename of the database file (without extensions). A new database " "creates the following files: - :file:`{filename}.dat` - :file:`{filename}." "dir`" msgstr "" -#: ../../library/dbm.rst:364 +#: ../../library/dbm.rst:358 msgid "" "The basename of the database file (without extensions). A new database " "creates the following files:" msgstr "" -#: ../../library/dbm.rst:367 +#: ../../library/dbm.rst:361 msgid ":file:`{filename}.dat`" msgstr ":file:`{filename}.dat`" -#: ../../library/dbm.rst:368 +#: ../../library/dbm.rst:362 msgid ":file:`{filename}.dir`" msgstr ":file:`{filename}.dir`" -#: ../../library/dbm.rst:371 +#: ../../library/dbm.rst:365 msgid "" "* ``'r'``: |flag_r| * ``'w'``: |flag_w| * ``'c'`` (default): |flag_c| * " "``'n'``: |flag_n|" @@ -461,48 +448,51 @@ msgstr "" "* ``'r'``: |flag_r| * ``'w'``: |flag_w| * ``'c'`` (default): |flag_c| * " "``'n'``: |flag_n|" -#: ../../library/dbm.rst:372 +#: ../../library/dbm.rst:366 msgid "``'r'``: |flag_r|" msgstr "``'r'``: |flag_r|" -#: ../../library/dbm.rst:374 +#: ../../library/dbm.rst:368 msgid "``'c'`` (default): |flag_c|" msgstr "``'c'`` (default): |flag_c|" -#: ../../library/dbm.rst:381 +#: ../../library/dbm.rst:375 msgid "" "It is possible to crash the Python interpreter when loading a database with " "a sufficiently large/complex entry due to stack depth limitations in " "Python's AST compiler." msgstr "" -#: ../../library/dbm.rst:385 +#: ../../library/dbm.rst:379 msgid "" ":func:`~dbm.dumb.open` always creates a new database when *flag* is ``'n'``." msgstr "" -#: ../../library/dbm.rst:388 +#: ../../library/dbm.rst:382 msgid "" "A database opened read-only if *flag* is ``'r'``. A database is not created " "if it does not exist if *flag* is ``'r'`` or ``'w'``." msgstr "" -#: ../../library/dbm.rst:395 +#: ../../library/dbm.rst:389 msgid "" "In addition to the methods provided by the :class:`collections.abc." "MutableMapping` class, the following methods are provided:" msgstr "" -#: ../../library/dbm.rst:401 +#: ../../library/dbm.rst:395 msgid "" "Synchronize the on-disk directory and data files. This method is called by " "the :meth:`Shelve.sync` method." msgstr "" -#: ../../library/dbm.rst:406 +#: ../../library/dbm.rst:400 msgid "Close the database." msgstr "關閉資料庫。" -#: ../../library/dbm.rst:330 +#: ../../library/dbm.rst:326 msgid "databases" msgstr "databases(資料庫)" + +#~ msgid "|incompat_note|" +#~ msgstr "|incompat_note|" From 880a0aee9c6640fe59b7b62123663873c7b9e040 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 16 Feb 2024 00:04:55 +0000 Subject: [PATCH 09/33] sync with cpython f383ca1a --- whatsnew/2.6.po | 141 ++++++++---- whatsnew/3.1.po | 219 +++++++++--------- whatsnew/3.10.po | 434 ++++++++++++++++++++--------------- whatsnew/3.6.po | 469 +++++++++++++++++++++----------------- whatsnew/3.7.po | 575 ++++++++++++++++++++++++++--------------------- whatsnew/3.8.po | 125 ++++++++++- whatsnew/3.9.po | 68 +++++- 7 files changed, 1218 insertions(+), 813 deletions(-) diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 7b42f6b920..4679885ca6 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-13 00:03+0000\n" +"POT-Creation-Date: 2024-02-16 00:03+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-" @@ -3249,7 +3249,7 @@ msgstr "" msgid "Deprecations and Removals" msgstr "" -#: ../../whatsnew/2.6.rst:2908 ../../whatsnew/2.6.rst:3236 +#: ../../whatsnew/2.6.rst:2908 ../../whatsnew/2.6.rst:3263 msgid "" "String exceptions have been removed. Attempting to use them raises a :exc:" "`TypeError`." @@ -3358,19 +3358,57 @@ msgstr "" #: ../../whatsnew/2.6.rst:2995 msgid "" +"A new function added in Python 2.6.6, :c:func:`!PySys_SetArgvEx`, sets the " +"value of ``sys.argv`` and can optionally update ``sys.path`` to include the " +"directory containing the script named by ``sys.argv[0]`` depending on the " +"value of an *updatepath* parameter." +msgstr "" + +#: ../../whatsnew/2.6.rst:3000 +msgid "" +"This function was added to close a security hole for applications that embed " +"Python. The old function, :c:func:`!PySys_SetArgv`, would always update " +"``sys.path``, and sometimes it would add the current directory. This meant " +"that, if you ran an application embedding Python in a directory controlled " +"by someone else, attackers could put a Trojan-horse module in the directory " +"(say, a file named :file:`os.py`) that your application would then import " +"and run." +msgstr "" + +#: ../../whatsnew/2.6.rst:3008 +msgid "" +"If you maintain a C/C++ application that embeds Python, check whether you're " +"calling :c:func:`!PySys_SetArgv` and carefully consider whether the " +"application should be using :c:func:`!PySys_SetArgvEx` with *updatepath* set " +"to false. Note that using this function will break compatibility with " +"Python versions 2.6.5 and earlier; if you have to continue working with " +"earlier versions, you can leave the call to :c:func:`!PySys_SetArgv` alone " +"and call ``PyRun_SimpleString(\"sys.path.pop(0)\\n\")`` afterwards to " +"discard the first ``sys.path`` component." +msgstr "" + +#: ../../whatsnew/2.6.rst:3018 +msgid "" +"Security issue reported as `CVE-2008-5983 `_; discussed in :gh:`50003`, and fixed by " +"Antoine Pitrou." +msgstr "" + +#: ../../whatsnew/2.6.rst:3022 +msgid "" "The BerkeleyDB module now has a C API object, available as ``bsddb.db." "api``. This object can be used by other C extensions that wish to use the :" "mod:`bsddb` module for their own purposes. (Contributed by Duncan Grisby.)" msgstr "" -#: ../../whatsnew/2.6.rst:3000 +#: ../../whatsnew/2.6.rst:3027 msgid "" "The new buffer interface, previously described in `the PEP 3118 section " "<#pep-3118-revised-buffer-protocol>`__, adds :c:func:`PyObject_GetBuffer` " "and :c:func:`PyBuffer_Release`, as well as a few other functions." msgstr "" -#: ../../whatsnew/2.6.rst:3005 +#: ../../whatsnew/2.6.rst:3032 msgid "" "Python's use of the C stdio library is now thread-safe, or at least as " "thread-safe as the underlying library is. A long-standing potential bug " @@ -3385,7 +3423,7 @@ msgid "" "Gregory P. Smith.)" msgstr "" -#: ../../whatsnew/2.6.rst:3018 +#: ../../whatsnew/2.6.rst:3045 msgid "" "Importing modules simultaneously in two different threads no longer " "deadlocks; it will now raise an :exc:`ImportError`. A new API function, :c:" @@ -3395,7 +3433,7 @@ msgid "" "(Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:3026 +#: ../../whatsnew/2.6.rst:3053 msgid "" "Several functions return information about the platform's floating-point " "support. :c:func:`PyFloat_GetMax` returns the maximum representable " @@ -3407,7 +3445,7 @@ msgid "" "by Christian Heimes; :issue:`1534`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3037 +#: ../../whatsnew/2.6.rst:3064 msgid "" "C functions and methods that use :c:func:`PyComplex_AsCComplex` will now " "accept arguments that have a :meth:`__complex__` method. In particular, the " @@ -3416,14 +3454,14 @@ msgid "" "Dickinson; :issue:`1675423`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3044 +#: ../../whatsnew/2.6.rst:3071 msgid "" "Python's C API now includes two functions for case-insensitive string " "comparisons, ``PyOS_stricmp(char*, char*)`` and ``PyOS_strnicmp(char*, " "char*, Py_ssize_t)``. (Contributed by Christian Heimes; :issue:`1635`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3049 +#: ../../whatsnew/2.6.rst:3076 msgid "" "Many C extensions define their own little macro for adding integers and " "strings to the module's dictionary in the ``init*`` function. Python 2.6 " @@ -3432,7 +3470,7 @@ msgid "" "(Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:3056 +#: ../../whatsnew/2.6.rst:3083 msgid "" "Some macros were renamed in both 3.0 and 2.6 to make it clearer that they " "are macros, not functions. :c:macro:`!Py_Size()` became :c:macro:" @@ -3441,14 +3479,14 @@ msgid "" "still available in Python 2.6 for backward compatibility. (:issue:`1629`)" msgstr "" -#: ../../whatsnew/2.6.rst:3065 +#: ../../whatsnew/2.6.rst:3092 msgid "" "Distutils now places C extensions it builds in a different directory when " "running on a debug version of Python. (Contributed by Collin Winter; :issue:" "`1530959`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3069 +#: ../../whatsnew/2.6.rst:3096 msgid "" "Several basic data types, such as integers and strings, maintain internal " "free lists of objects that can be re-used. The data structures for these " @@ -3457,7 +3495,7 @@ msgid "" "``Py_MAXFREELIST`` is always defined." msgstr "" -#: ../../whatsnew/2.6.rst:3076 +#: ../../whatsnew/2.6.rst:3103 msgid "" "A new Makefile target, \"make patchcheck\", prepares the Python source tree " "for making a patch: it fixes trailing whitespace in all modified ``.py`` " @@ -3466,7 +3504,7 @@ msgid "" "(Contributed by Brett Cannon.)" msgstr "" -#: ../../whatsnew/2.6.rst:3083 +#: ../../whatsnew/2.6.rst:3110 msgid "" "Another new target, \"make profile-opt\", compiles a Python binary using " "GCC's profile-guided optimization. It compiles Python with profiling " @@ -3475,17 +3513,17 @@ msgid "" "Smith.)" msgstr "" -#: ../../whatsnew/2.6.rst:3092 +#: ../../whatsnew/2.6.rst:3119 msgid "Port-Specific Changes: Windows" msgstr "" -#: ../../whatsnew/2.6.rst:3094 +#: ../../whatsnew/2.6.rst:3121 msgid "" "The support for Windows 95, 98, ME and NT4 has been dropped. Python 2.6 " "requires at least Windows 2000 SP4." msgstr "" -#: ../../whatsnew/2.6.rst:3097 +#: ../../whatsnew/2.6.rst:3124 msgid "" "The new default compiler on Windows is Visual Studio 2008 (version 9.0). The " "build directories for Visual Studio 2003 (version 7.1) and 2005 (version " @@ -3496,7 +3534,7 @@ msgid "" "Martin von Löwis.)" msgstr "" -#: ../../whatsnew/2.6.rst:3105 +#: ../../whatsnew/2.6.rst:3132 msgid "" "The :mod:`msvcrt` module now supports both the normal and wide char variants " "of the console I/O API. The :func:`~msvcrt.getwch` function reads a " @@ -3505,21 +3543,21 @@ msgid "" "writes it to the console. (Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:3112 +#: ../../whatsnew/2.6.rst:3139 msgid "" ":func:`os.path.expandvars` will now expand environment variables in the form " "\"%var%\", and \"~user\" will be expanded into the user's home directory " "path. (Contributed by Josiah Carlson; :issue:`957650`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3116 +#: ../../whatsnew/2.6.rst:3143 msgid "" "The :mod:`socket` module's socket objects now have an :meth:`~socket.socket." "ioctl` method that provides a limited interface to the :c:func:`WSAIoctl` " "system interface." msgstr "" -#: ../../whatsnew/2.6.rst:3120 +#: ../../whatsnew/2.6.rst:3147 msgid "" "The :mod:`_winreg ` module now has a function, :func:`~winreg." "ExpandEnvironmentStrings`, that expands environment variable references such " @@ -3528,7 +3566,7 @@ msgid "" "`with` statements. (Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:3127 +#: ../../whatsnew/2.6.rst:3154 msgid "" ":mod:`_winreg ` also has better support for x64 systems, exposing " "the :func:`~winreg.DisableReflectionKey`, :func:`~winreg." @@ -3537,7 +3575,7 @@ msgid "" "64-bit systems. (:issue:`1753245`)" msgstr "" -#: ../../whatsnew/2.6.rst:3133 +#: ../../whatsnew/2.6.rst:3160 msgid "" "The :mod:`msilib` module's :class:`!Record` object gained :meth:`~msilib." "Record.GetInteger` and :meth:`~msilib.Record.GetString` methods that return " @@ -3545,25 +3583,25 @@ msgid "" "issue:`2125`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3141 +#: ../../whatsnew/2.6.rst:3168 msgid "Port-Specific Changes: Mac OS X" msgstr "" -#: ../../whatsnew/2.6.rst:3143 +#: ../../whatsnew/2.6.rst:3170 msgid "" "When compiling a framework build of Python, you can now specify the " "framework name to be used by providing the :option:`!--with-framework-name=` " "option to the :program:`configure` script." msgstr "" -#: ../../whatsnew/2.6.rst:3148 +#: ../../whatsnew/2.6.rst:3175 msgid "" "The :mod:`!macfs` module has been removed. This in turn required the :func:" "`!macostools.touched` function to be removed because it depended on the :mod:" "`!macfs` module. (:issue:`1490190`)" msgstr "" -#: ../../whatsnew/2.6.rst:3152 +#: ../../whatsnew/2.6.rst:3179 msgid "" "Many other Mac OS modules have been deprecated and will be removed in Python " "3.0: :mod:`!_builtinSuites`, :mod:`!aepack`, :mod:`!aetools`, :mod:`!" @@ -3578,11 +3616,11 @@ msgid "" "mod:`!SystemEvents`, :mod:`!Terminal`, and :mod:`!terminalcommand`." msgstr "" -#: ../../whatsnew/2.6.rst:3195 +#: ../../whatsnew/2.6.rst:3222 msgid "Port-Specific Changes: IRIX" msgstr "" -#: ../../whatsnew/2.6.rst:3197 +#: ../../whatsnew/2.6.rst:3224 msgid "" "A number of old IRIX-specific modules were deprecated and will be removed in " "Python 3.0: :mod:`!al` and :mod:`!AL`, :mod:`!cd`, :mod:`!cddb`, :mod:`!" @@ -3593,30 +3631,30 @@ msgid "" "`!torgb`, :mod:`!videoreader`, and :mod:`!WAIT`." msgstr "" -#: ../../whatsnew/2.6.rst:3227 +#: ../../whatsnew/2.6.rst:3254 msgid "Porting to Python 2.6" msgstr "" -#: ../../whatsnew/2.6.rst:3229 +#: ../../whatsnew/2.6.rst:3256 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code:" msgstr "" -#: ../../whatsnew/2.6.rst:3232 +#: ../../whatsnew/2.6.rst:3259 msgid "" "Classes that aren't supposed to be hashable should set ``__hash__ = None`` " "in their definitions to indicate the fact." msgstr "" -#: ../../whatsnew/2.6.rst:3239 +#: ../../whatsnew/2.6.rst:3266 msgid "" "The :meth:`__init__` method of :class:`collections.deque` now clears any " "existing contents of the deque before adding elements from the iterable. " "This change makes the behavior match ``list.__init__()``." msgstr "" -#: ../../whatsnew/2.6.rst:3244 +#: ../../whatsnew/2.6.rst:3271 msgid "" ":meth:`object.__init__` previously accepted arbitrary arguments and keyword " "arguments, ignoring them. In Python 2.6, this is no longer allowed and will " @@ -3625,7 +3663,7 @@ msgid "" "through using :func:`super`). See :issue:`1683368` for discussion." msgstr "" -#: ../../whatsnew/2.6.rst:3251 +#: ../../whatsnew/2.6.rst:3278 msgid "" "The :class:`Decimal` constructor now accepts leading and trailing whitespace " "when passed a string. Previously it would raise an :exc:`InvalidOperation` " @@ -3634,7 +3672,7 @@ msgid "" "`ConversionSyntax` exception." msgstr "" -#: ../../whatsnew/2.6.rst:3258 +#: ../../whatsnew/2.6.rst:3285 msgid "" "Due to an implementation accident, if you passed a file path to the built-" "in :func:`__import__` function, it would actually import the specified " @@ -3642,20 +3680,20 @@ msgid "" "explicitly checks for this case and raises an :exc:`ImportError`." msgstr "" -#: ../../whatsnew/2.6.rst:3264 +#: ../../whatsnew/2.6.rst:3291 msgid "" "C API: the :c:func:`PyImport_Import` and :c:func:`PyImport_ImportModule` " "functions now default to absolute imports, not relative imports. This will " "affect C extensions that import other modules." msgstr "" -#: ../../whatsnew/2.6.rst:3268 +#: ../../whatsnew/2.6.rst:3295 msgid "" "C API: extension data types that shouldn't be hashable should define their " "``tp_hash`` slot to :c:func:`PyObject_HashNotImplemented`." msgstr "" -#: ../../whatsnew/2.6.rst:3272 +#: ../../whatsnew/2.6.rst:3299 msgid "" "The :mod:`socket` module exception :exc:`socket.error` now inherits from :" "exc:`IOError`. Previously it wasn't a subclass of :exc:`StandardError` but " @@ -3663,7 +3701,7 @@ msgid "" "`1706815`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3277 +#: ../../whatsnew/2.6.rst:3304 msgid "" "The :mod:`xmlrpclib ` module no longer automatically " "converts :class:`datetime.date` and :class:`datetime.time` to the :class:" @@ -3673,32 +3711,45 @@ msgid "" "instances. (:issue:`1330538`)" msgstr "" -#: ../../whatsnew/2.6.rst:3284 +#: ../../whatsnew/2.6.rst:3311 msgid "" "(3.0-warning mode) The :class:`Exception` class now warns when accessed " "using slicing or index access; having :class:`Exception` behave like a tuple " "is being phased out." msgstr "" -#: ../../whatsnew/2.6.rst:3288 +#: ../../whatsnew/2.6.rst:3315 msgid "" "(3.0-warning mode) inequality comparisons between two dictionaries or two " "objects that don't implement comparison methods are reported as warnings. " "``dict1 == dict2`` still works, but ``dict1 < dict2`` is being phased out." msgstr "" -#: ../../whatsnew/2.6.rst:3293 +#: ../../whatsnew/2.6.rst:3320 msgid "" "Comparisons between cells, which are an implementation detail of Python's " "scoping rules, also cause warnings because such comparisons are forbidden " "entirely in 3.0." msgstr "" -#: ../../whatsnew/2.6.rst:3303 +#: ../../whatsnew/2.6.rst:3324 +msgid "For applications that embed Python:" +msgstr "" + +#: ../../whatsnew/2.6.rst:3326 +msgid "" +"The :c:func:`!PySys_SetArgvEx` function was added in Python 2.6.6, letting " +"applications close a security hole when the existing :c:func:`!" +"PySys_SetArgv` function was used. Check whether you're calling :c:func:`!" +"PySys_SetArgv` and carefully consider whether the application should be " +"using :c:func:`!PySys_SetArgvEx` with *updatepath* set to false." +msgstr "" + +#: ../../whatsnew/2.6.rst:3339 msgid "Acknowledgements" msgstr "致謝" -#: ../../whatsnew/2.6.rst:3305 +#: ../../whatsnew/2.6.rst:3341 msgid "" "The author would like to thank the following people for offering " "suggestions, corrections and assistance with various drafts of this article: " diff --git a/whatsnew/3.1.po b/whatsnew/3.1.po index 6a2d52cda4..89e53403fd 100644 --- a/whatsnew/3.1.po +++ b/whatsnew/3.1.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-13 00:03+0000\n" +"POT-Creation-Date: 2024-02-16 00:03+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-" @@ -81,11 +81,24 @@ msgid "" "by Raymond Hettinger." msgstr "" -#: ../../whatsnew/3.1.rst:85 +#: ../../whatsnew/3.1.rst:83 +msgid "" +"Since an ordered dictionary remembers its insertion order, it can be used in " +"conjuction with sorting to make a sorted dictionary::" +msgstr "" + +#: ../../whatsnew/3.1.rst:101 +msgid "" +"The new sorted dictionaries maintain their sort order when entries are " +"deleted. But when new keys are added, the keys are appended to the end and " +"the sort is not maintained." +msgstr "" + +#: ../../whatsnew/3.1.rst:107 msgid "PEP 378: Format Specifier for Thousands Separator" msgstr "" -#: ../../whatsnew/3.1.rst:87 +#: ../../whatsnew/3.1.rst:109 msgid "" "The built-in :func:`format` function and the :meth:`str.format` method use a " "mini-language that now includes a simple, non-locale aware way to format a " @@ -93,13 +106,13 @@ msgid "" "program's output, improving its professional appearance and readability::" msgstr "" -#: ../../whatsnew/3.1.rst:101 +#: ../../whatsnew/3.1.rst:123 msgid "" "The supported types are :class:`int`, :class:`float`, :class:`complex` and :" "class:`decimal.Decimal`." msgstr "" -#: ../../whatsnew/3.1.rst:104 +#: ../../whatsnew/3.1.rst:126 msgid "" "Discussions are underway about how to specify alternative separators like " "dots, spaces, apostrophes, or underscores. Locale-aware applications should " @@ -107,25 +120,25 @@ msgid "" "thousands separators." msgstr "" -#: ../../whatsnew/3.1.rst:112 +#: ../../whatsnew/3.1.rst:134 msgid ":pep:`378` - Format Specifier for Thousands Separator" msgstr "" -#: ../../whatsnew/3.1.rst:112 +#: ../../whatsnew/3.1.rst:134 msgid "" "PEP written by Raymond Hettinger and implemented by Eric Smith and Mark " "Dickinson." msgstr "" -#: ../../whatsnew/3.1.rst:117 +#: ../../whatsnew/3.1.rst:139 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/3.1.rst:119 +#: ../../whatsnew/3.1.rst:141 msgid "Some smaller changes made to the core Python language are:" msgstr "" -#: ../../whatsnew/3.1.rst:121 +#: ../../whatsnew/3.1.rst:143 msgid "" "Directories and zip archives containing a :file:`__main__.py` file can now " "be executed directly by passing their name to the interpreter. The directory/" @@ -134,13 +147,13 @@ msgid "" "and Nick Coghlan; :issue:`1739468`.)" msgstr "" -#: ../../whatsnew/3.1.rst:127 +#: ../../whatsnew/3.1.rst:149 msgid "" "The :func:`int` type gained a ``bit_length`` method that returns the number " "of bits necessary to represent its argument in binary::" msgstr "" -#: ../../whatsnew/3.1.rst:141 +#: ../../whatsnew/3.1.rst:163 msgid "" "(Contributed by Fredrik Johansson, Victor Stinner, Raymond Hettinger, and " "Mark Dickinson; :issue:`3439`.)" @@ -148,22 +161,22 @@ msgstr "" "(由 Fredrik Johansson、Victor Stinner、Raymond Hettinger 和 Mark Dickinson " "貢獻;:issue:`3439`。)" -#: ../../whatsnew/3.1.rst:144 +#: ../../whatsnew/3.1.rst:166 msgid "" "The fields in :func:`format` strings can now be automatically numbered::" msgstr "" -#: ../../whatsnew/3.1.rst:150 +#: ../../whatsnew/3.1.rst:172 msgid "" "Formerly, the string would have required numbered fields such as: ``'Sir {0} " "of {1}'``." msgstr "" -#: ../../whatsnew/3.1.rst:153 +#: ../../whatsnew/3.1.rst:175 msgid "(Contributed by Eric Smith; :issue:`5237`.)" msgstr "(由 Eric Smith 貢獻;:issue:`5237`。)" -#: ../../whatsnew/3.1.rst:155 +#: ../../whatsnew/3.1.rst:177 msgid "" "The :func:`string.maketrans` function is deprecated and is replaced by new " "static methods, :meth:`bytes.maketrans` and :meth:`bytearray.maketrans`. " @@ -173,23 +186,23 @@ msgid "" "intermediate translation tables of the appropriate type." msgstr "" -#: ../../whatsnew/3.1.rst:162 +#: ../../whatsnew/3.1.rst:184 msgid "(Contributed by Georg Brandl; :issue:`5675`.)" msgstr "(由 Georg Brandl 貢獻;:issue:`5675`。)" -#: ../../whatsnew/3.1.rst:164 +#: ../../whatsnew/3.1.rst:186 msgid "" "The syntax of the :keyword:`with` statement now allows multiple context " "managers in a single statement::" msgstr "" -#: ../../whatsnew/3.1.rst:172 +#: ../../whatsnew/3.1.rst:194 msgid "" "With the new syntax, the :func:`!contextlib.nested` function is no longer " "needed and is now deprecated." msgstr "" -#: ../../whatsnew/3.1.rst:175 +#: ../../whatsnew/3.1.rst:197 msgid "" "(Contributed by Georg Brandl and Mattias Brändström; `appspot issue 53094 " "`_.)" @@ -197,24 +210,24 @@ msgstr "" "(由 Georg Brandl 和 Mattias Brändström 貢獻;`appspot 問題 53094 `_。)" -#: ../../whatsnew/3.1.rst:178 +#: ../../whatsnew/3.1.rst:200 msgid "" "``round(x, n)`` now returns an integer if *x* is an integer. Previously it " "returned a float::" msgstr "" -#: ../../whatsnew/3.1.rst:184 +#: ../../whatsnew/3.1.rst:206 msgid "(Contributed by Mark Dickinson; :issue:`4707`.)" msgstr "(由 Mark Dickinson 貢獻;:issue:`4707`。)" -#: ../../whatsnew/3.1.rst:186 +#: ../../whatsnew/3.1.rst:208 msgid "" "Python now uses David Gay's algorithm for finding the shortest floating " "point representation that doesn't change its value. This should help " "mitigate some of the confusion surrounding binary floating point numbers." msgstr "" -#: ../../whatsnew/3.1.rst:191 +#: ../../whatsnew/3.1.rst:213 msgid "" "The significance is easily seen with a number like ``1.1`` which does not " "have an exact equivalent in binary floating point. Since there is no exact " @@ -225,7 +238,7 @@ msgid "" "calculations." msgstr "" -#: ../../whatsnew/3.1.rst:199 +#: ../../whatsnew/3.1.rst:221 msgid "" "What is new is how the number gets displayed. Formerly, Python used a " "simple approach. The value of ``repr(1.1)`` was computed as ``format(1.1, " @@ -237,7 +250,7 @@ msgid "" "problem with Python itself)." msgstr "" -#: ../../whatsnew/3.1.rst:208 +#: ../../whatsnew/3.1.rst:230 msgid "" "The new algorithm for ``repr(1.1)`` is smarter and returns ``'1.1'``. " "Effectively, it searches all equivalent string representations (ones that " @@ -245,14 +258,14 @@ msgid "" "representation." msgstr "" -#: ../../whatsnew/3.1.rst:213 +#: ../../whatsnew/3.1.rst:235 msgid "" "The new algorithm tends to emit cleaner representations when possible, but " "it does not change the underlying values. So, it is still the case that " "``1.1 + 2.2 != 3.3`` even though the representations may suggest otherwise." msgstr "" -#: ../../whatsnew/3.1.rst:217 +#: ../../whatsnew/3.1.rst:239 msgid "" "The new algorithm depends on certain features in the underlying floating " "point implementation. If the required features are not found, the old " @@ -260,64 +273,64 @@ msgid "" "cross-platform portability by using the old algorithm." msgstr "" -#: ../../whatsnew/3.1.rst:222 +#: ../../whatsnew/3.1.rst:244 msgid "(Contributed by Eric Smith and Mark Dickinson; :issue:`1580`)" msgstr "(由 Eric Smith 和 Mark Dickinson 貢獻;:issue:`1580`)" -#: ../../whatsnew/3.1.rst:225 +#: ../../whatsnew/3.1.rst:247 msgid "New, Improved, and Deprecated Modules" msgstr "" -#: ../../whatsnew/3.1.rst:227 +#: ../../whatsnew/3.1.rst:249 msgid "" "Added a :class:`collections.Counter` class to support convenient counting of " "unique items in a sequence or iterable::" msgstr "" -#: ../../whatsnew/3.1.rst:233 +#: ../../whatsnew/3.1.rst:255 msgid "(Contributed by Raymond Hettinger; :issue:`1696199`.)" msgstr "(由 Raymond Hettinger 貢獻;:issue:`1696199`。)" -#: ../../whatsnew/3.1.rst:235 +#: ../../whatsnew/3.1.rst:257 msgid "" "Added a new module, :mod:`tkinter.ttk` for access to the Tk themed widget " "set. The basic idea of ttk is to separate, to the extent possible, the code " "implementing a widget's behavior from the code implementing its appearance." msgstr "" -#: ../../whatsnew/3.1.rst:239 +#: ../../whatsnew/3.1.rst:261 msgid "(Contributed by Guilherme Polo; :issue:`2983`.)" msgstr "(由 Guilherme Polo 貢獻;:issue:`2983`。)" -#: ../../whatsnew/3.1.rst:241 +#: ../../whatsnew/3.1.rst:263 msgid "" "The :class:`gzip.GzipFile` and :class:`bz2.BZ2File` classes now support the " "context management protocol::" msgstr "" -#: ../../whatsnew/3.1.rst:248 +#: ../../whatsnew/3.1.rst:270 msgid "(Contributed by Antoine Pitrou.)" msgstr "(由 Antoine Pitrou 貢獻。)" -#: ../../whatsnew/3.1.rst:250 +#: ../../whatsnew/3.1.rst:272 msgid "" "The :mod:`decimal` module now supports methods for creating a decimal object " "from a binary :class:`float`. The conversion is exact but can sometimes be " "surprising::" msgstr "" -#: ../../whatsnew/3.1.rst:257 +#: ../../whatsnew/3.1.rst:279 msgid "" "The long decimal result shows the actual binary fraction being stored for " "*1.1*. The fraction has many digits because *1.1* cannot be exactly " "represented in binary." msgstr "" -#: ../../whatsnew/3.1.rst:261 +#: ../../whatsnew/3.1.rst:283 msgid "(Contributed by Raymond Hettinger and Mark Dickinson.)" msgstr "(由 Raymond Hettinger 和 Mark Dickinso 貢獻。)" -#: ../../whatsnew/3.1.rst:263 +#: ../../whatsnew/3.1.rst:285 msgid "" "The :mod:`itertools` module grew two new functions. The :func:`itertools." "combinations_with_replacement` function is one of four for generating " @@ -328,11 +341,11 @@ msgid "" "`fractions.Fraction` and :class:`decimal.Decimal`::" msgstr "" -#: ../../whatsnew/3.1.rst:282 +#: ../../whatsnew/3.1.rst:304 msgid "(Contributed by Raymond Hettinger.)" msgstr "(由 Raymond Hettinger 貢獻。)" -#: ../../whatsnew/3.1.rst:284 +#: ../../whatsnew/3.1.rst:306 msgid "" ":func:`collections.namedtuple` now supports a keyword argument *rename* " "which lets invalid fieldnames be automatically converted to positional names " @@ -341,21 +354,21 @@ msgid "" "input::" msgstr "" -#: ../../whatsnew/3.1.rst:301 +#: ../../whatsnew/3.1.rst:323 msgid "(Contributed by Raymond Hettinger; :issue:`1818`.)" msgstr "(由 Raymond Hettinger 貢獻;:issue:`1818`。)" -#: ../../whatsnew/3.1.rst:303 +#: ../../whatsnew/3.1.rst:325 msgid "" "The :func:`re.sub`, :func:`re.subn` and :func:`re.split` functions now " "accept a flags parameter." msgstr "" -#: ../../whatsnew/3.1.rst:306 +#: ../../whatsnew/3.1.rst:328 msgid "(Contributed by Gregory Smith.)" msgstr "(由 Gregory Smith 貢獻。)" -#: ../../whatsnew/3.1.rst:308 +#: ../../whatsnew/3.1.rst:330 msgid "" "The :mod:`logging` module now implements a simple :class:`logging." "NullHandler` class for applications that are not using logging but are " @@ -363,52 +376,52 @@ msgid "" "spurious warnings such as \"No handlers could be found for logger foo\"::" msgstr "" -#: ../../whatsnew/3.1.rst:316 +#: ../../whatsnew/3.1.rst:338 msgid "(Contributed by Vinay Sajip; :issue:`4384`)." msgstr "(由 Vinay Sajip 貢獻;:issue:`4384`)。" -#: ../../whatsnew/3.1.rst:318 +#: ../../whatsnew/3.1.rst:340 msgid "" "The :mod:`runpy` module which supports the ``-m`` command line switch now " "supports the execution of packages by looking for and executing a " "``__main__`` submodule when a package name is supplied." msgstr "" -#: ../../whatsnew/3.1.rst:322 +#: ../../whatsnew/3.1.rst:344 msgid "(Contributed by Andi Vajda; :issue:`4195`.)" msgstr "(由 Andi Vajda 貢獻;:issue:`4195`。)" -#: ../../whatsnew/3.1.rst:324 +#: ../../whatsnew/3.1.rst:346 msgid "" "The :mod:`pdb` module can now access and display source code loaded via :mod:" "`zipimport` (or any other conformant :pep:`302` loader)." msgstr "" -#: ../../whatsnew/3.1.rst:327 +#: ../../whatsnew/3.1.rst:349 msgid "(Contributed by Alexander Belopolsky; :issue:`4201`.)" msgstr "(由 Alexander Belopolsky 貢獻;:issue:`4201`。)" -#: ../../whatsnew/3.1.rst:329 +#: ../../whatsnew/3.1.rst:351 msgid ":class:`functools.partial` objects can now be pickled." msgstr "" -#: ../../whatsnew/3.1.rst:331 +#: ../../whatsnew/3.1.rst:353 msgid "" "(Suggested by Antoine Pitrou and Jesse Noller. Implemented by Jack " "Diederich; :issue:`5228`.)" msgstr "" -#: ../../whatsnew/3.1.rst:334 +#: ../../whatsnew/3.1.rst:356 msgid "" "Add :mod:`pydoc` help topics for symbols so that ``help('@')`` works as " "expected in the interactive environment." msgstr "" -#: ../../whatsnew/3.1.rst:337 +#: ../../whatsnew/3.1.rst:359 msgid "(Contributed by David Laban; :issue:`4739`.)" msgstr "(由 David Laban 貢獻;:issue:`4739`。)" -#: ../../whatsnew/3.1.rst:339 +#: ../../whatsnew/3.1.rst:361 msgid "" "The :mod:`unittest` module now supports skipping individual tests or classes " "of tests. And it supports marking a test as an expected failure, a test that " @@ -416,13 +429,13 @@ msgid "" "TestResult::" msgstr "" -#: ../../whatsnew/3.1.rst:354 +#: ../../whatsnew/3.1.rst:376 msgid "" "Also, tests for exceptions have been builtout to work with context managers " "using the :keyword:`with` statement::" msgstr "" -#: ../../whatsnew/3.1.rst:361 +#: ../../whatsnew/3.1.rst:383 msgid "" "In addition, several new assertion methods were added including :func:" "`assertSetEqual`, :func:`assertDictEqual`, :func:" @@ -431,33 +444,33 @@ msgid "" "`assertRaisesRegexp`, :func:`assertIsNone`, and :func:`assertIsNotNone`." msgstr "" -#: ../../whatsnew/3.1.rst:368 +#: ../../whatsnew/3.1.rst:390 msgid "(Contributed by Benjamin Peterson and Antoine Pitrou.)" msgstr "(由 Benjamin Peterson 和 Antoine Pitrou 貢獻。)" -#: ../../whatsnew/3.1.rst:370 +#: ../../whatsnew/3.1.rst:392 msgid "" "The :mod:`io` module has three new constants for the :meth:`seek` method :" "data:`SEEK_SET`, :data:`SEEK_CUR`, and :data:`SEEK_END`." msgstr "" -#: ../../whatsnew/3.1.rst:373 +#: ../../whatsnew/3.1.rst:395 msgid "The :data:`sys.version_info` tuple is now a named tuple::" msgstr "" -#: ../../whatsnew/3.1.rst:378 +#: ../../whatsnew/3.1.rst:400 msgid "(Contributed by Ross Light; :issue:`4285`.)" msgstr "(由 Ross Light 貢獻;:issue:`4285`。)" -#: ../../whatsnew/3.1.rst:380 +#: ../../whatsnew/3.1.rst:402 msgid "The :mod:`nntplib` and :mod:`imaplib` modules now support IPv6." msgstr "" -#: ../../whatsnew/3.1.rst:382 +#: ../../whatsnew/3.1.rst:404 msgid "(Contributed by Derek Morr; :issue:`1655` and :issue:`1664`.)" msgstr "(由 Derek Morr 貢獻;:issue:`1655` 和 :issue:`1664`。)" -#: ../../whatsnew/3.1.rst:384 +#: ../../whatsnew/3.1.rst:406 msgid "" "The :mod:`pickle` module has been adapted for better interoperability with " "Python 2.x when used with protocol 2 or lower. The reorganization of the " @@ -470,7 +483,7 @@ msgid "" "*fix_imports* option::" msgstr "" -#: ../../whatsnew/3.1.rst:400 +#: ../../whatsnew/3.1.rst:422 msgid "" "An unfortunate but unavoidable side-effect of this change is that protocol 2 " "pickles produced by Python 3.1 won't be readable with Python 3.0. The latest " @@ -479,12 +492,12 @@ msgid "" "Python 2.x." msgstr "" -#: ../../whatsnew/3.1.rst:406 +#: ../../whatsnew/3.1.rst:428 msgid "" "(Contributed by Alexandre Vassalotti and Antoine Pitrou, :issue:`6137`.)" msgstr "(由 Alexandre Vassalotti 和 Antoine Pitrou 貢獻,:issue:`6137`。)" -#: ../../whatsnew/3.1.rst:408 +#: ../../whatsnew/3.1.rst:430 msgid "" "A new module, :mod:`importlib` was added. It provides a complete, portable, " "pure Python reference implementation of the :keyword:`import` statement and " @@ -493,19 +506,19 @@ msgid "" "place during imports." msgstr "" -#: ../../whatsnew/3.1.rst:414 +#: ../../whatsnew/3.1.rst:436 msgid "(Contributed by Brett Cannon.)" msgstr "(由 Brett Cannon 貢獻。)" -#: ../../whatsnew/3.1.rst:417 +#: ../../whatsnew/3.1.rst:439 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.1.rst:419 +#: ../../whatsnew/3.1.rst:441 msgid "Major performance enhancements have been added:" msgstr "" -#: ../../whatsnew/3.1.rst:421 +#: ../../whatsnew/3.1.rst:443 msgid "" "The new I/O library (as defined in :pep:`3116`) was mostly written in Python " "and quickly proved to be a problematic bottleneck in Python 3.0. In Python " @@ -514,11 +527,11 @@ msgid "" "available for experimentation purposes through the ``_pyio`` module." msgstr "" -#: ../../whatsnew/3.1.rst:428 +#: ../../whatsnew/3.1.rst:450 msgid "(Contributed by Amaury Forgeot d'Arc and Antoine Pitrou.)" msgstr "(由 Amaury Forgeot d'Arc 和 Antoine Pitrou 貢獻。)" -#: ../../whatsnew/3.1.rst:430 +#: ../../whatsnew/3.1.rst:452 msgid "" "Added a heuristic so that tuples and dicts containing only untrackable " "objects are not tracked by the garbage collector. This can reduce the size " @@ -526,11 +539,11 @@ msgid "" "programs, depending on their particular use of datatypes." msgstr "" -#: ../../whatsnew/3.1.rst:435 +#: ../../whatsnew/3.1.rst:457 msgid "(Contributed by Antoine Pitrou, :issue:`4688`.)" msgstr "(由 Antoine Pitrou 貢獻,:issue:`4688`。)" -#: ../../whatsnew/3.1.rst:437 +#: ../../whatsnew/3.1.rst:459 msgid "" "Enabling a configure option named ``--with-computed-gotos`` on compilers " "that support it (notably: gcc, SunPro, icc), the bytecode evaluation loop is " @@ -538,23 +551,23 @@ msgid "" "depending on the system, the compiler, and the benchmark." msgstr "" -#: ../../whatsnew/3.1.rst:443 +#: ../../whatsnew/3.1.rst:465 msgid "" "(Contributed by Antoine Pitrou along with a number of other participants, :" "issue:`4753`)." msgstr "(由 Antoine Pitrou 和其他一些參與者共同貢獻,:issue:`4753`)。" -#: ../../whatsnew/3.1.rst:446 +#: ../../whatsnew/3.1.rst:468 msgid "" "The decoding of UTF-8, UTF-16 and LATIN-1 is now two to four times faster." msgstr "" -#: ../../whatsnew/3.1.rst:449 +#: ../../whatsnew/3.1.rst:471 msgid "" "(Contributed by Antoine Pitrou and Amaury Forgeot d'Arc, :issue:`4868`.)" msgstr "(由 Antoine Pitrou 和 Amaury Forgeot d'Arc 貢獻,:issue:`4868`。)" -#: ../../whatsnew/3.1.rst:451 +#: ../../whatsnew/3.1.rst:473 msgid "" "The :mod:`json` module now has a C extension to substantially improve its " "performance. In addition, the API was modified so that json works only " @@ -563,7 +576,7 @@ msgid "" "in terms of Unicode." msgstr "" -#: ../../whatsnew/3.1.rst:457 +#: ../../whatsnew/3.1.rst:479 msgid "" "(Contributed by Bob Ippolito and converted to Py3.1 by Antoine Pitrou and " "Benjamin Peterson; :issue:`4136`.)" @@ -571,39 +584,39 @@ msgstr "" "(由 Bob Ippolito 貢獻,由 Antoine Pitrou 和 Benjamin Peterson 轉換為 " "Py3.1;:issue:`4136`。)" -#: ../../whatsnew/3.1.rst:460 +#: ../../whatsnew/3.1.rst:482 msgid "" "Unpickling now interns the attribute names of pickled objects. This saves " "memory and allows pickles to be smaller." msgstr "" -#: ../../whatsnew/3.1.rst:463 +#: ../../whatsnew/3.1.rst:485 msgid "(Contributed by Jake McGuire and Antoine Pitrou; :issue:`5084`.)" msgstr "(由 Jake McGuire 和 Antoine Pitrou 貢獻;:issue:`5084`。)" -#: ../../whatsnew/3.1.rst:466 +#: ../../whatsnew/3.1.rst:488 msgid "IDLE" msgstr "IDLE" -#: ../../whatsnew/3.1.rst:468 +#: ../../whatsnew/3.1.rst:490 msgid "" "IDLE's format menu now provides an option to strip trailing whitespace from " "a source file." msgstr "" -#: ../../whatsnew/3.1.rst:471 +#: ../../whatsnew/3.1.rst:493 msgid "(Contributed by Roger D. Serwy; :issue:`5150`.)" msgstr "(由 Roger D. Serwy 貢獻;:issue:`5150`。)" -#: ../../whatsnew/3.1.rst:474 +#: ../../whatsnew/3.1.rst:496 msgid "Build and C API Changes" msgstr "" -#: ../../whatsnew/3.1.rst:476 +#: ../../whatsnew/3.1.rst:498 msgid "Changes to Python's build process and to the C API include:" msgstr "" -#: ../../whatsnew/3.1.rst:478 +#: ../../whatsnew/3.1.rst:500 msgid "" "Integers are now stored internally either in base ``2**15`` or in base " "``2**30``, the base being determined at build time. Previously, they were " @@ -615,7 +628,7 @@ msgid "" "this default." msgstr "" -#: ../../whatsnew/3.1.rst:487 +#: ../../whatsnew/3.1.rst:509 msgid "" "Apart from the performance improvements this change should be invisible to " "end users, with one exception: for testing and debugging purposes there's a " @@ -624,41 +637,41 @@ msgid "" "type used to store each digit::" msgstr "" -#: ../../whatsnew/3.1.rst:497 +#: ../../whatsnew/3.1.rst:519 msgid "(Contributed by Mark Dickinson; :issue:`4258`.)" msgstr "(由 Mark Dickinson 貢獻;:issue:`4258`。)" -#: ../../whatsnew/3.1.rst:499 +#: ../../whatsnew/3.1.rst:521 msgid "" "The :c:func:`PyLong_AsUnsignedLongLong()` function now handles a negative " "*pylong* by raising :exc:`OverflowError` instead of :exc:`TypeError`." msgstr "" -#: ../../whatsnew/3.1.rst:502 +#: ../../whatsnew/3.1.rst:524 msgid "(Contributed by Mark Dickinson and Lisandro Dalcrin; :issue:`5175`.)" msgstr "(由 Mark Dickinson 和 Lisandro Dalcrin 貢獻;:issue:`5175`。)" -#: ../../whatsnew/3.1.rst:504 +#: ../../whatsnew/3.1.rst:526 msgid "" "Deprecated :c:func:`!PyNumber_Int`. Use :c:func:`PyNumber_Long` instead." msgstr "" -#: ../../whatsnew/3.1.rst:506 +#: ../../whatsnew/3.1.rst:528 msgid "(Contributed by Mark Dickinson; :issue:`4910`.)" msgstr "(由 Mark Dickinson 貢獻;:issue:`4910`。)" -#: ../../whatsnew/3.1.rst:508 +#: ../../whatsnew/3.1.rst:530 msgid "" "Added a new :c:func:`PyOS_string_to_double` function to replace the " "deprecated functions :c:func:`!PyOS_ascii_strtod` and :c:func:`!" "PyOS_ascii_atof`." msgstr "" -#: ../../whatsnew/3.1.rst:511 +#: ../../whatsnew/3.1.rst:533 msgid "(Contributed by Mark Dickinson; :issue:`5914`.)" msgstr "(由 Mark Dickinson 貢獻;:issue:`5914`。)" -#: ../../whatsnew/3.1.rst:513 +#: ../../whatsnew/3.1.rst:535 msgid "" "Added :c:type:`PyCapsule` as a replacement for the :c:type:`!PyCObject` API. " "The principal difference is that the new type has a well defined interface " @@ -667,27 +680,27 @@ msgid "" "deprecated." msgstr "" -#: ../../whatsnew/3.1.rst:519 +#: ../../whatsnew/3.1.rst:541 msgid "(Contributed by Larry Hastings; :issue:`5630`.)" msgstr "(由 Larry Hastings 貢獻;:issue:`5630`。)" -#: ../../whatsnew/3.1.rst:522 +#: ../../whatsnew/3.1.rst:544 msgid "Porting to Python 3.1" msgstr "" -#: ../../whatsnew/3.1.rst:524 +#: ../../whatsnew/3.1.rst:546 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code:" msgstr "" -#: ../../whatsnew/3.1.rst:527 +#: ../../whatsnew/3.1.rst:549 msgid "" "The new floating point string representations can break existing doctests. " "For example::" msgstr "" -#: ../../whatsnew/3.1.rst:550 +#: ../../whatsnew/3.1.rst:572 msgid "" "The automatic name remapping in the pickle module for protocol 2 or lower " "can make Python 3.1 pickles unreadable in Python 3.0. One solution is to " diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index 920729bffa..8709e77e02 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-06 00:03+0000\n" +"POT-Creation-Date: 2024-02-16 00:03+0000\n" "PO-Revision-Date: 2023-06-26 03:02+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -125,7 +125,7 @@ msgstr ":pep:`624`,刪除 Py_UNICODE 編碼器 API" msgid ":pep:`597`, Add optional EncodingWarning" msgstr ":pep:`597`,新增可選的 EncodingWarning" -#: ../../whatsnew/3.10.rst:92 ../../whatsnew/3.10.rst:2046 +#: ../../whatsnew/3.10.rst:92 ../../whatsnew/3.10.rst:2053 msgid "New Features" msgstr "新功能" @@ -2301,11 +2301,21 @@ msgstr "" "訊,請參閱各自的文件。(由 Adam Goldschmidt、Senthil Kumaran 和 Ken Jin 在 :" "issue:`42967` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1521 +#: ../../whatsnew/3.10.rst:1520 +msgid "" +"The presence of newline or tab characters in parts of a URL allows for some " +"forms of attacks. Following the WHATWG specification that updates :rfc:" +"`3986`, ASCII newline ``\\n``, ``\\r`` and tab ``\\t`` characters are " +"stripped from the URL by the parser in :mod:`urllib.parse` preventing such " +"attacks. The removal characters are controlled by a new module level " +"variable ``urllib.parse._UNSAFE_URL_BYTES_TO_REMOVE``. (See :gh:`88048`)" +msgstr "" + +#: ../../whatsnew/3.10.rst:1528 msgid "xml" msgstr "xml" -#: ../../whatsnew/3.10.rst:1523 +#: ../../whatsnew/3.10.rst:1530 msgid "" "Add a :class:`~xml.sax.handler.LexicalHandler` class to the :mod:`xml.sax." "handler` module. (Contributed by Jonathan Gossage and Zackery Spytz in :" @@ -2314,11 +2324,11 @@ msgstr "" "新增 :class:`~xml.sax.handler.LexicalHandler` 類別到 :mod:`xml.sax.handler` " "模組。(由 Jonathan Gossage 和 Zackery Spytz 在 :issue:`35018` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1528 +#: ../../whatsnew/3.10.rst:1535 msgid "zipimport" msgstr "zipimport" -#: ../../whatsnew/3.10.rst:1529 +#: ../../whatsnew/3.10.rst:1536 msgid "" "Add methods related to :pep:`451`: :meth:`~zipimport.zipimporter." "find_spec`, :meth:`zipimport.zipimporter.create_module`, and :meth:" @@ -2329,7 +2339,7 @@ msgstr "" "meth:`zipimport.zipimporter.create_module` 和 :meth:`zipimport.zipimporter." "exec_module`。(由 Brett Cannon 在 :issue:`42131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1534 +#: ../../whatsnew/3.10.rst:1541 msgid "" "Add :meth:`~zipimport.zipimporter.invalidate_caches` method. (Contributed by " "Desmond Cheong in :issue:`14678`.)" @@ -2337,11 +2347,11 @@ msgstr "" "新增 :meth:`~zipimport.zipimporter.invalidate_caches` 方法。(由 Desmond " "Cheong 在 :issue:`14678` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1539 +#: ../../whatsnew/3.10.rst:1546 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.10.rst:1541 +#: ../../whatsnew/3.10.rst:1548 msgid "" "Constructors :func:`str`, :func:`bytes` and :func:`bytearray` are now faster " "(around 30--40% for small objects). (Contributed by Serhiy Storchaka in :" @@ -2350,7 +2360,7 @@ msgstr "" "建構函式 :func:`str`、:func:`bytes` 和 :func:`bytearray` 現在更快了(對於小型" "物件大約快了 30--40%)。(由 Serhiy Storchaka 在 :issue:`41334` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1545 +#: ../../whatsnew/3.10.rst:1552 msgid "" "The :mod:`runpy` module now imports fewer modules. The ``python3 -m module-" "name`` command startup time is 1.4x faster in average. On Linux, ``python3 -" @@ -2363,7 +2373,7 @@ msgstr "" "引入 69 個模組,而在 Python 3.10 上僅引入 51 個模組 (-18)。(由 Victor " "Stinner 在 :issue:`41006` 和 :issue:`41718` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1551 +#: ../../whatsnew/3.10.rst:1558 msgid "" "The ``LOAD_ATTR`` instruction now uses new \"per opcode cache\" mechanism. " "It is about 36% faster now for regular attributes and 44% faster for slots. " @@ -2376,7 +2386,7 @@ msgstr "" "Yury Selivanov 在 :issue:`42093` 中以及 Guido van Rossum 在 :issue:`42927` 中" "貢獻,基於最初在 PyPy 和 MicroPython 中實作的想法。)" -#: ../../whatsnew/3.10.rst:1557 +#: ../../whatsnew/3.10.rst:1564 msgid "" "When building Python with :option:`--enable-optimizations` now ``-fno-" "semantic-interposition`` is added to both the compile and link line. This " @@ -2393,7 +2403,7 @@ msgstr "" "linux-8-2-brings-faster-python-3-8-run-speeds/>`_ 以了解詳情。(由 Victor " "Stinner 和 Pablo Galindo 在 :issue:`38980` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1565 +#: ../../whatsnew/3.10.rst:1572 msgid "" "Use a new output buffer management code for :mod:`bz2` / :mod:`lzma` / :mod:" "`zlib` modules, and add ``.readall()`` function to ``_compression." @@ -2408,7 +2418,7 @@ msgstr "" "``GzipFile.read(-1)`` 速度提高了 1.11x ~ 1.18x。(由 Ma Lin 於 :issue:" "`41486` 貢獻、由 Gregory P. Smith 審閱)" -#: ../../whatsnew/3.10.rst:1571 +#: ../../whatsnew/3.10.rst:1578 msgid "" "When using stringized annotations, annotations dicts for functions are no " "longer created when the function is created. Instead, they are stored as a " @@ -2422,7 +2432,7 @@ msgstr "" "最佳化將定義帶有註釋的函式所需的 CPU 時間減少了一半。(由 Yurii Karabas 和 " "Inada Naoki 在 :issue:`42202` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1578 +#: ../../whatsnew/3.10.rst:1585 msgid "" "Substring search functions such as ``str1 in str2`` and ``str2.find(str1)`` " "now sometimes use Crochemore & Perrin's \"Two-Way\" string searching " @@ -2433,7 +2443,7 @@ msgstr "" "用 Crochemore & Perrin 的「雙向」字串搜索演算法來避免作用於長字串上時發生二次" "方行為 (quadratic behavior)。(由 Dennis Sweeney 在 :issue:`41972` 中貢獻)" -#: ../../whatsnew/3.10.rst:1583 +#: ../../whatsnew/3.10.rst:1590 msgid "" "Add micro-optimizations to ``_PyType_Lookup()`` to improve type attribute " "cache lookup performance in the common case of cache hits. This makes the " @@ -2444,7 +2454,7 @@ msgstr "" "查找性能。這使得直譯器平均速度提高了 1.04 倍。(由 Dino Viehland 在 :issue:" "`43452` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1587 +#: ../../whatsnew/3.10.rst:1594 msgid "" "The following built-in functions now support the faster :pep:`590` " "vectorcall calling convention: :func:`map`, :func:`filter`, :func:" @@ -2457,7 +2467,7 @@ msgstr "" "Na 和 Jeroen Demeyer 在 :issue:`43575`、:issue:`43287`、:issue:`41922`、:" "issue:`41873` 和 :issue:`41870` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1591 +#: ../../whatsnew/3.10.rst:1598 msgid "" ":class:`BZ2File` performance is improved by removing internal ``RLock``. " "This makes :class:`BZ2File` thread unsafe in the face of multiple " @@ -2469,11 +2479,11 @@ msgstr "" "`BZ2File` 在面對多個同時的讀取器或寫入器時執行緒不安全,就像 :mod:`gzip` 和 :" "mod:`lzma` 中的等效類別一樣。(由 Inada Naoki 在 :issue:`43785` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1599 ../../whatsnew/3.10.rst:2205 +#: ../../whatsnew/3.10.rst:1606 ../../whatsnew/3.10.rst:2212 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.10.rst:1601 +#: ../../whatsnew/3.10.rst:1608 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -2493,7 +2503,7 @@ msgstr "" "其中之一,則會引發棄用警告。在未來的版本中,它將被變更為語法警告,最後成為為" "語法錯誤。(由 Serhiy Storchaka 在 :issue:`43833` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1612 +#: ../../whatsnew/3.10.rst:1619 msgid "" "Starting in this release, there will be a concerted effort to begin cleaning " "up old import semantics that were kept for Python 2.7 compatibility. " @@ -2519,7 +2529,7 @@ msgstr "" "類別和方法)。將酌情引發 :exc:`ImportWarning` 和/或 :exc:" "`DeprecationWarning` 以幫助識別在此轉換期間需要更新的程式碼。" -#: ../../whatsnew/3.10.rst:1629 +#: ../../whatsnew/3.10.rst:1636 msgid "" "The entire ``distutils`` namespace is deprecated, to be removed in Python " "3.12. Refer to the :ref:`module changes ` section for " @@ -2528,7 +2538,7 @@ msgstr "" "整個 ``distutils`` 命名空間已棄用,將在 Python 3.12 中刪除。請參閱\\ :ref:`模" "組更改 ` 以獲取更多資訊。" -#: ../../whatsnew/3.10.rst:1633 +#: ../../whatsnew/3.10.rst:1640 msgid "" "Non-integer arguments to :func:`random.randrange` are deprecated. The :exc:" "`ValueError` is deprecated in favor of a :exc:`TypeError`. (Contributed by " @@ -2538,7 +2548,7 @@ msgstr "" "代之的是 :exc:`TypeError`。(由 Serhiy Storchaka 和 Raymond Hettinger 在 :" "issue:`37319` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1637 +#: ../../whatsnew/3.10.rst:1644 msgid "" "The various ``load_module()`` methods of :mod:`importlib` have been " "documented as deprecated since Python 3.6, but will now also trigger a :exc:" @@ -2549,7 +2559,7 @@ msgstr "" "用,但現在也會觸發 :exc:`DeprecationWarning`。請改用 :meth:`~importlib.abc." "Loader.exec_module`。(由 Brett Cannon 在 :issue:`26131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1643 +#: ../../whatsnew/3.10.rst:1650 msgid "" ":meth:`zimport.zipimporter.load_module` has been deprecated in preference " "for :meth:`~zipimport.zipimporter.exec_module`. (Contributed by Brett Cannon " @@ -2558,7 +2568,7 @@ msgstr "" ":meth:`zimport.zipimporter.load_module` 已被棄用,請用 :meth:`~zipimport." "zipimporter.exec_module`。(由 Brett Cannon 在 :issue:`26131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1647 +#: ../../whatsnew/3.10.rst:1654 msgid "" "The use of :meth:`~importlib.abc.Loader.load_module` by the import system " "now triggers an :exc:`ImportWarning` as :meth:`~importlib.abc.Loader." @@ -2568,7 +2578,7 @@ msgstr "" "`ImportWarning`,因為 :meth:`~importlib.abc.Loader.exec_module` 是當前首選。" "(由 Brett Cannon 在 :issue:`26131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1652 +#: ../../whatsnew/3.10.rst:1659 msgid "" "The use of :meth:`!importlib.abc.MetaPathFinder.find_module` and :meth:`!" "importlib.abc.PathEntryFinder.find_module` by the import system now trigger " @@ -2584,7 +2594,7 @@ msgstr "" "util.spec_from_loader` 來幫助移植。(由 Brett Cannon 在 :issue:`42134` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1661 +#: ../../whatsnew/3.10.rst:1668 msgid "" "The use of :meth:`!importlib.abc.PathEntryFinder.find_loader` by the import " "system now triggers an :exc:`ImportWarning` as :meth:`importlib.abc." @@ -2597,7 +2607,7 @@ msgstr "" "首選。你可以使用 :func:`importlib.util.spec_from_loader` 來幫助移植。(由 " "Brett Cannon 在 :issue:`43672` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1667 +#: ../../whatsnew/3.10.rst:1674 msgid "" "The various implementations of :meth:`!importlib.abc.MetaPathFinder." "find_module` ( :meth:`!importlib.machinery.BuiltinImporter.find_module`, :" @@ -2622,7 +2632,7 @@ msgstr "" "發 :exc:`DeprecationWarning` 並計劃在 Python 3.12 中刪除(之前它們已在 " "Python 3.4 中被記錄為已棄用)。(由 Brett Cannon 在 :issue:`42135` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1682 +#: ../../whatsnew/3.10.rst:1689 msgid "" ":class:`!importlib.abc.Finder` is deprecated (including its sole method, :" "meth:`!find_module`). Both :class:`importlib.abc.MetaPathFinder` and :class:" @@ -2635,7 +2645,7 @@ msgstr "" "abc.PathEntryFinder` 都不再從該類別繼承。使用者應該根據需求來選擇其一以繼承。" "(由 Brett Cannon 在 :issue:`42135` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1689 +#: ../../whatsnew/3.10.rst:1696 msgid "" "The deprecations of :mod:`!imp`, :func:`!importlib.find_loader`, :func:`!" "importlib.util.set_package_wrapper`, :func:`!importlib.util." @@ -2652,7 +2662,7 @@ msgstr "" "過去版本的 Python 中引發 :exc:`DeprecationWarning`) 。(由 Brett Cannon 在 :" "issue:`43720` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1699 +#: ../../whatsnew/3.10.rst:1706 msgid "" "The import system now uses the ``__spec__`` attribute on modules before " "falling back on :meth:`!module_repr` for a module's ``__repr__()`` method. " @@ -2663,7 +2673,7 @@ msgstr "" "module_repr` 作為模組的 ``__repr__()`` 方法。計劃在 Python 3.12 中刪除 " "``module_repr()`` 的使用。(由 Brett Cannon 在 :issue:`42137` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1705 +#: ../../whatsnew/3.10.rst:1712 msgid "" ":meth:`!importlib.abc.Loader.module_repr`, :meth:`!importlib.machinery." "FrozenLoader.module_repr`, and :meth:`!importlib.machinery.BuiltinLoader." @@ -2675,7 +2685,7 @@ msgstr "" "module_repr` 已棄用並計劃在 Python 3.12 中刪除。(由 Brett Cannon 在 :issue:" "`42136` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1711 +#: ../../whatsnew/3.10.rst:1718 msgid "" "``sqlite3.OptimizedUnicode`` has been undocumented and obsolete since Python " "3.3, when it was made an alias to :class:`str`. It is now deprecated, " @@ -2686,7 +2696,7 @@ msgstr "" "它被用作 :class:`str` 的別名。它現已被棄用,並計劃在 Python 3.12 中刪除。" "(由 Erlend E. Aasland 在 :issue:`42264` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1716 +#: ../../whatsnew/3.10.rst:1723 msgid "" "The undocumented built-in function ``sqlite3.enable_shared_cache`` is now " "deprecated, scheduled for removal in Python 3.12. Its use is strongly " @@ -2701,49 +2711,49 @@ msgstr "" "使用共享快取,請使用 ``cache=shared`` 查詢參數以 URI 模式打開資料庫。(由 " "Erlend E. Aasland 在 :issue:`24464` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1724 +#: ../../whatsnew/3.10.rst:1731 msgid "The following ``threading`` methods are now deprecated:" msgstr "以下 ``threading`` 方法現已棄用:" -#: ../../whatsnew/3.10.rst:1726 +#: ../../whatsnew/3.10.rst:1733 msgid "``threading.currentThread`` => :func:`threading.current_thread`" msgstr "``threading.currentThread`` => :func:`threading.current_thread`" -#: ../../whatsnew/3.10.rst:1728 +#: ../../whatsnew/3.10.rst:1735 msgid "``threading.activeCount`` => :func:`threading.active_count`" msgstr "``threading.activeCount`` => :func:`threading.active_count`" -#: ../../whatsnew/3.10.rst:1730 +#: ../../whatsnew/3.10.rst:1737 msgid "" "``threading.Condition.notifyAll`` => :meth:`threading.Condition.notify_all`" msgstr "" "``threading.Condition.notifyAll`` => :meth:`threading.Condition.notify_all`" -#: ../../whatsnew/3.10.rst:1733 +#: ../../whatsnew/3.10.rst:1740 msgid "``threading.Event.isSet`` => :meth:`threading.Event.is_set`" msgstr "``threading.Event.isSet`` => :meth:`threading.Event.is_set`" -#: ../../whatsnew/3.10.rst:1735 +#: ../../whatsnew/3.10.rst:1742 msgid "``threading.Thread.setName`` => :attr:`threading.Thread.name`" msgstr "``threading.Thread.setName`` => :attr:`threading.Thread.name`" -#: ../../whatsnew/3.10.rst:1737 +#: ../../whatsnew/3.10.rst:1744 msgid "``threading.thread.getName`` => :attr:`threading.Thread.name`" msgstr "``threading.thread.getName`` => :attr:`threading.Thread.name`" -#: ../../whatsnew/3.10.rst:1739 +#: ../../whatsnew/3.10.rst:1746 msgid "``threading.Thread.isDaemon`` => :attr:`threading.Thread.daemon`" msgstr "``threading.Thread.isDaemon`` => :attr:`threading.Thread.daemon`" -#: ../../whatsnew/3.10.rst:1741 +#: ../../whatsnew/3.10.rst:1748 msgid "``threading.Thread.setDaemon`` => :attr:`threading.Thread.daemon`" msgstr "``threading.Thread.setDaemon`` => :attr:`threading.Thread.daemon`" -#: ../../whatsnew/3.10.rst:1743 +#: ../../whatsnew/3.10.rst:1750 msgid "(Contributed by Jelle Zijlstra in :gh:`87889`.)" msgstr "(由 Jelle Zijlstra 在 :gh:`87889` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1745 +#: ../../whatsnew/3.10.rst:1752 msgid "" ":meth:`!pathlib.Path.link_to` is deprecated and slated for removal in Python " "3.12. Use :meth:`pathlib.Path.hardlink_to` instead. (Contributed by Barney " @@ -2753,7 +2763,7 @@ msgstr "" "meth:`pathlib.Path.hardlink_to`。(由 Barney Gale 在 :issue:`39950` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1749 +#: ../../whatsnew/3.10.rst:1756 msgid "" "``cgi.log()`` is deprecated and slated for removal in Python 3.12. " "(Contributed by Inada Naoki in :issue:`41139`.)" @@ -2761,7 +2771,7 @@ msgstr "" "``cgi.log()`` 已棄用並計劃在 Python 3.12 中刪除。(由 Inada Naoki 在 :issue:" "`41139` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1752 +#: ../../whatsnew/3.10.rst:1759 msgid "" "The following :mod:`ssl` features have been deprecated since Python 3.6, " "Python 3.7, or OpenSSL 1.1.0 and will be removed in 3.11:" @@ -2769,7 +2779,7 @@ msgstr "" "自 Python 3.6、Python 3.7 或 OpenSSL 1.1.0 起,以下 :mod:`ssl` 功能已被棄用," "並將在 3.11 中刪除:" -#: ../../whatsnew/3.10.rst:1755 +#: ../../whatsnew/3.10.rst:1762 msgid "" ":data:`~ssl.OP_NO_SSLv2`, :data:`~ssl.OP_NO_SSLv3`, :data:`~ssl." "OP_NO_TLSv1`, :data:`~ssl.OP_NO_TLSv1_1`, :data:`~ssl.OP_NO_TLSv1_2`, and :" @@ -2781,7 +2791,7 @@ msgstr "" "data:`~ssl.OP_NO_TLSv1_3` 已被替換為 :attr:`sslSSLContext.minimum_version` " "和 :attr:`sslSSLContext.maximum_version`。" -#: ../../whatsnew/3.10.rst:1761 +#: ../../whatsnew/3.10.rst:1768 msgid "" ":data:`~ssl.PROTOCOL_SSLv2`, :data:`~ssl.PROTOCOL_SSLv3`, :data:`~ssl." "PROTOCOL_SSLv23`, :data:`~ssl.PROTOCOL_TLSv1`, :data:`~ssl." @@ -2795,20 +2805,20 @@ msgstr "" "PROTOCOL_TLS` 已棄用,取而代之的是 :const:`~ssl.PROTOCOL_TLS_CLIENT` 和 :" "const:`~ssl.PROTOCOL_TLS_SERVER`" -#: ../../whatsnew/3.10.rst:1767 +#: ../../whatsnew/3.10.rst:1774 msgid "" ":func:`~ssl.wrap_socket` is replaced by :meth:`ssl.SSLContext.wrap_socket`" msgstr ":func:`~ssl.wrap_socket` 被替換為 :meth:`ssl.SSLContext.wrap_socket`" -#: ../../whatsnew/3.10.rst:1769 +#: ../../whatsnew/3.10.rst:1776 msgid ":func:`~ssl.match_hostname`" msgstr ":func:`~ssl.match_hostname`" -#: ../../whatsnew/3.10.rst:1771 +#: ../../whatsnew/3.10.rst:1778 msgid ":func:`~ssl.RAND_pseudo_bytes`, :func:`~ssl.RAND_egd`" msgstr ":func:`~ssl.RAND_pseudo_bytes`, :func:`~ssl.RAND_egd`" -#: ../../whatsnew/3.10.rst:1773 +#: ../../whatsnew/3.10.rst:1780 msgid "" "NPN features like :meth:`ssl.SSLSocket.selected_npn_protocol` and :meth:`ssl." "SSLContext.set_npn_protocols` are replaced by ALPN." @@ -2816,7 +2826,7 @@ msgstr "" "NPN 功能如 :meth:`ssl.SSLSocket.selected_npn_protocol` 和 :meth:`ssl." "SSLContext.set_npn_protocols` 已被 ALPN 取代。" -#: ../../whatsnew/3.10.rst:1776 +#: ../../whatsnew/3.10.rst:1783 msgid "" "The threading debug (:envvar:`!PYTHONTHREADDEBUG` environment variable) is " "deprecated in Python 3.10 and will be removed in Python 3.12. This feature " @@ -2827,7 +2837,7 @@ msgstr "" "並將在 Python 3.12 中刪除。此功能需要一個 :ref:`Python 的除錯用建置版本 " "`。(由 Victor Stinner 在 :issue:`44584` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1781 +#: ../../whatsnew/3.10.rst:1788 msgid "" "Importing from the ``typing.io`` and ``typing.re`` submodules will now emit :" "exc:`DeprecationWarning`. These submodules will be removed in a future " @@ -2840,11 +2850,11 @@ msgstr "" "的任何內容都應該直接從 :mod:`typing` 引入。(由 Sebastian Rittau 在 :issue:" "`38291` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1790 ../../whatsnew/3.10.rst:2213 +#: ../../whatsnew/3.10.rst:1797 ../../whatsnew/3.10.rst:2220 msgid "Removed" msgstr "已刪除" -#: ../../whatsnew/3.10.rst:1792 +#: ../../whatsnew/3.10.rst:1799 msgid "" "Removed special methods ``__int__``, ``__float__``, ``__floordiv__``, " "``__mod__``, ``__divmod__``, ``__rfloordiv__``, ``__rmod__`` and " @@ -2856,7 +2866,7 @@ msgstr "" "``__rmod__`` 和 ``__rdivmod__`` 。它們都會引發 :exc:`TypeError`。(由 Serhiy " "Storchaka 在 :issue:`41974` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1798 +#: ../../whatsnew/3.10.rst:1805 msgid "" "The ``ParserBase.error()`` method from the private and undocumented " "``_markupbase`` module has been removed. :class:`html.parser.HTMLParser` is " @@ -2869,7 +2879,7 @@ msgstr "" "``error()`` 實作已在 Python 3.5 中刪除。(由 Berker Peksag 在 :issue:`31844` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:1804 +#: ../../whatsnew/3.10.rst:1811 msgid "" "Removed the ``unicodedata.ucnhash_CAPI`` attribute which was an internal " "PyCapsule object. The related private ``_PyUnicode_Name_CAPI`` structure was " @@ -2880,7 +2890,7 @@ msgstr "" "私有 ``_PyUnicode_Name_CAPI`` 結構已移至內部 C API。(由 Victor Stinner 在 :" "issue:`42157` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1809 +#: ../../whatsnew/3.10.rst:1816 msgid "" "Removed the ``parser`` module, which was deprecated in 3.9 due to the switch " "to the new PEG parser, as well as all the C source and header files that " @@ -2891,7 +2901,7 @@ msgstr "" "析器使用的所有 C 原始碼和標頭檔也已被刪除,包括 ``node.h``、``parser.h``、" "``graminit.h`` 和 ``grammar.h``。" -#: ../../whatsnew/3.10.rst:1814 +#: ../../whatsnew/3.10.rst:1821 msgid "" "Removed the Public C API functions ``PyParser_SimpleParseStringFlags``, " "``PyParser_SimpleParseStringFlagsFilename``, " @@ -2903,7 +2913,7 @@ msgstr "" "``PyParser_SimpleParseFileFlags`` 和 ``PyNode_Compile``,這些函式由於切換到新" "的 PEG 剖析器而在 3.9 中被棄用。" -#: ../../whatsnew/3.10.rst:1819 +#: ../../whatsnew/3.10.rst:1826 msgid "" "Removed the ``formatter`` module, which was deprecated in Python 3.4. It is " "somewhat obsolete, little used, and not tested. It was originally scheduled " @@ -2916,7 +2926,7 @@ msgstr "" "Python 2.7 EOL 之後。現有使用者應該將他們使用的任何類別複製到他們的程式碼中。" "(由 Donghee Na 和 Terry J. Reedy 在 :issue:`42299` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1826 +#: ../../whatsnew/3.10.rst:1833 msgid "" "Removed the :c:func:`!PyModule_GetWarningsModule` function that was useless " "now due to the :mod:`!_warnings` module was converted to a builtin module in " @@ -2926,7 +2936,7 @@ msgstr "" "`!_warnings` 模組在 2.6 中已轉換為內建模組。(由 Hai Shi 在 :issue:`42599` 中" "貢獻。)" -#: ../../whatsnew/3.10.rst:1830 +#: ../../whatsnew/3.10.rst:1837 msgid "" "Remove deprecated aliases to :ref:`collections-abstract-base-classes` from " "the :mod:`collections` module. (Contributed by Victor Stinner in :issue:" @@ -2935,7 +2945,7 @@ msgstr "" "從 :mod:`collections` 模組中刪除已棄用的、對 :ref:`collections-abstract-base-" "classes` 的別名。(由 Victor Stinner 在 :issue:`37324` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1834 +#: ../../whatsnew/3.10.rst:1841 msgid "" "The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ 's :" "doc:`high-level API <../library/asyncio-api-index>` following deprecation in " @@ -2944,11 +2954,11 @@ msgstr "" "在 Python 3.8 中棄用後,``loop`` 參數已從大多數 :mod:`asyncio` 的\\ :doc:`高" "階 API <../library/asyncio-api-index>` 中刪除。這一變化的背後動機是多方面的:" -#: ../../whatsnew/3.10.rst:1838 +#: ../../whatsnew/3.10.rst:1845 msgid "This simplifies the high-level API." msgstr "這簡化了高階 API。" -#: ../../whatsnew/3.10.rst:1839 +#: ../../whatsnew/3.10.rst:1846 msgid "" "The functions in the high-level API have been implicitly getting the current " "thread's running event loop since Python 3.7. There isn't a need to pass " @@ -2957,13 +2967,13 @@ msgstr "" "自 Python 3.7 以來,高階 API 中的函式一直隱式獲取當前執行緒正在運行的事件循" "環。在大多數正常用例中,不需要將事件循環傳遞給 API。" -#: ../../whatsnew/3.10.rst:1842 +#: ../../whatsnew/3.10.rst:1849 msgid "" "Event loop passing is error-prone especially when dealing with loops running " "in different threads." msgstr "事件循環的傳遞很容易出錯,尤其是在處理在不同執行緒中運行的循環時。" -#: ../../whatsnew/3.10.rst:1845 +#: ../../whatsnew/3.10.rst:1852 msgid "" "Note that the low-level API will still accept ``loop``. See :ref:`changes-" "python-api` for examples of how to replace existing code." @@ -2971,7 +2981,7 @@ msgstr "" "請注意,低階 API 仍會接受 ``loop``。有關如何替換現有程式碼的範例,請參閱 :" "ref:`changes-python-api`。" -#: ../../whatsnew/3.10.rst:1848 ../../whatsnew/3.10.rst:1920 +#: ../../whatsnew/3.10.rst:1855 ../../whatsnew/3.10.rst:1927 msgid "" "(Contributed by Yurii Karabas, Andrew Svetlov, Yury Selivanov and Kyle " "Stanley in :issue:`42392`.)" @@ -2979,21 +2989,21 @@ msgstr "" "(由 Yurii Karabas、Andrew Svetlov、Yury Selivanov 和 Kyle Stanley 在 :issue:" "`42392` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1853 ../../whatsnew/3.10.rst:2140 +#: ../../whatsnew/3.10.rst:1860 ../../whatsnew/3.10.rst:2147 msgid "Porting to Python 3.10" msgstr "移植到 Python 3.10" -#: ../../whatsnew/3.10.rst:1855 +#: ../../whatsnew/3.10.rst:1862 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "本節列出了前面描述的更改以及可能需要更改程式碼的其他錯誤修復。" -#: ../../whatsnew/3.10.rst:1860 +#: ../../whatsnew/3.10.rst:1867 msgid "Changes in the Python syntax" msgstr "Python 語法的變化" -#: ../../whatsnew/3.10.rst:1862 +#: ../../whatsnew/3.10.rst:1869 msgid "" "Deprecation warning is now emitted when compiling previously valid syntax if " "the numeric literal is immediately followed by a keyword (like in ``0in " @@ -3007,11 +3017,11 @@ msgstr "" "要消除警告並使程式碼與未來版本相容,只需在數字字面值和以下關鍵字之間新增一個" "空格即可。(由 Serhiy Storchaka 在 :issue:`43833` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1873 +#: ../../whatsnew/3.10.rst:1880 msgid "Changes in the Python API" msgstr "Python API 的變化" -#: ../../whatsnew/3.10.rst:1875 +#: ../../whatsnew/3.10.rst:1882 msgid "" "The *etype* parameters of the :func:`~traceback.format_exception`, :func:" "`~traceback.format_exception_only`, and :func:`~traceback.print_exception` " @@ -3023,7 +3033,7 @@ msgstr "" "print_exception` 函式的 *etype* 參數已重命名為 *exc*。(由 Zackery Spytz 和 " "Matthias Bussonnier 在 :issue:`26389` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1881 +#: ../../whatsnew/3.10.rst:1888 msgid "" ":mod:`atexit`: At Python exit, if a callback registered with :func:`atexit." "register` fails, its exception is now logged. Previously, only some " @@ -3034,7 +3044,7 @@ msgstr "" "回呼 (callback) 失敗,該例外現在會被記錄下來。在以前只記錄一些例外,並且最後" "一個例外總是被默默地忽略。(由 Victor Stinner 在 :issue:`42639` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1887 +#: ../../whatsnew/3.10.rst:1894 msgid "" ":class:`collections.abc.Callable` generic now flattens type parameters, " "similar to what :data:`typing.Callable` currently does. This means that " @@ -3054,7 +3064,7 @@ msgstr "" "可能會引發 :exc:`TypeError`,而在 Python 3.9 中,該參數可能已被默默地傳遞。" "(由 Ken Jin 在 :issue:`42195` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1897 +#: ../../whatsnew/3.10.rst:1904 msgid "" ":meth:`socket.htons` and :meth:`socket.ntohs` now raise :exc:`OverflowError` " "instead of :exc:`DeprecationWarning` if the given parameter will not fit in " @@ -3066,7 +3076,7 @@ msgstr "" "是 :exc:`DeprecationWarning`。(由 Erlend E. Aasland 在 :issue:`42393` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1902 +#: ../../whatsnew/3.10.rst:1909 msgid "" "The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ 's :" "doc:`high-level API <../library/asyncio-api-index>` following deprecation in " @@ -3075,21 +3085,21 @@ msgstr "" "在 Python 3.8 中棄用後,``loop`` 參數已從大多數 :mod:`asyncio` 的\\ :doc:`高" "階 API <../library/asyncio-api-index>` 中刪除。" -#: ../../whatsnew/3.10.rst:1906 +#: ../../whatsnew/3.10.rst:1913 msgid "A coroutine that currently looks like this::" msgstr "" "目前如下所示的協程:\n" "\n" "::" -#: ../../whatsnew/3.10.rst:1911 +#: ../../whatsnew/3.10.rst:1918 msgid "Should be replaced with this::" msgstr "" "應替換為:\n" "\n" "::" -#: ../../whatsnew/3.10.rst:1916 +#: ../../whatsnew/3.10.rst:1923 msgid "" "If ``foo()`` was specifically designed *not* to run in the current thread's " "running event loop (e.g. running in another thread's event loop), consider " @@ -3098,7 +3108,7 @@ msgstr "" "如果 ``foo()`` 被專門設計為 *不* 在當前執行緒的事件循環中運行(例如在另一個執" "行緒的事件循環中運行),請考慮改用 :func:`asyncio.run_coroutine_threadsafe`。" -#: ../../whatsnew/3.10.rst:1923 +#: ../../whatsnew/3.10.rst:1930 msgid "" "The :data:`types.FunctionType` constructor now inherits the current builtins " "if the *globals* dictionary has no ``\"__builtins__\"`` key, rather than " @@ -3114,11 +3124,11 @@ msgstr "" "function(...): ...`` 定義函式不受影響,全域變數不能用此語法覆蓋:它也繼承當前" "的內建物件。 (由 Victor Stinner 在 :issue:`42990` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1932 +#: ../../whatsnew/3.10.rst:1939 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.10.rst:1934 +#: ../../whatsnew/3.10.rst:1941 msgid "" "The C API functions ``PyParser_SimpleParseStringFlags``, " "``PyParser_SimpleParseStringFlagsFilename``, " @@ -3131,7 +3141,7 @@ msgstr "" "``PyParser_SimpleParseFileFlags``、``PyNode_Compile`` 和被這些函式使用的型別 " "``struct _node`` 被刪除。" -#: ../../whatsnew/3.10.rst:1940 +#: ../../whatsnew/3.10.rst:1947 msgid "" "Source should be now be compiled directly to a code object using, for " "example, :c:func:`Py_CompileString`. The resulting code object can then be " @@ -3141,11 +3151,11 @@ msgstr "" "件。然後可以(例如透過 :c:func:`PyEval_EvalCode`)為產生的程式碼物件求值 " "(evaluated)。" -#: ../../whatsnew/3.10.rst:1944 +#: ../../whatsnew/3.10.rst:1951 msgid "Specifically:" msgstr "具體來說:" -#: ../../whatsnew/3.10.rst:1946 +#: ../../whatsnew/3.10.rst:1953 msgid "" "A call to ``PyParser_SimpleParseStringFlags`` followed by ``PyNode_Compile`` " "can be replaced by calling :c:func:`Py_CompileString`." @@ -3153,7 +3163,7 @@ msgstr "" "後跟有 ``PyNode_Compile`` 呼叫的 ``PyParser_SimpleParseStringFlags`` 呼叫,可" "以替換為呼叫 :c:func:`Py_CompileString`。" -#: ../../whatsnew/3.10.rst:1949 +#: ../../whatsnew/3.10.rst:1956 msgid "" "There is no direct replacement for ``PyParser_SimpleParseFileFlags``. To " "compile code from a ``FILE *`` argument, you will need to read the file in C " @@ -3162,7 +3172,7 @@ msgstr "" "沒有 ``PyParser_SimpleParseFileFlags`` 的直接替代品。要從 ``FILE *`` 引數編譯" "程式碼,你需要用 C 讀取檔案並將結果緩衝區傳遞給 :c:func:`Py_CompileString`。" -#: ../../whatsnew/3.10.rst:1953 +#: ../../whatsnew/3.10.rst:1960 msgid "" "To compile a file given a ``char *`` filename, explicitly open the file, " "read it and compile the result. One way to do this is using the :py:mod:`io` " @@ -3175,7 +3185,7 @@ msgstr "" "`PyObject_CallMethod`、:c:func:`PyBytes_AsString` 和 :c:func:" "`Py_CompileString`,如下所示。(宣告和錯誤處理在此被省略。):" -#: ../../whatsnew/3.10.rst:1966 +#: ../../whatsnew/3.10.rst:1973 msgid "" "For ``FrameObject`` objects, the :attr:`~frame.f_lasti` member now " "represents a wordcode offset instead of a simple offset into the bytecode " @@ -3191,11 +3201,11 @@ msgstr "" "還要注意,``FrameObject`` 物件的 :attr:`!f_lasti` 成員不被認為是穩定的:請改" "用 :c:func:`PyFrame_GetLineNumber`。" -#: ../../whatsnew/3.10.rst:1974 +#: ../../whatsnew/3.10.rst:1981 msgid "CPython bytecode changes" msgstr "CPython 位元組碼更改" -#: ../../whatsnew/3.10.rst:1976 +#: ../../whatsnew/3.10.rst:1983 msgid "" "The ``MAKE_FUNCTION`` instruction now accepts either a dict or a tuple of " "strings as the function's annotations. (Contributed by Yurii Karabas and " @@ -3204,11 +3214,11 @@ msgstr "" "``MAKE_FUNCTION`` 指令現在接受字典或字串元組作為函式的註釋。(由 Yurii " "Karabas 和 Inada Naoki 在 :issue:`42202` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1981 +#: ../../whatsnew/3.10.rst:1988 msgid "Build Changes" msgstr "建置變更" -#: ../../whatsnew/3.10.rst:1983 +#: ../../whatsnew/3.10.rst:1990 msgid "" ":pep:`644`: Python now requires OpenSSL 1.1.1 or newer. OpenSSL 1.0.2 is no " "longer supported. (Contributed by Christian Heimes in :issue:`43669`.)" @@ -3216,7 +3226,7 @@ msgstr "" ":pep:`644`:Python 現在需要 OpenSSL 1.1.1 或更高版本。不再支援 OpenSSL " "1.0.2。(由 Christian Heimes 在 :issue:`43669` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1987 +#: ../../whatsnew/3.10.rst:1994 msgid "" "The C99 functions :c:func:`snprintf` and :c:func:`vsnprintf` are now " "required to build Python. (Contributed by Victor Stinner in :issue:`36020`.)" @@ -3224,7 +3234,7 @@ msgstr "" "現在需要 C99 函式 :c:func:`snprintf` 和 :c:func:`vsnprintf` 來建置 Python。 " "(由 Victor Stinner 在 :issue:`36020` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1991 +#: ../../whatsnew/3.10.rst:1998 msgid "" ":mod:`sqlite3` requires SQLite 3.7.15 or higher. (Contributed by Sergey " "Fedoseev and Erlend E. Aasland in :issue:`40744` and :issue:`40810`.)" @@ -3232,7 +3242,7 @@ msgstr "" ":mod:`sqlite3` 需要 SQLite 3.7.15 或更新版本。(由 Sergey Fedoseev 和 Erlend " "E. Aasland 在 :issue:`40744` 和 :issue:`40810` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1994 +#: ../../whatsnew/3.10.rst:2001 msgid "" "The :mod:`atexit` module must now always be built as a built-in module. " "(Contributed by Victor Stinner in :issue:`42639`.)" @@ -3240,7 +3250,7 @@ msgstr "" ":mod:`atexit` 模組現在必須都被建置為內建模組。(由 Victor Stinner 在 :issue:" "`42639` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1997 +#: ../../whatsnew/3.10.rst:2004 msgid "" "Add :option:`--disable-test-modules` option to the ``configure`` script: " "don't build nor install test modules. (Contributed by Xavier de Gaye, Thomas " @@ -3250,7 +3260,7 @@ msgstr "" "不安裝測試模組。(由 Xavier de Gaye、Thomas Petazzoni 和 Peixing Xin 在 :" "issue:`27640` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2001 +#: ../../whatsnew/3.10.rst:2008 msgid "" "Add :option:`--with-wheel-pkg-dir=PATH option <--with-wheel-pkg-dir>` to the " "``./configure`` script. If specified, the :mod:`ensurepip` module looks for " @@ -3263,7 +3273,7 @@ msgstr "" "``setuptools`` 和 ``pip`` wheel 套件:如果兩者都存在,則使用這些 wheel 套件而" "不是 ensurepip 捆綁的 wheel 套件。" -#: ../../whatsnew/3.10.rst:2007 +#: ../../whatsnew/3.10.rst:2014 msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" @@ -3274,11 +3284,11 @@ msgstr "" "share/python-wheels/`` 目錄中安裝 wheel 套件,並且不安裝 ``ensurepip." "_bundled`` 套件。" -#: ../../whatsnew/3.10.rst:2012 +#: ../../whatsnew/3.10.rst:2019 msgid "(Contributed by Victor Stinner in :issue:`42856`.)" msgstr "(由 Victor Stinner 在 :issue:`42856` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2014 +#: ../../whatsnew/3.10.rst:2021 msgid "" "Add a new :option:`configure --without-static-libpython option <--without-" "static-libpython>` to not build the ``libpythonMAJOR.MINOR.a`` static " @@ -3288,11 +3298,11 @@ msgstr "" "libpython>` 以不建置 ``libpythonMAJOR.MINOR.a`` 靜態函式庫且不安裝 ``python." "o`` 目標檔案。" -#: ../../whatsnew/3.10.rst:2018 +#: ../../whatsnew/3.10.rst:2025 msgid "(Contributed by Victor Stinner in :issue:`43103`.)" msgstr "(由 Victor Stinner 在 :issue:`43103` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2020 +#: ../../whatsnew/3.10.rst:2027 msgid "" "The ``configure`` script now uses the ``pkg-config`` utility, if available, " "to detect the location of Tcl/Tk headers and libraries. As before, those " @@ -3305,7 +3315,7 @@ msgstr "" "includes`` 和 ``--with-tcltk-libs`` 配置選項顯式指定這些位置。(由 Manolis " "Stamatogiannakis 在 :issue:`42603` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2026 +#: ../../whatsnew/3.10.rst:2033 msgid "" "Add :option:`--with-openssl-rpath` option to ``configure`` script. The " "option simplifies building Python with a custom OpenSSL installation, e.g. " @@ -3317,15 +3327,15 @@ msgstr "" "openssl=/path/to/openssl --with-openssl-rpath=auto``。(由 Christian Heimes " "在 :issue:`43466` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2033 +#: ../../whatsnew/3.10.rst:2040 msgid "C API Changes" msgstr "C API 變更" -#: ../../whatsnew/3.10.rst:2036 +#: ../../whatsnew/3.10.rst:2043 msgid "PEP 652: Maintaining the Stable ABI" msgstr "PEP 652:維護穩定 ABI" -#: ../../whatsnew/3.10.rst:2038 +#: ../../whatsnew/3.10.rst:2045 msgid "" "The Stable ABI (Application Binary Interface) for extension modules or " "embedding Python is now explicitly defined. :ref:`stable` describes C API " @@ -3335,11 +3345,11 @@ msgstr "" "用於擴充模組或嵌入 Python 的穩定 ABI(應用程式二進位介面)現已明確定義。 :" "ref:`stable` 描述了 C API 和 ABI 穩定性保證以及使用穩定 ABI 的最佳實踐。" -#: ../../whatsnew/3.10.rst:2043 +#: ../../whatsnew/3.10.rst:2050 msgid "(Contributed by Petr Viktorin in :pep:`652` and :issue:`43795`.)" msgstr "(由 Petr Viktorin 在 :pep:`652` 和 :issue:`43795` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2048 +#: ../../whatsnew/3.10.rst:2055 msgid "" "The result of :c:func:`PyNumber_Index` now always has exact type :class:" "`int`. Previously, the result could have been an instance of a subclass of " @@ -3349,7 +3359,7 @@ msgstr "" "果可能是 ``int`` 子類別的實例。(由 Serhiy Storchaka 在 :issue:`40792` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:2052 +#: ../../whatsnew/3.10.rst:2059 msgid "" "Add a new :c:member:`~PyConfig.orig_argv` member to the :c:type:`PyConfig` " "structure: the list of the original command line arguments passed to the " @@ -3359,7 +3369,7 @@ msgstr "" "遞給 Python 可執行檔案的原始命令列參數列表。(由 Victor Stinner 在 :issue:" "`23427` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2057 +#: ../../whatsnew/3.10.rst:2064 msgid "" "The :c:func:`PyDateTime_DATE_GET_TZINFO` and :c:func:" "`PyDateTime_TIME_GET_TZINFO` macros have been added for accessing the " @@ -3371,7 +3381,7 @@ msgstr "" "class:`datetime.time` 物件的 ``tzinfo`` 屬性。(由 Zackery Spytz 在 :issue:" "`30155` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2063 +#: ../../whatsnew/3.10.rst:2070 msgid "" "Add a :c:func:`PyCodec_Unregister` function to unregister a codec search " "function. (Contributed by Hai Shi in :issue:`41842`.)" @@ -3379,7 +3389,7 @@ msgstr "" "新增 :c:func:`PyCodec_Unregister` 函式來取消註冊編解碼器搜索函式。(由 Hai " "Shi 在 :issue:`41842` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2067 +#: ../../whatsnew/3.10.rst:2074 msgid "" "The :c:func:`PyIter_Send` function was added to allow sending value into " "iterator without raising ``StopIteration`` exception. (Contributed by " @@ -3388,7 +3398,7 @@ msgstr "" "新增了 :c:func:`PyIter_Send` 函式,以允許將值發送到疊代器中,而不會引發 " "``StopIteration`` 例外。(由 Vladimir Matveev 在 :issue:`41756` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2071 +#: ../../whatsnew/3.10.rst:2078 msgid "" "Add :c:func:`PyUnicode_AsUTF8AndSize` to the limited C API. (Contributed by " "Alex Gaynor in :issue:`41784`.)" @@ -3396,7 +3406,7 @@ msgstr "" "將 :c:func:`PyUnicode_AsUTF8AndSize` 新增到受限 C API (limited C API) 中。" "(由 Alex Gaynor 在 :issue:`41784` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2074 +#: ../../whatsnew/3.10.rst:2081 msgid "" "Add :c:func:`PyModule_AddObjectRef` function: similar to :c:func:" "`PyModule_AddObject` but don't steal a reference to the value on success. " @@ -3406,7 +3416,7 @@ msgstr "" "`PyModule_AddObject` 但成功時不竊取對值的參照。(由 Victor Stinner 在 :issue:" "`1635741` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2079 +#: ../../whatsnew/3.10.rst:2086 msgid "" "Add :c:func:`Py_NewRef` and :c:func:`Py_XNewRef` functions to increment the " "reference count of an object and return the object. (Contributed by Victor " @@ -3415,7 +3425,7 @@ msgstr "" "新增 :c:func:`Py_NewRef` 和 :c:func:`Py_XNewRef` 函式來增加物件的參照計數並回" "傳物件。 (由 Victor Stinner 在 :issue:`42262` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2083 +#: ../../whatsnew/3.10.rst:2090 msgid "" "The :c:func:`PyType_FromSpecWithBases` and :c:func:" "`PyType_FromModuleAndSpec` functions now accept a single class as the " @@ -3425,7 +3435,7 @@ msgstr "" "現在接受單個類別作為 *bases* 引數。(由 Serhiy Storchaka 在 :issue:`42423` 中" "貢獻。)" -#: ../../whatsnew/3.10.rst:2087 +#: ../../whatsnew/3.10.rst:2094 msgid "" "The :c:func:`PyType_FromModuleAndSpec` function now accepts NULL ``tp_doc`` " "slot. (Contributed by Hai Shi in :issue:`41832`.)" @@ -3433,7 +3443,7 @@ msgstr "" ":c:func:`PyType_FromModuleAndSpec` 函式現在接受 NULL ``tp_doc`` 槽位。(由 " "Hai Shi 在 :issue:`41832` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2091 +#: ../../whatsnew/3.10.rst:2098 msgid "" "The :c:func:`PyType_GetSlot` function can accept :ref:`static types `. (Contributed by Hai Shi and Petr Viktorin in :issue:`41073`.)" @@ -3441,7 +3451,7 @@ msgstr "" ":c:func:`PyType_GetSlot` 函式可以接受\\ :ref:`靜態型別 (static type) `。(由 Hai Shi 和 Petr Viktorin 在 :issue:`41073` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2095 +#: ../../whatsnew/3.10.rst:2102 msgid "" "Add a new :c:func:`PySet_CheckExact` function to the C-API to check if an " "object is an instance of :class:`set` but not an instance of a subtype. " @@ -3450,7 +3460,7 @@ msgstr "" "向 C-API 新增 :c:func:`PySet_CheckExact` 函式,以檢查物件是否是 :class:`set` " "的實例而不是子型別的實例。(由 Pablo Galindo 在 :issue:`43277` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2099 +#: ../../whatsnew/3.10.rst:2106 msgid "" "Add :c:func:`PyErr_SetInterruptEx` which allows passing a signal number to " "simulate. (Contributed by Antoine Pitrou in :issue:`43356`.)" @@ -3458,7 +3468,7 @@ msgstr "" "新增 :c:func:`PyErr_SetInterruptEx`,它允許傳遞信號編號來進行模擬。 (由 " "Antoine Pitrou 在 :issue:`43356` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2103 +#: ../../whatsnew/3.10.rst:2110 msgid "" "The limited C API is now supported if :ref:`Python is built in debug mode " "` (if the ``Py_DEBUG`` macro is defined). In the limited C API, " @@ -3478,7 +3488,7 @@ msgstr "" "C API 成為可能,因為自 Python 3.8 以來,:c:type:`PyObject` 結構在發布和除錯模" "式下是相同的(請參閱:issue:`36465`)。" -#: ../../whatsnew/3.10.rst:2113 +#: ../../whatsnew/3.10.rst:2120 msgid "" "The limited C API is still not supported in the :option:`--with-trace-refs` " "special build (``Py_TRACE_REFS`` macro). (Contributed by Victor Stinner in :" @@ -3487,7 +3497,7 @@ msgstr "" ":option:`--with-trace-refs` 特殊建置(``Py_TRACE_REFS`` 巨集)仍不支援受限 C " "API。(由 Victor Stinner 在 :issue:`43688` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2117 +#: ../../whatsnew/3.10.rst:2124 msgid "" "Add the :c:func:`Py_Is(x, y) ` function to test if the *x* object is " "the *y* object, the same as ``x is y`` in Python. Add also the :c:func:" @@ -3502,7 +3512,7 @@ msgstr "" "``True`` 單例或 ``False`` 單例。(由 Victor Stinner 在 :issue:`43753` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:2124 +#: ../../whatsnew/3.10.rst:2131 msgid "" "Add new functions to control the garbage collector from C code: :c:func:" "`PyGC_Enable()`, :c:func:`PyGC_Disable()`, :c:func:`PyGC_IsEnabled()`. These " @@ -3513,7 +3523,7 @@ msgstr "" "`PyGC_Disable()`、:c:func:`PyGC_IsEnabled()`。這些函式使得能夠從 C 程式碼啟" "用、停用和查詢垃圾收集器的狀態,而無需引入 :mod:`gc` 模組。" -#: ../../whatsnew/3.10.rst:2131 +#: ../../whatsnew/3.10.rst:2138 msgid "" "Add a new :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` type flag to disallow " "creating type instances. (Contributed by Victor Stinner in :issue:`43916`.)" @@ -3521,7 +3531,7 @@ msgstr "" "新增 :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` 型別旗標以禁止建立型別實" "例。(由 Victor Stinner 在 :issue:`43916` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2135 +#: ../../whatsnew/3.10.rst:2142 msgid "" "Add a new :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` type flag for creating " "immutable type objects: type attributes cannot be set nor deleted. " @@ -3531,7 +3541,7 @@ msgstr "" "設定或刪除型別屬性。(由 Victor Stinner 和 Erlend E. Aasland 在 :issue:" "`43908` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2142 +#: ../../whatsnew/3.10.rst:2149 msgid "" "The ``PY_SSIZE_T_CLEAN`` macro must now be defined to use :c:func:" "`PyArg_ParseTuple` and :c:func:`Py_BuildValue` formats which use ``#``: " @@ -3544,7 +3554,7 @@ msgstr "" "``u#``、``y#``、``z#``、``U#`` 和 ``Z#``。請參閱 :ref:`arg-parsing` 和 :pep:" "`353`。(由 Victor Stinner 在 :issue:`40943` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2148 +#: ../../whatsnew/3.10.rst:2155 msgid "" "Since :c:func:`Py_REFCNT()` is changed to the inline static function, " "``Py_REFCNT(obj) = new_refcnt`` must be replaced with ``Py_SET_REFCNT(obj, " @@ -3556,11 +3566,11 @@ msgstr "" "new_refcnt)`` :參見 :c:func:`Py_SET_REFCNT()` (自 Python 3.9 起可用)。為了" "向後相容,可以使用該巨集:" -#: ../../whatsnew/3.10.rst:2157 +#: ../../whatsnew/3.10.rst:2164 msgid "(Contributed by Victor Stinner in :issue:`39573`.)" msgstr "(由 Victor Stinner 在 :issue:`39573` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2159 +#: ../../whatsnew/3.10.rst:2166 msgid "" "Calling :c:func:`PyDict_GetItem` without :term:`GIL` held had been allowed " "for historical reason. It is no longer allowed. (Contributed by Victor " @@ -3570,7 +3580,7 @@ msgstr "" "`PyDict_GetItem` 是被允許的。目前已被禁止。(由 Victor Stinner 在 :issue:" "`40839` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2163 +#: ../../whatsnew/3.10.rst:2170 msgid "" "``PyUnicode_FromUnicode(NULL, size)`` and " "``PyUnicode_FromStringAndSize(NULL, size)`` raise ``DeprecationWarning`` " @@ -3582,7 +3592,7 @@ msgstr "" "分配沒有初始資料的 Unicode 物件。(由 Inada Naoki 在 :issue:`36346` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:2168 +#: ../../whatsnew/3.10.rst:2175 msgid "" "The private ``_PyUnicode_Name_CAPI`` structure of the PyCapsule API " "``unicodedata.ucnhash_CAPI`` has been moved to the internal C API. " @@ -3591,7 +3601,7 @@ msgstr "" "PyCapsule API ``unicodedata.ucnhash_CAPI`` 的私有 ``_PyUnicode_Name_CAPI`` 結" "構已移至內部 C API。(由 Victor Stinner 在 :issue:`42157` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2172 +#: ../../whatsnew/3.10.rst:2179 msgid "" ":c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:" "func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome` and :c:func:" @@ -3606,7 +3616,7 @@ msgstr "" "`Py_GetProgramName` 現在會回傳 ``NULL``。使用新的 :ref:`init-config` API 來獲" "取 :ref:`init-path-config`。(由 Victor Stinner 在 :issue:`42260` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2179 +#: ../../whatsnew/3.10.rst:2186 msgid "" ":c:func:`PyList_SET_ITEM`, :c:func:`PyTuple_SET_ITEM` and :c:func:" "`PyCell_SET` macros can no longer be used as l-value or r-value. For " @@ -3621,7 +3631,7 @@ msgstr "" "現編譯器錯誤。它可以防止如 ``if (PyList_SET_ITEM (a, b, c) < 0) ...`` 測試之" "類的錯誤。(由 Zackery Spytz 和 Victor Stinner 在 :issue:`30459` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2186 +#: ../../whatsnew/3.10.rst:2193 msgid "" "The non-limited API files ``odictobject.h``, ``parser_interface.h``, " "``picklebufobject.h``, ``pyarena.h``, ``pyctype.h``, ``pydebug.h``, ``pyfpe." @@ -3637,7 +3647,7 @@ msgstr "" "``Python.h`` 中引入;請參閱 :ref:`api-includes`。如果直接引入它們,請考慮改為" "引入 ``Python.h``。(由 Nicholas Sim 在 :issue:`35134` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2194 +#: ../../whatsnew/3.10.rst:2201 msgid "" "Use the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` type flag to create immutable " "type objects. Do not rely on :c:macro:`Py_TPFLAGS_HEAPTYPE` to decide if a " @@ -3650,7 +3660,7 @@ msgstr "" "了 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE`。(由 Victor Stinner 和 Erlend E. " "Aasland 在 :issue:`35134` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2200 +#: ../../whatsnew/3.10.rst:2207 msgid "" "The undocumented function ``Py_FrozenMain`` has been removed from the " "limited API. The function is mainly useful for custom builds of Python. " @@ -3659,7 +3669,7 @@ msgstr "" "未以說明文件記錄的函式 ``Py_FrozenMain`` 已從受限 API 中刪除。該函式主要用於 " "Python 的自定義建置。(由 Petr Viktorin 在 :issue:`26241` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2207 +#: ../../whatsnew/3.10.rst:2214 msgid "" "The ``PyUnicode_InternImmortal()`` function is now deprecated and will be " "removed in Python 3.12: use :c:func:`PyUnicode_InternInPlace` instead. " @@ -3669,7 +3679,7 @@ msgstr "" "用 :c:func:`PyUnicode_InternInPlace`。(由 Victor Stinner 在 :issue:`41692` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:2215 +#: ../../whatsnew/3.10.rst:2222 msgid "" "Removed ``Py_UNICODE_str*`` functions manipulating ``Py_UNICODE*`` strings. " "(Contributed by Inada Naoki in :issue:`41123`.)" @@ -3677,7 +3687,7 @@ msgstr "" "刪除了操作 ``Py_UNICODE*`` 字串的 ``Py_UNICODE_str*`` 函式。(由 Inada Naoki " "在 :issue:`41123` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2218 +#: ../../whatsnew/3.10.rst:2225 msgid "" "``Py_UNICODE_strlen``: use :c:func:`PyUnicode_GetLength` or :c:macro:" "`PyUnicode_GET_LENGTH`" @@ -3685,7 +3695,7 @@ msgstr "" "``Py_UNICODE_strlen``:使用 :c:func:`PyUnicode_GetLength` 或 :c:macro:" "`PyUnicode_GET_LENGTH`" -#: ../../whatsnew/3.10.rst:2220 +#: ../../whatsnew/3.10.rst:2227 msgid "" "``Py_UNICODE_strcat``: use :c:func:`PyUnicode_CopyCharacters` or :c:func:" "`PyUnicode_FromFormat`" @@ -3693,7 +3703,7 @@ msgstr "" "``Py_UNICODE_strcat``:使用 :c:func:`PyUnicode_CopyCharacters` 或 :c:func:" "`PyUnicode_FromFormat`" -#: ../../whatsnew/3.10.rst:2222 +#: ../../whatsnew/3.10.rst:2229 msgid "" "``Py_UNICODE_strcpy``, ``Py_UNICODE_strncpy``: use :c:func:" "`PyUnicode_CopyCharacters` or :c:func:`PyUnicode_Substring`" @@ -3701,15 +3711,15 @@ msgstr "" "``Py_UNICODE_strcpy``、``Py_UNICODE_strncpy``:使用 :c:func:" "`PyUnicode_CopyCharacters` 或 :c:func:`PyUnicode_Substring`" -#: ../../whatsnew/3.10.rst:2224 +#: ../../whatsnew/3.10.rst:2231 msgid "``Py_UNICODE_strcmp``: use :c:func:`PyUnicode_Compare`" msgstr "``Py_UNICODE_strcmp``:使用 :c:func:`PyUnicode_Compare`" -#: ../../whatsnew/3.10.rst:2225 +#: ../../whatsnew/3.10.rst:2232 msgid "``Py_UNICODE_strncmp``: use :c:func:`PyUnicode_Tailmatch`" msgstr "``Py_UNICODE_strncmp``:使用 :c:func:`PyUnicode_Tailmatch`" -#: ../../whatsnew/3.10.rst:2226 +#: ../../whatsnew/3.10.rst:2233 msgid "" "``Py_UNICODE_strchr``, ``Py_UNICODE_strrchr``: use :c:func:" "`PyUnicode_FindChar`" @@ -3717,7 +3727,7 @@ msgstr "" "``Py_UNICODE_strchr``、``Py_UNICODE_strrchr``:使用 :c:func:" "`PyUnicode_FindChar`" -#: ../../whatsnew/3.10.rst:2229 +#: ../../whatsnew/3.10.rst:2236 msgid "" "Removed ``PyUnicode_GetMax()``. Please migrate to new (:pep:`393`) APIs. " "(Contributed by Inada Naoki in :issue:`41103`.)" @@ -3725,7 +3735,7 @@ msgstr "" "刪除了 ``PyUnicode_GetMax()``。請改用新的 (:pep:`393`) API。(由 Inada Naoki " "在 :issue:`41103` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2232 +#: ../../whatsnew/3.10.rst:2239 msgid "" "Removed ``PyLong_FromUnicode()``. Please migrate to :c:func:" "`PyLong_FromUnicodeObject`. (Contributed by Inada Naoki in :issue:`41103`.)" @@ -3733,7 +3743,7 @@ msgstr "" "刪除了 ``PyLong_FromUnicode()``。請改用 :c:func:`PyLong_FromUnicodeObject`。" "(由 Inada Naoki 在 :issue:`41103` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2235 +#: ../../whatsnew/3.10.rst:2242 msgid "" "Removed ``PyUnicode_AsUnicodeCopy()``. Please use :c:func:" "`PyUnicode_AsUCS4Copy` or :c:func:`PyUnicode_AsWideCharString` (Contributed " @@ -3743,7 +3753,7 @@ msgstr "" "或 :c:func:`PyUnicode_AsWideCharString` (由 Inada Naoki 在 :issue:`41103` 中" "貢獻。)" -#: ../../whatsnew/3.10.rst:2239 +#: ../../whatsnew/3.10.rst:2246 msgid "" "Removed ``_Py_CheckRecursionLimit`` variable: it has been replaced by " "``ceval.recursion_limit`` of the :c:type:`PyInterpreterState` structure. " @@ -3753,7 +3763,7 @@ msgstr "" "結構的 ``ceval.recursion_limit`` 取代。(由 Victor Stinner 在 :issue:`41834` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:2243 +#: ../../whatsnew/3.10.rst:2250 msgid "" "Removed undocumented macros ``Py_ALLOW_RECURSION`` and " "``Py_END_ALLOW_RECURSION`` and the ``recursion_critical`` field of the :c:" @@ -3764,7 +3774,7 @@ msgstr "" "``Py_END_ALLOW_RECURSION`` 以及 :c:type:`PyInterpreterState` 結構的 " "``recursion_ritic`` 欄位。(由 Serhiy Storchaka 在 :issue:`41936` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2248 +#: ../../whatsnew/3.10.rst:2255 msgid "" "Removed the undocumented ``PyOS_InitInterrupts()`` function. Initializing " "Python already implicitly installs signal handlers: see :c:member:`PyConfig." @@ -3774,7 +3784,7 @@ msgstr "" "式安裝信號處理程式:請參閱 :c:member:`PyConfig.install_signal_handlers`。" "(由 Victor Stinner 在 :issue:`41713` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2253 +#: ../../whatsnew/3.10.rst:2260 msgid "" "Remove the ``PyAST_Validate()`` function. It is no longer possible to build " "a AST object (``mod_ty`` type) with the public C API. The function was " @@ -3785,35 +3795,35 @@ msgstr "" "(``mod_ty`` 類型)。該函式已被排除在受限 C API 之外 (:pep:`384`)。(由 " "Victor Stinner 在 :issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2258 +#: ../../whatsnew/3.10.rst:2265 msgid "Remove the ``symtable.h`` header file and the undocumented functions:" msgstr "刪除 ``symtable.h`` 標頭檔和未被說明文件記錄的函式:" -#: ../../whatsnew/3.10.rst:2260 +#: ../../whatsnew/3.10.rst:2267 msgid "``PyST_GetScope()``" msgstr "``PyST_GetScope()``" -#: ../../whatsnew/3.10.rst:2261 +#: ../../whatsnew/3.10.rst:2268 msgid "``PySymtable_Build()``" msgstr "``PySymtable_Build()``" -#: ../../whatsnew/3.10.rst:2262 +#: ../../whatsnew/3.10.rst:2269 msgid "``PySymtable_BuildObject()``" msgstr "``PySymtable_BuildObject()``" -#: ../../whatsnew/3.10.rst:2263 +#: ../../whatsnew/3.10.rst:2270 msgid "``PySymtable_Free()``" msgstr "``PySymtable_Free()``" -#: ../../whatsnew/3.10.rst:2264 +#: ../../whatsnew/3.10.rst:2271 msgid "``Py_SymtableString()``" msgstr "``Py_SymtableString()``" -#: ../../whatsnew/3.10.rst:2265 +#: ../../whatsnew/3.10.rst:2272 msgid "``Py_SymtableStringObject()``" msgstr "``Py_SymtableStringObject()``" -#: ../../whatsnew/3.10.rst:2267 +#: ../../whatsnew/3.10.rst:2274 msgid "" "The ``Py_SymtableString()`` function was part the stable ABI by mistake but " "it could not be used, because the ``symtable.h`` header file was excluded " @@ -3822,7 +3832,7 @@ msgstr "" "``Py_SymtableString()`` 函式錯誤地成為穩定 ABI 的一部分,但它因為 ``symtable." "h`` 標頭檔被排除在受限 C API 之外而無法使用。" -#: ../../whatsnew/3.10.rst:2271 +#: ../../whatsnew/3.10.rst:2278 msgid "" "Use Python :mod:`symtable` module instead. (Contributed by Victor Stinner " "in :issue:`43244`.)" @@ -3830,7 +3840,7 @@ msgstr "" "請改用 Python :mod:`symtable` 模組。(由 Victor Stinner 在 :issue:`43244` 中" "貢獻。)" -#: ../../whatsnew/3.10.rst:2274 +#: ../../whatsnew/3.10.rst:2281 msgid "" "Remove :c:func:`PyOS_ReadlineFunctionPointer` from the limited C API headers " "and from ``python3.dll``, the library that provides the stable ABI on " @@ -3841,7 +3851,7 @@ msgstr "" "刪除 :c:func:`PyOS_ReadlineFunctionPointer`。由於該函式採用 FILE* 引數,因此" "無法保證其 ABI 穩定性。(由 Petr Viktorin 在 :issue:`43868` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2280 +#: ../../whatsnew/3.10.rst:2287 msgid "" "Remove ``ast.h``, ``asdl.h``, and ``Python-ast.h`` header files. These " "functions were undocumented and excluded from the limited C API. Most names " @@ -3857,54 +3867,54 @@ msgstr "" "Windows ```` 標頭使用的 ``Yield`` 有名稱衝突。請改用 Python :mod:" "`ast` 模組。(由 Victor Stinner 在 :issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2288 +#: ../../whatsnew/3.10.rst:2295 msgid "" "Remove the compiler and parser functions using ``struct _mod`` type, because " "the public AST C API was removed:" msgstr "" "刪除編譯器和使用 ``struct _mod`` 的剖析器函式,因為公開 AST C API 已被刪除:" -#: ../../whatsnew/3.10.rst:2291 +#: ../../whatsnew/3.10.rst:2298 msgid "``PyAST_Compile()``" msgstr "``PyAST_Compile()``" -#: ../../whatsnew/3.10.rst:2292 +#: ../../whatsnew/3.10.rst:2299 msgid "``PyAST_CompileEx()``" msgstr "``PyAST_CompileEx()``" -#: ../../whatsnew/3.10.rst:2293 +#: ../../whatsnew/3.10.rst:2300 msgid "``PyAST_CompileObject()``" msgstr "``PyAST_CompileObject()``" -#: ../../whatsnew/3.10.rst:2294 +#: ../../whatsnew/3.10.rst:2301 msgid "``PyFuture_FromAST()``" msgstr "``PyFuture_FromAST()``" -#: ../../whatsnew/3.10.rst:2295 +#: ../../whatsnew/3.10.rst:2302 msgid "``PyFuture_FromASTObject()``" msgstr "``PyFuture_FromASTObject()``" -#: ../../whatsnew/3.10.rst:2296 +#: ../../whatsnew/3.10.rst:2303 msgid "``PyParser_ASTFromFile()``" msgstr "``PyParser_ASTFromFile()``" -#: ../../whatsnew/3.10.rst:2297 +#: ../../whatsnew/3.10.rst:2304 msgid "``PyParser_ASTFromFileObject()``" msgstr "``PyParser_ASTFromFileObject()``" -#: ../../whatsnew/3.10.rst:2298 +#: ../../whatsnew/3.10.rst:2305 msgid "``PyParser_ASTFromFilename()``" msgstr "``PyParser_ASTFromFilename()``" -#: ../../whatsnew/3.10.rst:2299 +#: ../../whatsnew/3.10.rst:2306 msgid "``PyParser_ASTFromString()``" msgstr "``PyParser_ASTFromString()``" -#: ../../whatsnew/3.10.rst:2300 +#: ../../whatsnew/3.10.rst:2307 msgid "``PyParser_ASTFromStringObject()``" msgstr "``PyParser_ASTFromStringObject()``" -#: ../../whatsnew/3.10.rst:2302 +#: ../../whatsnew/3.10.rst:2309 msgid "" "These functions were undocumented and excluded from the limited C API. " "(Contributed by Victor Stinner in :issue:`43244`.)" @@ -3912,27 +3922,27 @@ msgstr "" "這些函式沒有文件記錄,並且被排除在受限 C API 之外。(由 Victor Stinner 在 :" "issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2305 +#: ../../whatsnew/3.10.rst:2312 msgid "Remove the ``pyarena.h`` header file with functions:" msgstr "刪除包含以下函式的 ``pyarena.h`` 標頭檔:" -#: ../../whatsnew/3.10.rst:2307 +#: ../../whatsnew/3.10.rst:2314 msgid "``PyArena_New()``" msgstr "``PyArena_New()``" -#: ../../whatsnew/3.10.rst:2308 +#: ../../whatsnew/3.10.rst:2315 msgid "``PyArena_Free()``" msgstr "``PyArena_Free()``" -#: ../../whatsnew/3.10.rst:2309 +#: ../../whatsnew/3.10.rst:2316 msgid "``PyArena_Malloc()``" msgstr "``PyArena_Malloc()``" -#: ../../whatsnew/3.10.rst:2310 +#: ../../whatsnew/3.10.rst:2317 msgid "``PyArena_AddPyObject()``" msgstr "``PyArena_AddPyObject()``" -#: ../../whatsnew/3.10.rst:2312 +#: ../../whatsnew/3.10.rst:2319 msgid "" "These functions were undocumented, excluded from the limited C API, and were " "only used internally by the compiler. (Contributed by Victor Stinner in :" @@ -3941,10 +3951,60 @@ msgstr "" "這些函式沒有文件記錄、被排除在受限 C API 之外,並僅被編譯器於內部使用。(由 " "Victor Stinner 在 :issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2316 +#: ../../whatsnew/3.10.rst:2323 msgid "" "The ``PyThreadState.use_tracing`` member has been removed to optimize " "Python. (Contributed by Mark Shannon in :issue:`43760`.)" msgstr "" "為了 Python 最佳化,已刪除 ``PyThreadState.use_tracing`` 成員。(由 Mark " "Shannon 在 :issue:`43760` 中貢獻。)" + +#: ../../whatsnew/3.10.rst:2328 +msgid "Notable security feature in 3.10.7" +msgstr "" + +#: ../../whatsnew/3.10.rst:2330 +msgid "" +"Converting between :class:`int` and :class:`str` in bases other than 2 " +"(binary), 4, 8 (octal), 16 (hexadecimal), or 32 such as base 10 (decimal) " +"now raises a :exc:`ValueError` if the number of digits in string form is " +"above a limit to avoid potential denial of service attacks due to the " +"algorithmic complexity. This is a mitigation for `CVE-2020-10735 `_. This limit can be " +"configured or disabled by environment variable, command line flag, or :mod:" +"`sys` APIs. See the :ref:`integer string conversion length limitation " +"` documentation. The default limit is 4300 digits in " +"string form." +msgstr "" + +#: ../../whatsnew/3.10.rst:2342 +msgid "Notable security feature in 3.10.8" +msgstr "" + +#: ../../whatsnew/3.10.rst:2344 +msgid "" +"The deprecated :mod:`!mailcap` module now refuses to inject unsafe text " +"(filenames, MIME types, parameters) into shell commands. Instead of using " +"such text, it will warn and act as if a match was not found (or for test " +"commands, as if the test failed). (Contributed by Petr Viktorin in :gh:" +"`98966`.)" +msgstr "" + +#: ../../whatsnew/3.10.rst:2351 +msgid "Notable changes in 3.10.12" +msgstr "" + +#: ../../whatsnew/3.10.rst:2354 +msgid "tarfile" +msgstr "" + +#: ../../whatsnew/3.10.rst:2356 +msgid "" +"The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " +"have a new a *filter* argument that allows limiting tar features than may be " +"surprising or dangerous, such as creating files outside the destination " +"directory. See :ref:`tarfile-extraction-filter` for details. In Python 3.12, " +"use without the *filter* argument will show a :exc:`DeprecationWarning`. In " +"Python 3.14, the default will switch to ``'data'``. (Contributed by Petr " +"Viktorin in :pep:`706`.)" +msgstr "" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index 0e776e4e55..4f6139fb59 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-03 20:44+0000\n" +"POT-Creation-Date: 2024-02-16 00:03+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -1140,7 +1140,7 @@ msgid "" "Hettinger in :issue:`17941`.)" msgstr "" -#: ../../whatsnew/3.6.rst:940 ../../whatsnew/3.6.rst:2282 +#: ../../whatsnew/3.6.rst:940 ../../whatsnew/3.6.rst:2295 msgid "" "The *verbose* and *rename* arguments for :func:`~collections.namedtuple` are " "now keyword-only. (Contributed by Raymond Hettinger in :issue:`25628`.)" @@ -1231,7 +1231,7 @@ msgstr "" msgid "(Contributed by Stefan Krah amd Mark Dickinson in :issue:`25928`.)" msgstr "(由 Stefan Krah 和 Mark Dickinson 於 :issue:`25928` 中貢獻。)" -#: ../../whatsnew/3.6.rst:1012 ../../whatsnew/3.6.rst:1986 +#: ../../whatsnew/3.6.rst:1012 ../../whatsnew/3.6.rst:1990 msgid "distutils" msgstr "distutils" @@ -1501,7 +1501,7 @@ msgid "" "button. (Contributed by Tal Einat in :issue:`1529353`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1199 ../../whatsnew/3.6.rst:2003 +#: ../../whatsnew/3.6.rst:1199 ../../whatsnew/3.6.rst:2007 msgid "importlib" msgstr "importlib" @@ -1596,7 +1596,7 @@ msgid "" "issue:`6766`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1268 ../../whatsnew/3.6.rst:2017 +#: ../../whatsnew/3.6.rst:1268 ../../whatsnew/3.6.rst:2021 msgid "os" msgstr "os" @@ -1701,7 +1701,7 @@ msgid "" "by Raymond Hettinger in :issue:`18844`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1345 ../../whatsnew/3.6.rst:2025 +#: ../../whatsnew/3.6.rst:1345 ../../whatsnew/3.6.rst:2029 msgid "re" msgstr "re" @@ -1843,7 +1843,7 @@ msgid "" "(Contributed by Martin Panter in :issue:`26721`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1445 ../../whatsnew/3.6.rst:2033 +#: ../../whatsnew/3.6.rst:1445 ../../whatsnew/3.6.rst:2037 msgid "ssl" msgstr "ssl" @@ -1892,32 +1892,39 @@ msgid "" "were added. (Contributed by Christian Heimes in :issue:`28085`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1477 +#: ../../whatsnew/3.6.rst:1475 +msgid "" +"Added :attr:`ssl.SSLContext.post_handshake_auth` to enable and :meth:`ssl." +"SSLSocket.verify_client_post_handshake` to initiate TLS 1.3 post-handshake " +"authentication. (Contributed by Christian Heimes in :gh:`78851`.)" +msgstr "" + +#: ../../whatsnew/3.6.rst:1481 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.6.rst:1479 +#: ../../whatsnew/3.6.rst:1483 msgid "" "A new :func:`~statistics.harmonic_mean` function has been added. " "(Contributed by Steven D'Aprano in :issue:`27181`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1484 +#: ../../whatsnew/3.6.rst:1488 msgid "struct" msgstr "struct" -#: ../../whatsnew/3.6.rst:1486 +#: ../../whatsnew/3.6.rst:1490 msgid "" ":mod:`struct` now supports IEEE 754 half-precision floats via the ``'e'`` " "format specifier. (Contributed by Eli Stevens, Mark Dickinson in :issue:" "`11734`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1492 +#: ../../whatsnew/3.6.rst:1496 msgid "subprocess" msgstr "subprocess" -#: ../../whatsnew/3.6.rst:1494 +#: ../../whatsnew/3.6.rst:1498 msgid "" ":class:`subprocess.Popen` destructor now emits a :exc:`ResourceWarning` " "warning if the child process is still running. Use the context manager " @@ -1926,7 +1933,7 @@ msgid "" "(Contributed by Victor Stinner in :issue:`26741`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1500 +#: ../../whatsnew/3.6.rst:1504 msgid "" "The :class:`subprocess.Popen` constructor and all functions that pass " "arguments through to it now accept *encoding* and *errors* arguments. " @@ -1934,18 +1941,18 @@ msgid "" "and *stderr* streams. (Contributed by Steve Dower in :issue:`6135`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1507 +#: ../../whatsnew/3.6.rst:1511 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.6.rst:1509 +#: ../../whatsnew/3.6.rst:1513 msgid "" "The new :func:`~sys.getfilesystemencodeerrors` function returns the name of " "the error mode used to convert between Unicode filenames and bytes " "filenames. (Contributed by Steve Dower in :issue:`27781`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1513 +#: ../../whatsnew/3.6.rst:1517 msgid "" "On Windows the return value of the :func:`~sys.getwindowsversion` function " "now includes the *platform_version* field which contains the accurate major " @@ -1954,31 +1961,31 @@ msgid "" "by Steve Dower in :issue:`27932`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1521 +#: ../../whatsnew/3.6.rst:1525 msgid "telnetlib" msgstr "telnetlib" -#: ../../whatsnew/3.6.rst:1523 +#: ../../whatsnew/3.6.rst:1527 msgid "" ":class:`~telnetlib.Telnet` is now a context manager (contributed by Stéphane " "Wirtel in :issue:`25485`)." msgstr "" -#: ../../whatsnew/3.6.rst:1528 +#: ../../whatsnew/3.6.rst:1532 msgid "time" msgstr "time" -#: ../../whatsnew/3.6.rst:1530 +#: ../../whatsnew/3.6.rst:1534 msgid "" "The :class:`~time.struct_time` attributes :attr:`tm_gmtoff` and :attr:" "`tm_zone` are now available on all platforms." msgstr "" -#: ../../whatsnew/3.6.rst:1535 +#: ../../whatsnew/3.6.rst:1539 msgid "timeit" msgstr "timeit" -#: ../../whatsnew/3.6.rst:1537 +#: ../../whatsnew/3.6.rst:1541 msgid "" "The new :meth:`Timer.autorange() ` convenience " "method has been added to call :meth:`Timer.timeit() ` " @@ -1986,17 +1993,17 @@ msgid "" "milliseconds. (Contributed by Steven D'Aprano in :issue:`6422`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1542 +#: ../../whatsnew/3.6.rst:1546 msgid "" ":mod:`timeit` now warns when there is substantial (4x) variance between best " "and worst times. (Contributed by Serhiy Storchaka in :issue:`23552`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1548 ../../whatsnew/3.6.rst:2050 +#: ../../whatsnew/3.6.rst:1552 ../../whatsnew/3.6.rst:2054 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.6.rst:1550 +#: ../../whatsnew/3.6.rst:1554 msgid "" "Added methods :meth:`~tkinter.Variable.trace_add`, :meth:`~tkinter.Variable." "trace_remove` and :meth:`~tkinter.Variable.trace_info` in the :class:" @@ -2007,52 +2014,52 @@ msgid "" "Serhiy Storchaka in :issue:`22115`)." msgstr "" -#: ../../whatsnew/3.6.rst:1563 +#: ../../whatsnew/3.6.rst:1567 msgid "traceback" msgstr "traceback" -#: ../../whatsnew/3.6.rst:1565 +#: ../../whatsnew/3.6.rst:1569 msgid "" "Both the traceback module and the interpreter's builtin exception display " "now abbreviate long sequences of repeated lines in tracebacks as shown in " "the following example::" msgstr "" -#: ../../whatsnew/3.6.rst:1580 +#: ../../whatsnew/3.6.rst:1584 msgid "(Contributed by Emanuel Barry in :issue:`26823`.)" msgstr "(由 Emanuel Barry 於 :issue:`26823` 中貢獻。)" -#: ../../whatsnew/3.6.rst:1584 +#: ../../whatsnew/3.6.rst:1588 msgid "tracemalloc" msgstr "tracemalloc" -#: ../../whatsnew/3.6.rst:1586 +#: ../../whatsnew/3.6.rst:1590 msgid "" "The :mod:`tracemalloc` module now supports tracing memory allocations in " "multiple different address spaces." msgstr "" -#: ../../whatsnew/3.6.rst:1589 +#: ../../whatsnew/3.6.rst:1593 msgid "" "The new :class:`~tracemalloc.DomainFilter` filter class has been added to " "filter block traces by their address space (domain)." msgstr "" -#: ../../whatsnew/3.6.rst:1592 +#: ../../whatsnew/3.6.rst:1596 msgid "(Contributed by Victor Stinner in :issue:`26588`.)" msgstr "(由 Victor Stinner 於 :issue:`26588` 中貢獻。)" -#: ../../whatsnew/3.6.rst:1598 +#: ../../whatsnew/3.6.rst:1602 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.6.rst:1600 +#: ../../whatsnew/3.6.rst:1604 msgid "" "Since the :mod:`typing` module is :term:`provisional `, all " "changes introduced in Python 3.6 have also been backported to Python 3.5.x." msgstr "" -#: ../../whatsnew/3.6.rst:1604 +#: ../../whatsnew/3.6.rst:1608 msgid "" "The :mod:`typing` module has a much improved support for generic type " "aliases. For example ``Dict[str, Tuple[S, T]]`` is now a valid type " @@ -2060,21 +2067,21 @@ msgid "" "com/python/typing/pull/195>`_.)" msgstr "" -#: ../../whatsnew/3.6.rst:1610 +#: ../../whatsnew/3.6.rst:1614 msgid "" "The :class:`typing.ContextManager` class has been added for representing :" "class:`contextlib.AbstractContextManager`. (Contributed by Brett Cannon in :" "issue:`25609`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1614 +#: ../../whatsnew/3.6.rst:1618 msgid "" "The :class:`typing.Collection` class has been added for representing :class:" "`collections.abc.Collection`. (Contributed by Ivan Levkivskyi in :issue:" "`27598`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1618 +#: ../../whatsnew/3.6.rst:1622 msgid "" "The :const:`typing.ClassVar` type construct has been added to mark class " "variables. As introduced in :pep:`526`, a variable annotation wrapped in " @@ -2084,7 +2091,7 @@ msgid "" "pull/280>`_.)" msgstr "" -#: ../../whatsnew/3.6.rst:1625 +#: ../../whatsnew/3.6.rst:1629 msgid "" "A new :const:`~typing.TYPE_CHECKING` constant that is assumed to be ``True`` " "by the static type checkers, but is ``False`` at runtime. (Contributed by " @@ -2092,38 +2099,38 @@ msgid "" "issues/230>`_.)" msgstr "" -#: ../../whatsnew/3.6.rst:1630 +#: ../../whatsnew/3.6.rst:1634 msgid "" "A new :func:`~typing.NewType` helper function has been added to create " "lightweight distinct types for annotations::" msgstr "" -#: ../../whatsnew/3.6.rst:1638 +#: ../../whatsnew/3.6.rst:1642 msgid "" "The static type checker will treat the new type as if it were a subclass of " "the original type. (Contributed by Ivan Levkivskyi in `Github #189 `_.)" msgstr "" -#: ../../whatsnew/3.6.rst:1644 +#: ../../whatsnew/3.6.rst:1648 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.6.rst:1646 +#: ../../whatsnew/3.6.rst:1650 msgid "" "The :mod:`unicodedata` module now uses data from `Unicode 9.0.0 `_. (Contributed by Benjamin Peterson.)" msgstr "" -#: ../../whatsnew/3.6.rst:1652 +#: ../../whatsnew/3.6.rst:1656 msgid "unittest.mock" msgstr "unittest.mock" -#: ../../whatsnew/3.6.rst:1654 +#: ../../whatsnew/3.6.rst:1658 msgid "The :class:`~unittest.mock.Mock` class has the following improvements:" msgstr "" -#: ../../whatsnew/3.6.rst:1656 +#: ../../whatsnew/3.6.rst:1660 msgid "" "Two new methods, :meth:`Mock.assert_called() ` and :meth:`Mock.assert_called_once() ` method now has " "two optional keyword only arguments: *return_value* and *side_effect*. " "(Contributed by Kushal Das in :issue:`21271`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1669 +#: ../../whatsnew/3.6.rst:1673 msgid "urllib.request" msgstr "urllib.request" -#: ../../whatsnew/3.6.rst:1671 +#: ../../whatsnew/3.6.rst:1675 msgid "" "If a HTTP request has a file or iterable body (other than a bytes object) " "but no ``Content-Length`` header, rather than throwing an error, :class:" @@ -2150,33 +2157,33 @@ msgid "" "encoding. (Contributed by Demian Brecht and Rolf Krahl in :issue:`12319`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1679 +#: ../../whatsnew/3.6.rst:1683 msgid "urllib.robotparser" msgstr "urllib.robotparser" -#: ../../whatsnew/3.6.rst:1681 +#: ../../whatsnew/3.6.rst:1685 msgid "" ":class:`~urllib.robotparser.RobotFileParser` now supports the ``Crawl-" "delay`` and ``Request-rate`` extensions. (Contributed by Nikolay Bogoychev " "in :issue:`16099`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1687 ../../whatsnew/3.6.rst:2058 +#: ../../whatsnew/3.6.rst:1691 ../../whatsnew/3.6.rst:2062 msgid "venv" msgstr "venv" -#: ../../whatsnew/3.6.rst:1689 +#: ../../whatsnew/3.6.rst:1693 msgid "" ":mod:`venv` accepts a new parameter ``--prompt``. This parameter provides an " "alternative prefix for the virtual environment. (Proposed by Łukasz " "Balcerzak and ported to 3.6 by Stéphane Wirtel in :issue:`22829`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1695 +#: ../../whatsnew/3.6.rst:1699 msgid "warnings" msgstr "warnings" -#: ../../whatsnew/3.6.rst:1697 +#: ../../whatsnew/3.6.rst:1701 msgid "" "A new optional *source* parameter has been added to the :func:`warnings." "warn_explicit` function: the destroyed object which emitted a :exc:" @@ -2185,65 +2192,65 @@ msgid "" "and :issue:`26567`)." msgstr "" -#: ../../whatsnew/3.6.rst:1703 +#: ../../whatsnew/3.6.rst:1707 msgid "" "When a :exc:`ResourceWarning` warning is logged, the :mod:`tracemalloc` " "module is now used to try to retrieve the traceback where the destroyed " "object was allocated." msgstr "" -#: ../../whatsnew/3.6.rst:1706 +#: ../../whatsnew/3.6.rst:1710 msgid "Example with the script ``example.py``::" msgstr "" -#: ../../whatsnew/3.6.rst:1716 +#: ../../whatsnew/3.6.rst:1720 msgid "Output of the command ``python3.6 -Wd -X tracemalloc=5 example.py``::" msgstr "" -#: ../../whatsnew/3.6.rst:1726 +#: ../../whatsnew/3.6.rst:1730 msgid "" "The \"Object allocated at\" traceback is new and is only displayed if :mod:" "`tracemalloc` is tracing Python memory allocations and if the :mod:" "`warnings` module was already imported." msgstr "" -#: ../../whatsnew/3.6.rst:1732 +#: ../../whatsnew/3.6.rst:1736 msgid "winreg" msgstr "winreg" -#: ../../whatsnew/3.6.rst:1734 +#: ../../whatsnew/3.6.rst:1738 msgid "" "Added the 64-bit integer type :data:`REG_QWORD `. " "(Contributed by Clement Rouault in :issue:`23026`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1739 +#: ../../whatsnew/3.6.rst:1743 msgid "winsound" msgstr "winsound" -#: ../../whatsnew/3.6.rst:1741 +#: ../../whatsnew/3.6.rst:1745 msgid "" "Allowed keyword arguments to be passed to :func:`Beep `, :" "func:`MessageBeep `, and :func:`PlaySound ` (:issue:`27982`)." msgstr "" -#: ../../whatsnew/3.6.rst:1747 +#: ../../whatsnew/3.6.rst:1751 msgid "xmlrpc.client" msgstr "xmlrpc.client" -#: ../../whatsnew/3.6.rst:1749 +#: ../../whatsnew/3.6.rst:1753 msgid "" "The :mod:`xmlrpc.client` module now supports unmarshalling additional data " "types used by the Apache XML-RPC implementation for numerics and ``None``. " "(Contributed by Serhiy Storchaka in :issue:`26885`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1756 +#: ../../whatsnew/3.6.rst:1760 msgid "zipfile" msgstr "zipfile" -#: ../../whatsnew/3.6.rst:1758 +#: ../../whatsnew/3.6.rst:1762 msgid "" "A new :meth:`ZipInfo.from_file() ` class method " "allows making a :class:`~zipfile.ZipInfo` instance from a filesystem file. A " @@ -2252,29 +2259,29 @@ msgid "" "(Contributed by Thomas Kluyver in :issue:`26039`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1764 +#: ../../whatsnew/3.6.rst:1768 msgid "" "The :meth:`ZipFile.open() ` method can now be used to " "write data into a ZIP file, as well as for extracting data. (Contributed by " "Thomas Kluyver in :issue:`26039`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1770 +#: ../../whatsnew/3.6.rst:1774 msgid "zlib" msgstr "zlib" -#: ../../whatsnew/3.6.rst:1772 +#: ../../whatsnew/3.6.rst:1776 msgid "" "The :func:`~zlib.compress` and :func:`~zlib.decompress` functions now accept " "keyword arguments. (Contributed by Aviv Palivoda in :issue:`26243` and Xiang " "Zhang in :issue:`16764` respectively.)" msgstr "" -#: ../../whatsnew/3.6.rst:1779 +#: ../../whatsnew/3.6.rst:1783 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.6.rst:1781 +#: ../../whatsnew/3.6.rst:1785 msgid "" "The Python interpreter now uses a 16-bit wordcode instead of bytecode which " "made a number of opcode optimizations possible. (Contributed by Demur Rumed " @@ -2282,79 +2289,79 @@ msgid "" "`26647` and :issue:`28050`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1786 +#: ../../whatsnew/3.6.rst:1790 msgid "" "The :class:`asyncio.Future` class now has an optimized C implementation. " "(Contributed by Yury Selivanov and INADA Naoki in :issue:`26081`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1789 +#: ../../whatsnew/3.6.rst:1793 msgid "" "The :class:`asyncio.Task` class now has an optimized C implementation. " "(Contributed by Yury Selivanov in :issue:`28544`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1792 +#: ../../whatsnew/3.6.rst:1796 msgid "" "Various implementation improvements in the :mod:`typing` module (such as " "caching of generic types) allow up to 30 times performance improvements and " "reduced memory footprint." msgstr "" -#: ../../whatsnew/3.6.rst:1796 +#: ../../whatsnew/3.6.rst:1800 msgid "" "The ASCII decoder is now up to 60 times as fast for error handlers " "``surrogateescape``, ``ignore`` and ``replace`` (Contributed by Victor " "Stinner in :issue:`24870`)." msgstr "" -#: ../../whatsnew/3.6.rst:1800 +#: ../../whatsnew/3.6.rst:1804 msgid "" "The ASCII and the Latin1 encoders are now up to 3 times as fast for the " "error handler ``surrogateescape`` (Contributed by Victor Stinner in :issue:" "`25227`)." msgstr "" -#: ../../whatsnew/3.6.rst:1804 +#: ../../whatsnew/3.6.rst:1808 msgid "" "The UTF-8 encoder is now up to 75 times as fast for error handlers " "``ignore``, ``replace``, ``surrogateescape``, ``surrogatepass`` (Contributed " "by Victor Stinner in :issue:`25267`)." msgstr "" -#: ../../whatsnew/3.6.rst:1808 +#: ../../whatsnew/3.6.rst:1812 msgid "" "The UTF-8 decoder is now up to 15 times as fast for error handlers " "``ignore``, ``replace`` and ``surrogateescape`` (Contributed by Victor " "Stinner in :issue:`25301`)." msgstr "" -#: ../../whatsnew/3.6.rst:1812 +#: ../../whatsnew/3.6.rst:1816 msgid "" "``bytes % args`` is now up to 2 times faster. (Contributed by Victor Stinner " "in :issue:`25349`)." msgstr "" -#: ../../whatsnew/3.6.rst:1815 +#: ../../whatsnew/3.6.rst:1819 msgid "" "``bytearray % args`` is now between 2.5 and 5 times faster. (Contributed by " "Victor Stinner in :issue:`25399`)." msgstr "" -#: ../../whatsnew/3.6.rst:1818 +#: ../../whatsnew/3.6.rst:1822 msgid "" "Optimize :meth:`bytes.fromhex` and :meth:`bytearray.fromhex`: they are now " "between 2x and 3.5x faster. (Contributed by Victor Stinner in :issue:" "`25401`)." msgstr "" -#: ../../whatsnew/3.6.rst:1821 +#: ../../whatsnew/3.6.rst:1825 msgid "" "Optimize ``bytes.replace(b'', b'.')`` and ``bytearray.replace(b'', b'.')``: " "up to 80% faster. (Contributed by Josh Snider in :issue:`26574`)." msgstr "" -#: ../../whatsnew/3.6.rst:1824 +#: ../../whatsnew/3.6.rst:1828 msgid "" "Allocator functions of the :c:func:`PyMem_Malloc` domain (:c:macro:" "`PYMEM_DOMAIN_MEM`) now use the :ref:`pymalloc memory allocator ` " @@ -2364,14 +2371,14 @@ msgid "" "(Contributed by Victor Stinner in :issue:`26249`)." msgstr "" -#: ../../whatsnew/3.6.rst:1831 +#: ../../whatsnew/3.6.rst:1835 msgid "" ":func:`pickle.load` and :func:`pickle.loads` are now up to 10% faster when " "deserializing many small objects (Contributed by Victor Stinner in :issue:" "`27056`)." msgstr "" -#: ../../whatsnew/3.6.rst:1835 +#: ../../whatsnew/3.6.rst:1839 msgid "" "Passing :term:`keyword arguments ` to a function has an " "overhead in comparison with passing :term:`positional arguments ` must now be held when allocator " "functions of :c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) " @@ -2444,72 +2451,72 @@ msgid "" "called." msgstr "" -#: ../../whatsnew/3.6.rst:1880 +#: ../../whatsnew/3.6.rst:1884 msgid "" "New :c:func:`Py_FinalizeEx` API which indicates if flushing buffered data " "failed. (Contributed by Martin Panter in :issue:`5319`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1884 +#: ../../whatsnew/3.6.rst:1888 msgid "" ":c:func:`PyArg_ParseTupleAndKeywords` now supports :ref:`positional-only " "parameters `. Positional-only parameters are " "defined by empty names. (Contributed by Serhiy Storchaka in :issue:`26282`)." msgstr "" -#: ../../whatsnew/3.6.rst:1889 +#: ../../whatsnew/3.6.rst:1893 msgid "" "``PyTraceback_Print`` method now abbreviates long sequences of repeated " "lines as ``\"[Previous line repeated {count} more times]\"``. (Contributed " "by Emanuel Barry in :issue:`26823`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1893 +#: ../../whatsnew/3.6.rst:1897 msgid "" "The new :c:func:`PyErr_SetImportErrorSubclass` function allows for " "specifying a subclass of :exc:`ImportError` to raise. (Contributed by Eric " "Snow in :issue:`15767`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1897 +#: ../../whatsnew/3.6.rst:1901 msgid "" "The new :c:func:`PyErr_ResourceWarning` function can be used to generate a :" "exc:`ResourceWarning` providing the source of the resource allocation. " "(Contributed by Victor Stinner in :issue:`26567`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1901 +#: ../../whatsnew/3.6.rst:1905 msgid "" "The new :c:func:`PyOS_FSPath` function returns the file system " "representation of a :term:`path-like object`. (Contributed by Brett Cannon " "in :issue:`27186`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1905 +#: ../../whatsnew/3.6.rst:1909 msgid "" "The :c:func:`PyUnicode_FSConverter` and :c:func:`PyUnicode_FSDecoder` " "functions will now accept :term:`path-like objects `." msgstr "" -#: ../../whatsnew/3.6.rst:1910 +#: ../../whatsnew/3.6.rst:1914 msgid "Other Improvements" msgstr "" -#: ../../whatsnew/3.6.rst:1912 +#: ../../whatsnew/3.6.rst:1916 msgid "" "When :option:`--version` (short form: :option:`-V`) is supplied twice, " "Python prints :data:`sys.version` for detailed information." msgstr "" -#: ../../whatsnew/3.6.rst:1923 +#: ../../whatsnew/3.6.rst:1927 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.6.rst:1926 +#: ../../whatsnew/3.6.rst:1930 msgid "New Keywords" msgstr "新關鍵字" -#: ../../whatsnew/3.6.rst:1928 +#: ../../whatsnew/3.6.rst:1932 msgid "" "``async`` and ``await`` are not recommended to be used as variable, class, " "function or module names. Introduced by :pep:`492` in Python 3.5, they will " @@ -2517,18 +2524,18 @@ msgid "" "``async`` or ``await`` as names will generate a :exc:`DeprecationWarning`." msgstr "" -#: ../../whatsnew/3.6.rst:1935 +#: ../../whatsnew/3.6.rst:1939 msgid "Deprecated Python behavior" msgstr "" -#: ../../whatsnew/3.6.rst:1937 +#: ../../whatsnew/3.6.rst:1941 msgid "" "Raising the :exc:`StopIteration` exception inside a generator will now " "generate a :exc:`DeprecationWarning`, and will trigger a :exc:`RuntimeError` " "in Python 3.7. See :ref:`whatsnew-pep-479` for details." msgstr "" -#: ../../whatsnew/3.6.rst:1941 +#: ../../whatsnew/3.6.rst:1945 msgid "" "The :meth:`__aiter__` method is now expected to return an asynchronous " "iterator directly instead of returning an awaitable as previously. Doing the " @@ -2537,7 +2544,7 @@ msgid "" "`27243`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1947 +#: ../../whatsnew/3.6.rst:1951 msgid "" "A backslash-character pair that is not a valid escape sequence now generates " "a :exc:`DeprecationWarning`. Although this will eventually become a :exc:" @@ -2545,7 +2552,7 @@ msgid "" "Emanuel Barry in :issue:`27364`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1952 +#: ../../whatsnew/3.6.rst:1956 msgid "" "When performing a relative import, falling back on ``__name__`` and " "``__path__`` from the calling module when ``__spec__`` or ``__package__`` " @@ -2553,35 +2560,35 @@ msgid "" "Ames in :issue:`25791`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1959 +#: ../../whatsnew/3.6.rst:1963 msgid "Deprecated Python modules, functions and methods" msgstr "" -#: ../../whatsnew/3.6.rst:1962 +#: ../../whatsnew/3.6.rst:1966 msgid "asynchat" msgstr "asynchat" -#: ../../whatsnew/3.6.rst:1964 +#: ../../whatsnew/3.6.rst:1968 msgid "" "The :mod:`!asynchat` has been deprecated in favor of :mod:`asyncio`. " "(Contributed by Mariatta in :issue:`25002`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1969 +#: ../../whatsnew/3.6.rst:1973 msgid "asyncore" msgstr "asyncore" -#: ../../whatsnew/3.6.rst:1971 +#: ../../whatsnew/3.6.rst:1975 msgid "" "The :mod:`!asyncore` has been deprecated in favor of :mod:`asyncio`. " "(Contributed by Mariatta in :issue:`25002`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1976 +#: ../../whatsnew/3.6.rst:1980 msgid "dbm" msgstr "dbm" -#: ../../whatsnew/3.6.rst:1978 +#: ../../whatsnew/3.6.rst:1982 msgid "" "Unlike other :mod:`dbm` implementations, the :mod:`dbm.dumb` module creates " "databases with the ``'rw'`` mode and allows modifying the database opened " @@ -2589,7 +2596,7 @@ msgid "" "in 3.8. (Contributed by Serhiy Storchaka in :issue:`21708`.)" msgstr "" -#: ../../whatsnew/3.6.rst:1988 +#: ../../whatsnew/3.6.rst:1992 msgid "" "The undocumented ``extra_path`` argument to the ``distutils.Distribution`` " "constructor is now considered deprecated and will raise a warning if set. " @@ -2597,17 +2604,17 @@ msgid "" "issue:`27919` for details." msgstr "" -#: ../../whatsnew/3.6.rst:1995 +#: ../../whatsnew/3.6.rst:1999 msgid "grp" msgstr "grp" -#: ../../whatsnew/3.6.rst:1997 +#: ../../whatsnew/3.6.rst:2001 msgid "" "The support of non-integer arguments in :func:`~grp.getgrgid` has been " "deprecated. (Contributed by Serhiy Storchaka in :issue:`26129`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2005 +#: ../../whatsnew/3.6.rst:2009 msgid "" "The :meth:`importlib.machinery.SourceFileLoader.load_module` and :meth:" "`importlib.machinery.SourcelessFileLoader.load_module` methods are now " @@ -2617,14 +2624,14 @@ msgid "" "exec_module`." msgstr "" -#: ../../whatsnew/3.6.rst:2012 +#: ../../whatsnew/3.6.rst:2016 msgid "" "The :class:`importlib.machinery.WindowsRegistryFinder` class is now " "deprecated. As of 3.6.0, it is still added to :data:`sys.meta_path` by " "default (on Windows), but this may change in future releases." msgstr "" -#: ../../whatsnew/3.6.rst:2019 +#: ../../whatsnew/3.6.rst:2023 msgid "" "Undocumented support of general :term:`bytes-like objects ` as paths in :mod:`os` functions, :func:`compile` and similar " @@ -2632,7 +2639,7 @@ msgid "" "`25791` and :issue:`26754`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2027 +#: ../../whatsnew/3.6.rst:2031 msgid "" "Support for inline flags ``(?letters)`` in the middle of the regular " "expression has been deprecated and will be removed in a future Python " @@ -2640,14 +2647,14 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`22493`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2035 +#: ../../whatsnew/3.6.rst:2039 msgid "" "OpenSSL 0.9.8, 1.0.0 and 1.0.1 are deprecated and no longer supported. In " "the future the :mod:`ssl` module will require at least OpenSSL 1.0.2 or " "1.1.0." msgstr "" -#: ../../whatsnew/3.6.rst:2039 +#: ../../whatsnew/3.6.rst:2043 msgid "" "SSL-related arguments like ``certfile``, ``keyfile`` and ``check_hostname`` " "in :mod:`ftplib`, :mod:`http.client`, :mod:`imaplib`, :mod:`poplib`, and :" @@ -2655,7 +2662,7 @@ msgid "" "Christian Heimes in :issue:`28022`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2044 +#: ../../whatsnew/3.6.rst:2048 msgid "" "A couple of protocols and functions of the :mod:`ssl` module are now " "deprecated. Some features will no longer be available in future versions of " @@ -2663,13 +2670,13 @@ msgid "" "(Contributed by Christian Heimes in :issue:`28022` and :issue:`26470`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2052 +#: ../../whatsnew/3.6.rst:2056 msgid "" "The :mod:`tkinter.tix` module is now deprecated. :mod:`tkinter` users " "should use :mod:`tkinter.ttk` instead." msgstr "" -#: ../../whatsnew/3.6.rst:2060 +#: ../../whatsnew/3.6.rst:2064 msgid "" "The ``pyvenv`` script has been deprecated in favour of ``python3 -m venv``. " "This prevents confusion as to what Python interpreter ``pyvenv`` is " @@ -2677,11 +2684,22 @@ msgid "" "environment. (Contributed by Brett Cannon in :issue:`25154`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2067 +#: ../../whatsnew/3.6.rst:2071 +msgid "xml" +msgstr "" + +#: ../../whatsnew/3.6.rst:2073 +msgid "" +"As mitigation against DTD and external entity retrieval, the :mod:`xml.dom." +"minidom` and :mod:`xml.sax` modules no longer process external entities by " +"default. (Contributed by Christian Heimes in :gh:`61441`.)" +msgstr "" + +#: ../../whatsnew/3.6.rst:2080 msgid "Deprecated functions and types of the C API" msgstr "" -#: ../../whatsnew/3.6.rst:2069 +#: ../../whatsnew/3.6.rst:2082 msgid "" "Undocumented functions :c:func:`!PyUnicode_AsEncodedObject`, :c:func:`!" "PyUnicode_AsDecodedObject`, :c:func:`!PyUnicode_AsEncodedUnicode` and :c:" @@ -2689,11 +2707,11 @@ msgid "" "codec based API ` instead." msgstr "" -#: ../../whatsnew/3.6.rst:2076 +#: ../../whatsnew/3.6.rst:2089 msgid "Deprecated Build Options" msgstr "" -#: ../../whatsnew/3.6.rst:2078 +#: ../../whatsnew/3.6.rst:2091 msgid "" "The ``--with-system-ffi`` configure flag is now on by default on non-macOS " "UNIX platforms. It may be disabled by using ``--without-system-ffi``, but " @@ -2702,15 +2720,15 @@ msgid "" "the ``--with-system-ffi`` flag when building their system Python." msgstr "" -#: ../../whatsnew/3.6.rst:2086 +#: ../../whatsnew/3.6.rst:2099 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.6.rst:2089 +#: ../../whatsnew/3.6.rst:2102 msgid "API and Feature Removals" msgstr "" -#: ../../whatsnew/3.6.rst:2091 +#: ../../whatsnew/3.6.rst:2104 msgid "" "Unknown escapes consisting of ``'\\'`` and an ASCII letter in regular " "expressions will now cause an error. In replacement templates for :func:`re." @@ -2718,14 +2736,14 @@ msgid "" "now only be used with binary patterns." msgstr "" -#: ../../whatsnew/3.6.rst:2096 +#: ../../whatsnew/3.6.rst:2109 msgid "" "``inspect.getmoduleinfo()`` was removed (was deprecated since CPython 3.3). :" "func:`inspect.getmodulename` should be used for obtaining the module name " "for a given path. (Contributed by Yury Selivanov in :issue:`13248`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2101 +#: ../../whatsnew/3.6.rst:2114 msgid "" "``traceback.Ignore`` class and ``traceback.usage``, ``traceback.modname``, " "``traceback.fullmodname``, ``traceback.find_lines_from_code``, ``traceback." @@ -2735,14 +2753,14 @@ msgid "" "equivalent functionality is available from private methods." msgstr "" -#: ../../whatsnew/3.6.rst:2108 +#: ../../whatsnew/3.6.rst:2121 msgid "" "The ``tk_menuBar()`` and ``tk_bindForTraversal()`` dummy methods in :mod:" "`tkinter` widget classes were removed (corresponding Tk commands were " "obsolete since Tk 4.0)." msgstr "" -#: ../../whatsnew/3.6.rst:2112 +#: ../../whatsnew/3.6.rst:2125 msgid "" "The :meth:`~zipfile.ZipFile.open` method of the :class:`zipfile.ZipFile` " "class no longer supports the ``'U'`` mode (was deprecated since Python 3.4). " @@ -2750,7 +2768,7 @@ msgid "" "`universal newlines` mode." msgstr "" -#: ../../whatsnew/3.6.rst:2117 +#: ../../whatsnew/3.6.rst:2130 msgid "" "The undocumented ``IN``, ``CDROM``, ``DLFCN``, ``TYPES``, ``CDIO``, and " "``STROPTS`` modules have been removed. They had been available in the " @@ -2761,25 +2779,25 @@ msgid "" "blob/v3.6.15/Tools/scripts/h2py.py>`_." msgstr "" -#: ../../whatsnew/3.6.rst:2125 +#: ../../whatsnew/3.6.rst:2138 msgid "The deprecated ``asynchat.fifo`` class has been removed." msgstr "" -#: ../../whatsnew/3.6.rst:2129 +#: ../../whatsnew/3.6.rst:2142 msgid "Porting to Python 3.6" msgstr "" -#: ../../whatsnew/3.6.rst:2131 +#: ../../whatsnew/3.6.rst:2144 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.6.rst:2135 +#: ../../whatsnew/3.6.rst:2148 msgid "Changes in 'python' Command Behavior" msgstr "" -#: ../../whatsnew/3.6.rst:2137 +#: ../../whatsnew/3.6.rst:2150 msgid "" "The output of a special Python build with defined ``COUNT_ALLOCS``, " "``SHOW_ALLOC_COUNT`` or ``SHOW_TRACK_COUNT`` macros is now off by default. " @@ -2788,42 +2806,42 @@ msgid "" "issue:`23034`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2145 +#: ../../whatsnew/3.6.rst:2158 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.6.rst:2147 +#: ../../whatsnew/3.6.rst:2160 msgid "" ":func:`open() ` will no longer allow combining the ``'U'`` mode flag " "with ``'+'``. (Contributed by Jeff Balogh and John O'Connor in :issue:" "`2091`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2151 +#: ../../whatsnew/3.6.rst:2164 msgid "" ":mod:`sqlite3` no longer implicitly commits an open transaction before DDL " "statements." msgstr "" -#: ../../whatsnew/3.6.rst:2154 +#: ../../whatsnew/3.6.rst:2167 msgid "" "On Linux, :func:`os.urandom` now blocks until the system urandom entropy " "pool is initialized to increase the security." msgstr "" -#: ../../whatsnew/3.6.rst:2157 +#: ../../whatsnew/3.6.rst:2170 msgid "" "When :meth:`importlib.abc.Loader.exec_module` is defined, :meth:`importlib." "abc.Loader.create_module` must also be defined." msgstr "" -#: ../../whatsnew/3.6.rst:2160 +#: ../../whatsnew/3.6.rst:2173 msgid "" ":c:func:`PyErr_SetImportError` now sets :exc:`TypeError` when its **msg** " "argument is not set. Previously only ``NULL`` was returned." msgstr "" -#: ../../whatsnew/3.6.rst:2163 +#: ../../whatsnew/3.6.rst:2176 msgid "" "The format of the :attr:`~codeobject.co_lnotab` attribute of code objects " "changed to support a negative line number delta. By default, Python does not " @@ -2836,7 +2854,7 @@ msgid "" "and how to decode it, and see the :pep:`511` for the rationale." msgstr "" -#: ../../whatsnew/3.6.rst:2174 +#: ../../whatsnew/3.6.rst:2187 msgid "" "The functions in the :mod:`compileall` module now return booleans instead of " "``1`` or ``0`` to represent success or failure, respectively. Thanks to " @@ -2844,7 +2862,7 @@ msgid "" "were doing identity checks for ``1`` or ``0``. See :issue:`25768`." msgstr "" -#: ../../whatsnew/3.6.rst:2179 +#: ../../whatsnew/3.6.rst:2192 msgid "" "Reading the :attr:`~urllib.parse.SplitResult.port` attribute of :func:" "`urllib.parse.urlsplit` and :func:`~urllib.parse.urlparse` results now " @@ -2852,13 +2870,13 @@ msgid "" "const:`None`. See :issue:`20059`." msgstr "" -#: ../../whatsnew/3.6.rst:2184 +#: ../../whatsnew/3.6.rst:2197 msgid "" "The :mod:`!imp` module now raises a :exc:`DeprecationWarning` instead of :" "exc:`PendingDeprecationWarning`." msgstr "" -#: ../../whatsnew/3.6.rst:2187 +#: ../../whatsnew/3.6.rst:2200 msgid "" "The following modules have had missing APIs added to their :attr:`__all__` " "attributes to match the documented APIs: :mod:`calendar`, :mod:`cgi`, :mod:" @@ -2870,21 +2888,21 @@ msgid "" "Kołodziej in :issue:`23883`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2198 +#: ../../whatsnew/3.6.rst:2211 msgid "" "When performing a relative import, if ``__package__`` does not compare equal " "to ``__spec__.parent`` then :exc:`ImportWarning` is raised. (Contributed by " "Brett Cannon in :issue:`25791`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2202 +#: ../../whatsnew/3.6.rst:2215 msgid "" "When a relative import is performed and no parent package is known, then :" "exc:`ImportError` will be raised. Previously, :exc:`SystemError` could be " "raised. (Contributed by Brett Cannon in :issue:`18018`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2206 +#: ../../whatsnew/3.6.rst:2219 msgid "" "Servers based on the :mod:`socketserver` module, including those defined in :" "mod:`http.server`, :mod:`xmlrpc.server` and :mod:`wsgiref.simple_server`, " @@ -2895,20 +2913,20 @@ msgid "" "(Contributed by Martin Panter in :issue:`23430`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2215 +#: ../../whatsnew/3.6.rst:2228 msgid "" ":func:`spwd.getspnam` now raises a :exc:`PermissionError` instead of :exc:" "`KeyError` if the user doesn't have privileges." msgstr "" -#: ../../whatsnew/3.6.rst:2218 +#: ../../whatsnew/3.6.rst:2231 msgid "" "The :meth:`socket.socket.close` method now raises an exception if an error " "(e.g. ``EBADF``) was reported by the underlying system call. (Contributed by " "Martin Panter in :issue:`26685`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2222 +#: ../../whatsnew/3.6.rst:2235 msgid "" "The *decode_data* argument for the :class:`!smtpd.SMTPChannel` and :class:`!" "smtpd.SMTPServer` constructors is now ``False`` by default. This means that " @@ -2918,7 +2936,7 @@ msgid "" "generated by 3.5 will not be affected." msgstr "" -#: ../../whatsnew/3.6.rst:2230 +#: ../../whatsnew/3.6.rst:2243 msgid "" "All optional arguments of the :func:`~json.dump`, :func:`~json.dumps`, :func:" "`~json.load` and :func:`~json.loads` functions and :class:`~json." @@ -2927,13 +2945,13 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`18726`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2237 +#: ../../whatsnew/3.6.rst:2250 msgid "" "Subclasses of :class:`type` which don't override ``type.__new__`` may no " "longer use the one-argument form to get the type of an object." msgstr "" -#: ../../whatsnew/3.6.rst:2240 +#: ../../whatsnew/3.6.rst:2253 msgid "" "As part of :pep:`487`, the handling of keyword arguments passed to :class:" "`type` (other than the metaclass hint, ``metaclass``) is now consistently " @@ -2945,7 +2963,7 @@ msgid "" "__new__` (whether direct or via :class:`super`) accordingly." msgstr "" -#: ../../whatsnew/3.6.rst:2249 +#: ../../whatsnew/3.6.rst:2262 msgid "" "In ``distutils.command.sdist.sdist``, the ``default_format`` attribute has " "been removed and is no longer honored. Instead, the gzipped tarfile format " @@ -2955,13 +2973,13 @@ msgid "" "containing the following:" msgstr "" -#: ../../whatsnew/3.6.rst:2262 +#: ../../whatsnew/3.6.rst:2275 msgid "" "This behavior has also been backported to earlier Python versions by " "Setuptools 26.0.0." msgstr "" -#: ../../whatsnew/3.6.rst:2265 +#: ../../whatsnew/3.6.rst:2278 msgid "" "In the :mod:`urllib.request` module and the :meth:`http.client." "HTTPConnection.request` method, if no Content-Length header field has been " @@ -2972,47 +2990,47 @@ msgid "" "`12319`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2274 +#: ../../whatsnew/3.6.rst:2287 msgid "" "The :class:`~csv.DictReader` now returns rows of type :class:`~collections." "OrderedDict`. (Contributed by Steve Holden in :issue:`27842`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2278 +#: ../../whatsnew/3.6.rst:2291 msgid "" "The :const:`crypt.METHOD_CRYPT` will no longer be added to ``crypt.methods`` " "if unsupported by the platform. (Contributed by Victor Stinner in :issue:" "`25287`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2286 +#: ../../whatsnew/3.6.rst:2299 msgid "" "On Linux, :func:`ctypes.util.find_library` now looks in ``LD_LIBRARY_PATH`` " "for shared libraries. (Contributed by Vinay Sajip in :issue:`9998`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2290 +#: ../../whatsnew/3.6.rst:2303 msgid "" "The :class:`imaplib.IMAP4` class now handles flags containing the ``']'`` " "character in messages sent from the server to improve real-world " "compatibility. (Contributed by Lita Cho in :issue:`21815`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2295 +#: ../../whatsnew/3.6.rst:2308 msgid "" "The :func:`mmap.write() ` function now returns the number of " "bytes written like other write methods. (Contributed by Jakub Stasiak in :" "issue:`26335`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2299 +#: ../../whatsnew/3.6.rst:2312 msgid "" "The :func:`pkgutil.iter_modules` and :func:`pkgutil.walk_packages` functions " "now return :class:`~pkgutil.ModuleInfo` named tuples. (Contributed by " "Ramchandra Apte in :issue:`17211`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2303 +#: ../../whatsnew/3.6.rst:2316 msgid "" ":func:`re.sub` now raises an error for invalid numerical group references in " "replacement templates even if the pattern is not found in the string. The " @@ -3021,7 +3039,7 @@ msgid "" "in :issue:`25953`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2309 +#: ../../whatsnew/3.6.rst:2322 msgid "" ":class:`zipfile.ZipFile` will now raise :exc:`NotImplementedError` for " "unrecognized compression values. Previously a plain :exc:`RuntimeError` was " @@ -3031,7 +3049,7 @@ msgid "" "`RuntimeError` was raised in those scenarios." msgstr "" -#: ../../whatsnew/3.6.rst:2316 +#: ../../whatsnew/3.6.rst:2329 msgid "" "when custom metaclasses are combined with zero-argument :func:`super` or " "direct references from methods to the implicit ``__class__`` closure " @@ -3041,7 +3059,7 @@ msgid "" "Python 3.8." msgstr "" -#: ../../whatsnew/3.6.rst:2323 +#: ../../whatsnew/3.6.rst:2336 msgid "" "With the introduction of :exc:`ModuleNotFoundError`, import system consumers " "may start expecting import system replacements to raise that more specific " @@ -3054,11 +3072,11 @@ msgid "" "the default import system will raise the new subclass when appropriate." msgstr "" -#: ../../whatsnew/3.6.rst:2335 +#: ../../whatsnew/3.6.rst:2348 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.6.rst:2337 +#: ../../whatsnew/3.6.rst:2350 msgid "" "The :c:func:`PyMem_Malloc` allocator family now uses the :ref:`pymalloc " "allocator ` rather than the system :c:func:`malloc`. Applications " @@ -3067,29 +3085,29 @@ msgid "" "usage of memory allocators in your application. See :issue:`26249`." msgstr "" -#: ../../whatsnew/3.6.rst:2343 +#: ../../whatsnew/3.6.rst:2356 msgid "" ":c:func:`Py_Exit` (and the main interpreter) now override the exit status " "with 120 if flushing buffered data failed. See :issue:`5319`." msgstr "" -#: ../../whatsnew/3.6.rst:2348 +#: ../../whatsnew/3.6.rst:2361 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.6.rst:2350 +#: ../../whatsnew/3.6.rst:2363 msgid "" "There have been several major changes to the :term:`bytecode` in Python 3.6." msgstr "" -#: ../../whatsnew/3.6.rst:2352 +#: ../../whatsnew/3.6.rst:2365 msgid "" "The Python interpreter now uses a 16-bit wordcode instead of bytecode. " "(Contributed by Demur Rumed with input and reviews from Serhiy Storchaka and " "Victor Stinner in :issue:`26647` and :issue:`28050`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2356 +#: ../../whatsnew/3.6.rst:2369 msgid "" "The new :opcode:`FORMAT_VALUE` and :opcode:`BUILD_STRING` opcodes as part of " "the :ref:`formatted string literal ` implementation. " @@ -3097,14 +3115,14 @@ msgid "" "`27078`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2361 +#: ../../whatsnew/3.6.rst:2374 msgid "" "The new :opcode:`BUILD_CONST_KEY_MAP` opcode to optimize the creation of " "dictionaries with constant keys. (Contributed by Serhiy Storchaka in :issue:" "`27140`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2365 +#: ../../whatsnew/3.6.rst:2378 msgid "" "The function call opcodes have been heavily reworked for better performance " "and simpler implementation. The :opcode:`MAKE_FUNCTION`, :opcode:" @@ -3116,22 +3134,22 @@ msgid "" "issue:`27095`, and Serhiy Storchaka in :issue:`27213`, :issue:`28257`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2376 +#: ../../whatsnew/3.6.rst:2389 msgid "" "The new :opcode:`SETUP_ANNOTATIONS` and :opcode:`STORE_ANNOTATION` opcodes " "have been added to support the new :term:`variable annotation` syntax. " "(Contributed by Ivan Levkivskyi in :issue:`27985`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2382 +#: ../../whatsnew/3.6.rst:2395 msgid "Notable changes in Python 3.6.2" msgstr "" -#: ../../whatsnew/3.6.rst:2385 +#: ../../whatsnew/3.6.rst:2398 msgid "New ``make regen-all`` build target" msgstr "" -#: ../../whatsnew/3.6.rst:2387 +#: ../../whatsnew/3.6.rst:2400 msgid "" "To simplify cross-compilation, and to ensure that CPython can reliably be " "compiled without requiring an existing version of Python to already be " @@ -3139,43 +3157,43 @@ msgid "" "recompile generated files based on file modification times." msgstr "" -#: ../../whatsnew/3.6.rst:2392 +#: ../../whatsnew/3.6.rst:2405 msgid "" "Instead, a new ``make regen-all`` command has been added to force " "regeneration of these files when desired (e.g. after an initial version of " "Python has already been built based on the pregenerated versions)." msgstr "" -#: ../../whatsnew/3.6.rst:2396 +#: ../../whatsnew/3.6.rst:2409 msgid "" "More selective regeneration targets are also defined - see :source:`Makefile." "pre.in` for details." msgstr "" -#: ../../whatsnew/3.6.rst:2399 ../../whatsnew/3.6.rst:2412 +#: ../../whatsnew/3.6.rst:2412 ../../whatsnew/3.6.rst:2425 msgid "(Contributed by Victor Stinner in :issue:`23404`.)" msgstr "(由 Victor Stinner 於 :issue:`23404` 中貢獻。)" -#: ../../whatsnew/3.6.rst:2405 +#: ../../whatsnew/3.6.rst:2418 msgid "Removal of ``make touch`` build target" msgstr "" -#: ../../whatsnew/3.6.rst:2407 +#: ../../whatsnew/3.6.rst:2420 msgid "" "The ``make touch`` build target previously used to request implicit " "regeneration of generated files by updating their modification times has " "been removed." msgstr "" -#: ../../whatsnew/3.6.rst:2410 +#: ../../whatsnew/3.6.rst:2423 msgid "It has been replaced by the new ``make regen-all`` target." msgstr "" -#: ../../whatsnew/3.6.rst:2418 +#: ../../whatsnew/3.6.rst:2431 msgid "Notable changes in Python 3.6.4" msgstr "" -#: ../../whatsnew/3.6.rst:2420 +#: ../../whatsnew/3.6.rst:2433 msgid "" "The ``PyExc_RecursionErrorInst`` singleton that was part of the public API " "has been removed as its members being never cleared may cause a segfault " @@ -3183,22 +3201,28 @@ msgid "" "issue:`22898` and :issue:`30697`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2427 +#: ../../whatsnew/3.6.rst:2440 msgid "Notable changes in Python 3.6.5" msgstr "" -#: ../../whatsnew/3.6.rst:2429 +#: ../../whatsnew/3.6.rst:2442 msgid "" "The :func:`locale.localeconv` function now sets temporarily the ``LC_CTYPE`` " "locale to the ``LC_NUMERIC`` locale in some cases. (Contributed by Victor " "Stinner in :issue:`31900`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2434 +#: ../../whatsnew/3.6.rst:2448 msgid "Notable changes in Python 3.6.7" msgstr "" -#: ../../whatsnew/3.6.rst:2436 +#: ../../whatsnew/3.6.rst:2450 +msgid "" +":mod:`xml.dom.minidom` and :mod:`xml.sax` modules no longer process external " +"entities by default. See also :gh:`61441`." +msgstr "" + +#: ../../whatsnew/3.6.rst:2453 msgid "" "In 3.6.7 the :mod:`tokenize` module now implicitly emits a ``NEWLINE`` token " "when provided with input that does not have a trailing new line. This " @@ -3206,11 +3230,11 @@ msgid "" "Ammar Askar in :issue:`33899`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2442 +#: ../../whatsnew/3.6.rst:2459 msgid "Notable changes in Python 3.6.10" msgstr "" -#: ../../whatsnew/3.6.rst:2444 +#: ../../whatsnew/3.6.rst:2461 msgid "" "Due to significant security concerns, the *reuse_address* parameter of :meth:" "`asyncio.loop.create_datagram_endpoint` is no longer supported. This is " @@ -3220,11 +3244,11 @@ msgid "" "`37228`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2452 +#: ../../whatsnew/3.6.rst:2469 msgid "Notable changes in Python 3.6.13" msgstr "" -#: ../../whatsnew/3.6.rst:2454 +#: ../../whatsnew/3.6.rst:2471 msgid "" "Earlier Python versions allowed using both ``;`` and ``&`` as query " "parameter separators in :func:`urllib.parse.parse_qs` and :func:`urllib." @@ -3235,3 +3259,26 @@ msgid "" "For more details, please see their respective documentation. (Contributed by " "Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.)" msgstr "" + +#: ../../whatsnew/3.6.rst:2482 +msgid "Notable changes in Python 3.6.14" +msgstr "" + +#: ../../whatsnew/3.6.rst:2484 +msgid "" +"A security fix alters the :class:`ftplib.FTP` behavior to not trust the IPv4 " +"address sent from the remote server when setting up a passive data channel. " +"We reuse the ftp server IP address instead. For unusual code requiring the " +"old behavior, set a ``trust_server_pasv_ipv4_address`` attribute on your FTP " +"instance to ``True``. (See :gh:`87451`)" +msgstr "" + +#: ../../whatsnew/3.6.rst:2490 +msgid "" +"The presence of newline or tab characters in parts of a URL allows for some " +"forms of attacks. Following the WHATWG specification that updates RFC 3986, " +"ASCII newline ``\\n``, ``\\r`` and tab ``\\t`` characters are stripped from " +"the URL by the parser :func:`urllib.parse` preventing such attacks. The " +"removal characters are controlled by a new module level variable ``urllib." +"parse._UNSAFE_URL_BYTES_TO_REMOVE``. (See :gh:`88048`)" +msgstr "" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index fb19e07d8e..ef976caeaf 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-03 20:44+0000\n" +"POT-Creation-Date: 2024-02-16 00:03+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -474,27 +474,27 @@ msgid "" "module:" msgstr "" -#: ../../whatsnew/3.7.rst:347 ../../whatsnew/3.7.rst:1447 +#: ../../whatsnew/3.7.rst:347 ../../whatsnew/3.7.rst:1451 msgid ":func:`time.clock_gettime_ns`" msgstr ":func:`time.clock_gettime_ns`" -#: ../../whatsnew/3.7.rst:348 ../../whatsnew/3.7.rst:1448 +#: ../../whatsnew/3.7.rst:348 ../../whatsnew/3.7.rst:1452 msgid ":func:`time.clock_settime_ns`" msgstr ":func:`time.clock_settime_ns`" -#: ../../whatsnew/3.7.rst:349 ../../whatsnew/3.7.rst:1449 +#: ../../whatsnew/3.7.rst:349 ../../whatsnew/3.7.rst:1453 msgid ":func:`time.monotonic_ns`" msgstr ":func:`time.monotonic_ns`" -#: ../../whatsnew/3.7.rst:350 ../../whatsnew/3.7.rst:1450 +#: ../../whatsnew/3.7.rst:350 ../../whatsnew/3.7.rst:1454 msgid ":func:`time.perf_counter_ns`" msgstr ":func:`time.perf_counter_ns`" -#: ../../whatsnew/3.7.rst:351 ../../whatsnew/3.7.rst:1451 +#: ../../whatsnew/3.7.rst:351 ../../whatsnew/3.7.rst:1455 msgid ":func:`time.process_time_ns`" msgstr ":func:`time.process_time_ns`" -#: ../../whatsnew/3.7.rst:352 ../../whatsnew/3.7.rst:1452 +#: ../../whatsnew/3.7.rst:352 ../../whatsnew/3.7.rst:1456 msgid ":func:`time.time_ns`" msgstr ":func:`time.time_ns`" @@ -867,7 +867,7 @@ msgid "" "positional arguments. (Contributed by paul.j3 in :issue:`14191`.)" msgstr "" -#: ../../whatsnew/3.7.rst:634 ../../whatsnew/3.7.rst:1951 +#: ../../whatsnew/3.7.rst:634 ../../whatsnew/3.7.rst:1964 msgid "asyncio" msgstr "asyncio" @@ -1095,7 +1095,7 @@ msgid "" "(Contributed by Oz Tiram in :issue:`30095`.)" msgstr "" -#: ../../whatsnew/3.7.rst:796 ../../whatsnew/3.7.rst:1965 +#: ../../whatsnew/3.7.rst:796 ../../whatsnew/3.7.rst:1978 msgid "collections" msgstr "collections" @@ -1202,7 +1202,7 @@ msgid "" "(Contributed by Alexander Belopolsky in :issue:`5288`.)" msgstr "" -#: ../../whatsnew/3.7.rst:872 ../../whatsnew/3.7.rst:1975 +#: ../../whatsnew/3.7.rst:872 ../../whatsnew/3.7.rst:1988 msgid "dbm" msgstr "dbm" @@ -1247,7 +1247,7 @@ msgid "" "in :issue:`11913`.)" msgstr "" -#: ../../whatsnew/3.7.rst:906 ../../whatsnew/3.7.rst:1985 +#: ../../whatsnew/3.7.rst:906 ../../whatsnew/3.7.rst:1998 msgid "enum" msgstr "enum" @@ -1447,7 +1447,7 @@ msgid "" "`17535`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1044 ../../whatsnew/3.7.rst:2004 +#: ../../whatsnew/3.7.rst:1044 ../../whatsnew/3.7.rst:2017 msgid "importlib" msgstr "importlib" @@ -1515,7 +1515,7 @@ msgid "" "Roberts in :issue:`30537`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1093 ../../whatsnew/3.7.rst:2022 +#: ../../whatsnew/3.7.rst:1093 ../../whatsnew/3.7.rst:2035 msgid "locale" msgstr "locale" @@ -1780,7 +1780,7 @@ msgid "" "in :issue:`30050`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1272 ../../whatsnew/3.7.rst:2045 +#: ../../whatsnew/3.7.rst:1272 ../../whatsnew/3.7.rst:2058 msgid "socket" msgstr "socket" @@ -1857,7 +1857,7 @@ msgid "" "Lorentsen in :issue:`31843`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1323 ../../whatsnew/3.7.rst:2054 +#: ../../whatsnew/3.7.rst:1323 ../../whatsnew/3.7.rst:2067 msgid "ssl" msgstr "ssl" @@ -1943,22 +1943,29 @@ msgid "" "`32609`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1385 +#: ../../whatsnew/3.7.rst:1383 +msgid "" +"Added :attr:`ssl.SSLContext.post_handshake_auth` to enable and :meth:`ssl." +"SSLSocket.verify_client_post_handshake` to initiate TLS 1.3 post-handshake " +"authentication. (Contributed by Christian Heimes in :gh:`78851`.)" +msgstr "" + +#: ../../whatsnew/3.7.rst:1389 msgid "string" msgstr "string" -#: ../../whatsnew/3.7.rst:1387 +#: ../../whatsnew/3.7.rst:1391 msgid "" ":class:`string.Template` now lets you to optionally modify the regular " "expression pattern for braced placeholders and non-braced placeholders " "separately. (Contributed by Barry Warsaw in :issue:`1198569`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1393 +#: ../../whatsnew/3.7.rst:1397 msgid "subprocess" msgstr "subprocess" -#: ../../whatsnew/3.7.rst:1395 +#: ../../whatsnew/3.7.rst:1399 msgid "" "The :func:`subprocess.run` function accepts the new *capture_output* keyword " "argument. When true, stdout and stderr will be captured. This is equivalent " @@ -1966,14 +1973,14 @@ msgid "" "(Contributed by Bo Bayles in :issue:`32102`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1401 +#: ../../whatsnew/3.7.rst:1405 msgid "" "The ``subprocess.run`` function and the :class:`subprocess.Popen` " "constructor now accept the *text* keyword argument as an alias to " "*universal_newlines*. (Contributed by Andrew Clegg in :issue:`31756`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1406 +#: ../../whatsnew/3.7.rst:1410 msgid "" "On Windows the default for *close_fds* was changed from ``False`` to " "``True`` when redirecting the standard handles. It's now possible to set " @@ -1982,7 +1989,7 @@ msgid "" "all supported platforms. (Contributed by Segev Finer in :issue:`19764`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1413 +#: ../../whatsnew/3.7.rst:1417 msgid "" "The subprocess module is now more graceful when handling :exc:" "`KeyboardInterrupt` during :func:`subprocess.call`, :func:`subprocess.run`, " @@ -1992,23 +1999,23 @@ msgid "" "`25942`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1423 ../../whatsnew/3.7.rst:2070 +#: ../../whatsnew/3.7.rst:1427 ../../whatsnew/3.7.rst:2083 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.7.rst:1425 +#: ../../whatsnew/3.7.rst:1429 msgid "" "The new :func:`sys.breakpointhook` hook function is called by the built-in :" "func:`breakpoint`. (Contributed by Barry Warsaw in :issue:`31353`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1429 +#: ../../whatsnew/3.7.rst:1433 msgid "" "On Android, the new :func:`sys.getandroidapilevel` returns the build-time " "Android API version. (Contributed by Victor Stinner in :issue:`28740`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1433 +#: ../../whatsnew/3.7.rst:1437 msgid "" "The new :func:`sys.get_coroutine_origin_tracking_depth` function returns the " "current coroutine origin tracking depth, as set by the new :func:`sys." @@ -2018,68 +2025,68 @@ msgid "" "`32591`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1442 +#: ../../whatsnew/3.7.rst:1446 msgid "time" msgstr "time" -#: ../../whatsnew/3.7.rst:1444 +#: ../../whatsnew/3.7.rst:1448 msgid "" ":pep:`564` adds six new functions with nanosecond resolution to the :mod:" "`time` module:" msgstr "" -#: ../../whatsnew/3.7.rst:1454 +#: ../../whatsnew/3.7.rst:1458 msgid "New clock identifiers have been added:" msgstr "" -#: ../../whatsnew/3.7.rst:1456 +#: ../../whatsnew/3.7.rst:1460 msgid "" ":const:`time.CLOCK_BOOTTIME` (Linux): Identical to :const:`time." "CLOCK_MONOTONIC`, except it also includes any time that the system is " "suspended." msgstr "" -#: ../../whatsnew/3.7.rst:1459 +#: ../../whatsnew/3.7.rst:1463 msgid "" ":const:`time.CLOCK_PROF` (FreeBSD, NetBSD and OpenBSD): High-resolution per-" "process CPU timer." msgstr "" -#: ../../whatsnew/3.7.rst:1461 +#: ../../whatsnew/3.7.rst:1465 msgid "" ":const:`time.CLOCK_UPTIME` (FreeBSD, OpenBSD): Time whose absolute value is " "the time the system has been running and not suspended, providing accurate " "uptime measurement." msgstr "" -#: ../../whatsnew/3.7.rst:1465 +#: ../../whatsnew/3.7.rst:1469 msgid "" "The new :func:`time.thread_time` and :func:`time.thread_time_ns` functions " "can be used to get per-thread CPU time measurements. (Contributed by Antoine " "Pitrou in :issue:`32025`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1469 +#: ../../whatsnew/3.7.rst:1473 msgid "" "The new :func:`time.pthread_getcpuclockid` function returns the clock ID of " "the thread-specific CPU-time clock." msgstr "" -#: ../../whatsnew/3.7.rst:1474 +#: ../../whatsnew/3.7.rst:1478 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.7.rst:1476 +#: ../../whatsnew/3.7.rst:1480 msgid "" "The new :class:`tkinter.ttk.Spinbox` class is now available. (Contributed by " "Alan Moore in :issue:`32585`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1481 +#: ../../whatsnew/3.7.rst:1485 msgid "tracemalloc" msgstr "tracemalloc" -#: ../../whatsnew/3.7.rst:1483 +#: ../../whatsnew/3.7.rst:1487 msgid "" ":class:`tracemalloc.Traceback` behaves more like regular tracebacks, sorting " "the frames from oldest to most recent. :meth:`Traceback.format() " @@ -2089,11 +2096,11 @@ msgid "" "by Jesse Bakker in :issue:`32121`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1493 +#: ../../whatsnew/3.7.rst:1497 msgid "types" msgstr "types" -#: ../../whatsnew/3.7.rst:1495 +#: ../../whatsnew/3.7.rst:1499 msgid "" "The new :class:`~types.WrapperDescriptorType`, :class:`~types." "MethodWrapperType`, :class:`~types.MethodDescriptorType`, and :class:`~types." @@ -2102,29 +2109,29 @@ msgid "" "issue:`32265`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1501 +#: ../../whatsnew/3.7.rst:1505 msgid "" "The new :func:`types.resolve_bases` function resolves MRO entries " "dynamically as specified by :pep:`560`. (Contributed by Ivan Levkivskyi in :" "issue:`32717`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1507 +#: ../../whatsnew/3.7.rst:1511 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.7.rst:1509 +#: ../../whatsnew/3.7.rst:1513 msgid "" "The internal :mod:`unicodedata` database has been upgraded to use `Unicode " "11 `_. (Contributed by " "Benjamin Peterson.)" msgstr "" -#: ../../whatsnew/3.7.rst:1515 +#: ../../whatsnew/3.7.rst:1519 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.7.rst:1517 +#: ../../whatsnew/3.7.rst:1521 msgid "" "The new ``-k`` command-line option allows filtering tests by a name " "substring or a Unix shell-like pattern. For example, ``python -m unittest -k " @@ -2133,18 +2140,18 @@ msgid "" "Jonas Haag in :issue:`32071`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1526 +#: ../../whatsnew/3.7.rst:1530 msgid "unittest.mock" msgstr "unittest.mock" -#: ../../whatsnew/3.7.rst:1528 +#: ../../whatsnew/3.7.rst:1532 msgid "" "The :const:`~unittest.mock.sentinel` attributes now preserve their identity " "when they are :mod:`copied ` or :mod:`pickled `. (Contributed " "by Serhiy Storchaka in :issue:`20804`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1532 +#: ../../whatsnew/3.7.rst:1536 msgid "" "The new :func:`~unittest.mock.seal` function allows sealing :class:" "`~unittest.mock.Mock` instances, which will disallow further creation of " @@ -2152,33 +2159,33 @@ msgid "" "themselves mocks. (Contributed by Mario Corchero in :issue:`30541`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1540 +#: ../../whatsnew/3.7.rst:1544 msgid "urllib.parse" msgstr "urllib.parse" -#: ../../whatsnew/3.7.rst:1542 +#: ../../whatsnew/3.7.rst:1546 msgid "" ":func:`urllib.parse.quote` has been updated from :rfc:`2396` to :rfc:`3986`, " "adding ``~`` to the set of characters that are never quoted by default. " "(Contributed by Christian Theune and Ratnadeep Debnath in :issue:`16285`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1548 +#: ../../whatsnew/3.7.rst:1552 msgid "uu" msgstr "uu" -#: ../../whatsnew/3.7.rst:1550 +#: ../../whatsnew/3.7.rst:1554 msgid "" "The :func:`uu.encode` function now accepts an optional *backtick* keyword " "argument. When it's true, zeros are represented by ``'`'`` instead of " "spaces. (Contributed by Xiang Zhang in :issue:`30103`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1556 +#: ../../whatsnew/3.7.rst:1560 msgid "uuid" msgstr "uuid" -#: ../../whatsnew/3.7.rst:1558 +#: ../../whatsnew/3.7.rst:1562 msgid "" "The new :attr:`UUID.is_safe ` attribute relays " "information from the platform about whether generated UUIDs are generated " @@ -2186,7 +2193,7 @@ msgid "" "`22807`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1563 +#: ../../whatsnew/3.7.rst:1567 msgid "" ":func:`uuid.getnode` now prefers universally administered MAC addresses over " "locally administered MAC addresses. This makes a better guarantee for global " @@ -2195,58 +2202,58 @@ msgid "" "returned. (Contributed by Barry Warsaw in :issue:`32107`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1572 +#: ../../whatsnew/3.7.rst:1576 msgid "warnings" msgstr "warnings" -#: ../../whatsnew/3.7.rst:1574 +#: ../../whatsnew/3.7.rst:1578 msgid "" "The initialization of the default warnings filters has changed as follows:" msgstr "" -#: ../../whatsnew/3.7.rst:1576 +#: ../../whatsnew/3.7.rst:1580 msgid "" "warnings enabled via command line options (including those for :option:`-b` " "and the new CPython-specific :option:`-X` ``dev`` option) are always passed " "to the warnings machinery via the :data:`sys.warnoptions` attribute." msgstr "" -#: ../../whatsnew/3.7.rst:1580 +#: ../../whatsnew/3.7.rst:1584 msgid "" "warnings filters enabled via the command line or the environment now have " "the following order of precedence:" msgstr "" -#: ../../whatsnew/3.7.rst:1583 +#: ../../whatsnew/3.7.rst:1587 msgid "the ``BytesWarning`` filter for :option:`-b` (or ``-bb``)" msgstr "" -#: ../../whatsnew/3.7.rst:1584 +#: ../../whatsnew/3.7.rst:1588 msgid "any filters specified with the :option:`-W` option" msgstr "" -#: ../../whatsnew/3.7.rst:1585 +#: ../../whatsnew/3.7.rst:1589 msgid "" "any filters specified with the :envvar:`PYTHONWARNINGS` environment variable" msgstr "" -#: ../../whatsnew/3.7.rst:1587 +#: ../../whatsnew/3.7.rst:1591 msgid "" "any other CPython specific filters (e.g. the ``default`` filter added for " "the new ``-X dev`` mode)" msgstr "" -#: ../../whatsnew/3.7.rst:1589 +#: ../../whatsnew/3.7.rst:1593 msgid "any implicit filters defined directly by the warnings machinery" msgstr "" -#: ../../whatsnew/3.7.rst:1591 +#: ../../whatsnew/3.7.rst:1595 msgid "" "in :ref:`CPython debug builds `, all warnings are now displayed " "by default (the implicit filter list is empty)" msgstr "" -#: ../../whatsnew/3.7.rst:1594 +#: ../../whatsnew/3.7.rst:1598 msgid "" "(Contributed by Nick Coghlan and Victor Stinner in :issue:`20361`, :issue:" "`32043`, and :issue:`32230`.)" @@ -2254,18 +2261,29 @@ msgstr "" "(由 Nick Coghlan 和 Victor Stinner 在 :issue:`20361`、:issue:`32043` 和 :" "issue:`32230` 中貢獻。)" -#: ../../whatsnew/3.7.rst:1597 +#: ../../whatsnew/3.7.rst:1601 msgid "" "Deprecation warnings are once again shown by default in single-file scripts " "and at the interactive prompt. See :ref:`whatsnew37-pep565` for details. " "(Contributed by Nick Coghlan in :issue:`31975`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1603 +#: ../../whatsnew/3.7.rst:1607 +msgid "xml" +msgstr "" + +#: ../../whatsnew/3.7.rst:1609 +msgid "" +"As mitigation against DTD and external entity retrieval, the :mod:`xml.dom." +"minidom` and :mod:`xml.sax` modules no longer process external entities by " +"default. (Contributed by Christian Heimes in :gh:`61441`.)" +msgstr "" + +#: ../../whatsnew/3.7.rst:1616 msgid "xml.etree" msgstr "xml.etree" -#: ../../whatsnew/3.7.rst:1605 +#: ../../whatsnew/3.7.rst:1618 msgid "" ":ref:`ElementPath ` predicates in the :meth:`find` " "methods can now compare text of the current node with ``[. = \"text\"]``, " @@ -2273,29 +2291,29 @@ msgid "" "readability. (Contributed by Stefan Behnel in :issue:`31648`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1612 +#: ../../whatsnew/3.7.rst:1625 msgid "xmlrpc.server" msgstr "xmlrpc.server" -#: ../../whatsnew/3.7.rst:1614 +#: ../../whatsnew/3.7.rst:1627 msgid "" ":meth:`SimpleXMLRPCDispatcher.register_function ` can now be used as a decorator. (Contributed by " "Xiang Zhang in :issue:`7769`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1620 +#: ../../whatsnew/3.7.rst:1633 msgid "zipapp" msgstr "zipapp" -#: ../../whatsnew/3.7.rst:1622 +#: ../../whatsnew/3.7.rst:1635 msgid "" "Function :func:`~zipapp.create_archive` now accepts an optional *filter* " "argument to allow the user to select which files should be included in the " "archive. (Contributed by Irmen de Jong in :issue:`31072`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1626 +#: ../../whatsnew/3.7.rst:1639 msgid "" "Function :func:`~zipapp.create_archive` now accepts an optional *compressed* " "argument to generate a compressed archive. A command line option ``--" @@ -2303,27 +2321,27 @@ msgid "" "Zhiming Wang in :issue:`31638`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1633 +#: ../../whatsnew/3.7.rst:1646 msgid "zipfile" msgstr "zipfile" -#: ../../whatsnew/3.7.rst:1635 +#: ../../whatsnew/3.7.rst:1648 msgid "" ":class:`~zipfile.ZipFile` now accepts the new *compresslevel* parameter to " "control the compression level. (Contributed by Bo Bayles in :issue:`21417`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1639 +#: ../../whatsnew/3.7.rst:1652 msgid "" "Subdirectories in archives created by ``ZipFile`` are now stored in " "alphabetical order. (Contributed by Bernhard M. Wiedemann in :issue:`30693`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1645 +#: ../../whatsnew/3.7.rst:1658 msgid "C API Changes" msgstr "C API 變更" -#: ../../whatsnew/3.7.rst:1647 +#: ../../whatsnew/3.7.rst:1660 msgid "" "A new API for thread-local storage has been implemented. See :ref:" "`whatsnew37-pep539` for an overview and :ref:`thread-specific-storage-api` " @@ -2331,46 +2349,46 @@ msgid "" "`25658`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1652 +#: ../../whatsnew/3.7.rst:1665 msgid "" "The new :ref:`context variables ` functionality exposes a " "number of :ref:`new C APIs `." msgstr "" -#: ../../whatsnew/3.7.rst:1655 +#: ../../whatsnew/3.7.rst:1668 msgid "" "The new :c:func:`PyImport_GetModule` function returns the previously " "imported module with the given name. (Contributed by Eric Snow in :issue:" "`28411`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1659 +#: ../../whatsnew/3.7.rst:1672 msgid "" "The new :c:macro:`Py_RETURN_RICHCOMPARE` macro eases writing rich comparison " "functions. (Contributed by Petr Victorin in :issue:`23699`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1663 +#: ../../whatsnew/3.7.rst:1676 msgid "" "The new :c:macro:`Py_UNREACHABLE` macro can be used to mark unreachable code " "paths. (Contributed by Barry Warsaw in :issue:`31338`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1667 +#: ../../whatsnew/3.7.rst:1680 msgid "" "The :mod:`tracemalloc` now exposes a C API through the new :c:func:" "`PyTraceMalloc_Track` and :c:func:`PyTraceMalloc_Untrack` functions. " "(Contributed by Victor Stinner in :issue:`30054`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1672 +#: ../../whatsnew/3.7.rst:1685 msgid "" "The new :c:func:`import__find__load__start` and :c:func:" "`import__find__load__done` static markers can be used to trace module " "imports. (Contributed by Christian Heimes in :issue:`31574`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1677 +#: ../../whatsnew/3.7.rst:1690 msgid "" "The fields :c:member:`!name` and :c:member:`!doc` of structures :c:type:" "`PyMemberDef`, :c:type:`PyGetSetDef`, :c:type:`PyStructSequence_Field`, :c:" @@ -2379,34 +2397,34 @@ msgid "" "issue:`28761`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1683 +#: ../../whatsnew/3.7.rst:1696 msgid "" "The result of :c:func:`PyUnicode_AsUTF8AndSize` and :c:func:" "`PyUnicode_AsUTF8` is now of type ``const char *`` rather of ``char *``. " "(Contributed by Serhiy Storchaka in :issue:`28769`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1687 +#: ../../whatsnew/3.7.rst:1700 msgid "" "The result of :c:func:`PyMapping_Keys`, :c:func:`PyMapping_Values` and :c:" "func:`PyMapping_Items` is now always a list, rather than a list or a tuple. " "(Contributed by Oren Milman in :issue:`28280`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1691 +#: ../../whatsnew/3.7.rst:1704 msgid "" "Added functions :c:func:`PySlice_Unpack` and :c:func:" "`PySlice_AdjustIndices`. (Contributed by Serhiy Storchaka in :issue:`27867`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1694 +#: ../../whatsnew/3.7.rst:1707 msgid "" ":c:func:`PyOS_AfterFork` is deprecated in favour of the new functions :c:" "func:`PyOS_BeforeFork`, :c:func:`PyOS_AfterFork_Parent` and :c:func:" "`PyOS_AfterFork_Child`. (Contributed by Antoine Pitrou in :issue:`16500`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1699 +#: ../../whatsnew/3.7.rst:1712 msgid "" "The ``PyExc_RecursionErrorInst`` singleton that was part of the public API " "has been removed as its members being never cleared may cause a segfault " @@ -2414,7 +2432,7 @@ msgid "" "issue:`22898` and :issue:`30697`." msgstr "" -#: ../../whatsnew/3.7.rst:1704 +#: ../../whatsnew/3.7.rst:1717 msgid "" "Added C API support for timezones with timezone constructors :c:func:" "`PyTimeZone_FromOffset` and :c:func:`PyTimeZone_FromOffsetAndName`, and " @@ -2422,7 +2440,7 @@ msgid "" "Contributed by Paul Ganssle in :issue:`10381`." msgstr "" -#: ../../whatsnew/3.7.rst:1709 +#: ../../whatsnew/3.7.rst:1722 msgid "" "The type of results of :c:func:`PyThread_start_new_thread` and :c:func:" "`PyThread_get_thread_ident`, and the *id* parameter of :c:func:" @@ -2430,14 +2448,14 @@ msgid "" "long`. (Contributed by Serhiy Storchaka in :issue:`6532`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1715 +#: ../../whatsnew/3.7.rst:1728 msgid "" ":c:func:`PyUnicode_AsWideCharString` now raises a :exc:`ValueError` if the " "second argument is ``NULL`` and the :c:expr:`wchar_t*` string contains null " "characters. (Contributed by Serhiy Storchaka in :issue:`30708`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1719 +#: ../../whatsnew/3.7.rst:1732 msgid "" "Changes to the startup sequence and the management of dynamic memory " "allocators mean that the long documented requirement to call :c:func:" @@ -2448,45 +2466,45 @@ msgid "" "details." msgstr "" -#: ../../whatsnew/3.7.rst:1727 +#: ../../whatsnew/3.7.rst:1740 msgid "" "The new :c:func:`PyInterpreterState_GetID` returns the unique ID for a given " "interpreter. (Contributed by Eric Snow in :issue:`29102`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1731 +#: ../../whatsnew/3.7.rst:1744 msgid "" ":c:func:`Py_DecodeLocale`, :c:func:`Py_EncodeLocale` now use the UTF-8 " "encoding when the :ref:`UTF-8 mode ` is enabled. " "(Contributed by Victor Stinner in :issue:`29240`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1735 +#: ../../whatsnew/3.7.rst:1748 msgid "" ":c:func:`PyUnicode_DecodeLocaleAndSize` and :c:func:`PyUnicode_EncodeLocale` " "now use the current locale encoding for ``surrogateescape`` error handler. " "(Contributed by Victor Stinner in :issue:`29240`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1739 +#: ../../whatsnew/3.7.rst:1752 msgid "" "The *start* and *end* parameters of :c:func:`PyUnicode_FindChar` are now " "adjusted to behave like string slices. (Contributed by Xiang Zhang in :issue:" "`28822`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1745 +#: ../../whatsnew/3.7.rst:1758 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.7.rst:1747 +#: ../../whatsnew/3.7.rst:1760 msgid "" "Support for building ``--without-threads`` has been removed. The :mod:" "`threading` module is now always available. (Contributed by Antoine Pitrou " "in :issue:`31370`.)." msgstr "" -#: ../../whatsnew/3.7.rst:1751 +#: ../../whatsnew/3.7.rst:1764 msgid "" "A full copy of libffi is no longer bundled for use when building the :mod:" "`_ctypes ` module on non-OSX UNIX platforms. An installed copy of " @@ -2494,7 +2512,7 @@ msgid "" "(Contributed by Zachary Ware in :issue:`27979`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1756 +#: ../../whatsnew/3.7.rst:1769 msgid "" "The Windows build process no longer depends on Subversion to pull in " "external sources, a Python script is used to download zipfiles from GitHub " @@ -2503,7 +2521,7 @@ msgid "" "by Zachary Ware in :issue:`30450`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1762 +#: ../../whatsnew/3.7.rst:1775 msgid "" "The :mod:`ssl` module requires OpenSSL 1.0.2 or 1.1 compatible libssl. " "OpenSSL 1.0.1 has reached end of lifetime on 2016-12-31 and is no longer " @@ -2511,11 +2529,11 @@ msgid "" "up to version 2.6.4 are missing required OpenSSL 1.0.2 APIs." msgstr "" -#: ../../whatsnew/3.7.rst:1771 +#: ../../whatsnew/3.7.rst:1784 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.7.rst:1773 +#: ../../whatsnew/3.7.rst:1786 msgid "" "The overhead of calling many methods of various standard library classes " "implemented in C has been significantly reduced by porting more code to use " @@ -2523,85 +2541,85 @@ msgid "" "`29300`, :issue:`29507`, :issue:`29452`, and :issue:`29286`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1779 +#: ../../whatsnew/3.7.rst:1792 msgid "" "Various optimizations have reduced Python startup time by 10% on Linux and " "up to 30% on macOS. (Contributed by Victor Stinner, INADA Naoki in :issue:" "`29585`, and Ivan Levkivskyi in :issue:`31333`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1784 +#: ../../whatsnew/3.7.rst:1797 msgid "" "Method calls are now up to 20% faster due to the bytecode changes which " "avoid creating bound method instances. (Contributed by Yury Selivanov and " "INADA Naoki in :issue:`26110`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1790 +#: ../../whatsnew/3.7.rst:1803 msgid "" "The :mod:`asyncio` module received a number of notable optimizations for " "commonly used functions:" msgstr "" -#: ../../whatsnew/3.7.rst:1793 +#: ../../whatsnew/3.7.rst:1806 msgid "" "The :func:`asyncio.get_event_loop` function has been reimplemented in C to " "make it up to 15 times faster. (Contributed by Yury Selivanov in :issue:" "`32296`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1797 +#: ../../whatsnew/3.7.rst:1810 msgid "" ":class:`asyncio.Future` callback management has been optimized. (Contributed " "by Yury Selivanov in :issue:`32348`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1800 +#: ../../whatsnew/3.7.rst:1813 msgid "" ":func:`asyncio.gather` is now up to 15% faster. (Contributed by Yury " "Selivanov in :issue:`32355`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1803 +#: ../../whatsnew/3.7.rst:1816 msgid "" ":func:`asyncio.sleep` is now up to 2 times faster when the *delay* argument " "is zero or negative. (Contributed by Andrew Svetlov in :issue:`32351`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1807 +#: ../../whatsnew/3.7.rst:1820 msgid "" "The performance overhead of asyncio debug mode has been reduced. " "(Contributed by Antoine Pitrou in :issue:`31970`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1810 +#: ../../whatsnew/3.7.rst:1823 msgid "" "As a result of :ref:`PEP 560 work `, the import time of :" "mod:`typing` has been reduced by a factor of 7, and many typing operations " "are now faster. (Contributed by Ivan Levkivskyi in :issue:`32226`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1815 +#: ../../whatsnew/3.7.rst:1828 msgid "" ":func:`sorted` and :meth:`list.sort` have been optimized for common cases to " "be up to 40-75% faster. (Contributed by Elliot Gorokhovsky in :issue:" "`28685`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1819 +#: ../../whatsnew/3.7.rst:1832 msgid "" ":meth:`dict.copy` is now up to 5.5 times faster. (Contributed by Yury " "Selivanov in :issue:`31179`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1822 +#: ../../whatsnew/3.7.rst:1835 msgid "" ":func:`hasattr` and :func:`getattr` are now about 4 times faster when *name* " "is not found and *obj* does not override :meth:`object.__getattr__` or :meth:" "`object.__getattribute__`. (Contributed by INADA Naoki in :issue:`32544`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1827 +#: ../../whatsnew/3.7.rst:1840 msgid "" "Searching for certain Unicode characters (like Ukrainian capital \"Є\") in a " "string was up to 25 times slower than searching for other characters. It is " @@ -2609,7 +2627,7 @@ msgid "" "in :issue:`24821`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1832 +#: ../../whatsnew/3.7.rst:1845 msgid "" "The :func:`collections.namedtuple` factory has been reimplemented to make " "the creation of named tuples 4 to 6 times faster. (Contributed by Jelle " @@ -2617,33 +2635,33 @@ msgid "" "Raymond Hettinger in :issue:`28638`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1837 +#: ../../whatsnew/3.7.rst:1850 msgid "" ":meth:`date.fromordinal` and :meth:`date.fromtimestamp` are now up to 30% " "faster in the common case. (Contributed by Paul Ganssle in :issue:`32403`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1841 +#: ../../whatsnew/3.7.rst:1854 msgid "" "The :func:`os.fwalk` function is now up to 2 times faster thanks to the use " "of :func:`os.scandir`. (Contributed by Serhiy Storchaka in :issue:`25996`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1845 +#: ../../whatsnew/3.7.rst:1858 msgid "" "The speed of the :func:`shutil.rmtree` function has been improved by 20--40% " "thanks to the use of the :func:`os.scandir` function. (Contributed by Serhiy " "Storchaka in :issue:`28564`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1849 +#: ../../whatsnew/3.7.rst:1862 msgid "" "Optimized case-insensitive matching and searching of :mod:`regular " "expressions `. Searching some patterns can now be up to 20 times " "faster. (Contributed by Serhiy Storchaka in :issue:`30285`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1853 +#: ../../whatsnew/3.7.rst:1866 msgid "" ":func:`re.compile` now converts ``flags`` parameter to int object if it is " "``RegexFlag``. It is now as fast as Python 3.5, and faster than Python 3.6 " @@ -2651,7 +2669,7 @@ msgid "" "`31671`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1858 +#: ../../whatsnew/3.7.rst:1871 msgid "" "The :meth:`~selectors.BaseSelector.modify` methods of classes :class:" "`selectors.EpollSelector`, :class:`selectors.PollSelector` and :class:" @@ -2659,7 +2677,7 @@ msgid "" "(Contributed by Giampaolo Rodola' in :issue:`30014`)" msgstr "" -#: ../../whatsnew/3.7.rst:1863 +#: ../../whatsnew/3.7.rst:1876 msgid "" "Constant folding has been moved from the peephole optimizer to the new AST " "optimizer, which is able perform optimizations more consistently. " @@ -2667,7 +2685,7 @@ msgid "" "`11549`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1868 +#: ../../whatsnew/3.7.rst:1881 msgid "" "Most functions and methods in :mod:`abc` have been rewritten in C. This " "makes creation of abstract base classes, and calling :func:`isinstance` and :" @@ -2676,7 +2694,7 @@ msgid "" "`31333`)" msgstr "" -#: ../../whatsnew/3.7.rst:1874 +#: ../../whatsnew/3.7.rst:1887 msgid "" "Significant speed improvements to alternate constructors for :class:" "`datetime.date` and :class:`datetime.datetime` by using fast-path " @@ -2684,7 +2702,7 @@ msgid "" "in :issue:`32403`)" msgstr "" -#: ../../whatsnew/3.7.rst:1879 +#: ../../whatsnew/3.7.rst:1892 msgid "" "The speed of comparison of :class:`array.array` instances has been improved " "considerably in certain cases. It is now from 10x to 70x faster when " @@ -2692,18 +2710,18 @@ msgid "" "Adrian Wielgosik in :issue:`24700`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1884 +#: ../../whatsnew/3.7.rst:1897 msgid "" "The :func:`math.erf` and :func:`math.erfc` functions now use the (faster) C " "library implementation on most platforms. (Contributed by Serhiy Storchaka " "in :issue:`26121`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1890 +#: ../../whatsnew/3.7.rst:1903 msgid "Other CPython Implementation Changes" msgstr "" -#: ../../whatsnew/3.7.rst:1892 +#: ../../whatsnew/3.7.rst:1905 msgid "" "Trace hooks may now opt out of receiving the ``line`` and opt into receiving " "the ``opcode`` events from the interpreter by setting the corresponding new :" @@ -2711,7 +2729,7 @@ msgid "" "the frame being traced. (Contributed by Nick Coghlan in :issue:`31344`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1897 +#: ../../whatsnew/3.7.rst:1910 msgid "" "Fixed some consistency problems with namespace package module attributes. " "Namespace module objects now have an ``__file__`` that is set to ``None`` " @@ -2722,14 +2740,14 @@ msgid "" "`32303`." msgstr "" -#: ../../whatsnew/3.7.rst:1905 +#: ../../whatsnew/3.7.rst:1918 msgid "" "The :func:`locals` dictionary now displays in the lexical order that " "variables were defined. Previously, the order was undefined. (Contributed " "by Raymond Hettinger in :issue:`32690`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1909 +#: ../../whatsnew/3.7.rst:1922 msgid "" "The ``distutils`` ``upload`` command no longer tries to change CR end-of-" "line characters to CRLF. This fixes a corruption issue with sdists that " @@ -2737,11 +2755,11 @@ msgid "" "`32304`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1916 +#: ../../whatsnew/3.7.rst:1929 msgid "Deprecated Python Behavior" msgstr "" -#: ../../whatsnew/3.7.rst:1918 +#: ../../whatsnew/3.7.rst:1931 msgid "" "Yield expressions (both ``yield`` and ``yield from`` clauses) are now " "deprecated in comprehensions and generator expressions (aside from the " @@ -2755,7 +2773,7 @@ msgid "" "Storchaka in :issue:`10544`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1929 +#: ../../whatsnew/3.7.rst:1942 msgid "" "Returning a subclass of :class:`complex` from :meth:`object.__complex__` is " "deprecated and will be an error in future Python versions. This makes " @@ -2763,22 +2781,22 @@ msgid "" "__float__`. (Contributed by Serhiy Storchaka in :issue:`28894`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1938 +#: ../../whatsnew/3.7.rst:1951 msgid "Deprecated Python modules, functions and methods" msgstr "" -#: ../../whatsnew/3.7.rst:1941 +#: ../../whatsnew/3.7.rst:1954 msgid "aifc" msgstr "aifc" -#: ../../whatsnew/3.7.rst:1943 +#: ../../whatsnew/3.7.rst:1956 msgid "" ":func:`aifc.openfp` has been deprecated and will be removed in Python 3.9. " "Use :func:`aifc.open` instead. (Contributed by Brian Curtin in :issue:" "`31985`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1953 +#: ../../whatsnew/3.7.rst:1966 msgid "" "Support for directly ``await``-ing instances of :class:`asyncio.Lock` and " "other asyncio synchronization primitives has been deprecated. An " @@ -2787,14 +2805,14 @@ msgid "" "`32253`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1959 +#: ../../whatsnew/3.7.rst:1972 msgid "" "The :meth:`asyncio.Task.current_task` and :meth:`asyncio.Task.all_tasks` " "methods have been deprecated. (Contributed by Andrew Svetlov in :issue:" "`32250`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1967 +#: ../../whatsnew/3.7.rst:1980 msgid "" "In Python 3.8, the abstract base classes in :mod:`collections.abc` will no " "longer be exposed in the regular :mod:`collections` module. This will help " @@ -2802,7 +2820,7 @@ msgid "" "base classes. (Contributed by Serhiy Storchaka in :issue:`25988`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1977 +#: ../../whatsnew/3.7.rst:1990 msgid "" ":mod:`dbm.dumb` now supports reading read-only files and no longer writes " "the index file when it is not changed. A deprecation warning is now emitted " @@ -2811,7 +2829,7 @@ msgid "" "Storchaka in :issue:`28847`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1987 +#: ../../whatsnew/3.7.rst:2000 msgid "" "In Python 3.8, attempting to check for non-Enum objects in :class:`Enum` " "classes will raise a :exc:`TypeError` (e.g. ``1 in Color``); similarly, " @@ -2821,18 +2839,18 @@ msgid "" "`33217`.)" msgstr "" -#: ../../whatsnew/3.7.rst:1996 +#: ../../whatsnew/3.7.rst:2009 msgid "gettext" msgstr "gettext" -#: ../../whatsnew/3.7.rst:1998 +#: ../../whatsnew/3.7.rst:2011 msgid "" "Using non-integer value for selecting a plural form in :mod:`gettext` is now " "deprecated. It never correctly worked. (Contributed by Serhiy Storchaka in :" "issue:`28692`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2006 +#: ../../whatsnew/3.7.rst:2019 msgid "" "Methods :meth:`!MetaPathFinder.find_module()` (replaced by :meth:" "`MetaPathFinder.find_spec() `) and :" @@ -2842,40 +2860,40 @@ msgid "" "Bussonnier in :issue:`29576`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2017 +#: ../../whatsnew/3.7.rst:2030 msgid "" "The :class:`importlib.abc.ResourceLoader` ABC has been deprecated in favour " "of :class:`importlib.abc.ResourceReader`." msgstr "" -#: ../../whatsnew/3.7.rst:2024 +#: ../../whatsnew/3.7.rst:2037 msgid "" ":func:`locale.format` has been deprecated, use :meth:`locale.format_string` " "instead. (Contributed by Garvit in :issue:`10379`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2029 +#: ../../whatsnew/3.7.rst:2042 msgid "macpath" msgstr "macpath" -#: ../../whatsnew/3.7.rst:2031 +#: ../../whatsnew/3.7.rst:2044 msgid "" "The :mod:`macpath` is now deprecated and will be removed in Python 3.8. " "(Contributed by Chi Hsuan Yen in :issue:`9850`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2036 +#: ../../whatsnew/3.7.rst:2049 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.7.rst:2038 +#: ../../whatsnew/3.7.rst:2051 msgid "" ":mod:`dummy_threading` and :mod:`_dummy_thread` have been deprecated. It is " "no longer possible to build Python with threading disabled. Use :mod:" "`threading` instead. (Contributed by Antoine Pitrou in :issue:`31370`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2047 +#: ../../whatsnew/3.7.rst:2060 msgid "" "The silent argument value truncation in :func:`socket.htons` and :func:" "`socket.ntohs` has been deprecated. In future versions of Python, if the " @@ -2883,52 +2901,52 @@ msgid "" "(Contributed by Oren Milman in :issue:`28332`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2056 +#: ../../whatsnew/3.7.rst:2069 msgid "" ":func:`ssl.wrap_socket` is deprecated. Use :meth:`ssl.SSLContext." "wrap_socket` instead. (Contributed by Christian Heimes in :issue:`28124`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2062 +#: ../../whatsnew/3.7.rst:2075 msgid "sunau" msgstr "sunau" -#: ../../whatsnew/3.7.rst:2064 +#: ../../whatsnew/3.7.rst:2077 msgid "" ":func:`sunau.openfp` has been deprecated and will be removed in Python 3.9. " "Use :func:`sunau.open` instead. (Contributed by Brian Curtin in :issue:" "`31985`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2072 +#: ../../whatsnew/3.7.rst:2085 msgid "" "Deprecated :func:`sys.set_coroutine_wrapper` and :func:`sys." "get_coroutine_wrapper`." msgstr "" -#: ../../whatsnew/3.7.rst:2075 +#: ../../whatsnew/3.7.rst:2088 msgid "" "The undocumented ``sys.callstats()`` function has been deprecated and will " "be removed in a future Python version. (Contributed by Victor Stinner in :" "issue:`28799`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2081 +#: ../../whatsnew/3.7.rst:2094 msgid "wave" msgstr "wave" -#: ../../whatsnew/3.7.rst:2083 +#: ../../whatsnew/3.7.rst:2096 msgid "" ":func:`wave.openfp` has been deprecated and will be removed in Python 3.9. " "Use :func:`wave.open` instead. (Contributed by Brian Curtin in :issue:" "`31985`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2089 +#: ../../whatsnew/3.7.rst:2102 msgid "Deprecated functions and types of the C API" msgstr "" -#: ../../whatsnew/3.7.rst:2091 +#: ../../whatsnew/3.7.rst:2104 msgid "" "Function :c:func:`PySlice_GetIndicesEx` is deprecated and replaced with a " "macro if ``Py_LIMITED_API`` is not set or set to a value in the range " @@ -2937,7 +2955,7 @@ msgid "" "`27867`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2096 +#: ../../whatsnew/3.7.rst:2109 msgid "" ":c:func:`PyOS_AfterFork` has been deprecated. Use :c:func:" "`PyOS_BeforeFork`, :c:func:`PyOS_AfterFork_Parent` or :c:func:" @@ -2945,15 +2963,15 @@ msgid "" "`16500`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2104 +#: ../../whatsnew/3.7.rst:2117 msgid "Platform Support Removals" msgstr "" -#: ../../whatsnew/3.7.rst:2106 +#: ../../whatsnew/3.7.rst:2119 msgid "FreeBSD 9 and older are no longer officially supported." msgstr "" -#: ../../whatsnew/3.7.rst:2107 +#: ../../whatsnew/3.7.rst:2120 msgid "" "For full Unicode support, including within extension modules, \\*nix " "platforms are now expected to provide at least one of ``C.UTF-8`` (full " @@ -2961,7 +2979,7 @@ msgid "" "an alternative to the legacy ``ASCII``-based ``C`` locale." msgstr "" -#: ../../whatsnew/3.7.rst:2111 +#: ../../whatsnew/3.7.rst:2124 msgid "" "OpenSSL 0.9.8 and 1.0.1 are no longer supported, which means building " "CPython 3.7 with SSL/TLS support on older platforms still using these " @@ -2969,14 +2987,14 @@ msgid "" "OpenSSL." msgstr "" -#: ../../whatsnew/3.7.rst:2115 +#: ../../whatsnew/3.7.rst:2128 msgid "" "Notably, this issue affects the Debian 8 (aka \"jessie\") and Ubuntu 14.04 " "(aka \"Trusty\") LTS Linux distributions, as they still use OpenSSL 1.0.1 by " "default." msgstr "" -#: ../../whatsnew/3.7.rst:2119 +#: ../../whatsnew/3.7.rst:2132 msgid "" "Debian 9 (\"stretch\") and Ubuntu 16.04 (\"xenial\"), as well as recent " "releases of other LTS Linux releases (e.g. RHEL/CentOS 7.5, SLES 12-SP3), " @@ -2984,7 +3002,7 @@ msgid "" "configuration." msgstr "" -#: ../../whatsnew/3.7.rst:2123 +#: ../../whatsnew/3.7.rst:2136 msgid "" "CPython's own `CI configuration file `_ provides an example of using the SSL :source:" @@ -2993,41 +3011,41 @@ msgid "" "outdated system provided OpenSSL." msgstr "" -#: ../../whatsnew/3.7.rst:2132 +#: ../../whatsnew/3.7.rst:2145 msgid "API and Feature Removals" msgstr "" -#: ../../whatsnew/3.7.rst:2134 +#: ../../whatsnew/3.7.rst:2147 msgid "The following features and APIs have been removed from Python 3.7:" msgstr "" -#: ../../whatsnew/3.7.rst:2136 +#: ../../whatsnew/3.7.rst:2149 msgid "" "The ``os.stat_float_times()`` function has been removed. It was introduced " "in Python 2.3 for backward compatibility with Python 2.2, and was deprecated " "since Python 3.1." msgstr "" -#: ../../whatsnew/3.7.rst:2140 +#: ../../whatsnew/3.7.rst:2153 msgid "" "Unknown escapes consisting of ``'\\'`` and an ASCII letter in replacement " "templates for :func:`re.sub` were deprecated in Python 3.5, and will now " "cause an error." msgstr "" -#: ../../whatsnew/3.7.rst:2144 +#: ../../whatsnew/3.7.rst:2157 msgid "" "Removed support of the *exclude* argument in :meth:`tarfile.TarFile.add`. It " "was deprecated in Python 2.7 and 3.2. Use the *filter* argument instead." msgstr "" -#: ../../whatsnew/3.7.rst:2147 +#: ../../whatsnew/3.7.rst:2160 msgid "" "The :func:`!ntpath.splitunc` function was deprecated in Python 3.1, and has " "now been removed. Use :func:`~os.path.splitdrive` instead." msgstr "" -#: ../../whatsnew/3.7.rst:2151 +#: ../../whatsnew/3.7.rst:2164 msgid "" ":func:`collections.namedtuple` no longer supports the *verbose* parameter or " "``_source`` attribute which showed the generated source code for the named " @@ -3036,14 +3054,14 @@ msgid "" "Naoki, Serhiy Storchaka, and Raymond Hettinger in :issue:`28638`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2157 +#: ../../whatsnew/3.7.rst:2170 msgid "" "Functions :func:`bool`, :func:`float`, :func:`list` and :func:`tuple` no " "longer take keyword arguments. The first argument of :func:`int` can now be " "passed only as positional argument." msgstr "" -#: ../../whatsnew/3.7.rst:2161 +#: ../../whatsnew/3.7.rst:2174 msgid "" "Removed previously deprecated in Python 2.4 classes ``Plist``, ``Dict`` and " "``_InternalDict`` in the :mod:`plistlib` module. Dict values in the result " @@ -3052,7 +3070,7 @@ msgid "" "access to access items of these dictionaries." msgstr "" -#: ../../whatsnew/3.7.rst:2167 +#: ../../whatsnew/3.7.rst:2180 msgid "" "The ``asyncio.windows_utils.socketpair()`` function has been removed. Use " "the :func:`socket.socketpair` function instead, it is available on all " @@ -3060,14 +3078,14 @@ msgid "" "alias to ``socket.socketpair`` on Python 3.5 and newer." msgstr "" -#: ../../whatsnew/3.7.rst:2173 +#: ../../whatsnew/3.7.rst:2186 msgid "" ":mod:`asyncio` no longer exports the :mod:`selectors` and :mod:`_overlapped` " "modules as ``asyncio.selectors`` and ``asyncio._overlapped``. Replace ``from " "asyncio import selectors`` with ``import selectors``." msgstr "" -#: ../../whatsnew/3.7.rst:2178 +#: ../../whatsnew/3.7.rst:2191 msgid "" "Direct instantiation of :class:`ssl.SSLSocket` and :class:`ssl.SSLObject` " "objects is now prohibited. The constructors were never documented, tested, " @@ -3076,17 +3094,17 @@ msgid "" "in :issue:`32951`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2184 +#: ../../whatsnew/3.7.rst:2197 msgid "" "The unused ``distutils`` ``install_misc`` command has been removed. " "(Contributed by Eric N. Vander Weele in :issue:`29218`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2189 +#: ../../whatsnew/3.7.rst:2202 msgid "Module Removals" msgstr "" -#: ../../whatsnew/3.7.rst:2191 +#: ../../whatsnew/3.7.rst:2204 msgid "" "The ``fpectl`` module has been removed. It was never enabled by default, " "never worked correctly on x86-64, and it changed the Python ABI in ways that " @@ -3094,11 +3112,11 @@ msgid "" "Smith in :issue:`29137`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2198 ../../whatsnew/3.7.rst:2474 +#: ../../whatsnew/3.7.rst:2211 ../../whatsnew/3.7.rst:2487 msgid "Windows-only Changes" msgstr "" -#: ../../whatsnew/3.7.rst:2200 +#: ../../whatsnew/3.7.rst:2213 msgid "" "The python launcher, (py.exe), can accept 32 & 64 bit specifiers **without** " "having to specify a minor version as well. So ``py -3-32`` and ``py -3-64`` " @@ -3108,7 +3126,7 @@ msgid "" "(Contributed by Steve Barnes in :issue:`30291`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2207 +#: ../../whatsnew/3.7.rst:2220 msgid "" "The launcher can be run as ``py -0`` to produce a list of the installed " "pythons, *with default marked with an asterisk*. Running ``py -0p`` will " @@ -3117,28 +3135,28 @@ msgid "" "(Contributed by Steve Barnes in :issue:`30362`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2217 +#: ../../whatsnew/3.7.rst:2230 msgid "Porting to Python 3.7" msgstr "" -#: ../../whatsnew/3.7.rst:2219 +#: ../../whatsnew/3.7.rst:2232 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.7.rst:2224 +#: ../../whatsnew/3.7.rst:2237 msgid "Changes in Python Behavior" msgstr "" -#: ../../whatsnew/3.7.rst:2226 +#: ../../whatsnew/3.7.rst:2239 msgid "" ":keyword:`async` and :keyword:`await` names are now reserved keywords. Code " "using these names as identifiers will now raise a :exc:`SyntaxError`. " "(Contributed by Jelle Zijlstra in :issue:`30406`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2230 +#: ../../whatsnew/3.7.rst:2243 msgid "" ":pep:`479` is enabled for all code in Python 3.7, meaning that :exc:" "`StopIteration` exceptions raised directly or indirectly in coroutines and " @@ -3146,19 +3164,19 @@ msgid "" "by Yury Selivanov in :issue:`32670`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2236 +#: ../../whatsnew/3.7.rst:2249 msgid "" ":meth:`object.__aiter__` methods can no longer be declared as asynchronous. " "(Contributed by Yury Selivanov in :issue:`31709`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2239 +#: ../../whatsnew/3.7.rst:2252 msgid "" "Due to an oversight, earlier Python versions erroneously accepted the " "following syntax::" msgstr "" -#: ../../whatsnew/3.7.rst:2247 +#: ../../whatsnew/3.7.rst:2260 msgid "" "Python 3.7 now correctly raises a :exc:`SyntaxError`, as a generator " "expression always needs to be directly inside a set of parentheses and " @@ -3167,7 +3185,7 @@ msgid "" "`32012` and :issue:`32023`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2253 +#: ../../whatsnew/3.7.rst:2266 msgid "" "When using the :option:`-m` switch, the initial working directory is now " "added to :data:`sys.path`, rather than an empty string (which dynamically " @@ -3179,11 +3197,11 @@ msgid "" "place)." msgstr "" -#: ../../whatsnew/3.7.rst:2263 +#: ../../whatsnew/3.7.rst:2276 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.7.rst:2265 +#: ../../whatsnew/3.7.rst:2278 msgid "" ":meth:`socketserver.ThreadingMixIn.server_close` now waits until all non-" "daemon threads complete. Set the new :attr:`socketserver.ThreadingMixIn." @@ -3191,7 +3209,7 @@ msgid "" "(Contributed by Victor Stinner in :issue:`31233` and :issue:`33540`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2271 +#: ../../whatsnew/3.7.rst:2284 msgid "" ":meth:`socketserver.ForkingMixIn.server_close` now waits until all child " "processes complete. Set the new :attr:`socketserver.ForkingMixIn." @@ -3199,21 +3217,21 @@ msgid "" "(Contributed by Victor Stinner in :issue:`31151` and :issue:`33540`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2277 +#: ../../whatsnew/3.7.rst:2290 msgid "" "The :func:`locale.localeconv` function now temporarily sets the ``LC_CTYPE`` " "locale to the value of ``LC_NUMERIC`` in some cases. (Contributed by Victor " "Stinner in :issue:`31900`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2281 +#: ../../whatsnew/3.7.rst:2294 msgid "" ":meth:`pkgutil.walk_packages` now raises a :exc:`ValueError` if *path* is a " "string. Previously an empty list was returned. (Contributed by Sanyam " "Khurana in :issue:`24744`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2285 +#: ../../whatsnew/3.7.rst:2298 msgid "" "A format string argument for :meth:`string.Formatter.format` is now :ref:" "`positional-only `. Passing it as a keyword " @@ -3221,7 +3239,7 @@ msgid "" "issue:`29193`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2290 +#: ../../whatsnew/3.7.rst:2303 msgid "" "Attributes :attr:`~http.cookies.Morsel.key`, :attr:`~http.cookies.Morsel." "value` and :attr:`~http.cookies.Morsel.coded_value` of class :class:`http." @@ -3230,7 +3248,7 @@ msgid "" "them. (Contributed by Serhiy Storchaka in :issue:`29192`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2298 +#: ../../whatsnew/3.7.rst:2311 msgid "" "The *mode* argument of :func:`os.makedirs` no longer affects the file " "permission bits of newly created intermediate-level directories. To set " @@ -3238,13 +3256,13 @@ msgid "" "``makedirs()``. (Contributed by Serhiy Storchaka in :issue:`19930`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2304 +#: ../../whatsnew/3.7.rst:2317 msgid "" "The :attr:`struct.Struct.format` type is now :class:`str` instead of :class:" "`bytes`. (Contributed by Victor Stinner in :issue:`21071`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2307 +#: ../../whatsnew/3.7.rst:2320 msgid "" ":func:`~cgi.parse_multipart` now accepts the *encoding* and *errors* " "arguments and returns the same results as :class:`!FieldStorage`: for non-" @@ -3252,27 +3270,27 @@ msgid "" "(Contributed by Pierre Quentel in :issue:`29979`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2313 +#: ../../whatsnew/3.7.rst:2326 msgid "" "Due to internal changes in :mod:`socket`, calling :func:`socket.fromshare` " "on a socket created by :func:`socket.share ` in older " "Python versions is not supported." msgstr "" -#: ../../whatsnew/3.7.rst:2317 +#: ../../whatsnew/3.7.rst:2330 msgid "" "``repr`` for :exc:`BaseException` has changed to not include the trailing " "comma. Most exceptions are affected by this change. (Contributed by Serhiy " "Storchaka in :issue:`30399`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2321 +#: ../../whatsnew/3.7.rst:2334 msgid "" "``repr`` for :class:`datetime.timedelta` has changed to include the keyword " "arguments in the output. (Contributed by Utkarsh Upadhyay in :issue:`30302`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2324 +#: ../../whatsnew/3.7.rst:2337 msgid "" "Because :func:`shutil.rmtree` is now implemented using the :func:`os." "scandir` function, the user specified handler *onerror* is now called with " @@ -3280,7 +3298,7 @@ msgid "" "directory is failed." msgstr "" -#: ../../whatsnew/3.7.rst:2329 +#: ../../whatsnew/3.7.rst:2342 msgid "" "Support for nested sets and set operations in regular expressions as in " "`Unicode Technical Standard #18`_ might be added in the future. This would " @@ -3291,7 +3309,7 @@ msgid "" "with a backslash. (Contributed by Serhiy Storchaka in :issue:`30349`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2340 +#: ../../whatsnew/3.7.rst:2353 msgid "" "The result of splitting a string on a :mod:`regular expression ` that " "could match an empty string has been changed. For example splitting on " @@ -3302,7 +3320,7 @@ msgid "" "patterns since Python 3.5." msgstr "" -#: ../../whatsnew/3.7.rst:2349 +#: ../../whatsnew/3.7.rst:2362 msgid "" "For patterns that match both empty and non-empty strings, the result of " "searching for all matches may also be changed in other cases. For example " @@ -3312,7 +3330,7 @@ msgid "" "as ``r'(?m)^[^\\S\\n]*$'``." msgstr "" -#: ../../whatsnew/3.7.rst:2356 +#: ../../whatsnew/3.7.rst:2369 msgid "" ":func:`re.sub()` now replaces empty matches adjacent to a previous non-empty " "match. For example ``re.sub('x*', '-', 'abxd')`` returns now ``'-a-b--d-'`` " @@ -3320,25 +3338,25 @@ msgid "" "and the second minus replaces an empty string between 'x' and 'd')." msgstr "" -#: ../../whatsnew/3.7.rst:2362 +#: ../../whatsnew/3.7.rst:2375 msgid "(Contributed by Serhiy Storchaka in :issue:`25054` and :issue:`32308`.)" msgstr "(由 Serhiy Storchaka 在 :issue:`25054` 和 :issue:`32308` 中貢獻。)" -#: ../../whatsnew/3.7.rst:2364 +#: ../../whatsnew/3.7.rst:2377 msgid "" "Change :func:`re.escape` to only escape regex special characters instead of " "escaping all characters other than ASCII letters, numbers, and ``'_'``. " "(Contributed by Serhiy Storchaka in :issue:`29995`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2368 +#: ../../whatsnew/3.7.rst:2381 msgid "" ":class:`tracemalloc.Traceback` frames are now sorted from oldest to most " "recent to be more consistent with :mod:`traceback`. (Contributed by Jesse " "Bakker in :issue:`32121`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2372 +#: ../../whatsnew/3.7.rst:2385 msgid "" "On OSes that support :const:`socket.SOCK_NONBLOCK` or :const:`socket." "SOCK_CLOEXEC` bit flags, the :attr:`socket.type ` no " @@ -3347,7 +3365,7 @@ msgid "" "Selivanov in :issue:`32331`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2379 +#: ../../whatsnew/3.7.rst:2392 msgid "" "On Windows the default for the *close_fds* argument of :class:`subprocess." "Popen` was changed from :const:`False` to :const:`True` when redirecting the " @@ -3357,7 +3375,7 @@ msgid "" "`STARTUPINFO.lpAttributeList `." msgstr "" -#: ../../whatsnew/3.7.rst:2387 +#: ../../whatsnew/3.7.rst:2400 msgid "" ":meth:`importlib.machinery.PathFinder.invalidate_caches` -- which implicitly " "affects :func:`importlib.invalidate_caches` -- now deletes entries in :data:" @@ -3365,7 +3383,7 @@ msgid "" "Cannon in :issue:`33169`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2392 +#: ../../whatsnew/3.7.rst:2405 msgid "" "In :mod:`asyncio`, :meth:`loop.sock_recv() `, :meth:" "`loop.sock_sendall() `, :meth:`loop.sock_accept() " @@ -3376,21 +3394,21 @@ msgid "" "(Contributed by Yury Selivanov in :issue:`32327`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2403 +#: ../../whatsnew/3.7.rst:2416 msgid "" ":attr:`asyncio.Server.sockets` now returns a copy of the internal list of " "server sockets, instead of returning it directly. (Contributed by Yury " "Selivanov in :issue:`32662`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2407 +#: ../../whatsnew/3.7.rst:2420 msgid "" ":attr:`Struct.format ` is now a :class:`str` instance " "instead of a :class:`bytes` instance. (Contributed by Victor Stinner in :" "issue:`21071`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2411 +#: ../../whatsnew/3.7.rst:2424 msgid "" ":mod:`argparse` subparsers can now be made mandatory by passing " "``required=True`` to :meth:`ArgumentParser.add_subparsers() ` will now " "consistently raise an exception when a date falls outside of the " @@ -3417,13 +3435,13 @@ msgid "" "date`. (Contributed by Alexander Belopolsky in :issue:`28292`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2429 +#: ../../whatsnew/3.7.rst:2442 msgid "" ":class:`collections.ChainMap` now preserves the order of the underlying " "mappings. (Contributed by Raymond Hettinger in :issue:`32792`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2432 +#: ../../whatsnew/3.7.rst:2445 msgid "" "The ``submit()`` method of :class:`concurrent.futures.ThreadPoolExecutor` " "and :class:`concurrent.futures.ProcessPoolExecutor` now raises a :exc:" @@ -3431,7 +3449,7 @@ msgid "" "Nemec in :issue:`33097`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2437 +#: ../../whatsnew/3.7.rst:2450 msgid "" "The :class:`configparser.ConfigParser` constructor now uses ``read_dict()`` " "to process the default values, making its behavior consistent with the rest " @@ -3440,7 +3458,7 @@ msgid "" "in :issue:`23835`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2443 +#: ../../whatsnew/3.7.rst:2456 msgid "" "Several undocumented internal imports were removed. One example is that ``os." "errno`` is no longer available; use ``import errno`` directly instead. Note " @@ -3448,11 +3466,11 @@ msgid "" "notice, even in micro version releases." msgstr "" -#: ../../whatsnew/3.7.rst:2451 +#: ../../whatsnew/3.7.rst:2464 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.7.rst:2453 +#: ../../whatsnew/3.7.rst:2466 msgid "" "The function :c:func:`PySlice_GetIndicesEx` is considered unsafe for " "resizable sequences. If the slice indices are not instances of :class:" @@ -3464,23 +3482,23 @@ msgid "" "Storchaka in :issue:`27867`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2464 +#: ../../whatsnew/3.7.rst:2477 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.7.rst:2466 +#: ../../whatsnew/3.7.rst:2479 msgid "" "There are two new opcodes: :opcode:`LOAD_METHOD` and :opcode:`CALL_METHOD`. " "(Contributed by Yury Selivanov and INADA Naoki in :issue:`26110`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2469 +#: ../../whatsnew/3.7.rst:2482 msgid "" "The :opcode:`STORE_ANNOTATION` opcode has been removed. (Contributed by Mark " "Shannon in :issue:`32550`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2476 +#: ../../whatsnew/3.7.rst:2489 msgid "" "The file used to override :data:`sys.path` is now called ``._pth`` instead of ``'sys.path'``. See :ref:" @@ -3488,11 +3506,11 @@ msgid "" "in :issue:`28137`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2483 +#: ../../whatsnew/3.7.rst:2496 msgid "Other CPython implementation changes" msgstr "" -#: ../../whatsnew/3.7.rst:2485 +#: ../../whatsnew/3.7.rst:2498 msgid "" "In preparation for potential future changes to the public CPython runtime " "initialization API (see :pep:`432` for an initial, but somewhat outdated, " @@ -3507,21 +3525,21 @@ msgid "" "Stinner in a number of other issues). Some known details affected:" msgstr "" -#: ../../whatsnew/3.7.rst:2498 +#: ../../whatsnew/3.7.rst:2511 msgid "" ":c:func:`PySys_AddWarnOptionUnicode` is not currently usable by embedding " "applications due to the requirement to create a Unicode object prior to " "calling ``Py_Initialize``. Use :c:func:`PySys_AddWarnOption` instead." msgstr "" -#: ../../whatsnew/3.7.rst:2502 +#: ../../whatsnew/3.7.rst:2515 msgid "" "warnings filters added by an embedding application with :c:func:" "`PySys_AddWarnOption` should now more consistently take precedence over the " "default filters set by the interpreter" msgstr "" -#: ../../whatsnew/3.7.rst:2506 +#: ../../whatsnew/3.7.rst:2519 msgid "" "Due to changes in the way the default warnings filters are configured, " "setting :c:data:`Py_BytesWarningFlag` to a value greater than one is no " @@ -3531,7 +3549,7 @@ msgid "" "BytesWarning`` warnings filter added to convert them to exceptions." msgstr "" -#: ../../whatsnew/3.7.rst:2513 +#: ../../whatsnew/3.7.rst:2526 msgid "" "Due to a change in the way docstrings are handled by the compiler, the " "implicit ``return None`` in a function body consisting solely of a docstring " @@ -3539,7 +3557,7 @@ msgid "" "function's header line." msgstr "" -#: ../../whatsnew/3.7.rst:2518 +#: ../../whatsnew/3.7.rst:2531 msgid "" "The current exception state has been moved from the frame object to the co-" "routine. This simplified the interpreter and fixed a couple of obscure bugs " @@ -3547,11 +3565,11 @@ msgid "" "(Contributed by Mark Shannon in :issue:`25612`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2524 +#: ../../whatsnew/3.7.rst:2537 msgid "Notable changes in Python 3.7.1" msgstr "" -#: ../../whatsnew/3.7.rst:2526 +#: ../../whatsnew/3.7.rst:2539 msgid "" "Starting in 3.7.1, :c:func:`Py_Initialize` now consistently reads and " "respects all of the same environment settings as :c:func:`Py_Main` (in " @@ -3561,14 +3579,14 @@ msgid "" "`Py_IgnoreEnvironmentFlag` to 1 before calling :c:func:`Py_Initialize`." msgstr "" -#: ../../whatsnew/3.7.rst:2533 +#: ../../whatsnew/3.7.rst:2546 msgid "" "In 3.7.1 the C API for Context Variables :ref:`was updated " "` to use :c:type:`PyObject` " "pointers. See also :issue:`34762`." msgstr "" -#: ../../whatsnew/3.7.rst:2537 +#: ../../whatsnew/3.7.rst:2550 msgid "" "In 3.7.1 the :mod:`tokenize` module now implicitly emits a ``NEWLINE`` token " "when provided with input that does not have a trailing new line. This " @@ -3576,11 +3594,11 @@ msgid "" "Ammar Askar in :issue:`33899`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2543 +#: ../../whatsnew/3.7.rst:2556 msgid "Notable changes in Python 3.7.2" msgstr "" -#: ../../whatsnew/3.7.rst:2545 +#: ../../whatsnew/3.7.rst:2558 msgid "" "In 3.7.2, :mod:`venv` on Windows no longer copies the original binaries, but " "creates redirector scripts named ``python.exe`` and ``pythonw.exe`` instead. " @@ -3590,11 +3608,11 @@ msgid "" "to get the new scripts." msgstr "" -#: ../../whatsnew/3.7.rst:2553 +#: ../../whatsnew/3.7.rst:2566 msgid "Notable changes in Python 3.7.6" msgstr "" -#: ../../whatsnew/3.7.rst:2555 +#: ../../whatsnew/3.7.rst:2568 msgid "" "Due to significant security concerns, the *reuse_address* parameter of :meth:" "`asyncio.loop.create_datagram_endpoint` is no longer supported. This is " @@ -3604,11 +3622,11 @@ msgid "" "`37228`.)" msgstr "" -#: ../../whatsnew/3.7.rst:2563 +#: ../../whatsnew/3.7.rst:2576 msgid "Notable changes in Python 3.7.10" msgstr "" -#: ../../whatsnew/3.7.rst:2565 +#: ../../whatsnew/3.7.rst:2578 msgid "" "Earlier Python versions allowed using both ``;`` and ``&`` as query " "parameter separators in :func:`urllib.parse.parse_qs` and :func:`urllib." @@ -3619,3 +3637,44 @@ msgid "" "For more details, please see their respective documentation. (Contributed by " "Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.)" msgstr "" + +#: ../../whatsnew/3.7.rst:2589 +msgid "Notable changes in Python 3.7.11" +msgstr "" + +#: ../../whatsnew/3.7.rst:2591 +msgid "" +"A security fix alters the :class:`ftplib.FTP` behavior to not trust the IPv4 " +"address sent from the remote server when setting up a passive data channel. " +"We reuse the ftp server IP address instead. For unusual code requiring the " +"old behavior, set a ``trust_server_pasv_ipv4_address`` attribute on your FTP " +"instance to ``True``. (See :gh:`87451`)" +msgstr "" + +#: ../../whatsnew/3.7.rst:2598 +msgid "" +"The presence of newline or tab characters in parts of a URL allows for some " +"forms of attacks. Following the WHATWG specification that updates RFC 3986, " +"ASCII newline ``\\n``, ``\\r`` and tab ``\\t`` characters are stripped from " +"the URL by the parser :func:`urllib.parse` preventing such attacks. The " +"removal characters are controlled by a new module level variable ``urllib." +"parse._UNSAFE_URL_BYTES_TO_REMOVE``. (See :gh:`88048`)" +msgstr "" + +#: ../../whatsnew/3.7.rst:2606 +msgid "Notable security feature in 3.7.14" +msgstr "" + +#: ../../whatsnew/3.7.rst:2608 +msgid "" +"Converting between :class:`int` and :class:`str` in bases other than 2 " +"(binary), 4, 8 (octal), 16 (hexadecimal), or 32 such as base 10 (decimal) " +"now raises a :exc:`ValueError` if the number of digits in string form is " +"above a limit to avoid potential denial of service attacks due to the " +"algorithmic complexity. This is a mitigation for `CVE-2020-10735 `_. This limit can be " +"configured or disabled by environment variable, command line flag, or :mod:" +"`sys` APIs. See the :ref:`integer string conversion length limitation " +"` documentation. The default limit is 4300 digits in " +"string form." +msgstr "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index e7f99d7ab9..d654f7bb7c 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-30 00:03+0000\n" +"POT-Creation-Date: 2024-02-16 00:03+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-" @@ -1523,7 +1523,7 @@ msgid "" "(:func:`gc.collect`). (Contributed by Victor Stinner in :issue:`36829`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1250 +#: ../../whatsnew/3.8.rst:1250 ../../whatsnew/3.8.rst:2351 msgid "tarfile" msgstr "tarfile" @@ -2417,7 +2417,7 @@ msgid "" "`sys.is_finalizing`. (Contributed by Joannah Nanjekye in :issue:`36475`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1858 +#: ../../whatsnew/3.8.rst:1858 ../../whatsnew/3.8.rst:2321 msgid "Changes in the Python API" msgstr "" @@ -2856,11 +2856,34 @@ msgid "" msgstr "" #: ../../whatsnew/3.8.rst:2247 -msgid "Notable changes in Python 3.8.8" +msgid "Notable changes in Python 3.8.2" msgstr "" #: ../../whatsnew/3.8.rst:2249 msgid "" +"Fixed a regression with the ``ignore`` callback of :func:`shutil.copytree`. " +"The argument types are now str and List[str] again. (Contributed by Manuel " +"Barkhau and Giampaolo Rodola in :gh:`83571`.)" +msgstr "" + +#: ../../whatsnew/3.8.rst:2254 +msgid "Notable changes in Python 3.8.3" +msgstr "" + +#: ../../whatsnew/3.8.rst:2256 +msgid "" +"The constant values of future flags in the :mod:`__future__` module are " +"updated in order to prevent collision with compiler flags. Previously " +"``PyCF_ALLOW_TOP_LEVEL_AWAIT`` was clashing with ``CO_FUTURE_DIVISION``. " +"(Contributed by Batuhan Taskaya in :gh:`83743`)" +msgstr "" + +#: ../../whatsnew/3.8.rst:2262 +msgid "Notable changes in Python 3.8.8" +msgstr "" + +#: ../../whatsnew/3.8.rst:2264 +msgid "" "Earlier Python versions allowed using both ``;`` and ``&`` as query " "parameter separators in :func:`urllib.parse.parse_qs` and :func:`urllib." "parse.parse_qsl`. Due to security concerns, and to conform with newer W3C " @@ -2871,11 +2894,66 @@ msgid "" "Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2260 +#: ../../whatsnew/3.8.rst:2275 +msgid "Notable changes in Python 3.8.9" +msgstr "" + +#: ../../whatsnew/3.8.rst:2277 +msgid "" +"A security fix alters the :class:`ftplib.FTP` behavior to not trust the IPv4 " +"address sent from the remote server when setting up a passive data channel. " +"We reuse the ftp server IP address instead. For unusual code requiring the " +"old behavior, set a ``trust_server_pasv_ipv4_address`` attribute on your FTP " +"instance to ``True``. (See :gh:`87451`)" +msgstr "" + +#: ../../whatsnew/3.8.rst:2284 ../../whatsnew/3.8.rst:2304 +msgid "Notable changes in Python 3.8.10" +msgstr "" + +#: ../../whatsnew/3.8.rst:2287 +msgid "macOS 11.0 (Big Sur) and Apple Silicon Mac support" +msgstr "" + +#: ../../whatsnew/3.8.rst:2289 +msgid "" +"As of 3.8.10, Python now supports building and running on macOS 11 (Big Sur) " +"and on Apple Silicon Macs (based on the ``ARM64`` architecture). A new " +"universal build variant, ``universal2``, is now available to natively " +"support both ``ARM64`` and ``Intel 64`` in one set of executables. Note that " +"support for \"weaklinking\", building binaries targeted for newer versions " +"of macOS that will also run correctly on older versions by testing at " +"runtime for missing features, is not included in this backport from Python " +"3.9; to support a range of macOS versions, continue to target for and build " +"on the oldest version in the range." +msgstr "" + +#: ../../whatsnew/3.8.rst:2299 +msgid "" +"(Originally contributed by Ronald Oussoren and Lawrence D'Anna in :gh:" +"`85272`, with fixes by FX Coudert and Eli Rykoff, and backported to 3.8 by " +"Maxime Bélanger and Ned Deily)" +msgstr "" + +#: ../../whatsnew/3.8.rst:2307 +msgid "urllib.parse" +msgstr "" + +#: ../../whatsnew/3.8.rst:2309 +msgid "" +"The presence of newline or tab characters in parts of a URL allows for some " +"forms of attacks. Following the WHATWG specification that updates :rfc:" +"`3986`, ASCII newline ``\\n``, ``\\r`` and tab ``\\t`` characters are " +"stripped from the URL by the parser in :mod:`urllib.parse` preventing such " +"attacks. The removal characters are controlled by a new module level " +"variable ``urllib.parse._UNSAFE_URL_BYTES_TO_REMOVE``. (See :issue:`43882`)" +msgstr "" + +#: ../../whatsnew/3.8.rst:2318 msgid "Notable changes in Python 3.8.12" msgstr "" -#: ../../whatsnew/3.8.rst:2262 +#: ../../whatsnew/3.8.rst:2323 msgid "" "Starting with Python 3.8.12 the :mod:`ipaddress` module no longer accepts " "any leading zeros in IPv4 address strings. Leading zeros are ambiguous and " @@ -2885,8 +2963,41 @@ msgid "" "leading zeros." msgstr "" -#: ../../whatsnew/3.8.rst:2269 +#: ../../whatsnew/3.8.rst:2330 msgid "" "(Originally contributed by Christian Heimes in :issue:`36384`, and " "backported to 3.8 by Achraf Merzouki.)" msgstr "" + +#: ../../whatsnew/3.8.rst:2334 +msgid "Notable security feature in 3.8.14" +msgstr "" + +#: ../../whatsnew/3.8.rst:2336 +msgid "" +"Converting between :class:`int` and :class:`str` in bases other than 2 " +"(binary), 4, 8 (octal), 16 (hexadecimal), or 32 such as base 10 (decimal) " +"now raises a :exc:`ValueError` if the number of digits in string form is " +"above a limit to avoid potential denial of service attacks due to the " +"algorithmic complexity. This is a mitigation for `CVE-2020-10735 `_. This limit can be " +"configured or disabled by environment variable, command line flag, or :mod:" +"`sys` APIs. See the :ref:`integer string conversion length limitation " +"` documentation. The default limit is 4300 digits in " +"string form." +msgstr "" + +#: ../../whatsnew/3.8.rst:2348 +msgid "Notable changes in 3.8.17" +msgstr "" + +#: ../../whatsnew/3.8.rst:2353 +msgid "" +"The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " +"have a new a *filter* argument that allows limiting tar features than may be " +"surprising or dangerous, such as creating files outside the destination " +"directory. See :ref:`tarfile-extraction-filter` for details. In Python 3.12, " +"use without the *filter* argument will show a :exc:`DeprecationWarning`. In " +"Python 3.14, the default will switch to ``'data'``. (Contributed by Petr " +"Viktorin in :pep:`706`.)" +msgstr "" diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 3b38a6f09f..40a825bcba 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-03 20:44+0000\n" +"POT-Creation-Date: 2024-02-16 00:03+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-" @@ -2286,7 +2286,7 @@ msgid "" "Python 3.10. (Contributed by Ken Jin in :issue:`42195`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1554 +#: ../../whatsnew/3.9.rst:1554 ../../whatsnew/3.9.rst:1579 msgid "urllib.parse" msgstr "urllib.parse" @@ -2301,3 +2301,67 @@ msgid "" "For more details, please see their respective documentation. (Contributed by " "Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.)" msgstr "" + +#: ../../whatsnew/3.9.rst:1567 +msgid "Notable changes in Python 3.9.3" +msgstr "" + +#: ../../whatsnew/3.9.rst:1569 +msgid "" +"A security fix alters the :class:`ftplib.FTP` behavior to not trust the IPv4 " +"address sent from the remote server when setting up a passive data channel. " +"We reuse the ftp server IP address instead. For unusual code requiring the " +"old behavior, set a ``trust_server_pasv_ipv4_address`` attribute on your FTP " +"instance to ``True``. (See :gh:`87451`)" +msgstr "" + +#: ../../whatsnew/3.9.rst:1576 +msgid "Notable changes in Python 3.9.5" +msgstr "" + +#: ../../whatsnew/3.9.rst:1581 +msgid "" +"The presence of newline or tab characters in parts of a URL allows for some " +"forms of attacks. Following the WHATWG specification that updates :rfc:" +"`3986`, ASCII newline ``\\n``, ``\\r`` and tab ``\\t`` characters are " +"stripped from the URL by the parser in :mod:`urllib.parse` preventing such " +"attacks. The removal characters are controlled by a new module level " +"variable ``urllib.parse._UNSAFE_URL_BYTES_TO_REMOVE``. (See :gh:`88048`)" +msgstr "" + +#: ../../whatsnew/3.9.rst:1589 +msgid "Notable security feature in 3.9.14" +msgstr "" + +#: ../../whatsnew/3.9.rst:1591 +msgid "" +"Converting between :class:`int` and :class:`str` in bases other than 2 " +"(binary), 4, 8 (octal), 16 (hexadecimal), or 32 such as base 10 (decimal) " +"now raises a :exc:`ValueError` if the number of digits in string form is " +"above a limit to avoid potential denial of service attacks due to the " +"algorithmic complexity. This is a mitigation for `CVE-2020-10735 `_. This limit can be " +"configured or disabled by environment variable, command line flag, or :mod:" +"`sys` APIs. See the :ref:`integer string conversion length limitation " +"` documentation. The default limit is 4300 digits in " +"string form." +msgstr "" + +#: ../../whatsnew/3.9.rst:1603 +msgid "Notable changes in 3.9.17" +msgstr "" + +#: ../../whatsnew/3.9.rst:1606 +msgid "tarfile" +msgstr "" + +#: ../../whatsnew/3.9.rst:1608 +msgid "" +"The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " +"have a new a *filter* argument that allows limiting tar features than may be " +"surprising or dangerous, such as creating files outside the destination " +"directory. See :ref:`tarfile-extraction-filter` for details. In Python 3.12, " +"use without the *filter* argument will show a :exc:`DeprecationWarning`. In " +"Python 3.14, the default will switch to ``'data'``. (Contributed by Petr " +"Viktorin in :pep:`706`.)" +msgstr "" From 1436149621f248edb62d55ba2b454da3107da5a7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 17 Feb 2024 00:04:58 +0000 Subject: [PATCH 10/33] sync with cpython d08d5b62 --- library/shutil.po | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/library/shutil.po b/library/shutil.po index 6b4ad4f562..403aea8be8 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-05 00:03+0000\n" +"POT-Creation-Date: 2024-02-17 00:03+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-" @@ -54,20 +54,21 @@ msgstr "" #: ../../library/shutil.rst:42 msgid "" -"Copy the contents of the file-like object *fsrc* to the file-like object " -"*fdst*. The integer *length*, if given, is the buffer size. In particular, a " -"negative *length* value means to copy the data without looping over the " -"source data in chunks; by default the data is read in chunks to avoid " -"uncontrolled memory consumption. Note that if the current file position of " -"the *fsrc* object is not 0, only the contents from the current file position " -"to the end of the file will be copied." +"Copy the contents of the :term:`file-like object ` *fsrc* to " +"the file-like object *fdst*. The integer *length*, if given, is the buffer " +"size. In particular, a negative *length* value means to copy the data " +"without looping over the source data in chunks; by default the data is read " +"in chunks to avoid uncontrolled memory consumption. Note that if the current " +"file position of the *fsrc* object is not 0, only the contents from the " +"current file position to the end of the file will be copied." msgstr "" #: ../../library/shutil.rst:53 msgid "" "Copy the contents (no metadata) of the file named *src* to a file named " "*dst* and return *dst* in the most efficient way possible. *src* and *dst* " -"are path-like objects or path names given as strings." +"are :term:`path-like objects ` or path names given as " +"strings." msgstr "" #: ../../library/shutil.rst:57 @@ -130,13 +131,14 @@ msgstr "" #: ../../library/shutil.rst:96 msgid "" "Copy the permission bits from *src* to *dst*. The file contents, owner, and " -"group are unaffected. *src* and *dst* are path-like objects or path names " -"given as strings. If *follow_symlinks* is false, and both *src* and *dst* " -"are symbolic links, :func:`copymode` will attempt to modify the mode of " -"*dst* itself (rather than the file it points to). This functionality is not " -"available on every platform; please see :func:`copystat` for more " -"information. If :func:`copymode` cannot modify symbolic links on the local " -"platform, and it is asked to do so, it will do nothing and return." +"group are unaffected. *src* and *dst* are :term:`path-like objects ` or path names given as strings. If *follow_symlinks* is false, " +"and both *src* and *dst* are symbolic links, :func:`copymode` will attempt " +"to modify the mode of *dst* itself (rather than the file it points to). " +"This functionality is not available on every platform; please see :func:" +"`copystat` for more information. If :func:`copymode` cannot modify symbolic " +"links on the local platform, and it is asked to do so, it will do nothing " +"and return." msgstr "" #: ../../library/shutil.rst:106 ../../library/shutil.rst:179 @@ -156,8 +158,8 @@ msgid "" "Copy the permission bits, last access time, last modification time, and " "flags from *src* to *dst*. On Linux, :func:`copystat` also copies the " "\"extended attributes\" where possible. The file contents, owner, and group " -"are unaffected. *src* and *dst* are path-like objects or path names given " -"as strings." +"are unaffected. *src* and *dst* are :term:`path-like objects ` or path names given as strings." msgstr "" #: ../../library/shutil.rst:119 From 85b7b9c693b05bb40b8c8c5dc22d18464104832d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 18 Feb 2024 00:05:06 +0000 Subject: [PATCH 11/33] sync with cpython b9d1efa6 --- c-api/hash.po | 58 ++++++++++ library/ftplib.po | 7 +- library/pickle.po | 6 +- library/re.po | 171 +++++++++++++-------------- library/ssl.po | 2 +- library/unittest.mock.po | 96 ++++++++-------- whatsnew/3.1.po | 112 +++++++++--------- whatsnew/3.2.po | 241 ++++++++++++++++++++------------------- 8 files changed, 385 insertions(+), 308 deletions(-) create mode 100644 c-api/hash.po diff --git a/c-api/hash.po b/c-api/hash.po new file mode 100644 index 0000000000..bf46c8c664 --- /dev/null +++ b/c-api/hash.po @@ -0,0 +1,58 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-02-18 00:03+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../c-api/hash.rst:4 +msgid "PyHash API" +msgstr "" + +#: ../../c-api/hash.rst:6 +msgid "See also the :c:member:`PyTypeObject.tp_hash` member." +msgstr "" + +#: ../../c-api/hash.rst:10 +msgid "Hash value type: signed integer." +msgstr "" + +#: ../../c-api/hash.rst:16 +msgid "Hash value type: unsigned integer." +msgstr "" + +#: ../../c-api/hash.rst:23 +msgid "Hash function definition used by :c:func:`PyHash_GetFuncDef`." +msgstr "" + +#: ../../c-api/hash.rst:31 +msgid "Hash function name (UTF-8 encoded string)." +msgstr "" + +#: ../../c-api/hash.rst:35 +msgid "Internal size of the hash value in bits." +msgstr "" + +#: ../../c-api/hash.rst:39 +msgid "Size of seed input in bits." +msgstr "" + +#: ../../c-api/hash.rst:46 +msgid "Get the hash function definition." +msgstr "" + +#: ../../c-api/hash.rst:49 +msgid ":pep:`456` \"Secure and interchangeable hash algorithm\"." +msgstr "" diff --git a/library/ftplib.po b/library/ftplib.po index 14138b54f8..2c8c8f845a 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-25 06:20+0000\n" +"POT-Creation-Date: 2024-02-18 00:03+0000\n" "PO-Revision-Date: 2023-04-26 19:44+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -266,10 +266,11 @@ msgstr "" "sendcmd``。" #: ../../library/ftplib.rst:234 +#, fuzzy msgid "" "Send a simple command string to the server and handle the response. Return " -"nothing if a response code corresponding to success (codes in the range " -"200--299) is received. Raise :exc:`error_reply` otherwise." +"the response string if the response code corresponds to success (codes in " +"the range 200--299). Raise :exc:`error_reply` otherwise." msgstr "" "向伺服器發送一個簡單的命令字串並處理回應。如果收到代表成功的回應狀態碼(範圍" "為 200--299 的狀態碼),則不回傳任何內容,否則引發 :exc:`error_reply`。" diff --git a/library/pickle.po b/library/pickle.po index e260907326..5b383fae66 100644 --- a/library/pickle.po +++ b/library/pickle.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-05 00:03+0000\n" +"POT-Creation-Date: 2024-02-18 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -864,8 +864,8 @@ msgstr "" #: ../../library/pickle.rst:648 msgid "" -"If :meth:`__getstate__` returns a false value, the :meth:`__setstate__` " -"method will not be called upon unpickling." +"If :meth:`__reduce__` returns a state with value ``None`` at pickling, the :" +"meth:`__setstate__` method will not be called upon unpickling." msgstr "" #: ../../library/pickle.rst:652 diff --git a/library/re.po b/library/re.po index 1633d10d6b..ea8ccaf417 100644 --- a/library/re.po +++ b/library/re.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-12 00:03+0000\n" +"POT-Creation-Date: 2024-02-18 00:03+0000\n" "PO-Revision-Date: 2023-09-16 14:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -169,7 +169,7 @@ msgstr "" msgid "The special characters are:" msgstr "" -#: ../../library/re.rst:104 ../../library/re.rst:1605 +#: ../../library/re.rst:104 ../../library/re.rst:1606 msgid "``.``" msgstr "``.``" @@ -1381,7 +1381,7 @@ msgid "" msgstr "" #: ../../library/re.rst:1071 ../../library/re.rst:1100 -#: ../../library/re.rst:1343 +#: ../../library/re.rst:1344 msgid "Unmatched groups are replaced with an empty string." msgstr "" @@ -1632,10 +1632,11 @@ msgid "" "string *template*, as done by the :meth:`~Pattern.sub` method. Escapes such " "as ``\\n`` are converted to the appropriate characters, and numeric " "backreferences (``\\1``, ``\\2``) and named backreferences (``\\g<1>``, " -"``\\g``) are replaced by the contents of the corresponding group." +"``\\g``) are replaced by the contents of the corresponding group. The " +"backreference ``\\g<0>`` will be replaced by the entire match." msgstr "" -#: ../../library/re.rst:1348 +#: ../../library/re.rst:1349 msgid "" "Returns one or more subgroups of the match. If there is a single argument, " "the result is a single string; if there are multiple arguments, the result " @@ -1650,7 +1651,7 @@ msgid "" "the pattern that matched multiple times, the last match is returned. ::" msgstr "" -#: ../../library/re.rst:1370 +#: ../../library/re.rst:1371 msgid "" "If the regular expression uses the ``(?P...)`` syntax, the *groupN* " "arguments may also be strings identifying groups by their group name. If a " @@ -1658,57 +1659,57 @@ msgid "" "`IndexError` exception is raised." msgstr "" -#: ../../library/re.rst:1375 +#: ../../library/re.rst:1376 msgid "A moderately complicated example::" msgstr "" -#: ../../library/re.rst:1383 +#: ../../library/re.rst:1384 msgid "Named groups can also be referred to by their index::" msgstr "" -#: ../../library/re.rst:1390 +#: ../../library/re.rst:1391 msgid "If a group matches multiple times, only the last match is accessible::" msgstr "" -#: ../../library/re.rst:1399 +#: ../../library/re.rst:1400 msgid "" "This is identical to ``m.group(g)``. This allows easier access to an " "individual group from a match::" msgstr "" -#: ../../library/re.rst:1410 +#: ../../library/re.rst:1411 msgid "Named groups are supported as well::" msgstr "" -#: ../../library/re.rst:1423 +#: ../../library/re.rst:1424 msgid "" "Return a tuple containing all the subgroups of the match, from 1 up to " "however many groups are in the pattern. The *default* argument is used for " "groups that did not participate in the match; it defaults to ``None``." msgstr "" -#: ../../library/re.rst:1427 ../../library/re.rst:1652 +#: ../../library/re.rst:1428 ../../library/re.rst:1653 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/re.rst:1433 +#: ../../library/re.rst:1434 msgid "" "If we make the decimal place and everything after it optional, not all " "groups might participate in the match. These groups will default to " "``None`` unless the *default* argument is given::" msgstr "" -#: ../../library/re.rst:1446 +#: ../../library/re.rst:1447 msgid "" "Return a dictionary containing all the *named* subgroups of the match, keyed " "by the subgroup name. The *default* argument is used for groups that did " "not participate in the match; it defaults to ``None``. For example::" msgstr "" -#: ../../library/re.rst:1458 +#: ../../library/re.rst:1459 msgid "" "Return the indices of the start and end of the substring matched by *group*; " "*group* defaults to zero (meaning the whole matched substring). Return " @@ -1717,7 +1718,7 @@ msgid "" "matched by group *g* (equivalent to ``m.group(g)``) is ::" msgstr "" -#: ../../library/re.rst:1466 +#: ../../library/re.rst:1467 msgid "" "Note that ``m.start(group)`` will equal ``m.end(group)`` if *group* matched " "a null string. For example, after ``m = re.search('b(c?)', 'cba')``, ``m." @@ -1725,32 +1726,32 @@ msgid "" "2, and ``m.start(2)`` raises an :exc:`IndexError` exception." msgstr "" -#: ../../library/re.rst:1471 +#: ../../library/re.rst:1472 msgid "An example that will remove *remove_this* from email addresses::" msgstr "" -#: ../../library/re.rst:1481 +#: ../../library/re.rst:1482 msgid "" "For a match *m*, return the 2-tuple ``(m.start(group), m.end(group))``. Note " "that if *group* did not contribute to the match, this is ``(-1, -1)``. " "*group* defaults to zero, the entire match." msgstr "" -#: ../../library/re.rst:1488 +#: ../../library/re.rst:1489 msgid "" "The value of *pos* which was passed to the :meth:`~Pattern.search` or :meth:" "`~Pattern.match` method of a :ref:`regex object `. This is the " "index into the string at which the RE engine started looking for a match." msgstr "" -#: ../../library/re.rst:1495 +#: ../../library/re.rst:1496 msgid "" "The value of *endpos* which was passed to the :meth:`~Pattern.search` or :" "meth:`~Pattern.match` method of a :ref:`regex object `. This is " "the index into the string beyond which the RE engine will not go." msgstr "" -#: ../../library/re.rst:1502 +#: ../../library/re.rst:1503 msgid "" "The integer index of the last matched capturing group, or ``None`` if no " "group was matched at all. For example, the expressions ``(a)b``, ``((a)" @@ -1759,43 +1760,43 @@ msgid "" "applied to the same string." msgstr "" -#: ../../library/re.rst:1511 +#: ../../library/re.rst:1512 msgid "" "The name of the last matched capturing group, or ``None`` if the group " "didn't have a name, or if no group was matched at all." msgstr "" -#: ../../library/re.rst:1517 +#: ../../library/re.rst:1518 msgid "" "The :ref:`regular expression object ` whose :meth:`~Pattern." "match` or :meth:`~Pattern.search` method produced this match instance." msgstr "" -#: ../../library/re.rst:1523 +#: ../../library/re.rst:1524 msgid "The string passed to :meth:`~Pattern.match` or :meth:`~Pattern.search`." msgstr "" -#: ../../library/re.rst:1526 +#: ../../library/re.rst:1527 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Match objects " "are considered atomic." msgstr "" -#: ../../library/re.rst:1534 +#: ../../library/re.rst:1535 msgid "Regular Expression Examples" msgstr "" -#: ../../library/re.rst:1538 +#: ../../library/re.rst:1539 msgid "Checking for a Pair" msgstr "" -#: ../../library/re.rst:1540 +#: ../../library/re.rst:1541 msgid "" "In this example, we'll use the following helper function to display match " "objects a little more gracefully::" msgstr "" -#: ../../library/re.rst:1548 +#: ../../library/re.rst:1549 msgid "" "Suppose you are writing a poker program where a player's hand is represented " "as a 5-character string with each character representing a card, \"a\" for " @@ -1803,28 +1804,28 @@ msgid "" "\"2\" through \"9\" representing the card with that value." msgstr "" -#: ../../library/re.rst:1553 +#: ../../library/re.rst:1554 msgid "To see if a given string is a valid hand, one could do the following::" msgstr "" -#: ../../library/re.rst:1563 +#: ../../library/re.rst:1564 msgid "" "That last hand, ``\"727ak\"``, contained a pair, or two of the same valued " "cards. To match this with a regular expression, one could use backreferences " "as such::" msgstr "" -#: ../../library/re.rst:1573 +#: ../../library/re.rst:1574 msgid "" "To find out what card the pair consists of, one could use the :meth:`~Match." "group` method of the match object in the following manner::" msgstr "" -#: ../../library/re.rst:1592 +#: ../../library/re.rst:1593 msgid "Simulating scanf()" msgstr "" -#: ../../library/re.rst:1596 +#: ../../library/re.rst:1597 msgid "" "Python does not currently have an equivalent to :c:func:`!scanf`. Regular " "expressions are generally more powerful, though also more verbose, than :c:" @@ -1833,124 +1834,124 @@ msgid "" "expressions." msgstr "" -#: ../../library/re.rst:1603 +#: ../../library/re.rst:1604 msgid ":c:func:`!scanf` Token" msgstr "" -#: ../../library/re.rst:1603 +#: ../../library/re.rst:1604 msgid "Regular Expression" msgstr "" -#: ../../library/re.rst:1605 +#: ../../library/re.rst:1606 msgid "``%c``" msgstr "``%c``" -#: ../../library/re.rst:1607 +#: ../../library/re.rst:1608 msgid "``%5c``" msgstr "``%5c``" -#: ../../library/re.rst:1607 +#: ../../library/re.rst:1608 msgid "``.{5}``" msgstr "``.{5}``" -#: ../../library/re.rst:1609 +#: ../../library/re.rst:1610 msgid "``%d``" msgstr "``%d``" -#: ../../library/re.rst:1609 +#: ../../library/re.rst:1610 msgid "``[-+]?\\d+``" msgstr "``[-+]?\\d+``" -#: ../../library/re.rst:1611 +#: ../../library/re.rst:1612 msgid "``%e``, ``%E``, ``%f``, ``%g``" msgstr "``%e``, ``%E``, ``%f``, ``%g``" -#: ../../library/re.rst:1611 +#: ../../library/re.rst:1612 msgid "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" msgstr "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" -#: ../../library/re.rst:1613 +#: ../../library/re.rst:1614 msgid "``%i``" msgstr "``%i``" -#: ../../library/re.rst:1613 +#: ../../library/re.rst:1614 msgid "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" msgstr "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" -#: ../../library/re.rst:1615 +#: ../../library/re.rst:1616 msgid "``%o``" msgstr "``%o``" -#: ../../library/re.rst:1615 +#: ../../library/re.rst:1616 msgid "``[-+]?[0-7]+``" msgstr "``[-+]?[0-7]+``" -#: ../../library/re.rst:1617 +#: ../../library/re.rst:1618 msgid "``%s``" msgstr "``%s``" -#: ../../library/re.rst:1617 +#: ../../library/re.rst:1618 msgid "``\\S+``" msgstr "``\\S+``" -#: ../../library/re.rst:1619 +#: ../../library/re.rst:1620 msgid "``%u``" msgstr "``%u``" -#: ../../library/re.rst:1619 +#: ../../library/re.rst:1620 msgid "``\\d+``" msgstr "``\\d+``" -#: ../../library/re.rst:1621 +#: ../../library/re.rst:1622 msgid "``%x``, ``%X``" msgstr "``%x``\\ 、\\ ``%X``" -#: ../../library/re.rst:1621 +#: ../../library/re.rst:1622 msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``" msgstr "``[-+]?(0[xX])?[\\dA-Fa-f]+``" -#: ../../library/re.rst:1624 +#: ../../library/re.rst:1625 msgid "To extract the filename and numbers from a string like ::" msgstr "" -#: ../../library/re.rst:1628 +#: ../../library/re.rst:1629 msgid "you would use a :c:func:`!scanf` format like ::" msgstr "" -#: ../../library/re.rst:1632 +#: ../../library/re.rst:1633 msgid "The equivalent regular expression would be ::" msgstr "" -#: ../../library/re.rst:1640 +#: ../../library/re.rst:1641 msgid "search() vs. match()" msgstr "" -#: ../../library/re.rst:1644 +#: ../../library/re.rst:1645 msgid "" "Python offers different primitive operations based on regular expressions:" msgstr "" -#: ../../library/re.rst:1646 +#: ../../library/re.rst:1647 msgid ":func:`re.match` checks for a match only at the beginning of the string" msgstr "" -#: ../../library/re.rst:1647 +#: ../../library/re.rst:1648 msgid "" ":func:`re.search` checks for a match anywhere in the string (this is what " "Perl does by default)" msgstr "" -#: ../../library/re.rst:1649 +#: ../../library/re.rst:1650 msgid ":func:`re.fullmatch` checks for entire string to be a match" msgstr "" -#: ../../library/re.rst:1661 +#: ../../library/re.rst:1662 msgid "" "Regular expressions beginning with ``'^'`` can be used with :func:`search` " "to restrict the match at the beginning of the string::" msgstr "" -#: ../../library/re.rst:1669 +#: ../../library/re.rst:1670 msgid "" "Note however that in :const:`MULTILINE` mode :func:`match` only matches at " "the beginning of the string, whereas using :func:`search` with a regular " @@ -1958,11 +1959,11 @@ msgid "" "line. ::" msgstr "" -#: ../../library/re.rst:1679 +#: ../../library/re.rst:1680 msgid "Making a Phonebook" msgstr "" -#: ../../library/re.rst:1681 +#: ../../library/re.rst:1682 msgid "" ":func:`split` splits a string into a list delimited by the passed pattern. " "The method is invaluable for converting textual data into data structures " @@ -1970,37 +1971,37 @@ msgid "" "following example that creates a phonebook." msgstr "" -#: ../../library/re.rst:1686 +#: ../../library/re.rst:1687 msgid "" "First, here is the input. Normally it may come from a file, here we are " "using triple-quoted string syntax" msgstr "" -#: ../../library/re.rst:1699 +#: ../../library/re.rst:1700 msgid "" "The entries are separated by one or more newlines. Now we convert the string " "into a list with each nonempty line having its own entry:" msgstr "" -#: ../../library/re.rst:1712 +#: ../../library/re.rst:1713 msgid "" "Finally, split each entry into a list with first name, last name, telephone " "number, and address. We use the ``maxsplit`` parameter of :func:`split` " "because the address has spaces, our splitting pattern, in it:" msgstr "" -#: ../../library/re.rst:1725 +#: ../../library/re.rst:1726 msgid "" "The ``:?`` pattern matches the colon after the last name, so that it does " "not occur in the result list. With a ``maxsplit`` of ``4``, we could " "separate the house number from the street name:" msgstr "" -#: ../../library/re.rst:1740 +#: ../../library/re.rst:1741 msgid "Text Munging" msgstr "" -#: ../../library/re.rst:1742 +#: ../../library/re.rst:1743 msgid "" ":func:`sub` replaces every occurrence of a pattern with a string or the " "result of a function. This example demonstrates using :func:`sub` with a " @@ -2008,11 +2009,11 @@ msgid "" "each word of a sentence except for the first and last characters::" msgstr "" -#: ../../library/re.rst:1760 +#: ../../library/re.rst:1761 msgid "Finding all Adverbs" msgstr "" -#: ../../library/re.rst:1762 +#: ../../library/re.rst:1763 msgid "" ":func:`findall` matches *all* occurrences of a pattern, not just the first " "one as :func:`search` does. For example, if a writer wanted to find all of " @@ -2020,11 +2021,11 @@ msgid "" "manner::" msgstr "" -#: ../../library/re.rst:1773 +#: ../../library/re.rst:1774 msgid "Finding all Adverbs and their Positions" msgstr "" -#: ../../library/re.rst:1775 +#: ../../library/re.rst:1776 msgid "" "If one wants more information about all matches of a pattern than the " "matched text, :func:`finditer` is useful as it provides :class:`~re.Match` " @@ -2033,11 +2034,11 @@ msgid "" "they would use :func:`finditer` in the following manner::" msgstr "" -#: ../../library/re.rst:1789 +#: ../../library/re.rst:1790 msgid "Raw String Notation" msgstr "" -#: ../../library/re.rst:1791 +#: ../../library/re.rst:1792 msgid "" "Raw string notation (``r\"text\"``) keeps regular expressions sane. Without " "it, every backslash (``'\\'``) in a regular expression would have to be " @@ -2045,7 +2046,7 @@ msgid "" "lines of code are functionally identical::" msgstr "" -#: ../../library/re.rst:1801 +#: ../../library/re.rst:1802 msgid "" "When one wants to match a literal backslash, it must be escaped in the " "regular expression. With raw string notation, this means ``r\"\\\\\"``. " @@ -2053,29 +2054,29 @@ msgid "" "following lines of code functionally identical::" msgstr "" -#: ../../library/re.rst:1813 +#: ../../library/re.rst:1814 msgid "Writing a Tokenizer" msgstr "" -#: ../../library/re.rst:1815 +#: ../../library/re.rst:1816 msgid "" "A `tokenizer or scanner `_ " "analyzes a string to categorize groups of characters. This is a useful " "first step in writing a compiler or interpreter." msgstr "" -#: ../../library/re.rst:1819 +#: ../../library/re.rst:1820 msgid "" "The text categories are specified with regular expressions. The technique " "is to combine those into a single master regular expression and to loop over " "successive matches::" msgstr "" -#: ../../library/re.rst:1875 +#: ../../library/re.rst:1876 msgid "The tokenizer produces the following output::" msgstr "" -#: ../../library/re.rst:1898 +#: ../../library/re.rst:1899 msgid "" "Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly Media, " "2009. The third edition of the book no longer covers Python at all, but the " @@ -2304,7 +2305,7 @@ msgstr "# (井字號)" msgid "\\g" msgstr "\\g" -#: ../../library/re.rst:1594 +#: ../../library/re.rst:1595 msgid "scanf (C function)" msgstr "" diff --git a/library/ssl.po b/library/ssl.po index e043eea238..3b3d5fb05d 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -2364,7 +2364,7 @@ msgstr "" #: ../../library/ssl.rst:1953 msgid "" -"The flag had no effect with OpenSSL before version 1.1.1k. Python 3.8.9, " +"The flag had no effect with OpenSSL before version 1.1.1l. Python 3.8.9, " "3.9.3, and 3.10 include workarounds for previous versions." msgstr "" diff --git a/library/unittest.mock.po b/library/unittest.mock.po index cceb36be21..24bcd16265 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -2516,11 +2516,17 @@ msgid "" "`~Mock.mock_calls`:" msgstr "" -#: ../../library/unittest.mock.rst:2383 +#: ../../library/unittest.mock.rst:2380 +msgid "" +":data:`ANY` is not limited to comparisons with call objects and so can also " +"be used in test assertions::" +msgstr "" + +#: ../../library/unittest.mock.rst:2391 msgid "FILTER_DIR" msgstr "FILTER_DIR" -#: ../../library/unittest.mock.rst:2387 +#: ../../library/unittest.mock.rst:2395 msgid "" ":data:`FILTER_DIR` is a module level variable that controls the way mock " "objects respond to :func:`dir`. The default is ``True``, which uses the " @@ -2529,7 +2535,7 @@ msgid "" "FILTER_DIR = False``." msgstr "" -#: ../../library/unittest.mock.rst:2393 +#: ../../library/unittest.mock.rst:2401 msgid "" "With filtering on, ``dir(some_mock)`` shows only useful attributes and will " "include any dynamically created attributes that wouldn't normally be shown. " @@ -2538,7 +2544,7 @@ msgid "" "yet:" msgstr "" -#: ../../library/unittest.mock.rst:2420 +#: ../../library/unittest.mock.rst:2428 msgid "" "Many of the not-very-useful (private to :class:`Mock` rather than the thing " "being mocked) underscore and double underscore prefixed attributes have been " @@ -2547,31 +2553,31 @@ msgid "" "switch :data:`FILTER_DIR`:" msgstr "" -#: ../../library/unittest.mock.rst:2441 +#: ../../library/unittest.mock.rst:2449 msgid "" "Alternatively you can just use ``vars(my_mock)`` (instance members) and " "``dir(type(my_mock))`` (type members) to bypass the filtering irrespective " "of :const:`mock.FILTER_DIR`." msgstr "" -#: ../../library/unittest.mock.rst:2447 +#: ../../library/unittest.mock.rst:2455 msgid "mock_open" msgstr "mock_open" -#: ../../library/unittest.mock.rst:2451 +#: ../../library/unittest.mock.rst:2459 msgid "" "A helper function to create a mock to replace the use of :func:`open`. It " "works for :func:`open` called directly or used as a context manager." msgstr "" -#: ../../library/unittest.mock.rst:2454 +#: ../../library/unittest.mock.rst:2462 msgid "" "The *mock* argument is the mock object to configure. If ``None`` (the " "default) then a :class:`MagicMock` will be created for you, with the API " "limited to methods or attributes available on standard file handles." msgstr "" -#: ../../library/unittest.mock.rst:2458 +#: ../../library/unittest.mock.rst:2466 msgid "" "*read_data* is a string for the :meth:`~io.IOBase.read`, :meth:`~io.IOBase." "readline`, and :meth:`~io.IOBase.readlines` methods of the file handle to " @@ -2584,51 +2590,51 @@ msgid "" "realistic filesystem for testing." msgstr "" -#: ../../library/unittest.mock.rst:2468 +#: ../../library/unittest.mock.rst:2476 msgid "" "Added :meth:`~io.IOBase.readline` and :meth:`~io.IOBase.readlines` support. " "The mock of :meth:`~io.IOBase.read` changed to consume *read_data* rather " "than returning it on each call." msgstr "" -#: ../../library/unittest.mock.rst:2473 +#: ../../library/unittest.mock.rst:2481 msgid "*read_data* is now reset on each call to the *mock*." msgstr "" -#: ../../library/unittest.mock.rst:2476 +#: ../../library/unittest.mock.rst:2484 msgid "" "Added :meth:`~container.__iter__` to implementation so that iteration (such " "as in for loops) correctly consumes *read_data*." msgstr "" -#: ../../library/unittest.mock.rst:2480 +#: ../../library/unittest.mock.rst:2488 msgid "" "Using :func:`open` as a context manager is a great way to ensure your file " "handles are closed properly and is becoming common::" msgstr "" -#: ../../library/unittest.mock.rst:2486 +#: ../../library/unittest.mock.rst:2494 msgid "" "The issue is that even if you mock out the call to :func:`open` it is the " "*returned object* that is used as a context manager (and has :meth:`~object." "__enter__` and :meth:`~object.__exit__` called)." msgstr "" -#: ../../library/unittest.mock.rst:2490 +#: ../../library/unittest.mock.rst:2498 msgid "" "Mocking context managers with a :class:`MagicMock` is common enough and " "fiddly enough that a helper function is useful. ::" msgstr "" -#: ../../library/unittest.mock.rst:2507 +#: ../../library/unittest.mock.rst:2515 msgid "And for reading files::" msgstr "" -#: ../../library/unittest.mock.rst:2520 +#: ../../library/unittest.mock.rst:2528 msgid "Autospeccing" msgstr "" -#: ../../library/unittest.mock.rst:2522 +#: ../../library/unittest.mock.rst:2530 msgid "" "Autospeccing is based on the existing :attr:`spec` feature of mock. It " "limits the api of mocks to the api of an original object (the spec), but it " @@ -2638,11 +2644,11 @@ msgid "" "`TypeError` if they are called incorrectly." msgstr "" -#: ../../library/unittest.mock.rst:2529 +#: ../../library/unittest.mock.rst:2537 msgid "Before I explain how auto-speccing works, here's why it is needed." msgstr "" -#: ../../library/unittest.mock.rst:2531 +#: ../../library/unittest.mock.rst:2539 msgid "" ":class:`Mock` is a very powerful and flexible object, but it suffers from " "two flaws when used to mock out objects from a system under test. One of " @@ -2650,25 +2656,25 @@ msgid "" "general problem with using mock objects." msgstr "" -#: ../../library/unittest.mock.rst:2536 +#: ../../library/unittest.mock.rst:2544 msgid "" "First the problem specific to :class:`Mock`. :class:`Mock` has two assert " "methods that are extremely handy: :meth:`~Mock.assert_called_with` and :meth:" "`~Mock.assert_called_once_with`." msgstr "" -#: ../../library/unittest.mock.rst:2549 +#: ../../library/unittest.mock.rst:2557 msgid "" "Because mocks auto-create attributes on demand, and allow you to call them " "with arbitrary arguments, if you misspell one of these assert methods then " "your assertion is gone:" msgstr "" -#: ../../library/unittest.mock.rst:2559 +#: ../../library/unittest.mock.rst:2567 msgid "Your tests can pass silently and incorrectly because of the typo." msgstr "" -#: ../../library/unittest.mock.rst:2561 +#: ../../library/unittest.mock.rst:2569 msgid "" "The second issue is more general to mocking. If you refactor some of your " "code, rename members and so on, any tests for code that is still using the " @@ -2676,7 +2682,7 @@ msgid "" "means your tests can all pass even though your code is broken." msgstr "" -#: ../../library/unittest.mock.rst:2566 +#: ../../library/unittest.mock.rst:2574 msgid "" "Note that this is another reason why you need integration tests as well as " "unit tests. Testing everything in isolation is all fine and dandy, but if " @@ -2684,20 +2690,20 @@ msgid "" "room for bugs that tests might have caught." msgstr "" -#: ../../library/unittest.mock.rst:2571 +#: ../../library/unittest.mock.rst:2579 msgid "" ":mod:`mock` already provides a feature to help with this, called speccing. " "If you use a class or instance as the :attr:`spec` for a mock then you can " "only access attributes on the mock that exist on the real class:" msgstr "" -#: ../../library/unittest.mock.rst:2582 +#: ../../library/unittest.mock.rst:2590 msgid "" "The spec only applies to the mock itself, so we still have the same issue " "with any methods on the mock:" msgstr "" -#: ../../library/unittest.mock.rst:2591 +#: ../../library/unittest.mock.rst:2599 msgid "" "Auto-speccing solves this problem. You can either pass ``autospec=True`` to :" "func:`patch` / :func:`patch.object` or use the :func:`create_autospec` " @@ -2709,24 +2715,24 @@ msgid "" "import modules) without a big performance hit." msgstr "" -#: ../../library/unittest.mock.rst:2600 +#: ../../library/unittest.mock.rst:2608 msgid "Here's an example of it in use::" msgstr "" -#: ../../library/unittest.mock.rst:2610 +#: ../../library/unittest.mock.rst:2618 msgid "" "You can see that :class:`request.Request` has a spec. :class:`request." "Request` takes two arguments in the constructor (one of which is *self*). " "Here's what happens if we try to call it incorrectly::" msgstr "" -#: ../../library/unittest.mock.rst:2619 +#: ../../library/unittest.mock.rst:2627 msgid "" "The spec also applies to instantiated classes (i.e. the return value of " "specced mocks)::" msgstr "" -#: ../../library/unittest.mock.rst:2626 +#: ../../library/unittest.mock.rst:2634 msgid "" ":class:`Request` objects are not callable, so the return value of " "instantiating our mocked out :class:`request.Request` is a non-callable " @@ -2734,20 +2740,20 @@ msgid "" "error::" msgstr "" -#: ../../library/unittest.mock.rst:2638 +#: ../../library/unittest.mock.rst:2646 msgid "" "In many cases you will just be able to add ``autospec=True`` to your " "existing :func:`patch` calls and then be protected against bugs due to typos " "and api changes." msgstr "" -#: ../../library/unittest.mock.rst:2642 +#: ../../library/unittest.mock.rst:2650 msgid "" "As well as using *autospec* through :func:`patch` there is a :func:" "`create_autospec` for creating autospecced mocks directly:" msgstr "" -#: ../../library/unittest.mock.rst:2650 +#: ../../library/unittest.mock.rst:2658 msgid "" "This isn't without caveats and limitations however, which is why it is not " "the default behaviour. In order to know what attributes are available on the " @@ -2759,7 +2765,7 @@ msgid "" "objects so that introspection is safe [#]_." msgstr "" -#: ../../library/unittest.mock.rst:2659 +#: ../../library/unittest.mock.rst:2667 msgid "" "A more serious problem is that it is common for instance attributes to be " "created in the :meth:`~object.__init__` method and not to exist on the class " @@ -2767,7 +2773,7 @@ msgid "" "restricts the api to visible attributes. ::" msgstr "" -#: ../../library/unittest.mock.rst:2676 +#: ../../library/unittest.mock.rst:2684 msgid "" "There are a few different ways of resolving this problem. The easiest, but " "not necessarily the least annoying, way is to simply set the required " @@ -2776,7 +2782,7 @@ msgid "" "setting them::" msgstr "" -#: ../../library/unittest.mock.rst:2687 +#: ../../library/unittest.mock.rst:2695 msgid "" "There is a more aggressive version of both *spec* and *autospec* that *does* " "prevent you setting non-existent attributes. This is useful if you want to " @@ -2784,7 +2790,7 @@ msgid "" "this particular scenario:" msgstr "" -#: ../../library/unittest.mock.rst:2700 +#: ../../library/unittest.mock.rst:2708 msgid "" "Probably the best way of solving the problem is to add class attributes as " "default values for instance members initialised in :meth:`~object.__init__`. " @@ -2793,7 +2799,7 @@ msgid "" "course) is faster too. e.g." msgstr "" -#: ../../library/unittest.mock.rst:2711 +#: ../../library/unittest.mock.rst:2719 msgid "" "This brings up another issue. It is relatively common to provide a default " "value of ``None`` for members that will later be an object of a different " @@ -2804,7 +2810,7 @@ msgid "" "These will just be ordinary mocks (well - MagicMocks):" msgstr "" -#: ../../library/unittest.mock.rst:2726 +#: ../../library/unittest.mock.rst:2734 msgid "" "If modifying your production classes to add defaults isn't to your liking " "then there are more options. One of these is simply to use an instance as " @@ -2815,25 +2821,25 @@ msgid "" "alternative object as the *autospec* argument::" msgstr "" -#: ../../library/unittest.mock.rst:2747 +#: ../../library/unittest.mock.rst:2755 msgid "" "This only applies to classes or already instantiated objects. Calling a " "mocked class to create a mock instance *does not* create a real instance. It " "is only attribute lookups - along with calls to :func:`dir` - that are done." msgstr "" -#: ../../library/unittest.mock.rst:2752 +#: ../../library/unittest.mock.rst:2760 msgid "Sealing mocks" msgstr "" -#: ../../library/unittest.mock.rst:2761 +#: ../../library/unittest.mock.rst:2769 msgid "" "Seal will disable the automatic creation of mocks when accessing an " "attribute of the mock being sealed or any of its attributes that are already " "mocks recursively." msgstr "" -#: ../../library/unittest.mock.rst:2764 +#: ../../library/unittest.mock.rst:2772 msgid "" "If a mock instance with a name or a spec is assigned to an attribute it " "won't be considered in the sealing chain. This allows one to prevent seal " diff --git a/whatsnew/3.1.po b/whatsnew/3.1.po index 89e53403fd..7e1aafa225 100644 --- a/whatsnew/3.1.po +++ b/whatsnew/3.1.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-16 00:03+0000\n" +"POT-Creation-Date: 2024-02-18 00:03+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-" @@ -84,7 +84,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:83 msgid "" "Since an ordered dictionary remembers its insertion order, it can be used in " -"conjuction with sorting to make a sorted dictionary::" +"conjunction with sorting to make a sorted dictionary::" msgstr "" #: ../../whatsnew/3.1.rst:101 @@ -178,7 +178,7 @@ msgstr "(由 Eric Smith 貢獻;:issue:`5237`。)" #: ../../whatsnew/3.1.rst:177 msgid "" -"The :func:`string.maketrans` function is deprecated and is replaced by new " +"The :func:`!string.maketrans` function is deprecated and is replaced by new " "static methods, :meth:`bytes.maketrans` and :meth:`bytearray.maketrans`. " "This change solves the confusion around which types were supported by the :" "mod:`string` module. Now, :class:`str`, :class:`bytes`, and :class:" @@ -437,40 +437,42 @@ msgstr "" #: ../../whatsnew/3.1.rst:383 msgid "" -"In addition, several new assertion methods were added including :func:" -"`assertSetEqual`, :func:`assertDictEqual`, :func:" -"`assertDictContainsSubset`, :func:`assertListEqual`, :func:" -"`assertTupleEqual`, :func:`assertSequenceEqual`, :func:" -"`assertRaisesRegexp`, :func:`assertIsNone`, and :func:`assertIsNotNone`." +"In addition, several new assertion methods were added including :meth:" +"`~unittest.TestCase.assertSetEqual`, :meth:`~unittest.TestCase." +"assertDictEqual`, :meth:`!assertDictContainsSubset`, :meth:`~unittest." +"TestCase.assertListEqual`, :meth:`~unittest.TestCase.assertTupleEqual`, :" +"meth:`~unittest.TestCase.assertSequenceEqual`, :meth:`assertRaisesRegexp() " +"`, :meth:`~unittest.TestCase." +"assertIsNone`, and :meth:`~unittest.TestCase.assertIsNotNone`." msgstr "" -#: ../../whatsnew/3.1.rst:390 +#: ../../whatsnew/3.1.rst:394 msgid "(Contributed by Benjamin Peterson and Antoine Pitrou.)" msgstr "(由 Benjamin Peterson 和 Antoine Pitrou 貢獻。)" -#: ../../whatsnew/3.1.rst:392 +#: ../../whatsnew/3.1.rst:396 msgid "" -"The :mod:`io` module has three new constants for the :meth:`seek` method :" -"data:`SEEK_SET`, :data:`SEEK_CUR`, and :data:`SEEK_END`." +"The :mod:`io` module has three new constants for the :meth:`~io.IOBase.seek` " +"method: :data:`~os.SEEK_SET`, :data:`~os.SEEK_CUR`, and :data:`~os.SEEK_END`." msgstr "" -#: ../../whatsnew/3.1.rst:395 +#: ../../whatsnew/3.1.rst:399 msgid "The :data:`sys.version_info` tuple is now a named tuple::" msgstr "" -#: ../../whatsnew/3.1.rst:400 +#: ../../whatsnew/3.1.rst:404 msgid "(Contributed by Ross Light; :issue:`4285`.)" msgstr "(由 Ross Light 貢獻;:issue:`4285`。)" -#: ../../whatsnew/3.1.rst:402 +#: ../../whatsnew/3.1.rst:406 msgid "The :mod:`nntplib` and :mod:`imaplib` modules now support IPv6." msgstr "" -#: ../../whatsnew/3.1.rst:404 +#: ../../whatsnew/3.1.rst:408 msgid "(Contributed by Derek Morr; :issue:`1655` and :issue:`1664`.)" msgstr "(由 Derek Morr 貢獻;:issue:`1655` 和 :issue:`1664`。)" -#: ../../whatsnew/3.1.rst:406 +#: ../../whatsnew/3.1.rst:410 msgid "" "The :mod:`pickle` module has been adapted for better interoperability with " "Python 2.x when used with protocol 2 or lower. The reorganization of the " @@ -483,7 +485,7 @@ msgid "" "*fix_imports* option::" msgstr "" -#: ../../whatsnew/3.1.rst:422 +#: ../../whatsnew/3.1.rst:426 msgid "" "An unfortunate but unavoidable side-effect of this change is that protocol 2 " "pickles produced by Python 3.1 won't be readable with Python 3.0. The latest " @@ -492,12 +494,12 @@ msgid "" "Python 2.x." msgstr "" -#: ../../whatsnew/3.1.rst:428 +#: ../../whatsnew/3.1.rst:432 msgid "" "(Contributed by Alexandre Vassalotti and Antoine Pitrou, :issue:`6137`.)" msgstr "(由 Alexandre Vassalotti 和 Antoine Pitrou 貢獻,:issue:`6137`。)" -#: ../../whatsnew/3.1.rst:430 +#: ../../whatsnew/3.1.rst:434 msgid "" "A new module, :mod:`importlib` was added. It provides a complete, portable, " "pure Python reference implementation of the :keyword:`import` statement and " @@ -506,19 +508,19 @@ msgid "" "place during imports." msgstr "" -#: ../../whatsnew/3.1.rst:436 +#: ../../whatsnew/3.1.rst:440 msgid "(Contributed by Brett Cannon.)" msgstr "(由 Brett Cannon 貢獻。)" -#: ../../whatsnew/3.1.rst:439 +#: ../../whatsnew/3.1.rst:443 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.1.rst:441 +#: ../../whatsnew/3.1.rst:445 msgid "Major performance enhancements have been added:" msgstr "" -#: ../../whatsnew/3.1.rst:443 +#: ../../whatsnew/3.1.rst:447 msgid "" "The new I/O library (as defined in :pep:`3116`) was mostly written in Python " "and quickly proved to be a problematic bottleneck in Python 3.0. In Python " @@ -527,11 +529,11 @@ msgid "" "available for experimentation purposes through the ``_pyio`` module." msgstr "" -#: ../../whatsnew/3.1.rst:450 +#: ../../whatsnew/3.1.rst:454 msgid "(Contributed by Amaury Forgeot d'Arc and Antoine Pitrou.)" msgstr "(由 Amaury Forgeot d'Arc 和 Antoine Pitrou 貢獻。)" -#: ../../whatsnew/3.1.rst:452 +#: ../../whatsnew/3.1.rst:456 msgid "" "Added a heuristic so that tuples and dicts containing only untrackable " "objects are not tracked by the garbage collector. This can reduce the size " @@ -539,11 +541,11 @@ msgid "" "programs, depending on their particular use of datatypes." msgstr "" -#: ../../whatsnew/3.1.rst:457 +#: ../../whatsnew/3.1.rst:461 msgid "(Contributed by Antoine Pitrou, :issue:`4688`.)" msgstr "(由 Antoine Pitrou 貢獻,:issue:`4688`。)" -#: ../../whatsnew/3.1.rst:459 +#: ../../whatsnew/3.1.rst:463 msgid "" "Enabling a configure option named ``--with-computed-gotos`` on compilers " "that support it (notably: gcc, SunPro, icc), the bytecode evaluation loop is " @@ -551,23 +553,23 @@ msgid "" "depending on the system, the compiler, and the benchmark." msgstr "" -#: ../../whatsnew/3.1.rst:465 +#: ../../whatsnew/3.1.rst:469 msgid "" "(Contributed by Antoine Pitrou along with a number of other participants, :" "issue:`4753`)." msgstr "(由 Antoine Pitrou 和其他一些參與者共同貢獻,:issue:`4753`)。" -#: ../../whatsnew/3.1.rst:468 +#: ../../whatsnew/3.1.rst:472 msgid "" "The decoding of UTF-8, UTF-16 and LATIN-1 is now two to four times faster." msgstr "" -#: ../../whatsnew/3.1.rst:471 +#: ../../whatsnew/3.1.rst:475 msgid "" "(Contributed by Antoine Pitrou and Amaury Forgeot d'Arc, :issue:`4868`.)" msgstr "(由 Antoine Pitrou 和 Amaury Forgeot d'Arc 貢獻,:issue:`4868`。)" -#: ../../whatsnew/3.1.rst:473 +#: ../../whatsnew/3.1.rst:477 msgid "" "The :mod:`json` module now has a C extension to substantially improve its " "performance. In addition, the API was modified so that json works only " @@ -576,7 +578,7 @@ msgid "" "in terms of Unicode." msgstr "" -#: ../../whatsnew/3.1.rst:479 +#: ../../whatsnew/3.1.rst:483 msgid "" "(Contributed by Bob Ippolito and converted to Py3.1 by Antoine Pitrou and " "Benjamin Peterson; :issue:`4136`.)" @@ -584,39 +586,39 @@ msgstr "" "(由 Bob Ippolito 貢獻,由 Antoine Pitrou 和 Benjamin Peterson 轉換為 " "Py3.1;:issue:`4136`。)" -#: ../../whatsnew/3.1.rst:482 +#: ../../whatsnew/3.1.rst:486 msgid "" "Unpickling now interns the attribute names of pickled objects. This saves " "memory and allows pickles to be smaller." msgstr "" -#: ../../whatsnew/3.1.rst:485 +#: ../../whatsnew/3.1.rst:489 msgid "(Contributed by Jake McGuire and Antoine Pitrou; :issue:`5084`.)" msgstr "(由 Jake McGuire 和 Antoine Pitrou 貢獻;:issue:`5084`。)" -#: ../../whatsnew/3.1.rst:488 +#: ../../whatsnew/3.1.rst:492 msgid "IDLE" msgstr "IDLE" -#: ../../whatsnew/3.1.rst:490 +#: ../../whatsnew/3.1.rst:494 msgid "" "IDLE's format menu now provides an option to strip trailing whitespace from " "a source file." msgstr "" -#: ../../whatsnew/3.1.rst:493 +#: ../../whatsnew/3.1.rst:497 msgid "(Contributed by Roger D. Serwy; :issue:`5150`.)" msgstr "(由 Roger D. Serwy 貢獻;:issue:`5150`。)" -#: ../../whatsnew/3.1.rst:496 +#: ../../whatsnew/3.1.rst:500 msgid "Build and C API Changes" msgstr "" -#: ../../whatsnew/3.1.rst:498 +#: ../../whatsnew/3.1.rst:502 msgid "Changes to Python's build process and to the C API include:" msgstr "" -#: ../../whatsnew/3.1.rst:500 +#: ../../whatsnew/3.1.rst:504 msgid "" "Integers are now stored internally either in base ``2**15`` or in base " "``2**30``, the base being determined at build time. Previously, they were " @@ -628,7 +630,7 @@ msgid "" "this default." msgstr "" -#: ../../whatsnew/3.1.rst:509 +#: ../../whatsnew/3.1.rst:513 msgid "" "Apart from the performance improvements this change should be invisible to " "end users, with one exception: for testing and debugging purposes there's a " @@ -637,41 +639,41 @@ msgid "" "type used to store each digit::" msgstr "" -#: ../../whatsnew/3.1.rst:519 +#: ../../whatsnew/3.1.rst:523 msgid "(Contributed by Mark Dickinson; :issue:`4258`.)" msgstr "(由 Mark Dickinson 貢獻;:issue:`4258`。)" -#: ../../whatsnew/3.1.rst:521 +#: ../../whatsnew/3.1.rst:525 msgid "" "The :c:func:`PyLong_AsUnsignedLongLong()` function now handles a negative " "*pylong* by raising :exc:`OverflowError` instead of :exc:`TypeError`." msgstr "" -#: ../../whatsnew/3.1.rst:524 +#: ../../whatsnew/3.1.rst:528 msgid "(Contributed by Mark Dickinson and Lisandro Dalcrin; :issue:`5175`.)" msgstr "(由 Mark Dickinson 和 Lisandro Dalcrin 貢獻;:issue:`5175`。)" -#: ../../whatsnew/3.1.rst:526 +#: ../../whatsnew/3.1.rst:530 msgid "" "Deprecated :c:func:`!PyNumber_Int`. Use :c:func:`PyNumber_Long` instead." msgstr "" -#: ../../whatsnew/3.1.rst:528 +#: ../../whatsnew/3.1.rst:532 msgid "(Contributed by Mark Dickinson; :issue:`4910`.)" msgstr "(由 Mark Dickinson 貢獻;:issue:`4910`。)" -#: ../../whatsnew/3.1.rst:530 +#: ../../whatsnew/3.1.rst:534 msgid "" "Added a new :c:func:`PyOS_string_to_double` function to replace the " "deprecated functions :c:func:`!PyOS_ascii_strtod` and :c:func:`!" "PyOS_ascii_atof`." msgstr "" -#: ../../whatsnew/3.1.rst:533 +#: ../../whatsnew/3.1.rst:537 msgid "(Contributed by Mark Dickinson; :issue:`5914`.)" msgstr "(由 Mark Dickinson 貢獻;:issue:`5914`。)" -#: ../../whatsnew/3.1.rst:535 +#: ../../whatsnew/3.1.rst:539 msgid "" "Added :c:type:`PyCapsule` as a replacement for the :c:type:`!PyCObject` API. " "The principal difference is that the new type has a well defined interface " @@ -680,27 +682,27 @@ msgid "" "deprecated." msgstr "" -#: ../../whatsnew/3.1.rst:541 +#: ../../whatsnew/3.1.rst:545 msgid "(Contributed by Larry Hastings; :issue:`5630`.)" msgstr "(由 Larry Hastings 貢獻;:issue:`5630`。)" -#: ../../whatsnew/3.1.rst:544 +#: ../../whatsnew/3.1.rst:548 msgid "Porting to Python 3.1" msgstr "" -#: ../../whatsnew/3.1.rst:546 +#: ../../whatsnew/3.1.rst:550 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code:" msgstr "" -#: ../../whatsnew/3.1.rst:549 +#: ../../whatsnew/3.1.rst:553 msgid "" "The new floating point string representations can break existing doctests. " "For example::" msgstr "" -#: ../../whatsnew/3.1.rst:572 +#: ../../whatsnew/3.1.rst:576 msgid "" "The automatic name remapping in the pickle module for protocol 2 or lower " "can make Python 3.1 pickles unreadable in Python 3.0. One solution is to " diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index 45c638c559..2fc5215c4a 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-13 00:03+0000\n" +"POT-Creation-Date: 2024-02-18 00:03+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-" @@ -318,9 +318,9 @@ msgstr "" msgid "" "The :mod:`importlib.abc` module has been updated with new :term:`abstract " "base classes ` for loading bytecode files. The " -"obsolete ABCs, :class:`~importlib.abc.PyLoader` and :class:`~importlib.abc." -"PyPycLoader`, have been deprecated (instructions on how to stay Python 3.1 " -"compatible are included with the documentation)." +"obsolete ABCs, :class:`!PyLoader` and :class:`!PyPycLoader`, have been " +"deprecated (instructions on how to stay Python 3.1 compatible are included " +"with the documentation)." msgstr "" #: ../../whatsnew/3.2.rst:353 @@ -387,7 +387,7 @@ msgid "" "code points between *U+0000* through *U+00FF* which are translatable to " "bytes using *Latin-1* encoding. These strings are used for the keys and " "values in the environment dictionary and for response headers and statuses " -"in the :func:`start_response` function. They must follow :rfc:`2616` with " +"in the :func:`!start_response` function. They must follow :rfc:`2616` with " "respect to encoding. That is, they must either be *ISO-8859-1* characters or " "use :rfc:`2047` MIME encoding." msgstr "" @@ -413,9 +413,9 @@ msgstr "" #: ../../whatsnew/3.2.rst:418 msgid "" -"Values yielded by an application or sent using the :meth:`write` method must " -"be byte strings. The :func:`start_response` function and environ must use " -"native strings. The two cannot be mixed." +"Values yielded by an application or sent using the :meth:`!write` method " +"must be byte strings. The :func:`!start_response` function and environ must " +"use native strings. The two cannot be mixed." msgstr "" #: ../../whatsnew/3.2.rst:422 @@ -494,11 +494,11 @@ msgstr "(由 Marcin Wojdyr 在 :issue:`1772833` 中貢獻)。" msgid "" "The :func:`hasattr` function works by calling :func:`getattr` and detecting " "whether an exception is raised. This technique allows it to detect methods " -"created dynamically by :meth:`__getattr__` or :meth:`__getattribute__` which " -"would otherwise be absent from the class dictionary. Formerly, *hasattr* " -"would catch any exception, possibly masking genuine errors. Now, *hasattr* " -"has been tightened to only catch :exc:`AttributeError` and let other " -"exceptions pass through::" +"created dynamically by :meth:`~object.__getattr__` or :meth:`~object." +"__getattribute__` which would otherwise be absent from the class " +"dictionary. Formerly, *hasattr* would catch any exception, possibly masking " +"genuine errors. Now, *hasattr* has been tightened to only catch :exc:" +"`AttributeError` and let other exceptions pass through::" msgstr "" #: ../../whatsnew/3.2.rst:519 @@ -612,10 +612,11 @@ msgstr "" msgid "" ":class:`range` objects now support *index* and *count* methods. This is part " "of an effort to make more objects fully implement the :class:`collections." -"Sequence` :term:`abstract base class`. As a result, the language will have " -"a more uniform API. In addition, :class:`range` objects now support slicing " -"and negative indices, even with values larger than :data:`sys.maxsize`. " -"This makes *range* more interoperable with lists::" +"Sequence ` :term:`abstract base class`. As a " +"result, the language will have a more uniform API. In addition, :class:" +"`range` objects now support slicing and negative indices, even with values " +"larger than :data:`sys.maxsize`. This makes *range* more interoperable with " +"lists::" msgstr "" #: ../../whatsnew/3.2.rst:637 @@ -758,7 +759,7 @@ msgstr "elementtree" #: ../../whatsnew/3.2.rst:723 msgid "" -"The :mod:`xml.etree.ElementTree` package and its :mod:`xml.etree." +"The :mod:`xml.etree.ElementTree` package and its :mod:`!xml.etree." "cElementTree` counterpart have been updated to version 1.3." msgstr "" @@ -1103,7 +1104,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1010 msgid "" "Whenever a two-digit year is used in a time tuple, the interpretation has " -"been governed by :data:`time.accept2dyear`. The default is ``True`` which " +"been governed by :data:`!time.accept2dyear`. The default is ``True`` which " "means that for a two-digit year, the century is guessed according to the " "POSIX rules governing the ``%y`` strptime format." msgstr "" @@ -1111,15 +1112,15 @@ msgstr "" #: ../../whatsnew/3.2.rst:1015 msgid "" "Starting with Py3.2, use of the century guessing heuristic will emit a :exc:" -"`DeprecationWarning`. Instead, it is recommended that :data:`time." +"`DeprecationWarning`. Instead, it is recommended that :data:`!time." "accept2dyear` be set to ``False`` so that large date ranges can be used " "without guesswork::" msgstr "" #: ../../whatsnew/3.2.rst:1034 msgid "" -"Several functions now have significantly expanded date ranges. When :data:" -"`time.accept2dyear` is false, the :func:`time.asctime` function will accept " +"Several functions now have significantly expanded date ranges. When :data:`!" +"time.accept2dyear` is false, the :func:`time.asctime` function will accept " "any year that fits in a C int, while the :func:`time.mktime` and :func:`time." "strftime` functions will accept the full range supported by the " "corresponding operating system functions." @@ -1222,18 +1223,19 @@ msgstr "reprlib" #: ../../whatsnew/3.2.rst:1151 msgid "" -"When writing a :meth:`__repr__` method for a custom container, it is easy to " -"forget to handle the case where a member refers back to the container " -"itself. Python's builtin objects such as :class:`list` and :class:`set` " -"handle self-reference by displaying \"...\" in the recursive part of the " -"representation string." +"When writing a :meth:`~object.__repr__` method for a custom container, it is " +"easy to forget to handle the case where a member refers back to the " +"container itself. Python's builtin objects such as :class:`list` and :class:" +"`set` handle self-reference by displaying \"...\" in the recursive part of " +"the representation string." msgstr "" #: ../../whatsnew/3.2.rst:1157 msgid "" -"To help write such :meth:`__repr__` methods, the :mod:`reprlib` module has a " -"new decorator, :func:`~reprlib.recursive_repr`, for detecting recursive " -"calls to :meth:`__repr__` and substituting a placeholder string instead::" +"To help write such :meth:`~object.__repr__` methods, the :mod:`reprlib` " +"module has a new decorator, :func:`~reprlib.recursive_repr`, for detecting " +"recursive calls to :meth:`!__repr__` and substituting a placeholder string " +"instead::" msgstr "" #: ../../whatsnew/3.2.rst:1172 @@ -1401,14 +1403,13 @@ msgstr "" #: ../../whatsnew/3.2.rst:1311 msgid "" -"An early decision to limit the inter-operability of various numeric types " -"has been relaxed. It is still unsupported (and ill-advised) to have " -"implicit mixing in arithmetic expressions such as ``Decimal('1.1') + " -"float('1.1')`` because the latter loses information in the process of " -"constructing the binary float. However, since existing floating point value " -"can be converted losslessly to either a decimal or rational representation, " -"it makes sense to add them to the constructor and to support mixed-type " -"comparisons." +"An early decision to limit the interoperability of various numeric types has " +"been relaxed. It is still unsupported (and ill-advised) to have implicit " +"mixing in arithmetic expressions such as ``Decimal('1.1') + float('1.1')`` " +"because the latter loses information in the process of constructing the " +"binary float. However, since existing floating point value can be converted " +"losslessly to either a decimal or rational representation, it makes sense to " +"add them to the constructor and to support mixed-type comparisons." msgstr "" #: ../../whatsnew/3.2.rst:1319 @@ -1435,9 +1436,9 @@ msgstr "" #: ../../whatsnew/3.2.rst:1338 msgid "" "Another useful change for the :mod:`decimal` module is that the :attr:" -"`Context.clamp` attribute is now public. This is useful in creating " -"contexts that correspond to the decimal interchange formats specified in " -"IEEE 754 (see :issue:`8540`)." +"`Context.clamp ` attribute is now public. This is " +"useful in creating contexts that correspond to the decimal interchange " +"formats specified in IEEE 754 (see :issue:`8540`)." msgstr "" #: ../../whatsnew/3.2.rst:1343 @@ -1547,11 +1548,11 @@ msgstr "" #: ../../whatsnew/3.2.rst:1431 msgid "" -"Also, the :class:`zipfile.ZipExtFile` class was reworked internally to " -"represent files stored inside an archive. The new implementation is " -"significantly faster and can be wrapped in an :class:`io.BufferedReader` " -"object for more speedups. It also solves an issue where interleaved calls " -"to *read* and *readline* gave the wrong results." +"Also, the :class:`zipfile.ZipExtFile ` class was " +"reworked internally to represent files stored inside an archive. The new " +"implementation is significantly faster and can be wrapped in an :class:`io." +"BufferedReader` object for more speedups. It also solves an issue where " +"interleaved calls to *read* and *readline* gave the wrong results." msgstr "" #: ../../whatsnew/3.2.rst:1437 @@ -1703,7 +1704,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1599 msgid "" -"The :attr:`sqlite3.Connection.in_transit` attribute is true if there is an " +"The :attr:`!sqlite3.Connection.in_transit` attribute is true if there is an " "active transaction for uncommitted changes." msgstr "" @@ -1773,17 +1774,18 @@ msgstr "" #: ../../whatsnew/3.2.rst:1646 msgid "" -"A new function, :func:`ssl.match_hostname`, supports server identity " +"A new function, :func:`!ssl.match_hostname`, supports server identity " "verification for higher-level protocols by implementing the rules of HTTPS " "(from :rfc:`2818`) which are also suitable for other protocols." msgstr "" #: ../../whatsnew/3.2.rst:1650 msgid "" -"The :func:`ssl.wrap_socket` constructor function now takes a *ciphers* " -"argument. The *ciphers* string lists the allowed encryption algorithms " -"using the format described in the `OpenSSL documentation `__." +"The :func:`ssl.wrap_socket() ` constructor " +"function now takes a *ciphers* argument. The *ciphers* string lists the " +"allowed encryption algorithms using the format described in the `OpenSSL " +"documentation `__." msgstr "" #: ../../whatsnew/3.2.rst:1655 @@ -1961,7 +1963,7 @@ msgstr "(由 Michael Foord 貢獻。)" #: ../../whatsnew/3.2.rst:1761 msgid "" "Experimentation at the interactive prompt is now easier because the :class:" -"`unittest.case.TestCase` class can now be instantiated without arguments:" +"`unittest.TestCase` class can now be instantiated without arguments:" msgstr "" #: ../../whatsnew/3.2.rst:1770 @@ -2002,12 +2004,11 @@ msgstr "" #: ../../whatsnew/3.2.rst:1799 msgid "" "For example, :meth:`~unittest.TestCase.assertRegex` is the new name for :" -"meth:`~unittest.TestCase.assertRegexpMatches` which was misnamed because the " -"test uses :func:`re.search`, not :func:`re.match`. Other methods using " -"regular expressions are now named using short form \"Regex\" in preference " -"to \"Regexp\" -- this matches the names used in other unittest " -"implementations, matches Python's old name for the :mod:`re` module, and it " -"has unambiguous camel-casing." +"meth:`!assertRegexpMatches` which was misnamed because the test uses :func:" +"`re.search`, not :func:`re.match`. Other methods using regular expressions " +"are now named using short form \"Regex\" in preference to \"Regexp\" -- this " +"matches the names used in other unittest implementations, matches Python's " +"old name for the :mod:`re` module, and it has unambiguous camel-casing." msgstr "" #: ../../whatsnew/3.2.rst:1807 @@ -2029,7 +2030,8 @@ msgid "Preferred Name" msgstr "" #: ../../whatsnew/3.2.rst:1815 -msgid ":meth:`assert_`" +#, fuzzy +msgid ":meth:`!assert_`" msgstr ":meth:`assert_`" #: ../../whatsnew/3.2.rst:1815 @@ -2037,7 +2039,8 @@ msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" #: ../../whatsnew/3.2.rst:1816 -msgid ":meth:`assertEquals`" +#, fuzzy +msgid ":meth:`!assertEquals`" msgstr ":meth:`assertEquals`" #: ../../whatsnew/3.2.rst:1816 @@ -2045,7 +2048,8 @@ msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" #: ../../whatsnew/3.2.rst:1817 -msgid ":meth:`assertNotEquals`" +#, fuzzy +msgid ":meth:`!assertNotEquals`" msgstr ":meth:`assertNotEquals`" #: ../../whatsnew/3.2.rst:1817 @@ -2053,7 +2057,8 @@ msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" #: ../../whatsnew/3.2.rst:1818 -msgid ":meth:`assertAlmostEquals`" +#, fuzzy +msgid ":meth:`!assertAlmostEquals`" msgstr ":meth:`assertAlmostEquals`" #: ../../whatsnew/3.2.rst:1818 @@ -2061,7 +2066,8 @@ msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" #: ../../whatsnew/3.2.rst:1819 -msgid ":meth:`assertNotAlmostEquals`" +#, fuzzy +msgid ":meth:`!assertNotAlmostEquals`" msgstr ":meth:`assertNotAlmostEquals`" #: ../../whatsnew/3.2.rst:1819 @@ -2080,10 +2086,10 @@ msgstr "(由 Ezio Melotti 貢獻;:issue:`9424`。)" #: ../../whatsnew/3.2.rst:1827 msgid "" -"The :meth:`~unittest.TestCase.assertDictContainsSubset` method was " -"deprecated because it was misimplemented with the arguments in the wrong " -"order. This created hard-to-debug optical illusions where tests like " -"``TestCase().assertDictContainsSubset({'a':1, 'b':2}, {'a':1})`` would fail." +"The :meth:`!assertDictContainsSubset` method was deprecated because it was " +"misimplemented with the arguments in the wrong order. This created hard-to-" +"debug optical illusions where tests like ``TestCase()." +"assertDictContainsSubset({'a':1, 'b':2}, {'a':1})`` would fail." msgstr "" #: ../../whatsnew/3.2.rst:1835 @@ -2228,7 +2234,7 @@ msgstr "dbm" #: ../../whatsnew/3.2.rst:2000 msgid "" -"All database modules now support the :meth:`get` and :meth:`setdefault` " +"All database modules now support the :meth:`!get` and :meth:`!setdefault` " "methods." msgstr "" @@ -2361,7 +2367,8 @@ msgid "" msgstr "" #: ../../whatsnew/3.2.rst:2121 -msgid "The :class:`Pdb` class constructor now accepts a *nosigint* argument." +msgid "" +"The :class:`~pdb.Pdb` class constructor now accepts a *nosigint* argument." msgstr "" #: ../../whatsnew/3.2.rst:2122 @@ -2691,11 +2698,11 @@ msgstr "(由 Antoine Pitrou 貢獻;:issue:`3001`。)" #: ../../whatsnew/3.2.rst:2397 msgid "" -"The fast-search algorithm in stringlib is now used by the :meth:`split`, :" -"meth:`rsplit`, :meth:`splitlines` and :meth:`replace` methods on :class:" -"`bytes`, :class:`bytearray` and :class:`str` objects. Likewise, the " -"algorithm is also used by :meth:`rfind`, :meth:`rindex`, :meth:`rsplit` and :" -"meth:`rpartition`." +"The fast-search algorithm in stringlib is now used by the :meth:`~str." +"split`, :meth:`~str.rsplit`, :meth:`~str.splitlines` and :meth:`~str." +"replace` methods on :class:`bytes`, :class:`bytearray` and :class:`str` " +"objects. Likewise, the algorithm is also used by :meth:`~str.rfind`, :meth:" +"`~str.rindex`, :meth:`~str.rsplit` and :meth:`~str.rpartition`." msgstr "" #: ../../whatsnew/3.2.rst:2403 @@ -2716,11 +2723,11 @@ msgstr "" msgid "" "There were several other minor optimizations. Set differencing now runs " "faster when one operand is much larger than the other (patch by Andress " -"Bennetts in :issue:`8685`). The :meth:`array.repeat` method has a faster " -"implementation (:issue:`1569291` by Alexander Belopolsky). The :class:" -"`BaseHTTPRequestHandler` has more efficient buffering (:issue:`3709` by " -"Andrew Schaaf). The :func:`operator.attrgetter` function has been sped-up (:" -"issue:`10160` by Christos Georgiou). And :class:`~configparser." +"Bennetts in :issue:`8685`). The :meth:`!array.repeat` method has a faster " +"implementation (:issue:`1569291` by Alexander Belopolsky). The :class:`~http." +"server.BaseHTTPRequestHandler` has more efficient buffering (:issue:`3709` " +"by Andrew Schaaf). The :func:`operator.attrgetter` function has been sped-" +"up (:issue:`10160` by Christos Georgiou). And :class:`~configparser." "ConfigParser` loads multi-line arguments a bit faster (:issue:`7113` by " "Łukasz Langa)." msgstr "" @@ -2970,14 +2977,14 @@ msgstr "" #: ../../whatsnew/3.2.rst:2565 msgid "" -"A new macro :c:macro:`Py_VA_COPY` copies the state of the variable argument " +"A new macro :c:macro:`!Py_VA_COPY` copies the state of the variable argument " "list. It is equivalent to C99 *va_copy* but available on all Python " "platforms (:issue:`2443`)." msgstr "" #: ../../whatsnew/3.2.rst:2569 msgid "" -"A new C API function :c:func:`PySys_SetArgvEx` allows an embedded " +"A new C API function :c:func:`!PySys_SetArgvEx` allows an embedded " "interpreter to set :data:`sys.argv` without also modifying :data:`sys.path` " "(:issue:`5753`)." msgstr "" @@ -3118,24 +3125,25 @@ msgstr "" #: ../../whatsnew/3.2.rst:2653 msgid "" -"The :meth:`array.tostring` and :meth:`array.fromstring` have been renamed " -"to :meth:`array.tobytes` and :meth:`array.frombytes` for clarity. The old " -"names have been deprecated. (See :issue:`8990`.)" +"The :meth:`!array.tostring` and :meth:`!array.fromstring` have been renamed " +"to :meth:`array.tobytes() ` and :meth:`array." +"frombytes() ` for clarity. The old names have been " +"deprecated. (See :issue:`8990`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2657 +#: ../../whatsnew/3.2.rst:2658 msgid "``PyArg_Parse*()`` functions:" msgstr "" -#: ../../whatsnew/3.2.rst:2659 +#: ../../whatsnew/3.2.rst:2660 msgid "\"t#\" format has been removed: use \"s#\" or \"s*\" instead" msgstr "" -#: ../../whatsnew/3.2.rst:2660 +#: ../../whatsnew/3.2.rst:2661 msgid "\"w\" and \"w#\" formats has been removed: use \"w*\" instead" msgstr "" -#: ../../whatsnew/3.2.rst:2662 +#: ../../whatsnew/3.2.rst:2663 msgid "" "The :c:type:`!PyCObject` type, deprecated in 3.1, has been removed. To wrap " "opaque C pointers in Python objects, the :c:type:`PyCapsule` API should be " @@ -3143,13 +3151,13 @@ msgid "" "safety information and a less complicated signature for calling a destructor." msgstr "" -#: ../../whatsnew/3.2.rst:2667 +#: ../../whatsnew/3.2.rst:2668 msgid "" -"The :func:`sys.setfilesystemencoding` function was removed because it had a " +"The :func:`!sys.setfilesystemencoding` function was removed because it had a " "flawed design." msgstr "" -#: ../../whatsnew/3.2.rst:2670 +#: ../../whatsnew/3.2.rst:2671 msgid "" "The :func:`random.seed` function and method now salt string seeds with an " "sha512 hash function. To access the previous version of *seed* in order to " @@ -3157,21 +3165,22 @@ msgid "" "seed(s, version=1)``." msgstr "" -#: ../../whatsnew/3.2.rst:2675 +#: ../../whatsnew/3.2.rst:2676 msgid "" -"The previously deprecated :func:`string.maketrans` function has been removed " -"in favor of the static methods :meth:`bytes.maketrans` and :meth:`bytearray." -"maketrans`. This change solves the confusion around which types were " -"supported by the :mod:`string` module. Now, :class:`str`, :class:`bytes`, " -"and :class:`bytearray` each have their own **maketrans** and **translate** " -"methods with intermediate translation tables of the appropriate type." +"The previously deprecated :func:`!string.maketrans` function has been " +"removed in favor of the static methods :meth:`bytes.maketrans` and :meth:" +"`bytearray.maketrans`. This change solves the confusion around which types " +"were supported by the :mod:`string` module. Now, :class:`str`, :class:" +"`bytes`, and :class:`bytearray` each have their own **maketrans** and " +"**translate** methods with intermediate translation tables of the " +"appropriate type." msgstr "" -#: ../../whatsnew/3.2.rst:2683 +#: ../../whatsnew/3.2.rst:2684 msgid "(Contributed by Georg Brandl; :issue:`5675`.)" msgstr "(由 Georg Brandl 貢獻;:issue:`5675`。)" -#: ../../whatsnew/3.2.rst:2685 +#: ../../whatsnew/3.2.rst:2686 msgid "" "The previously deprecated :func:`!contextlib.nested` function has been " "removed in favor of a plain :keyword:`with` statement which can accept " @@ -3180,7 +3189,7 @@ msgid "" "when one of them raises an exception::" msgstr "" -#: ../../whatsnew/3.2.rst:2696 +#: ../../whatsnew/3.2.rst:2697 msgid "" "(Contributed by Georg Brandl and Mattias Brändström; `appspot issue 53094 " "`_.)" @@ -3188,7 +3197,7 @@ msgstr "" "(由 Georg Brandl 和 Mattias Brändström 貢獻;`appspot 問題 53094 `_。)" -#: ../../whatsnew/3.2.rst:2699 +#: ../../whatsnew/3.2.rst:2700 msgid "" ":func:`struct.pack` now only allows bytes for the ``s`` string pack code. " "Formerly, it would accept text arguments and implicitly encode them to bytes " @@ -3197,32 +3206,32 @@ msgid "" "writing to fixed length segment of a structure." msgstr "" -#: ../../whatsnew/3.2.rst:2705 +#: ../../whatsnew/3.2.rst:2706 msgid "" "Code such as ``struct.pack('<6sHHBBB', 'GIF87a', x, y)`` should be rewritten " "with to use bytes instead of text, ``struct.pack('<6sHHBBB', b'GIF87a', x, " "y)``." msgstr "" -#: ../../whatsnew/3.2.rst:2708 +#: ../../whatsnew/3.2.rst:2709 msgid "" "(Discovered by David Beazley and fixed by Victor Stinner; :issue:`10783`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2710 +#: ../../whatsnew/3.2.rst:2711 msgid "" "The :class:`xml.etree.ElementTree` class now raises an :exc:`xml.etree." "ElementTree.ParseError` when a parse fails. Previously it raised an :exc:" "`xml.parsers.expat.ExpatError`." msgstr "" -#: ../../whatsnew/3.2.rst:2714 +#: ../../whatsnew/3.2.rst:2715 msgid "" "The new, longer :func:`str` value on floats may break doctests which rely on " "the old output format." msgstr "" -#: ../../whatsnew/3.2.rst:2717 +#: ../../whatsnew/3.2.rst:2718 msgid "" "In :class:`subprocess.Popen`, the default value for *close_fds* is now " "``True`` under Unix; under Windows, it is ``True`` if the three standard " @@ -3231,28 +3240,28 @@ msgid "" "race conditions when open file descriptors would leak into the child process." msgstr "" -#: ../../whatsnew/3.2.rst:2724 +#: ../../whatsnew/3.2.rst:2725 msgid "" "Support for legacy HTTP 0.9 has been removed from :mod:`urllib.request` and :" "mod:`http.client`. Such support is still present on the server side (in :" "mod:`http.server`)." msgstr "" -#: ../../whatsnew/3.2.rst:2728 +#: ../../whatsnew/3.2.rst:2729 msgid "(Contributed by Antoine Pitrou, :issue:`10711`.)" msgstr "(由 Antoine Pitrou 於 :issue:`10711` 貢獻。)" -#: ../../whatsnew/3.2.rst:2730 +#: ../../whatsnew/3.2.rst:2731 msgid "" "SSL sockets in timeout mode now raise :exc:`socket.timeout` when a timeout " "occurs, rather than a generic :exc:`~ssl.SSLError`." msgstr "" -#: ../../whatsnew/3.2.rst:2733 +#: ../../whatsnew/3.2.rst:2734 msgid "(Contributed by Antoine Pitrou, :issue:`10272`.)" msgstr "(由 Antoine Pitrou 於 :issue:`10272` 貢獻。)" -#: ../../whatsnew/3.2.rst:2735 +#: ../../whatsnew/3.2.rst:2736 msgid "" "The misleading functions :c:func:`!PyEval_AcquireLock` and :c:func:`!" "PyEval_ReleaseLock` have been officially deprecated. The thread-state aware " @@ -3260,18 +3269,18 @@ msgid "" "`PyEval_RestoreThread`) should be used instead." msgstr "" -#: ../../whatsnew/3.2.rst:2740 +#: ../../whatsnew/3.2.rst:2741 msgid "" "Due to security risks, :func:`!asyncore.handle_accept` has been deprecated, " "and a new function, :func:`!asyncore.handle_accepted`, was added to replace " "it." msgstr "" -#: ../../whatsnew/3.2.rst:2743 +#: ../../whatsnew/3.2.rst:2744 msgid "(Contributed by Giampaolo Rodola in :issue:`6706`.)" msgstr "(由 Giampaolo Rodola 在 :issue:`6706` 中貢獻。)" -#: ../../whatsnew/3.2.rst:2745 +#: ../../whatsnew/3.2.rst:2746 msgid "" "Due to the new :term:`GIL` implementation, :c:func:`!PyEval_InitThreads` " "cannot be called before :c:func:`Py_Initialize` anymore." From 1a078e456fe8abd8d235709afb94520b6fb7b2db Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 19 Feb 2024 00:04:52 +0000 Subject: [PATCH 12/33] sync with cpython ae6c01d9 --- library/types.po | 133 +++--- reference/datamodel.po | 893 +++++++++++++++++++++-------------------- 2 files changed, 514 insertions(+), 512 deletions(-) diff --git a/library/types.po b/library/types.po index 88b403ea70..2693c94041 100644 --- a/library/types.po +++ b/library/types.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-25 06:20+0000\n" +"POT-Creation-Date: 2024-02-19 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -223,7 +223,9 @@ msgid "" msgstr "" #: ../../library/types.rst:191 -msgid "The type for code objects such as returned by :func:`compile`." +msgid "" +"The type of :ref:`code objects ` such as returned by :func:" +"`compile`." msgstr "" #: ../../library/types.rst:193 @@ -245,80 +247,75 @@ msgstr "" #: ../../library/types.rst:201 msgid "" -"Return a copy of the code object with new values for the specified fields." -msgstr "" - -#: ../../library/types.rst:207 -msgid "" "The type for cell objects: such objects are used as containers for a " "function's free variables." msgstr "" -#: ../../library/types.rst:215 +#: ../../library/types.rst:209 msgid "The type of methods of user-defined class instances." msgstr "" -#: ../../library/types.rst:221 +#: ../../library/types.rst:215 msgid "" "The type of built-in functions like :func:`len` or :func:`sys.exit`, and " "methods of built-in classes. (Here, the term \"built-in\" means \"written " "in C\".)" msgstr "" -#: ../../library/types.rst:228 +#: ../../library/types.rst:222 msgid "" "The type of methods of some built-in data types and base classes such as :" "meth:`object.__init__` or :meth:`object.__lt__`." msgstr "" -#: ../../library/types.rst:236 +#: ../../library/types.rst:230 msgid "" "The type of *bound* methods of some built-in data types and base classes. " "For example it is the type of :code:`object().__str__`." msgstr "" -#: ../../library/types.rst:244 +#: ../../library/types.rst:238 msgid "The type of :data:`NotImplemented`." msgstr "" -#: ../../library/types.rst:251 +#: ../../library/types.rst:245 msgid "" "The type of methods of some built-in data types such as :meth:`str.join`." msgstr "" -#: ../../library/types.rst:258 +#: ../../library/types.rst:252 msgid "" "The type of *unbound* class methods of some built-in data types such as " "``dict.__dict__['fromkeys']``." msgstr "" -#: ../../library/types.rst:266 +#: ../../library/types.rst:260 msgid "" "The type of :term:`modules `. The constructor takes the name of the " "module to be created and optionally its :term:`docstring`." msgstr "" -#: ../../library/types.rst:270 +#: ../../library/types.rst:264 msgid "" "Use :func:`importlib.util.module_from_spec` to create a new module if you " "wish to set the various import-controlled attributes." msgstr "" -#: ../../library/types.rst:275 +#: ../../library/types.rst:269 msgid "The :term:`docstring` of the module. Defaults to ``None``." msgstr "" -#: ../../library/types.rst:279 +#: ../../library/types.rst:273 msgid "The :term:`loader` which loaded the module. Defaults to ``None``." msgstr "" -#: ../../library/types.rst:281 +#: ../../library/types.rst:275 msgid "" "This attribute is to match :attr:`importlib.machinery.ModuleSpec.loader` as " "stored in the :attr:`__spec__` object." msgstr "" -#: ../../library/types.rst:285 +#: ../../library/types.rst:279 msgid "" "A future version of Python may stop setting this attribute by default. To " "guard against this potential change, preferably read from the :attr:" @@ -326,17 +323,17 @@ msgid "" "None)`` if you explicitly need to use this attribute." msgstr "" -#: ../../library/types.rst:291 ../../library/types.rst:316 +#: ../../library/types.rst:285 ../../library/types.rst:310 msgid "Defaults to ``None``. Previously the attribute was optional." msgstr "" -#: ../../library/types.rst:296 +#: ../../library/types.rst:290 msgid "" "The name of the module. Expected to match :attr:`importlib.machinery." "ModuleSpec.name`." msgstr "" -#: ../../library/types.rst:301 +#: ../../library/types.rst:295 msgid "" "Which :term:`package` a module belongs to. If the module is top-level (i.e. " "not a part of any specific package) then the attribute should be set to " @@ -344,13 +341,13 @@ msgid "" "`__name__` if the module is a package itself). Defaults to ``None``." msgstr "" -#: ../../library/types.rst:306 +#: ../../library/types.rst:300 msgid "" "This attribute is to match :attr:`importlib.machinery.ModuleSpec.parent` as " "stored in the :attr:`__spec__` object." msgstr "" -#: ../../library/types.rst:310 +#: ../../library/types.rst:304 msgid "" "A future version of Python may stop setting this attribute by default. To " "guard against this potential change, preferably read from the :attr:" @@ -358,73 +355,73 @@ msgid "" "None)`` if you explicitly need to use this attribute." msgstr "" -#: ../../library/types.rst:321 +#: ../../library/types.rst:315 msgid "" "A record of the module's import-system-related state. Expected to be an " "instance of :class:`importlib.machinery.ModuleSpec`." msgstr "" -#: ../../library/types.rst:329 +#: ../../library/types.rst:323 msgid "The type of :data:`Ellipsis`." msgstr "" -#: ../../library/types.rst:335 +#: ../../library/types.rst:329 msgid "" "The type of :ref:`parameterized generics ` such as " "``list[int]``." msgstr "" -#: ../../library/types.rst:338 +#: ../../library/types.rst:332 msgid "" "``t_origin`` should be a non-parameterized generic class, such as ``list``, " "``tuple`` or ``dict``. ``t_args`` should be a :class:`tuple` (possibly of " "length 1) of types which parameterize ``t_origin``::" msgstr "" -#: ../../library/types.rst:351 +#: ../../library/types.rst:345 msgid "This type can now be subclassed." msgstr "" -#: ../../library/types.rst:357 +#: ../../library/types.rst:351 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../library/types.rst:357 +#: ../../library/types.rst:351 msgid "In-depth documentation on instances of :class:`!types.GenericAlias`" msgstr "" -#: ../../library/types.rst:359 +#: ../../library/types.rst:353 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/types.rst:360 +#: ../../library/types.rst:354 msgid "Introducing the :class:`!types.GenericAlias` class" msgstr "" -#: ../../library/types.rst:364 +#: ../../library/types.rst:358 msgid "The type of :ref:`union type expressions`." msgstr "" -#: ../../library/types.rst:370 +#: ../../library/types.rst:364 msgid "" "The type of traceback objects such as found in ``sys.exception()." "__traceback__``." msgstr "" -#: ../../library/types.rst:372 +#: ../../library/types.rst:366 msgid "" "See :ref:`the language reference ` for details of the " "available attributes and operations, and guidance on creating tracebacks " "dynamically." msgstr "" -#: ../../library/types.rst:379 +#: ../../library/types.rst:373 msgid "" "The type of :ref:`frame objects ` such as found in :attr:`tb." "tb_frame ` if ``tb`` is a traceback object." msgstr "" -#: ../../library/types.rst:385 +#: ../../library/types.rst:379 msgid "" "The type of objects defined in extension modules with ``PyGetSetDef``, such " "as :attr:`FrameType.f_locals ` or ``array.array.typecode``. " @@ -433,7 +430,7 @@ msgid "" "modules." msgstr "" -#: ../../library/types.rst:394 +#: ../../library/types.rst:388 msgid "" "The type of objects defined in extension modules with ``PyMemberDef``, such " "as ``datetime.timedelta.days``. This type is used as descriptor for simple " @@ -442,7 +439,7 @@ msgid "" "modules." msgstr "" -#: ../../library/types.rst:399 +#: ../../library/types.rst:393 msgid "" "In addition, when a class is defined with a :attr:`~object.__slots__` " "attribute, then for each slot, an instance of :class:`!MemberDescriptorType` " @@ -450,117 +447,117 @@ msgid "" "in the class's :attr:`~object.__dict__`." msgstr "" -#: ../../library/types.rst:405 +#: ../../library/types.rst:399 msgid "" "In other implementations of Python, this type may be identical to " "``GetSetDescriptorType``." msgstr "" -#: ../../library/types.rst:410 +#: ../../library/types.rst:404 msgid "" "Read-only proxy of a mapping. It provides a dynamic view on the mapping's " "entries, which means that when the mapping changes, the view reflects these " "changes." msgstr "" -#: ../../library/types.rst:418 +#: ../../library/types.rst:412 msgid "" "Updated to support the new union (``|``) operator from :pep:`584`, which " "simply delegates to the underlying mapping." msgstr "" -#: ../../library/types.rst:423 +#: ../../library/types.rst:417 msgid "" "Return ``True`` if the underlying mapping has a key *key*, else ``False``." msgstr "" -#: ../../library/types.rst:428 +#: ../../library/types.rst:422 msgid "" "Return the item of the underlying mapping with key *key*. Raises a :exc:" "`KeyError` if *key* is not in the underlying mapping." msgstr "" -#: ../../library/types.rst:433 +#: ../../library/types.rst:427 msgid "" "Return an iterator over the keys of the underlying mapping. This is a " "shortcut for ``iter(proxy.keys())``." msgstr "" -#: ../../library/types.rst:438 +#: ../../library/types.rst:432 msgid "Return the number of items in the underlying mapping." msgstr "" -#: ../../library/types.rst:442 +#: ../../library/types.rst:436 msgid "Return a shallow copy of the underlying mapping." msgstr "" -#: ../../library/types.rst:446 +#: ../../library/types.rst:440 msgid "" "Return the value for *key* if *key* is in the underlying mapping, else " "*default*. If *default* is not given, it defaults to ``None``, so that this " "method never raises a :exc:`KeyError`." msgstr "" -#: ../../library/types.rst:452 +#: ../../library/types.rst:446 msgid "" "Return a new view of the underlying mapping's items (``(key, value)`` pairs)." msgstr "" -#: ../../library/types.rst:457 +#: ../../library/types.rst:451 msgid "Return a new view of the underlying mapping's keys." msgstr "" -#: ../../library/types.rst:461 +#: ../../library/types.rst:455 msgid "Return a new view of the underlying mapping's values." msgstr "" -#: ../../library/types.rst:465 +#: ../../library/types.rst:459 msgid "Return a reverse iterator over the keys of the underlying mapping." msgstr "" -#: ../../library/types.rst:471 +#: ../../library/types.rst:465 msgid "Return a hash of the underlying mapping." msgstr "" -#: ../../library/types.rst:477 +#: ../../library/types.rst:471 msgid "Additional Utility Classes and Functions" msgstr "" -#: ../../library/types.rst:481 +#: ../../library/types.rst:475 msgid "" "A simple :class:`object` subclass that provides attribute access to its " "namespace, as well as a meaningful repr." msgstr "" -#: ../../library/types.rst:484 +#: ../../library/types.rst:478 msgid "" "Unlike :class:`object`, with ``SimpleNamespace`` you can add and remove " "attributes. If a ``SimpleNamespace`` object is initialized with keyword " "arguments, those are directly added to the underlying namespace." msgstr "" -#: ../../library/types.rst:488 +#: ../../library/types.rst:482 msgid "The type is roughly equivalent to the following code::" msgstr "" -#: ../../library/types.rst:503 +#: ../../library/types.rst:497 msgid "" "``SimpleNamespace`` may be useful as a replacement for ``class NS: pass``. " "However, for a structured record type use :func:`~collections.namedtuple` " "instead." msgstr "" -#: ../../library/types.rst:509 +#: ../../library/types.rst:503 msgid "" "Attribute order in the repr changed from alphabetical to insertion (like " "``dict``)." msgstr "" -#: ../../library/types.rst:515 +#: ../../library/types.rst:509 msgid "Route attribute access on a class to __getattr__." msgstr "" -#: ../../library/types.rst:517 +#: ../../library/types.rst:511 msgid "" "This is a descriptor, used to define attributes that act differently when " "accessed through an instance and through a class. Instance access remains " @@ -568,18 +565,18 @@ msgid "" "class's __getattr__ method; this is done by raising AttributeError." msgstr "" -#: ../../library/types.rst:522 +#: ../../library/types.rst:516 msgid "" "This allows one to have properties active on an instance, and have virtual " "attributes on the class with the same name (see :class:`enum.Enum` for an " "example)." msgstr "" -#: ../../library/types.rst:529 +#: ../../library/types.rst:523 msgid "Coroutine Utility Functions" msgstr "" -#: ../../library/types.rst:533 +#: ../../library/types.rst:527 msgid "" "This function transforms a :term:`generator` function into a :term:" "`coroutine function` which returns a generator-based coroutine. The " @@ -589,11 +586,11 @@ msgid "" "method." msgstr "" -#: ../../library/types.rst:540 +#: ../../library/types.rst:534 msgid "If *gen_func* is a generator function, it will be modified in-place." msgstr "" -#: ../../library/types.rst:542 +#: ../../library/types.rst:536 msgid "" "If *gen_func* is not a generator function, it will be wrapped. If it returns " "an instance of :class:`collections.abc.Generator`, the instance will be " diff --git a/reference/datamodel.po b/reference/datamodel.po index 2cba446389..bd2bae95c6 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-14 00:03+0000\n" +"POT-Creation-Date: 2024-02-19 00:03+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-" @@ -598,7 +598,7 @@ msgid "" msgstr "" #: ../../reference/datamodel.rst:538 ../../reference/datamodel.rst:1127 -#: ../../reference/datamodel.rst:1316 +#: ../../reference/datamodel.rst:1322 msgid "Special read-only attributes" msgstr "特殊唯讀屬性" @@ -629,7 +629,7 @@ msgid "" "the value of the cell, as well as set the value." msgstr "" -#: ../../reference/datamodel.rst:564 ../../reference/datamodel.rst:1353 +#: ../../reference/datamodel.rst:564 ../../reference/datamodel.rst:1359 msgid "Special writable attributes" msgstr "特殊可寫屬性" @@ -731,7 +731,7 @@ msgid "" "callable object (normally a user-defined function)." msgstr "" -#: ../../reference/datamodel.rst:669 ../../reference/datamodel.rst:1444 +#: ../../reference/datamodel.rst:669 ../../reference/datamodel.rst:1450 msgid "Special read-only attributes:" msgstr "特殊唯讀屬性:" @@ -1479,24 +1479,29 @@ msgstr "" msgid "The PEP that introduced the :meth:`!co_lines` method." msgstr "" -#: ../../reference/datamodel.rst:1299 +#: ../../reference/datamodel.rst:1297 +msgid "" +"Return a copy of the code object with new values for the specified fields." +msgstr "" + +#: ../../reference/datamodel.rst:1305 msgid "Frame objects" msgstr "" -#: ../../reference/datamodel.rst:1303 +#: ../../reference/datamodel.rst:1309 msgid "" "Frame objects represent execution frames. They may occur in :ref:`traceback " "objects `, and are also passed to registered trace " "functions." msgstr "" -#: ../../reference/datamodel.rst:1321 +#: ../../reference/datamodel.rst:1327 msgid "" "Points to the previous stack frame (towards the caller), or ``None`` if this " "is the bottom stack frame" msgstr "" -#: ../../reference/datamodel.rst:1325 +#: ../../reference/datamodel.rst:1331 msgid "" "The :ref:`code object ` being executed in this frame. " "Accessing this attribute raises an :ref:`auditing event ` ``object." @@ -1506,49 +1511,49 @@ msgstr "" "這個屬性會引發一個附帶引數 ``obj`` 與 ``\"f_code\"`` 的\\ :ref:`稽核事件 " "` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1330 +#: ../../reference/datamodel.rst:1336 msgid "" "The dictionary used by the frame to look up :ref:`local variables `" msgstr "" -#: ../../reference/datamodel.rst:1334 +#: ../../reference/datamodel.rst:1340 msgid "" "The dictionary used by the frame to look up :ref:`global variables `" msgstr "" -#: ../../reference/datamodel.rst:1338 +#: ../../reference/datamodel.rst:1344 msgid "" "The dictionary used by the frame to look up :ref:`built-in (intrinsic) names " "`" msgstr "" -#: ../../reference/datamodel.rst:1342 +#: ../../reference/datamodel.rst:1348 msgid "" "The \"precise instruction\" of the frame object (this is an index into the :" "term:`bytecode` string of the :ref:`code object `)" msgstr "" -#: ../../reference/datamodel.rst:1358 +#: ../../reference/datamodel.rst:1364 msgid "" "If not ``None``, this is a function called for various events during code " "execution (this is used by debuggers). Normally an event is triggered for " "each new source line (see :attr:`~frame.f_trace_lines`)." msgstr "" -#: ../../reference/datamodel.rst:1363 +#: ../../reference/datamodel.rst:1369 msgid "" "Set this attribute to :const:`False` to disable triggering a tracing event " "for each source line." msgstr "" -#: ../../reference/datamodel.rst:1367 +#: ../../reference/datamodel.rst:1373 msgid "" "Set this attribute to :const:`True` to allow per-opcode events to be " "requested. Note that this may lead to undefined interpreter behaviour if " "exceptions raised by the trace function escape to the function being traced." msgstr "" -#: ../../reference/datamodel.rst:1373 +#: ../../reference/datamodel.rst:1379 msgid "" "The current line number of the frame -- writing to this from within a trace " "function jumps to the given line (only for the bottom-most frame). A " @@ -1556,15 +1561,15 @@ msgid "" "this attribute." msgstr "" -#: ../../reference/datamodel.rst:1379 +#: ../../reference/datamodel.rst:1385 msgid "Frame object methods" msgstr "" -#: ../../reference/datamodel.rst:1381 +#: ../../reference/datamodel.rst:1387 msgid "Frame objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1385 +#: ../../reference/datamodel.rst:1391 msgid "" "This method clears all references to :ref:`local variables ` held by " "the frame. Also, if the frame belonged to a :term:`generator`, the " @@ -1573,26 +1578,26 @@ msgid "" "and storing its :ref:`traceback ` for later use)." msgstr "" -#: ../../reference/datamodel.rst:1391 +#: ../../reference/datamodel.rst:1397 msgid ":exc:`RuntimeError` is raised if the frame is currently executing." msgstr "" -#: ../../reference/datamodel.rst:1399 +#: ../../reference/datamodel.rst:1405 msgid "Traceback objects" msgstr "" -#: ../../reference/datamodel.rst:1412 +#: ../../reference/datamodel.rst:1418 msgid "" "Traceback objects represent the stack trace of an :ref:`exception `. A traceback object is implicitly created when an exception occurs, " "and may also be explicitly created by calling :class:`types.TracebackType`." msgstr "" -#: ../../reference/datamodel.rst:1417 +#: ../../reference/datamodel.rst:1423 msgid "Traceback objects can now be explicitly instantiated from Python code." msgstr "" -#: ../../reference/datamodel.rst:1420 +#: ../../reference/datamodel.rst:1426 msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " @@ -1603,7 +1608,7 @@ msgid "" "the caught exception." msgstr "" -#: ../../reference/datamodel.rst:1429 +#: ../../reference/datamodel.rst:1435 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " @@ -1611,19 +1616,19 @@ msgid "" "last_traceback`." msgstr "" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1440 msgid "" "For explicitly created tracebacks, it is up to the creator of the traceback " "to determine how the :attr:`~traceback.tb_next` attributes should be linked " "to form a full stack trace." msgstr "" -#: ../../reference/datamodel.rst:1449 +#: ../../reference/datamodel.rst:1455 msgid "" "Points to the execution :ref:`frame ` of the current level." msgstr "" -#: ../../reference/datamodel.rst:1452 +#: ../../reference/datamodel.rst:1458 msgid "" "Accessing this attribute raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." @@ -1631,15 +1636,15 @@ msgstr "" "存取此屬性會引發一個附帶引數 ``obj`` 與 ``\"tb_frame\"`` 的\\ :ref:`稽核事件 " "` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1457 +#: ../../reference/datamodel.rst:1463 msgid "Gives the line number where the exception occurred" msgstr "" -#: ../../reference/datamodel.rst:1460 +#: ../../reference/datamodel.rst:1466 msgid "Indicates the \"precise instruction\"." msgstr "" -#: ../../reference/datamodel.rst:1462 +#: ../../reference/datamodel.rst:1468 msgid "" "The line number and last instruction in the traceback may differ from the " "line number of its :ref:`frame object ` if the exception " @@ -1647,39 +1652,39 @@ msgid "" "with a :keyword:`finally` clause." msgstr "" -#: ../../reference/datamodel.rst:1473 +#: ../../reference/datamodel.rst:1479 msgid "" "The special writable attribute :attr:`!tb_next` is the next level in the " "stack trace (towards the frame where the exception occurred), or ``None`` if " "there is no next level." msgstr "" -#: ../../reference/datamodel.rst:1477 +#: ../../reference/datamodel.rst:1483 msgid "This attribute is now writable" msgstr "" -#: ../../reference/datamodel.rst:1482 +#: ../../reference/datamodel.rst:1488 msgid "Slice objects" msgstr "" -#: ../../reference/datamodel.rst:1486 +#: ../../reference/datamodel.rst:1492 msgid "" "Slice objects are used to represent slices for :meth:`~object.__getitem__` " "methods. They are also created by the built-in :func:`slice` function." msgstr "" -#: ../../reference/datamodel.rst:1495 +#: ../../reference/datamodel.rst:1501 msgid "" "Special read-only attributes: :attr:`~slice.start` is the lower bound; :attr:" "`~slice.stop` is the upper bound; :attr:`~slice.step` is the step value; " "each is ``None`` if omitted. These attributes can have any type." msgstr "" -#: ../../reference/datamodel.rst:1499 +#: ../../reference/datamodel.rst:1505 msgid "Slice objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1503 +#: ../../reference/datamodel.rst:1509 msgid "" "This method takes a single integer argument *length* and computes " "information about the slice that the slice object would describe if applied " @@ -1689,11 +1694,11 @@ msgid "" "a manner consistent with regular slices." msgstr "" -#: ../../reference/datamodel.rst:1512 +#: ../../reference/datamodel.rst:1518 msgid "Static method objects" msgstr "" -#: ../../reference/datamodel.rst:1514 +#: ../../reference/datamodel.rst:1520 msgid "" "Static method objects provide a way of defeating the transformation of " "function objects to method objects described above. A static method object " @@ -1704,11 +1709,11 @@ msgid "" "method objects are created by the built-in :func:`staticmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1524 +#: ../../reference/datamodel.rst:1530 msgid "Class method objects" msgstr "" -#: ../../reference/datamodel.rst:1526 +#: ../../reference/datamodel.rst:1532 msgid "" "A class method object, like a static method object, is a wrapper around " "another object that alters the way in which that object is retrieved from " @@ -1718,11 +1723,11 @@ msgid "" "`classmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1536 +#: ../../reference/datamodel.rst:1542 msgid "Special method names" msgstr "" -#: ../../reference/datamodel.rst:1542 +#: ../../reference/datamodel.rst:1548 msgid "" "A class can implement certain operations that are invoked by special syntax " "(such as arithmetic operations or subscripting and slicing) by defining " @@ -1736,7 +1741,7 @@ msgid "" "`TypeError`)." msgstr "" -#: ../../reference/datamodel.rst:1553 +#: ../../reference/datamodel.rst:1559 msgid "" "Setting a special method to ``None`` indicates that the corresponding " "operation is not available. For example, if a class sets :meth:`~object." @@ -1745,7 +1750,7 @@ msgid "" "`~object.__getitem__`). [#]_" msgstr "" -#: ../../reference/datamodel.rst:1559 +#: ../../reference/datamodel.rst:1565 msgid "" "When implementing a class that emulates any built-in type, it is important " "that the emulation only be implemented to the degree that it makes sense for " @@ -1755,11 +1760,11 @@ msgid "" "the W3C's Document Object Model.)" msgstr "" -#: ../../reference/datamodel.rst:1570 +#: ../../reference/datamodel.rst:1576 msgid "Basic customization" msgstr "" -#: ../../reference/datamodel.rst:1576 +#: ../../reference/datamodel.rst:1582 msgid "" "Called to create a new instance of class *cls*. :meth:`__new__` is a static " "method (special-cased so you need not declare it as such) that takes the " @@ -1769,7 +1774,7 @@ msgid "" "new object instance (usually an instance of *cls*)." msgstr "" -#: ../../reference/datamodel.rst:1583 +#: ../../reference/datamodel.rst:1589 msgid "" "Typical implementations create a new instance of the class by invoking the " "superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` " @@ -1777,7 +1782,7 @@ msgid "" "necessary before returning it." msgstr "" -#: ../../reference/datamodel.rst:1588 +#: ../../reference/datamodel.rst:1594 msgid "" "If :meth:`__new__` is invoked during object construction and it returns an " "instance of *cls*, then the new instance’s :meth:`__init__` method will be " @@ -1786,13 +1791,13 @@ msgid "" "constructor." msgstr "" -#: ../../reference/datamodel.rst:1593 +#: ../../reference/datamodel.rst:1599 msgid "" "If :meth:`__new__` does not return an instance of *cls*, then the new " "instance's :meth:`__init__` method will not be invoked." msgstr "" -#: ../../reference/datamodel.rst:1596 +#: ../../reference/datamodel.rst:1602 msgid "" ":meth:`__new__` is intended mainly to allow subclasses of immutable types " "(like int, str, or tuple) to customize instance creation. It is also " @@ -1800,7 +1805,7 @@ msgid "" "creation." msgstr "" -#: ../../reference/datamodel.rst:1605 +#: ../../reference/datamodel.rst:1611 msgid "" "Called after the instance has been created (by :meth:`__new__`), but before " "it is returned to the caller. The arguments are those passed to the class " @@ -1810,7 +1815,7 @@ msgid "" "example: ``super().__init__([args...])``." msgstr "" -#: ../../reference/datamodel.rst:1612 +#: ../../reference/datamodel.rst:1618 msgid "" "Because :meth:`__new__` and :meth:`__init__` work together in constructing " "objects (:meth:`__new__` to create it, and :meth:`__init__` to customize " @@ -1818,7 +1823,7 @@ msgid "" "will cause a :exc:`TypeError` to be raised at runtime." msgstr "" -#: ../../reference/datamodel.rst:1625 +#: ../../reference/datamodel.rst:1631 msgid "" "Called when the instance is about to be destroyed. This is also called a " "finalizer or (improperly) a destructor. If a base class has a :meth:" @@ -1827,7 +1832,7 @@ msgid "" "instance." msgstr "" -#: ../../reference/datamodel.rst:1631 +#: ../../reference/datamodel.rst:1637 msgid "" "It is possible (though not recommended!) for the :meth:`__del__` method to " "postpone destruction of the instance by creating a new reference to it. " @@ -1837,20 +1842,20 @@ msgid "" "it once." msgstr "" -#: ../../reference/datamodel.rst:1638 +#: ../../reference/datamodel.rst:1644 msgid "" "It is not guaranteed that :meth:`__del__` methods are called for objects " "that still exist when the interpreter exits." msgstr "" -#: ../../reference/datamodel.rst:1643 +#: ../../reference/datamodel.rst:1649 msgid "" "``del x`` doesn't directly call ``x.__del__()`` --- the former decrements " "the reference count for ``x`` by one, and the latter is only called when " "``x``'s reference count reaches zero." msgstr "" -#: ../../reference/datamodel.rst:1648 +#: ../../reference/datamodel.rst:1654 msgid "" "It is possible for a reference cycle to prevent the reference count of an " "object from going to zero. In this case, the cycle will be later detected " @@ -1861,18 +1866,18 @@ msgid "" "caught in the traceback." msgstr "" -#: ../../reference/datamodel.rst:1658 +#: ../../reference/datamodel.rst:1664 msgid "Documentation for the :mod:`gc` module." msgstr "" -#: ../../reference/datamodel.rst:1662 +#: ../../reference/datamodel.rst:1668 msgid "" "Due to the precarious circumstances under which :meth:`__del__` methods are " "invoked, exceptions that occur during their execution are ignored, and a " "warning is printed to ``sys.stderr`` instead. In particular:" msgstr "" -#: ../../reference/datamodel.rst:1666 +#: ../../reference/datamodel.rst:1672 msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " @@ -1881,7 +1886,7 @@ msgid "" "`__del__`." msgstr "" -#: ../../reference/datamodel.rst:1672 +#: ../../reference/datamodel.rst:1678 msgid "" ":meth:`__del__` can be executed during interpreter shutdown. As a " "consequence, the global variables it needs to access (including other " @@ -1892,7 +1897,7 @@ msgid "" "still available at the time when the :meth:`__del__` method is called." msgstr "" -#: ../../reference/datamodel.rst:1687 +#: ../../reference/datamodel.rst:1693 msgid "" "Called by the :func:`repr` built-in function to compute the \"official\" " "string representation of an object. If at all possible, this should look " @@ -1904,13 +1909,13 @@ msgid "" "an \"informal\" string representation of instances of that class is required." msgstr "" -#: ../../reference/datamodel.rst:1696 +#: ../../reference/datamodel.rst:1702 msgid "" "This is typically used for debugging, so it is important that the " "representation is information-rich and unambiguous." msgstr "" -#: ../../reference/datamodel.rst:1707 +#: ../../reference/datamodel.rst:1713 msgid "" "Called by :func:`str(object) ` and the built-in functions :func:" "`format` and :func:`print` to compute the \"informal\" or nicely printable " @@ -1918,26 +1923,26 @@ msgid "" "` object." msgstr "" -#: ../../reference/datamodel.rst:1712 +#: ../../reference/datamodel.rst:1718 msgid "" "This method differs from :meth:`object.__repr__` in that there is no " "expectation that :meth:`__str__` return a valid Python expression: a more " "convenient or concise representation can be used." msgstr "" -#: ../../reference/datamodel.rst:1716 +#: ../../reference/datamodel.rst:1722 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:1726 +#: ../../reference/datamodel.rst:1732 msgid "" "Called by :ref:`bytes ` to compute a byte-string representation " "of an object. This should return a :class:`bytes` object." msgstr "" -#: ../../reference/datamodel.rst:1737 +#: ../../reference/datamodel.rst:1743 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -1949,28 +1954,28 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:1747 +#: ../../reference/datamodel.rst:1753 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:1749 +#: ../../reference/datamodel.rst:1755 msgid "The return value must be a string object." msgstr "" -#: ../../reference/datamodel.rst:1751 +#: ../../reference/datamodel.rst:1757 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:1755 +#: ../../reference/datamodel.rst:1761 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:1771 +#: ../../reference/datamodel.rst:1777 msgid "" "These are the so-called \"rich comparison\" methods. The correspondence " "between operator symbols and method names is as follows: ``x.__hash__``." msgstr "" -#: ../../reference/datamodel.rst:1860 +#: ../../reference/datamodel.rst:1866 msgid "" "If a class that does not override :meth:`__eq__` wishes to suppress hash " "support, it should include ``__hash__ = None`` in the class definition. A " @@ -2089,7 +2094,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:1869 +#: ../../reference/datamodel.rst:1875 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -2097,7 +2102,7 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:1874 +#: ../../reference/datamodel.rst:1880 msgid "" "This is intended to provide protection against a denial-of-service caused by " "carefully chosen inputs that exploit the worst case performance of a dict " @@ -2105,22 +2110,22 @@ msgid "" "advisories/ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:1879 +#: ../../reference/datamodel.rst:1885 msgid "" "Changing hash values affects the iteration order of sets. Python has never " "made guarantees about this ordering (and it typically varies between 32-bit " "and 64-bit builds)." msgstr "" -#: ../../reference/datamodel.rst:1883 +#: ../../reference/datamodel.rst:1889 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`\\ 。" -#: ../../reference/datamodel.rst:1885 +#: ../../reference/datamodel.rst:1891 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:1893 +#: ../../reference/datamodel.rst:1899 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -2129,18 +2134,18 @@ msgid "" "meth:`!__len__` nor :meth:`!__bool__`, all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:1904 +#: ../../reference/datamodel.rst:1910 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:1906 +#: ../../reference/datamodel.rst:1912 msgid "" "The following methods can be defined to customize the meaning of attribute " "access (use of, assignment to, or deletion of ``x.name``) for class " "instances." msgstr "" -#: ../../reference/datamodel.rst:1914 +#: ../../reference/datamodel.rst:1920 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -2150,7 +2155,7 @@ msgid "" "attribute value or raise an :exc:`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1921 +#: ../../reference/datamodel.rst:1927 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -2163,7 +2168,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:1934 +#: ../../reference/datamodel.rst:1940 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -2175,14 +2180,14 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:1945 +#: ../../reference/datamodel.rst:1951 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or :ref:`built-in " "functions `. See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:1950 +#: ../../reference/datamodel.rst:1956 msgid "" "Raises an :ref:`auditing event ` ``object.__getattr__`` with " "arguments ``obj``, ``name``." @@ -2190,27 +2195,27 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__getattr__``。" -#: ../../reference/datamodel.rst:1952 +#: ../../reference/datamodel.rst:1958 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1959 +#: ../../reference/datamodel.rst:1965 msgid "" "Called when an attribute assignment is attempted. This is called instead of " "the normal mechanism (i.e. store the value in the instance dictionary). " "*name* is the attribute name, *value* is the value to be assigned to it." msgstr "" -#: ../../reference/datamodel.rst:1963 +#: ../../reference/datamodel.rst:1969 msgid "" "If :meth:`__setattr__` wants to assign to an instance attribute, it should " "call the base class method with the same name, for example, ``object." "__setattr__(self, name, value)``." msgstr "" -#: ../../reference/datamodel.rst:1967 +#: ../../reference/datamodel.rst:1973 msgid "" "Raises an :ref:`auditing event ` ``object.__setattr__`` with " "arguments ``obj``, ``name``, ``value``." @@ -2218,21 +2223,21 @@ msgstr "" "引發一個附帶引數 ``obj``、``name``、``value`` 的\\ :ref:`稽核事件 " "` ``object.__setattr__``。" -#: ../../reference/datamodel.rst:1969 +#: ../../reference/datamodel.rst:1975 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:1976 +#: ../../reference/datamodel.rst:1982 msgid "" "Like :meth:`__setattr__` but for attribute deletion instead of assignment. " "This should only be implemented if ``del obj.name`` is meaningful for the " "object." msgstr "" -#: ../../reference/datamodel.rst:1979 +#: ../../reference/datamodel.rst:1985 msgid "" "Raises an :ref:`auditing event ` ``object.__delattr__`` with " "arguments ``obj``, ``name``." @@ -2240,23 +2245,23 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__delattr__``。" -#: ../../reference/datamodel.rst:1981 +#: ../../reference/datamodel.rst:1987 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1988 +#: ../../reference/datamodel.rst:1994 msgid "" "Called when :func:`dir` is called on the object. An iterable must be " "returned. :func:`dir` converts the returned iterable to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:1993 +#: ../../reference/datamodel.rst:1999 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:2000 +#: ../../reference/datamodel.rst:2006 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2268,21 +2273,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:2009 +#: ../../reference/datamodel.rst:2015 msgid "" "The ``__dir__`` function should accept no arguments, and return an iterable " "of strings that represents the names accessible on module. If present, this " "function overrides the standard :func:`dir` search on a module." msgstr "" -#: ../../reference/datamodel.rst:2013 +#: ../../reference/datamodel.rst:2019 msgid "" "For a more fine grained customization of the module behavior (setting " "attributes, properties, etc.), one can set the ``__class__`` attribute of a " "module object to a subclass of :class:`types.ModuleType`. For example::" msgstr "" -#: ../../reference/datamodel.rst:2031 +#: ../../reference/datamodel.rst:2037 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2290,27 +2295,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:2036 +#: ../../reference/datamodel.rst:2042 msgid "``__class__`` module attribute is now writable." msgstr "" -#: ../../reference/datamodel.rst:2039 +#: ../../reference/datamodel.rst:2045 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "" -#: ../../reference/datamodel.rst:2044 +#: ../../reference/datamodel.rst:2050 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:2045 +#: ../../reference/datamodel.rst:2051 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:2051 +#: ../../reference/datamodel.rst:2057 msgid "Implementing Descriptors" msgstr "" -#: ../../reference/datamodel.rst:2053 +#: ../../reference/datamodel.rst:2059 msgid "" "The following methods only apply when an instance of the class containing " "the method (a so-called *descriptor* class) appears in an *owner* class (the " @@ -2320,7 +2325,7 @@ msgid "" "the owner class' :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:2063 +#: ../../reference/datamodel.rst:2069 msgid "" "Called to get the attribute of the owner class (class attribute access) or " "of an instance of that class (instance attribute access). The optional " @@ -2329,13 +2334,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:2069 +#: ../../reference/datamodel.rst:2075 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:2072 +#: ../../reference/datamodel.rst:2078 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2345,31 +2350,31 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:2081 +#: ../../reference/datamodel.rst:2087 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:2084 +#: ../../reference/datamodel.rst:2090 msgid "" "Note, adding :meth:`__set__` or :meth:`__delete__` changes the kind of " "descriptor to a \"data descriptor\". See :ref:`descriptor-invocation` for " "more details." msgstr "" -#: ../../reference/datamodel.rst:2090 +#: ../../reference/datamodel.rst:2096 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:2092 +#: ../../reference/datamodel.rst:2098 msgid "" "Instances of descriptors may also have the :attr:`!__objclass__` attribute " "present:" msgstr "" -#: ../../reference/datamodel.rst:2097 +#: ../../reference/datamodel.rst:2103 msgid "" "The attribute :attr:`!__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2380,11 +2385,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:2108 +#: ../../reference/datamodel.rst:2114 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:2110 +#: ../../reference/datamodel.rst:2116 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2393,7 +2398,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:2116 +#: ../../reference/datamodel.rst:2122 msgid "" "The default behavior for attribute access is to get, set, or delete the " "attribute from an object's dictionary. For instance, ``a.x`` has a lookup " @@ -2401,7 +2406,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:2121 +#: ../../reference/datamodel.rst:2127 msgid "" "However, if the looked-up value is an object defining one of the descriptor " "methods, then Python may override the default behavior and invoke the " @@ -2409,54 +2414,54 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:2126 +#: ../../reference/datamodel.rst:2132 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:2131 +#: ../../reference/datamodel.rst:2137 msgid "Direct Call" msgstr "" -#: ../../reference/datamodel.rst:2130 +#: ../../reference/datamodel.rst:2136 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:2135 +#: ../../reference/datamodel.rst:2141 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:2134 +#: ../../reference/datamodel.rst:2140 msgid "" "If binding to an object instance, ``a.x`` is transformed into the call: " "``type(a).__dict__['x'].__get__(a, type(a))``." msgstr "" -#: ../../reference/datamodel.rst:2139 +#: ../../reference/datamodel.rst:2145 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:2138 +#: ../../reference/datamodel.rst:2144 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:2145 +#: ../../reference/datamodel.rst:2151 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:2142 +#: ../../reference/datamodel.rst:2148 msgid "" "A dotted lookup such as ``super(A, a).x`` searches ``a.__class__.__mro__`` " "for a base class ``B`` following ``A`` and then returns ``B.__dict__['x']." "__get__(a, A)``. If not a descriptor, ``x`` is returned unchanged." msgstr "" -#: ../../reference/datamodel.rst:2179 +#: ../../reference/datamodel.rst:2185 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " @@ -2474,7 +2479,7 @@ msgid "" "instances." msgstr "" -#: ../../reference/datamodel.rst:2194 +#: ../../reference/datamodel.rst:2200 msgid "" "Python methods (including those decorated with :func:`@staticmethod " "` and :func:`@classmethod `) are implemented as " @@ -2483,30 +2488,30 @@ msgid "" "from other instances of the same class." msgstr "" -#: ../../reference/datamodel.rst:2200 +#: ../../reference/datamodel.rst:2206 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:2207 +#: ../../reference/datamodel.rst:2213 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:2209 +#: ../../reference/datamodel.rst:2215 msgid "" "*__slots__* allow us to explicitly declare data members (like properties) " "and deny the creation of :attr:`~object.__dict__` and *__weakref__* (unless " "explicitly declared in *__slots__* or available in a parent.)" msgstr "" -#: ../../reference/datamodel.rst:2213 +#: ../../reference/datamodel.rst:2219 msgid "" "The space saved over using :attr:`~object.__dict__` can be significant. " "Attribute lookup speed can be significantly improved as well." msgstr "" -#: ../../reference/datamodel.rst:2218 +#: ../../reference/datamodel.rst:2224 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -2514,18 +2519,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:2227 +#: ../../reference/datamodel.rst:2233 msgid "Notes on using *__slots__*:" msgstr "" -#: ../../reference/datamodel.rst:2229 +#: ../../reference/datamodel.rst:2235 msgid "" "When inheriting from a class without *__slots__*, the :attr:`~object." "__dict__` and *__weakref__* attribute of the instances will always be " "accessible." msgstr "" -#: ../../reference/datamodel.rst:2233 +#: ../../reference/datamodel.rst:2239 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -2534,7 +2539,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2240 +#: ../../reference/datamodel.rst:2246 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -2542,7 +2547,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2246 +#: ../../reference/datamodel.rst:2252 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -2550,7 +2555,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:2252 +#: ../../reference/datamodel.rst:2258 msgid "" "The action of a *__slots__* declaration is not limited to the class where it " "is defined. *__slots__* declared in parents are available in child classes. " @@ -2559,7 +2564,7 @@ msgid "" "names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:2258 +#: ../../reference/datamodel.rst:2264 msgid "" "If a class defines a slot also defined in a base class, the instance " "variable defined by the base class slot is inaccessible (except by " @@ -2568,7 +2573,7 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:2263 +#: ../../reference/datamodel.rst:2269 msgid "" ":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " "class derived from a :c:member:`\"variable-length\" built-in type " @@ -2576,11 +2581,11 @@ msgid "" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:2268 +#: ../../reference/datamodel.rst:2274 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2270 +#: ../../reference/datamodel.rst:2276 msgid "" "If a :class:`dictionary ` is used to assign *__slots__*, the " "dictionary keys will be used as the slot names. The values of the dictionary " @@ -2588,13 +2593,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:2275 +#: ../../reference/datamodel.rst:2281 msgid "" ":attr:`~instance.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2278 +#: ../../reference/datamodel.rst:2284 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2602,18 +2607,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2284 +#: ../../reference/datamodel.rst:2290 msgid "" "If an :term:`iterator` is used for *__slots__* then a :term:`descriptor` is " "created for each of the iterator's values. However, the *__slots__* " "attribute will be an empty iterator." msgstr "" -#: ../../reference/datamodel.rst:2292 +#: ../../reference/datamodel.rst:2298 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:2294 +#: ../../reference/datamodel.rst:2300 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2623,14 +2628,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:2303 +#: ../../reference/datamodel.rst:2309 msgid "" "This method is called whenever the containing class is subclassed. *cls* is " "then the new subclass. If defined as a normal instance method, this method " "is implicitly converted to a class method." msgstr "" -#: ../../reference/datamodel.rst:2307 +#: ../../reference/datamodel.rst:2313 msgid "" "Keyword arguments which are given to a new class are passed to the parent " "class's ``__init_subclass__``. For compatibility with other classes using " @@ -2638,13 +2643,13 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2321 +#: ../../reference/datamodel.rst:2327 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2326 +#: ../../reference/datamodel.rst:2332 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2652,41 +2657,41 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2334 +#: ../../reference/datamodel.rst:2340 msgid "" "When a class is created, :meth:`type.__new__` scans the class variables and " "makes callbacks to those with a :meth:`~object.__set_name__` hook." msgstr "" -#: ../../reference/datamodel.rst:2339 +#: ../../reference/datamodel.rst:2345 msgid "" "Automatically called at the time the owning class *owner* is created. The " "object has been assigned to *name* in that class::" msgstr "" -#: ../../reference/datamodel.rst:2345 +#: ../../reference/datamodel.rst:2351 msgid "" "If the class variable is assigned after the class is created, :meth:" "`__set_name__` will not be called automatically. If needed, :meth:" "`__set_name__` can be called directly::" msgstr "" -#: ../../reference/datamodel.rst:2356 +#: ../../reference/datamodel.rst:2362 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`\\ 。" -#: ../../reference/datamodel.rst:2364 +#: ../../reference/datamodel.rst:2370 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2371 +#: ../../reference/datamodel.rst:2377 msgid "" "By default, classes are constructed using :func:`type`. The class body is " "executed in a new namespace and the class name is bound locally to the " "result of ``type(name, bases, namespace)``." msgstr "" -#: ../../reference/datamodel.rst:2375 +#: ../../reference/datamodel.rst:2381 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2694,41 +2699,41 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2389 +#: ../../reference/datamodel.rst:2395 msgid "" "Any other keyword arguments that are specified in the class definition are " "passed through to all metaclass operations described below." msgstr "" -#: ../../reference/datamodel.rst:2392 +#: ../../reference/datamodel.rst:2398 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2394 +#: ../../reference/datamodel.rst:2400 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2395 +#: ../../reference/datamodel.rst:2401 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2396 +#: ../../reference/datamodel.rst:2402 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2397 +#: ../../reference/datamodel.rst:2403 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2398 +#: ../../reference/datamodel.rst:2404 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2402 +#: ../../reference/datamodel.rst:2408 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2406 +#: ../../reference/datamodel.rst:2412 msgid "" "If a base that appears in a class definition is not an instance of :class:" "`type`, then an :meth:`!__mro_entries__` method is searched on the base. If " @@ -2740,59 +2745,59 @@ msgid "" "is ignored." msgstr "" -#: ../../reference/datamodel.rst:2418 +#: ../../reference/datamodel.rst:2424 msgid ":func:`types.resolve_bases`" msgstr ":func:`types.resolve_bases`" -#: ../../reference/datamodel.rst:2418 +#: ../../reference/datamodel.rst:2424 msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" -#: ../../reference/datamodel.rst:2422 +#: ../../reference/datamodel.rst:2428 msgid ":func:`types.get_original_bases`" msgstr ":func:`types.get_original_bases`" -#: ../../reference/datamodel.rst:2421 +#: ../../reference/datamodel.rst:2427 msgid "" "Retrieve a class's \"original bases\" prior to modifications by :meth:" "`~object.__mro_entries__`." msgstr "" -#: ../../reference/datamodel.rst:2424 +#: ../../reference/datamodel.rst:2430 msgid ":pep:`560`" msgstr ":pep:`560`" -#: ../../reference/datamodel.rst:2425 +#: ../../reference/datamodel.rst:2431 msgid "Core support for typing module and generic types." msgstr "" -#: ../../reference/datamodel.rst:2429 +#: ../../reference/datamodel.rst:2435 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2433 +#: ../../reference/datamodel.rst:2439 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2435 +#: ../../reference/datamodel.rst:2441 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2436 +#: ../../reference/datamodel.rst:2442 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:2438 +#: ../../reference/datamodel.rst:2444 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:2441 +#: ../../reference/datamodel.rst:2447 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2801,11 +2806,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2451 +#: ../../reference/datamodel.rst:2457 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2456 +#: ../../reference/datamodel.rst:2462 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2817,25 +2822,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2465 +#: ../../reference/datamodel.rst:2471 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2470 +#: ../../reference/datamodel.rst:2476 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2471 +#: ../../reference/datamodel.rst:2477 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2475 +#: ../../reference/datamodel.rst:2481 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2480 +#: ../../reference/datamodel.rst:2486 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2844,7 +2849,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2486 +#: ../../reference/datamodel.rst:2492 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -2853,11 +2858,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2495 +#: ../../reference/datamodel.rst:2501 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2502 +#: ../../reference/datamodel.rst:2508 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2865,7 +2870,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2507 +#: ../../reference/datamodel.rst:2513 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -2876,7 +2881,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2517 +#: ../../reference/datamodel.rst:2523 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -2885,39 +2890,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2523 +#: ../../reference/datamodel.rst:2529 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customization " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2527 +#: ../../reference/datamodel.rst:2533 msgid "" "The ``type.__new__`` method collects all of the attributes in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2529 +#: ../../reference/datamodel.rst:2535 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2531 +#: ../../reference/datamodel.rst:2537 msgid "" "The :meth:`~object.__init_subclass__` hook is called on the immediate parent " "of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2534 +#: ../../reference/datamodel.rst:2540 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2538 +#: ../../reference/datamodel.rst:2544 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -2925,19 +2930,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2545 +#: ../../reference/datamodel.rst:2551 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2546 +#: ../../reference/datamodel.rst:2552 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2550 +#: ../../reference/datamodel.rst:2556 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2552 +#: ../../reference/datamodel.rst:2558 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2945,17 +2950,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2559 +#: ../../reference/datamodel.rst:2565 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2561 +#: ../../reference/datamodel.rst:2567 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2564 +#: ../../reference/datamodel.rst:2570 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2963,21 +2968,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2571 +#: ../../reference/datamodel.rst:2577 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2578 +#: ../../reference/datamodel.rst:2584 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2583 +#: ../../reference/datamodel.rst:2589 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -2985,11 +2990,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2594 +#: ../../reference/datamodel.rst:2600 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2591 +#: ../../reference/datamodel.rst:2597 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2998,11 +3003,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2599 +#: ../../reference/datamodel.rst:2605 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2601 +#: ../../reference/datamodel.rst:2607 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -3010,65 +3015,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2609 +#: ../../reference/datamodel.rst:2615 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2609 +#: ../../reference/datamodel.rst:2615 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2612 +#: ../../reference/datamodel.rst:2618 msgid ":ref:`Generic Alias Types`" msgstr ":ref:`泛型別名型別 `" -#: ../../reference/datamodel.rst:2612 +#: ../../reference/datamodel.rst:2618 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2615 +#: ../../reference/datamodel.rst:2621 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2615 +#: ../../reference/datamodel.rst:2621 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2618 +#: ../../reference/datamodel.rst:2624 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2623 +#: ../../reference/datamodel.rst:2629 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2626 +#: ../../reference/datamodel.rst:2632 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " "method. As such, there is no need for it to be decorated with :func:" "`@classmethod` when it is defined." msgstr "" -#: ../../reference/datamodel.rst:2632 +#: ../../reference/datamodel.rst:2638 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2634 +#: ../../reference/datamodel.rst:2640 msgid "" "The purpose of :meth:`~object.__class_getitem__` is to allow runtime " "parameterization of standard-library generic classes in order to more easily " "apply :term:`type hints` to these classes." msgstr "" -#: ../../reference/datamodel.rst:2638 +#: ../../reference/datamodel.rst:2644 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -3077,7 +3082,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2644 +#: ../../reference/datamodel.rst:2650 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -3085,11 +3090,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2654 +#: ../../reference/datamodel.rst:2660 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2656 +#: ../../reference/datamodel.rst:2662 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -3099,14 +3104,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2663 +#: ../../reference/datamodel.rst:2669 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " "follows something like the following process to decide whether :meth:" "`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" -#: ../../reference/datamodel.rst:2691 +#: ../../reference/datamodel.rst:2697 msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " @@ -3116,40 +3121,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2710 +#: ../../reference/datamodel.rst:2716 msgid "" "However, if a class has a custom metaclass that defines :meth:`~object." "__getitem__`, subscribing the class may result in different behaviour. An " "example of this can be found in the :mod:`enum` module::" msgstr "" -#: ../../reference/datamodel.rst:2735 +#: ../../reference/datamodel.rst:2741 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2734 +#: ../../reference/datamodel.rst:2740 msgid "" "Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" "`subscription` results in ``__class_getitem__()`` being " "called instead of :meth:`~object.__getitem__`" msgstr "" -#: ../../reference/datamodel.rst:2742 +#: ../../reference/datamodel.rst:2748 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2749 +#: ../../reference/datamodel.rst:2755 msgid "" "Called when the instance is \"called\" as a function; if this method is " "defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " "arg1, ...)``." msgstr "" -#: ../../reference/datamodel.rst:2756 +#: ../../reference/datamodel.rst:2762 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2758 +#: ../../reference/datamodel.rst:2764 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -3185,7 +3190,7 @@ msgid "" "should iterate through the values." msgstr "" -#: ../../reference/datamodel.rst:2799 +#: ../../reference/datamodel.rst:2805 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -3193,7 +3198,7 @@ msgid "" "returns zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2806 +#: ../../reference/datamodel.rst:2812 msgid "" "In CPython, the length is required to be at most :data:`sys.maxsize`. If the " "length is larger than :data:`!sys.maxsize` some features (such as :func:" @@ -3202,7 +3207,7 @@ msgid "" "`~object.__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2815 +#: ../../reference/datamodel.rst:2821 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -3212,20 +3217,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2829 +#: ../../reference/datamodel.rst:2835 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2833 +#: ../../reference/datamodel.rst:2839 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2837 +#: ../../reference/datamodel.rst:2843 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2842 +#: ../../reference/datamodel.rst:2848 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers. Optionally, they may support :class:" @@ -3237,20 +3242,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2854 +#: ../../reference/datamodel.rst:2860 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:2859 +#: ../../reference/datamodel.rst:2865 msgid "" "When :ref:`subscripting` a *class*, the special class method :" "meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " "See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:2867 +#: ../../reference/datamodel.rst:2873 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3259,7 +3264,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2876 +#: ../../reference/datamodel.rst:2882 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3268,13 +3273,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2885 +#: ../../reference/datamodel.rst:2891 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:2891 +#: ../../reference/datamodel.rst:2897 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3282,14 +3287,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2899 +#: ../../reference/datamodel.rst:2905 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:2903 +#: ../../reference/datamodel.rst:2909 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -3298,7 +3303,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2910 +#: ../../reference/datamodel.rst:2916 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3306,14 +3311,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2917 +#: ../../reference/datamodel.rst:2923 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:2921 +#: ../../reference/datamodel.rst:2927 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3321,11 +3326,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2930 +#: ../../reference/datamodel.rst:2936 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2932 +#: ../../reference/datamodel.rst:2938 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3333,7 +3338,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2958 +#: ../../reference/datamodel.rst:2964 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3347,13 +3352,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2969 +#: ../../reference/datamodel.rst:2975 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2992 +#: ../../reference/datamodel.rst:2998 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3366,13 +3371,13 @@ msgid "" "*NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:3004 +#: ../../reference/datamodel.rst:3010 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:3009 +#: ../../reference/datamodel.rst:3015 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -3381,7 +3386,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:3030 +#: ../../reference/datamodel.rst:3036 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3397,19 +3402,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:3051 +#: ../../reference/datamodel.rst:3057 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:3064 +#: ../../reference/datamodel.rst:3070 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:3071 +#: ../../reference/datamodel.rst:3077 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3418,14 +3423,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:3077 +#: ../../reference/datamodel.rst:3083 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:3089 +#: ../../reference/datamodel.rst:3095 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3434,21 +3439,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:3095 +#: ../../reference/datamodel.rst:3101 msgid "" "The built-in function :func:`int` falls back to :meth:`__trunc__` if " "neither :meth:`__int__` nor :meth:`__index__` is defined." msgstr "" -#: ../../reference/datamodel.rst:3098 +#: ../../reference/datamodel.rst:3104 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:3105 +#: ../../reference/datamodel.rst:3111 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3107 +#: ../../reference/datamodel.rst:3113 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -3458,32 +3463,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:3118 +#: ../../reference/datamodel.rst:3124 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:3121 +#: ../../reference/datamodel.rst:3127 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:3126 +#: ../../reference/datamodel.rst:3132 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:3133 +#: ../../reference/datamodel.rst:3139 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:3137 +#: ../../reference/datamodel.rst:3143 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -3491,27 +3496,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:3141 +#: ../../reference/datamodel.rst:3147 msgid "" "Note that :meth:`~object.__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:3148 +#: ../../reference/datamodel.rst:3154 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:3148 +#: ../../reference/datamodel.rst:3154 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3155 +#: ../../reference/datamodel.rst:3161 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:3157 +#: ../../reference/datamodel.rst:3163 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -3519,7 +3524,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:3164 +#: ../../reference/datamodel.rst:3170 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -3528,7 +3533,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:3170 +#: ../../reference/datamodel.rst:3176 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3538,19 +3543,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:3180 +#: ../../reference/datamodel.rst:3186 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:3181 +#: ../../reference/datamodel.rst:3187 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:3187 +#: ../../reference/datamodel.rst:3193 msgid "Emulating buffer types" msgstr "" -#: ../../reference/datamodel.rst:3189 +#: ../../reference/datamodel.rst:3195 msgid "" "The :ref:`buffer protocol ` provides a way for Python objects " "to expose efficient access to a low-level memory array. This protocol is " @@ -3558,13 +3563,13 @@ msgid "" "and third-party libraries may define additional buffer types." msgstr "" -#: ../../reference/datamodel.rst:3194 +#: ../../reference/datamodel.rst:3200 msgid "" "While buffer types are usually implemented in C, it is also possible to " "implement the protocol in Python." msgstr "" -#: ../../reference/datamodel.rst:3199 +#: ../../reference/datamodel.rst:3205 msgid "" "Called when a buffer is requested from *self* (for example, by the :class:" "`memoryview` constructor). The *flags* argument is an integer representing " @@ -3574,7 +3579,7 @@ msgid "" "`memoryview` object." msgstr "" -#: ../../reference/datamodel.rst:3208 +#: ../../reference/datamodel.rst:3214 msgid "" "Called when a buffer is no longer needed. The *buffer* argument is a :class:" "`memoryview` object that was previously returned by :meth:`~object." @@ -3583,28 +3588,28 @@ msgid "" "to perform any cleanup are not required to implement this method." msgstr "" -#: ../../reference/datamodel.rst:3220 +#: ../../reference/datamodel.rst:3226 msgid ":pep:`688` - Making the buffer protocol accessible in Python" msgstr "" -#: ../../reference/datamodel.rst:3220 +#: ../../reference/datamodel.rst:3226 msgid "" "Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3222 +#: ../../reference/datamodel.rst:3228 msgid ":class:`collections.abc.Buffer`" msgstr ":class:`collections.abc.Buffer`" -#: ../../reference/datamodel.rst:3223 +#: ../../reference/datamodel.rst:3229 msgid "ABC for buffer types." msgstr "" -#: ../../reference/datamodel.rst:3228 +#: ../../reference/datamodel.rst:3234 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:3230 +#: ../../reference/datamodel.rst:3236 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -3612,7 +3617,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:3245 +#: ../../reference/datamodel.rst:3251 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3621,21 +3626,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:3259 +#: ../../reference/datamodel.rst:3265 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:3268 +#: ../../reference/datamodel.rst:3274 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:3294 +#: ../../reference/datamodel.rst:3300 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3644,36 +3649,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:3305 +#: ../../reference/datamodel.rst:3311 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:3309 +#: ../../reference/datamodel.rst:3315 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:3311 +#: ../../reference/datamodel.rst:3317 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:3317 +#: ../../reference/datamodel.rst:3323 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:3323 +#: ../../reference/datamodel.rst:3329 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " "method to be compatible with the :keyword:`await` expression." msgstr "" -#: ../../reference/datamodel.rst:3329 +#: ../../reference/datamodel.rst:3335 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -3681,15 +3686,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:3337 +#: ../../reference/datamodel.rst:3343 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:3343 +#: ../../reference/datamodel.rst:3349 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:3345 +#: ../../reference/datamodel.rst:3351 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3700,18 +3705,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:3353 +#: ../../reference/datamodel.rst:3359 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:3357 +#: ../../reference/datamodel.rst:3363 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3363 +#: ../../reference/datamodel.rst:3369 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3722,7 +3727,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3374 +#: ../../reference/datamodel.rst:3380 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3733,13 +3738,13 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3385 +#: ../../reference/datamodel.rst:3391 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:3390 +#: ../../reference/datamodel.rst:3396 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3749,99 +3754,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3398 +#: ../../reference/datamodel.rst:3404 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3404 +#: ../../reference/datamodel.rst:3410 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3406 +#: ../../reference/datamodel.rst:3412 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3409 +#: ../../reference/datamodel.rst:3415 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3413 +#: ../../reference/datamodel.rst:3419 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3417 +#: ../../reference/datamodel.rst:3423 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3420 +#: ../../reference/datamodel.rst:3426 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3437 +#: ../../reference/datamodel.rst:3443 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3442 +#: ../../reference/datamodel.rst:3448 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3450 +#: ../../reference/datamodel.rst:3456 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3452 +#: ../../reference/datamodel.rst:3458 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3455 +#: ../../reference/datamodel.rst:3461 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3459 +#: ../../reference/datamodel.rst:3465 msgid "" "Semantically similar to :meth:`~object.__enter__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3464 +#: ../../reference/datamodel.rst:3470 msgid "" "Semantically similar to :meth:`~object.__exit__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3467 +#: ../../reference/datamodel.rst:3473 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3480 +#: ../../reference/datamodel.rst:3486 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3481 +#: ../../reference/datamodel.rst:3487 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3485 +#: ../../reference/datamodel.rst:3491 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3849,7 +3854,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3491 +#: ../../reference/datamodel.rst:3497 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns ``NotImplemented``. Do not set the method to ``None`` if you " @@ -3857,7 +3862,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3497 +#: ../../reference/datamodel.rst:3503 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method -- such as :meth:`~object.__add__` -- fails then the overall " @@ -3879,8 +3884,8 @@ msgstr "" #: ../../reference/datamodel.rst:856 ../../reference/datamodel.rst:938 #: ../../reference/datamodel.rst:1007 ../../reference/datamodel.rst:1034 #: ../../reference/datamodel.rst:1096 ../../reference/datamodel.rst:1200 -#: ../../reference/datamodel.rst:1301 ../../reference/datamodel.rst:1401 -#: ../../reference/datamodel.rst:1810 ../../reference/datamodel.rst:2825 +#: ../../reference/datamodel.rst:1307 ../../reference/datamodel.rst:1407 +#: ../../reference/datamodel.rst:1816 ../../reference/datamodel.rst:2831 msgid "object" msgstr "object(物件)" @@ -3891,13 +3896,13 @@ msgstr "data(資料)" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:292 #: ../../reference/datamodel.rst:336 ../../reference/datamodel.rst:420 #: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:799 -#: ../../reference/datamodel.rst:1053 ../../reference/datamodel.rst:1484 -#: ../../reference/datamodel.rst:1724 ../../reference/datamodel.rst:1729 -#: ../../reference/datamodel.rst:1810 ../../reference/datamodel.rst:2366 -#: ../../reference/datamodel.rst:2795 ../../reference/datamodel.rst:2953 -#: ../../reference/datamodel.rst:2988 ../../reference/datamodel.rst:3002 -#: ../../reference/datamodel.rst:3049 ../../reference/datamodel.rst:3059 -#: ../../reference/datamodel.rst:3087 +#: ../../reference/datamodel.rst:1053 ../../reference/datamodel.rst:1490 +#: ../../reference/datamodel.rst:1730 ../../reference/datamodel.rst:1735 +#: ../../reference/datamodel.rst:1816 ../../reference/datamodel.rst:2372 +#: ../../reference/datamodel.rst:2801 ../../reference/datamodel.rst:2959 +#: ../../reference/datamodel.rst:2994 ../../reference/datamodel.rst:3008 +#: ../../reference/datamodel.rst:3055 ../../reference/datamodel.rst:3065 +#: ../../reference/datamodel.rst:3093 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -3906,7 +3911,7 @@ msgid "id" msgstr "id" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:122 -#: ../../reference/datamodel.rst:2366 +#: ../../reference/datamodel.rst:2372 msgid "type" msgstr "type(型別)" @@ -4030,12 +4035,12 @@ msgstr "number(數字)" msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:3059 +#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:3065 msgid "complex" msgstr "complex(複數)" #: ../../reference/datamodel.rst:292 ../../reference/datamodel.rst:420 -#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2795 +#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2801 msgid "len" msgstr "len" @@ -4068,8 +4073,8 @@ msgstr "immutable sequence(不可變序列)" msgid "immutable" msgstr "immutable(不可變)" -#: ../../reference/datamodel.rst:332 ../../reference/datamodel.rst:1699 -#: ../../reference/datamodel.rst:1729 +#: ../../reference/datamodel.rst:332 ../../reference/datamodel.rst:1705 +#: ../../reference/datamodel.rst:1735 msgid "string" msgstr "string(字串)" @@ -4105,7 +4110,7 @@ msgstr "singleton(單例)" msgid "empty" msgstr "empty(空的)" -#: ../../reference/datamodel.rst:369 ../../reference/datamodel.rst:1724 +#: ../../reference/datamodel.rst:369 ../../reference/datamodel.rst:1730 msgid "bytes" msgstr "bytes(位元組)" @@ -4127,8 +4132,8 @@ msgid "assignment" msgstr "assignment(賦值)" #: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:856 -#: ../../reference/datamodel.rst:1438 ../../reference/datamodel.rst:1620 -#: ../../reference/datamodel.rst:3114 +#: ../../reference/datamodel.rst:1444 ../../reference/datamodel.rst:1626 +#: ../../reference/datamodel.rst:3120 msgid "statement" msgstr "statement(陳述式)" @@ -4165,7 +4170,7 @@ msgid "mapping" msgstr "mapping(對映)" #: ../../reference/datamodel.rst:476 ../../reference/datamodel.rst:938 -#: ../../reference/datamodel.rst:1810 +#: ../../reference/datamodel.rst:1816 msgid "dictionary" msgstr "dictionary(字典)" @@ -4188,7 +4193,7 @@ msgid "function" msgstr "function (函式)" #: ../../reference/datamodel.rst:512 ../../reference/datamodel.rst:938 -#: ../../reference/datamodel.rst:961 ../../reference/datamodel.rst:2747 +#: ../../reference/datamodel.rst:961 ../../reference/datamodel.rst:2753 msgid "call" msgstr "call(呼叫)" @@ -4296,7 +4301,7 @@ msgstr "generator(產生器)" msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:761 ../../reference/datamodel.rst:3301 +#: ../../reference/datamodel.rst:761 ../../reference/datamodel.rst:3307 msgid "coroutine" msgstr "coroutine(協程)" @@ -4341,8 +4346,8 @@ msgid "__dict__ (module attribute)" msgstr "__dict__ (模組屬性)" #: ../../reference/datamodel.rst:938 ../../reference/datamodel.rst:956 -#: ../../reference/datamodel.rst:1007 ../../reference/datamodel.rst:1603 -#: ../../reference/datamodel.rst:2477 +#: ../../reference/datamodel.rst:1007 ../../reference/datamodel.rst:1609 +#: ../../reference/datamodel.rst:2483 msgid "class" msgstr "class(類別)" @@ -4352,7 +4357,7 @@ msgid "class instance" msgstr "class instance(類別實例)" #: ../../reference/datamodel.rst:938 ../../reference/datamodel.rst:1007 -#: ../../reference/datamodel.rst:2747 +#: ../../reference/datamodel.rst:2753 msgid "instance" msgstr "instance(實例)" @@ -4532,287 +4537,287 @@ msgstr "co_qualname (程式碼物件屬性)" msgid "documentation string" msgstr "documentation string(文件字串)" -#: ../../reference/datamodel.rst:1301 +#: ../../reference/datamodel.rst:1307 msgid "frame" msgstr "frame" -#: ../../reference/datamodel.rst:1307 +#: ../../reference/datamodel.rst:1313 msgid "f_back (frame attribute)" msgstr "f_back (frame 屬性)" -#: ../../reference/datamodel.rst:1307 +#: ../../reference/datamodel.rst:1313 msgid "f_code (frame attribute)" msgstr "f_code (frame 屬性)" -#: ../../reference/datamodel.rst:1307 +#: ../../reference/datamodel.rst:1313 msgid "f_globals (frame attribute)" msgstr "f_globals (frame 屬性)" -#: ../../reference/datamodel.rst:1307 +#: ../../reference/datamodel.rst:1313 msgid "f_locals (frame attribute)" msgstr "f_locals (frame 屬性)" -#: ../../reference/datamodel.rst:1307 +#: ../../reference/datamodel.rst:1313 msgid "f_lasti (frame attribute)" msgstr "f_lasti (frame 屬性)" -#: ../../reference/datamodel.rst:1307 +#: ../../reference/datamodel.rst:1313 msgid "f_builtins (frame attribute)" msgstr "f_builtins (frame 屬性)" -#: ../../reference/datamodel.rst:1346 +#: ../../reference/datamodel.rst:1352 msgid "f_trace (frame attribute)" msgstr "f_trace (frame 屬性)" -#: ../../reference/datamodel.rst:1346 +#: ../../reference/datamodel.rst:1352 msgid "f_trace_lines (frame attribute)" msgstr "f_trace_lines (frame 屬性)" -#: ../../reference/datamodel.rst:1346 +#: ../../reference/datamodel.rst:1352 msgid "f_trace_opcodes (frame attribute)" msgstr "f_trace_opcodes (frame 屬性)" -#: ../../reference/datamodel.rst:1346 +#: ../../reference/datamodel.rst:1352 msgid "f_lineno (frame attribute)" msgstr "f_lineno (frame 屬性)" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1407 msgid "traceback" msgstr "traceback" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1407 msgid "stack" msgstr "stack(堆疊)" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1407 msgid "trace" msgstr "trace(追蹤)" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1407 msgid "exception" msgstr "exception(例外)" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1407 msgid "handler" msgstr "handler(處理器)" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1407 msgid "execution" msgstr "execution(執行)" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1407 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1407 msgid "last_traceback (in module sys)" msgstr "last_traceback (sys 模組中)" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1407 msgid "sys.exc_info" msgstr "sys.exc_info" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1407 msgid "sys.exception" msgstr "sys.exception" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1407 msgid "sys.last_traceback" msgstr "sys.last_traceback" -#: ../../reference/datamodel.rst:1438 +#: ../../reference/datamodel.rst:1444 msgid "tb_frame (traceback attribute)" msgstr "tb_frame (traceback 屬性)" -#: ../../reference/datamodel.rst:1438 +#: ../../reference/datamodel.rst:1444 msgid "tb_lineno (traceback attribute)" msgstr "tb_lineno (traceback 屬性)" -#: ../../reference/datamodel.rst:1438 +#: ../../reference/datamodel.rst:1444 msgid "tb_lasti (traceback attribute)" msgstr "tb_lasti (traceback 屬性)" -#: ../../reference/datamodel.rst:1438 +#: ../../reference/datamodel.rst:1444 msgid "try" msgstr "try" -#: ../../reference/datamodel.rst:1468 +#: ../../reference/datamodel.rst:1474 msgid "tb_next (traceback attribute)" msgstr "tb_next (traceback 屬性)" -#: ../../reference/datamodel.rst:1484 ../../reference/datamodel.rst:2825 +#: ../../reference/datamodel.rst:1490 ../../reference/datamodel.rst:2831 msgid "slice" msgstr "slice(切片)" -#: ../../reference/datamodel.rst:1490 +#: ../../reference/datamodel.rst:1496 msgid "start (slice object attribute)" msgstr "start (slice 物件屬性)" -#: ../../reference/datamodel.rst:1490 +#: ../../reference/datamodel.rst:1496 msgid "stop (slice object attribute)" msgstr "stop (slice 物件屬性)" -#: ../../reference/datamodel.rst:1490 +#: ../../reference/datamodel.rst:1496 msgid "step (slice object attribute)" msgstr "step (slice 物件屬性)" -#: ../../reference/datamodel.rst:1538 +#: ../../reference/datamodel.rst:1544 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/datamodel.rst:1538 +#: ../../reference/datamodel.rst:1544 msgid "overloading" msgstr "overloading(多載)" -#: ../../reference/datamodel.rst:1538 +#: ../../reference/datamodel.rst:1544 msgid "__getitem__() (mapping object method)" msgstr "__getitem__() (對映物件方法)" -#: ../../reference/datamodel.rst:1574 +#: ../../reference/datamodel.rst:1580 msgid "subclassing" msgstr "subclassing(子類別化)" -#: ../../reference/datamodel.rst:1574 +#: ../../reference/datamodel.rst:1580 msgid "immutable types" msgstr "immutable types(不可變型別)" -#: ../../reference/datamodel.rst:1603 +#: ../../reference/datamodel.rst:1609 msgid "constructor" msgstr "constructor(建構函式)" -#: ../../reference/datamodel.rst:1620 +#: ../../reference/datamodel.rst:1626 msgid "destructor" msgstr "destructor(解構函式)" -#: ../../reference/datamodel.rst:1620 +#: ../../reference/datamodel.rst:1626 msgid "finalizer" msgstr "finalizer(終結函式)" -#: ../../reference/datamodel.rst:1620 +#: ../../reference/datamodel.rst:1626 msgid "del" msgstr "del" -#: ../../reference/datamodel.rst:1682 +#: ../../reference/datamodel.rst:1688 msgid "repr() (built-in function)" msgstr "repr() (內建函式)" -#: ../../reference/datamodel.rst:1682 +#: ../../reference/datamodel.rst:1688 msgid "__repr__() (object method)" msgstr "__repr__() (物件方法)" -#: ../../reference/datamodel.rst:1699 +#: ../../reference/datamodel.rst:1705 msgid "__str__() (object method)" msgstr "__str__() (物件方法)" -#: ../../reference/datamodel.rst:1699 +#: ../../reference/datamodel.rst:1705 msgid "format() (built-in function)" msgstr "format() (內建函式)" -#: ../../reference/datamodel.rst:1699 +#: ../../reference/datamodel.rst:1705 msgid "print() (built-in function)" msgstr "print() (內建函式)" -#: ../../reference/datamodel.rst:1729 +#: ../../reference/datamodel.rst:1735 msgid "__format__() (object method)" msgstr "__format__() (物件方法)" -#: ../../reference/datamodel.rst:1729 +#: ../../reference/datamodel.rst:1735 msgid "conversion" msgstr "conversion" -#: ../../reference/datamodel.rst:1729 +#: ../../reference/datamodel.rst:1735 msgid "print" msgstr "print" -#: ../../reference/datamodel.rst:1768 +#: ../../reference/datamodel.rst:1774 msgid "comparisons" msgstr "comparison(比較)" -#: ../../reference/datamodel.rst:1810 +#: ../../reference/datamodel.rst:1816 msgid "hash" msgstr "hash(雜湊)" -#: ../../reference/datamodel.rst:1891 +#: ../../reference/datamodel.rst:1897 msgid "__len__() (mapping object method)" msgstr "__len__() (對映物件方法)" -#: ../../reference/datamodel.rst:1995 +#: ../../reference/datamodel.rst:2001 msgid "__getattr__ (module attribute)" msgstr "__getattr__ (模組屬性)" -#: ../../reference/datamodel.rst:1995 +#: ../../reference/datamodel.rst:2001 msgid "__dir__ (module attribute)" msgstr "__dir__ (模組屬性)" -#: ../../reference/datamodel.rst:1995 +#: ../../reference/datamodel.rst:2001 msgid "__class__ (module attribute)" msgstr "__class__ (模組屬性)" -#: ../../reference/datamodel.rst:2366 +#: ../../reference/datamodel.rst:2372 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../reference/datamodel.rst:2366 +#: ../../reference/datamodel.rst:2372 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/datamodel.rst:2366 +#: ../../reference/datamodel.rst:2372 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/datamodel.rst:2430 +#: ../../reference/datamodel.rst:2436 msgid "metaclass hint" msgstr "metaclass hint(元類別提示)" -#: ../../reference/datamodel.rst:2453 +#: ../../reference/datamodel.rst:2459 msgid "__prepare__ (metaclass method)" msgstr "__prepare__ (元類別方法)" -#: ../../reference/datamodel.rst:2477 +#: ../../reference/datamodel.rst:2483 msgid "body" msgstr "body" -#: ../../reference/datamodel.rst:2497 +#: ../../reference/datamodel.rst:2503 msgid "__class__ (method cell)" msgstr "__class__ (方法 cell)" -#: ../../reference/datamodel.rst:2497 +#: ../../reference/datamodel.rst:2503 msgid "__classcell__ (class namespace entry)" msgstr "__classcell__ (類別命名空間項目)" -#: ../../reference/datamodel.rst:2795 +#: ../../reference/datamodel.rst:2801 msgid "__bool__() (object method)" msgstr "__bool__() (物件方法)" -#: ../../reference/datamodel.rst:2953 ../../reference/datamodel.rst:2988 +#: ../../reference/datamodel.rst:2959 ../../reference/datamodel.rst:2994 msgid "divmod" msgstr "divmod" -#: ../../reference/datamodel.rst:2953 ../../reference/datamodel.rst:2988 -#: ../../reference/datamodel.rst:3002 +#: ../../reference/datamodel.rst:2959 ../../reference/datamodel.rst:2994 +#: ../../reference/datamodel.rst:3008 msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:3049 +#: ../../reference/datamodel.rst:3055 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:3059 +#: ../../reference/datamodel.rst:3065 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:3059 +#: ../../reference/datamodel.rst:3065 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:3087 +#: ../../reference/datamodel.rst:3093 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:3114 +#: ../../reference/datamodel.rst:3120 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:3114 +#: ../../reference/datamodel.rst:3120 msgid "context manager" msgstr "context manager(情境管理器)" From b86551f15195e36e7de6d59b770ba4f2676ce3ac Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 19 Feb 2024 11:11:09 +0000 Subject: [PATCH 13/33] sync with cpython 8a5731e7 --- library/struct.po | 324 ++++++++++++++++++++++++---------------------- 1 file changed, 171 insertions(+), 153 deletions(-) diff --git a/library/struct.po b/library/struct.po index 3ca23ad674..022bb78e79 100644 --- a/library/struct.po +++ b/library/struct.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2024-02-19 11:09+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -225,7 +225,25 @@ msgstr "" msgid "If the first character is not one of these, ``'@'`` is assumed." msgstr "" -#: ../../library/struct.rst:159 +#: ../../library/struct.rst:161 +msgid "" +"The number 1023 (``0x3ff`` in hexadecimal) has the following byte " +"representations:" +msgstr "" + +#: ../../library/struct.rst:163 +msgid "``03 ff`` in big-endian (``>``)" +msgstr "" + +#: ../../library/struct.rst:164 +msgid "``ff 03`` in little-endian (``<``)" +msgstr "" + +#: ../../library/struct.rst:166 +msgid "Python example:" +msgstr "" + +#: ../../library/struct.rst:174 msgid "" "Native byte order is big-endian or little-endian, depending on the host " "system. For example, Intel x86, AMD64 (x86-64), and Apple M1 are little-" @@ -233,64 +251,64 @@ msgid "" "byteorder` to check the endianness of your system." msgstr "" -#: ../../library/struct.rst:164 +#: ../../library/struct.rst:179 msgid "" "Native size and alignment are determined using the C compiler's ``sizeof`` " "expression. This is always combined with native byte order." msgstr "" -#: ../../library/struct.rst:167 +#: ../../library/struct.rst:182 msgid "" "Standard size depends only on the format character; see the table in the :" "ref:`format-characters` section." msgstr "" -#: ../../library/struct.rst:170 +#: ../../library/struct.rst:185 msgid "" "Note the difference between ``'@'`` and ``'='``: both use native byte order, " "but the size and alignment of the latter is standardized." msgstr "" -#: ../../library/struct.rst:173 +#: ../../library/struct.rst:188 msgid "" "The form ``'!'`` represents the network byte order which is always big-" "endian as defined in `IETF RFC 1700 `_." msgstr "" -#: ../../library/struct.rst:176 +#: ../../library/struct.rst:191 msgid "" "There is no way to indicate non-native byte order (force byte-swapping); use " "the appropriate choice of ``'<'`` or ``'>'``." msgstr "" -#: ../../library/struct.rst:179 ../../library/struct.rst:258 +#: ../../library/struct.rst:194 ../../library/struct.rst:273 msgid "Notes:" msgstr "註解:" -#: ../../library/struct.rst:181 +#: ../../library/struct.rst:196 msgid "" "Padding is only automatically added between successive structure members. No " "padding is added at the beginning or the end of the encoded struct." msgstr "" -#: ../../library/struct.rst:184 +#: ../../library/struct.rst:199 msgid "" "No padding is added when using non-native size and alignment, e.g. with '<', " "'>', '=', and '!'." msgstr "" -#: ../../library/struct.rst:187 +#: ../../library/struct.rst:202 msgid "" "To align the end of a structure to the alignment requirement of a particular " "type, end the format with the code for that type with a repeat count of " "zero. See :ref:`struct-examples`." msgstr "" -#: ../../library/struct.rst:195 +#: ../../library/struct.rst:210 msgid "Format Characters" msgstr "" -#: ../../library/struct.rst:197 +#: ../../library/struct.rst:212 msgid "" "Format characters have the following meaning; the conversion between C and " "Python values should be obvious given their types. The 'Standard size' " @@ -300,310 +318,310 @@ msgid "" "platform-dependent." msgstr "" -#: ../../library/struct.rst:205 +#: ../../library/struct.rst:220 msgid "Format" msgstr "" -#: ../../library/struct.rst:205 +#: ../../library/struct.rst:220 msgid "C Type" msgstr "C Type" -#: ../../library/struct.rst:205 +#: ../../library/struct.rst:220 msgid "Python type" msgstr "" -#: ../../library/struct.rst:205 +#: ../../library/struct.rst:220 msgid "Standard size" msgstr "" -#: ../../library/struct.rst:205 +#: ../../library/struct.rst:220 msgid "Notes" msgstr "註解" -#: ../../library/struct.rst:207 +#: ../../library/struct.rst:222 msgid "``x``" msgstr "``x``" -#: ../../library/struct.rst:207 +#: ../../library/struct.rst:222 msgid "pad byte" msgstr "" -#: ../../library/struct.rst:207 +#: ../../library/struct.rst:222 msgid "no value" msgstr "" -#: ../../library/struct.rst:207 +#: ../../library/struct.rst:222 msgid "\\(7)" msgstr "" -#: ../../library/struct.rst:209 +#: ../../library/struct.rst:224 msgid "``c``" msgstr "``c``" -#: ../../library/struct.rst:209 +#: ../../library/struct.rst:224 msgid ":c:expr:`char`" msgstr ":c:expr:`char`" -#: ../../library/struct.rst:209 +#: ../../library/struct.rst:224 msgid "bytes of length 1" msgstr "" -#: ../../library/struct.rst:209 ../../library/struct.rst:211 -#: ../../library/struct.rst:213 ../../library/struct.rst:215 +#: ../../library/struct.rst:224 ../../library/struct.rst:226 +#: ../../library/struct.rst:228 ../../library/struct.rst:230 msgid "1" msgstr "1" -#: ../../library/struct.rst:211 +#: ../../library/struct.rst:226 msgid "``b``" msgstr "``b``" -#: ../../library/struct.rst:211 +#: ../../library/struct.rst:226 msgid ":c:expr:`signed char`" msgstr ":c:expr:`signed char`" -#: ../../library/struct.rst:211 ../../library/struct.rst:213 -#: ../../library/struct.rst:217 ../../library/struct.rst:219 -#: ../../library/struct.rst:221 ../../library/struct.rst:223 -#: ../../library/struct.rst:225 ../../library/struct.rst:227 -#: ../../library/struct.rst:229 ../../library/struct.rst:231 -#: ../../library/struct.rst:234 ../../library/struct.rst:236 -#: ../../library/struct.rst:248 +#: ../../library/struct.rst:226 ../../library/struct.rst:228 +#: ../../library/struct.rst:232 ../../library/struct.rst:234 +#: ../../library/struct.rst:236 ../../library/struct.rst:238 +#: ../../library/struct.rst:240 ../../library/struct.rst:242 +#: ../../library/struct.rst:244 ../../library/struct.rst:246 +#: ../../library/struct.rst:249 ../../library/struct.rst:251 +#: ../../library/struct.rst:263 msgid "integer" msgstr "" -#: ../../library/struct.rst:211 +#: ../../library/struct.rst:226 msgid "\\(1), \\(2)" msgstr "\\(1), \\(2)" -#: ../../library/struct.rst:213 +#: ../../library/struct.rst:228 msgid "``B``" msgstr "``B``" -#: ../../library/struct.rst:213 +#: ../../library/struct.rst:228 msgid ":c:expr:`unsigned char`" msgstr ":c:expr:`unsigned char`" -#: ../../library/struct.rst:213 ../../library/struct.rst:217 -#: ../../library/struct.rst:219 ../../library/struct.rst:221 -#: ../../library/struct.rst:223 ../../library/struct.rst:225 -#: ../../library/struct.rst:227 ../../library/struct.rst:229 -#: ../../library/struct.rst:231 +#: ../../library/struct.rst:228 ../../library/struct.rst:232 +#: ../../library/struct.rst:234 ../../library/struct.rst:236 +#: ../../library/struct.rst:238 ../../library/struct.rst:240 +#: ../../library/struct.rst:242 ../../library/struct.rst:244 +#: ../../library/struct.rst:246 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/struct.rst:215 +#: ../../library/struct.rst:230 msgid "``?``" msgstr "``?``" -#: ../../library/struct.rst:215 +#: ../../library/struct.rst:230 msgid ":c:expr:`_Bool`" msgstr ":c:expr:`_Bool`" -#: ../../library/struct.rst:215 +#: ../../library/struct.rst:230 msgid "bool" msgstr "bool" -#: ../../library/struct.rst:215 +#: ../../library/struct.rst:230 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/struct.rst:217 +#: ../../library/struct.rst:232 msgid "``h``" msgstr "``h``" -#: ../../library/struct.rst:217 +#: ../../library/struct.rst:232 msgid ":c:expr:`short`" msgstr ":c:expr:`short`" -#: ../../library/struct.rst:217 ../../library/struct.rst:219 -#: ../../library/struct.rst:238 +#: ../../library/struct.rst:232 ../../library/struct.rst:234 +#: ../../library/struct.rst:253 msgid "2" msgstr "2" -#: ../../library/struct.rst:219 +#: ../../library/struct.rst:234 msgid "``H``" msgstr "``H``" -#: ../../library/struct.rst:219 +#: ../../library/struct.rst:234 msgid ":c:expr:`unsigned short`" msgstr ":c:expr:`unsigned short`" -#: ../../library/struct.rst:221 +#: ../../library/struct.rst:236 msgid "``i``" msgstr "``i``" -#: ../../library/struct.rst:221 +#: ../../library/struct.rst:236 msgid ":c:expr:`int`" msgstr ":c:expr:`int`" -#: ../../library/struct.rst:221 ../../library/struct.rst:223 -#: ../../library/struct.rst:225 ../../library/struct.rst:227 -#: ../../library/struct.rst:240 +#: ../../library/struct.rst:236 ../../library/struct.rst:238 +#: ../../library/struct.rst:240 ../../library/struct.rst:242 +#: ../../library/struct.rst:255 msgid "4" msgstr "4" -#: ../../library/struct.rst:223 +#: ../../library/struct.rst:238 msgid "``I``" msgstr "``I``" -#: ../../library/struct.rst:223 +#: ../../library/struct.rst:238 msgid ":c:expr:`unsigned int`" msgstr ":c:expr:`unsigned int`" -#: ../../library/struct.rst:225 +#: ../../library/struct.rst:240 msgid "``l``" msgstr "``l``" -#: ../../library/struct.rst:225 +#: ../../library/struct.rst:240 msgid ":c:expr:`long`" msgstr ":c:expr:`long`" -#: ../../library/struct.rst:227 +#: ../../library/struct.rst:242 msgid "``L``" msgstr "``L``" -#: ../../library/struct.rst:227 +#: ../../library/struct.rst:242 msgid ":c:expr:`unsigned long`" msgstr ":c:expr:`unsigned long`" -#: ../../library/struct.rst:229 +#: ../../library/struct.rst:244 msgid "``q``" msgstr "``q``" -#: ../../library/struct.rst:229 +#: ../../library/struct.rst:244 msgid ":c:expr:`long long`" msgstr ":c:expr:`long long`" -#: ../../library/struct.rst:229 ../../library/struct.rst:231 -#: ../../library/struct.rst:242 +#: ../../library/struct.rst:244 ../../library/struct.rst:246 +#: ../../library/struct.rst:257 msgid "8" msgstr "8" -#: ../../library/struct.rst:231 +#: ../../library/struct.rst:246 msgid "``Q``" msgstr "``Q``" -#: ../../library/struct.rst:231 +#: ../../library/struct.rst:246 msgid ":c:expr:`unsigned long long`" msgstr ":c:expr:`unsigned long long`" -#: ../../library/struct.rst:234 +#: ../../library/struct.rst:249 msgid "``n``" msgstr "``n``" -#: ../../library/struct.rst:234 +#: ../../library/struct.rst:249 msgid ":c:type:`ssize_t`" msgstr ":c:type:`ssize_t`" -#: ../../library/struct.rst:234 ../../library/struct.rst:236 +#: ../../library/struct.rst:249 ../../library/struct.rst:251 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/struct.rst:236 +#: ../../library/struct.rst:251 msgid "``N``" msgstr "``N``" -#: ../../library/struct.rst:236 +#: ../../library/struct.rst:251 msgid ":c:type:`size_t`" msgstr ":c:type:`size_t`" -#: ../../library/struct.rst:238 +#: ../../library/struct.rst:253 msgid "``e``" msgstr "``e``" -#: ../../library/struct.rst:238 +#: ../../library/struct.rst:253 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/struct.rst:238 ../../library/struct.rst:240 -#: ../../library/struct.rst:242 +#: ../../library/struct.rst:253 ../../library/struct.rst:255 +#: ../../library/struct.rst:257 msgid "float" msgstr "float" -#: ../../library/struct.rst:238 ../../library/struct.rst:240 -#: ../../library/struct.rst:242 +#: ../../library/struct.rst:253 ../../library/struct.rst:255 +#: ../../library/struct.rst:257 msgid "\\(4)" msgstr "\\(4)" -#: ../../library/struct.rst:240 +#: ../../library/struct.rst:255 msgid "``f``" msgstr "``f``" -#: ../../library/struct.rst:240 +#: ../../library/struct.rst:255 msgid ":c:expr:`float`" msgstr ":c:expr:`float`" -#: ../../library/struct.rst:242 +#: ../../library/struct.rst:257 msgid "``d``" msgstr "``d``" -#: ../../library/struct.rst:242 +#: ../../library/struct.rst:257 msgid ":c:expr:`double`" msgstr ":c:expr:`double`" -#: ../../library/struct.rst:244 +#: ../../library/struct.rst:259 msgid "``s``" msgstr "``s``" -#: ../../library/struct.rst:244 ../../library/struct.rst:246 +#: ../../library/struct.rst:259 ../../library/struct.rst:261 msgid ":c:expr:`char[]`" msgstr ":c:expr:`char[]`" -#: ../../library/struct.rst:244 ../../library/struct.rst:246 +#: ../../library/struct.rst:259 ../../library/struct.rst:261 msgid "bytes" msgstr "" -#: ../../library/struct.rst:244 +#: ../../library/struct.rst:259 msgid "\\(9)" msgstr "\\(9)" -#: ../../library/struct.rst:246 +#: ../../library/struct.rst:261 msgid "``p``" msgstr "``p``" -#: ../../library/struct.rst:246 +#: ../../library/struct.rst:261 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/struct.rst:248 +#: ../../library/struct.rst:263 msgid "``P``" msgstr "``P``" -#: ../../library/struct.rst:248 +#: ../../library/struct.rst:263 msgid ":c:expr:`void \\*`" msgstr ":c:expr:`void \\*`" -#: ../../library/struct.rst:248 +#: ../../library/struct.rst:263 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/struct.rst:251 +#: ../../library/struct.rst:266 msgid "Added support for the ``'n'`` and ``'N'`` formats." msgstr "新增 ``'n'`` 與 ``'N'`` 格式的支援。" -#: ../../library/struct.rst:254 +#: ../../library/struct.rst:269 msgid "Added support for the ``'e'`` format." msgstr "新增 ``'e'`` 格式的支援。" -#: ../../library/struct.rst:263 +#: ../../library/struct.rst:278 msgid "" "The ``'?'`` conversion code corresponds to the :c:expr:`_Bool` type defined " "by C99. If this type is not available, it is simulated using a :c:expr:" "`char`. In standard mode, it is always represented by one byte." msgstr "" -#: ../../library/struct.rst:268 +#: ../../library/struct.rst:283 msgid "" "When attempting to pack a non-integer using any of the integer conversion " "codes, if the non-integer has a :meth:`~object.__index__` method then that " "method is called to convert the argument to an integer before packing." msgstr "" -#: ../../library/struct.rst:272 +#: ../../library/struct.rst:287 msgid "Added use of the :meth:`~object.__index__` method for non-integers." msgstr "" -#: ../../library/struct.rst:276 +#: ../../library/struct.rst:291 msgid "" "The ``'n'`` and ``'N'`` conversion codes are only available for the native " "size (selected as the default or with the ``'@'`` byte order character). For " @@ -611,7 +629,7 @@ msgid "" "your application." msgstr "" -#: ../../library/struct.rst:282 +#: ../../library/struct.rst:297 msgid "" "For the ``'f'``, ``'d'`` and ``'e'`` conversion codes, the packed " "representation uses the IEEE 754 binary32, binary64 or binary16 format (for " @@ -619,7 +637,7 @@ msgid "" "format used by the platform." msgstr "" -#: ../../library/struct.rst:288 +#: ../../library/struct.rst:303 msgid "" "The ``'P'`` format character is only available for the native byte ordering " "(selected as the default or with the ``'@'`` byte order character). The byte " @@ -628,7 +646,7 @@ msgid "" "ordering, so the ``'P'`` format is not available." msgstr "" -#: ../../library/struct.rst:295 +#: ../../library/struct.rst:310 msgid "" "The IEEE 754 binary16 \"half precision\" type was introduced in the 2008 " "revision of the `IEEE 754 standard `_. It has a sign " @@ -640,11 +658,11 @@ msgid "" "format `_ for more information." msgstr "" -#: ../../library/struct.rst:305 +#: ../../library/struct.rst:320 msgid "When packing, ``'x'`` inserts one NUL byte." msgstr "" -#: ../../library/struct.rst:308 +#: ../../library/struct.rst:323 msgid "" "The ``'p'`` format character encodes a \"Pascal string\", meaning a short " "variable-length string stored in a *fixed number of bytes*, given by the " @@ -658,7 +676,7 @@ msgid "" "more than 255 bytes." msgstr "" -#: ../../library/struct.rst:320 +#: ../../library/struct.rst:335 msgid "" "For the ``'s'`` format character, the count is interpreted as the length of " "the bytes, not a repeat count like for the other format characters; for " @@ -673,19 +691,19 @@ msgid "" "(while ``'0c'`` means 0 characters)." msgstr "" -#: ../../library/struct.rst:333 +#: ../../library/struct.rst:348 msgid "" "A format character may be preceded by an integral repeat count. For " "example, the format string ``'4h'`` means exactly the same as ``'hhhh'``." msgstr "" -#: ../../library/struct.rst:336 +#: ../../library/struct.rst:351 msgid "" "Whitespace characters between formats are ignored; a count and its format " "must not contain whitespace though." msgstr "" -#: ../../library/struct.rst:339 +#: ../../library/struct.rst:354 msgid "" "When packing a value ``x`` using one of the integer formats (``'b'``, " "``'B'``, ``'h'``, ``'H'``, ``'i'``, ``'I'``, ``'l'``, ``'L'``, ``'q'``, " @@ -693,13 +711,13 @@ msgid "" "`struct.error` is raised." msgstr "" -#: ../../library/struct.rst:344 +#: ../../library/struct.rst:359 msgid "" "Previously, some of the integer formats wrapped out-of-range values and " "raised :exc:`DeprecationWarning` instead of :exc:`struct.error`." msgstr "" -#: ../../library/struct.rst:350 +#: ../../library/struct.rst:365 msgid "" "For the ``'?'`` format character, the return value is either :const:`True` " "or :const:`False`. When packing, the truth value of the argument object is " @@ -707,39 +725,39 @@ msgid "" "packed, and any non-zero value will be ``True`` when unpacking." msgstr "" -#: ../../library/struct.rst:360 +#: ../../library/struct.rst:375 msgid "Examples" msgstr "範例" -#: ../../library/struct.rst:363 +#: ../../library/struct.rst:378 msgid "" "Native byte order examples (designated by the ``'@'`` format prefix or lack " "of any prefix character) may not match what the reader's machine produces as " "that depends on the platform and compiler." msgstr "" -#: ../../library/struct.rst:368 +#: ../../library/struct.rst:383 msgid "" "Pack and unpack integers of three different sizes, using big endian " "ordering::" msgstr "" -#: ../../library/struct.rst:379 +#: ../../library/struct.rst:394 msgid "Attempt to pack an integer which is too large for the defined field::" msgstr "" -#: ../../library/struct.rst:386 +#: ../../library/struct.rst:401 msgid "" "Demonstrate the difference between ``'s'`` and ``'c'`` format characters::" msgstr "" -#: ../../library/struct.rst:394 +#: ../../library/struct.rst:409 msgid "" "Unpacked fields can be named by assigning them to variables or by wrapping " "the result in a named tuple::" msgstr "" -#: ../../library/struct.rst:405 +#: ../../library/struct.rst:420 msgid "" "The ordering of format characters may have an impact on size in native mode " "since padding is implicit. In standard mode, the user is responsible for " @@ -749,41 +767,41 @@ msgid "" "a little endian machine::" msgstr "" -#: ../../library/struct.rst:422 +#: ../../library/struct.rst:437 msgid "" "The following format ``'llh0l'`` results in two pad bytes being added at the " "end, assuming the platform's longs are aligned on 4-byte boundaries::" msgstr "" -#: ../../library/struct.rst:432 +#: ../../library/struct.rst:447 msgid "Module :mod:`array`" msgstr ":mod:`array` 模組" -#: ../../library/struct.rst:432 +#: ../../library/struct.rst:447 msgid "Packed binary storage of homogeneous data." msgstr "" -#: ../../library/struct.rst:435 +#: ../../library/struct.rst:450 msgid "Module :mod:`json`" msgstr ":mod:`json` 模組" -#: ../../library/struct.rst:435 +#: ../../library/struct.rst:450 msgid "JSON encoder and decoder." msgstr "" -#: ../../library/struct.rst:437 +#: ../../library/struct.rst:452 msgid "Module :mod:`pickle`" msgstr ":mod:`pickle` 模組" -#: ../../library/struct.rst:438 +#: ../../library/struct.rst:453 msgid "Python object serialization." msgstr "" -#: ../../library/struct.rst:444 +#: ../../library/struct.rst:459 msgid "Applications" msgstr "" -#: ../../library/struct.rst:446 +#: ../../library/struct.rst:461 msgid "" "Two main applications for the :mod:`struct` module exist, data interchange " "between Python and C code within an application or another application " @@ -793,11 +811,11 @@ msgid "" "speaking, the format strings constructed for these two domains are distinct." msgstr "" -#: ../../library/struct.rst:457 +#: ../../library/struct.rst:472 msgid "Native Formats" msgstr "" -#: ../../library/struct.rst:459 +#: ../../library/struct.rst:474 msgid "" "When constructing format strings which mimic native layouts, the compiler " "and machine architecture determine byte ordering and padding. In such cases, " @@ -808,35 +826,35 @@ msgid "" "of consecutive chunks of data." msgstr "" -#: ../../library/struct.rst:467 +#: ../../library/struct.rst:482 msgid "" "Consider these two simple examples (on a 64-bit, little-endian machine)::" msgstr "" -#: ../../library/struct.rst:475 +#: ../../library/struct.rst:490 msgid "" "Data is not padded to an 8-byte boundary at the end of the second format " "string without the use of extra padding. A zero-repeat format code solves " "that problem::" msgstr "" -#: ../../library/struct.rst:482 +#: ../../library/struct.rst:497 msgid "" "The ``'x'`` format code can be used to specify the repeat, but for native " "formats it is better to use a zero-repeat format like ``'0l'``." msgstr "" -#: ../../library/struct.rst:485 +#: ../../library/struct.rst:500 msgid "" "By default, native byte ordering and alignment is used, but it is better to " "be explicit and use the ``'@'`` prefix character." msgstr "" -#: ../../library/struct.rst:492 +#: ../../library/struct.rst:507 msgid "Standard Formats" msgstr "" -#: ../../library/struct.rst:494 +#: ../../library/struct.rst:509 msgid "" "When exchanging data beyond your process such as networking or storage, be " "precise. Specify the exact byte order, size, and alignment. Do not assume " @@ -850,22 +868,22 @@ msgid "" "from the previous section, we have::" msgstr "" -#: ../../library/struct.rst:521 +#: ../../library/struct.rst:536 msgid "" "The above results (executed on a 64-bit machine) aren't guaranteed to match " "when executed on different machines. For example, the examples below were " "executed on a 32-bit machine::" msgstr "" -#: ../../library/struct.rst:536 +#: ../../library/struct.rst:551 msgid "Classes" msgstr "" -#: ../../library/struct.rst:538 +#: ../../library/struct.rst:553 msgid "The :mod:`struct` module also defines the following type:" msgstr "" -#: ../../library/struct.rst:543 +#: ../../library/struct.rst:558 msgid "" "Return a new Struct object which writes and reads binary data according to " "the format string *format*. Creating a ``Struct`` object once and calling " @@ -873,55 +891,55 @@ msgid "" "same format since the format string is only compiled once." msgstr "" -#: ../../library/struct.rst:550 +#: ../../library/struct.rst:565 msgid "" "The compiled versions of the most recent format strings passed to the module-" "level functions are cached, so programs that use only a few format strings " "needn't worry about reusing a single :class:`Struct` instance." msgstr "" -#: ../../library/struct.rst:555 +#: ../../library/struct.rst:570 msgid "Compiled Struct objects support the following methods and attributes:" msgstr "" -#: ../../library/struct.rst:559 +#: ../../library/struct.rst:574 msgid "" "Identical to the :func:`pack` function, using the compiled format. " "(``len(result)`` will equal :attr:`size`.)" msgstr "" -#: ../../library/struct.rst:565 +#: ../../library/struct.rst:580 msgid "Identical to the :func:`pack_into` function, using the compiled format." msgstr "" -#: ../../library/struct.rst:570 +#: ../../library/struct.rst:585 msgid "" "Identical to the :func:`unpack` function, using the compiled format. The " "buffer's size in bytes must equal :attr:`size`." msgstr "" -#: ../../library/struct.rst:576 +#: ../../library/struct.rst:591 msgid "" "Identical to the :func:`unpack_from` function, using the compiled format. " "The buffer's size in bytes, starting at position *offset*, must be at least :" "attr:`size`." msgstr "" -#: ../../library/struct.rst:583 +#: ../../library/struct.rst:598 msgid "" "Identical to the :func:`iter_unpack` function, using the compiled format. " "The buffer's size in bytes must be a multiple of :attr:`size`." msgstr "" -#: ../../library/struct.rst:590 +#: ../../library/struct.rst:605 msgid "The format string used to construct this Struct object." msgstr "" -#: ../../library/struct.rst:592 +#: ../../library/struct.rst:607 msgid "The format string type is now :class:`str` instead of :class:`bytes`." msgstr "" -#: ../../library/struct.rst:597 +#: ../../library/struct.rst:612 msgid "" "The calculated size of the struct (and hence of the bytes object produced by " "the :meth:`pack` method) corresponding to :attr:`format`." @@ -951,8 +969,8 @@ msgstr "data(資料)" msgid "@ (at)" msgstr "@ (在)" -#: ../../library/struct.rst:132 ../../library/struct.rst:261 -#: ../../library/struct.rst:348 +#: ../../library/struct.rst:132 ../../library/struct.rst:276 +#: ../../library/struct.rst:363 msgid "in struct format strings" msgstr "於 struct format strings(結構格式字串)" @@ -972,6 +990,6 @@ msgstr "> (大於)" msgid "! (exclamation)" msgstr "! (驚嘆號)" -#: ../../library/struct.rst:261 ../../library/struct.rst:348 +#: ../../library/struct.rst:276 ../../library/struct.rst:363 msgid "? (question mark)" msgstr "? (問號)" From b41b564f1aef96e2433e64aba7eb28ca9d9ba134 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 19 Feb 2024 19:56:43 +0000 Subject: [PATCH 14/33] sync with cpython db145c72 --- library/codecs.po | 10 +- library/math.po | 6 +- library/multiprocessing.po | 701 +++++++++++++++--------------- library/shutil.po | 10 +- library/sys.po | 865 +++++++++++++++++++------------------ library/venv.po | 22 +- 6 files changed, 809 insertions(+), 805 deletions(-) diff --git a/library/codecs.po b/library/codecs.po index 2ff557ff55..888f41ce92 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-21 00:03+0000\n" +"POT-Creation-Date: 2024-02-19 19:55+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-" @@ -2661,15 +2661,15 @@ msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" #: ../../library/codecs.rst:1545 -msgid "Support any error handler." -msgstr "" - -#: ../../library/codecs.rst:1548 msgid "" "Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used " "to encode, and ``'ignore'`` to decode." msgstr "" +#: ../../library/codecs.rst:1549 +msgid "Support any error handler." +msgstr "" + #: ../../library/codecs.rst:1554 msgid ":mod:`encodings.utf_8_sig` --- UTF-8 codec with BOM signature" msgstr "" diff --git a/library/math.po b/library/math.po index 93e0cc4928..2bb4ee4385 100644 --- a/library/math.po +++ b/library/math.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2024-02-19 19:55+0000\n" "PO-Revision-Date: 2024-02-05 16:30+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -326,7 +326,7 @@ msgstr "" msgid "See also :func:`math.ulp`." msgstr "另請參閱 :func:`math.ulp`。" -#: ../../library/math.rst:242 +#: ../../library/math.rst:244 msgid "Added the *steps* argument." msgstr "新增 *steps* 引數。" @@ -765,7 +765,7 @@ msgid "" "NaNs instead of ``is`` or ``==``. Example:" msgstr "" -#: ../../library/math.rst:683 +#: ../../library/math.rst:685 msgid "It is now always available." msgstr "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index f9dc7a6263..3049265a60 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-13 00:03+0000\n" +"POT-Creation-Date: 2024-02-19 19:55+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -185,20 +185,20 @@ msgid "" "Unix pipes such as Linux." msgstr "" -#: ../../library/multiprocessing.rst:155 -msgid "" -"On macOS, the *spawn* start method is now the default. The *fork* start " -"method should be considered unsafe as it can lead to crashes of the " -"subprocess as macOS system libraries may start threads. See :issue:`33725`." -msgstr "" - -#: ../../library/multiprocessing.rst:159 +#: ../../library/multiprocessing.rst:153 msgid "" "*spawn* added on all POSIX platforms, and *forkserver* added for some POSIX " "platforms. Child processes no longer inherit all of the parents inheritable " "handles on Windows." msgstr "" +#: ../../library/multiprocessing.rst:161 +msgid "" +"On macOS, the *spawn* start method is now the default. The *fork* start " +"method should be considered unsafe as it can lead to crashes of the " +"subprocess as macOS system libraries may start threads. See :issue:`33725`." +msgstr "" + #: ../../library/multiprocessing.rst:165 msgid "" "On POSIX using the *spawn* or *forkserver* start methods will also start a " @@ -479,7 +479,8 @@ msgid "" msgstr "" #: ../../library/multiprocessing.rst:521 -msgid "Added the *daemon* argument." +#, fuzzy +msgid "Added the *daemon* parameter." msgstr "新增 *daemon* 引數。" #: ../../library/multiprocessing.rst:526 @@ -1173,7 +1174,7 @@ msgid "" "``None``. See :ref:`multiprocessing-start-methods`." msgstr "" -#: ../../library/multiprocessing.rst:1082 +#: ../../library/multiprocessing.rst:1084 msgid "" "On macOS, the *spawn* start method is now the default. The *fork* start " "method should be considered unsafe as it can lead to crashes of the " @@ -1374,23 +1375,23 @@ msgstr "" #: ../../library/multiprocessing.rst:1241 msgid "" -"Connection objects now support the context management protocol -- see :ref:" -"`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " +"Connection objects also now support the context management protocol -- see :" +"ref:`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "connection object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:1246 +#: ../../library/multiprocessing.rst:1245 msgid "For example:" msgstr "" -#: ../../library/multiprocessing.rst:1271 +#: ../../library/multiprocessing.rst:1270 msgid "" "The :meth:`Connection.recv` method automatically unpickles the data it " "receives, which can be a security risk unless you can trust the process " "which sent the message." msgstr "" -#: ../../library/multiprocessing.rst:1275 +#: ../../library/multiprocessing.rst:1274 msgid "" "Therefore, unless the connection object was produced using :func:`Pipe` you " "should only use the :meth:`~Connection.recv` and :meth:`~Connection.send` " @@ -1398,73 +1399,73 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:1282 +#: ../../library/multiprocessing.rst:1281 msgid "" "If a process is killed while it is trying to read or write to a pipe then " "the data in the pipe is likely to become corrupted, because it may become " "impossible to be sure where the message boundaries lie." msgstr "" -#: ../../library/multiprocessing.rst:1288 +#: ../../library/multiprocessing.rst:1287 msgid "Synchronization primitives" msgstr "" -#: ../../library/multiprocessing.rst:1292 +#: ../../library/multiprocessing.rst:1291 msgid "" "Generally synchronization primitives are not as necessary in a multiprocess " "program as they are in a multithreaded program. See the documentation for :" "mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:1296 +#: ../../library/multiprocessing.rst:1295 msgid "" "Note that one can also create synchronization primitives by using a manager " "object -- see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:1301 +#: ../../library/multiprocessing.rst:1300 msgid "A barrier object: a clone of :class:`threading.Barrier`." msgstr "" -#: ../../library/multiprocessing.rst:1307 +#: ../../library/multiprocessing.rst:1306 msgid "" "A bounded semaphore object: a close analog of :class:`threading." "BoundedSemaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1310 -#: ../../library/multiprocessing.rst:1448 +#: ../../library/multiprocessing.rst:1309 +#: ../../library/multiprocessing.rst:1447 msgid "" "A solitary difference from its close analog exists: its ``acquire`` method's " "first argument is named *block*, as is consistent with :meth:`Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1314 +#: ../../library/multiprocessing.rst:1313 msgid "" "On macOS, this is indistinguishable from :class:`Semaphore` because " "``sem_getvalue()`` is not implemented on that platform." msgstr "" -#: ../../library/multiprocessing.rst:1319 +#: ../../library/multiprocessing.rst:1318 msgid "A condition variable: an alias for :class:`threading.Condition`." msgstr "" -#: ../../library/multiprocessing.rst:1321 +#: ../../library/multiprocessing.rst:1320 msgid "" "If *lock* is specified then it should be a :class:`Lock` or :class:`RLock` " "object from :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:1324 -#: ../../library/multiprocessing.rst:1873 +#: ../../library/multiprocessing.rst:1323 +#: ../../library/multiprocessing.rst:1872 msgid "The :meth:`~threading.Condition.wait_for` method was added." msgstr "" -#: ../../library/multiprocessing.rst:1329 +#: ../../library/multiprocessing.rst:1328 msgid "A clone of :class:`threading.Event`." msgstr "" -#: ../../library/multiprocessing.rst:1334 +#: ../../library/multiprocessing.rst:1333 msgid "" "A non-recursive lock object: a close analog of :class:`threading.Lock`. Once " "a process or thread has acquired a lock, subsequent attempts to acquire it " @@ -1475,25 +1476,25 @@ msgid "" "as noted." msgstr "" -#: ../../library/multiprocessing.rst:1342 +#: ../../library/multiprocessing.rst:1341 msgid "" "Note that :class:`Lock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.Lock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1346 +#: ../../library/multiprocessing.rst:1345 msgid "" ":class:`Lock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1351 -#: ../../library/multiprocessing.rst:1402 +#: ../../library/multiprocessing.rst:1350 +#: ../../library/multiprocessing.rst:1401 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: ../../library/multiprocessing.rst:1353 +#: ../../library/multiprocessing.rst:1352 msgid "" "With the *block* argument set to ``True`` (the default), the method call " "will block until the lock is in an unlocked state, then set it to locked and " @@ -1501,14 +1502,14 @@ msgid "" "that in :meth:`threading.Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1358 +#: ../../library/multiprocessing.rst:1357 msgid "" "With the *block* argument set to ``False``, the method call does not block. " "If the lock is currently in a locked state, return ``False``; otherwise set " "the lock to a locked state and return ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1362 +#: ../../library/multiprocessing.rst:1361 msgid "" "When invoked with a positive, floating-point value for *timeout*, block for " "at most the number of seconds specified by *timeout* as long as the lock can " @@ -1522,19 +1523,19 @@ msgid "" "acquired or ``False`` if the timeout period has elapsed." msgstr "" -#: ../../library/multiprocessing.rst:1377 +#: ../../library/multiprocessing.rst:1376 msgid "" "Release a lock. This can be called from any process or thread, not only the " "process or thread which originally acquired the lock." msgstr "" -#: ../../library/multiprocessing.rst:1380 +#: ../../library/multiprocessing.rst:1379 msgid "" "Behavior is the same as in :meth:`threading.Lock.release` except that when " "invoked on an unlocked lock, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:1386 +#: ../../library/multiprocessing.rst:1385 msgid "" "A recursive lock object: a close analog of :class:`threading.RLock`. A " "recursive lock must be released by the process or thread that acquired it. " @@ -1543,20 +1544,20 @@ msgid "" "release it once for each time it has been acquired." msgstr "" -#: ../../library/multiprocessing.rst:1392 +#: ../../library/multiprocessing.rst:1391 msgid "" "Note that :class:`RLock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.RLock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1396 +#: ../../library/multiprocessing.rst:1395 msgid "" ":class:`RLock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1404 +#: ../../library/multiprocessing.rst:1403 msgid "" "When invoked with the *block* argument set to ``True``, block until the lock " "is in an unlocked state (not owned by any process or thread) unless the lock " @@ -1569,7 +1570,7 @@ msgid "" "itself." msgstr "" -#: ../../library/multiprocessing.rst:1414 +#: ../../library/multiprocessing.rst:1413 msgid "" "When invoked with the *block* argument set to ``False``, do not block. If " "the lock has already been acquired (and thus is owned) by another process or " @@ -1580,14 +1581,14 @@ msgid "" "a return value of ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1422 +#: ../../library/multiprocessing.rst:1421 msgid "" "Use and behaviors of the *timeout* argument are the same as in :meth:`Lock." "acquire`. Note that some of these behaviors of *timeout* differ from the " "implemented behaviors in :meth:`threading.RLock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1429 +#: ../../library/multiprocessing.rst:1428 msgid "" "Release a lock, decrementing the recursion level. If after the decrement " "the recursion level is zero, reset the lock to unlocked (not owned by any " @@ -1597,7 +1598,7 @@ msgid "" "locked and owned by the calling process or thread." msgstr "" -#: ../../library/multiprocessing.rst:1437 +#: ../../library/multiprocessing.rst:1436 msgid "" "Only call this method when the calling process or thread owns the lock. An :" "exc:`AssertionError` is raised if this method is called by a process or " @@ -1606,17 +1607,17 @@ msgid "" "from the implemented behavior in :meth:`threading.RLock.release`." msgstr "" -#: ../../library/multiprocessing.rst:1446 +#: ../../library/multiprocessing.rst:1445 msgid "A semaphore object: a close analog of :class:`threading.Semaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1453 +#: ../../library/multiprocessing.rst:1452 msgid "" "On macOS, ``sem_timedwait`` is unsupported, so calling ``acquire()`` with a " "timeout will emulate that function's behavior using a sleeping loop." msgstr "" -#: ../../library/multiprocessing.rst:1458 +#: ../../library/multiprocessing.rst:1457 msgid "" "If the SIGINT signal generated by :kbd:`Ctrl-C` arrives while the main " "thread is blocked by a call to :meth:`BoundedSemaphore.acquire`, :meth:`Lock." @@ -1625,13 +1626,13 @@ msgid "" "interrupted and :exc:`KeyboardInterrupt` will be raised." msgstr "" -#: ../../library/multiprocessing.rst:1464 +#: ../../library/multiprocessing.rst:1463 msgid "" "This differs from the behaviour of :mod:`threading` where SIGINT will be " "ignored while the equivalent blocking calls are in progress." msgstr "" -#: ../../library/multiprocessing.rst:1469 +#: ../../library/multiprocessing.rst:1468 msgid "" "Some of this package's functionality requires a functioning shared semaphore " "implementation on the host operating system. Without one, the :mod:" @@ -1640,32 +1641,32 @@ msgid "" "additional information." msgstr "" -#: ../../library/multiprocessing.rst:1477 +#: ../../library/multiprocessing.rst:1476 msgid "Shared :mod:`ctypes` Objects" msgstr "" -#: ../../library/multiprocessing.rst:1479 +#: ../../library/multiprocessing.rst:1478 msgid "" "It is possible to create shared objects using shared memory which can be " "inherited by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1484 +#: ../../library/multiprocessing.rst:1483 msgid "" "Return a :mod:`ctypes` object allocated from shared memory. By default the " "return value is actually a synchronized wrapper for the object. The object " "itself can be accessed via the *value* attribute of a :class:`Value`." msgstr "" -#: ../../library/multiprocessing.rst:1488 -#: ../../library/multiprocessing.rst:1575 +#: ../../library/multiprocessing.rst:1487 +#: ../../library/multiprocessing.rst:1574 msgid "" "*typecode_or_type* determines the type of the returned object: it is either " "a ctypes type or a one character typecode of the kind used by the :mod:" "`array` module. *\\*args* is passed on to the constructor for the type." msgstr "" -#: ../../library/multiprocessing.rst:1492 +#: ../../library/multiprocessing.rst:1491 msgid "" "If *lock* is ``True`` (the default) then a new recursive lock object is " "created to synchronize access to the value. If *lock* is a :class:`Lock` " @@ -1675,32 +1676,32 @@ msgid "" "\"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1499 +#: ../../library/multiprocessing.rst:1498 msgid "" "Operations like ``+=`` which involve a read and write are not atomic. So " "if, for instance, you want to atomically increment a shared value it is " "insufficient to just do ::" msgstr "" -#: ../../library/multiprocessing.rst:1505 +#: ../../library/multiprocessing.rst:1504 msgid "" "Assuming the associated lock is recursive (which it is by default) you can " "instead do ::" msgstr "" -#: ../../library/multiprocessing.rst:1511 -#: ../../library/multiprocessing.rst:1601 -#: ../../library/multiprocessing.rst:1616 +#: ../../library/multiprocessing.rst:1510 +#: ../../library/multiprocessing.rst:1600 +#: ../../library/multiprocessing.rst:1615 msgid "Note that *lock* is a keyword-only argument." msgstr "" -#: ../../library/multiprocessing.rst:1515 +#: ../../library/multiprocessing.rst:1514 msgid "" "Return a ctypes array allocated from shared memory. By default the return " "value is actually a synchronized wrapper for the array." msgstr "" -#: ../../library/multiprocessing.rst:1518 +#: ../../library/multiprocessing.rst:1517 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1710,7 +1711,7 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1525 +#: ../../library/multiprocessing.rst:1524 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`Lock` or :class:" @@ -1720,28 +1721,28 @@ msgid "" "safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1532 +#: ../../library/multiprocessing.rst:1531 msgid "Note that *lock* is a keyword only argument." msgstr "" -#: ../../library/multiprocessing.rst:1534 +#: ../../library/multiprocessing.rst:1533 msgid "" "Note that an array of :data:`ctypes.c_char` has *value* and *raw* attributes " "which allow one to use it to store and retrieve strings." msgstr "" -#: ../../library/multiprocessing.rst:1539 +#: ../../library/multiprocessing.rst:1538 msgid "The :mod:`multiprocessing.sharedctypes` module" msgstr "" -#: ../../library/multiprocessing.rst:1544 +#: ../../library/multiprocessing.rst:1543 msgid "" "The :mod:`multiprocessing.sharedctypes` module provides functions for " "allocating :mod:`ctypes` objects from shared memory which can be inherited " "by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1550 +#: ../../library/multiprocessing.rst:1549 msgid "" "Although it is possible to store a pointer in shared memory remember that " "this will refer to a location in the address space of a specific process. " @@ -1750,11 +1751,11 @@ msgid "" "may cause a crash." msgstr "" -#: ../../library/multiprocessing.rst:1558 +#: ../../library/multiprocessing.rst:1557 msgid "Return a ctypes array allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1560 +#: ../../library/multiprocessing.rst:1559 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1764,40 +1765,40 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1567 +#: ../../library/multiprocessing.rst:1566 msgid "" "Note that setting and getting an element is potentially non-atomic -- use :" "func:`Array` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1573 +#: ../../library/multiprocessing.rst:1572 msgid "Return a ctypes object allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1579 +#: ../../library/multiprocessing.rst:1578 msgid "" "Note that setting and getting the value is potentially non-atomic -- use :" "func:`Value` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1583 +#: ../../library/multiprocessing.rst:1582 msgid "" "Note that an array of :data:`ctypes.c_char` has ``value`` and ``raw`` " "attributes which allow one to use it to store and retrieve strings -- see " "documentation for :mod:`ctypes`." msgstr "" -#: ../../library/multiprocessing.rst:1589 +#: ../../library/multiprocessing.rst:1588 msgid "" "The same as :func:`RawArray` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "array." msgstr "" -#: ../../library/multiprocessing.rst:1593 -#: ../../library/multiprocessing.rst:1609 +#: ../../library/multiprocessing.rst:1592 +#: ../../library/multiprocessing.rst:1608 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`~multiprocessing." @@ -1807,121 +1808,121 @@ msgid "" "not necessarily be \"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1605 +#: ../../library/multiprocessing.rst:1604 msgid "" "The same as :func:`RawValue` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "object." msgstr "" -#: ../../library/multiprocessing.rst:1620 +#: ../../library/multiprocessing.rst:1619 msgid "" "Return a ctypes object allocated from shared memory which is a copy of the " "ctypes object *obj*." msgstr "" -#: ../../library/multiprocessing.rst:1625 +#: ../../library/multiprocessing.rst:1624 msgid "" "Return a process-safe wrapper object for a ctypes object which uses *lock* " "to synchronize access. If *lock* is ``None`` (the default) then a :class:" "`multiprocessing.RLock` object is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1629 +#: ../../library/multiprocessing.rst:1628 msgid "" "A synchronized wrapper will have two methods in addition to those of the " "object it wraps: :meth:`get_obj` returns the wrapped object and :meth:" "`get_lock` returns the lock object used for synchronization." msgstr "" -#: ../../library/multiprocessing.rst:1633 +#: ../../library/multiprocessing.rst:1632 msgid "" "Note that accessing the ctypes object through the wrapper can be a lot " "slower than accessing the raw ctypes object." msgstr "" -#: ../../library/multiprocessing.rst:1636 +#: ../../library/multiprocessing.rst:1635 msgid "Synchronized objects support the :term:`context manager` protocol." msgstr "" -#: ../../library/multiprocessing.rst:1640 +#: ../../library/multiprocessing.rst:1639 msgid "" "The table below compares the syntax for creating shared ctypes objects from " "shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is " "some subclass of :class:`ctypes.Structure`.)" msgstr "" -#: ../../library/multiprocessing.rst:1645 +#: ../../library/multiprocessing.rst:1644 msgid "ctypes" msgstr "ctypes" -#: ../../library/multiprocessing.rst:1645 +#: ../../library/multiprocessing.rst:1644 msgid "sharedctypes using type" msgstr "" -#: ../../library/multiprocessing.rst:1645 +#: ../../library/multiprocessing.rst:1644 msgid "sharedctypes using typecode" msgstr "" -#: ../../library/multiprocessing.rst:1647 +#: ../../library/multiprocessing.rst:1646 msgid "c_double(2.4)" msgstr "c_double(2.4)" -#: ../../library/multiprocessing.rst:1647 +#: ../../library/multiprocessing.rst:1646 msgid "RawValue(c_double, 2.4)" msgstr "RawValue(c_double, 2.4)" -#: ../../library/multiprocessing.rst:1647 +#: ../../library/multiprocessing.rst:1646 msgid "RawValue('d', 2.4)" msgstr "RawValue('d', 2.4)" -#: ../../library/multiprocessing.rst:1648 +#: ../../library/multiprocessing.rst:1647 msgid "MyStruct(4, 6)" msgstr "MyStruct(4, 6)" -#: ../../library/multiprocessing.rst:1648 +#: ../../library/multiprocessing.rst:1647 msgid "RawValue(MyStruct, 4, 6)" msgstr "RawValue(MyStruct, 4, 6)" -#: ../../library/multiprocessing.rst:1649 +#: ../../library/multiprocessing.rst:1648 msgid "(c_short * 7)()" msgstr "(c_short * 7)()" -#: ../../library/multiprocessing.rst:1649 +#: ../../library/multiprocessing.rst:1648 msgid "RawArray(c_short, 7)" msgstr "RawArray(c_short, 7)" -#: ../../library/multiprocessing.rst:1649 +#: ../../library/multiprocessing.rst:1648 msgid "RawArray('h', 7)" msgstr "RawArray('h', 7)" -#: ../../library/multiprocessing.rst:1650 +#: ../../library/multiprocessing.rst:1649 msgid "(c_int * 3)(9, 2, 8)" msgstr "(c_int * 3)(9, 2, 8)" -#: ../../library/multiprocessing.rst:1650 +#: ../../library/multiprocessing.rst:1649 msgid "RawArray(c_int, (9, 2, 8))" msgstr "RawArray(c_int, (9, 2, 8))" -#: ../../library/multiprocessing.rst:1650 +#: ../../library/multiprocessing.rst:1649 msgid "RawArray('i', (9, 2, 8))" msgstr "RawArray('i', (9, 2, 8))" -#: ../../library/multiprocessing.rst:1654 +#: ../../library/multiprocessing.rst:1653 msgid "" "Below is an example where a number of ctypes objects are modified by a child " "process::" msgstr "" -#: ../../library/multiprocessing.rst:1692 +#: ../../library/multiprocessing.rst:1691 msgid "The results printed are ::" msgstr "" -#: ../../library/multiprocessing.rst:1705 +#: ../../library/multiprocessing.rst:1704 msgid "Managers" msgstr "" -#: ../../library/multiprocessing.rst:1707 +#: ../../library/multiprocessing.rst:1706 msgid "" "Managers provide a way to create data which can be shared between different " "processes, including sharing over a network between processes running on " @@ -1930,7 +1931,7 @@ msgid "" "proxies." msgstr "" -#: ../../library/multiprocessing.rst:1716 +#: ../../library/multiprocessing.rst:1715 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " @@ -1938,31 +1939,31 @@ msgid "" "will create shared objects and return corresponding proxies." msgstr "" -#: ../../library/multiprocessing.rst:1724 +#: ../../library/multiprocessing.rst:1723 msgid "" "Manager processes will be shutdown as soon as they are garbage collected or " "their parent process exits. The manager classes are defined in the :mod:" "`multiprocessing.managers` module:" msgstr "" -#: ../../library/multiprocessing.rst:1730 +#: ../../library/multiprocessing.rst:1729 msgid "Create a BaseManager object." msgstr "" -#: ../../library/multiprocessing.rst:1732 +#: ../../library/multiprocessing.rst:1731 msgid "" "Once created one should call :meth:`start` or ``get_server()." "serve_forever()`` to ensure that the manager object refers to a started " "manager process." msgstr "" -#: ../../library/multiprocessing.rst:1735 +#: ../../library/multiprocessing.rst:1734 msgid "" "*address* is the address on which the manager process listens for new " "connections. If *address* is ``None`` then an arbitrary one is chosen." msgstr "" -#: ../../library/multiprocessing.rst:1738 +#: ../../library/multiprocessing.rst:1737 msgid "" "*authkey* is the authentication key which will be used to check the validity " "of incoming connections to the server process. If *authkey* is ``None`` " @@ -1970,19 +1971,19 @@ msgid "" "it must be a byte string." msgstr "" -#: ../../library/multiprocessing.rst:1743 +#: ../../library/multiprocessing.rst:1742 msgid "" "*serializer* must be ``'pickle'`` (use :mod:`pickle` serialization) or " "``'xmlrpclib'`` (use :mod:`xmlrpc.client` serialization)." msgstr "" -#: ../../library/multiprocessing.rst:1746 +#: ../../library/multiprocessing.rst:1745 msgid "" "*ctx* is a context object, or ``None`` (use the current context). See the :" "func:`get_context` function." msgstr "" -#: ../../library/multiprocessing.rst:1749 +#: ../../library/multiprocessing.rst:1748 msgid "" "*shutdown_timeout* is a timeout in seconds used to wait until the process " "used by the manager completes in the :meth:`shutdown` method. If the " @@ -1990,54 +1991,54 @@ msgid "" "also times out, the process is killed." msgstr "" -#: ../../library/multiprocessing.rst:1754 +#: ../../library/multiprocessing.rst:1753 msgid "Added the *shutdown_timeout* parameter." msgstr "新增 *shutdown_timeout* 參數。" -#: ../../library/multiprocessing.rst:1759 +#: ../../library/multiprocessing.rst:1758 msgid "" "Start a subprocess to start the manager. If *initializer* is not ``None`` " "then the subprocess will call ``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:1764 +#: ../../library/multiprocessing.rst:1763 msgid "" "Returns a :class:`Server` object which represents the actual server under " "the control of the Manager. The :class:`Server` object supports the :meth:" "`serve_forever` method::" msgstr "" -#: ../../library/multiprocessing.rst:1773 +#: ../../library/multiprocessing.rst:1772 msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr "" -#: ../../library/multiprocessing.rst:1777 +#: ../../library/multiprocessing.rst:1776 msgid "Connect a local manager object to a remote manager process::" msgstr "" -#: ../../library/multiprocessing.rst:1785 +#: ../../library/multiprocessing.rst:1784 msgid "" "Stop the process used by the manager. This is only available if :meth:" "`start` has been used to start the server process." msgstr "" -#: ../../library/multiprocessing.rst:1788 +#: ../../library/multiprocessing.rst:1787 msgid "This can be called multiple times." msgstr "" -#: ../../library/multiprocessing.rst:1792 +#: ../../library/multiprocessing.rst:1791 msgid "" "A classmethod which can be used for registering a type or callable with the " "manager class." msgstr "" -#: ../../library/multiprocessing.rst:1795 +#: ../../library/multiprocessing.rst:1794 msgid "" "*typeid* is a \"type identifier\" which is used to identify a particular " "type of shared object. This must be a string." msgstr "" -#: ../../library/multiprocessing.rst:1798 +#: ../../library/multiprocessing.rst:1797 msgid "" "*callable* is a callable used for creating objects for this type " "identifier. If a manager instance will be connected to the server using " @@ -2045,14 +2046,14 @@ msgid "" "then this can be left as ``None``." msgstr "" -#: ../../library/multiprocessing.rst:1804 +#: ../../library/multiprocessing.rst:1803 msgid "" "*proxytype* is a subclass of :class:`BaseProxy` which is used to create " "proxies for shared objects with this *typeid*. If ``None`` then a proxy " "class is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1808 +#: ../../library/multiprocessing.rst:1807 msgid "" "*exposed* is used to specify a sequence of method names which proxies for " "this typeid should be allowed to access using :meth:`BaseProxy." @@ -2063,7 +2064,7 @@ msgid "" "method and whose name does not begin with ``'_'``.)" msgstr "" -#: ../../library/multiprocessing.rst:1817 +#: ../../library/multiprocessing.rst:1816 msgid "" "*method_to_typeid* is a mapping used to specify the return type of those " "exposed methods which should return a proxy. It maps method names to typeid " @@ -2073,22 +2074,22 @@ msgid "" "returned by the method will be copied by value." msgstr "" -#: ../../library/multiprocessing.rst:1824 +#: ../../library/multiprocessing.rst:1823 msgid "" "*create_method* determines whether a method should be created with name " "*typeid* which can be used to tell the server process to create a new shared " "object and return a proxy for it. By default it is ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1828 +#: ../../library/multiprocessing.rst:1827 msgid ":class:`BaseManager` instances also have one read-only property:" msgstr "" -#: ../../library/multiprocessing.rst:1832 +#: ../../library/multiprocessing.rst:1831 msgid "The address used by the manager." msgstr "" -#: ../../library/multiprocessing.rst:1834 +#: ../../library/multiprocessing.rst:1833 msgid "" "Manager objects support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server " @@ -2096,173 +2097,173 @@ msgid "" "object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`." msgstr "" -#: ../../library/multiprocessing.rst:1840 +#: ../../library/multiprocessing.rst:1839 msgid "" "In previous versions :meth:`~contextmanager.__enter__` did not start the " "manager's server process if it was not already started." msgstr "" -#: ../../library/multiprocessing.rst:1845 +#: ../../library/multiprocessing.rst:1844 msgid "" "A subclass of :class:`BaseManager` which can be used for the synchronization " "of processes. Objects of this type are returned by :func:`multiprocessing." "Manager`." msgstr "" -#: ../../library/multiprocessing.rst:1849 +#: ../../library/multiprocessing.rst:1848 msgid "" "Its methods create and return :ref:`multiprocessing-proxy_objects` for a " "number of commonly used data types to be synchronized across processes. This " "notably includes shared lists and dictionaries." msgstr "" -#: ../../library/multiprocessing.rst:1855 +#: ../../library/multiprocessing.rst:1854 msgid "" "Create a shared :class:`threading.Barrier` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1862 +#: ../../library/multiprocessing.rst:1861 msgid "" "Create a shared :class:`threading.BoundedSemaphore` object and return a " "proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1867 +#: ../../library/multiprocessing.rst:1866 msgid "" "Create a shared :class:`threading.Condition` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1870 +#: ../../library/multiprocessing.rst:1869 msgid "" "If *lock* is supplied then it should be a proxy for a :class:`threading." "Lock` or :class:`threading.RLock` object." msgstr "" -#: ../../library/multiprocessing.rst:1878 +#: ../../library/multiprocessing.rst:1877 msgid "" "Create a shared :class:`threading.Event` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1882 +#: ../../library/multiprocessing.rst:1881 msgid "" "Create a shared :class:`threading.Lock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1886 +#: ../../library/multiprocessing.rst:1885 msgid "Create a shared :class:`Namespace` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1890 +#: ../../library/multiprocessing.rst:1889 msgid "Create a shared :class:`queue.Queue` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1894 +#: ../../library/multiprocessing.rst:1893 msgid "" "Create a shared :class:`threading.RLock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1898 +#: ../../library/multiprocessing.rst:1897 msgid "" "Create a shared :class:`threading.Semaphore` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1903 +#: ../../library/multiprocessing.rst:1902 msgid "Create an array and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1907 +#: ../../library/multiprocessing.rst:1906 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1914 +#: ../../library/multiprocessing.rst:1913 msgid "Create a shared :class:`dict` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1919 +#: ../../library/multiprocessing.rst:1918 msgid "Create a shared :class:`list` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1921 +#: ../../library/multiprocessing.rst:1920 msgid "" "Shared objects are capable of being nested. For example, a shared container " "object such as a shared list can contain other shared objects which will all " "be managed and synchronized by the :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1928 +#: ../../library/multiprocessing.rst:1927 msgid "A type that can register with :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1930 +#: ../../library/multiprocessing.rst:1929 msgid "" "A namespace object has no public methods, but does have writable attributes. " "Its representation shows the values of its attributes." msgstr "" -#: ../../library/multiprocessing.rst:1933 +#: ../../library/multiprocessing.rst:1932 msgid "" "However, when using a proxy for a namespace object, an attribute beginning " "with ``'_'`` will be an attribute of the proxy and not an attribute of the " "referent:" msgstr "" -#: ../../library/multiprocessing.rst:1950 +#: ../../library/multiprocessing.rst:1949 msgid "Customized managers" msgstr "" -#: ../../library/multiprocessing.rst:1952 +#: ../../library/multiprocessing.rst:1951 msgid "" "To create one's own manager, one creates a subclass of :class:`BaseManager` " "and uses the :meth:`~BaseManager.register` classmethod to register new types " "or callables with the manager class. For example::" msgstr "" -#: ../../library/multiprocessing.rst:1977 +#: ../../library/multiprocessing.rst:1976 msgid "Using a remote manager" msgstr "" -#: ../../library/multiprocessing.rst:1979 +#: ../../library/multiprocessing.rst:1978 msgid "" "It is possible to run a manager server on one machine and have clients use " "it from other machines (assuming that the firewalls involved allow it)." msgstr "" -#: ../../library/multiprocessing.rst:1982 +#: ../../library/multiprocessing.rst:1981 msgid "" "Running the following commands creates a server for a single shared queue " "which remote clients can access::" msgstr "" -#: ../../library/multiprocessing.rst:1994 +#: ../../library/multiprocessing.rst:1993 msgid "One client can access the server as follows::" msgstr "" -#: ../../library/multiprocessing.rst:2004 +#: ../../library/multiprocessing.rst:2003 msgid "Another client can also use it::" msgstr "" -#: ../../library/multiprocessing.rst:2015 +#: ../../library/multiprocessing.rst:2014 msgid "" "Local processes can also access that queue, using the code from above on the " "client to access it remotely::" msgstr "" -#: ../../library/multiprocessing.rst:2040 +#: ../../library/multiprocessing.rst:2039 msgid "Proxy Objects" msgstr "" -#: ../../library/multiprocessing.rst:2042 +#: ../../library/multiprocessing.rst:2041 msgid "" "A proxy is an object which *refers* to a shared object which lives " "(presumably) in a different process. The shared object is said to be the " "*referent* of the proxy. Multiple proxy objects may have the same referent." msgstr "" -#: ../../library/multiprocessing.rst:2046 +#: ../../library/multiprocessing.rst:2045 msgid "" "A proxy object has methods which invoke corresponding methods of its " "referent (although not every method of the referent will necessarily be " @@ -2270,14 +2271,14 @@ msgid "" "its referent can:" msgstr "" -#: ../../library/multiprocessing.rst:2064 +#: ../../library/multiprocessing.rst:2063 msgid "" "Notice that applying :func:`str` to a proxy will return the representation " "of the referent, whereas applying :func:`repr` will return the " "representation of the proxy." msgstr "" -#: ../../library/multiprocessing.rst:2068 +#: ../../library/multiprocessing.rst:2067 msgid "" "An important feature of proxy objects is that they are picklable so they can " "be passed between processes. As such, a referent can contain :ref:" @@ -2285,11 +2286,11 @@ msgid "" "lists, dicts, and other :ref:`multiprocessing-proxy_objects`:" msgstr "" -#: ../../library/multiprocessing.rst:2084 +#: ../../library/multiprocessing.rst:2083 msgid "Similarly, dict and list proxies may be nested inside one another::" msgstr "" -#: ../../library/multiprocessing.rst:2097 +#: ../../library/multiprocessing.rst:2096 msgid "" "If standard (non-proxy) :class:`list` or :class:`dict` objects are contained " "in a referent, modifications to those mutable values will not be propagated " @@ -2300,53 +2301,53 @@ msgid "" "assign the modified value to the container proxy::" msgstr "" -#: ../../library/multiprocessing.rst:2116 +#: ../../library/multiprocessing.rst:2115 msgid "" "This approach is perhaps less convenient than employing nested :ref:" "`multiprocessing-proxy_objects` for most use cases but also demonstrates a " "level of control over the synchronization." msgstr "" -#: ../../library/multiprocessing.rst:2122 +#: ../../library/multiprocessing.rst:2121 msgid "" "The proxy types in :mod:`multiprocessing` do nothing to support comparisons " "by value. So, for instance, we have:" msgstr "" -#: ../../library/multiprocessing.rst:2130 +#: ../../library/multiprocessing.rst:2129 msgid "" "One should just use a copy of the referent instead when making comparisons." msgstr "" -#: ../../library/multiprocessing.rst:2134 +#: ../../library/multiprocessing.rst:2133 msgid "Proxy objects are instances of subclasses of :class:`BaseProxy`." msgstr "" -#: ../../library/multiprocessing.rst:2138 +#: ../../library/multiprocessing.rst:2137 msgid "Call and return the result of a method of the proxy's referent." msgstr "" -#: ../../library/multiprocessing.rst:2140 +#: ../../library/multiprocessing.rst:2139 msgid "" "If ``proxy`` is a proxy whose referent is ``obj`` then the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2144 +#: ../../library/multiprocessing.rst:2143 msgid "will evaluate the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2148 +#: ../../library/multiprocessing.rst:2147 msgid "in the manager's process." msgstr "" -#: ../../library/multiprocessing.rst:2150 +#: ../../library/multiprocessing.rst:2149 msgid "" "The returned value will be a copy of the result of the call or a proxy to a " "new shared object -- see documentation for the *method_to_typeid* argument " "of :meth:`BaseManager.register`." msgstr "" -#: ../../library/multiprocessing.rst:2154 +#: ../../library/multiprocessing.rst:2153 msgid "" "If an exception is raised by the call, then is re-raised by :meth:" "`_callmethod`. If some other exception is raised in the manager's process " @@ -2354,79 +2355,79 @@ msgid "" "meth:`_callmethod`." msgstr "" -#: ../../library/multiprocessing.rst:2159 +#: ../../library/multiprocessing.rst:2158 msgid "" "Note in particular that an exception will be raised if *methodname* has not " "been *exposed*." msgstr "" -#: ../../library/multiprocessing.rst:2162 +#: ../../library/multiprocessing.rst:2161 msgid "An example of the usage of :meth:`_callmethod`:" msgstr "" -#: ../../library/multiprocessing.rst:2178 +#: ../../library/multiprocessing.rst:2177 msgid "Return a copy of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2180 +#: ../../library/multiprocessing.rst:2179 msgid "If the referent is unpicklable then this will raise an exception." msgstr "" -#: ../../library/multiprocessing.rst:2184 +#: ../../library/multiprocessing.rst:2183 msgid "Return a representation of the proxy object." msgstr "" -#: ../../library/multiprocessing.rst:2188 +#: ../../library/multiprocessing.rst:2187 msgid "Return the representation of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2192 +#: ../../library/multiprocessing.rst:2191 msgid "Cleanup" msgstr "" -#: ../../library/multiprocessing.rst:2194 +#: ../../library/multiprocessing.rst:2193 msgid "" "A proxy object uses a weakref callback so that when it gets garbage " "collected it deregisters itself from the manager which owns its referent." msgstr "" -#: ../../library/multiprocessing.rst:2197 +#: ../../library/multiprocessing.rst:2196 msgid "" "A shared object gets deleted from the manager process when there are no " "longer any proxies referring to it." msgstr "" -#: ../../library/multiprocessing.rst:2202 +#: ../../library/multiprocessing.rst:2201 msgid "Process Pools" msgstr "" -#: ../../library/multiprocessing.rst:2207 +#: ../../library/multiprocessing.rst:2206 msgid "" "One can create a pool of processes which will carry out tasks submitted to " "it with the :class:`Pool` class." msgstr "" -#: ../../library/multiprocessing.rst:2212 +#: ../../library/multiprocessing.rst:2211 msgid "" "A process pool object which controls a pool of worker processes to which " "jobs can be submitted. It supports asynchronous results with timeouts and " "callbacks and has a parallel map implementation." msgstr "" -#: ../../library/multiprocessing.rst:2216 +#: ../../library/multiprocessing.rst:2215 msgid "" "*processes* is the number of worker processes to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2219 -#: ../../library/multiprocessing.rst:2780 +#: ../../library/multiprocessing.rst:2218 +#: ../../library/multiprocessing.rst:2779 msgid "" "If *initializer* is not ``None`` then each worker process will call " "``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:2222 +#: ../../library/multiprocessing.rst:2221 msgid "" "*maxtasksperchild* is the number of tasks a worker process can complete " "before it will exit and be replaced with a fresh worker process, to enable " @@ -2434,7 +2435,7 @@ msgid "" "which means worker processes will live as long as the pool." msgstr "" -#: ../../library/multiprocessing.rst:2227 +#: ../../library/multiprocessing.rst:2226 msgid "" "*context* can be used to specify the context used for starting the worker " "processes. Usually a pool is created using the function :func:" @@ -2442,13 +2443,13 @@ msgid "" "both cases *context* is set appropriately." msgstr "" -#: ../../library/multiprocessing.rst:2233 +#: ../../library/multiprocessing.rst:2232 msgid "" "Note that the methods of the pool object should only be called by the " "process which created the pool." msgstr "" -#: ../../library/multiprocessing.rst:2237 +#: ../../library/multiprocessing.rst:2236 msgid "" ":class:`multiprocessing.pool` objects have internal resources that need to " "be properly managed (like any other resource) by using the pool as a context " @@ -2456,22 +2457,24 @@ msgid "" "to do this can lead to the process hanging on finalization." msgstr "" -#: ../../library/multiprocessing.rst:2242 +#: ../../library/multiprocessing.rst:2241 msgid "" "Note that it is **not correct** to rely on the garbage collector to destroy " "the pool as CPython does not assure that the finalizer of the pool will be " "called (see :meth:`object.__del__` for more information)." msgstr "" -#: ../../library/multiprocessing.rst:2246 -msgid "*maxtasksperchild*" -msgstr "" +#: ../../library/multiprocessing.rst:2245 +#, fuzzy +msgid "Added the *maxtasksperchild* parameter." +msgstr "新增 *shutdown_timeout* 參數。" -#: ../../library/multiprocessing.rst:2249 -msgid "*context*" -msgstr "" +#: ../../library/multiprocessing.rst:2248 +#, fuzzy +msgid "Added the *context* parameter." +msgstr "新增 *shutdown_timeout* 參數。" -#: ../../library/multiprocessing.rst:2254 +#: ../../library/multiprocessing.rst:2253 msgid "" "Worker processes within a :class:`Pool` typically live for the complete " "duration of the Pool's work queue. A frequent pattern found in other systems " @@ -2482,7 +2485,7 @@ msgid "" "ability to the end user." msgstr "" -#: ../../library/multiprocessing.rst:2264 +#: ../../library/multiprocessing.rst:2263 msgid "" "Call *func* with arguments *args* and keyword arguments *kwds*. It blocks " "until the result is ready. Given this blocks, :meth:`apply_async` is better " @@ -2490,14 +2493,14 @@ msgid "" "executed in one of the workers of the pool." msgstr "" -#: ../../library/multiprocessing.rst:2271 +#: ../../library/multiprocessing.rst:2270 msgid "" "A variant of the :meth:`apply` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2274 -#: ../../library/multiprocessing.rst:2305 +#: ../../library/multiprocessing.rst:2273 +#: ../../library/multiprocessing.rst:2304 msgid "" "If *callback* is specified then it should be a callable which accepts a " "single argument. When the result becomes ready *callback* is applied to it, " @@ -2505,60 +2508,60 @@ msgid "" "applied instead." msgstr "" -#: ../../library/multiprocessing.rst:2279 -#: ../../library/multiprocessing.rst:2310 +#: ../../library/multiprocessing.rst:2278 +#: ../../library/multiprocessing.rst:2309 msgid "" "If *error_callback* is specified then it should be a callable which accepts " "a single argument. If the target function fails, then the *error_callback* " "is called with the exception instance." msgstr "" -#: ../../library/multiprocessing.rst:2283 -#: ../../library/multiprocessing.rst:2314 +#: ../../library/multiprocessing.rst:2282 +#: ../../library/multiprocessing.rst:2313 msgid "" "Callbacks should complete immediately since otherwise the thread which " "handles the results will get blocked." msgstr "" -#: ../../library/multiprocessing.rst:2288 +#: ../../library/multiprocessing.rst:2287 msgid "" "A parallel equivalent of the :func:`map` built-in function (it supports only " "one *iterable* argument though, for multiple iterables see :meth:`starmap`). " "It blocks until the result is ready." msgstr "" -#: ../../library/multiprocessing.rst:2292 +#: ../../library/multiprocessing.rst:2291 msgid "" "This method chops the iterable into a number of chunks which it submits to " "the process pool as separate tasks. The (approximate) size of these chunks " "can be specified by setting *chunksize* to a positive integer." msgstr "" -#: ../../library/multiprocessing.rst:2296 +#: ../../library/multiprocessing.rst:2295 msgid "" "Note that it may cause high memory usage for very long iterables. Consider " "using :meth:`imap` or :meth:`imap_unordered` with explicit *chunksize* " "option for better efficiency." msgstr "" -#: ../../library/multiprocessing.rst:2302 +#: ../../library/multiprocessing.rst:2301 msgid "" "A variant of the :meth:`.map` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2319 +#: ../../library/multiprocessing.rst:2318 msgid "A lazier version of :meth:`.map`." msgstr "" -#: ../../library/multiprocessing.rst:2321 +#: ../../library/multiprocessing.rst:2320 msgid "" "The *chunksize* argument is the same as the one used by the :meth:`.map` " "method. For very long iterables using a large value for *chunksize* can " "make the job complete **much** faster than using the default value of ``1``." msgstr "" -#: ../../library/multiprocessing.rst:2326 +#: ../../library/multiprocessing.rst:2325 msgid "" "Also if *chunksize* is ``1`` then the :meth:`!next` method of the iterator " "returned by the :meth:`imap` method has an optional *timeout* parameter: " @@ -2566,65 +2569,65 @@ msgid "" "result cannot be returned within *timeout* seconds." msgstr "" -#: ../../library/multiprocessing.rst:2333 +#: ../../library/multiprocessing.rst:2332 msgid "" "The same as :meth:`imap` except that the ordering of the results from the " "returned iterator should be considered arbitrary. (Only when there is only " "one worker process is the order guaranteed to be \"correct\".)" msgstr "" -#: ../../library/multiprocessing.rst:2339 +#: ../../library/multiprocessing.rst:2338 msgid "" "Like :meth:`~multiprocessing.pool.Pool.map` except that the elements of the " "*iterable* are expected to be iterables that are unpacked as arguments." msgstr "" -#: ../../library/multiprocessing.rst:2343 +#: ../../library/multiprocessing.rst:2342 msgid "" "Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2), " "func(3,4)]``." msgstr "" -#: ../../library/multiprocessing.rst:2350 +#: ../../library/multiprocessing.rst:2349 msgid "" "A combination of :meth:`starmap` and :meth:`map_async` that iterates over " "*iterable* of iterables and calls *func* with the iterables unpacked. " "Returns a result object." msgstr "" -#: ../../library/multiprocessing.rst:2358 +#: ../../library/multiprocessing.rst:2357 msgid "" "Prevents any more tasks from being submitted to the pool. Once all the " "tasks have been completed the worker processes will exit." msgstr "" -#: ../../library/multiprocessing.rst:2363 +#: ../../library/multiprocessing.rst:2362 msgid "" "Stops the worker processes immediately without completing outstanding work. " "When the pool object is garbage collected :meth:`terminate` will be called " "immediately." msgstr "" -#: ../../library/multiprocessing.rst:2369 +#: ../../library/multiprocessing.rst:2368 msgid "" "Wait for the worker processes to exit. One must call :meth:`close` or :meth:" "`terminate` before using :meth:`join`." msgstr "" -#: ../../library/multiprocessing.rst:2372 +#: ../../library/multiprocessing.rst:2371 msgid "" "Pool objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the pool " "object, and :meth:`~contextmanager.__exit__` calls :meth:`terminate`." msgstr "" -#: ../../library/multiprocessing.rst:2380 +#: ../../library/multiprocessing.rst:2379 msgid "" "The class of the result returned by :meth:`Pool.apply_async` and :meth:`Pool." "map_async`." msgstr "" -#: ../../library/multiprocessing.rst:2385 +#: ../../library/multiprocessing.rst:2384 msgid "" "Return the result when it arrives. If *timeout* is not ``None`` and the " "result does not arrive within *timeout* seconds then :exc:`multiprocessing." @@ -2632,41 +2635,41 @@ msgid "" "exception will be reraised by :meth:`get`." msgstr "" -#: ../../library/multiprocessing.rst:2392 +#: ../../library/multiprocessing.rst:2391 msgid "Wait until the result is available or until *timeout* seconds pass." msgstr "" -#: ../../library/multiprocessing.rst:2396 +#: ../../library/multiprocessing.rst:2395 msgid "Return whether the call has completed." msgstr "" -#: ../../library/multiprocessing.rst:2400 +#: ../../library/multiprocessing.rst:2399 msgid "" "Return whether the call completed without raising an exception. Will raise :" "exc:`ValueError` if the result is not ready." msgstr "" -#: ../../library/multiprocessing.rst:2403 +#: ../../library/multiprocessing.rst:2402 msgid "" "If the result is not ready, :exc:`ValueError` is raised instead of :exc:" "`AssertionError`." msgstr "" -#: ../../library/multiprocessing.rst:2407 +#: ../../library/multiprocessing.rst:2406 msgid "The following example demonstrates the use of a pool::" msgstr "" -#: ../../library/multiprocessing.rst:2434 +#: ../../library/multiprocessing.rst:2433 msgid "Listeners and Clients" msgstr "" -#: ../../library/multiprocessing.rst:2439 +#: ../../library/multiprocessing.rst:2438 msgid "" "Usually message passing between processes is done using queues or by using :" "class:`~Connection` objects returned by :func:`~multiprocessing.Pipe`." msgstr "" -#: ../../library/multiprocessing.rst:2443 +#: ../../library/multiprocessing.rst:2442 msgid "" "However, the :mod:`multiprocessing.connection` module allows some extra " "flexibility. It basically gives a high level message oriented API for " @@ -2675,46 +2678,46 @@ msgid "" "multiple connections at the same time." msgstr "" -#: ../../library/multiprocessing.rst:2452 +#: ../../library/multiprocessing.rst:2451 msgid "" "Send a randomly generated message to the other end of the connection and " "wait for a reply." msgstr "" -#: ../../library/multiprocessing.rst:2455 +#: ../../library/multiprocessing.rst:2454 msgid "" "If the reply matches the digest of the message using *authkey* as the key " "then a welcome message is sent to the other end of the connection. " "Otherwise :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2461 +#: ../../library/multiprocessing.rst:2460 msgid "" "Receive a message, calculate the digest of the message using *authkey* as " "the key, and then send the digest back." msgstr "" -#: ../../library/multiprocessing.rst:2464 +#: ../../library/multiprocessing.rst:2463 msgid "" "If a welcome message is not received, then :exc:`~multiprocessing." "AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2469 +#: ../../library/multiprocessing.rst:2468 msgid "" "Attempt to set up a connection to the listener which is using address " "*address*, returning a :class:`~Connection`." msgstr "" -#: ../../library/multiprocessing.rst:2472 +#: ../../library/multiprocessing.rst:2471 msgid "" "The type of the connection is determined by *family* argument, but this can " "generally be omitted since it can usually be inferred from the format of " "*address*. (See :ref:`multiprocessing-address-formats`)" msgstr "" -#: ../../library/multiprocessing.rst:2476 -#: ../../library/multiprocessing.rst:2511 +#: ../../library/multiprocessing.rst:2475 +#: ../../library/multiprocessing.rst:2510 msgid "" "If *authkey* is given and not None, it should be a byte string and will be " "used as the secret key for an HMAC-based authentication challenge. No " @@ -2723,26 +2726,26 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:2484 +#: ../../library/multiprocessing.rst:2483 msgid "" "A wrapper for a bound socket or Windows named pipe which is 'listening' for " "connections." msgstr "" -#: ../../library/multiprocessing.rst:2487 +#: ../../library/multiprocessing.rst:2486 msgid "" "*address* is the address to be used by the bound socket or named pipe of the " "listener object." msgstr "" -#: ../../library/multiprocessing.rst:2492 +#: ../../library/multiprocessing.rst:2491 msgid "" "If an address of '0.0.0.0' is used, the address will not be a connectable " "end point on Windows. If you require a connectable end-point, you should use " "'127.0.0.1'." msgstr "" -#: ../../library/multiprocessing.rst:2496 +#: ../../library/multiprocessing.rst:2495 msgid "" "*family* is the type of socket (or named pipe) to use. This can be one of " "the strings ``'AF_INET'`` (for a TCP socket), ``'AF_UNIX'`` (for a Unix " @@ -2756,49 +2759,49 @@ msgid "" "using :func:`tempfile.mkstemp`." msgstr "" -#: ../../library/multiprocessing.rst:2507 +#: ../../library/multiprocessing.rst:2506 msgid "" "If the listener object uses a socket then *backlog* (1 by default) is passed " "to the :meth:`~socket.socket.listen` method of the socket once it has been " "bound." msgstr "" -#: ../../library/multiprocessing.rst:2519 +#: ../../library/multiprocessing.rst:2518 msgid "" "Accept a connection on the bound socket or named pipe of the listener object " "and return a :class:`~Connection` object. If authentication is attempted and " "fails, then :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2526 +#: ../../library/multiprocessing.rst:2525 msgid "" "Close the bound socket or named pipe of the listener object. This is called " "automatically when the listener is garbage collected. However it is " "advisable to call it explicitly." msgstr "" -#: ../../library/multiprocessing.rst:2530 +#: ../../library/multiprocessing.rst:2529 msgid "Listener objects have the following read-only properties:" msgstr "" -#: ../../library/multiprocessing.rst:2534 +#: ../../library/multiprocessing.rst:2533 msgid "The address which is being used by the Listener object." msgstr "" -#: ../../library/multiprocessing.rst:2538 +#: ../../library/multiprocessing.rst:2537 msgid "" "The address from which the last accepted connection came. If this is " "unavailable then it is ``None``." msgstr "" -#: ../../library/multiprocessing.rst:2541 +#: ../../library/multiprocessing.rst:2540 msgid "" "Listener objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "listener object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:2548 +#: ../../library/multiprocessing.rst:2547 msgid "" "Wait till an object in *object_list* is ready. Returns the list of those " "objects in *object_list* which are ready. If *timeout* is a float then the " @@ -2807,32 +2810,32 @@ msgid "" "zero timeout." msgstr "" -#: ../../library/multiprocessing.rst:2554 +#: ../../library/multiprocessing.rst:2553 msgid "" "For both POSIX and Windows, an object can appear in *object_list* if it is" msgstr "" -#: ../../library/multiprocessing.rst:2557 +#: ../../library/multiprocessing.rst:2556 msgid "a readable :class:`~multiprocessing.connection.Connection` object;" msgstr "" -#: ../../library/multiprocessing.rst:2558 +#: ../../library/multiprocessing.rst:2557 msgid "a connected and readable :class:`socket.socket` object; or" msgstr "" -#: ../../library/multiprocessing.rst:2559 +#: ../../library/multiprocessing.rst:2558 msgid "" "the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:" "`~multiprocessing.Process` object." msgstr "" -#: ../../library/multiprocessing.rst:2562 +#: ../../library/multiprocessing.rst:2561 msgid "" "A connection or socket object is ready when there is data available to be " "read from it, or the other end has been closed." msgstr "" -#: ../../library/multiprocessing.rst:2565 +#: ../../library/multiprocessing.rst:2564 msgid "" "**POSIX**: ``wait(object_list, timeout)`` almost equivalent ``select." "select(object_list, [], [], timeout)``. The difference is that, if :func:" @@ -2840,7 +2843,7 @@ msgid "" "an error number of ``EINTR``, whereas :func:`wait` will not." msgstr "" -#: ../../library/multiprocessing.rst:2571 +#: ../../library/multiprocessing.rst:2570 msgid "" "**Windows**: An item in *object_list* must either be an integer handle which " "is waitable (according to the definition used by the documentation of the " @@ -2850,46 +2853,46 @@ msgid "" "handles.)" msgstr "" -#: ../../library/multiprocessing.rst:2581 +#: ../../library/multiprocessing.rst:2580 msgid "**Examples**" msgstr "" -#: ../../library/multiprocessing.rst:2583 +#: ../../library/multiprocessing.rst:2582 msgid "" "The following server code creates a listener which uses ``'secret " "password'`` as an authentication key. It then waits for a connection and " "sends some data to the client::" msgstr "" -#: ../../library/multiprocessing.rst:2602 +#: ../../library/multiprocessing.rst:2601 msgid "" "The following code connects to the server and receives some data from the " "server::" msgstr "" -#: ../../library/multiprocessing.rst:2619 +#: ../../library/multiprocessing.rst:2618 msgid "" "The following code uses :func:`~multiprocessing.connection.wait` to wait for " "messages from multiple processes at once::" msgstr "" -#: ../../library/multiprocessing.rst:2658 +#: ../../library/multiprocessing.rst:2657 msgid "Address Formats" msgstr "" -#: ../../library/multiprocessing.rst:2660 +#: ../../library/multiprocessing.rst:2659 msgid "" "An ``'AF_INET'`` address is a tuple of the form ``(hostname, port)`` where " "*hostname* is a string and *port* is an integer." msgstr "" -#: ../../library/multiprocessing.rst:2663 +#: ../../library/multiprocessing.rst:2662 msgid "" "An ``'AF_UNIX'`` address is a string representing a filename on the " "filesystem." msgstr "" -#: ../../library/multiprocessing.rst:2666 +#: ../../library/multiprocessing.rst:2665 msgid "" "An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\\\\\\\.\\" "\\pipe\\\\\\\\{PipeName}'`. To use :func:`Client` to connect to a named " @@ -2898,17 +2901,17 @@ msgid "" "instead." msgstr "" -#: ../../library/multiprocessing.rst:2671 +#: ../../library/multiprocessing.rst:2670 msgid "" "Note that any string beginning with two backslashes is assumed by default to " "be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address." msgstr "" -#: ../../library/multiprocessing.rst:2678 +#: ../../library/multiprocessing.rst:2677 msgid "Authentication keys" msgstr "" -#: ../../library/multiprocessing.rst:2680 +#: ../../library/multiprocessing.rst:2679 msgid "" "When one uses :meth:`Connection.recv `, the data received " "is automatically unpickled. Unfortunately unpickling data from an untrusted " @@ -2916,7 +2919,7 @@ msgid "" "use the :mod:`hmac` module to provide digest authentication." msgstr "" -#: ../../library/multiprocessing.rst:2686 +#: ../../library/multiprocessing.rst:2685 msgid "" "An authentication key is a byte string which can be thought of as a " "password: once a connection is established both ends will demand proof that " @@ -2924,7 +2927,7 @@ msgid "" "using the same key does **not** involve sending the key over the connection.)" msgstr "" -#: ../../library/multiprocessing.rst:2692 +#: ../../library/multiprocessing.rst:2691 msgid "" "If authentication is requested but no authentication key is specified then " "the return value of ``current_process().authkey`` is used (see :class:" @@ -2935,17 +2938,17 @@ msgid "" "setting up connections between themselves." msgstr "" -#: ../../library/multiprocessing.rst:2700 +#: ../../library/multiprocessing.rst:2699 msgid "" "Suitable authentication keys can also be generated by using :func:`os." "urandom`." msgstr "" -#: ../../library/multiprocessing.rst:2704 +#: ../../library/multiprocessing.rst:2703 msgid "Logging" msgstr "" -#: ../../library/multiprocessing.rst:2706 +#: ../../library/multiprocessing.rst:2705 msgid "" "Some support for logging is available. Note, however, that the :mod:" "`logging` package does not use process shared locks so it is possible " @@ -2953,27 +2956,27 @@ msgid "" "mixed up." msgstr "" -#: ../../library/multiprocessing.rst:2713 +#: ../../library/multiprocessing.rst:2712 msgid "" "Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " "will be created." msgstr "" -#: ../../library/multiprocessing.rst:2716 +#: ../../library/multiprocessing.rst:2715 msgid "" "When first created the logger has level :const:`logging.NOTSET` and no " "default handler. Messages sent to this logger will not by default propagate " "to the root logger." msgstr "" -#: ../../library/multiprocessing.rst:2720 +#: ../../library/multiprocessing.rst:2719 msgid "" "Note that on Windows child processes will only inherit the level of the " "parent process's logger -- any other customization of the logger will not be " "inherited." msgstr "" -#: ../../library/multiprocessing.rst:2727 +#: ../../library/multiprocessing.rst:2726 msgid "" "This function performs a call to :func:`get_logger` but in addition to " "returning the logger created by get_logger, it adds a handler which sends " @@ -2982,25 +2985,25 @@ msgid "" "``level`` argument." msgstr "" -#: ../../library/multiprocessing.rst:2733 +#: ../../library/multiprocessing.rst:2732 msgid "Below is an example session with logging turned on::" msgstr "" -#: ../../library/multiprocessing.rst:2748 +#: ../../library/multiprocessing.rst:2747 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: ../../library/multiprocessing.rst:2752 +#: ../../library/multiprocessing.rst:2751 msgid "The :mod:`multiprocessing.dummy` module" msgstr "" -#: ../../library/multiprocessing.rst:2757 +#: ../../library/multiprocessing.rst:2756 msgid "" ":mod:`multiprocessing.dummy` replicates the API of :mod:`multiprocessing` " "but is no more than a wrapper around the :mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:2762 +#: ../../library/multiprocessing.rst:2761 msgid "" "In particular, the ``Pool`` function provided by :mod:`multiprocessing." "dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" @@ -3008,7 +3011,7 @@ msgid "" "worker threads rather than worker processes." msgstr "" -#: ../../library/multiprocessing.rst:2770 +#: ../../library/multiprocessing.rst:2769 msgid "" "A thread pool object which controls a pool of worker threads to which jobs " "can be submitted. :class:`ThreadPool` instances are fully interface " @@ -3018,18 +3021,18 @@ msgid "" "pool.Pool.terminate` manually." msgstr "" -#: ../../library/multiprocessing.rst:2777 +#: ../../library/multiprocessing.rst:2776 msgid "" "*processes* is the number of worker threads to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2783 +#: ../../library/multiprocessing.rst:2782 msgid "" "Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." msgstr "" -#: ../../library/multiprocessing.rst:2787 +#: ../../library/multiprocessing.rst:2786 msgid "" "A :class:`ThreadPool` shares the same interface as :class:`Pool`, which is " "designed around a pool of processes and predates the introduction of the :" @@ -3039,7 +3042,7 @@ msgid "" "is not understood by any other libraries." msgstr "" -#: ../../library/multiprocessing.rst:2794 +#: ../../library/multiprocessing.rst:2793 msgid "" "Users should generally prefer to use :class:`concurrent.futures." "ThreadPoolExecutor`, which has a simpler interface that was designed around " @@ -3048,69 +3051,69 @@ msgid "" "`asyncio`." msgstr "" -#: ../../library/multiprocessing.rst:2804 +#: ../../library/multiprocessing.rst:2803 msgid "Programming guidelines" msgstr "" -#: ../../library/multiprocessing.rst:2806 +#: ../../library/multiprocessing.rst:2805 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:2811 +#: ../../library/multiprocessing.rst:2810 msgid "All start methods" msgstr "" -#: ../../library/multiprocessing.rst:2813 +#: ../../library/multiprocessing.rst:2812 msgid "The following applies to all start methods." msgstr "" -#: ../../library/multiprocessing.rst:2815 +#: ../../library/multiprocessing.rst:2814 msgid "Avoid shared state" msgstr "" -#: ../../library/multiprocessing.rst:2817 +#: ../../library/multiprocessing.rst:2816 msgid "" "As far as possible one should try to avoid shifting large amounts of data " "between processes." msgstr "" -#: ../../library/multiprocessing.rst:2820 +#: ../../library/multiprocessing.rst:2819 msgid "" "It is probably best to stick to using queues or pipes for communication " "between processes rather than using the lower level synchronization " "primitives." msgstr "" -#: ../../library/multiprocessing.rst:2824 +#: ../../library/multiprocessing.rst:2823 msgid "Picklability" msgstr "" -#: ../../library/multiprocessing.rst:2826 +#: ../../library/multiprocessing.rst:2825 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: ../../library/multiprocessing.rst:2828 +#: ../../library/multiprocessing.rst:2827 msgid "Thread safety of proxies" msgstr "" -#: ../../library/multiprocessing.rst:2830 +#: ../../library/multiprocessing.rst:2829 msgid "" "Do not use a proxy object from more than one thread unless you protect it " "with a lock." msgstr "" -#: ../../library/multiprocessing.rst:2833 +#: ../../library/multiprocessing.rst:2832 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: ../../library/multiprocessing.rst:2835 +#: ../../library/multiprocessing.rst:2834 msgid "Joining zombie processes" msgstr "" -#: ../../library/multiprocessing.rst:2837 +#: ../../library/multiprocessing.rst:2836 msgid "" "On POSIX when a process finishes but has not been joined it becomes a " "zombie. There should never be very many because each time a new process " @@ -3121,11 +3124,11 @@ msgid "" "explicitly join all the processes that you start." msgstr "" -#: ../../library/multiprocessing.rst:2845 +#: ../../library/multiprocessing.rst:2844 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: ../../library/multiprocessing.rst:2847 +#: ../../library/multiprocessing.rst:2846 msgid "" "When using the *spawn* or *forkserver* start methods many types from :mod:" "`multiprocessing` need to be picklable so that child processes can use " @@ -3135,11 +3138,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: ../../library/multiprocessing.rst:2855 +#: ../../library/multiprocessing.rst:2854 msgid "Avoid terminating processes" msgstr "" -#: ../../library/multiprocessing.rst:2857 +#: ../../library/multiprocessing.rst:2856 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -3147,18 +3150,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: ../../library/multiprocessing.rst:2863 +#: ../../library/multiprocessing.rst:2862 msgid "" "Therefore it is probably best to only consider using :meth:`Process." "terminate ` on processes which never use " "any shared resources." msgstr "" -#: ../../library/multiprocessing.rst:2867 +#: ../../library/multiprocessing.rst:2866 msgid "Joining processes that use queues" msgstr "" -#: ../../library/multiprocessing.rst:2869 +#: ../../library/multiprocessing.rst:2868 msgid "" "Bear in mind that a process that has put items in a queue will wait before " "terminating until all the buffered items are fed by the \"feeder\" thread to " @@ -3167,7 +3170,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: ../../library/multiprocessing.rst:2875 +#: ../../library/multiprocessing.rst:2874 msgid "" "This means that whenever you use a queue you need to make sure that all " "items which have been put on the queue will eventually be removed before the " @@ -3176,21 +3179,21 @@ msgid "" "processes will be joined automatically." msgstr "" -#: ../../library/multiprocessing.rst:2881 +#: ../../library/multiprocessing.rst:2880 msgid "An example which will deadlock is the following::" msgstr "" -#: ../../library/multiprocessing.rst:2895 +#: ../../library/multiprocessing.rst:2894 msgid "" "A fix here would be to swap the last two lines (or simply remove the ``p." "join()`` line)." msgstr "" -#: ../../library/multiprocessing.rst:2898 +#: ../../library/multiprocessing.rst:2897 msgid "Explicitly pass resources to child processes" msgstr "" -#: ../../library/multiprocessing.rst:2900 +#: ../../library/multiprocessing.rst:2899 msgid "" "On POSIX using the *fork* start method, a child process can make use of a " "shared resource created in a parent process using a global resource. " @@ -3198,7 +3201,7 @@ msgid "" "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:2905 +#: ../../library/multiprocessing.rst:2904 msgid "" "Apart from making the code (potentially) compatible with Windows and the " "other start methods this also ensures that as long as the child process is " @@ -3207,29 +3210,29 @@ msgid "" "collected in the parent process." msgstr "" -#: ../../library/multiprocessing.rst:2912 +#: ../../library/multiprocessing.rst:2911 msgid "So for instance ::" msgstr "" -#: ../../library/multiprocessing.rst:2924 +#: ../../library/multiprocessing.rst:2923 msgid "should be rewritten as ::" msgstr "" -#: ../../library/multiprocessing.rst:2936 +#: ../../library/multiprocessing.rst:2935 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: ../../library/multiprocessing.rst:2938 +#: ../../library/multiprocessing.rst:2937 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: ../../library/multiprocessing.rst:2942 +#: ../../library/multiprocessing.rst:2941 msgid "" "in the :meth:`multiprocessing.Process._bootstrap` method --- this resulted " "in issues with processes-in-processes. This has been changed to::" msgstr "" -#: ../../library/multiprocessing.rst:2948 +#: ../../library/multiprocessing.rst:2947 msgid "" "Which solves the fundamental issue of processes colliding with each other " "resulting in a bad file descriptor error, but introduces a potential danger " @@ -3239,33 +3242,33 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: ../../library/multiprocessing.rst:2955 +#: ../../library/multiprocessing.rst:2954 msgid "" "If you write a file-like object and implement your own caching, you can make " "it fork-safe by storing the pid whenever you append to the cache, and " "discarding the cache when the pid changes. For example::" msgstr "" -#: ../../library/multiprocessing.rst:2967 +#: ../../library/multiprocessing.rst:2966 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: ../../library/multiprocessing.rst:2970 +#: ../../library/multiprocessing.rst:2969 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: ../../library/multiprocessing.rst:2972 +#: ../../library/multiprocessing.rst:2971 msgid "" -"There are a few extra restriction which don't apply to the *fork* start " +"There are a few extra restrictions which don't apply to the *fork* start " "method." msgstr "" -#: ../../library/multiprocessing.rst:2975 +#: ../../library/multiprocessing.rst:2974 msgid "More picklability" msgstr "" -#: ../../library/multiprocessing.rst:2977 +#: ../../library/multiprocessing.rst:2976 msgid "" "Ensure that all arguments to :meth:`Process.__init__` are picklable. Also, " "if you subclass :class:`~multiprocessing.Process` then make sure that " @@ -3273,11 +3276,11 @@ msgid "" "Process.start>` method is called." msgstr "" -#: ../../library/multiprocessing.rst:2982 +#: ../../library/multiprocessing.rst:2981 msgid "Global variables" msgstr "" -#: ../../library/multiprocessing.rst:2984 +#: ../../library/multiprocessing.rst:2983 msgid "" "Bear in mind that if code run in a child process tries to access a global " "variable, then the value it sees (if any) may not be the same as the value " @@ -3285,66 +3288,66 @@ msgid "" "Process.start>` was called." msgstr "" -#: ../../library/multiprocessing.rst:2989 +#: ../../library/multiprocessing.rst:2988 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: ../../library/multiprocessing.rst:2994 +#: ../../library/multiprocessing.rst:2993 msgid "Safe importing of main module" msgstr "" -#: ../../library/multiprocessing.rst:2996 +#: ../../library/multiprocessing.rst:2995 msgid "" "Make sure that the main module can be safely imported by a new Python " "interpreter without causing unintended side effects (such as starting a new " "process)." msgstr "" -#: ../../library/multiprocessing.rst:3000 +#: ../../library/multiprocessing.rst:2999 msgid "" "For example, using the *spawn* or *forkserver* start method running the " "following module would fail with a :exc:`RuntimeError`::" msgstr "" -#: ../../library/multiprocessing.rst:3012 +#: ../../library/multiprocessing.rst:3011 msgid "" "Instead one should protect the \"entry point\" of the program by using ``if " "__name__ == '__main__':`` as follows::" msgstr "" -#: ../../library/multiprocessing.rst:3026 +#: ../../library/multiprocessing.rst:3025 msgid "" "(The ``freeze_support()`` line can be omitted if the program will be run " "normally instead of frozen.)" msgstr "" -#: ../../library/multiprocessing.rst:3029 +#: ../../library/multiprocessing.rst:3028 msgid "" "This allows the newly spawned Python interpreter to safely import the module " "and then run the module's ``foo()`` function." msgstr "" -#: ../../library/multiprocessing.rst:3032 +#: ../../library/multiprocessing.rst:3031 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: ../../library/multiprocessing.rst:3039 +#: ../../library/multiprocessing.rst:3038 msgid "Examples" msgstr "範例" -#: ../../library/multiprocessing.rst:3041 +#: ../../library/multiprocessing.rst:3040 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: ../../library/multiprocessing.rst:3047 +#: ../../library/multiprocessing.rst:3046 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "" -#: ../../library/multiprocessing.rst:3053 +#: ../../library/multiprocessing.rst:3052 msgid "" "An example showing how to use queues to feed tasks to a collection of worker " "processes and collect the results:" diff --git a/library/shutil.po b/library/shutil.po index 403aea8be8..212f0bcbac 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-17 00:03+0000\n" +"POT-Creation-Date: 2024-02-19 19:55+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-" @@ -360,16 +360,16 @@ msgstr "" "copytree``。" #: ../../library/shutil.rst:277 -msgid "Copy metadata when *symlinks* is false. Now returns *dst*." -msgstr "" - -#: ../../library/shutil.rst:281 msgid "" "Added the *copy_function* argument to be able to provide a custom copy " "function. Added the *ignore_dangling_symlinks* argument to silence dangling " "symlinks errors when *symlinks* is false." msgstr "" +#: ../../library/shutil.rst:283 +msgid "Copy metadata when *symlinks* is false. Now returns *dst*." +msgstr "" + #: ../../library/shutil.rst:292 msgid "Added the *dirs_exist_ok* parameter." msgstr "新增 *dirs_exist_ok* 參數。" diff --git a/library/sys.po b/library/sys.po index d508600d1b..ad52ed3445 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-05 00:03+0000\n" +"POT-Creation-Date: 2024-02-19 19:55+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-" @@ -36,19 +36,24 @@ msgid "" "script, this contains the ABI flags as specified by :pep:`3149`." msgstr "" -#: ../../library/sys.rst:19 +#: ../../library/sys.rst:21 msgid "" "Default flags became an empty string (``m`` flag for pymalloc has been " "removed)." msgstr "" -#: ../../library/sys.rst:28 +#: ../../library/sys.rst:25 ../../library/sys.rst:765 +#: ../../library/sys.rst:1459 +msgid ":ref:`Availability `: Unix." +msgstr ":ref:`適用 `:Unix。" + +#: ../../library/sys.rst:30 msgid "" "Append the callable *hook* to the list of active auditing hooks for the " "current (sub)interpreter." msgstr "" -#: ../../library/sys.rst:31 +#: ../../library/sys.rst:33 msgid "" "When an auditing event is raised through the :func:`sys.audit` function, " "each hook will be called in the order it was added with the event name and " @@ -58,7 +63,7 @@ msgid "" "terminate the process entirely." msgstr "" -#: ../../library/sys.rst:38 +#: ../../library/sys.rst:40 msgid "" "Note that audit hooks are primarily for collecting information about " "internal or otherwise unobservable actions, whether by Python or libraries " @@ -70,7 +75,7 @@ msgid "" "mod:`ctypes`) should be completely removed or closely monitored." msgstr "" -#: ../../library/sys.rst:47 +#: ../../library/sys.rst:49 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``sys.addaudithook`` with no " @@ -78,7 +83,7 @@ msgid "" msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.addaudithook``。" -#: ../../library/sys.rst:49 +#: ../../library/sys.rst:51 msgid "" "Calling :func:`sys.addaudithook` will itself raise an auditing event named " "``sys.addaudithook`` with no arguments. If any existing hooks raise an " @@ -91,7 +96,7 @@ msgstr "" "衍生的例外,則不會添加新的 hook 並抑制異常。因此,除非呼叫者控制所有已存在的 " "hook,他們不能假設他們的 hook 已被添加。" -#: ../../library/sys.rst:56 +#: ../../library/sys.rst:58 msgid "" "See the :ref:`audit events table ` for all events raised by " "CPython, and :pep:`578` for the original design discussion." @@ -99,20 +104,20 @@ msgstr "" "所有會被 CPython 所引發的事件請參考\\ :ref:`稽核事件總表 `、設" "計相關討論請見 :pep:`578`。" -#: ../../library/sys.rst:63 +#: ../../library/sys.rst:65 msgid "" "Exceptions derived from :class:`Exception` but not :class:`RuntimeError` are " "no longer suppressed." msgstr "" -#: ../../library/sys.rst:68 +#: ../../library/sys.rst:70 msgid "" "When tracing is enabled (see :func:`settrace`), Python hooks are only traced " "if the callable has a ``__cantrace__`` member that is set to a true value. " "Otherwise, trace functions will skip the hook." msgstr "" -#: ../../library/sys.rst:75 +#: ../../library/sys.rst:77 msgid "" "The list of command line arguments passed to a Python script. ``argv[0]`` is " "the script name (it is operating system dependent whether this is a full " @@ -122,17 +127,17 @@ msgid "" "is the empty string." msgstr "" -#: ../../library/sys.rst:81 +#: ../../library/sys.rst:83 msgid "" "To loop over the standard input, or the list of files given on the command " "line, see the :mod:`fileinput` module." msgstr "" -#: ../../library/sys.rst:84 +#: ../../library/sys.rst:86 msgid "See also :data:`sys.orig_argv`." msgstr "另請參閱 :data:`sys.orig_argv`\\ 。" -#: ../../library/sys.rst:87 +#: ../../library/sys.rst:89 msgid "" "On Unix, command line arguments are passed by bytes from OS. Python decodes " "them with filesystem encoding and \"surrogateescape\" error handler. When " @@ -140,7 +145,7 @@ msgid "" "sys.argv]``." msgstr "" -#: ../../library/sys.rst:99 +#: ../../library/sys.rst:101 msgid "" "Raise an auditing event and trigger any active auditing hooks. *event* is a " "string identifying the event, and *args* may contain optional arguments with " @@ -149,7 +154,7 @@ msgid "" "modified between releases." msgstr "" -#: ../../library/sys.rst:105 +#: ../../library/sys.rst:107 msgid "" "For example, one auditing event is named ``os.chdir``. This event has one " "argument called *path* that will contain the requested new working directory." @@ -157,7 +162,7 @@ msgstr "" "舉例來說,一個名為 ``os.chdir`` 的稽核事件擁有一個引數 *path*,其內容為所要求" "的新工作目錄。" -#: ../../library/sys.rst:109 +#: ../../library/sys.rst:111 msgid "" ":func:`sys.audit` will call the existing auditing hooks, passing the event " "name and arguments, and will re-raise the first exception from any hook. In " @@ -167,26 +172,26 @@ msgid "" "merely log the event or abort the operation by raising an exception." msgstr "" -#: ../../library/sys.rst:117 +#: ../../library/sys.rst:119 msgid "" "Hooks are added using the :func:`sys.addaudithook` or :c:func:" "`PySys_AddAuditHook` functions." msgstr "" -#: ../../library/sys.rst:120 +#: ../../library/sys.rst:122 msgid "" "The native equivalent of this function is :c:func:`PySys_Audit`. Using the " "native function is preferred when possible." msgstr "" -#: ../../library/sys.rst:123 +#: ../../library/sys.rst:125 msgid "" "See the :ref:`audit events table ` for all events raised by " "CPython." msgstr "" "所有會被 CPython 所引發的事件請參考\\ :ref:`稽核事件總表 `。" -#: ../../library/sys.rst:131 +#: ../../library/sys.rst:133 msgid "" "Set during Python startup, before ``site.py`` is run, to the same value as :" "data:`exec_prefix`. If not running in a :ref:`virtual environment `, " @@ -208,56 +213,56 @@ msgid "" "Python installation (the one which the virtual environment was created from)." msgstr "" -#: ../../library/sys.rst:158 +#: ../../library/sys.rst:160 msgid "" "An indicator of the native byte order. This will have the value ``'big'`` " "on big-endian (most-significant byte first) platforms, and ``'little'`` on " "little-endian (least-significant byte first) platforms." msgstr "" -#: ../../library/sys.rst:165 +#: ../../library/sys.rst:167 msgid "" "A tuple of strings containing the names of all modules that are compiled " "into this Python interpreter. (This information is not available in any " "other way --- ``modules.keys()`` only lists the imported modules.)" msgstr "" -#: ../../library/sys.rst:169 +#: ../../library/sys.rst:171 msgid "See also the :data:`sys.stdlib_module_names` list." msgstr "另請參閱 :data:`sys.stdlib_module_names` 清單。" -#: ../../library/sys.rst:174 +#: ../../library/sys.rst:176 msgid "" "Call ``func(*args)``, while tracing is enabled. The tracing state is saved, " "and restored afterwards. This is intended to be called from a debugger from " "a checkpoint, to recursively debug or profile some other code." msgstr "" -#: ../../library/sys.rst:178 +#: ../../library/sys.rst:180 msgid "" "Tracing is suspended while calling a tracing function set by :func:" "`settrace` or :func:`setprofile` to avoid infinite recursion. :func:`!" "call_tracing` enables explicit recursion of the tracing function." msgstr "" -#: ../../library/sys.rst:185 +#: ../../library/sys.rst:187 msgid "A string containing the copyright pertaining to the Python interpreter." msgstr "" -#: ../../library/sys.rst:190 +#: ../../library/sys.rst:192 msgid "" "Clear the internal type cache. The type cache is used to speed up attribute " "and method lookups. Use the function *only* to drop unnecessary references " "during reference leak debugging." msgstr "" -#: ../../library/sys.rst:194 ../../library/sys.rst:210 -#: ../../library/sys.rst:223 +#: ../../library/sys.rst:196 ../../library/sys.rst:212 +#: ../../library/sys.rst:225 msgid "" "This function should be used for internal and specialized purposes only." msgstr "" -#: ../../library/sys.rst:199 +#: ../../library/sys.rst:201 msgid "" "Return a dictionary mapping each thread's identifier to the topmost stack " "frame currently active in that thread at the time the function is called. " @@ -265,7 +270,7 @@ msgid "" "given such a frame." msgstr "" -#: ../../library/sys.rst:204 +#: ../../library/sys.rst:206 msgid "" "This is most useful for debugging deadlock: this function does not require " "the deadlocked threads' cooperation, and such threads' call stacks are " @@ -274,14 +279,14 @@ msgid "" "by the time calling code examines the frame." msgstr "" -#: ../../library/sys.rst:212 +#: ../../library/sys.rst:214 msgid "" "Raises an :ref:`auditing event ` ``sys._current_frames`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys._current_frames``。" -#: ../../library/sys.rst:216 +#: ../../library/sys.rst:218 msgid "" "Return a dictionary mapping each thread's identifier to the topmost " "exception currently active in that thread at the time the function is " @@ -289,11 +294,11 @@ msgid "" "included in the result dictionary." msgstr "" -#: ../../library/sys.rst:221 +#: ../../library/sys.rst:223 msgid "This is most useful for statistical profiling." msgstr "" -#: ../../library/sys.rst:225 +#: ../../library/sys.rst:227 msgid "" "Raises an :ref:`auditing event ` ``sys._current_exceptions`` with " "no arguments." @@ -301,20 +306,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "_current_exceptions``。" -#: ../../library/sys.rst:227 +#: ../../library/sys.rst:229 msgid "" "Each value in the dictionary is now a single exception instance, rather than " "a 3-tuple as returned from ``sys.exc_info()``." msgstr "" -#: ../../library/sys.rst:233 +#: ../../library/sys.rst:235 msgid "" "This hook function is called by built-in :func:`breakpoint`. By default, it " "drops you into the :mod:`pdb` debugger, but it can be set to any other " "function so that you can choose which debugger gets used." msgstr "" -#: ../../library/sys.rst:237 +#: ../../library/sys.rst:239 msgid "" "The signature of this function is dependent on what it calls. For example, " "the default binding (e.g. ``pdb.set_trace()``) expects no arguments, but you " @@ -324,7 +329,7 @@ msgid "" "returns is returned from ``breakpoint()``." msgstr "" -#: ../../library/sys.rst:244 +#: ../../library/sys.rst:246 msgid "" "The default implementation first consults the environment variable :envvar:" "`PYTHONBREAKPOINT`. If that is set to ``\"0\"`` then this function returns " @@ -338,48 +343,48 @@ msgid "" "breakpointhook()`` returns to the built-in :func:`breakpoint` function." msgstr "" -#: ../../library/sys.rst:256 +#: ../../library/sys.rst:258 msgid "" "Note that if anything goes wrong while importing the callable named by :" "envvar:`PYTHONBREAKPOINT`, a :exc:`RuntimeWarning` is reported and the " "breakpoint is ignored." msgstr "" -#: ../../library/sys.rst:260 +#: ../../library/sys.rst:262 msgid "" "Also note that if ``sys.breakpointhook()`` is overridden programmatically, :" "envvar:`PYTHONBREAKPOINT` is *not* consulted." msgstr "" -#: ../../library/sys.rst:267 +#: ../../library/sys.rst:269 msgid "" "Print low-level information to stderr about the state of CPython's memory " "allocator." msgstr "" -#: ../../library/sys.rst:270 +#: ../../library/sys.rst:272 msgid "" "If Python is :ref:`built in debug mode ` (:option:`configure --" "with-pydebug option <--with-pydebug>`), it also performs some expensive " "internal consistency checks." msgstr "" -#: ../../library/sys.rst:278 +#: ../../library/sys.rst:280 msgid "" "This function is specific to CPython. The exact output format is not " "defined here, and may change." msgstr "" -#: ../../library/sys.rst:284 +#: ../../library/sys.rst:286 msgid "Integer specifying the handle of the Python DLL." msgstr "" -#: ../../library/sys.rst:286 ../../library/sys.rst:976 -#: ../../library/sys.rst:1743 ../../library/sys.rst:1979 +#: ../../library/sys.rst:288 ../../library/sys.rst:978 +#: ../../library/sys.rst:1745 ../../library/sys.rst:1981 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/sys.rst:291 +#: ../../library/sys.rst:293 msgid "" "If *value* is not ``None``, this function prints ``repr(value)`` to ``sys." "stdout``, and saves *value* in ``builtins._``. If ``repr(value)`` is not " @@ -388,7 +393,7 @@ msgid "" "encoding`` with ``'backslashreplace'`` error handler." msgstr "" -#: ../../library/sys.rst:297 +#: ../../library/sys.rst:299 msgid "" "``sys.displayhook`` is called on the result of evaluating an :term:" "`expression` entered in an interactive Python session. The display of these " @@ -396,15 +401,15 @@ msgid "" "displayhook``." msgstr "" -#: ../../library/sys.rst:301 +#: ../../library/sys.rst:303 msgid "Pseudo-code::" msgstr "" -#: ../../library/sys.rst:321 +#: ../../library/sys.rst:323 msgid "Use ``'backslashreplace'`` error handler on :exc:`UnicodeEncodeError`." msgstr "" -#: ../../library/sys.rst:327 +#: ../../library/sys.rst:329 msgid "" "If this is true, Python won't try to write ``.pyc`` files on the import of " "source modules. This value is initially set to ``True`` or ``False`` " @@ -413,20 +418,20 @@ msgid "" "to control bytecode file generation." msgstr "" -#: ../../library/sys.rst:336 +#: ../../library/sys.rst:338 msgid "" "A :term:`named tuple` holding information about the environment on the " "*wasm32-emscripten* platform. The named tuple is provisional and may change " "in the future." msgstr "" -#: ../../library/sys.rst:342 +#: ../../library/sys.rst:344 msgid "" "Emscripten version as tuple of ints (major, minor, micro), e.g. ``(3, 1, " "8)``." msgstr "" -#: ../../library/sys.rst:346 +#: ../../library/sys.rst:348 msgid "" "Runtime string, e.g. browser user agent, ``'Node.js v14.18.2'``, or " "``'UNKNOWN'``." @@ -434,19 +439,19 @@ msgstr "" "運行環境字串,例如瀏覽器使用者代理 (browser user agent) ``'Node.js " "v14.18.2'`` 或 ``'UNKNOWN'``。" -#: ../../library/sys.rst:350 +#: ../../library/sys.rst:352 msgid "``True`` if Python is compiled with Emscripten pthreads support." msgstr "" -#: ../../library/sys.rst:354 +#: ../../library/sys.rst:356 msgid "``True`` if Python is compiled with shared memory support." msgstr "" -#: ../../library/sys.rst:356 +#: ../../library/sys.rst:358 msgid ":ref:`Availability `: Emscripten." msgstr ":ref:`適用 `:Emscripten。" -#: ../../library/sys.rst:363 +#: ../../library/sys.rst:365 msgid "" "If this is set (not ``None``), Python will write bytecode-cache ``.pyc`` " "files to (and read them from) a parallel directory tree rooted at this " @@ -457,12 +462,12 @@ msgid "" "with the same pycache prefix (if any) that you will use at runtime." msgstr "" -#: ../../library/sys.rst:371 +#: ../../library/sys.rst:373 msgid "" "A relative path is interpreted relative to the current working directory." msgstr "" -#: ../../library/sys.rst:373 +#: ../../library/sys.rst:375 msgid "" "This value is initially set based on the value of the :option:`-X` " "``pycache_prefix=PATH`` command-line option or the :envvar:" @@ -470,12 +475,12 @@ msgid "" "If neither are set, it is ``None``." msgstr "" -#: ../../library/sys.rst:383 +#: ../../library/sys.rst:385 msgid "" "This function prints out a given traceback and exception to ``sys.stderr``." msgstr "" -#: ../../library/sys.rst:385 +#: ../../library/sys.rst:387 msgid "" "When an exception other than :exc:`SystemExit` is raised and uncaught, the " "interpreter calls ``sys.excepthook`` with three arguments, the exception " @@ -486,7 +491,7 @@ msgid "" "argument function to ``sys.excepthook``." msgstr "" -#: ../../library/sys.rst:392 +#: ../../library/sys.rst:394 msgid "" "Raises an :ref:`auditing event ` ``sys.excepthook`` with arguments " "``hook``, ``type``, ``value``, ``traceback``." @@ -494,7 +499,7 @@ msgstr "" "引發一個附帶引數 ``hook``、``type``、``value``、``traceback`` 的\\ :ref:`稽核" "事件 ` ``sys.excepthook``。" -#: ../../library/sys.rst:394 +#: ../../library/sys.rst:396 msgid "" "Raise an auditing event ``sys.excepthook`` with arguments ``hook``, " "``type``, ``value``, ``traceback`` when an uncaught exception occurs. If no " @@ -504,14 +509,14 @@ msgid "" "excepthook`` will be called." msgstr "" -#: ../../library/sys.rst:403 +#: ../../library/sys.rst:405 msgid "" "The :func:`sys.unraisablehook` function handles unraisable exceptions and " "the :func:`threading.excepthook` function handles exception raised by :func:" "`threading.Thread.run`." msgstr "" -#: ../../library/sys.rst:413 +#: ../../library/sys.rst:415 msgid "" "These objects contain the original values of ``breakpointhook``, " "``displayhook``, ``excepthook``, and ``unraisablehook`` at the start of the " @@ -520,15 +525,15 @@ msgid "" "get replaced with broken or alternative objects." msgstr "" -#: ../../library/sys.rst:419 +#: ../../library/sys.rst:421 msgid "__breakpointhook__" msgstr "__breakpointhook__" -#: ../../library/sys.rst:422 +#: ../../library/sys.rst:424 msgid "__unraisablehook__" msgstr "__unraisablehook__" -#: ../../library/sys.rst:428 +#: ../../library/sys.rst:430 msgid "" "This function, when called while an exception handler is executing (such as " "an ``except`` or ``except*`` clause), returns the exception instance that " @@ -536,11 +541,11 @@ msgid "" "another, only the exception handled by the innermost handler is accessible." msgstr "" -#: ../../library/sys.rst:433 +#: ../../library/sys.rst:435 msgid "If no exception handler is executing, this function returns ``None``." msgstr "" -#: ../../library/sys.rst:440 +#: ../../library/sys.rst:442 msgid "" "This function returns the old-style representation of the handled exception. " "If an exception ``e`` is currently handled (so :func:`exception` would " @@ -551,13 +556,13 @@ msgid "" "stack at the point where the exception last occurred." msgstr "" -#: ../../library/sys.rst:451 +#: ../../library/sys.rst:453 msgid "" "If no exception is being handled anywhere on the stack, this function return " "a tuple containing three ``None`` values." msgstr "" -#: ../../library/sys.rst:454 +#: ../../library/sys.rst:456 msgid "" "The ``type`` and ``traceback`` fields are now derived from the ``value`` " "(the exception instance), so when an exception is modified while it is being " @@ -565,7 +570,7 @@ msgid "" "func:`exc_info`." msgstr "" -#: ../../library/sys.rst:462 +#: ../../library/sys.rst:464 msgid "" "A string giving the site-specific directory prefix where the platform-" "dependent Python files are installed; by default, this is also ``'/usr/" @@ -577,7 +582,7 @@ msgid "" "is the version number of Python, for example ``3.2``." msgstr "" -#: ../../library/sys.rst:473 +#: ../../library/sys.rst:475 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " @@ -585,7 +590,7 @@ msgid "" "`base_exec_prefix`." msgstr "" -#: ../../library/sys.rst:481 +#: ../../library/sys.rst:483 msgid "" "A string giving the absolute path of the executable binary for the Python " "interpreter, on systems where this makes sense. If Python is unable to " @@ -593,13 +598,13 @@ msgid "" "empty string or ``None``." msgstr "" -#: ../../library/sys.rst:489 +#: ../../library/sys.rst:491 msgid "" "Raise a :exc:`SystemExit` exception, signaling an intention to exit the " "interpreter." msgstr "" -#: ../../library/sys.rst:491 +#: ../../library/sys.rst:493 msgid "" "The optional argument *arg* can be an integer giving the exit status " "(defaulting to zero), or another type of object. If it is an integer, zero " @@ -615,7 +620,7 @@ msgid "" "way to exit a program when an error occurs." msgstr "" -#: ../../library/sys.rst:504 +#: ../../library/sys.rst:506 msgid "" "Since :func:`exit` ultimately \"only\" raises an exception, it will only " "exit the process when called from the main thread, and the exception is not " @@ -624,113 +629,113 @@ msgid "" "an outer level." msgstr "" -#: ../../library/sys.rst:509 +#: ../../library/sys.rst:511 msgid "" "If an error occurs in the cleanup after the Python interpreter has caught :" "exc:`SystemExit` (such as an error flushing buffered data in the standard " "streams), the exit status is changed to 120." msgstr "" -#: ../../library/sys.rst:517 +#: ../../library/sys.rst:519 msgid "" "The :term:`named tuple` *flags* exposes the status of command line flags. " "The attributes are read only." msgstr "" -#: ../../library/sys.rst:523 +#: ../../library/sys.rst:525 msgid ":option:`-d`" msgstr ":option:`-d`" -#: ../../library/sys.rst:526 ../../library/sys.rst:529 +#: ../../library/sys.rst:528 ../../library/sys.rst:531 msgid ":option:`-i`" msgstr ":option:`-i`" -#: ../../library/sys.rst:532 +#: ../../library/sys.rst:534 msgid ":option:`-I`" msgstr ":option:`-I`" -#: ../../library/sys.rst:535 +#: ../../library/sys.rst:537 msgid ":option:`-O` or :option:`-OO`" msgstr ":option:`-O` 或 :option:`-OO`" -#: ../../library/sys.rst:538 +#: ../../library/sys.rst:540 msgid ":option:`-B`" msgstr ":option:`-B`" -#: ../../library/sys.rst:541 +#: ../../library/sys.rst:543 msgid ":option:`-s`" msgstr ":option:`-s`" -#: ../../library/sys.rst:544 +#: ../../library/sys.rst:546 msgid ":option:`-S`" msgstr ":option:`-S`" -#: ../../library/sys.rst:547 +#: ../../library/sys.rst:549 msgid ":option:`-E`" msgstr ":option:`-E`" -#: ../../library/sys.rst:550 +#: ../../library/sys.rst:552 msgid ":option:`-v`" msgstr ":option:`-v`" -#: ../../library/sys.rst:553 +#: ../../library/sys.rst:555 msgid ":option:`-b`" msgstr ":option:`-b`" -#: ../../library/sys.rst:556 +#: ../../library/sys.rst:558 msgid ":option:`-q`" msgstr ":option:`-q`" -#: ../../library/sys.rst:559 +#: ../../library/sys.rst:561 msgid ":option:`-R`" msgstr ":option:`-R`" -#: ../../library/sys.rst:562 +#: ../../library/sys.rst:564 msgid ":option:`-X dev <-X>` (:ref:`Python Development Mode `)" msgstr ":option:`-X dev <-X>` (:ref:`Python 開發模式 `)" -#: ../../library/sys.rst:565 +#: ../../library/sys.rst:567 msgid ":option:`-X utf8 <-X>`" msgstr ":option:`-X utf8 <-X>`" -#: ../../library/sys.rst:568 +#: ../../library/sys.rst:570 msgid ":option:`-P`" msgstr ":option:`-P`" -#: ../../library/sys.rst:571 +#: ../../library/sys.rst:573 msgid "" ":option:`-X int_max_str_digits <-X>` (:ref:`integer string conversion length " "limitation `)" msgstr "" -#: ../../library/sys.rst:575 +#: ../../library/sys.rst:577 msgid ":option:`-X warn_default_encoding <-X>`" msgstr ":option:`-X warn_default_encoding <-X>`" -#: ../../library/sys.rst:577 +#: ../../library/sys.rst:579 msgid "Added ``quiet`` attribute for the new :option:`-q` flag." msgstr "新增 ``quiet`` 屬性,用於新的 :option:`-q` 旗標。" -#: ../../library/sys.rst:580 +#: ../../library/sys.rst:582 msgid "The ``hash_randomization`` attribute." msgstr "``hash_randomization`` 屬性。" -#: ../../library/sys.rst:583 +#: ../../library/sys.rst:585 msgid "Removed obsolete ``division_warning`` attribute." msgstr "移除過時的 ``division_warning`` 屬性。" -#: ../../library/sys.rst:586 +#: ../../library/sys.rst:588 msgid "Added ``isolated`` attribute for :option:`-I` ``isolated`` flag." msgstr "新增 ``isolated`` 屬性,用於 :option:`-I` ``isolated`` 旗標。" -#: ../../library/sys.rst:589 +#: ../../library/sys.rst:591 msgid "" "Added the ``dev_mode`` attribute for the new :ref:`Python Development Mode " "` and the ``utf8_mode`` attribute for the new :option:`-X` " "``utf8`` flag." msgstr "" -#: ../../library/sys.rst:594 +#: ../../library/sys.rst:596 msgid "" "Added ``warn_default_encoding`` attribute for :option:`-X` " "``warn_default_encoding`` flag." @@ -738,15 +743,15 @@ msgstr "" "新增 ``warn_default_encoding`` 屬性,用於 :option:`-X` " "``warn_default_encoding`` 旗標。" -#: ../../library/sys.rst:597 +#: ../../library/sys.rst:599 msgid "Added the ``safe_path`` attribute for :option:`-P` option." msgstr "新增 ``safe_path`` 屬性,用於 :option:`-P` 選項。" -#: ../../library/sys.rst:600 +#: ../../library/sys.rst:602 msgid "Added the ``int_max_str_digits`` attribute." msgstr "新增 ``int_max_str_digits`` 屬性。" -#: ../../library/sys.rst:606 +#: ../../library/sys.rst:608 msgid "" "A :term:`named tuple` holding information about the float type. It contains " "low level information about the precision and internal representation. The " @@ -756,161 +761,161 @@ msgid "" "floating types', for details." msgstr "" -#: ../../library/sys.rst:613 +#: ../../library/sys.rst:615 msgid "Attributes of the :data:`!float_info` :term:`named tuple`" msgstr "" -#: ../../library/sys.rst:616 +#: ../../library/sys.rst:618 msgid "attribute" msgstr "屬性" -#: ../../library/sys.rst:617 +#: ../../library/sys.rst:619 msgid "float.h macro" msgstr "float.h macro" -#: ../../library/sys.rst:618 +#: ../../library/sys.rst:620 msgid "explanation" msgstr "解釋" -#: ../../library/sys.rst:621 +#: ../../library/sys.rst:623 msgid ":c:macro:`!DBL_EPSILON`" msgstr ":c:macro:`!DBL_EPSILON`" -#: ../../library/sys.rst:622 +#: ../../library/sys.rst:624 msgid "" "difference between 1.0 and the least value greater than 1.0 that is " "representable as a float." msgstr "" -#: ../../library/sys.rst:625 +#: ../../library/sys.rst:627 msgid "See also :func:`math.ulp`." msgstr "另請參閱 :func:`math.ulp`。" -#: ../../library/sys.rst:628 +#: ../../library/sys.rst:630 msgid ":c:macro:`!DBL_DIG`" msgstr ":c:macro:`!DBL_DIG`" -#: ../../library/sys.rst:629 +#: ../../library/sys.rst:631 msgid "" "The maximum number of decimal digits that can be faithfully represented in a " "float; see below." msgstr "" -#: ../../library/sys.rst:633 +#: ../../library/sys.rst:635 msgid ":c:macro:`!DBL_MANT_DIG`" msgstr ":c:macro:`!DBL_MANT_DIG`" -#: ../../library/sys.rst:634 +#: ../../library/sys.rst:636 msgid "" "Float precision: the number of base-``radix`` digits in the significand of a " "float." msgstr "" -#: ../../library/sys.rst:638 +#: ../../library/sys.rst:640 msgid ":c:macro:`!DBL_MAX`" msgstr ":c:macro:`!DBL_MAX`" -#: ../../library/sys.rst:639 +#: ../../library/sys.rst:641 msgid "The maximum representable positive finite float." msgstr "" -#: ../../library/sys.rst:642 +#: ../../library/sys.rst:644 msgid ":c:macro:`!DBL_MAX_EXP`" msgstr ":c:macro:`!DBL_MAX_EXP`" -#: ../../library/sys.rst:643 +#: ../../library/sys.rst:645 msgid "" "The maximum integer *e* such that ``radix**(e-1)`` is a representable finite " "float." msgstr "" -#: ../../library/sys.rst:647 +#: ../../library/sys.rst:649 msgid ":c:macro:`!DBL_MAX_10_EXP`" msgstr ":c:macro:`!DBL_MAX_10_EXP`" -#: ../../library/sys.rst:648 +#: ../../library/sys.rst:650 msgid "" "The maximum integer *e* such that ``10**e`` is in the range of representable " "finite floats." msgstr "" -#: ../../library/sys.rst:652 +#: ../../library/sys.rst:654 msgid ":c:macro:`!DBL_MIN`" msgstr ":c:macro:`!DBL_MIN`" -#: ../../library/sys.rst:653 +#: ../../library/sys.rst:655 msgid "The minimum representable positive *normalized* float." msgstr "" -#: ../../library/sys.rst:655 +#: ../../library/sys.rst:657 msgid "" "Use :func:`math.ulp(0.0) ` to get the smallest positive " "*denormalized* representable float." msgstr "" -#: ../../library/sys.rst:659 +#: ../../library/sys.rst:661 msgid ":c:macro:`!DBL_MIN_EXP`" msgstr ":c:macro:`!DBL_MIN_EXP`" -#: ../../library/sys.rst:660 +#: ../../library/sys.rst:662 msgid "" "The minimum integer *e* such that ``radix**(e-1)`` is a normalized float." msgstr "" -#: ../../library/sys.rst:664 +#: ../../library/sys.rst:666 msgid ":c:macro:`!DBL_MIN_10_EXP`" msgstr ":c:macro:`!DBL_MIN_10_EXP`" -#: ../../library/sys.rst:665 +#: ../../library/sys.rst:667 msgid "The minimum integer *e* such that ``10**e`` is a normalized float." msgstr "" -#: ../../library/sys.rst:668 +#: ../../library/sys.rst:670 msgid ":c:macro:`!FLT_RADIX`" msgstr ":c:macro:`!FLT_RADIX`" -#: ../../library/sys.rst:669 +#: ../../library/sys.rst:671 msgid "The radix of exponent representation." msgstr "" -#: ../../library/sys.rst:672 +#: ../../library/sys.rst:674 msgid ":c:macro:`!FLT_ROUNDS`" msgstr ":c:macro:`!FLT_ROUNDS`" -#: ../../library/sys.rst:673 +#: ../../library/sys.rst:675 msgid "" "An integer representing the rounding mode for floating-point arithmetic. " "This reflects the value of the system :c:macro:`!FLT_ROUNDS` macro at " "interpreter startup time:" msgstr "" -#: ../../library/sys.rst:677 +#: ../../library/sys.rst:679 msgid "``-1``: indeterminable" msgstr "" -#: ../../library/sys.rst:678 +#: ../../library/sys.rst:680 msgid "``0``: toward zero" msgstr "" -#: ../../library/sys.rst:679 +#: ../../library/sys.rst:681 msgid "``1``: to nearest" msgstr "" -#: ../../library/sys.rst:680 +#: ../../library/sys.rst:682 msgid "``2``: toward positive infinity" msgstr "" -#: ../../library/sys.rst:681 +#: ../../library/sys.rst:683 msgid "``3``: toward negative infinity" msgstr "" -#: ../../library/sys.rst:683 +#: ../../library/sys.rst:685 msgid "" "All other values for :c:macro:`!FLT_ROUNDS` characterize implementation-" "defined rounding behavior." msgstr "" -#: ../../library/sys.rst:686 +#: ../../library/sys.rst:688 msgid "" "The attribute :attr:`sys.float_info.dig` needs further explanation. If " "``s`` is any string representing a decimal number with at most :attr:`!sys." @@ -918,13 +923,13 @@ msgid "" "back again will recover a string representing the same decimal value::" msgstr "" -#: ../../library/sys.rst:699 +#: ../../library/sys.rst:701 msgid "" "But for strings with more than :attr:`sys.float_info.dig` significant " "digits, this isn't always true::" msgstr "" -#: ../../library/sys.rst:708 +#: ../../library/sys.rst:710 msgid "" "A string indicating how the :func:`repr` function behaves for floats. If " "the string has value ``'short'`` then for a finite float ``x``, ``repr(x)`` " @@ -934,7 +939,7 @@ msgid "" "same way as it did in versions of Python prior to 3.1." msgstr "" -#: ../../library/sys.rst:721 +#: ../../library/sys.rst:723 msgid "" "Return the number of memory blocks currently allocated by the interpreter, " "regardless of their size. This function is mainly useful for tracking and " @@ -944,42 +949,38 @@ msgid "" "results." msgstr "" -#: ../../library/sys.rst:728 +#: ../../library/sys.rst:730 msgid "" "If a Python build or implementation cannot reasonably compute this " "information, :func:`getallocatedblocks()` is allowed to return 0 instead." msgstr "" -#: ../../library/sys.rst:736 +#: ../../library/sys.rst:738 msgid "Return the number of unicode objects that have been interned." msgstr "" -#: ../../library/sys.rst:743 +#: ../../library/sys.rst:745 msgid "Return the build time API version of Android as an integer." msgstr "" -#: ../../library/sys.rst:745 +#: ../../library/sys.rst:747 msgid ":ref:`Availability `: Android." msgstr ":ref:`適用 `:Android。" -#: ../../library/sys.rst:752 +#: ../../library/sys.rst:754 msgid "" "Return the name of the current default string encoding used by the Unicode " "implementation." msgstr "" -#: ../../library/sys.rst:758 +#: ../../library/sys.rst:760 msgid "" "Return the current value of the flags that are used for :c:func:`dlopen` " "calls. Symbolic names for the flag values can be found in the :mod:`os` " "module (:samp:`RTLD_{xxx}` constants, e.g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:763 ../../library/sys.rst:1457 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" - -#: ../../library/sys.rst:768 +#: ../../library/sys.rst:770 msgid "" "Get the :term:`filesystem encoding `: " "the encoding used with the :term:`filesystem error handler ` is enabled." msgstr "" -#: ../../library/sys.rst:801 +#: ../../library/sys.rst:803 msgid "" "Get the :term:`filesystem error handler `: the error handler used with the :term:`filesystem encoding " @@ -1034,20 +1035,20 @@ msgid "" "func:`getfilesystemencoding`." msgstr "" -#: ../../library/sys.rst:819 +#: ../../library/sys.rst:821 msgid "" "Returns the current value for the :ref:`integer string conversion length " "limitation `. See also :func:`set_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:826 +#: ../../library/sys.rst:828 msgid "" "Return the reference count of the *object*. The count returned is generally " "one higher than you might expect, because it includes the (temporary) " "reference as an argument to :func:`getrefcount`." msgstr "" -#: ../../library/sys.rst:830 +#: ../../library/sys.rst:832 msgid "" "Note that the returned value may not actually reflect how many references to " "the object are actually held. For example, some objects are \"immortal\" " @@ -1056,13 +1057,13 @@ msgid "" "other than a value of 0 or 1." msgstr "" -#: ../../library/sys.rst:836 +#: ../../library/sys.rst:838 msgid "" "Immortal objects have very large refcounts that do not match the actual " "number of references to the object." msgstr "" -#: ../../library/sys.rst:842 +#: ../../library/sys.rst:844 msgid "" "Return the current value of the recursion limit, the maximum depth of the " "Python interpreter stack. This limit prevents infinite recursion from " @@ -1070,46 +1071,46 @@ msgid "" "func:`setrecursionlimit`." msgstr "" -#: ../../library/sys.rst:850 +#: ../../library/sys.rst:852 msgid "" "Return the size of an object in bytes. The object can be any type of object. " "All built-in objects will return correct results, but this does not have to " "hold true for third-party extensions as it is implementation specific." msgstr "" -#: ../../library/sys.rst:855 +#: ../../library/sys.rst:857 msgid "" "Only the memory consumption directly attributed to the object is accounted " "for, not the memory consumption of objects it refers to." msgstr "" -#: ../../library/sys.rst:858 +#: ../../library/sys.rst:860 msgid "" "If given, *default* will be returned if the object does not provide means to " "retrieve the size. Otherwise a :exc:`TypeError` will be raised." msgstr "" -#: ../../library/sys.rst:861 +#: ../../library/sys.rst:863 msgid "" ":func:`getsizeof` calls the object's ``__sizeof__`` method and adds an " "additional garbage collector overhead if the object is managed by the " "garbage collector." msgstr "" -#: ../../library/sys.rst:865 +#: ../../library/sys.rst:867 msgid "" "See `recursive sizeof recipe `_ for an example of using :func:`getsizeof` recursively to find the size " "of containers and all their contents." msgstr "" -#: ../../library/sys.rst:871 +#: ../../library/sys.rst:873 msgid "" "Return the interpreter's \"thread switch interval\"; see :func:" "`setswitchinterval`." msgstr "" -#: ../../library/sys.rst:879 +#: ../../library/sys.rst:881 msgid "" "Return a frame object from the call stack. If optional integer *depth* is " "given, return the frame object that many calls below the top of the stack. " @@ -1118,7 +1119,7 @@ msgid "" "stack." msgstr "" -#: ../../library/sys.rst:884 +#: ../../library/sys.rst:886 msgid "" "Raises an :ref:`auditing event ` ``sys._getframe`` with argument " "``frame``." @@ -1126,13 +1127,13 @@ msgstr "" "引發一個附帶引數 ``frame`` 的\\ :ref:`稽核事件 ` ``sys." "_getframe``。" -#: ../../library/sys.rst:888 ../../library/sys.rst:904 +#: ../../library/sys.rst:890 ../../library/sys.rst:906 msgid "" "This function should be used for internal and specialized purposes only. It " "is not guaranteed to exist in all implementations of Python." msgstr "" -#: ../../library/sys.rst:894 +#: ../../library/sys.rst:896 msgid "" "Return the name of a module from the call stack. If optional integer " "*depth* is given, return the module that many calls below the top of the " @@ -1141,7 +1142,7 @@ msgid "" "returning the module at the top of the call stack." msgstr "" -#: ../../library/sys.rst:900 +#: ../../library/sys.rst:902 msgid "" "Raises an :ref:`auditing event ` ``sys._getframemodulename`` with " "argument ``depth``." @@ -1149,15 +1150,15 @@ msgstr "" "引發一個附帶引數 ``depth`` 的\\ :ref:`稽核事件 ` ``sys." "_getframemodulename``。" -#: ../../library/sys.rst:914 +#: ../../library/sys.rst:916 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: ../../library/sys.rst:923 +#: ../../library/sys.rst:925 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: ../../library/sys.rst:927 +#: ../../library/sys.rst:929 msgid "" "The :func:`gettrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -1165,7 +1166,7 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:935 +#: ../../library/sys.rst:937 msgid "" "Return a named tuple describing the Windows version currently running. The " "named elements are *major*, *minor*, *build*, *platform*, *service_pack*, " @@ -1177,54 +1178,54 @@ msgid "" "first 5 elements are retrievable by indexing." msgstr "" -#: ../../library/sys.rst:946 +#: ../../library/sys.rst:948 msgid "*platform* will be ``2`` (VER_PLATFORM_WIN32_NT)." msgstr "" -#: ../../library/sys.rst:948 +#: ../../library/sys.rst:950 msgid "*product_type* may be one of the following values:" msgstr "" -#: ../../library/sys.rst:951 +#: ../../library/sys.rst:953 msgid "Constant" msgstr "" -#: ../../library/sys.rst:951 +#: ../../library/sys.rst:953 msgid "Meaning" msgstr "" -#: ../../library/sys.rst:953 +#: ../../library/sys.rst:955 msgid "``1`` (VER_NT_WORKSTATION)" msgstr "``1`` (VER_NT_WORKSTATION)" -#: ../../library/sys.rst:953 +#: ../../library/sys.rst:955 msgid "The system is a workstation." msgstr "" -#: ../../library/sys.rst:955 +#: ../../library/sys.rst:957 msgid "``2`` (VER_NT_DOMAIN_CONTROLLER)" msgstr "``2`` (VER_NT_DOMAIN_CONTROLLER)" -#: ../../library/sys.rst:955 +#: ../../library/sys.rst:957 msgid "The system is a domain controller." msgstr "" -#: ../../library/sys.rst:958 +#: ../../library/sys.rst:960 msgid "``3`` (VER_NT_SERVER)" msgstr "``3`` (VER_NT_SERVER)" -#: ../../library/sys.rst:958 +#: ../../library/sys.rst:960 msgid "The system is a server, but not a domain controller." msgstr "" -#: ../../library/sys.rst:962 +#: ../../library/sys.rst:964 msgid "" "This function wraps the Win32 :c:func:`!GetVersionEx` function; see the " "Microsoft documentation on :c:func:`!OSVERSIONINFOEX` for more information " "about these fields." msgstr "" -#: ../../library/sys.rst:966 +#: ../../library/sys.rst:968 msgid "" "*platform_version* returns the major version, minor version and build number " "of the current operating system, rather than the version that is being " @@ -1232,24 +1233,24 @@ msgid "" "feature detection." msgstr "" -#: ../../library/sys.rst:972 +#: ../../library/sys.rst:974 msgid "" "*platform_version* derives the version from kernel32.dll which can be of a " "different version than the OS version. Please use :mod:`platform` module for " "achieving accurate OS version." msgstr "" -#: ../../library/sys.rst:978 +#: ../../library/sys.rst:980 msgid "" "Changed to a named tuple and added *service_pack_minor*, " "*service_pack_major*, *suite_mask*, and *product_type*." msgstr "" -#: ../../library/sys.rst:982 +#: ../../library/sys.rst:984 msgid "Added *platform_version*" msgstr "新增 *platform_version*" -#: ../../library/sys.rst:988 +#: ../../library/sys.rst:990 msgid "" "Returns an *asyncgen_hooks* object, which is similar to a :class:" "`~collections.namedtuple` of the form ``(firstiter, finalizer)``, where " @@ -1259,71 +1260,71 @@ msgid "" "loop." msgstr "" -#: ../../library/sys.rst:995 +#: ../../library/sys.rst:997 msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`\\ 。" -#: ../../library/sys.rst:999 ../../library/sys.rst:1675 +#: ../../library/sys.rst:1001 ../../library/sys.rst:1677 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" msgstr "" -#: ../../library/sys.rst:1005 +#: ../../library/sys.rst:1007 msgid "" "Get the current coroutine origin tracking depth, as set by :func:" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:1011 ../../library/sys.rst:1696 +#: ../../library/sys.rst:1013 ../../library/sys.rst:1698 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." msgstr "" -#: ../../library/sys.rst:1017 +#: ../../library/sys.rst:1019 msgid "" "A :term:`named tuple` giving parameters of the numeric hash implementation. " "For more details about hashing of numeric types, see :ref:`numeric-hash`." msgstr "" -#: ../../library/sys.rst:1023 +#: ../../library/sys.rst:1025 msgid "The width in bits used for hash values" msgstr "" -#: ../../library/sys.rst:1027 +#: ../../library/sys.rst:1029 msgid "The prime modulus P used for numeric hash scheme" msgstr "" -#: ../../library/sys.rst:1031 +#: ../../library/sys.rst:1033 msgid "The hash value returned for a positive infinity" msgstr "" -#: ../../library/sys.rst:1035 +#: ../../library/sys.rst:1037 msgid "(This attribute is no longer used)" msgstr "" -#: ../../library/sys.rst:1039 +#: ../../library/sys.rst:1041 msgid "The multiplier used for the imaginary part of a complex number" msgstr "" -#: ../../library/sys.rst:1043 +#: ../../library/sys.rst:1045 msgid "The name of the algorithm for hashing of str, bytes, and memoryview" msgstr "" -#: ../../library/sys.rst:1047 +#: ../../library/sys.rst:1049 msgid "The internal output size of the hash algorithm" msgstr "" -#: ../../library/sys.rst:1051 +#: ../../library/sys.rst:1053 msgid "The size of the seed key of the hash algorithm" msgstr "" -#: ../../library/sys.rst:1055 +#: ../../library/sys.rst:1057 msgid "Added *algorithm*, *hash_bits* and *seed_bits*" msgstr "新增 *algorithm*\\ 、\\ *hash_bits* 與 *seed_bits*" -#: ../../library/sys.rst:1061 +#: ../../library/sys.rst:1063 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " @@ -1331,7 +1332,7 @@ msgid "" "version 1.5.2, use::" msgstr "" -#: ../../library/sys.rst:1072 +#: ../../library/sys.rst:1074 msgid "" "This is called ``hexversion`` since it only really looks meaningful when " "viewed as the result of passing it to the built-in :func:`hex` function. " @@ -1339,25 +1340,25 @@ msgid "" "human-friendly encoding of the same information." msgstr "" -#: ../../library/sys.rst:1077 +#: ../../library/sys.rst:1079 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" -#: ../../library/sys.rst:1082 +#: ../../library/sys.rst:1084 msgid "" "An object containing information about the implementation of the currently " "running Python interpreter. The following attributes are required to exist " "in all Python implementations." msgstr "" -#: ../../library/sys.rst:1086 +#: ../../library/sys.rst:1088 msgid "" "*name* is the implementation's identifier, e.g. ``'cpython'``. The actual " "string is defined by the Python implementation, but it is guaranteed to be " "lower case." msgstr "" -#: ../../library/sys.rst:1090 +#: ../../library/sys.rst:1092 msgid "" "*version* is a named tuple, in the same format as :data:`sys.version_info`. " "It represents the version of the Python *implementation*. This has a " @@ -1369,13 +1370,13 @@ msgid "" "the same value, since it is the reference implementation." msgstr "" -#: ../../library/sys.rst:1100 +#: ../../library/sys.rst:1102 msgid "" "*hexversion* is the implementation version in hexadecimal format, like :data:" "`sys.hexversion`." msgstr "" -#: ../../library/sys.rst:1103 +#: ../../library/sys.rst:1105 msgid "" "*cache_tag* is the tag used by the import machinery in the filenames of " "cached modules. By convention, it would be a composite of the " @@ -1384,7 +1385,7 @@ msgid "" "set to ``None``, it indicates that module caching should be disabled." msgstr "" -#: ../../library/sys.rst:1110 +#: ../../library/sys.rst:1112 msgid "" ":data:`sys.implementation` may contain additional attributes specific to the " "Python implementation. These non-standard attributes must start with an " @@ -1394,41 +1395,41 @@ msgid "" "versions, however.) See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1121 +#: ../../library/sys.rst:1123 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1126 +#: ../../library/sys.rst:1128 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" -#: ../../library/sys.rst:1131 +#: ../../library/sys.rst:1133 msgid "" "The number of bits held in each digit. Python integers are stored internally " "in base ``2**int_info.bits_per_digit``." msgstr "" -#: ../../library/sys.rst:1136 +#: ../../library/sys.rst:1138 msgid "The size in bytes of the C type used to represent a digit." msgstr "" -#: ../../library/sys.rst:1140 +#: ../../library/sys.rst:1142 msgid "" "The default value for :func:`sys.get_int_max_str_digits` when it is not " "otherwise explicitly configured." msgstr "" -#: ../../library/sys.rst:1145 +#: ../../library/sys.rst:1147 msgid "" "The minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:" "`PYTHONINTMAXSTRDIGITS`, or :option:`-X int_max_str_digits <-X>`." msgstr "" -#: ../../library/sys.rst:1152 +#: ../../library/sys.rst:1154 msgid "" "Added :attr:`~int_info.default_max_str_digits` and :attr:`~int_info." "str_digits_check_threshold`." @@ -1436,7 +1437,7 @@ msgstr "" "新增 :attr:`~int_info.default_max_str_digits` 和 :attr:`~int_info." "str_digits_check_threshold`。" -#: ../../library/sys.rst:1158 +#: ../../library/sys.rst:1160 msgid "" "When this attribute exists, its value is automatically called (with no " "arguments) when the interpreter is launched in :ref:`interactive mode `." msgstr "" -#: ../../library/sys.rst:1164 +#: ../../library/sys.rst:1166 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with argument ``hook``." @@ -1453,13 +1454,13 @@ msgstr "" "引發一個附帶引數 ``hook`` 的\\ :ref:`稽核事件 ` ``cpython." "run_interactivehook``。" -#: ../../library/sys.rst:1166 +#: ../../library/sys.rst:1168 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with the hook object as the argument when the hook is called on startup." msgstr "" -#: ../../library/sys.rst:1175 +#: ../../library/sys.rst:1177 msgid "" "Enter *string* in the table of \"interned\" strings and return the interned " "string -- which is *string* itself or a copy. Interning strings is useful to " @@ -1471,19 +1472,19 @@ msgid "" "attributes have interned keys." msgstr "" -#: ../../library/sys.rst:1183 +#: ../../library/sys.rst:1185 msgid "" "Interned strings are not immortal; you must keep a reference to the return " "value of :func:`intern` around to benefit from it." msgstr "" -#: ../../library/sys.rst:1189 +#: ../../library/sys.rst:1191 msgid "" "Return :const:`True` if the Python interpreter is :term:`shutting down " "`, :const:`False` otherwise." msgstr "" -#: ../../library/sys.rst:1196 +#: ../../library/sys.rst:1198 msgid "" "This variable is not always defined; it is set to the exception instance " "when an exception is not handled and the interpreter prints an error message " @@ -1494,34 +1495,34 @@ msgid "" "more information.)" msgstr "" -#: ../../library/sys.rst:1210 +#: ../../library/sys.rst:1212 msgid "" "These three variables are deprecated; use :data:`sys.last_exc` instead. They " "hold the legacy representation of ``sys.last_exc``, as returned from :func:" "`exc_info` above." msgstr "" -#: ../../library/sys.rst:1216 +#: ../../library/sys.rst:1218 msgid "" "An integer giving the maximum value a variable of type :c:type:`Py_ssize_t` " "can take. It's usually ``2**31 - 1`` on a 32-bit platform and ``2**63 - 1`` " "on a 64-bit platform." msgstr "" -#: ../../library/sys.rst:1223 +#: ../../library/sys.rst:1225 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" -#: ../../library/sys.rst:1226 +#: ../../library/sys.rst:1228 msgid "" "Before :pep:`393`, ``sys.maxunicode`` used to be either ``0xFFFF`` or " "``0x10FFFF``, depending on the configuration option that specified whether " "Unicode characters were stored as UCS-2 or UCS-4." msgstr "" -#: ../../library/sys.rst:1234 +#: ../../library/sys.rst:1236 msgid "" "A list of :term:`meta path finder` objects that have their :meth:`~importlib." "abc.MetaPathFinder.find_spec` methods called to see if one of the objects " @@ -1534,40 +1535,40 @@ msgid "" "if the module cannot be found." msgstr "" -#: ../../library/sys.rst:1247 +#: ../../library/sys.rst:1249 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr ":class:`importlib.abc.MetaPathFinder`" -#: ../../library/sys.rst:1247 +#: ../../library/sys.rst:1249 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: ../../library/sys.rst:1251 +#: ../../library/sys.rst:1253 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr ":class:`importlib.machinery.ModuleSpec`" -#: ../../library/sys.rst:1250 +#: ../../library/sys.rst:1252 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1256 +#: ../../library/sys.rst:1258 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`." msgstr "" -#: ../../library/sys.rst:1261 +#: ../../library/sys.rst:1263 msgid "" "Removed the fallback that looked for a :meth:`!find_module` method if a :" "data:`meta_path` entry didn't have a :meth:`~importlib.abc.MetaPathFinder." "find_spec` method." msgstr "" -#: ../../library/sys.rst:1267 +#: ../../library/sys.rst:1269 msgid "" "This is a dictionary that maps module names to modules which have already " "been loaded. This can be manipulated to force reloading of modules and " @@ -1579,13 +1580,13 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1279 +#: ../../library/sys.rst:1281 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1282 +#: ../../library/sys.rst:1284 msgid "" "The elements of :data:`sys.orig_argv` are the arguments to the Python " "interpreter, while the elements of :data:`sys.argv` are the arguments to the " @@ -1593,68 +1594,68 @@ msgid "" "in :data:`sys.orig_argv` and missing from :data:`sys.argv`." msgstr "" -#: ../../library/sys.rst:1294 +#: ../../library/sys.rst:1296 msgid "" "A list of strings that specifies the search path for modules. Initialized " "from the environment variable :envvar:`PYTHONPATH`, plus an installation-" "dependent default." msgstr "" -#: ../../library/sys.rst:1298 +#: ../../library/sys.rst:1300 msgid "" "By default, as initialized upon program startup, a potentially unsafe path " "is prepended to :data:`sys.path` (*before* the entries inserted as a result " "of :envvar:`PYTHONPATH`):" msgstr "" -#: ../../library/sys.rst:1302 +#: ../../library/sys.rst:1304 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1304 +#: ../../library/sys.rst:1306 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1306 +#: ../../library/sys.rst:1308 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1309 +#: ../../library/sys.rst:1311 msgid "" "To not prepend this potentially unsafe path, use the :option:`-P` command " "line option or the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" -#: ../../library/sys.rst:1312 +#: ../../library/sys.rst:1314 msgid "" "A program is free to modify this list for its own purposes. Only strings " "should be added to :data:`sys.path`; all other data types are ignored during " "import." msgstr "" -#: ../../library/sys.rst:1318 +#: ../../library/sys.rst:1320 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1323 +#: ../../library/sys.rst:1325 msgid "" "A list of callables that take a path argument to try to create a :term:" "`finder` for the path. If a finder can be created, it is to be returned by " "the callable, else raise :exc:`ImportError`." msgstr "" -#: ../../library/sys.rst:1327 ../../library/sys.rst:1338 +#: ../../library/sys.rst:1329 ../../library/sys.rst:1340 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1332 +#: ../../library/sys.rst:1334 msgid "" "A dictionary acting as a cache for :term:`finder` objects. The keys are " "paths that have been passed to :data:`sys.path_hooks` and the values are the " @@ -1662,13 +1663,13 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1343 +#: ../../library/sys.rst:1345 msgid "" "This string contains a platform identifier that can be used to append " "platform-specific components to :data:`sys.path`, for instance." msgstr "" -#: ../../library/sys.rst:1346 +#: ../../library/sys.rst:1348 msgid "" "For Unix systems, except on Linux and AIX, this is the lowercased OS name as " "returned by ``uname -s`` with the first part of the version as returned by " @@ -1677,75 +1678,75 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1359 +#: ../../library/sys.rst:1361 msgid "For other systems, the values are:" msgstr "" -#: ../../library/sys.rst:1362 +#: ../../library/sys.rst:1364 msgid "System" msgstr "" -#: ../../library/sys.rst:1362 +#: ../../library/sys.rst:1364 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1364 +#: ../../library/sys.rst:1366 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1364 +#: ../../library/sys.rst:1366 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1365 +#: ../../library/sys.rst:1367 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1365 +#: ../../library/sys.rst:1367 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1366 +#: ../../library/sys.rst:1368 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1366 +#: ../../library/sys.rst:1368 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1367 +#: ../../library/sys.rst:1369 msgid "WASI" msgstr "WASI" -#: ../../library/sys.rst:1367 +#: ../../library/sys.rst:1369 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1368 +#: ../../library/sys.rst:1370 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1368 +#: ../../library/sys.rst:1370 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1369 +#: ../../library/sys.rst:1371 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1369 +#: ../../library/sys.rst:1371 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1370 +#: ../../library/sys.rst:1372 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1370 +#: ../../library/sys.rst:1372 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1373 +#: ../../library/sys.rst:1375 msgid "" "On Linux, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``. Since older " @@ -1753,7 +1754,7 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1379 +#: ../../library/sys.rst:1381 msgid "" "On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``. Since older " @@ -1761,57 +1762,57 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1387 +#: ../../library/sys.rst:1389 msgid "" ":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1390 +#: ../../library/sys.rst:1392 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1396 +#: ../../library/sys.rst:1398 msgid "" "Name of the platform-specific library directory. It is used to build the " "path of standard library and the paths of installed extension modules." msgstr "" -#: ../../library/sys.rst:1399 +#: ../../library/sys.rst:1401 msgid "" "It is equal to ``\"lib\"`` on most platforms. On Fedora and SuSE, it is " "equal to ``\"lib64\"`` on 64-bit platforms which gives the following ``sys." "path`` paths (where ``X.Y`` is the Python ``major.minor`` version):" msgstr "" -#: ../../library/sys.rst:1403 +#: ../../library/sys.rst:1405 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1405 +#: ../../library/sys.rst:1407 msgid "" "``/usr/lib64/pythonX.Y/lib-dynload/``: C extension modules of the standard " "library (like the :mod:`errno` module, the exact filename is platform " "specific)" msgstr "" -#: ../../library/sys.rst:1408 +#: ../../library/sys.rst:1410 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1410 +#: ../../library/sys.rst:1412 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1418 +#: ../../library/sys.rst:1420 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is :file:`/usr/" @@ -1820,14 +1821,14 @@ msgid "" "derived paths." msgstr "" -#: ../../library/sys.rst:1424 +#: ../../library/sys.rst:1426 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " "the Python installation will still be available, via :data:`base_prefix`." msgstr "" -#: ../../library/sys.rst:1439 +#: ../../library/sys.rst:1441 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1837,7 +1838,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1449 +#: ../../library/sys.rst:1451 msgid "" "Set the flags used by the interpreter for :c:func:`dlopen` calls, such as " "when the interpreter loads extension modules. Among other things, this will " @@ -1848,14 +1849,14 @@ msgid "" "g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1461 +#: ../../library/sys.rst:1463 msgid "" "Set the :ref:`integer string conversion length limitation " "` used by this interpreter. See also :func:" "`get_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:1473 +#: ../../library/sys.rst:1475 msgid "" "Set the system's profile function, which allows you to implement a Python " "source code profiler in Python. See chapter :ref:`profile` for more " @@ -1870,14 +1871,14 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1485 +#: ../../library/sys.rst:1487 msgid "" "The same tracing mechanism is used for :func:`!setprofile` as :func:" "`settrace`. To trace calls with :func:`!setprofile` inside a tracing " "function (e.g. in a debugger breakpoint), see :func:`call_tracing`." msgstr "" -#: ../../library/sys.rst:1489 +#: ../../library/sys.rst:1491 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1885,71 +1886,71 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:1494 ../../library/sys.rst:1581 +#: ../../library/sys.rst:1496 ../../library/sys.rst:1583 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1498 ../../library/sys.rst:1586 +#: ../../library/sys.rst:1500 ../../library/sys.rst:1588 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1497 +#: ../../library/sys.rst:1499 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1503 ../../library/sys.rst:1602 +#: ../../library/sys.rst:1505 ../../library/sys.rst:1604 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1501 +#: ../../library/sys.rst:1503 msgid "" "A function (or other code block) is about to return. The profile function " "is called; *arg* is the value that will be returned, or ``None`` if the " "event is caused by an exception being raised." msgstr "" -#: ../../library/sys.rst:1507 +#: ../../library/sys.rst:1509 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1506 +#: ../../library/sys.rst:1508 msgid "" "A C function is about to be called. This may be an extension function or a " "built-in. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1510 +#: ../../library/sys.rst:1512 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1510 +#: ../../library/sys.rst:1512 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1513 +#: ../../library/sys.rst:1515 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1513 +#: ../../library/sys.rst:1515 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1515 +#: ../../library/sys.rst:1517 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" -#: ../../library/sys.rst:1520 +#: ../../library/sys.rst:1522 msgid "" "Set the maximum depth of the Python interpreter stack to *limit*. This " "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" -#: ../../library/sys.rst:1524 +#: ../../library/sys.rst:1526 msgid "" "The highest possible limit is platform-dependent. A user may need to set " "the limit higher when they have a program that requires deep recursion and a " @@ -1957,19 +1958,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1529 +#: ../../library/sys.rst:1531 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1532 +#: ../../library/sys.rst:1534 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1539 +#: ../../library/sys.rst:1541 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -1980,7 +1981,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1556 +#: ../../library/sys.rst:1558 msgid "" "Set the system's trace function, which allows you to implement a Python " "source code debugger in Python. The function is thread-specific; for a " @@ -1989,7 +1990,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1561 +#: ../../library/sys.rst:1563 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1997,7 +1998,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1566 +#: ../../library/sys.rst:1568 msgid "" "The trace function is invoked (with *event* set to ``'call'``) whenever a " "new local scope is entered; it should return a reference to a local trace " @@ -2005,36 +2006,36 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1571 +#: ../../library/sys.rst:1573 msgid "" "The local trace function should return a reference to itself, or to another " "function which would then be used as the local trace function for the scope." msgstr "" -#: ../../library/sys.rst:1574 +#: ../../library/sys.rst:1576 msgid "" "If there is any error occurred in the trace function, it will be unset, just " "like ``settrace(None)`` is called." msgstr "" -#: ../../library/sys.rst:1578 +#: ../../library/sys.rst:1580 msgid "" "Tracing is disabled while calling the trace function (e.g. a function set " "by :func:`!settrace`). For recursive tracing see :func:`call_tracing`." msgstr "" -#: ../../library/sys.rst:1584 +#: ../../library/sys.rst:1586 msgid "" "A function is called (or some other code block entered). The global trace " "function is called; *arg* is ``None``; the return value specifies the local " "trace function." msgstr "" -#: ../../library/sys.rst:1596 +#: ../../library/sys.rst:1598 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1589 +#: ../../library/sys.rst:1591 msgid "" "The interpreter is about to execute a new line of code or re-execute the " "condition of a loop. The local trace function is called; *arg* is ``None``; " @@ -2044,7 +2045,7 @@ msgid "" "to :const:`False` on that :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1599 +#: ../../library/sys.rst:1601 msgid "" "A function (or other code block) is about to return. The local trace " "function is called; *arg* is the value that will be returned, or ``None`` if " @@ -2052,22 +2053,22 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1607 +#: ../../library/sys.rst:1609 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1605 +#: ../../library/sys.rst:1607 msgid "" "An exception has occurred. The local trace function is called; *arg* is a " "tuple ``(exception, value, traceback)``; the return value specifies the new " "local trace function." msgstr "" -#: ../../library/sys.rst:1615 +#: ../../library/sys.rst:1617 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1610 +#: ../../library/sys.rst:1612 msgid "" "The interpreter is about to execute a new opcode (see :mod:`dis` for opcode " "details). The local trace function is called; *arg* is ``None``; the return " @@ -2077,13 +2078,13 @@ msgid "" "objects>`." msgstr "" -#: ../../library/sys.rst:1617 +#: ../../library/sys.rst:1619 msgid "" "Note that as an exception is propagated down the chain of callers, an " "``'exception'`` event is generated at each level." msgstr "" -#: ../../library/sys.rst:1620 +#: ../../library/sys.rst:1622 msgid "" "For more fine-grained usage, it's possible to set a trace function by " "assigning ``frame.f_trace = tracefunc`` explicitly, rather than relying on " @@ -2097,17 +2098,17 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1631 +#: ../../library/sys.rst:1633 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:1633 +#: ../../library/sys.rst:1635 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:1637 +#: ../../library/sys.rst:1639 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2115,13 +2116,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1644 +#: ../../library/sys.rst:1646 msgid "" "``'opcode'`` event type added; :attr:`~frame.f_trace_lines` and :attr:" "`~frame.f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1647 +#: ../../library/sys.rst:1649 msgid "" "``'opcode'`` event will only be emitted if :attr:`~frame.f_trace_opcodes` of " "at least one frame has been set to :const:`True` before :func:`settrace` is " @@ -2129,7 +2130,7 @@ msgid "" "previous versions." msgstr "" -#: ../../library/sys.rst:1655 +#: ../../library/sys.rst:1657 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2138,7 +2139,7 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:1661 +#: ../../library/sys.rst:1663 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." @@ -2146,7 +2147,7 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_firstiter``。" -#: ../../library/sys.rst:1663 +#: ../../library/sys.rst:1665 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." @@ -2154,20 +2155,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_finalizer``。" -#: ../../library/sys.rst:1665 +#: ../../library/sys.rst:1667 msgid "" "Two auditing events are raised because the underlying API consists of two " "calls, each of which must raise its own event." msgstr "" -#: ../../library/sys.rst:1668 +#: ../../library/sys.rst:1670 msgid "" "See :pep:`525` for more details, and for a reference example of a " "*finalizer* method see the implementation of ``asyncio.Loop." "shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`" msgstr "" -#: ../../library/sys.rst:1680 +#: ../../library/sys.rst:1682 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2176,105 +2177,105 @@ msgid "" "disabled, ``cr_origin`` will be None." msgstr "" -#: ../../library/sys.rst:1687 +#: ../../library/sys.rst:1689 msgid "" "To enable, pass a *depth* value greater than zero; this sets the number of " "frames whose information will be captured. To disable, pass set *depth* to " "zero." msgstr "" -#: ../../library/sys.rst:1691 +#: ../../library/sys.rst:1693 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1701 +#: ../../library/sys.rst:1703 msgid "" "Activate the stack profiler trampoline *backend*. The only supported backend " "is ``\"perf\"``." msgstr "" -#: ../../library/sys.rst:1704 ../../library/sys.rst:1719 -#: ../../library/sys.rst:1727 +#: ../../library/sys.rst:1706 ../../library/sys.rst:1721 +#: ../../library/sys.rst:1729 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/sys.rst:1710 +#: ../../library/sys.rst:1712 msgid ":ref:`perf_profiling`" msgstr ":ref:`perf_profiling`" -#: ../../library/sys.rst:1711 +#: ../../library/sys.rst:1713 msgid "https://perf.wiki.kernel.org" msgstr "https://perf.wiki.kernel.org" -#: ../../library/sys.rst:1715 +#: ../../library/sys.rst:1717 msgid "Deactivate the current stack profiler trampoline backend." msgstr "" -#: ../../library/sys.rst:1717 +#: ../../library/sys.rst:1719 msgid "If no stack profiler is activated, this function has no effect." msgstr "" -#: ../../library/sys.rst:1725 +#: ../../library/sys.rst:1727 msgid "Return ``True`` if a stack profiler trampoline is active." msgstr "" -#: ../../library/sys.rst:1733 +#: ../../library/sys.rst:1735 msgid "" "Changes the :term:`filesystem encoding and error handler` to 'mbcs' and " "'replace' respectively, for consistency with versions of Python prior to 3.6." msgstr "" -#: ../../library/sys.rst:1737 +#: ../../library/sys.rst:1739 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1740 +#: ../../library/sys.rst:1742 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1745 +#: ../../library/sys.rst:1747 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`\\ 。" -#: ../../library/sys.rst:1752 +#: ../../library/sys.rst:1754 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1755 +#: ../../library/sys.rst:1757 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1757 +#: ../../library/sys.rst:1759 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" -#: ../../library/sys.rst:1759 +#: ../../library/sys.rst:1761 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1761 +#: ../../library/sys.rst:1763 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" -#: ../../library/sys.rst:1765 +#: ../../library/sys.rst:1767 msgid "" "The encoding and error handling are is initialized from :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors`." msgstr "" -#: ../../library/sys.rst:1768 +#: ../../library/sys.rst:1770 msgid "" "On Windows, UTF-8 is used for the console device. Non-character devices " "such as disk files and pipes use the system locale encoding (i.e. the ANSI " @@ -2285,14 +2286,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1777 +#: ../../library/sys.rst:1779 msgid "" "The special behaviour of the console can be overridden by setting the " "environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In " "that case, the console codepages are used as for any other character device." msgstr "" -#: ../../library/sys.rst:1782 +#: ../../library/sys.rst:1784 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2301,7 +2302,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1789 +#: ../../library/sys.rst:1791 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2310,19 +2311,19 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1795 +#: ../../library/sys.rst:1797 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1801 +#: ../../library/sys.rst:1803 msgid "" "To write or read binary data from/to the standard streams, use the " "underlying binary :data:`~io.TextIOBase.buffer` object. For example, to " "write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." msgstr "" -#: ../../library/sys.rst:1805 +#: ../../library/sys.rst:1807 msgid "" "However, if you are writing a library (and do not control in which context " "its code will be executed), be aware that the standard streams may be " @@ -2330,7 +2331,7 @@ msgid "" "support the :attr:`!buffer` attribute." msgstr "" -#: ../../library/sys.rst:1815 +#: ../../library/sys.rst:1817 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2338,7 +2339,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1820 +#: ../../library/sys.rst:1822 msgid "" "It can also be used to restore the actual files to known working file " "objects in case they have been overwritten with a broken object. However, " @@ -2346,7 +2347,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1826 +#: ../../library/sys.rst:1828 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2354,12 +2355,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1834 +#: ../../library/sys.rst:1836 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1836 +#: ../../library/sys.rst:1838 msgid "" "It is the same on all platforms. Modules which are not available on some " "platforms and modules disabled at Python build are also listed. All module " @@ -2367,7 +2368,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1841 +#: ../../library/sys.rst:1843 msgid "" "For packages, only the main package is listed: sub-packages and sub-modules " "are not listed. For example, the ``email`` package is listed, but the " @@ -2375,60 +2376,60 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1846 +#: ../../library/sys.rst:1848 msgid "See also the :data:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1853 +#: ../../library/sys.rst:1855 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1858 +#: ../../library/sys.rst:1860 msgid "The name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1860 +#: ../../library/sys.rst:1862 msgid "``\"nt\"``: Windows threads" msgstr "``\"nt\"``: Windows 執行緒" -#: ../../library/sys.rst:1861 +#: ../../library/sys.rst:1863 msgid "``\"pthread\"``: POSIX threads" msgstr "``\"pthread\"``: POSIX 執行緒" -#: ../../library/sys.rst:1862 +#: ../../library/sys.rst:1864 msgid "" "``\"pthread-stubs\"``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1864 +#: ../../library/sys.rst:1866 msgid "``\"solaris\"``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1868 +#: ../../library/sys.rst:1870 msgid "The name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1870 +#: ../../library/sys.rst:1872 msgid "``\"semaphore\"``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1871 +#: ../../library/sys.rst:1873 msgid "``\"mutex+cond\"``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1872 +#: ../../library/sys.rst:1874 msgid "``None`` if this information is unknown" msgstr "為 ``None`` 表示此資訊未知" -#: ../../library/sys.rst:1876 +#: ../../library/sys.rst:1878 msgid "" "The name and version of the thread library. It is a string, or ``None`` if " "this information is unknown." msgstr "" -#: ../../library/sys.rst:1884 +#: ../../library/sys.rst:1886 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2437,73 +2438,73 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1892 +#: ../../library/sys.rst:1894 msgid "Handle an unraisable exception." msgstr "處理一個不可被引發的例外。" -#: ../../library/sys.rst:1894 +#: ../../library/sys.rst:1896 msgid "" "Called when an exception has occurred but there is no way for Python to " "handle it. For example, when a destructor raises an exception or during " "garbage collection (:func:`gc.collect`)." msgstr "" -#: ../../library/sys.rst:1898 +#: ../../library/sys.rst:1900 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1900 +#: ../../library/sys.rst:1902 msgid ":attr:`!exc_type`: Exception type." msgstr ":attr:`!exc_type`: 例外型別。" -#: ../../library/sys.rst:1901 +#: ../../library/sys.rst:1903 msgid ":attr:`!exc_value`: Exception value, can be ``None``." msgstr ":attr:`!exc_value`: 例外值,可以為 ``None``。" -#: ../../library/sys.rst:1902 +#: ../../library/sys.rst:1904 msgid ":attr:`!exc_traceback`: Exception traceback, can be ``None``." msgstr ":attr:`!exc_traceback`: 例外追蹤,可以為 ``None``。" -#: ../../library/sys.rst:1903 +#: ../../library/sys.rst:1905 msgid ":attr:`!err_msg`: Error message, can be ``None``." msgstr ":attr:`!err_msg`: 錯誤訊息,可以為 ``None``。" -#: ../../library/sys.rst:1904 +#: ../../library/sys.rst:1906 msgid ":attr:`!object`: Object causing the exception, can be ``None``." msgstr ":attr:`!object`: 導致例外的物件,可以為 ``None``。" -#: ../../library/sys.rst:1906 +#: ../../library/sys.rst:1908 msgid "" "The default hook formats :attr:`!err_msg` and :attr:`!object` as: " "``f'{err_msg}: {object!r}'``; use \"Exception ignored in\" error message if :" "attr:`!err_msg` is ``None``." msgstr "" -#: ../../library/sys.rst:1910 +#: ../../library/sys.rst:1912 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1915 +#: ../../library/sys.rst:1917 msgid ":func:`excepthook` which handles uncaught exceptions." msgstr "處理未被捕捉到例外的 :func:`excepthook`。" -#: ../../library/sys.rst:1919 +#: ../../library/sys.rst:1921 msgid "" "Storing :attr:`!exc_value` using a custom hook can create a reference cycle. " "It should be cleared explicitly to break the reference cycle when the " "exception is no longer needed." msgstr "" -#: ../../library/sys.rst:1923 +#: ../../library/sys.rst:1925 msgid "" "Storing :attr:`!object` using a custom hook can resurrect it if it is set to " "an object which is being finalized. Avoid storing :attr:`!object` after the " "custom hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/sys.rst:1927 +#: ../../library/sys.rst:1929 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``sys.unraisablehook`` with " @@ -2512,7 +2513,7 @@ msgstr "" "引發一個附帶引數 ``hook``、``unraisable`` 的\\ :ref:`稽核事件 ` " "``sys.unraisablehook``。" -#: ../../library/sys.rst:1929 +#: ../../library/sys.rst:1931 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments *hook*, " "*unraisable* when an exception that cannot be handled occurs. The " @@ -2520,7 +2521,7 @@ msgid "" "hook has been set, *hook* may be ``None``." msgstr "" -#: ../../library/sys.rst:1938 +#: ../../library/sys.rst:1940 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2529,13 +2530,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1947 +#: ../../library/sys.rst:1949 msgid "" "The C API version for this interpreter. Programmers may find this useful " "when debugging version conflicts between Python and extension modules." msgstr "" -#: ../../library/sys.rst:1953 +#: ../../library/sys.rst:1955 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2546,18 +2547,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1961 +#: ../../library/sys.rst:1963 msgid "Added named component attributes." msgstr "新增了附名的元件屬性。" -#: ../../library/sys.rst:1966 +#: ../../library/sys.rst:1968 msgid "" "This is an implementation detail of the warnings framework; do not modify " "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" -#: ../../library/sys.rst:1973 +#: ../../library/sys.rst:1975 msgid "" "The version number used to form registry keys on Windows platforms. This is " "stored as string resource 1000 in the Python DLL. The value is normally the " @@ -2566,31 +2567,31 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1985 +#: ../../library/sys.rst:1987 msgid "" "Namespace containing functions and constants for register callbacks and " "controlling monitoring events. See :mod:`sys.monitoring` for details." msgstr "" -#: ../../library/sys.rst:1991 +#: ../../library/sys.rst:1993 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: ../../library/sys.rst:2007 +#: ../../library/sys.rst:2009 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: ../../library/sys.rst:2015 +#: ../../library/sys.rst:2017 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:2016 +#: ../../library/sys.rst:2018 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" @@ -2599,63 +2600,63 @@ msgstr "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" 公開草案可在以下網址取" "得 https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf\\ 。" -#: ../../library/sys.rst:97 +#: ../../library/sys.rst:99 msgid "auditing" msgstr "" -#: ../../library/sys.rst:449 +#: ../../library/sys.rst:451 msgid "object" msgstr "object(物件)" -#: ../../library/sys.rst:449 +#: ../../library/sys.rst:451 msgid "traceback" msgstr "traceback" -#: ../../library/sys.rst:910 ../../library/sys.rst:1469 +#: ../../library/sys.rst:912 ../../library/sys.rst:1471 msgid "profile function" msgstr "" -#: ../../library/sys.rst:910 ../../library/sys.rst:1469 +#: ../../library/sys.rst:912 ../../library/sys.rst:1471 msgid "profiler" msgstr "" -#: ../../library/sys.rst:919 ../../library/sys.rst:1552 +#: ../../library/sys.rst:921 ../../library/sys.rst:1554 msgid "trace function" msgstr "" -#: ../../library/sys.rst:919 ../../library/sys.rst:1552 +#: ../../library/sys.rst:921 ../../library/sys.rst:1554 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/sys.rst:1292 +#: ../../library/sys.rst:1294 msgid "module" msgstr "module(模組)" -#: ../../library/sys.rst:1292 +#: ../../library/sys.rst:1294 msgid "search" msgstr "search(搜尋)" -#: ../../library/sys.rst:1292 +#: ../../library/sys.rst:1294 msgid "path" msgstr "path(路徑)" -#: ../../library/sys.rst:1433 +#: ../../library/sys.rst:1435 msgid "interpreter prompts" msgstr "interpreter prompts(直譯器提示)" -#: ../../library/sys.rst:1433 +#: ../../library/sys.rst:1435 msgid "prompts, interpreter" msgstr "prompts, interpreter(提示、直譯器)" -#: ../../library/sys.rst:1433 +#: ../../library/sys.rst:1435 msgid ">>>" msgstr ">>>" -#: ../../library/sys.rst:1433 +#: ../../library/sys.rst:1435 msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/sys.rst:1433 +#: ../../library/sys.rst:1435 msgid "..." msgstr "..." diff --git a/library/venv.po b/library/venv.po index 65b4bad59c..3a72499425 100644 --- a/library/venv.po +++ b/library/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2024-02-19 19:55+0000\n" "PO-Revision-Date: 2023-07-09 15:09+0800\n" "Last-Translator: Po-Chuan Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -137,17 +137,17 @@ msgstr "" #: ../../using/venv-create.inc:17 msgid "" +"The use of ``venv`` is now recommended for creating virtual environments." +msgstr "目前建議使用 ``venv`` 來建立虛擬環境。" + +#: ../../using/venv-create.inc:20 +msgid "" "``pyvenv`` was the recommended tool for creating virtual environments for " "Python 3.3 and 3.4, and is :ref:`deprecated in Python 3.6 `." msgstr "" "``pyvenv`` 是在 Python 3.3 和 3.4 中建立虛擬環境的推薦工具,但在 Python 3.6 " "中已被\\ :ref:`棄用 `。" -#: ../../using/venv-create.inc:22 -msgid "" -"The use of ``venv`` is now recommended for creating virtual environments." -msgstr "目前建議使用 ``venv`` 來建立虛擬環境。" - #: ../../using/venv-create.inc:27 msgid "On Windows, invoke the ``venv`` command as follows::" msgstr "在 Windows 上,執行以下命令以使用 ``venv``:" @@ -640,14 +640,14 @@ msgstr "" #: ../../library/venv.rst:279 msgid "" -"The attribute ``lib_path`` was added to the context, and the context object " -"was documented." +"The *venv* :ref:`sysconfig installation scheme ` is used " +"to construct the paths of the created directories." msgstr "" -#: ../../library/venv.rst:283 +#: ../../library/venv.rst:284 msgid "" -"The *venv* :ref:`sysconfig installation scheme ` is used " -"to construct the paths of the created directories." +"The attribute ``lib_path`` was added to the context, and the context object " +"was documented." msgstr "" #: ../../library/venv.rst:290 From dcacfb659b418ad4da587dcec9250ebc7bef6d85 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 21 Feb 2024 00:04:46 +0000 Subject: [PATCH 15/33] sync with cpython f1c1afd4 --- howto/descriptor.po | 5 +- howto/sorting.po | 193 +++++++++++++++++++++++++++++--------------- library/socket.po | 173 +++++++++++++++++++-------------------- 3 files changed, 217 insertions(+), 154 deletions(-) diff --git a/howto/descriptor.po b/howto/descriptor.po index e87bd86a31..14c4920eb4 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 00:03+0000\n" +"POT-Creation-Date: 2024-02-21 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -19,7 +19,8 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/descriptor.rst:5 -msgid "Descriptor HowTo Guide" +#, fuzzy +msgid "Descriptor Guide" msgstr "描述器 HowTo 指南" #: ../../howto/descriptor.rst:0 diff --git a/howto/sorting.po b/howto/sorting.po index 9eb633ec2b..8b88e5541f 100644 --- a/howto/sorting.po +++ b/howto/sorting.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2024-02-21 00:03+0000\n" "PO-Revision-Date: 2023-08-12 15:09+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,8 +20,9 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/sorting.rst:4 -msgid "Sorting HOW TO" -msgstr "如何排序" +#, fuzzy +msgid "Sorting Techniques" +msgstr "基礎排序" #: ../../howto/sorting.rst:0 msgid "Author" @@ -31,15 +32,7 @@ msgstr "作者" msgid "Andrew Dalke and Raymond Hettinger" msgstr "Andrew Dalke 和 Raymond Hettinger" -#: ../../howto/sorting.rst:0 -msgid "Release" -msgstr "發佈版本" - -#: ../../howto/sorting.rst:7 -msgid "0.1" -msgstr "0.1" - -#: ../../howto/sorting.rst:10 +#: ../../howto/sorting.rst:9 msgid "" "Python lists have a built-in :meth:`list.sort` method that modifies the list " "in-place. There is also a :func:`sorted` built-in function that builds a " @@ -49,17 +42,17 @@ msgstr "" "列,也有一個內建的 :func:`sorted` 函式可以排序可疊代物件 (iterable) 並建立一" "個新的排序好的串列。" -#: ../../howto/sorting.rst:14 +#: ../../howto/sorting.rst:13 msgid "" "In this document, we explore the various techniques for sorting data using " "Python." msgstr "在這份文件裡,我們探索使用 Python 排序資料的各種方法。" -#: ../../howto/sorting.rst:18 +#: ../../howto/sorting.rst:17 msgid "Sorting Basics" msgstr "基礎排序" -#: ../../howto/sorting.rst:20 +#: ../../howto/sorting.rst:19 msgid "" "A simple ascending sort is very easy: just call the :func:`sorted` function. " "It returns a new sorted list:" @@ -67,7 +60,7 @@ msgstr "" "單純的升冪排序很容易做到:只要呼叫 :func:`sorted` 函式,它會回傳一個新的串" "列:" -#: ../../howto/sorting.rst:28 +#: ../../howto/sorting.rst:27 msgid "" "You can also use the :meth:`list.sort` method. It modifies the list in-place " "(and returns ``None`` to avoid confusion). Usually it's less convenient " @@ -78,7 +71,7 @@ msgstr "" "混淆)。它通常會比 :func:`sorted` 來得不方便——但如果你不需要保留原始串列的" "話,它會稍微有效率一點。" -#: ../../howto/sorting.rst:40 +#: ../../howto/sorting.rst:39 msgid "" "Another difference is that the :meth:`list.sort` method is only defined for " "lists. In contrast, the :func:`sorted` function accepts any iterable." @@ -86,11 +79,11 @@ msgstr "" "另一個差異是 :meth:`list.sort` 方法只有定義在串列上,而 :func:`sorted` 函式可" "以接受任何可疊代物件。" -#: ../../howto/sorting.rst:49 +#: ../../howto/sorting.rst:48 msgid "Key Functions" msgstr "鍵函式 (key functions)" -#: ../../howto/sorting.rst:51 +#: ../../howto/sorting.rst:50 msgid "" "Both :meth:`list.sort` and :func:`sorted` have a *key* parameter to specify " "a function (or other callable) to be called on each list element prior to " @@ -99,11 +92,11 @@ msgstr "" ":meth:`list.sort` 和 :func:`sorted` 都有一個參數 *key* 可以指定一個函式(或其" "它可呼叫物件 (callable)),這個函式會在每個串列元素做比較前被呼叫。" -#: ../../howto/sorting.rst:55 +#: ../../howto/sorting.rst:54 msgid "For example, here's a case-insensitive string comparison:" msgstr "例如這裡有一個不區分大小寫的字串比對:" -#: ../../howto/sorting.rst:62 +#: ../../howto/sorting.rst:61 msgid "" "The value of the *key* parameter should be a function (or other callable) " "that takes a single argument and returns a key to use for sorting purposes. " @@ -114,49 +107,66 @@ msgstr "" "傳一個用來排序的鍵。因為對每個輸入來說鍵函式只會被呼叫一次,所以這個做法是快" "速的。" -#: ../../howto/sorting.rst:67 +#: ../../howto/sorting.rst:66 msgid "" "A common pattern is to sort complex objects using some of the object's " "indices as keys. For example:" msgstr "" "一個常見的模式是在排序複雜物件的時候使用一部分物件的索引值當作鍵,例如:" -#: ../../howto/sorting.rst:80 +#: ../../howto/sorting.rst:79 msgid "" "The same technique works for objects with named attributes. For example:" msgstr "相同的做法也適用在有命名屬性的物件,例如:" -#: ../../howto/sorting.rst:101 -msgid "Operator Module Functions" +#: ../../howto/sorting.rst:99 +msgid "" +"Objects with named attributes can be made by a regular class as shown above, " +"or they can be instances of :class:`~dataclasses.dataclass` or a :term:" +"`named tuple`." +msgstr "" + +#: ../../howto/sorting.rst:104 +#, fuzzy +msgid "Operator Module Functions and Partial Function Evaluation" msgstr "Operator 模組的函式" -#: ../../howto/sorting.rst:103 +#: ../../howto/sorting.rst:106 +#, fuzzy msgid "" -"The key-function patterns shown above are very common, so Python provides " -"convenience functions to make accessor functions easier and faster. The :mod:" -"`operator` module has :func:`~operator.itemgetter`, :func:`~operator." -"attrgetter`, and a :func:`~operator.methodcaller` function." +"The :term:`key function` patterns shown above are very common, so Python " +"provides convenience functions to make accessor functions easier and faster. " +"The :mod:`operator` module has :func:`~operator.itemgetter`, :func:" +"`~operator.attrgetter`, and a :func:`~operator.methodcaller` function." msgstr "" "上述的鍵函式模式非常常見,所以 Python 提供了方便的函式讓物件存取更簡單且快" "速。:mod:`operator` 模組裡有 :func:`~operator.itemgetter`、:func:`~operator." "attrgetter` 及 :func:`~operator.methodcaller` 函式可以使用。" -#: ../../howto/sorting.rst:108 +#: ../../howto/sorting.rst:111 msgid "Using those functions, the above examples become simpler and faster:" msgstr "使用這些函式讓上面的範例變得更簡單且快速:" -#: ../../howto/sorting.rst:120 +#: ../../howto/sorting.rst:123 msgid "" "The operator module functions allow multiple levels of sorting. For example, " "to sort by *grade* then by *age*:" msgstr "" "operator 模組的函式允許多層的排序,例如先用 *grade* 排序再用 *age* 排序:" -#: ../../howto/sorting.rst:132 +#: ../../howto/sorting.rst:134 +msgid "" +"The :mod:`functools` module provides another helpful tool for making key-" +"functions. The :func:`~functools.partial` function can reduce the `arity " +"`_ of a multi-argument function making " +"it suitable for use as a key-function." +msgstr "" + +#: ../../howto/sorting.rst:153 msgid "Ascending and Descending" msgstr "升冪與降冪" -#: ../../howto/sorting.rst:134 +#: ../../howto/sorting.rst:155 msgid "" "Both :meth:`list.sort` and :func:`sorted` accept a *reverse* parameter with " "a boolean value. This is used to flag descending sorts. For example, to get " @@ -165,11 +175,11 @@ msgstr "" ":meth:`list.sort` 和 :func:`sorted` 都有一個 boolean 參數 *reverse* 用來表示" "是否要降冪排序。例如將學生資料依據 *age* 做降冪排序:" -#: ../../howto/sorting.rst:147 +#: ../../howto/sorting.rst:168 msgid "Sort Stability and Complex Sorts" msgstr "排序穩定性與複合排序" -#: ../../howto/sorting.rst:149 +#: ../../howto/sorting.rst:170 msgid "" "Sorts are guaranteed to be `stable `_\\. That means that when multiple records have " @@ -179,7 +189,7 @@ msgstr "" "Sorting_algorithm#Stability>`_\\ ,意思是當有多筆資料有相同的鍵,它們會維持原" "來的順序。" -#: ../../howto/sorting.rst:159 +#: ../../howto/sorting.rst:180 msgid "" "Notice how the two records for *blue* retain their original order so that " "``('blue', 1)`` is guaranteed to precede ``('blue', 2)``." @@ -187,7 +197,7 @@ msgstr "" "可以注意到有兩筆資料的鍵都是 *blue*,它們會維持本來的順序,即 ``('blue', " "1)`` 保證在 ``('blue', 2)`` 前面。" -#: ../../howto/sorting.rst:162 +#: ../../howto/sorting.rst:183 msgid "" "This wonderful property lets you build complex sorts in a series of sorting " "steps. For example, to sort the student data by descending *grade* and then " @@ -197,7 +207,7 @@ msgstr "" "做降冪排序再用 *age* 做升冪排序,你可以先用 *age* 排序一遍再用 *grade* 排序一" "遍:" -#: ../../howto/sorting.rst:172 +#: ../../howto/sorting.rst:193 msgid "" "This can be abstracted out into a wrapper function that can take a list and " "tuples of field and order to sort them on multiple passes." @@ -205,7 +215,7 @@ msgstr "" "這可以抽出一個包裝函式 (wrapper function),接受一個串列及多個欄位及升降冪的元" "組為引數,來對這個串列排序多遍。" -#: ../../howto/sorting.rst:185 +#: ../../howto/sorting.rst:206 msgid "" "The `Timsort `_ algorithm used in " "Python does multiple sorts efficiently because it can take advantage of any " @@ -214,36 +224,36 @@ msgstr "" "Python 裡使用的 `Timsort `_ 演算法,因" "為能利用資料集裡已經有的順序,可以有效率地做多次排序。" -#: ../../howto/sorting.rst:190 +#: ../../howto/sorting.rst:211 msgid "Decorate-Sort-Undecorate" msgstr "裝飾-排序-移除裝飾 (decorate-sort-undecorate)" -#: ../../howto/sorting.rst:192 +#: ../../howto/sorting.rst:213 msgid "This idiom is called Decorate-Sort-Undecorate after its three steps:" msgstr "這個用語的來源是因為它做了以下三件事情:" -#: ../../howto/sorting.rst:194 +#: ../../howto/sorting.rst:215 msgid "" "First, the initial list is decorated with new values that control the sort " "order." msgstr "首先,原始串列會裝飾 (decorated) 上新的值用來控制排序的順序。" -#: ../../howto/sorting.rst:196 +#: ../../howto/sorting.rst:217 msgid "Second, the decorated list is sorted." msgstr "接下來,排序裝飾過的串列。" -#: ../../howto/sorting.rst:198 +#: ../../howto/sorting.rst:219 msgid "" "Finally, the decorations are removed, creating a list that contains only the " "initial values in the new order." msgstr "最後,裝飾會被移除,並以新的順序產生一個只包含原始值的串列。" -#: ../../howto/sorting.rst:201 +#: ../../howto/sorting.rst:222 msgid "" "For example, to sort the student data by *grade* using the DSU approach:" msgstr "例如用上面說的方式來以 *grade* 排序學生資料:" -#: ../../howto/sorting.rst:208 +#: ../../howto/sorting.rst:231 msgid "" "This idiom works because tuples are compared lexicographically; the first " "items are compared; if they are the same then the second items are compared, " @@ -252,7 +262,7 @@ msgstr "" "這個方式會有效是因為元組是依照字典順序 (lexicographically) 來比較,先比較第一" "個項目,如果一樣再比較第二個項目,並依此類推。" -#: ../../howto/sorting.rst:212 +#: ../../howto/sorting.rst:235 msgid "" "It is not strictly necessary in all cases to include the index *i* in the " "decorated list, but including it gives two benefits:" @@ -260,7 +270,7 @@ msgstr "" "在所有情況下都把索引 *i* 加入已裝飾的串列並不是絕對需要的,但這樣做會有兩個好" "處:" -#: ../../howto/sorting.rst:215 +#: ../../howto/sorting.rst:238 msgid "" "The sort is stable -- if two items have the same key, their order will be " "preserved in the sorted list." @@ -268,7 +278,7 @@ msgstr "" "排序會是穩定的 -- 如果兩個項目有相同的鍵,它們在排序好的串列中會保持原來的順" "序。" -#: ../../howto/sorting.rst:218 +#: ../../howto/sorting.rst:241 msgid "" "The original items do not have to be comparable because the ordering of the " "decorated tuples will be determined by at most the first two items. So for " @@ -278,7 +288,7 @@ msgstr "" "原始項目不需要是可以比較的,因為最多只會用到前兩個項目就能決定裝飾過的元組的" "順序。例如原始串列可以包含不能直接用來排序的複數。" -#: ../../howto/sorting.rst:223 +#: ../../howto/sorting.rst:246 msgid "" "Another name for this idiom is `Schwartzian transform `_\\, after Randal L. Schwartz, who " @@ -288,23 +298,23 @@ msgstr "" "Schwartzian_transform>`_\\ ,是由於 Randal L. Schwartz 讓這個方法在 Perl 程式" "設計師間普及。" -#: ../../howto/sorting.rst:227 +#: ../../howto/sorting.rst:250 msgid "" "Now that Python sorting provides key-functions, this technique is not often " "needed." msgstr "而因為 Python 的排序提供了鍵函式,已經不太需要用到這個方法了。" -#: ../../howto/sorting.rst:230 +#: ../../howto/sorting.rst:253 msgid "Comparison Functions" msgstr "比較函式 (comparison functions)" -#: ../../howto/sorting.rst:232 +#: ../../howto/sorting.rst:255 msgid "" "Unlike key functions that return an absolute value for sorting, a comparison " "function computes the relative ordering for two inputs." msgstr "不像鍵函式回傳一個用來排序的值,比較函式計算兩個輸入間的相對順序。" -#: ../../howto/sorting.rst:235 +#: ../../howto/sorting.rst:258 msgid "" "For example, a `balance scale `_ compares two samples giving a " @@ -317,7 +327,7 @@ msgstr "" "重。同樣地,像是 ``cmp(a, b)`` 這樣的比較函式會回傳負數代表小於、0 代表輸入相" "同或正數代表大於。" -#: ../../howto/sorting.rst:242 +#: ../../howto/sorting.rst:265 msgid "" "It is common to encounter comparison functions when translating algorithms " "from other languages. Also, some libraries provide comparison functions as " @@ -327,7 +337,7 @@ msgstr "" "當從其它語言翻譯演算法的時候常看到比較函式。有些函式庫也會提供比較函式作為其 " "API 的一部份,例如 :func:`locale.strcoll` 就是一個比較函式。" -#: ../../howto/sorting.rst:246 +#: ../../howto/sorting.rst:269 msgid "" "To accommodate those situations, Python provides :class:`functools." "cmp_to_key` to wrap the comparison function to make it usable as a key " @@ -336,11 +346,11 @@ msgstr "" "為了滿足這些情境,Python 提供 :class:`functools.cmp_to_key` 來包裝比較函式," "讓其可以當作鍵函式來使用: ::" -#: ../../howto/sorting.rst:253 +#: ../../howto/sorting.rst:276 msgid "Odds and Ends" msgstr "雜項說明" -#: ../../howto/sorting.rst:255 +#: ../../howto/sorting.rst:278 msgid "" "For locale aware sorting, use :func:`locale.strxfrm` for a key function or :" "func:`locale.strcoll` for a comparison function. This is necessary because " @@ -351,7 +361,7 @@ msgstr "" "作鍵函式,或 :func:`locale.strcoll` 當作比較函式。這樣做是必要的,因為在不同" "文化中就算是相同的字母,按「字母順序」排序的結果也各不相同。" -#: ../../howto/sorting.rst:260 +#: ../../howto/sorting.rst:283 msgid "" "The *reverse* parameter still maintains sort stability (so that records with " "equal keys retain the original order). Interestingly, that effect can be " @@ -362,7 +372,7 @@ msgstr "" "是,不加這個參數也可以模擬這個效果,只要使用內建的 :func:`reversed` 函式兩" "次:" -#: ../../howto/sorting.rst:274 +#: ../../howto/sorting.rst:297 msgid "" "The sort routines use ``<`` when making comparisons between two objects. So, " "it is easy to add a standard sort order to a class by defining an :meth:" @@ -371,15 +381,16 @@ msgstr "" "排序時會使用 ``<`` 來比較兩個物件,因此要在類別裡面加入排序順序比較規則是簡單" "的,只要透過定義 :meth:`~object.__lt__` 方法:" -#: ../../howto/sorting.rst:284 +#: ../../howto/sorting.rst:307 msgid "" "However, note that ``<`` can fall back to using :meth:`~object.__gt__` if :" -"meth:`~object.__lt__` is not implemented (see :func:`object.__lt__`)." +"meth:`~object.__lt__` is not implemented (see :func:`object.__lt__` for " +"details on the mechanics). To avoid surprises, :pep:`8` recommends that all " +"six comparison methods be implemented. The :func:`~functools.total_ordering` " +"decorator is provided to make that task easier." msgstr "" -"然而,需要注意如果沒有實作 :meth:`~object.__lt__`,則 ``<`` 會退而使用 :meth:" -"`~object.__gt__`\\ (參見 :func:`object.__lt__`)。" -#: ../../howto/sorting.rst:287 +#: ../../howto/sorting.rst:314 msgid "" "Key functions need not depend directly on the objects being sorted. A key " "function can also access external resources. For instance, if the student " @@ -388,3 +399,53 @@ msgid "" msgstr "" "鍵函式不需要直接依賴用來排序的物件。鍵函式也可以存取外部資源,例如如果學生成" "績儲存在字典裡,它可以用來排序一個單獨的學生姓名串列:" + +#: ../../howto/sorting.rst:327 +msgid "Partial Sorts" +msgstr "" + +#: ../../howto/sorting.rst:329 +msgid "" +"Some applications require only some of the data to be ordered. The standard " +"library provides several tools that do less work than a full sort:" +msgstr "" + +#: ../../howto/sorting.rst:332 +msgid "" +":func:`min` and :func:`max` return the smallest and largest values, " +"respectively. These functions make a single pass over the input data and " +"require almost no auxiliary memory." +msgstr "" + +#: ../../howto/sorting.rst:336 +msgid "" +":func:`heapq.nsmallest` and :func:`heapq.nlargest` return the *n* smallest " +"and largest values, respectively. These functions make a single pass over " +"the data keeping only *n* elements in memory at a time. For values of *n* " +"that are small relative to the number of inputs, these functions make far " +"fewer comparisons than a full sort." +msgstr "" + +#: ../../howto/sorting.rst:342 +msgid "" +":func:`heapq.heappush` and :func:`heapq.heappop` create and maintain a " +"partially sorted arrangement of data that keeps the smallest element at " +"position ``0``. These functions are suitable for implementing priority " +"queues which are commonly used for task scheduling." +msgstr "" + +#~ msgid "Sorting HOW TO" +#~ msgstr "如何排序" + +#~ msgid "Release" +#~ msgstr "發佈版本" + +#~ msgid "0.1" +#~ msgstr "0.1" + +#~ msgid "" +#~ "However, note that ``<`` can fall back to using :meth:`~object.__gt__` " +#~ "if :meth:`~object.__lt__` is not implemented (see :func:`object.__lt__`)." +#~ msgstr "" +#~ "然而,需要注意如果沒有實作 :meth:`~object.__lt__`,則 ``<`` 會退而使用 :" +#~ "meth:`~object.__gt__`\\ (參見 :func:`object.__lt__`)。" diff --git a/library/socket.po b/library/socket.po index 5f65732831..bb52ed1747 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 13:14+0000\n" +"POT-Creation-Date: 2024-02-21 00:03+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-" @@ -114,7 +114,7 @@ msgid "" msgstr "" #: ../../library/socket.rst:66 ../../library/socket.rst:1148 -#: ../../library/socket.rst:1190 ../../library/socket.rst:1949 +#: ../../library/socket.rst:1190 ../../library/socket.rst:1950 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "" @@ -289,7 +289,7 @@ msgid "*feat* and *mask* are unsigned 32bit integers." msgstr "" #: ../../library/socket.rst:171 ../../library/socket.rst:589 -#: ../../library/socket.rst:1871 +#: ../../library/socket.rst:1872 msgid ":ref:`Availability `: Linux >= 2.6.38." msgstr ":ref:`適用 `:Linux >= 2.6.38。" @@ -836,7 +836,7 @@ msgid "Constants for Windows Hyper-V sockets for host/guest communications." msgstr "" #: ../../library/socket.rst:679 ../../library/socket.rst:886 -#: ../../library/socket.rst:1977 +#: ../../library/socket.rst:1978 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -1187,7 +1187,7 @@ msgstr "" #: ../../library/socket.rst:1400 ../../library/socket.rst:1447 #: ../../library/socket.rst:1461 ../../library/socket.rst:1481 #: ../../library/socket.rst:1528 ../../library/socket.rst:1573 -#: ../../library/socket.rst:1955 ../../library/socket.rst:1965 +#: ../../library/socket.rst:1956 ../../library/socket.rst:1966 msgid ":ref:`Availability `: not WASI." msgstr ":ref:`適用 `:非 WASI。" @@ -1443,8 +1443,8 @@ msgstr "" msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" -#: ../../library/socket.rst:1213 ../../library/socket.rst:1703 -#: ../../library/socket.rst:1747 ../../library/socket.rst:1855 +#: ../../library/socket.rst:1213 ../../library/socket.rst:1704 +#: ../../library/socket.rst:1748 ../../library/socket.rst:1856 msgid "Most Unix platforms." msgstr "" @@ -1498,8 +1498,8 @@ msgstr "" "引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``socket." "sethostname``。" -#: ../../library/socket.rst:1263 ../../library/socket.rst:1701 -#: ../../library/socket.rst:1745 +#: ../../library/socket.rst:1263 ../../library/socket.rst:1702 +#: ../../library/socket.rst:1746 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -1618,10 +1618,10 @@ msgstr "" msgid "The socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:1387 ../../library/socket.rst:1616 -#: ../../library/socket.rst:1630 ../../library/socket.rst:1707 -#: ../../library/socket.rst:1780 ../../library/socket.rst:1799 -#: ../../library/socket.rst:1816 ../../library/socket.rst:1861 +#: ../../library/socket.rst:1387 ../../library/socket.rst:1617 +#: ../../library/socket.rst:1631 ../../library/socket.rst:1708 +#: ../../library/socket.rst:1781 ../../library/socket.rst:1800 +#: ../../library/socket.rst:1817 ../../library/socket.rst:1862 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:" @@ -1862,18 +1862,19 @@ msgstr "" 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*. See the Unix manual page :manpage:" +"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." msgstr "" -#: ../../library/socket.rst:1613 +#: ../../library/socket.rst:1614 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:1624 +#: ../../library/socket.rst:1625 msgid "" "Receive data from the socket. The return value is a pair ``(bytes, " "address)`` where *bytes* is a bytes object representing the data received " @@ -1883,14 +1884,14 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1635 +#: ../../library/socket.rst:1636 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`." msgstr "" -#: ../../library/socket.rst:1642 +#: ../../library/socket.rst:1643 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 " @@ -1901,7 +1902,7 @@ msgid "" "*flags* argument defaults to 0 and has the same meaning as for :meth:`recv`." msgstr "" -#: ../../library/socket.rst:1652 +#: ../../library/socket.rst:1653 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 " @@ -1916,7 +1917,7 @@ msgid "" "socket, if available; otherwise, its value is unspecified." msgstr "" -#: ../../library/socket.rst:1666 +#: ../../library/socket.rst:1667 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 " @@ -1929,7 +1930,7 @@ msgid "" "descriptors received via this mechanism." msgstr "" -#: ../../library/socket.rst:1677 +#: ../../library/socket.rst:1678 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 " @@ -1938,7 +1939,7 @@ msgid "" "provided it has not been truncated before the start of its associated data." msgstr "" -#: ../../library/socket.rst:1684 +#: ../../library/socket.rst:1685 msgid "" "On systems which support the :const:`SCM_RIGHTS` mechanism, the following " "function will receive up to *maxfds* file descriptors, returning the message " @@ -1947,7 +1948,7 @@ msgid "" "meth:`sendmsg`. ::" msgstr "" -#: ../../library/socket.rst:1715 +#: ../../library/socket.rst:1716 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 " @@ -1960,7 +1961,7 @@ msgid "" "arguments have the same meaning as for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1726 +#: ../../library/socket.rst:1727 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 " @@ -1968,14 +1969,14 @@ msgid "" "for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1731 +#: ../../library/socket.rst:1732 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/socket.rst:1754 +#: ../../library/socket.rst:1755 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 " @@ -1985,7 +1986,7 @@ msgid "" "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1764 +#: ../../library/socket.rst:1765 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), " @@ -1994,7 +1995,7 @@ msgid "" "of the optional argument *flags*; it defaults to zero." msgstr "" -#: ../../library/socket.rst:1773 +#: ../../library/socket.rst:1774 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` " @@ -2004,7 +2005,7 @@ msgid "" "data. For further information on this topic, consult the :ref:`socket-howto`." msgstr "" -#: ../../library/socket.rst:1788 +#: ../../library/socket.rst:1789 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` " @@ -2014,13 +2015,13 @@ msgid "" "to determine how much data, if any, was successfully sent." msgstr "" -#: ../../library/socket.rst:1795 +#: ../../library/socket.rst:1796 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:1808 +#: ../../library/socket.rst:1809 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 " @@ -2029,7 +2030,7 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1825 +#: ../../library/socket.rst:1826 msgid "" "Raises an :ref:`auditing event ` ``socket.sendto`` with arguments " "``self``, ``address``." @@ -2037,7 +2038,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendto``。" -#: ../../library/socket.rst:1824 +#: ../../library/socket.rst:1825 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. " @@ -2057,18 +2058,18 @@ msgid "" "bytes of non-ancillary data sent." msgstr "" -#: ../../library/socket.rst:1844 +#: ../../library/socket.rst:1845 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` " "mechanism. See also :meth:`recvmsg`. ::" msgstr "" -#: ../../library/socket.rst:1853 +#: ../../library/socket.rst:1854 msgid ":ref:`Availability `: Unix, not WASI." msgstr ":ref:`適用 `:Unix、非 WASI。" -#: ../../library/socket.rst:1868 +#: ../../library/socket.rst:1869 msgid "" "Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments " "``self``, ``address``." @@ -2076,14 +2077,14 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendmsg``。" -#: ../../library/socket.rst:1868 +#: ../../library/socket.rst:1869 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:1877 +#: ../../library/socket.rst:1878 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 " @@ -2097,38 +2098,38 @@ msgid "" "be of :const:`SOCK_STREAM` type. Non-blocking sockets are not supported." msgstr "" -#: ../../library/socket.rst:1893 +#: ../../library/socket.rst:1894 msgid "" "Set the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle." msgstr "" -#: ../../library/socket.rst:1901 +#: ../../library/socket.rst:1902 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:1904 +#: ../../library/socket.rst:1905 msgid "" "This method is a shorthand for certain :meth:`~socket.settimeout` calls:" msgstr "" -#: ../../library/socket.rst:1906 +#: ../../library/socket.rst:1907 msgid "``sock.setblocking(True)`` is equivalent to ``sock.settimeout(None)``" msgstr "``sock.setblocking(True)`` 等價於 ``sock.settimeout(None)``" -#: ../../library/socket.rst:1908 +#: ../../library/socket.rst:1909 msgid "``sock.setblocking(False)`` is equivalent to ``sock.settimeout(0.0)``" msgstr "``sock.setblocking(False)`` 等價於 ``sock.settimeout(0.0)``" -#: ../../library/socket.rst:1910 +#: ../../library/socket.rst:1911 msgid "" "The method no longer applies :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1917 +#: ../../library/socket.rst:1918 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-" @@ -2138,19 +2139,19 @@ msgid "" "blocking mode. If ``None`` is given, the socket is put in blocking mode." msgstr "" -#: ../../library/socket.rst:1924 +#: ../../library/socket.rst:1925 msgid "" "For further information, please consult the :ref:`notes on socket timeouts " "`." msgstr "" -#: ../../library/socket.rst:1926 +#: ../../library/socket.rst:1927 msgid "" "The method no longer toggles :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1939 +#: ../../library/socket.rst:1940 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 " @@ -2163,11 +2164,11 @@ msgid "" "C function with ``optval=NULL`` and ``optlen=optlen``." msgstr "" -#: ../../library/socket.rst:1952 +#: ../../library/socket.rst:1953 msgid "setsockopt(level, optname, None, optlen: int) form added." msgstr "" -#: ../../library/socket.rst:1960 +#: ../../library/socket.rst:1961 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`, " @@ -2175,7 +2176,7 @@ msgid "" "and receives are disallowed." msgstr "" -#: ../../library/socket.rst:1970 +#: ../../library/socket.rst:1971 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 " @@ -2186,48 +2187,48 @@ msgid "" "process." msgstr "" -#: ../../library/socket.rst:1982 +#: ../../library/socket.rst:1983 msgid "" "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:1985 +#: ../../library/socket.rst:1986 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:1991 +#: ../../library/socket.rst:1992 msgid "The socket family." msgstr "" -#: ../../library/socket.rst:1996 +#: ../../library/socket.rst:1997 msgid "The socket type." msgstr "" -#: ../../library/socket.rst:2001 +#: ../../library/socket.rst:2002 msgid "The socket protocol." msgstr "" -#: ../../library/socket.rst:2008 +#: ../../library/socket.rst:2009 msgid "Notes on socket timeouts" msgstr "" -#: ../../library/socket.rst:2010 +#: ../../library/socket.rst:2011 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:2014 +#: ../../library/socket.rst:2015 msgid "" "In *blocking mode*, operations block until complete or the system returns an " "error (such as connection timed out)." msgstr "" -#: ../../library/socket.rst:2017 +#: ../../library/socket.rst:2018 msgid "" "In *non-blocking mode*, operations fail (with an error that is unfortunately " "system-dependent) if they cannot be completed immediately: functions from " @@ -2235,14 +2236,14 @@ msgid "" "available for reading or writing." msgstr "" -#: ../../library/socket.rst:2022 +#: ../../library/socket.rst:2023 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:2027 +#: ../../library/socket.rst:2028 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 " @@ -2251,11 +2252,11 @@ msgid "" "you decide to use the :meth:`~socket.fileno()` of a socket." msgstr "" -#: ../../library/socket.rst:2034 +#: ../../library/socket.rst:2035 msgid "Timeouts and the ``connect`` method" msgstr "" -#: ../../library/socket.rst:2036 +#: ../../library/socket.rst:2037 msgid "" "The :meth:`~socket.connect` operation is also subject to the timeout " "setting, and in general it is recommended to call :meth:`~socket.settimeout` " @@ -2265,24 +2266,24 @@ msgid "" "setting." msgstr "" -#: ../../library/socket.rst:2044 +#: ../../library/socket.rst:2045 msgid "Timeouts and the ``accept`` method" msgstr "" -#: ../../library/socket.rst:2046 +#: ../../library/socket.rst:2047 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:" msgstr "" -#: ../../library/socket.rst:2050 +#: ../../library/socket.rst:2051 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:2053 +#: ../../library/socket.rst:2054 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 " @@ -2290,11 +2291,11 @@ msgid "" "it is recommended you manually override this setting." msgstr "" -#: ../../library/socket.rst:2062 +#: ../../library/socket.rst:2063 msgid "Example" msgstr "範例" -#: ../../library/socket.rst:2064 +#: ../../library/socket.rst:2065 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 " @@ -2307,14 +2308,14 @@ msgid "" "on the new socket returned by :meth:`~socket.accept`." msgstr "" -#: ../../library/socket.rst:2074 +#: ../../library/socket.rst:2075 msgid "The first two examples support IPv4 only. ::" msgstr "" "前兩個範例只支援 IPv4:\n" "\n" "::" -#: ../../library/socket.rst:2105 +#: ../../library/socket.rst:2106 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 " @@ -2324,73 +2325,73 @@ msgid "" "resolution, and sends traffic to the first one connected successfully. ::" msgstr "" -#: ../../library/socket.rst:2177 +#: ../../library/socket.rst:2178 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:2202 +#: ../../library/socket.rst:2203 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:2208 +#: ../../library/socket.rst:2209 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:2212 +#: ../../library/socket.rst:2213 msgid "This last example might require special privileges::" msgstr "" -#: ../../library/socket.rst:2252 +#: ../../library/socket.rst:2253 msgid "" "Running an example several times with too small delay between executions, " "could lead to this error::" msgstr "" -#: ../../library/socket.rst:2257 +#: ../../library/socket.rst:2258 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:2260 +#: ../../library/socket.rst:2261 msgid "" "There is a :mod:`socket` flag to set, in order to prevent this, :const:" "`socket.SO_REUSEADDR`::" msgstr "" -#: ../../library/socket.rst:2267 +#: ../../library/socket.rst:2268 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:2273 +#: ../../library/socket.rst:2274 msgid "" "For an introduction to socket programming (in C), see the following papers:" msgstr "" -#: ../../library/socket.rst:2275 +#: ../../library/socket.rst:2276 msgid "" "*An Introductory 4.3BSD Interprocess Communication Tutorial*, by Stuart " "Sechrest" msgstr "" -#: ../../library/socket.rst:2277 +#: ../../library/socket.rst:2278 msgid "" "*An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. " "Leffler et al," msgstr "" -#: ../../library/socket.rst:2280 +#: ../../library/socket.rst:2281 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 " @@ -2417,10 +2418,10 @@ msgstr "I/O control(I/O 控制)" msgid "buffering" msgstr "buffering(緩衝)" -#: ../../library/socket.rst:1937 +#: ../../library/socket.rst:1938 msgid "module" msgstr "module(模組)" -#: ../../library/socket.rst:1937 +#: ../../library/socket.rst:1938 msgid "struct" msgstr "struct" From e05d21f48505ac4c010f839acb68829135624d10 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 22 Feb 2024 00:04:57 +0000 Subject: [PATCH 16/33] sync with cpython d2fced71 --- c-api/code.po | 102 ++++---- howto/pyporting.po | 614 ++++----------------------------------------- library/xml.po | 68 +++-- 3 files changed, 147 insertions(+), 637 deletions(-) diff --git a/c-api/code.po b/c-api/code.po index cecb3fec8c..ed91b49baf 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-12 00:03+0000\n" +"POT-Creation-Date: 2024-02-22 00:03+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -48,113 +48,117 @@ msgid "" msgstr "" #: ../../c-api/code.rst:35 -msgid "Return the number of free variables in *co*." +msgid "Return the number of free variables in a code object." msgstr "" #: ../../c-api/code.rst:39 +msgid "Return the position of the first free variable in a code object." +msgstr "" + +#: ../../c-api/code.rst:43 msgid "" "Return a new code object. If you need a dummy code object to create a " "frame, use :c:func:`PyCode_NewEmpty` instead." msgstr "" -#: ../../c-api/code.rst:42 +#: ../../c-api/code.rst:46 msgid "" "Since the definition of the bytecode changes often, calling :c:func:" "`PyUnstable_Code_New` directly can bind you to a precise Python version." msgstr "" -#: ../../c-api/code.rst:45 +#: ../../c-api/code.rst:49 msgid "" "The many arguments of this function are inter-dependent in complex ways, " "meaning that subtle changes to values are likely to result in incorrect " "execution or VM crashes. Use this function only with extreme care." msgstr "" -#: ../../c-api/code.rst:49 +#: ../../c-api/code.rst:53 msgid "Added ``qualname`` and ``exceptiontable`` parameters." msgstr "新增 ``qualname`` 和 ``exceptiontable`` 參數。" -#: ../../c-api/code.rst:56 +#: ../../c-api/code.rst:60 msgid "" "Renamed from ``PyCode_New`` as part of :ref:`unstable-c-api`. The old name " "is deprecated, but will remain available until the signature changes again." msgstr "" -#: ../../c-api/code.rst:62 +#: ../../c-api/code.rst:66 msgid "" "Similar to :c:func:`PyUnstable_Code_New`, but with an extra " "\"posonlyargcount\" for positional-only arguments. The same caveats that " "apply to ``PyUnstable_Code_New`` also apply to this function." msgstr "" -#: ../../c-api/code.rst:67 +#: ../../c-api/code.rst:71 msgid "as ``PyCode_NewWithPosOnlyArgs``" msgstr "" -#: ../../c-api/code.rst:69 +#: ../../c-api/code.rst:73 msgid "Added ``qualname`` and ``exceptiontable`` parameters." msgstr "新增 ``qualname`` 和 ``exceptiontable`` 參數。" -#: ../../c-api/code.rst:74 +#: ../../c-api/code.rst:78 msgid "" "Renamed to ``PyUnstable_Code_NewWithPosOnlyArgs``. The old name is " "deprecated, but will remain available until the signature changes again." msgstr "" -#: ../../c-api/code.rst:80 +#: ../../c-api/code.rst:84 msgid "" "Return a new empty code object with the specified filename, function name, " "and first line number. The resulting code object will raise an ``Exception`` " "if executed." msgstr "" -#: ../../c-api/code.rst:86 +#: ../../c-api/code.rst:90 msgid "" "Return the line number of the instruction that occurs on or before " "``byte_offset`` and ends after it. If you just need the line number of a " "frame, use :c:func:`PyFrame_GetLineNumber` instead." msgstr "" -#: ../../c-api/code.rst:89 +#: ../../c-api/code.rst:93 msgid "" "For efficiently iterating over the line numbers in a code object, use `the " "API described in PEP 626 `_." msgstr "" -#: ../../c-api/code.rst:94 +#: ../../c-api/code.rst:98 msgid "" "Sets the passed ``int`` pointers to the source code line and column numbers " "for the instruction at ``byte_offset``. Sets the value to ``0`` when " "information is not available for any particular element." msgstr "" -#: ../../c-api/code.rst:98 +#: ../../c-api/code.rst:102 msgid "Returns ``1`` if the function succeeds and 0 otherwise." msgstr "" -#: ../../c-api/code.rst:104 +#: ../../c-api/code.rst:108 msgid "" "Equivalent to the Python code ``getattr(co, 'co_code')``. Returns a strong " "reference to a :c:type:`PyBytesObject` representing the bytecode in a code " "object. On error, ``NULL`` is returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:109 +#: ../../c-api/code.rst:113 msgid "" "This ``PyBytesObject`` may be created on-demand by the interpreter and does " "not necessarily represent the bytecode actually executed by CPython. The " "primary use case for this function is debuggers and profilers." msgstr "" -#: ../../c-api/code.rst:117 +#: ../../c-api/code.rst:121 msgid "" "Equivalent to the Python code ``getattr(co, 'co_varnames')``. Returns a new " "reference to a :c:type:`PyTupleObject` containing the names of the local " "variables. On error, ``NULL`` is returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:126 +#: ../../c-api/code.rst:130 msgid "" "Equivalent to the Python code ``getattr(co, 'co_cellvars')``. Returns a new " "reference to a :c:type:`PyTupleObject` containing the names of the local " @@ -162,14 +166,14 @@ msgid "" "returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:135 +#: ../../c-api/code.rst:139 msgid "" "Equivalent to the Python code ``getattr(co, 'co_freevars')``. Returns a new " "reference to a :c:type:`PyTupleObject` containing the names of the free " "variables. On error, ``NULL`` is returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:143 +#: ../../c-api/code.rst:147 msgid "" "Register *callback* as a code object watcher for the current interpreter. " "Return an ID which may be passed to :c:func:`PyCode_ClearWatcher`. In case " @@ -177,7 +181,7 @@ msgid "" "exception." msgstr "" -#: ../../c-api/code.rst:152 +#: ../../c-api/code.rst:156 msgid "" "Clear watcher identified by *watcher_id* previously returned from :c:func:" "`PyCode_AddWatcher` for the current interpreter. Return ``0`` on success, or " @@ -185,17 +189,17 @@ msgid "" "never registered.)" msgstr "" -#: ../../c-api/code.rst:161 +#: ../../c-api/code.rst:165 msgid "" "Enumeration of possible code object watcher events: - " "``PY_CODE_EVENT_CREATE`` - ``PY_CODE_EVENT_DESTROY``" msgstr "" -#: ../../c-api/code.rst:169 +#: ../../c-api/code.rst:173 msgid "Type of a code object watcher callback function." msgstr "" -#: ../../c-api/code.rst:171 +#: ../../c-api/code.rst:175 msgid "" "If *event* is ``PY_CODE_EVENT_CREATE``, then the callback is invoked after " "`co` has been fully initialized. Otherwise, the callback is invoked before " @@ -203,7 +207,7 @@ msgid "" "inspected." msgstr "" -#: ../../c-api/code.rst:176 +#: ../../c-api/code.rst:180 msgid "" "If *event* is ``PY_CODE_EVENT_DESTROY``, taking a reference in the callback " "to the about-to-be-destroyed code object will resurrect it and prevent it " @@ -211,7 +215,7 @@ msgid "" "later, any watcher callbacks active at that time will be called again." msgstr "" -#: ../../c-api/code.rst:181 +#: ../../c-api/code.rst:185 msgid "" "Users of this API should not rely on internal runtime implementation " "details. Such details may include, but are not limited to, the exact order " @@ -221,14 +225,14 @@ msgid "" "the Python code being executed." msgstr "" -#: ../../c-api/code.rst:188 +#: ../../c-api/code.rst:192 msgid "" "If the callback sets an exception, it must return ``-1``; this exception " "will be printed as an unraisable exception using :c:func:" "`PyErr_WriteUnraisable`. Otherwise it should return ``0``." msgstr "" -#: ../../c-api/code.rst:192 +#: ../../c-api/code.rst:196 msgid "" "There may already be a pending exception set on entry to the callback. In " "this case, the callback should return ``0`` with the same exception still " @@ -237,85 +241,85 @@ msgid "" "it before returning." msgstr "" -#: ../../c-api/code.rst:202 +#: ../../c-api/code.rst:206 msgid "Extra information" msgstr "" -#: ../../c-api/code.rst:204 +#: ../../c-api/code.rst:208 msgid "" "To support low-level extensions to frame evaluation, such as external just-" "in-time compilers, it is possible to attach arbitrary extra data to code " "objects." msgstr "" -#: ../../c-api/code.rst:208 +#: ../../c-api/code.rst:212 msgid "" "These functions are part of the unstable C API tier: this functionality is a " "CPython implementation detail, and the API may change without deprecation " "warnings." msgstr "" -#: ../../c-api/code.rst:214 +#: ../../c-api/code.rst:218 msgid "Return a new an opaque index value used to adding data to code objects." msgstr "" -#: ../../c-api/code.rst:216 +#: ../../c-api/code.rst:220 msgid "" "You generally call this function once (per interpreter) and use the result " "with ``PyCode_GetExtra`` and ``PyCode_SetExtra`` to manipulate data on " "individual code objects." msgstr "" -#: ../../c-api/code.rst:220 +#: ../../c-api/code.rst:224 msgid "" "If *free* is not ``NULL``: when a code object is deallocated, *free* will be " "called on non-``NULL`` data stored under the new index. Use :c:func:" "`Py_DecRef` when storing :c:type:`PyObject`." msgstr "" -#: ../../c-api/code.rst:226 +#: ../../c-api/code.rst:230 msgid "as ``_PyEval_RequestCodeExtraIndex``" msgstr "" -#: ../../c-api/code.rst:230 +#: ../../c-api/code.rst:234 msgid "" "Renamed to ``PyUnstable_Eval_RequestCodeExtraIndex``. The old private name " "is deprecated, but will be available until the API changes." msgstr "" -#: ../../c-api/code.rst:236 +#: ../../c-api/code.rst:240 msgid "" "Set *extra* to the extra data stored under the given index. Return 0 on " "success. Set an exception and return -1 on failure." msgstr "" -#: ../../c-api/code.rst:239 +#: ../../c-api/code.rst:243 msgid "" "If no data was set under the index, set *extra* to ``NULL`` and return 0 " "without setting an exception." msgstr "" -#: ../../c-api/code.rst:244 +#: ../../c-api/code.rst:248 msgid "as ``_PyCode_GetExtra``" msgstr "" -#: ../../c-api/code.rst:248 +#: ../../c-api/code.rst:252 msgid "" "Renamed to ``PyUnstable_Code_GetExtra``. The old private name is deprecated, " "but will be available until the API changes." msgstr "" -#: ../../c-api/code.rst:254 +#: ../../c-api/code.rst:258 msgid "" "Set the extra data stored under the given index to *extra*. Return 0 on " "success. Set an exception and return -1 on failure." msgstr "" -#: ../../c-api/code.rst:259 +#: ../../c-api/code.rst:263 msgid "as ``_PyCode_SetExtra``" msgstr "" -#: ../../c-api/code.rst:263 +#: ../../c-api/code.rst:267 msgid "" "Renamed to ``PyUnstable_Code_SetExtra``. The old private name is deprecated, " "but will be available until the API changes." @@ -333,27 +337,27 @@ msgstr "code(程式碼)" msgid "code object" msgstr "code object(程式碼物件)" -#: ../../c-api/code.rst:52 +#: ../../c-api/code.rst:56 #, fuzzy msgid "PyCode_New (C function)" msgstr "PyCode_New" -#: ../../c-api/code.rst:65 +#: ../../c-api/code.rst:69 #, fuzzy msgid "PyCode_NewWithPosOnlyArgs (C function)" msgstr "PyCode_NewWithPosOnlyArgs" -#: ../../c-api/code.rst:224 +#: ../../c-api/code.rst:228 #, fuzzy msgid "_PyEval_RequestCodeExtraIndex (C function)" msgstr "_PyEval_RequestCodeExtraIndex" -#: ../../c-api/code.rst:242 +#: ../../c-api/code.rst:246 #, fuzzy msgid "_PyCode_GetExtra (C function)" msgstr "_PyCode_GetExtra" -#: ../../c-api/code.rst:257 +#: ../../c-api/code.rst:261 #, fuzzy msgid "_PyCode_SetExtra (C function)" msgstr "_PyCode_SetExtra" diff --git a/howto/pyporting.po b/howto/pyporting.po index 2f4c8ed9a7..4e4d90aa6e 100644 --- a/howto/pyporting.po +++ b/howto/pyporting.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-09 00:04+0000\n" +"POT-Creation-Date: 2024-02-22 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -19,7 +19,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/pyporting.rst:5 +#: ../../howto/pyporting.rst:7 msgid "How to port Python 2 Code to Python 3" msgstr "如何將 Python 2 的程式碼移植到 Python 3" @@ -27,614 +27,90 @@ msgstr "如何將 Python 2 的程式碼移植到 Python 3" msgid "author" msgstr "作者" -#: ../../howto/pyporting.rst:7 +#: ../../howto/pyporting.rst:9 msgid "Brett Cannon" msgstr "Brett Cannon" -#: ../../howto/pyporting.rst:-1 -msgid "Abstract" -msgstr "摘要" - #: ../../howto/pyporting.rst:11 msgid "" "Python 2 reached its official end-of-life at the start of 2020. This means " "that no new bug reports, fixes, or changes will be made to Python 2 - it's " -"no longer supported." +"no longer supported: see :pep:`373` and `status of Python versions `_." msgstr "" -#: ../../howto/pyporting.rst:15 -msgid "" -"This guide is intended to provide you with a path to Python 3 for your code, " -"that includes compatibility with Python 2 as a first step." -msgstr "" - -#: ../../howto/pyporting.rst:18 +#: ../../howto/pyporting.rst:16 msgid "" "If you are looking to port an extension module instead of pure Python code, " "please see :ref:`cporting-howto`." msgstr "" -#: ../../howto/pyporting.rst:21 +#: ../../howto/pyporting.rst:19 msgid "" "The archived python-porting_ mailing list may contain some useful guidance." msgstr "" -#: ../../howto/pyporting.rst:25 -msgid "The Short Explanation" -msgstr "簡短的說明" - -#: ../../howto/pyporting.rst:27 -msgid "" -"To achieve Python 2/3 compatibility in a single code base, the basic steps " -"are:" -msgstr "" - -#: ../../howto/pyporting.rst:30 -msgid "Only worry about supporting Python 2.7" -msgstr "" - -#: ../../howto/pyporting.rst:31 -msgid "" -"Make sure you have good test coverage (coverage.py_ can help; ``python -m " -"pip install coverage``)" -msgstr "" - -#: ../../howto/pyporting.rst:33 -msgid "Learn the differences between Python 2 and 3" -msgstr "瞭解 Python 2 & 3 的差異" - -#: ../../howto/pyporting.rst:34 -msgid "" -"Use Futurize_ (or Modernize_) to update your code (e.g. ``python -m pip " -"install future``)" -msgstr "" - -#: ../../howto/pyporting.rst:35 -msgid "" -"Use Pylint_ to help make sure you don't regress on your Python 3 support " -"(``python -m pip install pylint``)" -msgstr "" - -#: ../../howto/pyporting.rst:37 -msgid "" -"Use caniusepython3_ to find out which of your dependencies are blocking your " -"use of Python 3 (``python -m pip install caniusepython3``)" -msgstr "" - -#: ../../howto/pyporting.rst:39 -msgid "" -"Once your dependencies are no longer blocking you, use continuous " -"integration to make sure you stay compatible with Python 2 and 3 (tox_ can " -"help test against multiple versions of Python; ``python -m pip install tox``)" -msgstr "" - -#: ../../howto/pyporting.rst:42 -msgid "" -"Consider using optional :term:`static type checking ` " -"to make sure your type usage works in both Python 2 and 3 (e.g. use mypy_ to " -"check your typing under both Python 2 and Python 3; ``python -m pip install " -"mypy``)." -msgstr "" - -#: ../../howto/pyporting.rst:49 -msgid "" -"Note: Using ``python -m pip install`` guarantees that the ``pip`` you invoke " -"is the one installed for the Python currently in use, whether it be a system-" -"wide ``pip`` or one installed within a :ref:`virtual environment `." -msgstr "" - -#: ../../howto/pyporting.rst:55 -msgid "Details" -msgstr "詳細的" - -#: ../../howto/pyporting.rst:57 -msgid "" -"Even if other factors - say, dependencies over which you have no control - " -"still require you to support Python 2, that does not prevent you taking the " -"step of including Python 3 support." -msgstr "" - -#: ../../howto/pyporting.rst:61 -msgid "" -"Most changes required to support Python 3 lead to cleaner code using newer " -"practices even in Python 2 code." -msgstr "" - -#: ../../howto/pyporting.rst:66 -msgid "Different versions of Python 2" -msgstr "" - -#: ../../howto/pyporting.rst:68 -msgid "" -"Ideally, your code should be compatible with Python 2.7, which was the last " -"supported version of Python 2." -msgstr "" - -#: ../../howto/pyporting.rst:71 -msgid "" -"Some of the tools mentioned in this guide will not work with Python 2.6." -msgstr "" - -#: ../../howto/pyporting.rst:73 -msgid "" -"If absolutely necessary, the six_ project can help you support Python 2.5 " -"and 3 simultaneously. Do realize, though, that nearly all the projects " -"listed in this guide will not be available to you." -msgstr "" - -#: ../../howto/pyporting.rst:77 -msgid "" -"If you are able to skip Python 2.5 and older, the required changes to your " -"code will be minimal. At worst you will have to use a function instead of a " -"method in some instances or have to import a function instead of using a " -"built-in one." -msgstr "" - -#: ../../howto/pyporting.rst:84 -msgid "" -"Make sure you specify the proper version support in your ``setup.py`` file" -msgstr "" - -#: ../../howto/pyporting.rst:86 -msgid "" -"In your ``setup.py`` file you should have the proper `trove classifier`_ " -"specifying what versions of Python you support. As your project does not " -"support Python 3 yet you should at least have ``Programming Language :: " -"Python :: 2 :: Only`` specified. Ideally you should also specify each major/" -"minor version of Python that you do support, e.g. ``Programming Language :: " -"Python :: 2.7``." -msgstr "" - -#: ../../howto/pyporting.rst:95 -msgid "Have good test coverage" -msgstr "有好的測試覆蓋率" - -#: ../../howto/pyporting.rst:97 -msgid "" -"Once you have your code supporting the oldest version of Python 2 you want " -"it to, you will want to make sure your test suite has good coverage. A good " -"rule of thumb is that if you want to be confident enough in your test suite " -"that any failures that appear after having tools rewrite your code are " -"actual bugs in the tools and not in your code. If you want a number to aim " -"for, try to get over 80% coverage (and don't feel bad if you find it hard to " -"get better than 90% coverage). If you don't already have a tool to measure " -"test coverage then coverage.py_ is recommended." -msgstr "" - -#: ../../howto/pyporting.rst:108 -msgid "Be aware of the differences between Python 2 and 3" -msgstr "注意 Python 2 & 3 的差異" - -#: ../../howto/pyporting.rst:110 -msgid "" -"Once you have your code well-tested you are ready to begin porting your code " -"to Python 3! But to fully understand how your code is going to change and " -"what you want to look out for while you code, you will want to learn what " -"changes Python 3 makes in terms of Python 2." -msgstr "" - -#: ../../howto/pyporting.rst:115 -msgid "" -"Some resources for understanding the differences and their implications for " -"you code:" -msgstr "" - -#: ../../howto/pyporting.rst:118 -msgid "" -"the :ref:`\"What's New\" ` doc for each release of Python 3" -msgstr "" - -#: ../../howto/pyporting.rst:119 -msgid "the `Porting to Python 3`_ book (which is free online)" -msgstr "" - -#: ../../howto/pyporting.rst:120 -msgid "the handy `cheat sheet`_ from the Python-Future project." -msgstr "" - -#: ../../howto/pyporting.rst:124 -msgid "Update your code" -msgstr "更新你的程式碼" - -#: ../../howto/pyporting.rst:126 -msgid "There are tools available that can port your code automatically." -msgstr "" - -#: ../../howto/pyporting.rst:128 -msgid "" -"Futurize_ does its best to make Python 3 idioms and practices exist in " -"Python 2, e.g. backporting the ``bytes`` type from Python 3 so that you have " -"semantic parity between the major versions of Python. This is the better " -"approach for most cases." -msgstr "" - -#: ../../howto/pyporting.rst:133 -msgid "" -"Modernize_, on the other hand, is more conservative and targets a Python 2/3 " -"subset of Python, directly relying on six_ to help provide compatibility." -msgstr "" - -#: ../../howto/pyporting.rst:136 -msgid "" -"A good approach is to run the tool over your test suite first and visually " -"inspect the diff to make sure the transformation is accurate. After you have " -"transformed your test suite and verified that all the tests still pass as " -"expected, then you can transform your application code knowing that any " -"tests which fail is a translation failure." -msgstr "" - -#: ../../howto/pyporting.rst:142 -msgid "" -"Unfortunately the tools can't automate everything to make your code work " -"under Python 3, and you will also need to read the tools' documentation in " -"case some options you need are turned off by default." -msgstr "" - -#: ../../howto/pyporting.rst:146 -msgid "Key issues to be aware of and check for:" -msgstr "" - -#: ../../howto/pyporting.rst:149 -msgid "Division" -msgstr "" - -#: ../../howto/pyporting.rst:151 -msgid "" -"In Python 3, ``5 / 2 == 2.5`` and not ``2`` as it was in Python 2; all " -"division between ``int`` values result in a ``float``. This change has " -"actually been planned since Python 2.2 which was released in 2002. Since " -"then users have been encouraged to add ``from __future__ import division`` " -"to any and all files which use the ``/`` and ``//`` operators or to be " -"running the interpreter with the ``-Q`` flag. If you have not been doing " -"this then you will need to go through your code and do two things:" -msgstr "" - -#: ../../howto/pyporting.rst:159 -msgid "Add ``from __future__ import division`` to your files" -msgstr "" - -#: ../../howto/pyporting.rst:160 -msgid "" -"Update any division operator as necessary to either use ``//`` to use floor " -"division or continue using ``/`` and expect a float" -msgstr "" - -#: ../../howto/pyporting.rst:163 -msgid "" -"The reason that ``/`` isn't simply translated to ``//`` automatically is " -"that if an object defines a ``__truediv__`` method but not ``__floordiv__`` " -"then your code would begin to fail (e.g. a user-defined class that uses ``/" -"`` to signify some operation but not ``//`` for the same thing or at all)." -msgstr "" - -#: ../../howto/pyporting.rst:170 -msgid "Text versus binary data" -msgstr "" - -#: ../../howto/pyporting.rst:172 -msgid "" -"In Python 2 you could use the ``str`` type for both text and binary data. " -"Unfortunately this confluence of two different concepts could lead to " -"brittle code which sometimes worked for either kind of data, sometimes not. " -"It also could lead to confusing APIs if people didn't explicitly state that " -"something that accepted ``str`` accepted either text or binary data instead " -"of one specific type. This complicated the situation especially for anyone " -"supporting multiple languages as APIs wouldn't bother explicitly supporting " -"``unicode`` when they claimed text data support." -msgstr "" - -#: ../../howto/pyporting.rst:181 -msgid "" -"Python 3 made text and binary data distinct types that cannot simply be " -"mixed together. For any code that deals only with text or only binary data, " -"this separation doesn't pose an issue. But for code that has to deal with " -"both, it does mean you might have to now care about when you are using text " -"compared to binary data, which is why this cannot be entirely automated." -msgstr "" - -#: ../../howto/pyporting.rst:187 -msgid "" -"Decide which APIs take text and which take binary (it is **highly** " -"recommended you don't design APIs that can take both due to the difficulty " -"of keeping the code working; as stated earlier it is difficult to do well). " -"In Python 2 this means making sure the APIs that take text can work with " -"``unicode`` and those that work with binary data work with the ``bytes`` " -"type from Python 3 (which is a subset of ``str`` in Python 2 and acts as an " -"alias for ``bytes`` type in Python 2). Usually the biggest issue is " -"realizing which methods exist on which types in Python 2 and 3 " -"simultaneously (for text that's ``unicode`` in Python 2 and ``str`` in " -"Python 3, for binary that's ``str``/``bytes`` in Python 2 and ``bytes`` in " -"Python 3)." -msgstr "" - -#: ../../howto/pyporting.rst:198 -msgid "" -"The following table lists the **unique** methods of each data type across " -"Python 2 and 3 (e.g., the ``decode()`` method is usable on the equivalent " -"binary data type in either Python 2 or 3, but it can't be used by the " -"textual data type consistently between Python 2 and 3 because ``str`` in " -"Python 3 doesn't have the method). Do note that as of Python 3.5 the " -"``__mod__`` method was added to the bytes type." -msgstr "" - -#: ../../howto/pyporting.rst:206 -msgid "**Text data**" -msgstr "" - -#: ../../howto/pyporting.rst:206 -msgid "**Binary data**" -msgstr "" - -#: ../../howto/pyporting.rst:208 -msgid "\\" -msgstr "\\" - -#: ../../howto/pyporting.rst:208 -msgid "decode" -msgstr "" - -#: ../../howto/pyporting.rst:210 -msgid "encode" -msgstr "" - -#: ../../howto/pyporting.rst:212 -msgid "format" -msgstr "" - -#: ../../howto/pyporting.rst:214 -msgid "isdecimal" -msgstr "isdecimal" - -#: ../../howto/pyporting.rst:216 -msgid "isnumeric" -msgstr "isnumeric" - -#: ../../howto/pyporting.rst:219 -msgid "" -"Making the distinction easier to handle can be accomplished by encoding and " -"decoding between binary data and text at the edge of your code. This means " -"that when you receive text in binary data, you should immediately decode it. " -"And if your code needs to send text as binary data then encode it as late as " -"possible. This allows your code to work with only text internally and thus " -"eliminates having to keep track of what type of data you are working with." -msgstr "" - -#: ../../howto/pyporting.rst:226 -msgid "" -"The next issue is making sure you know whether the string literals in your " -"code represent text or binary data. You should add a ``b`` prefix to any " -"literal that presents binary data. For text you should add a ``u`` prefix to " -"the text literal. (There is a :mod:`__future__` import to force all " -"unspecified literals to be Unicode, but usage has shown it isn't as " -"effective as adding a ``b`` or ``u`` prefix to all literals explicitly)" -msgstr "" - -#: ../../howto/pyporting.rst:233 -msgid "" -"You also need to be careful about opening files. Possibly you have not " -"always bothered to add the ``b`` mode when opening a binary file (e.g., " -"``rb`` for binary reading). Under Python 3, binary files and text files are " -"clearly distinct and mutually incompatible; see the :mod:`io` module for " -"details. Therefore, you **must** make a decision of whether a file will be " -"used for binary access (allowing binary data to be read and/or written) or " -"textual access (allowing text data to be read and/or written). You should " -"also use :func:`io.open` for opening files instead of the built-in :func:" -"`open` function as the :mod:`io` module is consistent from Python 2 to 3 " -"while the built-in :func:`open` function is not (in Python 3 it's actually :" -"func:`io.open`). Do not bother with the outdated practice of using :func:" -"`codecs.open` as that's only necessary for keeping compatibility with Python " -"2.5." -msgstr "" - -#: ../../howto/pyporting.rst:246 -msgid "" -"The constructors of both ``str`` and ``bytes`` have different semantics for " -"the same arguments between Python 2 and 3. Passing an integer to ``bytes`` " -"in Python 2 will give you the string representation of the integer: " -"``bytes(3) == '3'``. But in Python 3, an integer argument to ``bytes`` will " -"give you a bytes object as long as the integer specified, filled with null " -"bytes: ``bytes(3) == b'\\x00\\x00\\x00'``. A similar worry is necessary when " -"passing a bytes object to ``str``. In Python 2 you just get the bytes object " -"back: ``str(b'3') == b'3'``. But in Python 3 you get the string " -"representation of the bytes object: ``str(b'3') == \"b'3'\"``." -msgstr "" - -#: ../../howto/pyporting.rst:256 -msgid "" -"Finally, the indexing of binary data requires careful handling (slicing does " -"**not** require any special handling). In Python 2, ``b'123'[1] == b'2'`` " -"while in Python 3 ``b'123'[1] == 50``. Because binary data is simply a " -"collection of binary numbers, Python 3 returns the integer value for the " -"byte you index on. But in Python 2 because ``bytes == str``, indexing " -"returns a one-item slice of bytes. The six_ project has a function named " -"``six.indexbytes()`` which will return an integer like in Python 3: ``six." -"indexbytes(b'123', 1)``." -msgstr "" - -#: ../../howto/pyporting.rst:265 -msgid "To summarize:" -msgstr "" - -#: ../../howto/pyporting.rst:267 -msgid "Decide which of your APIs take text and which take binary data" -msgstr "" - -#: ../../howto/pyporting.rst:268 -msgid "" -"Make sure that your code that works with text also works with ``unicode`` " -"and code for binary data works with ``bytes`` in Python 2 (see the table " -"above for what methods you cannot use for each type)" -msgstr "" - -#: ../../howto/pyporting.rst:271 -msgid "" -"Mark all binary literals with a ``b`` prefix, textual literals with a ``u`` " -"prefix" -msgstr "" - -#: ../../howto/pyporting.rst:273 -msgid "" -"Decode binary data to text as soon as possible, encode text as binary data " -"as late as possible" -msgstr "" - -#: ../../howto/pyporting.rst:275 -msgid "" -"Open files using :func:`io.open` and make sure to specify the ``b`` mode " -"when appropriate" -msgstr "" - -#: ../../howto/pyporting.rst:277 -msgid "Be careful when indexing into binary data" -msgstr "" - -#: ../../howto/pyporting.rst:281 -msgid "Use feature detection instead of version detection" -msgstr "" - -#: ../../howto/pyporting.rst:283 -msgid "" -"Inevitably you will have code that has to choose what to do based on what " -"version of Python is running. The best way to do this is with feature " -"detection of whether the version of Python you're running under supports " -"what you need. If for some reason that doesn't work then you should make the " -"version check be against Python 2 and not Python 3. To help explain this, " -"let's look at an example." -msgstr "" - -#: ../../howto/pyporting.rst:290 -msgid "" -"Let's pretend that you need access to a feature of :mod:`importlib` that is " -"available in Python's standard library since Python 3.3 and available for " -"Python 2 through importlib2_ on PyPI. You might be tempted to write code to " -"access e.g. the :mod:`importlib.abc` module by doing the following::" -msgstr "" - -#: ../../howto/pyporting.rst:302 +#: ../../howto/pyporting.rst:21 msgid "" -"The problem with this code is what happens when Python 4 comes out? It would " -"be better to treat Python 2 as the exceptional case instead of Python 3 and " -"assume that future Python versions will be more compatible with Python 3 " -"than Python 2::" +"Since Python 3.13 the original porting guide was discontinued. You can find " +"the old guide in the `archive `_." msgstr "" -#: ../../howto/pyporting.rst:314 -msgid "" -"The best solution, though, is to do no version detection at all and instead " -"rely on feature detection. That avoids any potential issues of getting the " -"version detection wrong and helps keep you future-compatible::" +#: ../../howto/pyporting.rst:27 +msgid "Third-party guides" msgstr "" -#: ../../howto/pyporting.rst:325 -msgid "Prevent compatibility regressions" +#: ../../howto/pyporting.rst:29 +msgid "There are also multiple third-party guides that might be useful:" msgstr "" -#: ../../howto/pyporting.rst:327 -msgid "" -"Once you have fully translated your code to be compatible with Python 3, you " -"will want to make sure your code doesn't regress and stop working under " -"Python 3. This is especially true if you have a dependency which is blocking " -"you from actually running under Python 3 at the moment." +#: ../../howto/pyporting.rst:31 +msgid "`Guide by Fedora `_" msgstr "" -#: ../../howto/pyporting.rst:332 -msgid "" -"To help with staying compatible, any new modules you create should have at " -"least the following block of code at the top of it::" +#: ../../howto/pyporting.rst:32 +msgid "`PyCon 2020 tutorial `_" msgstr "" -#: ../../howto/pyporting.rst:339 +#: ../../howto/pyporting.rst:33 msgid "" -"You can also run Python 2 with the ``-3`` flag to be warned about various " -"compatibility issues your code triggers during execution. If you turn " -"warnings into errors with ``-Werror`` then you can make sure that you don't " -"accidentally miss a warning." +"`Guide by DigitalOcean `_" msgstr "" -#: ../../howto/pyporting.rst:344 +#: ../../howto/pyporting.rst:34 msgid "" -"You can also use the Pylint_ project and its ``--py3k`` flag to lint your " -"code to receive warnings when your code begins to deviate from Python 3 " -"compatibility. This also prevents you from having to run Modernize_ or " -"Futurize_ over your code regularly to catch compatibility regressions. This " -"does require you only support Python 2.7 and Python 3.4 or newer as that is " -"Pylint's minimum Python version support." +"`Guide by ActiveState `_" msgstr "" -#: ../../howto/pyporting.rst:353 -msgid "Check which dependencies block your transition" -msgstr "" +#~ msgid "Abstract" +#~ msgstr "摘要" -#: ../../howto/pyporting.rst:355 -msgid "" -"**After** you have made your code compatible with Python 3 you should begin " -"to care about whether your dependencies have also been ported. The " -"caniusepython3_ project was created to help you determine which projects -- " -"directly or indirectly -- are blocking you from supporting Python 3. There " -"is both a command-line tool as well as a web interface at https://" -"caniusepython3.com." -msgstr "" +#~ msgid "The Short Explanation" +#~ msgstr "簡短的說明" -#: ../../howto/pyporting.rst:362 -msgid "" -"The project also provides code which you can integrate into your test suite " -"so that you will have a failing test when you no longer have dependencies " -"blocking you from using Python 3. This allows you to avoid having to " -"manually check your dependencies and to be notified quickly when you can " -"start running on Python 3." -msgstr "" +#~ msgid "Learn the differences between Python 2 and 3" +#~ msgstr "瞭解 Python 2 & 3 的差異" -#: ../../howto/pyporting.rst:369 -msgid "Update your ``setup.py`` file to denote Python 3 compatibility" -msgstr "" +#~ msgid "Details" +#~ msgstr "詳細的" -#: ../../howto/pyporting.rst:371 -msgid "" -"Once your code works under Python 3, you should update the classifiers in " -"your ``setup.py`` to contain ``Programming Language :: Python :: 3`` and to " -"not specify sole Python 2 support. This will tell anyone using your code " -"that you support Python 2 **and** 3. Ideally you will also want to add " -"classifiers for each major/minor version of Python you now support." -msgstr "" +#~ msgid "Have good test coverage" +#~ msgstr "有好的測試覆蓋率" -#: ../../howto/pyporting.rst:379 -msgid "Use continuous integration to stay compatible" -msgstr "" +#~ msgid "Be aware of the differences between Python 2 and 3" +#~ msgstr "注意 Python 2 & 3 的差異" -#: ../../howto/pyporting.rst:381 -msgid "" -"Once you are able to fully run under Python 3 you will want to make sure " -"your code always works under both Python 2 and 3. Probably the best tool for " -"running your tests under multiple Python interpreters is tox_. You can then " -"integrate tox with your continuous integration system so that you never " -"accidentally break Python 2 or 3 support." -msgstr "" +#~ msgid "Update your code" +#~ msgstr "更新你的程式碼" -#: ../../howto/pyporting.rst:387 -msgid "" -"You may also want to use the ``-bb`` flag with the Python 3 interpreter to " -"trigger an exception when you are comparing bytes to strings or bytes to an " -"int (the latter is available starting in Python 3.5). By default type-" -"differing comparisons simply return ``False``, but if you made a mistake in " -"your separation of text/binary data handling or indexing on bytes you " -"wouldn't easily find the mistake. This flag will raise an exception when " -"these kinds of comparisons occur, making the mistake much easier to track " -"down." -msgstr "" +#~ msgid "\\" +#~ msgstr "\\" -#: ../../howto/pyporting.rst:397 -msgid "Consider using optional static type checking" -msgstr "" +#~ msgid "isdecimal" +#~ msgstr "isdecimal" -#: ../../howto/pyporting.rst:399 -msgid "" -"Another way to help port your code is to use a :term:`static type checker` " -"like mypy_ or pytype_ on your code. These tools can be used to analyze your " -"code as if it's being run under Python 2, then you can run the tool a second " -"time as if your code is running under Python 3. By running a static type " -"checker twice like this you can discover if you're e.g. misusing binary data " -"type in one version of Python compared to another. If you add optional type " -"hints to your code you can also explicitly state whether your APIs use " -"textual or binary data, helping to make sure everything functions as " -"expected in both versions of Python." -msgstr "" +#~ msgid "isnumeric" +#~ msgstr "isnumeric" diff --git a/library/xml.po b/library/xml.po index aa38c6ef93..a58bd89b93 100644 --- a/library/xml.po +++ b/library/xml.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-27 00:03+0000\n" +"POT-Creation-Date: 2024-02-22 00:03+0000\n" "PO-Revision-Date: 2023-08-21 02:16+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -148,7 +148,7 @@ msgstr "**脆弱** (1)" msgid "quadratic blowup" msgstr "二次爆炸 (quadratic blowup)" -#: ../../library/xml.rst:68 ../../library/xml.rst:103 +#: ../../library/xml.rst:68 ../../library/xml.rst:109 msgid "external entity expansion" msgstr "外部實體擴展 (external entity expansion)" @@ -168,7 +168,7 @@ msgstr "安全 (3)" msgid "Safe (4)" msgstr "安全 (4)" -#: ../../library/xml.rst:69 ../../library/xml.rst:108 +#: ../../library/xml.rst:69 ../../library/xml.rst:114 msgid "`DTD`_ retrieval" msgstr "`DTD`_ 檢索" @@ -176,7 +176,7 @@ msgstr "`DTD`_ 檢索" msgid "Safe" msgstr "安全" -#: ../../library/xml.rst:70 ../../library/xml.rst:115 +#: ../../library/xml.rst:70 ../../library/xml.rst:121 msgid "decompression bomb" msgstr "解壓縮炸彈 (decompression bomb)" @@ -184,7 +184,16 @@ msgstr "解壓縮炸彈 (decompression bomb)" msgid "**Vulnerable**" msgstr "**脆弱**" -#: ../../library/xml.rst:73 +#: ../../library/xml.rst:71 ../../library/xml.rst:128 +msgid "large tokens" +msgstr "" + +#: ../../library/xml.rst:71 +#, fuzzy +msgid "**Vulnerable** (6)" +msgstr "**脆弱** (1)" + +#: ../../library/xml.rst:74 msgid "" "Expat 2.4.1 and newer is not vulnerable to the \"billion laughs\" and " "\"quadratic blowup\" vulnerabilities. Items still listed as vulnerable due " @@ -195,7 +204,7 @@ msgstr "" "能由於依賴系統提供的函式庫而被列為易受攻擊的項目。請檢查 :const:`!pyexpat." "EXPAT_VERSION`。" -#: ../../library/xml.rst:77 +#: ../../library/xml.rst:78 msgid "" ":mod:`xml.etree.ElementTree` doesn't expand external entities and raises a :" "exc:`~xml.etree.ElementTree.ParseError` when an entity occurs." @@ -203,27 +212,39 @@ msgstr "" ":mod:`xml.etree.ElementTree` 不會擴展外部實體,並在實體出現時引發 :exc:`~xml." "etree.ElementTree.ParseError`。" -#: ../../library/xml.rst:79 +#: ../../library/xml.rst:80 msgid "" ":mod:`xml.dom.minidom` doesn't expand external entities and simply returns " "the unexpanded entity verbatim." msgstr ":mod:`xml.dom.minidom` 不會擴展外部實體,只會逐字回傳未擴展的實體。" -#: ../../library/xml.rst:81 +#: ../../library/xml.rst:82 msgid ":mod:`xmlrpc.client` doesn't expand external entities and omits them." msgstr ":mod:`xmlrpc.client` 不會擴展外部實體且會忽略它們。" -#: ../../library/xml.rst:82 +#: ../../library/xml.rst:83 msgid "" "Since Python 3.7.1, external general entities are no longer processed by " "default." msgstr "從 Python 3.7.1 開始,預設情況下不再處理外部通用實體。" -#: ../../library/xml.rst:91 +#: ../../library/xml.rst:85 +#, fuzzy +msgid "" +"Expat 2.6.0 and newer is not vulnerable to denial of service through " +"quadratic runtime caused by parsing large tokens. Items still listed as " +"vulnerable due to potential reliance on system-provided libraries. Check :" +"const:`!pyexpat.EXPAT_VERSION`." +msgstr "" +"Expat 2.4.1 及更新的版本不易受到「十億笑聲」和「二次爆炸」漏洞的影響。但仍可" +"能由於依賴系統提供的函式庫而被列為易受攻擊的項目。請檢查 :const:`!pyexpat." +"EXPAT_VERSION`。" + +#: ../../library/xml.rst:97 msgid "billion laughs / exponential entity expansion" msgstr "十億笑聲 / 指數實體擴展" -#: ../../library/xml.rst:87 +#: ../../library/xml.rst:93 msgid "" "The `Billion Laughs`_ attack -- also known as exponential entity expansion " "-- uses multiple levels of nested entities. Each entity refers to another " @@ -235,11 +256,11 @@ msgstr "" "expansion))使用多層巢狀實體。每個實體多次引用另一個實體,最終的實體定義包含" "一個小字串。指數擴展會產生數 GB 的文本,並消耗大量記憶體和 CPU 時間。" -#: ../../library/xml.rst:98 +#: ../../library/xml.rst:104 msgid "quadratic blowup entity expansion" msgstr "二次爆炸實體擴展" -#: ../../library/xml.rst:94 +#: ../../library/xml.rst:100 msgid "" "A quadratic blowup attack is similar to a `Billion Laughs`_ attack; it " "abuses entity expansion, too. Instead of nested entities it repeats one " @@ -251,7 +272,7 @@ msgstr "" "它不是巢狀實體,而是一遍又一遍地重複一個具有幾千個字元的大型實體。該攻擊不如" "指數擴展那麼有效率,但它不會觸發那些用來防止深度巢狀實體的剖析器對策。" -#: ../../library/xml.rst:101 +#: ../../library/xml.rst:107 msgid "" "Entity declarations can contain more than just text for replacement. They " "can also point to external resources or local files. The XML parser accesses " @@ -260,7 +281,7 @@ msgstr "" "實體聲明不僅僅可以包含用於替換的文本,它們還可以指向外部資源或本地檔案。XML " "剖析器會存取資源並將內容嵌入到 XML 文件中。" -#: ../../library/xml.rst:106 +#: ../../library/xml.rst:112 msgid "" "Some XML libraries like Python's :mod:`xml.dom.pulldom` retrieve document " "type definitions from remote or local locations. The feature has similar " @@ -269,7 +290,7 @@ msgstr "" "一些 XML 函式庫(例如 Python 的 :mod:`xml.dom.pulldom`)從遠端或本地位置檢索" "文件類型定義。該功能與外部實體擴展問題具有類似的含義。" -#: ../../library/xml.rst:111 +#: ../../library/xml.rst:117 msgid "" "Decompression bombs (aka `ZIP bomb`_) apply to all XML libraries that can " "parse compressed XML streams such as gzipped HTTP streams or LZMA-compressed " @@ -280,7 +301,16 @@ msgstr "" "壓縮的 HTTP 串流或 LZMA 壓縮檔案)的 XML 函式庫。對於攻擊者來說,它可以將傳輸" "的資料量減少三個或更多數量級。" -#: ../../library/xml.rst:117 +#: ../../library/xml.rst:124 +msgid "" +"Expat needs to re-parse unfinished tokens; without the protection introduced " +"in Expat 2.6.0, this can lead to quadratic runtime that can be used to cause " +"denial of service in the application parsing XML. The issue is known as " +"`CVE-2023-52425 `_." +msgstr "" + +#: ../../library/xml.rst:130 msgid "" "The documentation for `defusedxml`_ on PyPI has further information about " "all known attack vectors with examples and references." @@ -288,11 +318,11 @@ msgstr "" "PyPI 上的 `defusedxml`_ 文件包含有關所有已知攻擊媒介 (attack vector) 的更多資" "訊以及範例和參考資料。" -#: ../../library/xml.rst:123 +#: ../../library/xml.rst:136 msgid "The :mod:`!defusedxml` Package" msgstr ":mod:`!defusedxml` 套件" -#: ../../library/xml.rst:125 +#: ../../library/xml.rst:138 msgid "" "`defusedxml`_ is a pure Python package with modified subclasses of all " "stdlib XML parsers that prevent any potentially malicious operation. Use of " From 3d846c3a0aa26c76af0f00cb85f6fe9ca5d9f9c0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 23 Feb 2024 00:04:51 +0000 Subject: [PATCH 17/33] sync with cpython b254de71 --- using/windows.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/using/windows.po b/using/windows.po index bd3c17e947..8de81c7d0a 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"POT-Creation-Date: 2024-02-23 00:03+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-" @@ -35,11 +35,11 @@ msgid "" "Unlike most Unix systems and services, Windows does not include a system " "supported installation of Python. To make Python available, the CPython team " "has compiled Windows installers (MSI packages) with every `release `_ for many years. These installers are " -"primarily intended to add a per-user installation of Python, with the core " -"interpreter and library being used by a single user. The installer is also " -"able to install for all users of a single machine, and a separate ZIP file " -"is available for application-local distributions." +"www.python.org/downloads/>`_ for many years. These installers are primarily " +"intended to add a per-user installation of Python, with the core interpreter " +"and library being used by a single user. The installer is also able to " +"install for all users of a single machine, and a separate ZIP file is " +"available for application-local distributions." msgstr "" #: ../../using/windows.rst:24 From dc661a0caf223873a3b101fdfe7e30e45e67a57d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 24 Feb 2024 00:04:34 +0000 Subject: [PATCH 18/33] sync with cpython 71b75f6f --- howto/gdb_helpers.po | 396 ++++++++++++++++++++++++++++++++++++++ library/http.cookiejar.po | 44 +++-- library/pyexpat.po | 212 ++++++++++---------- 3 files changed, 528 insertions(+), 124 deletions(-) create mode 100644 howto/gdb_helpers.po diff --git a/howto/gdb_helpers.po b/howto/gdb_helpers.po new file mode 100644 index 0000000000..2d8f2205a3 --- /dev/null +++ b/howto/gdb_helpers.po @@ -0,0 +1,396 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-02-24 00:03+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../howto/gdb_helpers.rst:5 +msgid "Debugging C API extensions and CPython Internals with GDB" +msgstr "" + +#: ../../howto/gdb_helpers.rst:9 +msgid "" +"This document explains how the Python GDB extension, ``python-gdb.py``, can " +"be used with the GDB debugger to debug CPython extensions and the CPython " +"interpreter itself." +msgstr "" + +#: ../../howto/gdb_helpers.rst:13 +msgid "" +"When debugging low-level problems such as crashes or deadlocks, a low-level " +"debugger, such as GDB, is useful to diagnose and correct the issue. By " +"default, GDB (or any of its front-ends) doesn't support high-level " +"information specific to the CPython interpreter." +msgstr "" + +#: ../../howto/gdb_helpers.rst:18 +msgid "" +"The ``python-gdb.py`` extension adds CPython interpreter information to GDB. " +"The extension helps introspect the stack of currently executing Python " +"functions. Given a Python object represented by a :c:expr:`PyObject *` " +"pointer, the extension surfaces the type and value of the object." +msgstr "" + +#: ../../howto/gdb_helpers.rst:23 +msgid "" +"Developers who are working on CPython extensions or tinkering with parts of " +"CPython that are written in C can use this document to learn how to use the " +"``python-gdb.py`` extension with GDB." +msgstr "" + +#: ../../howto/gdb_helpers.rst:29 +msgid "" +"This document assumes that you are familiar with the basics of GDB and the " +"CPython C API. It consolidates guidance from the `devguide `_ and the `Python wiki `_." +msgstr "" + +#: ../../howto/gdb_helpers.rst:36 +msgid "Prerequisites" +msgstr "" + +#: ../../howto/gdb_helpers.rst:38 +msgid "You need to have:" +msgstr "" + +#: ../../howto/gdb_helpers.rst:40 +msgid "" +"GDB 7 or later. (For earlier versions of GDB, see ``Misc/gdbinit`` in the " +"sources of Python 3.11 or earlier.)" +msgstr "" + +#: ../../howto/gdb_helpers.rst:42 +msgid "" +"GDB-compatible debugging information for Python and any extension you are " +"debugging." +msgstr "" + +#: ../../howto/gdb_helpers.rst:44 +msgid "The ``python-gdb.py`` extension." +msgstr "" + +#: ../../howto/gdb_helpers.rst:46 +msgid "" +"The extension is built with Python, but might be distributed separately or " +"not at all. Below, we include tips for a few common systems as examples. " +"Note that even if the instructions match your system, they might be outdated." +msgstr "" + +#: ../../howto/gdb_helpers.rst:52 +msgid "Setup with Python built from source" +msgstr "" + +#: ../../howto/gdb_helpers.rst:54 +msgid "" +"When you build CPython from source, debugging information should be " +"available, and the build should add a ``python-gdb.py`` file to the root " +"directory of your repository." +msgstr "" + +#: ../../howto/gdb_helpers.rst:58 +msgid "" +"To activate support, you must add the directory containing ``python-gdb.py`` " +"to GDB's \"auto-load-safe-path\". If you haven't done this, recent versions " +"of GDB will print out a warning with instructions on how to do this." +msgstr "" + +#: ../../howto/gdb_helpers.rst:65 +msgid "" +"If you do not see instructions for your version of GDB, put this in your " +"configuration file (``~/.gdbinit`` or ``~/.config/gdb/gdbinit``)::" +msgstr "" + +#: ../../howto/gdb_helpers.rst:70 +msgid "You can also add multiple paths, separated by ``:``." +msgstr "" + +#: ../../howto/gdb_helpers.rst:74 +msgid "Setup for Python from a Linux distro" +msgstr "" + +#: ../../howto/gdb_helpers.rst:76 +msgid "" +"Most Linux systems provide debug information for the system Python in a " +"package called ``python-debuginfo``, ``python-dbg`` or similar. For example:" +msgstr "" + +#: ../../howto/gdb_helpers.rst:80 +msgid "Fedora:" +msgstr "" + +#: ../../howto/gdb_helpers.rst:87 +msgid "Ubuntu:" +msgstr "" + +#: ../../howto/gdb_helpers.rst:93 +msgid "" +"On several recent Linux systems, GDB can download debugging symbols " +"automatically using *debuginfod*. However, this will not install the " +"``python-gdb.py`` extension; you generally do need to install the debug info " +"package separately." +msgstr "" + +#: ../../howto/gdb_helpers.rst:100 +msgid "Using the Debug build and Development mode" +msgstr "" + +#: ../../howto/gdb_helpers.rst:102 +msgid "For easier debugging, you might want to:" +msgstr "" + +#: ../../howto/gdb_helpers.rst:104 +msgid "" +"Use a :ref:`debug build ` of Python. (When building from " +"source, use ``configure --with-pydebug``. On Linux distros, install and run " +"a package like ``python-debug`` or ``python-dbg``, if available.)" +msgstr "" + +#: ../../howto/gdb_helpers.rst:107 +msgid "Use the runtime :ref:`development mode ` (``-X dev``)." +msgstr "" + +#: ../../howto/gdb_helpers.rst:109 +msgid "" +"Both enable extra assertions and disable some optimizations. Sometimes this " +"hides the bug you are trying to find, but in most cases they make the " +"process easier." +msgstr "" + +#: ../../howto/gdb_helpers.rst:115 +msgid "Using the ``python-gdb`` extension" +msgstr "" + +#: ../../howto/gdb_helpers.rst:117 +msgid "" +"When the extension is loaded, it provides two main features: pretty printers " +"for Python values, and additional commands." +msgstr "" + +#: ../../howto/gdb_helpers.rst:121 +msgid "Pretty-printers" +msgstr "" + +#: ../../howto/gdb_helpers.rst:123 +msgid "" +"This is what a GDB backtrace looks like (truncated) when this extension is " +"enabled::" +msgstr "" + +#: ../../howto/gdb_helpers.rst:142 +msgid "" +"Notice how the dictionary argument to ``PyDict_GetItemString`` is displayed " +"as its ``repr()``, rather than an opaque ``PyObject *`` pointer." +msgstr "" + +#: ../../howto/gdb_helpers.rst:145 +msgid "" +"The extension works by supplying a custom printing routine for values of " +"type ``PyObject *``. If you need to access lower-level details of an " +"object, then cast the value to a pointer of the appropriate type. For " +"example::" +msgstr "" + +#: ../../howto/gdb_helpers.rst:168 +msgid "" +"Note that the pretty-printers do not actually call ``repr()``. For basic " +"types, they try to match its result closely." +msgstr "" + +#: ../../howto/gdb_helpers.rst:171 +msgid "" +"An area that can be confusing is that the custom printer for some types look " +"a lot like GDB's built-in printer for standard types. For example, the " +"pretty-printer for a Python ``int`` (:c:expr:`PyLongObject *`) gives a " +"representation that is not distinguishable from one of a regular machine-" +"level integer::" +msgstr "" + +#: ../../howto/gdb_helpers.rst:183 +msgid "" +"The internal structure can be revealed with a cast to :c:expr:`PyLongObject " +"*`:" +msgstr "" + +#: ../../howto/gdb_helpers.rst:185 +msgid "" +"(gdb) p *(PyLongObject*)some_python_integer $5 = {ob_base = {ob_base = " +"{ob_refcnt = 8, ob_type = 0x3dad39f5e0}, ob_size = 1}, ob_digit = {42}}" +msgstr "" + +#: ../../howto/gdb_helpers.rst:189 +msgid "" +"A similar confusion can arise with the ``str`` type, where the output looks " +"a lot like gdb's built-in printer for ``char *``::" +msgstr "" + +#: ../../howto/gdb_helpers.rst:195 +msgid "" +"The pretty-printer for ``str`` instances defaults to using single-quotes (as " +"does Python's ``repr`` for strings) whereas the standard printer for ``char " +"*`` values uses double-quotes and contains a hexadecimal address::" +msgstr "" + +#: ../../howto/gdb_helpers.rst:202 +msgid "" +"Again, the implementation details can be revealed with a cast to :c:expr:" +"`PyUnicodeObject *`::" +msgstr "" + +#: ../../howto/gdb_helpers.rst:210 +msgid "``py-list``" +msgstr "" + +#: ../../howto/gdb_helpers.rst:212 +msgid "" +"The extension adds a ``py-list`` command, which lists the Python source code " +"(if any) for the current frame in the selected thread. The current line is " +"marked with a \">\"::" +msgstr "" + +#: ../../howto/gdb_helpers.rst:229 +msgid "" +"Use ``py-list START`` to list at a different line number within the Python " +"source, and ``py-list START,END`` to list a specific range of lines within " +"the Python source." +msgstr "" + +#: ../../howto/gdb_helpers.rst:234 +msgid "``py-up`` and ``py-down``" +msgstr "" + +#: ../../howto/gdb_helpers.rst:236 +msgid "" +"The ``py-up`` and ``py-down`` commands are analogous to GDB's regular ``up`` " +"and ``down`` commands, but try to move at the level of CPython frames, " +"rather than C frames." +msgstr "" + +#: ../../howto/gdb_helpers.rst:240 +msgid "" +"GDB is not always able to read the relevant frame information, depending on " +"the optimization level with which CPython was compiled. Internally, the " +"commands look for C frames that are executing the default frame evaluation " +"function (that is, the core bytecode interpreter loop within CPython) and " +"look up the value of the related ``PyFrameObject *``." +msgstr "" + +#: ../../howto/gdb_helpers.rst:246 +msgid "They emit the frame number (at the C level) within the thread." +msgstr "" + +#: ../../howto/gdb_helpers.rst:248 ../../howto/gdb_helpers.rst:320 +msgid "For example::" +msgstr "" + +#: ../../howto/gdb_helpers.rst:261 +msgid "so we're at the top of the Python stack." +msgstr "" + +#: ../../howto/gdb_helpers.rst:263 +msgid "" +"The frame numbers correspond to those displayed by GDB's standard " +"``backtrace`` command. The command skips C frames which are not executing " +"Python code." +msgstr "" + +#: ../../howto/gdb_helpers.rst:267 +msgid "Going back down::" +msgstr "" + +#: ../../howto/gdb_helpers.rst:289 +msgid "and we're at the bottom of the Python stack." +msgstr "" + +#: ../../howto/gdb_helpers.rst:291 +msgid "" +"Note that in Python 3.12 and newer, the same C stack frame can be used for " +"multiple Python stack frames. This means that ``py-up`` and ``py-down`` may " +"move multiple Python frames at once. For example::" +msgstr "" + +#: ../../howto/gdb_helpers.rst:315 +msgid "``py-bt``" +msgstr "" + +#: ../../howto/gdb_helpers.rst:317 +msgid "" +"The ``py-bt`` command attempts to display a Python-level backtrace of the " +"current thread." +msgstr "" + +#: ../../howto/gdb_helpers.rst:336 +msgid "" +"The frame numbers correspond to those displayed by GDB's standard " +"``backtrace`` command." +msgstr "" + +#: ../../howto/gdb_helpers.rst:340 +msgid "``py-print``" +msgstr "" + +#: ../../howto/gdb_helpers.rst:342 +msgid "" +"The ``py-print`` command looks up a Python name and tries to print it. It " +"looks in locals within the current thread, then globals, then finally " +"builtins::" +msgstr "" + +#: ../../howto/gdb_helpers.rst:356 +msgid "" +"If the current C frame corresponds to multiple Python frames, ``py-print`` " +"only considers the first one." +msgstr "" + +#: ../../howto/gdb_helpers.rst:360 +msgid "``py-locals``" +msgstr "" + +#: ../../howto/gdb_helpers.rst:362 +msgid "" +"The ``py-locals`` command looks up all Python locals within the current " +"Python frame in the selected thread, and prints their representations::" +msgstr "" + +#: ../../howto/gdb_helpers.rst:370 +msgid "" +"If the current C frame corresponds to multiple Python frames, locals from " +"all of them will be shown::" +msgstr "" + +#: ../../howto/gdb_helpers.rst:390 +msgid "Use with GDB commands" +msgstr "" + +#: ../../howto/gdb_helpers.rst:392 +msgid "" +"The extension commands complement GDB's built-in commands. For example, you " +"can use a frame numbers shown by ``py-bt`` with the ``frame`` command to go " +"a specific frame within the selected thread, like this::" +msgstr "" + +#: ../../howto/gdb_helpers.rst:411 +msgid "" +"The ``info threads`` command will give you a list of the threads within the " +"process, and you can use the ``thread`` command to select a different one::" +msgstr "" + +#: ../../howto/gdb_helpers.rst:419 +msgid "" +"You can use ``thread apply all COMMAND`` or (``t a a COMMAND`` for short) to " +"run a command on all threads. With ``py-bt``, this lets you see what every " +"thread is doing at the Python level::" +msgstr "" diff --git a/library/http.cookiejar.po b/library/http.cookiejar.po index ff0abea3da..10f1545847 100644 --- a/library/http.cookiejar.po +++ b/library/http.cookiejar.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2024-02-24 00:03+0000\n" "PO-Revision-Date: 2016-11-19 00:31+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -824,36 +824,40 @@ msgid "" msgstr "" #: ../../library/http.cookiejar.rst:654 -msgid "Cookie path (a string, eg. ``'/acme/rocket_launchers'``)." +msgid "Cookie domain (a string)." msgstr "" #: ../../library/http.cookiejar.rst:659 -msgid "``True`` if cookie should only be returned over a secure connection." +msgid "Cookie path (a string, eg. ``'/acme/rocket_launchers'``)." msgstr "" #: ../../library/http.cookiejar.rst:664 +msgid "``True`` if cookie should only be returned over a secure connection." +msgstr "" + +#: ../../library/http.cookiejar.rst:669 msgid "" "Integer expiry date in seconds since epoch, or :const:`None`. See also the :" "meth:`is_expired` method." msgstr "" -#: ../../library/http.cookiejar.rst:670 +#: ../../library/http.cookiejar.rst:675 msgid "``True`` if this is a session cookie." msgstr "" -#: ../../library/http.cookiejar.rst:675 +#: ../../library/http.cookiejar.rst:680 msgid "" "String comment from the server explaining the function of this cookie, or :" "const:`None`." msgstr "" -#: ../../library/http.cookiejar.rst:681 +#: ../../library/http.cookiejar.rst:686 msgid "" "URL linking to a comment from the server explaining the function of this " "cookie, or :const:`None`." msgstr "" -#: ../../library/http.cookiejar.rst:687 +#: ../../library/http.cookiejar.rst:692 msgid "" "``True`` if this cookie was received as an :rfc:`2109` cookie (ie. the " "cookie arrived in a :mailheader:`Set-Cookie` header, and the value of the " @@ -862,70 +866,70 @@ msgid "" "cookies, in which case :attr:`version` is 0." msgstr "" -#: ../../library/http.cookiejar.rst:696 +#: ../../library/http.cookiejar.rst:701 msgid "" "``True`` if a port or set of ports was explicitly specified by the server " "(in the :mailheader:`Set-Cookie` / :mailheader:`Set-Cookie2` header)." msgstr "" -#: ../../library/http.cookiejar.rst:702 +#: ../../library/http.cookiejar.rst:707 msgid "``True`` if a domain was explicitly specified by the server." msgstr "" -#: ../../library/http.cookiejar.rst:707 +#: ../../library/http.cookiejar.rst:712 msgid "" "``True`` if the domain explicitly specified by the server began with a dot " "(``'.'``)." msgstr "" -#: ../../library/http.cookiejar.rst:710 +#: ../../library/http.cookiejar.rst:715 msgid "" "Cookies may have additional non-standard cookie-attributes. These may be " "accessed using the following methods:" msgstr "" -#: ../../library/http.cookiejar.rst:716 +#: ../../library/http.cookiejar.rst:721 msgid "Return ``True`` if cookie has the named cookie-attribute." msgstr "" -#: ../../library/http.cookiejar.rst:721 +#: ../../library/http.cookiejar.rst:726 msgid "" "If cookie has the named cookie-attribute, return its value. Otherwise, " "return *default*." msgstr "" -#: ../../library/http.cookiejar.rst:727 +#: ../../library/http.cookiejar.rst:732 msgid "Set the value of the named cookie-attribute." msgstr "" -#: ../../library/http.cookiejar.rst:729 +#: ../../library/http.cookiejar.rst:734 msgid "The :class:`Cookie` class also defines the following method:" msgstr "" -#: ../../library/http.cookiejar.rst:734 +#: ../../library/http.cookiejar.rst:739 msgid "" "``True`` if cookie has passed the time at which the server requested it " "should expire. If *now* is given (in seconds since the epoch), return " "whether the cookie has expired at the specified time." msgstr "" -#: ../../library/http.cookiejar.rst:740 +#: ../../library/http.cookiejar.rst:745 msgid "Examples" msgstr "範例" -#: ../../library/http.cookiejar.rst:742 +#: ../../library/http.cookiejar.rst:747 msgid "" "The first example shows the most common usage of :mod:`http.cookiejar`::" msgstr "" -#: ../../library/http.cookiejar.rst:749 +#: ../../library/http.cookiejar.rst:754 msgid "" "This example illustrates how to open a URL using your Netscape, Mozilla, or " "Lynx cookies (assumes Unix/Netscape convention for location of the cookies " "file)::" msgstr "" -#: ../../library/http.cookiejar.rst:758 +#: ../../library/http.cookiejar.rst:763 msgid "" "The next example illustrates the use of :class:`DefaultCookiePolicy`. Turn " "on :rfc:`2965` cookies, be more strict about domains when setting and " diff --git a/library/pyexpat.po b/library/pyexpat.po index f3a0514505..4760c62bad 100644 --- a/library/pyexpat.po +++ b/library/pyexpat.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2024-02-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -232,17 +232,18 @@ msgid "" "`CharacterDataHandler` callback whenever possible. This can improve " "performance substantially since Expat normally breaks character data into " "chunks at every line ending. This attribute is false by default, and may be " -"changed at any time." +"changed at any time. Note that when it is false, data that does not contain " +"newlines may be chunked too." msgstr "" -#: ../../library/pyexpat.rst:222 +#: ../../library/pyexpat.rst:223 msgid "" "If :attr:`buffer_text` is enabled, the number of bytes stored in the buffer. " "These bytes represent UTF-8 encoded text. This attribute has no meaningful " "interpretation when :attr:`buffer_text` is false." msgstr "" -#: ../../library/pyexpat.rst:229 +#: ../../library/pyexpat.rst:230 msgid "" "Setting this attribute to a non-zero integer causes the attributes to be " "reported as a list rather than a dictionary. The attributes are presented " @@ -252,7 +253,7 @@ msgid "" "is false; it may be changed at any time." msgstr "" -#: ../../library/pyexpat.rst:239 +#: ../../library/pyexpat.rst:240 msgid "" "If set to a non-zero integer, the parser will report only those attributes " "which were specified in the document instance and not those which were " @@ -263,7 +264,7 @@ msgid "" "time." msgstr "" -#: ../../library/pyexpat.rst:247 +#: ../../library/pyexpat.rst:248 msgid "" "The following attributes contain values relating to the most recent error " "encountered by an :class:`xmlparser` object, and will only have correct " @@ -271,26 +272,26 @@ msgid "" "`xml.parsers.expat.ExpatError` exception." msgstr "" -#: ../../library/pyexpat.rst:255 +#: ../../library/pyexpat.rst:256 msgid "Byte index at which an error occurred." msgstr "" -#: ../../library/pyexpat.rst:260 +#: ../../library/pyexpat.rst:261 msgid "" "Numeric code specifying the problem. This value can be passed to the :func:" "`ErrorString` function, or compared to one of the constants defined in the " "``errors`` object." msgstr "" -#: ../../library/pyexpat.rst:267 +#: ../../library/pyexpat.rst:268 msgid "Column number at which an error occurred." msgstr "" -#: ../../library/pyexpat.rst:272 +#: ../../library/pyexpat.rst:273 msgid "Line number at which an error occurred." msgstr "" -#: ../../library/pyexpat.rst:274 +#: ../../library/pyexpat.rst:275 msgid "" "The following attributes contain values relating to the current parse " "location in an :class:`xmlparser` object. During a callback reporting a " @@ -300,19 +301,19 @@ msgid "" "whether there was an associated callback)." msgstr "" -#: ../../library/pyexpat.rst:284 +#: ../../library/pyexpat.rst:285 msgid "Current byte index in the parser input." msgstr "" -#: ../../library/pyexpat.rst:289 +#: ../../library/pyexpat.rst:290 msgid "Current column number in the parser input." msgstr "" -#: ../../library/pyexpat.rst:294 +#: ../../library/pyexpat.rst:295 msgid "Current line number in the parser input." msgstr "" -#: ../../library/pyexpat.rst:296 +#: ../../library/pyexpat.rst:297 msgid "" "Here is the list of handlers that can be set. To set a handler on an :class:" "`xmlparser` object *o*, use ``o.handlername = func``. *handlername* must be " @@ -321,7 +322,7 @@ msgid "" "unless otherwise stated." msgstr "" -#: ../../library/pyexpat.rst:305 +#: ../../library/pyexpat.rst:306 msgid "" "Called when the XML declaration is parsed. The XML declaration is the " "(optional) declaration of the applicable version of the XML recommendation, " @@ -332,7 +333,7 @@ msgid "" "only available with Expat version 1.95.0 or newer." msgstr "" -#: ../../library/pyexpat.rst:316 +#: ../../library/pyexpat.rst:317 msgid "" "Called when Expat begins parsing the document type declaration (``'``." msgstr "" -#: ../../library/pyexpat.rst:430 +#: ../../library/pyexpat.rst:434 msgid "" "Called at the start of a CDATA section. This and :attr:" "`EndCdataSectionHandler` are needed to be able to identify the syntactical " "start and end for CDATA sections." msgstr "" -#: ../../library/pyexpat.rst:437 +#: ../../library/pyexpat.rst:441 msgid "Called at the end of a CDATA section." msgstr "" -#: ../../library/pyexpat.rst:442 +#: ../../library/pyexpat.rst:446 msgid "" "Called for any characters in the XML document for which no applicable " "handler has been specified. This means characters that are part of a " @@ -463,14 +467,14 @@ msgid "" "supplied." msgstr "" -#: ../../library/pyexpat.rst:449 +#: ../../library/pyexpat.rst:453 msgid "" "This is the same as the :func:`DefaultHandler`, but doesn't inhibit " "expansion of internal entities. The entity reference will not be passed to " "the default handler." msgstr "" -#: ../../library/pyexpat.rst:456 +#: ../../library/pyexpat.rst:460 msgid "" "Called if the XML document hasn't been declared as being a standalone " "document. This happens when there is an external subset or a reference to a " @@ -480,7 +484,7 @@ msgid "" "set, no exception is raised by the parser for this condition." msgstr "" -#: ../../library/pyexpat.rst:466 +#: ../../library/pyexpat.rst:470 msgid "" "Called for references to external entities. *base* is the current base, as " "set by a previous call to :meth:`SetBase`. The public and system " @@ -489,7 +493,7 @@ msgid "" "is opaque and should only be used as described below." msgstr "" -#: ../../library/pyexpat.rst:472 +#: ../../library/pyexpat.rst:476 msgid "" "For external entities to be parsed, this handler must be implemented. It is " "responsible for creating the sub-parser using " @@ -499,130 +503,130 @@ msgid "" "`XML_ERROR_EXTERNAL_ENTITY_HANDLING` error, otherwise parsing will continue." msgstr "" -#: ../../library/pyexpat.rst:480 +#: ../../library/pyexpat.rst:484 msgid "" "If this handler is not provided, external entities are reported by the :attr:" "`DefaultHandler` callback, if provided." msgstr "" -#: ../../library/pyexpat.rst:487 +#: ../../library/pyexpat.rst:491 msgid "ExpatError Exceptions" msgstr "ExpatError 例外" -#: ../../library/pyexpat.rst:492 +#: ../../library/pyexpat.rst:496 msgid ":exc:`ExpatError` exceptions have a number of interesting attributes:" msgstr "" -#: ../../library/pyexpat.rst:497 +#: ../../library/pyexpat.rst:501 msgid "" "Expat's internal error number for the specific error. The :data:`errors." "messages ` dictionary maps these error " "numbers to Expat's error messages. For example::" msgstr "" -#: ../../library/pyexpat.rst:509 +#: ../../library/pyexpat.rst:513 msgid "" "The :mod:`~xml.parsers.expat.errors` module also provides error message " "constants and a dictionary :data:`~xml.parsers.expat.errors.codes` mapping " "these messages back to the error codes, see below." msgstr "" -#: ../../library/pyexpat.rst:516 +#: ../../library/pyexpat.rst:520 msgid "" "Line number on which the error was detected. The first line is numbered " "``1``." msgstr "" -#: ../../library/pyexpat.rst:521 +#: ../../library/pyexpat.rst:525 msgid "" "Character offset into the line where the error occurred. The first column " "is numbered ``0``." msgstr "" -#: ../../library/pyexpat.rst:528 +#: ../../library/pyexpat.rst:532 msgid "Example" msgstr "範例" -#: ../../library/pyexpat.rst:530 +#: ../../library/pyexpat.rst:534 msgid "" "The following program defines three handlers that just print out their " "arguments. ::" msgstr "" -#: ../../library/pyexpat.rst:554 +#: ../../library/pyexpat.rst:558 msgid "The output from this program is::" msgstr "" -#: ../../library/pyexpat.rst:571 +#: ../../library/pyexpat.rst:575 msgid "Content Model Descriptions" msgstr "" -#: ../../library/pyexpat.rst:577 +#: ../../library/pyexpat.rst:581 msgid "" "Content models are described using nested tuples. Each tuple contains four " "values: the type, the quantifier, the name, and a tuple of children. " "Children are simply additional content model descriptions." msgstr "" -#: ../../library/pyexpat.rst:581 +#: ../../library/pyexpat.rst:585 msgid "" "The values of the first two fields are constants defined in the :mod:`xml." "parsers.expat.model` module. These constants can be collected in two " "groups: the model type group and the quantifier group." msgstr "" -#: ../../library/pyexpat.rst:585 +#: ../../library/pyexpat.rst:589 msgid "The constants in the model type group are:" msgstr "" -#: ../../library/pyexpat.rst:591 +#: ../../library/pyexpat.rst:595 msgid "" "The element named by the model name was declared to have a content model of " "``ANY``." msgstr "" -#: ../../library/pyexpat.rst:598 +#: ../../library/pyexpat.rst:602 msgid "" "The named element allows a choice from a number of options; this is used for " "content models such as ``(A | B | C)``." msgstr "" -#: ../../library/pyexpat.rst:605 +#: ../../library/pyexpat.rst:609 msgid "Elements which are declared to be ``EMPTY`` have this model type." msgstr "" -#: ../../library/pyexpat.rst:619 +#: ../../library/pyexpat.rst:623 msgid "" "Models which represent a series of models which follow one after the other " "are indicated with this model type. This is used for models such as ``(A, " "B, C)``." msgstr "" -#: ../../library/pyexpat.rst:622 +#: ../../library/pyexpat.rst:626 msgid "The constants in the quantifier group are:" msgstr "" -#: ../../library/pyexpat.rst:628 +#: ../../library/pyexpat.rst:632 msgid "No modifier is given, so it can appear exactly once, as for ``A``." msgstr "" -#: ../../library/pyexpat.rst:634 +#: ../../library/pyexpat.rst:638 msgid "The model is optional: it can appear once or not at all, as for ``A?``." msgstr "" -#: ../../library/pyexpat.rst:640 +#: ../../library/pyexpat.rst:644 msgid "The model must occur one or more times (like ``A+``)." msgstr "" -#: ../../library/pyexpat.rst:646 +#: ../../library/pyexpat.rst:650 msgid "The model must occur zero or more times, as for ``A*``." msgstr "" -#: ../../library/pyexpat.rst:652 +#: ../../library/pyexpat.rst:656 msgid "Expat error constants" msgstr "" -#: ../../library/pyexpat.rst:656 +#: ../../library/pyexpat.rst:660 msgid "" "The following constants are provided in the :mod:`xml.parsers.expat.errors` " "module. These constants are useful in interpreting some of the attributes " @@ -633,206 +637,206 @@ msgid "" "XML_ERROR_{CONSTANT_NAME}]`." msgstr "" -#: ../../library/pyexpat.rst:664 +#: ../../library/pyexpat.rst:668 msgid "The ``errors`` module has the following attributes:" msgstr "" -#: ../../library/pyexpat.rst:668 +#: ../../library/pyexpat.rst:672 msgid "A dictionary mapping string descriptions to their error codes." msgstr "" -#: ../../library/pyexpat.rst:675 +#: ../../library/pyexpat.rst:679 msgid "A dictionary mapping numeric error codes to their string descriptions." msgstr "" -#: ../../library/pyexpat.rst:685 +#: ../../library/pyexpat.rst:689 msgid "" "An entity reference in an attribute value referred to an external entity " "instead of an internal entity." msgstr "" -#: ../../library/pyexpat.rst:691 +#: ../../library/pyexpat.rst:695 msgid "" "A character reference referred to a character which is illegal in XML (for " "example, character ``0``, or '``�``')." msgstr "" -#: ../../library/pyexpat.rst:697 +#: ../../library/pyexpat.rst:701 msgid "" "An entity reference referred to an entity which was declared with a " "notation, so cannot be parsed." msgstr "" -#: ../../library/pyexpat.rst:703 +#: ../../library/pyexpat.rst:707 msgid "An attribute was used more than once in a start tag." msgstr "" -#: ../../library/pyexpat.rst:711 +#: ../../library/pyexpat.rst:715 msgid "" "Raised when an input byte could not properly be assigned to a character; for " "example, a NUL byte (value ``0``) in a UTF-8 input stream." msgstr "" -#: ../../library/pyexpat.rst:717 +#: ../../library/pyexpat.rst:721 msgid "Something other than whitespace occurred after the document element." msgstr "" -#: ../../library/pyexpat.rst:722 +#: ../../library/pyexpat.rst:726 msgid "" "An XML declaration was found somewhere other than the start of the input " "data." msgstr "" -#: ../../library/pyexpat.rst:727 +#: ../../library/pyexpat.rst:731 msgid "" "The document contains no elements (XML requires all documents to contain " "exactly one top-level element).." msgstr "" -#: ../../library/pyexpat.rst:733 +#: ../../library/pyexpat.rst:737 msgid "Expat was not able to allocate memory internally." msgstr "" -#: ../../library/pyexpat.rst:738 +#: ../../library/pyexpat.rst:742 msgid "A parameter entity reference was found where it was not allowed." msgstr "" -#: ../../library/pyexpat.rst:743 +#: ../../library/pyexpat.rst:747 msgid "An incomplete character was found in the input." msgstr "" -#: ../../library/pyexpat.rst:748 +#: ../../library/pyexpat.rst:752 msgid "" "An entity reference contained another reference to the same entity; possibly " "via a different name, and possibly indirectly." msgstr "" -#: ../../library/pyexpat.rst:754 +#: ../../library/pyexpat.rst:758 msgid "Some unspecified syntax error was encountered." msgstr "" -#: ../../library/pyexpat.rst:759 +#: ../../library/pyexpat.rst:763 msgid "An end tag did not match the innermost open start tag." msgstr "" -#: ../../library/pyexpat.rst:764 +#: ../../library/pyexpat.rst:768 msgid "" "Some token (such as a start tag) was not closed before the end of the stream " "or the next token was encountered." msgstr "" -#: ../../library/pyexpat.rst:770 +#: ../../library/pyexpat.rst:774 msgid "A reference was made to an entity which was not defined." msgstr "" -#: ../../library/pyexpat.rst:775 +#: ../../library/pyexpat.rst:779 msgid "The document encoding is not supported by Expat." msgstr "" -#: ../../library/pyexpat.rst:780 +#: ../../library/pyexpat.rst:784 msgid "A CDATA marked section was not closed." msgstr "" -#: ../../library/pyexpat.rst:788 +#: ../../library/pyexpat.rst:792 msgid "" "The parser determined that the document was not \"standalone\" though it " "declared itself to be in the XML declaration, and the :attr:" "`NotStandaloneHandler` was set and returned ``0``." msgstr "" -#: ../../library/pyexpat.rst:801 +#: ../../library/pyexpat.rst:805 msgid "" "An operation was requested that requires DTD support to be compiled in, but " "Expat was configured without DTD support. This should never be reported by " "a standard build of the :mod:`xml.parsers.expat` module." msgstr "" -#: ../../library/pyexpat.rst:808 +#: ../../library/pyexpat.rst:812 msgid "" "A behavioral change was requested after parsing started that can only be " "changed before parsing has started. This is (currently) only raised by :" "meth:`UseForeignDTD`." msgstr "" -#: ../../library/pyexpat.rst:815 +#: ../../library/pyexpat.rst:819 msgid "An undeclared prefix was found when namespace processing was enabled." msgstr "" -#: ../../library/pyexpat.rst:820 +#: ../../library/pyexpat.rst:824 msgid "" "The document attempted to remove the namespace declaration associated with a " "prefix." msgstr "" -#: ../../library/pyexpat.rst:826 +#: ../../library/pyexpat.rst:830 msgid "A parameter entity contained incomplete markup." msgstr "" -#: ../../library/pyexpat.rst:831 +#: ../../library/pyexpat.rst:835 msgid "The document contained no document element at all." msgstr "" -#: ../../library/pyexpat.rst:836 +#: ../../library/pyexpat.rst:840 msgid "There was an error parsing a text declaration in an external entity." msgstr "" -#: ../../library/pyexpat.rst:841 +#: ../../library/pyexpat.rst:845 msgid "Characters were found in the public id that are not allowed." msgstr "" -#: ../../library/pyexpat.rst:846 +#: ../../library/pyexpat.rst:850 msgid "" "The requested operation was made on a suspended parser, but isn't allowed. " "This includes attempts to provide additional input or to stop the parser." msgstr "" -#: ../../library/pyexpat.rst:852 +#: ../../library/pyexpat.rst:856 msgid "" "An attempt to resume the parser was made when the parser had not been " "suspended." msgstr "" -#: ../../library/pyexpat.rst:857 ../../library/pyexpat.rst:890 -#: ../../library/pyexpat.rst:895 +#: ../../library/pyexpat.rst:861 ../../library/pyexpat.rst:894 +#: ../../library/pyexpat.rst:899 msgid "This should not be reported to Python applications." msgstr "" -#: ../../library/pyexpat.rst:862 +#: ../../library/pyexpat.rst:866 msgid "" "The requested operation was made on a parser which was finished parsing " "input, but isn't allowed. This includes attempts to provide additional " "input or to stop the parser." msgstr "" -#: ../../library/pyexpat.rst:872 +#: ../../library/pyexpat.rst:876 msgid "" "An attempt was made to undeclare reserved namespace prefix ``xml`` or to " "bind it to another namespace URI." msgstr "" -#: ../../library/pyexpat.rst:879 +#: ../../library/pyexpat.rst:883 msgid "" "An attempt was made to declare or undeclare reserved namespace prefix " "``xmlns``." msgstr "" -#: ../../library/pyexpat.rst:884 +#: ../../library/pyexpat.rst:888 msgid "" "An attempt was made to bind the URI of one the reserved namespace prefixes " "``xml`` and ``xmlns`` to another namespace prefix." msgstr "" -#: ../../library/pyexpat.rst:900 +#: ../../library/pyexpat.rst:904 msgid "" "The limit on input amplification factor (from DTD and entities) has been " "breached." msgstr "" -#: ../../library/pyexpat.rst:905 +#: ../../library/pyexpat.rst:909 msgid "Footnotes" msgstr "註解" -#: ../../library/pyexpat.rst:906 +#: ../../library/pyexpat.rst:910 msgid "" "The encoding string included in XML output should conform to the appropriate " "standards. For example, \"UTF-8\" is valid, but \"UTF8\" is not. See https://" From 3a06a4786d5dd4d5a819eda83fe7657cb74f6294 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 25 Feb 2024 00:05:01 +0000 Subject: [PATCH 19/33] sync with cpython b4dd3140 --- using/windows.po | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/using/windows.po b/using/windows.po index 8de81c7d0a..59ca88416c 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-23 00:03+0000\n" +"POT-Creation-Date: 2024-02-25 00:03+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-" @@ -34,12 +34,12 @@ msgstr "" msgid "" "Unlike most Unix systems and services, Windows does not include a system " "supported installation of Python. To make Python available, the CPython team " -"has compiled Windows installers (MSI packages) with every `release `_ for many years. These installers are primarily " -"intended to add a per-user installation of Python, with the core interpreter " -"and library being used by a single user. The installer is also able to " -"install for all users of a single machine, and a separate ZIP file is " -"available for application-local distributions." +"has compiled Windows installers with every `release `_ for many years. These installers are primarily intended to add " +"a per-user installation of Python, with the core interpreter and library " +"being used by a single user. The installer is also able to install for all " +"users of a single machine, and a separate ZIP file is available for " +"application-local distributions." msgstr "" #: ../../using/windows.rst:24 From a4f21df2d87bb0ed6267b0f1610d496b2bef2558 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 26 Feb 2024 00:05:25 +0000 Subject: [PATCH 20/33] sync with cpython 12459491 --- library/functions.po | 204 +++++++++++++++++----------------- library/itertools.po | 40 ++++--- reference/datamodel.po | 14 +-- whatsnew/2.0.po | 241 +++++++++++++++++++++-------------------- 4 files changed, 260 insertions(+), 239 deletions(-) diff --git a/library/functions.po b/library/functions.po index 094a919e32..8a12e84e70 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-24 00:03+0000\n" +"POT-Creation-Date: 2024-02-26 00:03+0000\n" "PO-Revision-Date: 2023-07-02 22:53+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2507,7 +2507,11 @@ msgid "" "raise :exc:`RuntimeError`." msgstr "" -#: ../../library/functions.rst:1575 +#: ../../library/functions.rst:1572 +msgid "This class has a custom representation that can be evaluated::" +msgstr "" + +#: ../../library/functions.rst:1585 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`~object.__reversed__` method or supports the sequence protocol (the :" @@ -2515,14 +2519,14 @@ msgid "" "with integer arguments starting at ``0``)." msgstr "" -#: ../../library/functions.rst:1583 +#: ../../library/functions.rst:1593 msgid "" "Return *number* rounded to *ndigits* precision after the decimal point. If " "*ndigits* is omitted or is ``None``, it returns the nearest integer to its " "input." msgstr "" -#: ../../library/functions.rst:1587 +#: ../../library/functions.rst:1597 msgid "" "For the built-in types supporting :func:`round`, values are rounded to the " "closest multiple of 10 to the power minus *ndigits*; if two multiples are " @@ -2533,13 +2537,13 @@ msgid "" "``None``. Otherwise, the return value has the same type as *number*." msgstr "" -#: ../../library/functions.rst:1596 +#: ../../library/functions.rst:1606 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." msgstr "" -#: ../../library/functions.rst:1601 +#: ../../library/functions.rst:1611 msgid "" "The behavior of :func:`round` for floats can be surprising: for example, " "``round(2.675, 2)`` gives ``2.67`` instead of the expected ``2.68``. This is " @@ -2548,21 +2552,21 @@ msgid "" "information." msgstr "" -#: ../../library/functions.rst:1613 +#: ../../library/functions.rst:1623 msgid "" "Return a new :class:`set` object, optionally with elements taken from " "*iterable*. ``set`` is a built-in class. See :class:`set` and :ref:`types-" "set` for documentation about this class." msgstr "" -#: ../../library/functions.rst:1617 +#: ../../library/functions.rst:1627 msgid "" "For other containers see the built-in :class:`frozenset`, :class:`list`, :" "class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections` " "module." msgstr "" -#: ../../library/functions.rst:1624 +#: ../../library/functions.rst:1634 msgid "" "This is the counterpart of :func:`getattr`. The arguments are an object, a " "string, and an arbitrary value. The string may name an existing attribute " @@ -2571,7 +2575,7 @@ msgid "" "is equivalent to ``x.foobar = 123``." msgstr "" -#: ../../library/functions.rst:1630 +#: ../../library/functions.rst:1640 msgid "" "*name* need not be a Python identifier as defined in :ref:`identifiers` " "unless the object chooses to enforce that, for example in a custom :meth:" @@ -2580,21 +2584,21 @@ msgid "" "notation, but is accessible through :func:`getattr` etc.." msgstr "" -#: ../../library/functions.rst:1638 +#: ../../library/functions.rst:1648 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " "with two leading underscores) name in order to set it with :func:`setattr`." msgstr "" -#: ../../library/functions.rst:1647 +#: ../../library/functions.rst:1657 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " "``None``." msgstr "" -#: ../../library/functions.rst:1655 +#: ../../library/functions.rst:1665 msgid "" "Slice objects have read-only data attributes :attr:`!start`, :attr:`!stop`, " "and :attr:`!step` which merely return the argument values (or their " @@ -2602,48 +2606,48 @@ msgid "" "by NumPy and other third-party packages." msgstr "" -#: ../../library/functions.rst:1660 +#: ../../library/functions.rst:1670 msgid "" "Slice objects are also generated when extended indexing syntax is used. For " "example: ``a[start:stop:step]`` or ``a[start:stop, i]``. See :func:" "`itertools.islice` for an alternate version that returns an :term:`iterator`." msgstr "" -#: ../../library/functions.rst:1665 +#: ../../library/functions.rst:1675 msgid "" "Slice objects are now :term:`hashable` (provided :attr:`~slice.start`, :attr:" "`~slice.stop`, and :attr:`~slice.step` are hashable)." msgstr "" -#: ../../library/functions.rst:1671 +#: ../../library/functions.rst:1681 msgid "Return a new sorted list from the items in *iterable*." msgstr "" -#: ../../library/functions.rst:1673 +#: ../../library/functions.rst:1683 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "有兩個選擇性引數,只能使用關鍵字引數來指定。" -#: ../../library/functions.rst:1675 +#: ../../library/functions.rst:1685 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each element in *iterable* (for example, ``key=str." "lower``). The default value is ``None`` (compare the elements directly)." msgstr "" -#: ../../library/functions.rst:1679 +#: ../../library/functions.rst:1689 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." msgstr "" -#: ../../library/functions.rst:1682 +#: ../../library/functions.rst:1692 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." msgstr "" -#: ../../library/functions.rst:1685 +#: ../../library/functions.rst:1695 msgid "" "The built-in :func:`sorted` function is guaranteed to be stable. A sort is " "stable if it guarantees not to change the relative order of elements that " @@ -2651,7 +2655,7 @@ msgid "" "example, sort by department, then by salary grade)." msgstr "" -#: ../../library/functions.rst:1690 +#: ../../library/functions.rst:1700 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -2663,22 +2667,22 @@ msgid "" "method." msgstr "" -#: ../../library/functions.rst:1699 +#: ../../library/functions.rst:1709 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functions.rst:1703 +#: ../../library/functions.rst:1713 msgid "Transform a method into a static method." msgstr "" -#: ../../library/functions.rst:1705 +#: ../../library/functions.rst:1715 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" msgstr "" -#: ../../library/functions.rst:1712 +#: ../../library/functions.rst:1722 msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -2686,21 +2690,21 @@ msgstr "" "``@staticmethod`` 語法是一個函式 :term:`decorator` - 參見 :ref:`function` 中" "的詳細介紹。" -#: ../../library/functions.rst:1715 +#: ../../library/functions.rst:1725 msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). Moreover, they can be called as regular " "functions (such as ``f()``)." msgstr "" -#: ../../library/functions.rst:1719 +#: ../../library/functions.rst:1729 msgid "" "Static methods in Python are similar to those found in Java or C++. Also, " "see :func:`classmethod` for a variant that is useful for creating alternate " "class constructors." msgstr "" -#: ../../library/functions.rst:1723 +#: ../../library/functions.rst:1733 msgid "" "Like all decorators, it is also possible to call ``staticmethod`` as a " "regular function and do something with its result. This is needed in some " @@ -2709,36 +2713,36 @@ msgid "" "cases, use this idiom::" msgstr "" -#: ../../library/functions.rst:1735 +#: ../../library/functions.rst:1745 msgid "For more information on static methods, see :ref:`types`." msgstr "關於 static method 的更多資訊,請參考 :ref:`types`。" -#: ../../library/functions.rst:1737 +#: ../../library/functions.rst:1747 msgid "" "Static methods now inherit the method attributes (``__module__``, " "``__name__``, ``__qualname__``, ``__doc__`` and ``__annotations__``), have a " "new ``__wrapped__`` attribute, and are now callable as regular functions." msgstr "" -#: ../../library/functions.rst:1752 +#: ../../library/functions.rst:1762 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" -#: ../../library/functions.rst:1754 +#: ../../library/functions.rst:1764 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." msgstr "" -#: ../../library/functions.rst:1760 +#: ../../library/functions.rst:1770 msgid "" "Sums *start* and the items of an *iterable* from left to right and returns " "the total. The *iterable*'s items are normally numbers, and the start value " "is not allowed to be a string." msgstr "" -#: ../../library/functions.rst:1764 +#: ../../library/functions.rst:1774 msgid "" "For some use cases, there are good alternatives to :func:`sum`. The " "preferred, fast way to concatenate a sequence of strings is by calling ``''." @@ -2747,37 +2751,37 @@ msgid "" "using :func:`itertools.chain`." msgstr "" -#: ../../library/functions.rst:1770 +#: ../../library/functions.rst:1780 msgid "The *start* parameter can be specified as a keyword argument." msgstr "*start* 參數可被指定為關鍵字引數。" -#: ../../library/functions.rst:1773 +#: ../../library/functions.rst:1783 msgid "" "Summation of floats switched to an algorithm that gives higher accuracy on " "most builds." msgstr "" -#: ../../library/functions.rst:1780 +#: ../../library/functions.rst:1790 msgid "" "Return a proxy object that delegates method calls to a parent or sibling " "class of *type*. This is useful for accessing inherited methods that have " "been overridden in a class." msgstr "" -#: ../../library/functions.rst:1784 +#: ../../library/functions.rst:1794 msgid "" "The *object_or_type* determines the :term:`method resolution order` to be " "searched. The search starts from the class right after the *type*." msgstr "" -#: ../../library/functions.rst:1788 +#: ../../library/functions.rst:1798 msgid "" "For example, if :attr:`~class.__mro__` of *object_or_type* is ``D -> B -> C -" "> A -> object`` and the value of *type* is ``B``, then :func:`super` " "searches ``C -> A -> object``." msgstr "" -#: ../../library/functions.rst:1792 +#: ../../library/functions.rst:1802 msgid "" "The :attr:`~class.__mro__` attribute of the *object_or_type* lists the " "method resolution search order used by both :func:`getattr` and :func:" @@ -2785,7 +2789,7 @@ msgid "" "hierarchy is updated." msgstr "" -#: ../../library/functions.rst:1797 +#: ../../library/functions.rst:1807 msgid "" "If the second argument is omitted, the super object returned is unbound. If " "the second argument is an object, ``isinstance(obj, type)`` must be true. " @@ -2793,7 +2797,7 @@ msgid "" "(this is useful for classmethods)." msgstr "" -#: ../../library/functions.rst:1802 +#: ../../library/functions.rst:1812 msgid "" "There are two typical use cases for *super*. In a class hierarchy with " "single inheritance, *super* can be used to refer to parent classes without " @@ -2801,7 +2805,7 @@ msgid "" "closely parallels the use of *super* in other programming languages." msgstr "" -#: ../../library/functions.rst:1807 +#: ../../library/functions.rst:1817 msgid "" "The second use case is to support cooperative multiple inheritance in a " "dynamic execution environment. This use case is unique to Python and is not " @@ -2814,18 +2818,18 @@ msgid "" "classes that are unknown prior to runtime)." msgstr "" -#: ../../library/functions.rst:1817 +#: ../../library/functions.rst:1827 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" -#: ../../library/functions.rst:1824 +#: ../../library/functions.rst:1834 msgid "" "In addition to method lookups, :func:`super` also works for attribute " "lookups. One possible use case for this is calling :term:`descriptors " "` in a parent or sibling class." msgstr "" -#: ../../library/functions.rst:1828 +#: ../../library/functions.rst:1838 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " @@ -2835,7 +2839,7 @@ msgid "" "using statements or operators such as ``super()[name]``." msgstr "" -#: ../../library/functions.rst:1836 +#: ../../library/functions.rst:1846 msgid "" "Also note that, aside from the zero argument form, :func:`super` is not " "limited to use inside methods. The two argument form specifies the " @@ -2845,33 +2849,33 @@ msgid "" "accessing the current instance for ordinary methods." msgstr "" -#: ../../library/functions.rst:1843 +#: ../../library/functions.rst:1853 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_." msgstr "" -#: ../../library/functions.rst:1853 +#: ../../library/functions.rst:1863 msgid "" "Rather than being a function, :class:`tuple` is actually an immutable " "sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1862 +#: ../../library/functions.rst:1872 msgid "" "With one argument, return the type of an *object*. The return value is a " "type object and generally the same object as returned by :attr:`object." "__class__ `." msgstr "" -#: ../../library/functions.rst:1866 +#: ../../library/functions.rst:1876 msgid "" "The :func:`isinstance` built-in function is recommended for testing the type " "of an object, because it takes subclasses into account." msgstr "" -#: ../../library/functions.rst:1870 +#: ../../library/functions.rst:1880 msgid "" "With three arguments, return a new type object. This is essentially a " "dynamic form of the :keyword:`class` statement. The *name* string is the " @@ -2884,11 +2888,11 @@ msgid "" "identical :class:`type` objects:" msgstr "" -#: ../../library/functions.rst:1885 +#: ../../library/functions.rst:1895 msgid "See also :ref:`bltin-type-objects`." msgstr "另請參閱 :ref:`bltin-type-objects`。" -#: ../../library/functions.rst:1887 +#: ../../library/functions.rst:1897 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -2896,23 +2900,23 @@ msgid "" "would." msgstr "" -#: ../../library/functions.rst:1892 +#: ../../library/functions.rst:1902 msgid "See also :ref:`class-customization`." msgstr "另請參閱 :ref:`class-customization`。" -#: ../../library/functions.rst:1894 +#: ../../library/functions.rst:1904 msgid "" "Subclasses of :class:`type` which don't override ``type.__new__`` may no " "longer use the one-argument form to get the type of an object." msgstr "" -#: ../../library/functions.rst:1901 +#: ../../library/functions.rst:1911 msgid "" "Return the :attr:`~object.__dict__` attribute for a module, class, instance, " "or any other object with a :attr:`~object.__dict__` attribute." msgstr "" -#: ../../library/functions.rst:1904 +#: ../../library/functions.rst:1914 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " @@ -2920,54 +2924,54 @@ msgid "" "`types.MappingProxyType` to prevent direct dictionary updates)." msgstr "" -#: ../../library/functions.rst:1909 +#: ../../library/functions.rst:1919 msgid "" "Without an argument, :func:`vars` acts like :func:`locals`. Note, the " "locals dictionary is only useful for reads since updates to the locals " "dictionary are ignored." msgstr "" -#: ../../library/functions.rst:1913 +#: ../../library/functions.rst:1923 msgid "" "A :exc:`TypeError` exception is raised if an object is specified but it " "doesn't have a :attr:`~object.__dict__` attribute (for example, if its class " "defines the :attr:`~object.__slots__` attribute)." msgstr "" -#: ../../library/functions.rst:1919 +#: ../../library/functions.rst:1929 msgid "" "Iterate over several iterables in parallel, producing tuples with an item " "from each one." msgstr "" -#: ../../library/functions.rst:1922 +#: ../../library/functions.rst:1932 msgid "Example::" msgstr "" "例如:\n" "\n" "::" -#: ../../library/functions.rst:1931 +#: ../../library/functions.rst:1941 msgid "" "More formally: :func:`zip` returns an iterator of tuples, where the *i*-th " "tuple contains the *i*-th element from each of the argument iterables." msgstr "" -#: ../../library/functions.rst:1934 +#: ../../library/functions.rst:1944 msgid "" "Another way to think of :func:`zip` is that it turns rows into columns, and " "columns into rows. This is similar to `transposing a matrix `_." msgstr "" -#: ../../library/functions.rst:1938 +#: ../../library/functions.rst:1948 msgid "" ":func:`zip` is lazy: The elements won't be processed until the iterable is " "iterated on, e.g. by a :keyword:`!for` loop or by wrapping in a :class:" "`list`." msgstr "" -#: ../../library/functions.rst:1942 +#: ../../library/functions.rst:1952 msgid "" "One thing to consider is that the iterables passed to :func:`zip` could have " "different lengths; sometimes by design, and sometimes because of a bug in " @@ -2975,51 +2979,51 @@ msgid "" "approaches to dealing with this issue:" msgstr "" -#: ../../library/functions.rst:1947 +#: ../../library/functions.rst:1957 msgid "" "By default, :func:`zip` stops when the shortest iterable is exhausted. It " "will ignore the remaining items in the longer iterables, cutting off the " "result to the length of the shortest iterable::" msgstr "" -#: ../../library/functions.rst:1954 +#: ../../library/functions.rst:1964 msgid "" ":func:`zip` is often used in cases where the iterables are assumed to be of " "equal length. In such cases, it's recommended to use the ``strict=True`` " "option. Its output is the same as regular :func:`zip`::" msgstr "" -#: ../../library/functions.rst:1961 +#: ../../library/functions.rst:1971 msgid "" "Unlike the default behavior, it raises a :exc:`ValueError` if one iterable " "is exhausted before the others:" msgstr "" -#: ../../library/functions.rst:1979 +#: ../../library/functions.rst:1989 msgid "" "Without the ``strict=True`` argument, any bug that results in iterables of " "different lengths will be silenced, possibly manifesting as a hard-to-find " "bug in another part of the program." msgstr "" -#: ../../library/functions.rst:1983 +#: ../../library/functions.rst:1993 msgid "" "Shorter iterables can be padded with a constant value to make all the " "iterables have the same length. This is done by :func:`itertools." "zip_longest`." msgstr "" -#: ../../library/functions.rst:1987 +#: ../../library/functions.rst:1997 msgid "" "Edge cases: With a single iterable argument, :func:`zip` returns an iterator " "of 1-tuples. With no arguments, it returns an empty iterator." msgstr "" -#: ../../library/functions.rst:1990 +#: ../../library/functions.rst:2000 msgid "Tips and tricks:" msgstr "" -#: ../../library/functions.rst:1992 +#: ../../library/functions.rst:2002 msgid "" "The left-to-right evaluation order of the iterables is guaranteed. This " "makes possible an idiom for clustering a data series into n-length groups " @@ -3028,23 +3032,23 @@ msgid "" "iterator. This has the effect of dividing the input into n-length chunks." msgstr "" -#: ../../library/functions.rst:1998 +#: ../../library/functions.rst:2008 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -#: ../../library/functions.rst:2009 +#: ../../library/functions.rst:2019 msgid "Added the ``strict`` argument." msgstr "增加了 ``strict`` 引數。" -#: ../../library/functions.rst:2021 +#: ../../library/functions.rst:2031 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2024 +#: ../../library/functions.rst:2034 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -3056,7 +3060,7 @@ msgid "" "discouraged in favor of :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2033 +#: ../../library/functions.rst:2043 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -3066,7 +3070,7 @@ msgid "" "determine the package context of the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:2040 +#: ../../library/functions.rst:2050 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -3075,7 +3079,7 @@ msgid "" "details)." msgstr "" -#: ../../library/functions.rst:2046 +#: ../../library/functions.rst:2056 msgid "" "When the *name* variable is of the form ``package.module``, normally, the " "top-level package (the name up till the first dot) is returned, *not* the " @@ -3083,58 +3087,58 @@ msgid "" "given, the module named by *name* is returned." msgstr "" -#: ../../library/functions.rst:2051 +#: ../../library/functions.rst:2061 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" -#: ../../library/functions.rst:2056 +#: ../../library/functions.rst:2066 msgid "The statement ``import spam.ham`` results in this call::" msgstr "" -#: ../../library/functions.rst:2060 +#: ../../library/functions.rst:2070 msgid "" "Note how :func:`__import__` returns the toplevel module here because this is " "the object that is bound to a name by the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:2063 +#: ../../library/functions.rst:2073 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" msgstr "" -#: ../../library/functions.rst:2070 +#: ../../library/functions.rst:2080 msgid "" "Here, the ``spam.ham`` module is returned from :func:`__import__`. From " "this object, the names to import are retrieved and assigned to their " "respective names." msgstr "" -#: ../../library/functions.rst:2074 +#: ../../library/functions.rst:2084 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2077 +#: ../../library/functions.rst:2087 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." msgstr "" -#: ../../library/functions.rst:2081 +#: ../../library/functions.rst:2091 msgid "" "When the command line options :option:`-E` or :option:`-I` are being used, " "the environment variable :envvar:`PYTHONCASEOK` is now ignored." msgstr "" -#: ../../library/functions.rst:2086 +#: ../../library/functions.rst:2096 msgid "Footnotes" msgstr "註解" -#: ../../library/functions.rst:2087 +#: ../../library/functions.rst:2097 msgid "" "Note that the parser only accepts the Unix-style end of line convention. If " "you are reading the code from a file, make sure to use newline conversion " @@ -3147,7 +3151,7 @@ msgstr "" msgid "Boolean" msgstr "Boolean(布林值)" -#: ../../library/functions.rst:153 ../../library/functions.rst:1860 +#: ../../library/functions.rst:153 ../../library/functions.rst:1870 msgid "type" msgstr "type(型別)" @@ -3171,7 +3175,7 @@ msgstr "Infinity(無窮)" msgid "__format__" msgstr "__format__" -#: ../../library/functions.rst:717 ../../library/functions.rst:1744 +#: ../../library/functions.rst:717 ../../library/functions.rst:1754 msgid "string" msgstr "string(字串)" @@ -3223,7 +3227,7 @@ msgstr "buffering(緩衝)" msgid "text mode" msgstr "text mode(文字模式)" -#: ../../library/functions.rst:1347 ../../library/functions.rst:2015 +#: ../../library/functions.rst:1347 ../../library/functions.rst:2025 msgid "module" msgstr "module(模組)" @@ -3231,22 +3235,22 @@ msgstr "module(模組)" msgid "sys" msgstr "sys" -#: ../../library/functions.rst:1744 +#: ../../library/functions.rst:1754 msgid "str() (built-in function)" msgstr "str() (內建函式)" -#: ../../library/functions.rst:1860 +#: ../../library/functions.rst:1870 msgid "object" msgstr "object(物件)" -#: ../../library/functions.rst:2015 +#: ../../library/functions.rst:2025 msgid "statement" msgstr "statement(陳述式)" -#: ../../library/functions.rst:2015 +#: ../../library/functions.rst:2025 msgid "import" msgstr "import(引入)" -#: ../../library/functions.rst:2015 +#: ../../library/functions.rst:2025 msgid "builtins" msgstr "builtins(內建)" diff --git a/library/itertools.po b/library/itertools.po index 04d9c6ad12..4a0018b8ab 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-26 00:03+0000\n" +"POT-Creation-Date: 2024-02-26 00:03+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-" @@ -789,32 +789,42 @@ msgid "" "predicate is true. Roughly equivalent to::" msgstr "" -#: ../../library/itertools.rst:686 +#: ../../library/itertools.rst:683 +msgid "" +"Note, the element that first fails the predicate condition is consumed from " +"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-iterools before_and_after() `_ instead." +msgstr "" + +#: ../../library/itertools.rst:694 msgid "Return *n* independent iterators from a single iterable." msgstr "" -#: ../../library/itertools.rst:688 +#: ../../library/itertools.rst:696 msgid "" "The following Python code helps explain what *tee* does (although the actual " "implementation is more complex and uses only a single underlying :abbr:`FIFO " "(first-in, first-out)` queue)::" msgstr "" -#: ../../library/itertools.rst:707 +#: ../../library/itertools.rst:715 msgid "" "Once a :func:`tee` has been created, the original *iterable* should not be " "used anywhere else; otherwise, the *iterable* could get advanced without the " "tee objects being informed." msgstr "" -#: ../../library/itertools.rst:711 +#: ../../library/itertools.rst:719 msgid "" "``tee`` iterators are not threadsafe. A :exc:`RuntimeError` may be raised " "when simultaneously using iterators returned by the same :func:`tee` call, " "even if the original *iterable* is threadsafe." msgstr "" -#: ../../library/itertools.rst:715 +#: ../../library/itertools.rst:723 msgid "" "This itertool may require significant auxiliary storage (depending on how " "much temporary data needs to be stored). In general, if one iterator uses " @@ -822,7 +832,7 @@ msgid "" "func:`list` instead of :func:`tee`." msgstr "" -#: ../../library/itertools.rst:723 +#: ../../library/itertools.rst:731 msgid "" "Make an iterator that aggregates elements from each of the iterables. If the " "iterables are of uneven length, missing values are filled-in with " @@ -830,7 +840,7 @@ msgid "" "Roughly equivalent to::" msgstr "" -#: ../../library/itertools.rst:747 +#: ../../library/itertools.rst:755 msgid "" "If one of the iterables is potentially infinite, then the :func:" "`zip_longest` function should be wrapped with something that limits the " @@ -838,17 +848,17 @@ msgid "" "specified, *fillvalue* defaults to ``None``." msgstr "" -#: ../../library/itertools.rst:756 +#: ../../library/itertools.rst:764 msgid "Itertools Recipes" msgstr "" -#: ../../library/itertools.rst:758 +#: ../../library/itertools.rst:766 msgid "" "This section shows recipes for creating an extended toolset using the " "existing itertools as building blocks." msgstr "" -#: ../../library/itertools.rst:761 +#: ../../library/itertools.rst:769 msgid "" "The primary purpose of the itertools recipes is educational. The recipes " "show various ways of thinking about individual tools — for example, that " @@ -860,7 +870,7 @@ msgid "" "``map()``, ``filter()``, ``reversed()``, and ``enumerate()``." msgstr "" -#: ../../library/itertools.rst:770 +#: ../../library/itertools.rst:778 msgid "" "A secondary purpose of the recipes is to serve as an incubator. The " "``accumulate()``, ``compress()``, and ``pairwise()`` itertools started out " @@ -868,14 +878,14 @@ msgid "" "recipes are being tested to see whether they prove their worth." msgstr "" -#: ../../library/itertools.rst:775 +#: ../../library/itertools.rst:783 msgid "" "Substantially all of these recipes and many, many others can be installed " "from the `more-itertools project `_ found on the Python Package Index::" msgstr "" -#: ../../library/itertools.rst:781 +#: ../../library/itertools.rst:789 msgid "" "Many of the recipes offer the same high performance as the underlying " "toolset. Superior memory performance is kept by processing elements one at a " @@ -886,6 +896,6 @@ msgid "" "term:`generator`\\s which incur interpreter overhead." msgstr "" -#: ../../library/itertools.rst:1027 +#: ../../library/itertools.rst:1009 msgid "The following recipes have a more mathematical flavor:" msgstr "" diff --git a/reference/datamodel.po b/reference/datamodel.po index bd2bae95c6..a389934c1f 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-19 00:03+0000\n" +"POT-Creation-Date: 2024-02-26 00:03+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-" @@ -37,8 +37,8 @@ msgstr "" msgid "" "Every object has an identity, a type and a value. An object's *identity* " "never changes once it has been created; you may think of it as the object's " -"address in memory. The ':keyword:`is`' operator compares the identity of " -"two objects; the :func:`id` function returns an integer representing its " +"address in memory. The :keyword:`is` operator compares the identity of two " +"objects; the :func:`id` function returns an integer representing its " "identity." msgstr "" @@ -94,8 +94,8 @@ msgstr "" msgid "" "Note that the use of the implementation's tracing or debugging facilities " "may keep objects alive that would normally be collectable. Also note that " -"catching an exception with a ':keyword:`try`...\\ :keyword:`except`' " -"statement may keep objects alive." +"catching an exception with a :keyword:`try`...\\ :keyword:`except` statement " +"may keep objects alive." msgstr "" #: ../../reference/datamodel.rst:87 @@ -105,8 +105,8 @@ msgid "" "is garbage-collected, but since garbage collection is not guaranteed to " "happen, such objects also provide an explicit way to release the external " "resource, usually a :meth:`!close` method. Programs are strongly recommended " -"to explicitly close such objects. The ':keyword:`try`...\\ :keyword:" -"`finally`' statement and the ':keyword:`with`' statement provide convenient " +"to explicitly close such objects. The :keyword:`try`...\\ :keyword:" +"`finally` statement and the :keyword:`with` statement provide convenient " "ways to do this." msgstr "" diff --git a/whatsnew/2.0.po b/whatsnew/2.0.po index c345c651db..4097f3dda4 100644 --- a/whatsnew/2.0.po +++ b/whatsnew/2.0.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-05 00:03+0000\n" +"POT-Creation-Date: 2024-02-26 00:03+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-" @@ -314,16 +314,16 @@ msgstr "" #: ../../whatsnew/2.0.rst:219 msgid "" "*stream_reader* is a class that supports decoding input from a stream. " -"*stream_reader(file_obj)* returns an object that supports the :meth:`read`, :" -"meth:`readline`, and :meth:`readlines` methods. These methods will all " -"translate from the given encoding and return Unicode strings." +"*stream_reader(file_obj)* returns an object that supports the :meth:`!" +"read`, :meth:`!readline`, and :meth:`!readlines` methods. These methods " +"will all translate from the given encoding and return Unicode strings." msgstr "" #: ../../whatsnew/2.0.rst:224 msgid "" "*stream_writer*, similarly, is a class that supports encoding output to a " "stream. *stream_writer(file_obj)* returns an object that supports the :meth:" -"`write` and :meth:`writelines` methods. These methods expect Unicode " +"`!write` and :meth:`!writelines` methods. These methods expect Unicode " "strings, translating them to the given encoding on output." msgstr "" @@ -449,14 +449,14 @@ msgid "" "The full list of supported assignment operators is ``+=``, ``-=``, ``*=``, " "``/=``, ``%=``, ``**=``, ``&=``, ``|=``, ``^=``, ``>>=``, and ``<<=``. " "Python classes can override the augmented assignment operators by defining " -"methods named :meth:`__iadd__`, :meth:`__isub__`, etc. For example, the " -"following :class:`Number` class stores a number and supports using += to " +"methods named :meth:`!__iadd__`, :meth:`!__isub__`, etc. For example, the " +"following :class:`!Number` class stores a number and supports using += to " "create a new instance with an incremented value." msgstr "" #: ../../whatsnew/2.0.rst:377 msgid "" -"The :meth:`__iadd__` special method is called with the value of the " +"The :meth:`!__iadd__` special method is called with the value of the " "increment, and should return a new instance with an appropriately modified " "value; this return value is bound as the new value of the variable on the " "left-hand side." @@ -477,12 +477,12 @@ msgstr "" #: ../../whatsnew/2.0.rst:392 msgid "" "Until now string-manipulation functionality was in the :mod:`string` module, " -"which was usually a front-end for the :mod:`strop` module written in C. The " -"addition of Unicode posed a difficulty for the :mod:`strop` module, because " -"the functions would all need to be rewritten in order to accept either 8-bit " -"or Unicode strings. For functions such as :func:`string.replace`, which " -"takes 3 string arguments, that means eight possible permutations, and " -"correspondingly complicated code." +"which was usually a front-end for the :mod:`!strop` module written in C. " +"The addition of Unicode posed a difficulty for the :mod:`!strop` module, " +"because the functions would all need to be rewritten in order to accept " +"either 8-bit or Unicode strings. For functions such as :func:`!string." +"replace`, which takes 3 string arguments, that means eight possible " +"permutations, and correspondingly complicated code." msgstr "" #: ../../whatsnew/2.0.rst:400 @@ -509,18 +509,18 @@ msgstr "" #: ../../whatsnew/2.0.rst:418 msgid "" "Two methods which have no parallel in pre-2.0 versions, although they did " -"exist in JPython for quite some time, are :meth:`startswith` and :meth:" -"`endswith`. ``s.startswith(t)`` is equivalent to ``s[:len(t)] == t``, while " +"exist in JPython for quite some time, are :meth:`!startswith` and :meth:`!" +"endswith`. ``s.startswith(t)`` is equivalent to ``s[:len(t)] == t``, while " "``s.endswith(t)`` is equivalent to ``s[-len(t):] == t``." msgstr "" #: ../../whatsnew/2.0.rst:423 msgid "" -"One other method which deserves special mention is :meth:`join`. The :meth:" -"`join` method of a string receives one parameter, a sequence of strings, and " -"is equivalent to the :func:`string.join` function from the old :mod:`string` " -"module, with the arguments reversed. In other words, ``s.join(seq)`` is " -"equivalent to the old ``string.join(seq, s)``." +"One other method which deserves special mention is :meth:`!join`. The :meth:" +"`!join` method of a string receives one parameter, a sequence of strings, " +"and is equivalent to the :func:`!string.join` function from the old :mod:" +"`string` module, with the arguments reversed. In other words, ``s." +"join(seq)`` is equivalent to the old ``string.join(seq, s)``." msgstr "" #: ../../whatsnew/2.0.rst:433 @@ -625,9 +625,9 @@ msgstr "" msgid "" "A new syntax makes it more convenient to call a given function with a tuple " "of arguments and/or a dictionary of keyword arguments. In Python 1.5 and " -"earlier, you'd use the :func:`apply` built-in function: ``apply(f, args, " -"kw)`` calls the function :func:`f` with the argument tuple *args* and the " -"keyword arguments in the dictionary *kw*. :func:`apply` is the same in " +"earlier, you'd use the :func:`!apply` built-in function: ``apply(f, args, " +"kw)`` calls the function :func:`!f` with the argument tuple *args* and the " +"keyword arguments in the dictionary *kw*. :func:`!apply` is the same in " "2.0, but thanks to a patch from Greg Ewing, ``f(*args, **kw)`` is a shorter " "and clearer way to achieve the same effect. This syntax is symmetrical with " "the syntax for defining functions::" @@ -638,7 +638,7 @@ msgid "" "The ``print`` statement can now have its output directed to a file-like " "object by following the ``print`` with ``>> file``, similar to the " "redirection operator in Unix shells. Previously you'd either have to use " -"the :meth:`write` method of the file-like object, which lacks the " +"the :meth:`!write` method of the file-like object, which lacks the " "convenience and simplicity of ``print``, or you could assign a new value to " "``sys.stdout`` and then restore the old value. For sending output to " "standard error, it's much easier to write this::" @@ -667,7 +667,7 @@ msgid "" "seq`` returns true if *obj* is present in the sequence *seq*; Python " "computes this by simply trying every index of the sequence until either " "*obj* is found or an :exc:`IndexError` is encountered. Moshe Zadka " -"contributed a patch which adds a :meth:`__contains__` magic method for " +"contributed a patch which adds a :meth:`!__contains__` magic method for " "providing a custom implementation for :keyword:`!in`. Additionally, new " "built-in objects written in C can define what :keyword:`!in` means for them " "via a new slot in the sequence protocol." @@ -691,7 +691,7 @@ msgid "" "to this implementation, and some useful relevant links. Note that " "comparisons can now also raise exceptions. In earlier versions of Python, a " "comparison operation such as ``cmp(a,b)`` would always produce an answer, " -"even if a user-defined :meth:`__cmp__` method encountered an error, since " +"even if a user-defined :meth:`!__cmp__` method encountered an error, since " "the resulting exception would simply be silently swallowed." msgstr "" @@ -748,7 +748,7 @@ msgstr "" #: ../../whatsnew/2.0.rst:610 msgid "" -"The :func:`int` and :func:`long` functions now accept an optional \"base\" " +"The :func:`int` and :func:`!long` functions now accept an optional \"base\" " "parameter when the first argument is a string. ``int('123', 10)`` returns " "123, while ``int('123', 16)`` returns 291. ``int(123, 16)`` raises a :exc:" "`TypeError` exception with the message \"can't convert non-string with " @@ -767,9 +767,9 @@ msgstr "" #: ../../whatsnew/2.0.rst:622 msgid "" "Dictionaries have an odd new method, ``setdefault(key, default)``, which " -"behaves similarly to the existing :meth:`get` method. However, if the key " -"is missing, :meth:`setdefault` both returns the value of *default* as :meth:" -"`get` would do, and also inserts it into the dictionary as the value for " +"behaves similarly to the existing :meth:`!get` method. However, if the key " +"is missing, :meth:`!setdefault` both returns the value of *default* as :meth:" +"`!get` would do, and also inserts it into the dictionary as the value for " "*key*. Thus, the following lines of code::" msgstr "" @@ -808,7 +808,7 @@ msgid "" "The change which will probably break the most code is tightening up the " "arguments accepted by some methods. Some methods would take multiple " "arguments and treat them as a tuple, particularly various list methods such " -"as :meth:`append` and :meth:`insert`. In earlier versions of Python, if " +"as :meth:`!append` and :meth:`!insert`. In earlier versions of Python, if " "``L`` is a list, ``L.append( 1,2 )`` appends the tuple ``(1,2)`` to the " "list. In Python 2.0 this causes a :exc:`TypeError` exception to be raised, " "with the message: 'append requires exactly 1 argument; 2 given'. The fix is " @@ -865,7 +865,7 @@ msgstr "" msgid "" "Some work has been done to make integers and long integers a bit more " "interchangeable. In 1.5.2, large-file support was added for Solaris, to " -"allow reading files larger than 2 GiB; this made the :meth:`tell` method of " +"allow reading files larger than 2 GiB; this made the :meth:`!tell` method of " "file objects return a long integer instead of a regular integer. Some code " "would subtract two file offsets and attempt to use the result to multiply a " "sequence or slice a string, but this raised a :exc:`TypeError`. In 2.0, " @@ -873,8 +873,8 @@ msgid "" "as you'd intuitively expect it to; ``3L * 'abc'`` produces 'abcabcabc', and " "``(0,1,2,3)[2L:4L]`` produces (2,3). Long integers can also be used in " "various contexts where previously only integers were accepted, such as in " -"the :meth:`seek` method of file objects, and in the formats supported by the " -"``%`` operator (``%d``, ``%i``, ``%x``, etc.). For example, ``\"%d\" % " +"the :meth:`!seek` method of file objects, and in the formats supported by " +"the ``%`` operator (``%d``, ``%i``, ``%x``, etc.). For example, ``\"%d\" % " "2L**64`` will produce the string ``18446744073709551616``." msgstr "" @@ -892,8 +892,8 @@ msgstr "" #: ../../whatsnew/2.0.rst:716 msgid "" "Taking the :func:`repr` of a float now uses a different formatting precision " -"than :func:`str`. :func:`repr` uses ``%.17g`` format string for C's :func:" -"`sprintf`, while :func:`str` uses ``%.12g`` as before. The effect is that :" +"than :func:`str`. :func:`repr` uses ``%.17g`` format string for C's :func:`!" +"sprintf`, while :func:`str` uses ``%.12g`` as before. The effect is that :" "func:`repr` may occasionally show more decimal places than :func:`str`, for " "certain numbers. For example, the number 8.1 can't be represented exactly " "in binary, so ``repr(8.1)`` is ``'8.0999999999999996'``, while str(8.1) is " @@ -904,9 +904,9 @@ msgstr "" msgid "" "The ``-X`` command-line option, which turned all standard exceptions into " "strings instead of classes, has been removed; the standard exceptions will " -"now always be classes. The :mod:`exceptions` module containing the standard " -"exceptions was translated from Python to a built-in C module, written by " -"Barry Warsaw and Fredrik Lundh." +"now always be classes. The :mod:`!exceptions` module containing the " +"standard exceptions was translated from Python to a built-in C module, " +"written by Barry Warsaw and Fredrik Lundh." msgstr "" #: ../../whatsnew/2.0.rst:740 @@ -1087,11 +1087,11 @@ msgstr "XML 模組" #: ../../whatsnew/2.0.rst:882 msgid "" -"Python 1.5.2 included a simple XML parser in the form of the :mod:`xmllib` " +"Python 1.5.2 included a simple XML parser in the form of the :mod:`!xmllib` " "module, contributed by Sjoerd Mullender. Since 1.5.2's release, two " "different interfaces for processing XML have become common: SAX2 (version 2 " "of the Simple API for XML) provides an event-driven interface with some " -"similarities to :mod:`xmllib`, and the DOM (Document Object Model) provides " +"similarities to :mod:`!xmllib`, and the DOM (Document Object Model) provides " "a tree-based interface, transforming an XML document into a tree of nodes " "that can be traversed and modified. Python 2.0 includes a SAX2 interface " "and a stripped-down DOM interface as part of the :mod:`xml` package. Here we " @@ -1109,10 +1109,11 @@ msgid "" "SAX defines an event-driven interface for parsing XML. To use SAX, you must " "write a SAX handler class. Handler classes inherit from various classes " "provided by SAX, and override various methods that will then be called by " -"the XML parser. For example, the :meth:`startElement` and :meth:" -"`endElement` methods are called for every starting and end tag encountered " -"by the parser, the :meth:`characters` method is called for every chunk of " -"character data, and so forth." +"the XML parser. For example, the :meth:`~xml.sax.handler.ContentHandler." +"startElement` and :meth:`~xml.sax.handler.ContentHandler.endElement` methods " +"are called for every starting and end tag encountered by the parser, the :" +"meth:`~xml.sax.handler.ContentHandler.characters` method is called for every " +"chunk of character data, and so forth." msgstr "" #: ../../whatsnew/2.0.rst:906 @@ -1144,13 +1145,13 @@ msgstr "DOM 支援" #: ../../whatsnew/2.0.rst:942 msgid "" "The Document Object Model is a tree-based representation for an XML " -"document. A top-level :class:`Document` instance is the root of the tree, " -"and has a single child which is the top-level :class:`Element` instance. " -"This :class:`Element` has children nodes representing character data and any " -"sub-elements, which may have further children of their own, and so forth. " -"Using the DOM you can traverse the resulting tree any way you like, access " -"element and attribute values, insert and delete nodes, and convert the tree " -"back into XML." +"document. A top-level :class:`!Document` instance is the root of the tree, " +"and has a single child which is the top-level :class:`!Element` instance. " +"This :class:`!Element` has children nodes representing character data and " +"any sub-elements, which may have further children of their own, and so " +"forth. Using the DOM you can traverse the resulting tree any way you like, " +"access element and attribute values, insert and delete nodes, and convert " +"the tree back into XML." msgstr "" #: ../../whatsnew/2.0.rst:950 @@ -1167,20 +1168,20 @@ msgstr "" msgid "" "The DOM implementation included with Python lives in the :mod:`xml.dom." "minidom` module. It's a lightweight implementation of the Level 1 DOM with " -"support for XML namespaces. The :func:`parse` and :func:`parseString` " +"support for XML namespaces. The :func:`!parse` and :func:`!parseString` " "convenience functions are provided for generating a DOM tree::" msgstr "" #: ../../whatsnew/2.0.rst:964 msgid "" -"``doc`` is a :class:`Document` instance. :class:`Document`, like all the " -"other DOM classes such as :class:`Element` and :class:`Text`, is a subclass " -"of the :class:`Node` base class. All the nodes in a DOM tree therefore " -"support certain common methods, such as :meth:`toxml` which returns a string " -"containing the XML representation of the node and its children. Each class " -"also has special methods of its own; for example, :class:`Element` and :" -"class:`Document` instances have a method to find all child elements with a " -"given tag name. Continuing from the previous 2-line example::" +"``doc`` is a :class:`!Document` instance. :class:`!Document`, like all the " +"other DOM classes such as :class:`!Element` and :class:`Text`, is a subclass " +"of the :class:`!Node` base class. All the nodes in a DOM tree therefore " +"support certain common methods, such as :meth:`!toxml` which returns a " +"string containing the XML representation of the node and its children. Each " +"class also has special methods of its own; for example, :class:`!Element` " +"and :class:`!Document` instances have a method to find all child elements " +"with a given tag name. Continuing from the previous 2-line example::" msgstr "" #: ../../whatsnew/2.0.rst:977 @@ -1197,7 +1198,7 @@ msgstr "" #: ../../whatsnew/2.0.rst:997 msgid "" "Again, I will refer you to the Python documentation for a complete listing " -"of the different :class:`Node` classes and their various methods." +"of the different :class:`!Node` classes and their various methods." msgstr "" #: ../../whatsnew/2.0.rst:1002 @@ -1235,7 +1236,7 @@ msgid "The xmlproc validating parser, written by Lars Marius Garshol." msgstr "" #: ../../whatsnew/2.0.rst:1023 -msgid "The :mod:`sgmlop` parser accelerator module, written by Fredrik Lundh." +msgid "The :mod:`!sgmlop` parser accelerator module, written by Fredrik Lundh." msgstr "" #: ../../whatsnew/2.0.rst:1029 @@ -1247,7 +1248,7 @@ msgid "" "Lots of improvements and bugfixes were made to Python's extensive standard " "library; some of the affected modules include :mod:`readline`, :mod:" "`ConfigParser `, :mod:`cgi`, :mod:`calendar`, :mod:`posix`, :" -"mod:`readline`, :mod:`xmllib`, :mod:`aifc`, :mod:`chunk, wave`, :mod:" +"mod:`readline`, :mod:`!xmllib`, :mod:`aifc`, :mod:`chunk` :mod:`wave`, :mod:" "`random`, :mod:`shelve`, and :mod:`nntplib`. Consult the CVS logs for the " "exact patch-by-patch details." msgstr "" @@ -1267,21 +1268,26 @@ msgstr "" #: ../../whatsnew/2.0.rst:1046 msgid "" "The :mod:`httplib ` module has been rewritten by Greg Stein to support " -"HTTP/1.1. Backward compatibility with the 1.5 version of :mod:`!httplib` is " -"provided, though using HTTP/1.1 features such as pipelining will require " -"rewriting code to use a different set of interfaces." +"HTTP/1.1." msgstr "" -#: ../../whatsnew/2.0.rst:1051 +#: ../../whatsnew/2.0.rst:1048 msgid "" -"The :mod:`Tkinter` module now supports Tcl/Tk version 8.1, 8.2, or 8.3, and " +"Backward compatibility with the 1.5 version of :mod:`!httplib` is provided, " +"though using HTTP/1.1 features such as pipelining will require rewriting " +"code to use a different set of interfaces." +msgstr "" + +#: ../../whatsnew/2.0.rst:1052 +msgid "" +"The :mod:`!Tkinter` module now supports Tcl/Tk version 8.1, 8.2, or 8.3, and " "support for the older 7.x versions has been dropped. The Tkinter module now " "supports displaying Unicode strings in Tk widgets. Also, Fredrik Lundh " "contributed an optimization which makes operations like ``create_line`` and " "``create_polygon`` much faster, especially when using lots of coordinates." msgstr "" -#: ../../whatsnew/2.0.rst:1057 +#: ../../whatsnew/2.0.rst:1058 msgid "" "The :mod:`curses` module has been greatly extended, starting from Oliver " "Andrich's enhanced version, to provide many additional functions from " @@ -1291,7 +1297,7 @@ msgid "" "currently maintained OSes that fall into this category." msgstr "" -#: ../../whatsnew/2.0.rst:1064 +#: ../../whatsnew/2.0.rst:1065 msgid "" "As mentioned in the earlier discussion of 2.0's Unicode support, the " "underlying implementation of the regular expressions provided by the :mod:" @@ -1300,18 +1306,18 @@ msgid "" "against both 8-bit strings and Unicode strings." msgstr "" -#: ../../whatsnew/2.0.rst:1074 +#: ../../whatsnew/2.0.rst:1075 msgid "New modules" msgstr "新增模組" -#: ../../whatsnew/2.0.rst:1076 +#: ../../whatsnew/2.0.rst:1077 msgid "" "A number of new modules were added. We'll simply list them with brief " "descriptions; consult the 2.0 documentation for the details of a particular " "module." msgstr "" -#: ../../whatsnew/2.0.rst:1080 +#: ../../whatsnew/2.0.rst:1081 msgid "" ":mod:`atexit`: For registering functions to be called before the Python " "interpreter exits. Code that currently sets ``sys.exitfunc`` directly should " @@ -1320,20 +1326,20 @@ msgid "" "(Contributed by Skip Montanaro.)" msgstr "" -#: ../../whatsnew/2.0.rst:1086 +#: ../../whatsnew/2.0.rst:1087 msgid "" -":mod:`codecs`, :mod:`encodings`, :mod:`unicodedata`: Added as part of the " +":mod:`codecs`, :mod:`!encodings`, :mod:`unicodedata`: Added as part of the " "new Unicode support." msgstr "" -#: ../../whatsnew/2.0.rst:1089 +#: ../../whatsnew/2.0.rst:1090 msgid "" -":mod:`filecmp`: Supersedes the old :mod:`cmp`, :mod:`cmpcache` and :mod:" -"`dircmp` modules, which have now become deprecated. (Contributed by Gordon " +":mod:`filecmp`: Supersedes the old :mod:`!cmp`, :mod:`!cmpcache` and :mod:`!" +"dircmp` modules, which have now become deprecated. (Contributed by Gordon " "MacMillan and Moshe Zadka.)" msgstr "" -#: ../../whatsnew/2.0.rst:1093 +#: ../../whatsnew/2.0.rst:1094 msgid "" ":mod:`gettext`: This module provides internationalization (I18N) and " "localization (L10N) support for Python programs by providing an interface to " @@ -1342,14 +1348,14 @@ msgid "" "Henstridge.)" msgstr "" -#: ../../whatsnew/2.0.rst:1098 +#: ../../whatsnew/2.0.rst:1099 msgid "" ":mod:`!linuxaudiodev`: Support for the :file:`/dev/audio` device on Linux, a " "twin to the existing :mod:`!sunaudiodev` module. (Contributed by Peter " "Bosch, with fixes by Jeremy Hylton.)" msgstr "" -#: ../../whatsnew/2.0.rst:1102 +#: ../../whatsnew/2.0.rst:1103 msgid "" ":mod:`mmap`: An interface to memory-mapped files on both Windows and Unix. " "A file's contents can be mapped directly into memory, at which point it " @@ -1359,13 +1365,13 @@ msgid "" "M. Kuchling.)" msgstr "" -#: ../../whatsnew/2.0.rst:1108 +#: ../../whatsnew/2.0.rst:1109 msgid "" -":mod:`pyexpat`: An interface to the Expat XML parser. (Contributed by Paul " +":mod:`!pyexpat`: An interface to the Expat XML parser. (Contributed by Paul " "Prescod.)" msgstr "" -#: ../../whatsnew/2.0.rst:1111 +#: ../../whatsnew/2.0.rst:1112 msgid "" ":mod:`robotparser `: Parse a :file:`robots.txt` file, " "which is used for writing web spiders that politely avoid certain areas of a " @@ -1374,19 +1380,19 @@ msgid "" "fetchability of a given URL. (Contributed by Skip Montanaro.)" msgstr "" -#: ../../whatsnew/2.0.rst:1117 +#: ../../whatsnew/2.0.rst:1118 msgid "" ":mod:`tabnanny`: A module/script to check Python source code for ambiguous " "indentation. (Contributed by Tim Peters.)" msgstr "" -#: ../../whatsnew/2.0.rst:1120 +#: ../../whatsnew/2.0.rst:1121 msgid "" -":mod:`UserString`: A base class useful for deriving objects that behave like " -"strings." +":mod:`!UserString`: A base class useful for deriving objects that behave " +"like strings." msgstr "" -#: ../../whatsnew/2.0.rst:1123 +#: ../../whatsnew/2.0.rst:1124 msgid "" ":mod:`webbrowser`: A module that provides a platform independent way to " "launch a web browser on a specific URL. For each platform, various browsers " @@ -1398,7 +1404,7 @@ msgid "" "Fred.)" msgstr "" -#: ../../whatsnew/2.0.rst:1132 +#: ../../whatsnew/2.0.rst:1133 msgid "" ":mod:`_winreg `: An interface to the Windows registry. :mod:`!" "_winreg` is an adaptation of functions that have been part of PythonWin " @@ -1407,7 +1413,7 @@ msgid "" "Hammond." msgstr "" -#: ../../whatsnew/2.0.rst:1137 +#: ../../whatsnew/2.0.rst:1138 msgid "" ":mod:`zipfile`: A module for reading and writing ZIP-format archives. These " "are archives produced by :program:`PKZIP` on DOS/Windows or :program:`zip` " @@ -1415,7 +1421,7 @@ msgid "" "supported by the :mod:`gzip` module) (Contributed by James C. Ahlstrom.)" msgstr "" -#: ../../whatsnew/2.0.rst:1142 +#: ../../whatsnew/2.0.rst:1143 msgid "" ":mod:`!imputil`: A module that provides a simpler way for writing customized " "import hooks, in comparison to the existing :mod:`!ihooks` module. " @@ -1423,92 +1429,93 @@ msgid "" "way.)" msgstr "" -#: ../../whatsnew/2.0.rst:1150 +#: ../../whatsnew/2.0.rst:1151 msgid "IDLE Improvements" msgstr "" -#: ../../whatsnew/2.0.rst:1152 +#: ../../whatsnew/2.0.rst:1153 msgid "" "IDLE is the official Python cross-platform IDE, written using Tkinter. " "Python 2.0 includes IDLE 0.6, which adds a number of new features and " "improvements. A partial list:" msgstr "" -#: ../../whatsnew/2.0.rst:1156 +#: ../../whatsnew/2.0.rst:1157 msgid "" "UI improvements and optimizations, especially in the area of syntax " "highlighting and auto-indentation." msgstr "" -#: ../../whatsnew/2.0.rst:1159 +#: ../../whatsnew/2.0.rst:1160 msgid "" "The class browser now shows more information, such as the top level " "functions in a module." msgstr "" -#: ../../whatsnew/2.0.rst:1162 +#: ../../whatsnew/2.0.rst:1163 msgid "" "Tab width is now a user settable option. When opening an existing Python " "file, IDLE automatically detects the indentation conventions, and adapts." msgstr "" -#: ../../whatsnew/2.0.rst:1165 +#: ../../whatsnew/2.0.rst:1166 msgid "" "There is now support for calling browsers on various platforms, used to open " "the Python documentation in a browser." msgstr "" -#: ../../whatsnew/2.0.rst:1168 +#: ../../whatsnew/2.0.rst:1169 msgid "" "IDLE now has a command line, which is largely similar to the vanilla Python " "interpreter." msgstr "" -#: ../../whatsnew/2.0.rst:1171 +#: ../../whatsnew/2.0.rst:1172 msgid "Call tips were added in many places." msgstr "" -#: ../../whatsnew/2.0.rst:1173 +#: ../../whatsnew/2.0.rst:1174 msgid "IDLE can now be installed as a package." msgstr "" -#: ../../whatsnew/2.0.rst:1175 +#: ../../whatsnew/2.0.rst:1176 msgid "In the editor window, there is now a line/column bar at the bottom." msgstr "" -#: ../../whatsnew/2.0.rst:1177 +#: ../../whatsnew/2.0.rst:1178 msgid "" "Three new keystroke commands: Check module (:kbd:`Alt-F5`), Import module (:" "kbd:`F5`) and Run script (:kbd:`Ctrl-F5`)." msgstr "" -#: ../../whatsnew/2.0.rst:1184 +#: ../../whatsnew/2.0.rst:1185 msgid "Deleted and Deprecated Modules" msgstr "" -#: ../../whatsnew/2.0.rst:1186 +#: ../../whatsnew/2.0.rst:1187 msgid "" "A few modules have been dropped because they're obsolete, or because there " -"are now better ways to do the same thing. The :mod:`stdwin` module is gone; " -"it was for a platform-independent windowing toolkit that's no longer " +"are now better ways to do the same thing. The :mod:`!stdwin` module is " +"gone; it was for a platform-independent windowing toolkit that's no longer " "developed." msgstr "" -#: ../../whatsnew/2.0.rst:1190 +#: ../../whatsnew/2.0.rst:1191 msgid "" "A number of modules have been moved to the :file:`lib-old` subdirectory: :" -"mod:`cmp`, :mod:`cmpcache`, :mod:`dircmp`, :mod:`dump`, :mod:`find`, :mod:" -"`grep`, :mod:`packmail`, :mod:`poly`, :mod:`util`, :mod:`whatsound`, :mod:" -"`zmod`. If you have code which relies on a module that's been moved to :" -"file:`lib-old`, you can simply add that directory to ``sys.path`` to get " -"them back, but you're encouraged to update any code that uses these modules." +"mod:`!cmp`, :mod:`!cmpcache`, :mod:`!dircmp`, :mod:`!dump`, :mod:`!find`, :" +"mod:`!grep`, :mod:`!packmail`, :mod:`!poly`, :mod:`!util`, :mod:`!" +"whatsound`, :mod:`!zmod`. If you have code which relies on a module that's " +"been moved to :file:`lib-old`, you can simply add that directory to ``sys." +"path`` to get them back, but you're encouraged to update any code that " +"uses these modules." msgstr "" -#: ../../whatsnew/2.0.rst:1199 +#: ../../whatsnew/2.0.rst:1200 msgid "Acknowledgements" msgstr "致謝" -#: ../../whatsnew/2.0.rst:1201 +#: ../../whatsnew/2.0.rst:1202 msgid "" "The authors would like to thank the following people for offering " "suggestions on various drafts of this article: David Bolen, Mark Hammond, " From 7604c1df19f802fc064e21af39e993a3bbf18191 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 27 Feb 2024 00:05:32 +0000 Subject: [PATCH 21/33] sync with cpython 3185a1ba --- library/ctypes.po | 531 +++++++++++++++++++++---------------------- library/fcntl.po | 72 +++--- library/random.po | 97 ++++---- library/threading.po | 84 ++++--- whatsnew/2.1.po | 94 ++++---- 5 files changed, 440 insertions(+), 438 deletions(-) diff --git a/library/ctypes.po b/library/ctypes.po index 803aeb4d87..1ac301a24a 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"POT-Creation-Date: 2024-02-27 00:04+0000\n" "PO-Revision-Date: 2023-04-26 02:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -210,7 +210,7 @@ msgid "" "learn more about :mod:`ctypes` data types." msgstr "" -#: ../../library/ctypes.rst:213 ../../library/ctypes.rst:2203 +#: ../../library/ctypes.rst:213 ../../library/ctypes.rst:2199 msgid "Fundamental data types" msgstr "" @@ -1067,22 +1067,15 @@ msgstr "" #: ../../library/ctypes.rst:1116 msgid "" -"If the interpreter would have been started with :option:`-O`, the sample " -"would have printed ``c_long(1)``, or ``c_long(2)`` if :option:`-OO` would " -"have been specified." -msgstr "" - -#: ../../library/ctypes.rst:1120 -msgid "" "An extended example which also demonstrates the use of pointers accesses " "the :c:data:`PyImport_FrozenModules` pointer exported by Python." msgstr "" -#: ../../library/ctypes.rst:1123 +#: ../../library/ctypes.rst:1119 msgid "Quoting the docs for that value:" msgstr "" -#: ../../library/ctypes.rst:1125 +#: ../../library/ctypes.rst:1121 msgid "" "This pointer is initialized to point to an array of :c:struct:`_frozen` " "records, terminated by one whose members are all ``NULL`` or zero. When a " @@ -1091,19 +1084,19 @@ msgid "" "frozen modules." msgstr "" -#: ../../library/ctypes.rst:1130 +#: ../../library/ctypes.rst:1126 msgid "" "So manipulating this pointer could even prove useful. To restrict the " "example size, we show only how this table can be read with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1144 +#: ../../library/ctypes.rst:1140 msgid "" "We have defined the :c:struct:`_frozen` data type, so we can get the pointer " "to the table::" msgstr "" -#: ../../library/ctypes.rst:1151 +#: ../../library/ctypes.rst:1147 msgid "" "Since ``table`` is a ``pointer`` to the array of ``struct_frozen`` records, " "we can iterate over it, but we just have to make sure that our loop " @@ -1112,34 +1105,34 @@ msgid "" "the loop when we hit the ``NULL`` entry::" msgstr "" -#: ../../library/ctypes.rst:1167 +#: ../../library/ctypes.rst:1163 msgid "" "The fact that standard Python has a frozen module and a frozen package " "(indicated by the negative ``size`` member) is not well known, it is only " "used for testing. Try it out with ``import __hello__`` for example." msgstr "" -#: ../../library/ctypes.rst:1175 +#: ../../library/ctypes.rst:1171 msgid "Surprises" msgstr "" -#: ../../library/ctypes.rst:1177 +#: ../../library/ctypes.rst:1173 msgid "" "There are some edges in :mod:`ctypes` where you might expect something other " "than what actually happens." msgstr "" -#: ../../library/ctypes.rst:1180 +#: ../../library/ctypes.rst:1176 msgid "Consider the following example::" msgstr "" -#: ../../library/ctypes.rst:1200 +#: ../../library/ctypes.rst:1196 msgid "" "Hm. We certainly expected the last statement to print ``3 4 1 2``. What " "happened? Here are the steps of the ``rc.a, rc.b = rc.b, rc.a`` line above::" msgstr "" -#: ../../library/ctypes.rst:1208 +#: ../../library/ctypes.rst:1204 msgid "" "Note that ``temp0`` and ``temp1`` are objects still using the internal " "buffer of the ``rc`` object above. So executing ``rc.a = temp0`` copies the " @@ -1148,26 +1141,26 @@ msgid "" "have the expected effect." msgstr "" -#: ../../library/ctypes.rst:1214 +#: ../../library/ctypes.rst:1210 msgid "" "Keep in mind that retrieving sub-objects from Structure, Unions, and Arrays " "doesn't *copy* the sub-object, instead it retrieves a wrapper object " "accessing the root-object's underlying buffer." msgstr "" -#: ../../library/ctypes.rst:1218 +#: ../../library/ctypes.rst:1214 msgid "" "Another example that may behave differently from what one would expect is " "this::" msgstr "" -#: ../../library/ctypes.rst:1230 +#: ../../library/ctypes.rst:1226 msgid "" "Objects instantiated from :class:`c_char_p` can only have their value set to " "bytes or integers." msgstr "" -#: ../../library/ctypes.rst:1233 +#: ../../library/ctypes.rst:1229 msgid "" "Why is it printing ``False``? ctypes instances are objects containing a " "memory block plus some :term:`descriptor`\\s accessing the contents of the " @@ -1176,16 +1169,16 @@ msgid "" "the contents again constructs a new Python object each time!" msgstr "" -#: ../../library/ctypes.rst:1243 +#: ../../library/ctypes.rst:1239 msgid "Variable-sized data types" msgstr "" -#: ../../library/ctypes.rst:1245 +#: ../../library/ctypes.rst:1241 msgid "" ":mod:`ctypes` provides some support for variable-sized arrays and structures." msgstr "" -#: ../../library/ctypes.rst:1247 +#: ../../library/ctypes.rst:1243 msgid "" "The :func:`resize` function can be used to resize the memory buffer of an " "existing ctypes object. The function takes the object as first argument, " @@ -1194,35 +1187,35 @@ msgid "" "objects type, a :exc:`ValueError` is raised if this is tried::" msgstr "" -#: ../../library/ctypes.rst:1267 +#: ../../library/ctypes.rst:1263 msgid "" "This is nice and fine, but how would one access the additional elements " "contained in this array? Since the type still only knows about 4 elements, " "we get errors accessing other elements::" msgstr "" -#: ../../library/ctypes.rst:1279 +#: ../../library/ctypes.rst:1275 msgid "" "Another way to use variable-sized data types with :mod:`ctypes` is to use " "the dynamic nature of Python, and (re-)define the data type after the " "required size is already known, on a case by case basis." msgstr "" -#: ../../library/ctypes.rst:1287 +#: ../../library/ctypes.rst:1283 msgid "ctypes reference" msgstr "" -#: ../../library/ctypes.rst:1293 +#: ../../library/ctypes.rst:1289 msgid "Finding shared libraries" msgstr "" -#: ../../library/ctypes.rst:1295 +#: ../../library/ctypes.rst:1291 msgid "" "When programming in a compiled language, shared libraries are accessed when " "compiling/linking a program, and when the program is run." msgstr "" -#: ../../library/ctypes.rst:1298 +#: ../../library/ctypes.rst:1294 msgid "" "The purpose of the :func:`~ctypes.util.find_library` function is to locate a " "library in a way similar to what the compiler or runtime loader does (on " @@ -1231,13 +1224,13 @@ msgid "" "and call the runtime loader directly." msgstr "" -#: ../../library/ctypes.rst:1304 +#: ../../library/ctypes.rst:1300 msgid "" "The :mod:`!ctypes.util` module provides a function which can help to " "determine the library to load." msgstr "" -#: ../../library/ctypes.rst:1312 +#: ../../library/ctypes.rst:1308 msgid "" "Try to find a library and return a pathname. *name* is the library name " "without any prefix like *lib*, suffix like ``.so``, ``.dylib`` or version " @@ -1245,39 +1238,39 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1317 ../../library/ctypes.rst:1977 +#: ../../library/ctypes.rst:1313 ../../library/ctypes.rst:1973 msgid "The exact functionality is system dependent." msgstr "" -#: ../../library/ctypes.rst:1319 +#: ../../library/ctypes.rst:1315 msgid "" "On Linux, :func:`~ctypes.util.find_library` tries to run external programs " "(``/sbin/ldconfig``, ``gcc``, ``objdump`` and ``ld``) to find the library " "file. It returns the filename of the library file." msgstr "" -#: ../../library/ctypes.rst:1323 +#: ../../library/ctypes.rst:1319 msgid "" "On Linux, the value of the environment variable ``LD_LIBRARY_PATH`` is used " "when searching for libraries, if a library cannot be found by any other " "means." msgstr "" -#: ../../library/ctypes.rst:1327 +#: ../../library/ctypes.rst:1323 msgid "Here are some examples::" msgstr "" "以下是一些範例:\n" "\n" "::" -#: ../../library/ctypes.rst:1338 +#: ../../library/ctypes.rst:1334 msgid "" "On macOS, :func:`~ctypes.util.find_library` tries several predefined naming " "schemes and paths to locate the library, and returns a full pathname if " "successful::" msgstr "" -#: ../../library/ctypes.rst:1352 +#: ../../library/ctypes.rst:1348 msgid "" "On Windows, :func:`~ctypes.util.find_library` searches along the system " "search path, and returns the full pathname, but since there is no predefined " @@ -1285,7 +1278,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/ctypes.rst:1356 +#: ../../library/ctypes.rst:1352 msgid "" "If wrapping a shared library with :mod:`ctypes`, it *may* be better to " "determine the shared library name at development time, and hardcode that " @@ -1293,24 +1286,24 @@ msgid "" "to locate the library at runtime." msgstr "" -#: ../../library/ctypes.rst:1364 +#: ../../library/ctypes.rst:1360 msgid "Loading shared libraries" msgstr "" -#: ../../library/ctypes.rst:1366 +#: ../../library/ctypes.rst:1362 msgid "" "There are several ways to load shared libraries into the Python process. " "One way is to instantiate one of the following classes:" msgstr "" -#: ../../library/ctypes.rst:1372 +#: ../../library/ctypes.rst:1368 msgid "" "Instances of this class represent loaded shared libraries. Functions in " "these libraries use the standard C calling convention, and are assumed to " "return :c:expr:`int`." msgstr "" -#: ../../library/ctypes.rst:1376 +#: ../../library/ctypes.rst:1372 msgid "" "On Windows creating a :class:`CDLL` instance may fail even if the DLL name " "exists. When a dependent DLL of the loaded DLL is not found, a :exc:" @@ -1322,18 +1315,18 @@ msgid "" "determine which one is not found using Windows debugging and tracing tools." msgstr "" -#: ../../library/ctypes.rst:1388 ../../library/ctypes.rst:1411 -#: ../../library/ctypes.rst:1422 ../../library/ctypes.rst:1439 +#: ../../library/ctypes.rst:1384 ../../library/ctypes.rst:1407 +#: ../../library/ctypes.rst:1418 ../../library/ctypes.rst:1435 msgid "The *name* parameter can now be a :term:`path-like object`." msgstr "" -#: ../../library/ctypes.rst:1392 +#: ../../library/ctypes.rst:1388 msgid "" "`Microsoft DUMPBIN tool `_ -- A tool to find DLL dependents." msgstr "" -#: ../../library/ctypes.rst:1398 +#: ../../library/ctypes.rst:1394 msgid "" "Windows only: Instances of this class represent loaded shared libraries, " "functions in these libraries use the ``stdcall`` calling convention, and are " @@ -1343,26 +1336,26 @@ msgid "" "value signals a failure, an :class:`OSError` is automatically raised." msgstr "" -#: ../../library/ctypes.rst:1405 +#: ../../library/ctypes.rst:1401 msgid "" ":exc:`WindowsError` used to be raised, which is now an alias of :exc:" "`OSError`." msgstr "" -#: ../../library/ctypes.rst:1416 +#: ../../library/ctypes.rst:1412 msgid "" "Windows only: Instances of this class represent loaded shared libraries, " "functions in these libraries use the ``stdcall`` calling convention, and are " "assumed to return :c:expr:`int` by default." msgstr "" -#: ../../library/ctypes.rst:1424 +#: ../../library/ctypes.rst:1420 msgid "" "The Python :term:`global interpreter lock` is released before calling any " "function exported by these libraries, and reacquired afterwards." msgstr "" -#: ../../library/ctypes.rst:1430 +#: ../../library/ctypes.rst:1426 msgid "" "Instances of this class behave like :class:`CDLL` instances, except that the " "Python GIL is *not* released during the function call, and after the " @@ -1370,11 +1363,11 @@ msgid "" "set, a Python exception is raised." msgstr "" -#: ../../library/ctypes.rst:1435 +#: ../../library/ctypes.rst:1431 msgid "Thus, this is only useful to call Python C api functions directly." msgstr "" -#: ../../library/ctypes.rst:1441 +#: ../../library/ctypes.rst:1437 msgid "" "All these classes can be instantiated by calling them with at least one " "argument, the pathname of the shared library. If you have an existing " @@ -1384,7 +1377,7 @@ msgid "" "the process, and to get a handle to it." msgstr "" -#: ../../library/ctypes.rst:1448 +#: ../../library/ctypes.rst:1444 msgid "" "The *mode* parameter can be used to specify how the library is loaded. For " "details, consult the :manpage:`dlopen(3)` manpage. On Windows, *mode* is " @@ -1392,7 +1385,7 @@ msgid "" "configurable." msgstr "" -#: ../../library/ctypes.rst:1453 +#: ../../library/ctypes.rst:1449 msgid "" "The *use_errno* parameter, when set to true, enables a ctypes mechanism that " "allows accessing the system :data:`errno` error number in a safe way. :mod:" @@ -1402,14 +1395,14 @@ msgid "" "private copy, the same happens immediately after the function call." msgstr "" -#: ../../library/ctypes.rst:1460 +#: ../../library/ctypes.rst:1456 msgid "" "The function :func:`ctypes.get_errno` returns the value of the ctypes " "private copy, and the function :func:`ctypes.set_errno` changes the ctypes " "private copy to a new value and returns the former value." msgstr "" -#: ../../library/ctypes.rst:1464 +#: ../../library/ctypes.rst:1460 msgid "" "The *use_last_error* parameter, when set to true, enables the same mechanism " "for the Windows error code which is managed by the :func:`GetLastError` and :" @@ -1418,7 +1411,7 @@ msgid "" "private copy of the windows error code." msgstr "" -#: ../../library/ctypes.rst:1470 +#: ../../library/ctypes.rst:1466 msgid "" "The *winmode* parameter is used on Windows to specify how the library is " "loaded (since *mode* is ignored). It takes any value that is valid for the " @@ -1428,29 +1421,29 @@ msgid "" "ensure the correct library and dependencies are loaded." msgstr "" -#: ../../library/ctypes.rst:1477 +#: ../../library/ctypes.rst:1473 msgid "Added *winmode* parameter." msgstr "新增 *winmode* 參數。" -#: ../../library/ctypes.rst:1484 +#: ../../library/ctypes.rst:1480 msgid "" "Flag to use as *mode* parameter. On platforms where this flag is not " "available, it is defined as the integer zero." msgstr "" -#: ../../library/ctypes.rst:1491 +#: ../../library/ctypes.rst:1487 msgid "" "Flag to use as *mode* parameter. On platforms where this is not available, " "it is the same as *RTLD_GLOBAL*." msgstr "" -#: ../../library/ctypes.rst:1498 +#: ../../library/ctypes.rst:1494 msgid "" "The default mode which is used to load shared libraries. On OSX 10.3, this " "is *RTLD_GLOBAL*, otherwise it is the same as *RTLD_LOCAL*." msgstr "" -#: ../../library/ctypes.rst:1501 +#: ../../library/ctypes.rst:1497 msgid "" "Instances of these classes have no public methods. Functions exported by " "the shared library can be accessed as attributes or by index. Please note " @@ -1459,21 +1452,21 @@ msgid "" "other hand, accessing it through an index returns a new object each time::" msgstr "" -#: ../../library/ctypes.rst:1514 +#: ../../library/ctypes.rst:1510 msgid "" "The following public attributes are available, their name starts with an " "underscore to not clash with exported function names:" msgstr "" -#: ../../library/ctypes.rst:1520 +#: ../../library/ctypes.rst:1516 msgid "The system handle used to access the library." msgstr "" -#: ../../library/ctypes.rst:1525 +#: ../../library/ctypes.rst:1521 msgid "The name of the library passed in the constructor." msgstr "" -#: ../../library/ctypes.rst:1527 +#: ../../library/ctypes.rst:1523 msgid "" "Shared libraries can also be loaded by using one of the prefabricated " "objects, which are instances of the :class:`LibraryLoader` class, either by " @@ -1481,13 +1474,13 @@ msgid "" "library as attribute of the loader instance." msgstr "" -#: ../../library/ctypes.rst:1535 +#: ../../library/ctypes.rst:1531 msgid "" "Class which loads shared libraries. *dlltype* should be one of the :class:" "`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types." msgstr "" -#: ../../library/ctypes.rst:1538 +#: ../../library/ctypes.rst:1534 msgid "" ":meth:`!__getattr__` has special behavior: It allows loading a shared " "library by accessing it as attribute of a library loader instance. The " @@ -1495,39 +1488,39 @@ msgid "" "each time." msgstr "" -#: ../../library/ctypes.rst:1544 +#: ../../library/ctypes.rst:1540 msgid "" "Load a shared library into the process and return it. This method always " "returns a new instance of the library." msgstr "" -#: ../../library/ctypes.rst:1548 +#: ../../library/ctypes.rst:1544 msgid "These prefabricated library loaders are available:" msgstr "" -#: ../../library/ctypes.rst:1553 +#: ../../library/ctypes.rst:1549 msgid "Creates :class:`CDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1559 +#: ../../library/ctypes.rst:1555 msgid "Windows only: Creates :class:`WinDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1565 +#: ../../library/ctypes.rst:1561 msgid "Windows only: Creates :class:`OleDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1571 +#: ../../library/ctypes.rst:1567 msgid "Creates :class:`PyDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1574 +#: ../../library/ctypes.rst:1570 msgid "" "For accessing the C Python api directly, a ready-to-use Python shared " "library object is available:" msgstr "" -#: ../../library/ctypes.rst:1580 +#: ../../library/ctypes.rst:1576 msgid "" "An instance of :class:`PyDLL` that exposes Python C API functions as " "attributes. Note that all these functions are assumed to return C :c:expr:" @@ -1535,21 +1528,21 @@ msgid "" "correct :attr:`!restype` attribute to use these functions." msgstr "" -#: ../../library/ctypes.rst:1585 +#: ../../library/ctypes.rst:1581 msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlopen`` with argument " "``name``." msgstr "" "引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``ctypes.dlopen``。" -#: ../../library/ctypes.rst:1587 +#: ../../library/ctypes.rst:1583 msgid "" "Loading a library through any of these objects raises an :ref:`auditing " "event ` ``ctypes.dlopen`` with string argument ``name``, the name " "used to load the library." msgstr "" -#: ../../library/ctypes.rst:1591 +#: ../../library/ctypes.rst:1587 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym`` with arguments " @@ -1558,14 +1551,14 @@ msgstr "" "引發一個附帶引數 ``library``、``name`` 的\\ :ref:`稽核事件 ` " "``ctypes.dlsym``。" -#: ../../library/ctypes.rst:1593 +#: ../../library/ctypes.rst:1589 msgid "" "Accessing a function on a loaded library raises an auditing event ``ctypes." "dlsym`` with arguments ``library`` (the library object) and ``name`` (the " "symbol's name as a string or integer)." msgstr "" -#: ../../library/ctypes.rst:1597 +#: ../../library/ctypes.rst:1593 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym/handle`` with " @@ -1574,18 +1567,18 @@ msgstr "" "引發一個附帶引數 ``handle``、``name`` 的\\ :ref:`稽核事件 ` " "``ctypes.dlsym/handle``。" -#: ../../library/ctypes.rst:1599 +#: ../../library/ctypes.rst:1595 msgid "" "In cases when only the library handle is available rather than the object, " "accessing a function raises an auditing event ``ctypes.dlsym/handle`` with " "arguments ``handle`` (the raw library handle) and ``name``." msgstr "" -#: ../../library/ctypes.rst:1606 +#: ../../library/ctypes.rst:1602 msgid "Foreign functions" msgstr "" -#: ../../library/ctypes.rst:1608 +#: ../../library/ctypes.rst:1604 msgid "" "As explained in the previous section, foreign functions can be accessed as " "attributes of loaded shared libraries. The function objects created in this " @@ -1594,29 +1587,29 @@ msgid "" "library loader. They are instances of a private class:" msgstr "" -#: ../../library/ctypes.rst:1617 +#: ../../library/ctypes.rst:1613 msgid "Base class for C callable foreign functions." msgstr "" -#: ../../library/ctypes.rst:1619 +#: ../../library/ctypes.rst:1615 msgid "" "Instances of foreign functions are also C compatible data types; they " "represent C function pointers." msgstr "" -#: ../../library/ctypes.rst:1622 +#: ../../library/ctypes.rst:1618 msgid "" "This behavior can be customized by assigning to special attributes of the " "foreign function object." msgstr "" -#: ../../library/ctypes.rst:1627 +#: ../../library/ctypes.rst:1623 msgid "" "Assign a ctypes type to specify the result type of the foreign function. Use " "``None`` for :c:expr:`void`, a function not returning anything." msgstr "" -#: ../../library/ctypes.rst:1630 +#: ../../library/ctypes.rst:1626 msgid "" "It is possible to assign a callable Python object that is not a ctypes type, " "in this case the function is assumed to return a C :c:expr:`int`, and the " @@ -1626,7 +1619,7 @@ msgid "" "callable to the :attr:`errcheck` attribute." msgstr "" -#: ../../library/ctypes.rst:1639 +#: ../../library/ctypes.rst:1635 msgid "" "Assign a tuple of ctypes types to specify the argument types that the " "function accepts. Functions using the ``stdcall`` calling convention can " @@ -1635,7 +1628,7 @@ msgid "" "unspecified arguments as well." msgstr "" -#: ../../library/ctypes.rst:1645 +#: ../../library/ctypes.rst:1641 msgid "" "When a foreign function is called, each actual argument is passed to the :" "meth:`~_CData.from_param` class method of the items in the :attr:`argtypes` " @@ -1645,7 +1638,7 @@ msgid "" "object using ctypes conversion rules." msgstr "" -#: ../../library/ctypes.rst:1652 +#: ../../library/ctypes.rst:1648 msgid "" "New: It is now possible to put items in argtypes which are not ctypes types, " "but each item must have a :meth:`~_CData.from_param` method which returns a " @@ -1653,44 +1646,44 @@ msgid "" "defining adapters that can adapt custom objects as function parameters." msgstr "" -#: ../../library/ctypes.rst:1659 +#: ../../library/ctypes.rst:1655 msgid "" "Assign a Python function or another callable to this attribute. The callable " "will be called with three or more arguments:" msgstr "" -#: ../../library/ctypes.rst:1666 +#: ../../library/ctypes.rst:1662 msgid "" "*result* is what the foreign function returns, as specified by the :attr:`!" "restype` attribute." msgstr "" -#: ../../library/ctypes.rst:1669 +#: ../../library/ctypes.rst:1665 msgid "" "*func* is the foreign function object itself, this allows reusing the same " "callable object to check or post process the results of several functions." msgstr "" -#: ../../library/ctypes.rst:1673 +#: ../../library/ctypes.rst:1669 msgid "" "*arguments* is a tuple containing the parameters originally passed to the " "function call, this allows specializing the behavior on the arguments used." msgstr "" -#: ../../library/ctypes.rst:1677 +#: ../../library/ctypes.rst:1673 msgid "" "The object that this function returns will be returned from the foreign " "function call, but it can also check the result value and raise an exception " "if the foreign function call failed." msgstr "" -#: ../../library/ctypes.rst:1684 +#: ../../library/ctypes.rst:1680 msgid "" "This exception is raised when a foreign function call cannot convert one of " "the passed arguments." msgstr "" -#: ../../library/ctypes.rst:1688 +#: ../../library/ctypes.rst:1684 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_exception`` with " @@ -1699,7 +1692,7 @@ msgstr "" "引發一個附帶引數 ``code`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_exception``。" -#: ../../library/ctypes.rst:1690 +#: ../../library/ctypes.rst:1686 msgid "" "On Windows, when a foreign function call raises a system exception (for " "example, due to an access violation), it will be captured and replaced with " @@ -1708,7 +1701,7 @@ msgid "" "hook to replace the exception with its own." msgstr "" -#: ../../library/ctypes.rst:1696 +#: ../../library/ctypes.rst:1692 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.call_function`` with " @@ -1717,18 +1710,18 @@ msgstr "" "引發一個附帶引數 ``func_pointer``、``arguments`` 的\\ :ref:`稽核事件 " "` ``ctypes.call_function``。" -#: ../../library/ctypes.rst:1698 +#: ../../library/ctypes.rst:1694 msgid "" "Some ways to invoke foreign function calls may raise an auditing event " "``ctypes.call_function`` with arguments ``function pointer`` and " "``arguments``." msgstr "" -#: ../../library/ctypes.rst:1704 +#: ../../library/ctypes.rst:1700 msgid "Function prototypes" msgstr "" -#: ../../library/ctypes.rst:1706 +#: ../../library/ctypes.rst:1702 msgid "" "Foreign functions can also be created by instantiating function prototypes. " "Function prototypes are similar to function prototypes in C; they describe a " @@ -1739,7 +1732,7 @@ msgid "" "``@wrapper`` syntax. See :ref:`ctypes-callback-functions` for examples." msgstr "" -#: ../../library/ctypes.rst:1717 +#: ../../library/ctypes.rst:1713 msgid "" "The returned function prototype creates functions that use the standard C " "calling convention. The function will release the GIL during the call. If " @@ -1748,37 +1741,37 @@ msgid "" "after the call; *use_last_error* does the same for the Windows error code." msgstr "" -#: ../../library/ctypes.rst:1727 +#: ../../library/ctypes.rst:1723 msgid "" "Windows only: The returned function prototype creates functions that use the " "``stdcall`` calling convention. The function will release the GIL during " "the call. *use_errno* and *use_last_error* have the same meaning as above." msgstr "" -#: ../../library/ctypes.rst:1735 +#: ../../library/ctypes.rst:1731 msgid "" "The returned function prototype creates functions that use the Python " "calling convention. The function will *not* release the GIL during the call." msgstr "" -#: ../../library/ctypes.rst:1738 +#: ../../library/ctypes.rst:1734 msgid "" "Function prototypes created by these factory functions can be instantiated " "in different ways, depending on the type and number of the parameters in the " "call:" msgstr "" -#: ../../library/ctypes.rst:1745 +#: ../../library/ctypes.rst:1741 msgid "" "Returns a foreign function at the specified address which must be an integer." msgstr "" -#: ../../library/ctypes.rst:1752 +#: ../../library/ctypes.rst:1748 msgid "" "Create a C callable function (a callback function) from a Python *callable*." msgstr "" -#: ../../library/ctypes.rst:1759 +#: ../../library/ctypes.rst:1755 msgid "" "Returns a foreign function exported by a shared library. *func_spec* must be " "a 2-tuple ``(name_or_ordinal, library)``. The first item is the name of the " @@ -1786,7 +1779,7 @@ msgid "" "small integer. The second item is the shared library instance." msgstr "" -#: ../../library/ctypes.rst:1769 +#: ../../library/ctypes.rst:1765 msgid "" "Returns a foreign function that will call a COM method. *vtbl_index* is the " "index into the virtual function table, a small non-negative integer. *name* " @@ -1794,87 +1787,87 @@ msgid "" "identifier which is used in extended error reporting." msgstr "" -#: ../../library/ctypes.rst:1774 +#: ../../library/ctypes.rst:1770 msgid "" "COM methods use a special calling convention: They require a pointer to the " "COM interface as first argument, in addition to those parameters that are " "specified in the :attr:`!argtypes` tuple." msgstr "" -#: ../../library/ctypes.rst:1778 +#: ../../library/ctypes.rst:1774 msgid "" "The optional *paramflags* parameter creates foreign function wrappers with " "much more functionality than the features described above." msgstr "" -#: ../../library/ctypes.rst:1781 +#: ../../library/ctypes.rst:1777 msgid "" "*paramflags* must be a tuple of the same length as :attr:`~_FuncPtr." "argtypes`." msgstr "" -#: ../../library/ctypes.rst:1783 +#: ../../library/ctypes.rst:1779 msgid "" "Each item in this tuple contains further information about a parameter, it " "must be a tuple containing one, two, or three items." msgstr "" -#: ../../library/ctypes.rst:1786 +#: ../../library/ctypes.rst:1782 msgid "" "The first item is an integer containing a combination of direction flags for " "the parameter:" msgstr "" -#: ../../library/ctypes.rst:1790 +#: ../../library/ctypes.rst:1786 msgid "1" msgstr "1" -#: ../../library/ctypes.rst:1790 +#: ../../library/ctypes.rst:1786 msgid "Specifies an input parameter to the function." msgstr "" -#: ../../library/ctypes.rst:1793 +#: ../../library/ctypes.rst:1789 msgid "2" msgstr "2" -#: ../../library/ctypes.rst:1793 +#: ../../library/ctypes.rst:1789 msgid "Output parameter. The foreign function fills in a value." msgstr "" -#: ../../library/ctypes.rst:1796 +#: ../../library/ctypes.rst:1792 msgid "4" msgstr "4" -#: ../../library/ctypes.rst:1796 +#: ../../library/ctypes.rst:1792 msgid "Input parameter which defaults to the integer zero." msgstr "" -#: ../../library/ctypes.rst:1798 +#: ../../library/ctypes.rst:1794 msgid "" "The optional second item is the parameter name as string. If this is " "specified, the foreign function can be called with named parameters." msgstr "" -#: ../../library/ctypes.rst:1801 +#: ../../library/ctypes.rst:1797 msgid "The optional third item is the default value for this parameter." msgstr "" -#: ../../library/ctypes.rst:1804 +#: ../../library/ctypes.rst:1800 msgid "" "The following example demonstrates how to wrap the Windows ``MessageBoxW`` " "function so that it supports default parameters and named arguments. The C " "declaration from the windows header file is this::" msgstr "" -#: ../../library/ctypes.rst:1815 ../../library/ctypes.rst:1838 +#: ../../library/ctypes.rst:1811 ../../library/ctypes.rst:1834 msgid "Here is the wrapping with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1823 +#: ../../library/ctypes.rst:1819 msgid "The ``MessageBox`` foreign function can now be called in these ways::" msgstr "" -#: ../../library/ctypes.rst:1829 +#: ../../library/ctypes.rst:1825 msgid "" "A second example demonstrates output parameters. The win32 " "``GetWindowRect`` function retrieves the dimensions of a specified window by " @@ -1882,7 +1875,7 @@ msgid "" "the C declaration::" msgstr "" -#: ../../library/ctypes.rst:1847 +#: ../../library/ctypes.rst:1843 msgid "" "Functions with output parameters will automatically return the output " "parameter value if there is a single one, or a tuple containing the output " @@ -1890,7 +1883,7 @@ msgid "" "now returns a RECT instance, when called." msgstr "" -#: ../../library/ctypes.rst:1852 +#: ../../library/ctypes.rst:1848 msgid "" "Output parameters can be combined with the :attr:`~_FuncPtr.errcheck` " "protocol to do further output processing and error checking. The win32 " @@ -1899,7 +1892,7 @@ msgid "" "exception when the api call failed::" msgstr "" -#: ../../library/ctypes.rst:1865 +#: ../../library/ctypes.rst:1861 msgid "" "If the :attr:`~_FuncPtr.errcheck` function returns the argument tuple it " "receives unchanged, :mod:`ctypes` continues the normal processing it does on " @@ -1908,17 +1901,17 @@ msgid "" "and return them instead, the normal processing will no longer take place::" msgstr "" -#: ../../library/ctypes.rst:1884 +#: ../../library/ctypes.rst:1880 msgid "Utility functions" msgstr "" -#: ../../library/ctypes.rst:1888 +#: ../../library/ctypes.rst:1884 msgid "" "Returns the address of the memory buffer as integer. *obj* must be an " "instance of a ctypes type." msgstr "" -#: ../../library/ctypes.rst:1891 +#: ../../library/ctypes.rst:1887 msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." @@ -1926,30 +1919,30 @@ msgstr "" "引發一個附帶引數 ``obj`` 的\\ :ref:`稽核事件 ` ``ctypes." "addressof``。" -#: ../../library/ctypes.rst:1896 +#: ../../library/ctypes.rst:1892 msgid "" "Returns the alignment requirements of a ctypes type. *obj_or_type* must be a " "ctypes type or instance." msgstr "" -#: ../../library/ctypes.rst:1902 +#: ../../library/ctypes.rst:1898 msgid "" "Returns a light-weight pointer to *obj*, which must be an instance of a " "ctypes type. *offset* defaults to zero, and must be an integer that will be " "added to the internal pointer value." msgstr "" -#: ../../library/ctypes.rst:1906 +#: ../../library/ctypes.rst:1902 msgid "``byref(obj, offset)`` corresponds to this C code::" msgstr "" -#: ../../library/ctypes.rst:1910 +#: ../../library/ctypes.rst:1906 msgid "" "The returned object can only be used as a foreign function call parameter. " "It behaves similar to ``pointer(obj)``, but the construction is a lot faster." msgstr "" -#: ../../library/ctypes.rst:1916 +#: ../../library/ctypes.rst:1912 msgid "" "This function is similar to the cast operator in C. It returns a new " "instance of *type* which points to the same memory block as *obj*. *type* " @@ -1957,19 +1950,19 @@ msgid "" "as a pointer." msgstr "" -#: ../../library/ctypes.rst:1924 +#: ../../library/ctypes.rst:1920 msgid "" "This function creates a mutable character buffer. The returned object is a " "ctypes array of :class:`c_char`." msgstr "" -#: ../../library/ctypes.rst:1927 +#: ../../library/ctypes.rst:1923 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a bytes object which will be used to initialize the array items." msgstr "" -#: ../../library/ctypes.rst:1930 +#: ../../library/ctypes.rst:1926 msgid "" "If a bytes object is specified as first argument, the buffer is made one " "item larger than its length so that the last element in the array is a NUL " @@ -1978,7 +1971,7 @@ msgid "" "not be used." msgstr "" -#: ../../library/ctypes.rst:1935 +#: ../../library/ctypes.rst:1931 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." @@ -1986,19 +1979,19 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_string_buffer``。" -#: ../../library/ctypes.rst:1940 +#: ../../library/ctypes.rst:1936 msgid "" "This function creates a mutable unicode character buffer. The returned " "object is a ctypes array of :class:`c_wchar`." msgstr "" -#: ../../library/ctypes.rst:1943 +#: ../../library/ctypes.rst:1939 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a string which will be used to initialize the array items." msgstr "" -#: ../../library/ctypes.rst:1946 +#: ../../library/ctypes.rst:1942 msgid "" "If a string is specified as first argument, the buffer is made one item " "larger than the length of the string so that the last element in the array " @@ -2007,7 +2000,7 @@ msgid "" "should not be used." msgstr "" -#: ../../library/ctypes.rst:1952 +#: ../../library/ctypes.rst:1948 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." @@ -2015,21 +2008,21 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_unicode_buffer``。" -#: ../../library/ctypes.rst:1957 +#: ../../library/ctypes.rst:1953 msgid "" "Windows only: This function is a hook which allows implementing in-process " "COM servers with ctypes. It is called from the DllCanUnloadNow function " "that the _ctypes extension dll exports." msgstr "" -#: ../../library/ctypes.rst:1964 +#: ../../library/ctypes.rst:1960 msgid "" "Windows only: This function is a hook which allows implementing in-process " "COM servers with ctypes. It is called from the DllGetClassObject function " "that the ``_ctypes`` extension dll exports." msgstr "" -#: ../../library/ctypes.rst:1972 +#: ../../library/ctypes.rst:1968 msgid "" "Try to find a library and return a pathname. *name* is the library name " "without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version " @@ -2037,94 +2030,94 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1983 +#: ../../library/ctypes.rst:1979 msgid "" "Windows only: return the filename of the VC runtime library used by Python, " "and by the extension modules. If the name of the library cannot be " "determined, ``None`` is returned." msgstr "" -#: ../../library/ctypes.rst:1987 +#: ../../library/ctypes.rst:1983 msgid "" "If you need to free memory, for example, allocated by an extension module " "with a call to the ``free(void *)``, it is important that you use the " "function in the same library that allocated the memory." msgstr "" -#: ../../library/ctypes.rst:1994 +#: ../../library/ctypes.rst:1990 msgid "" "Windows only: Returns a textual description of the error code *code*. If no " "error code is specified, the last error code is used by calling the Windows " "api function GetLastError." msgstr "" -#: ../../library/ctypes.rst:2001 +#: ../../library/ctypes.rst:1997 msgid "" "Windows only: Returns the last error code set by Windows in the calling " "thread. This function calls the Windows ``GetLastError()`` function " "directly, it does not return the ctypes-private copy of the error code." msgstr "" -#: ../../library/ctypes.rst:2007 +#: ../../library/ctypes.rst:2003 msgid "" "Returns the current value of the ctypes-private copy of the system :data:" "`errno` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2010 +#: ../../library/ctypes.rst:2006 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_errno``。" -#: ../../library/ctypes.rst:2014 +#: ../../library/ctypes.rst:2010 msgid "" "Windows only: returns the current value of the ctypes-private copy of the " "system :data:`!LastError` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2017 +#: ../../library/ctypes.rst:2013 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_last_error``。" -#: ../../library/ctypes.rst:2021 +#: ../../library/ctypes.rst:2017 msgid "" "Same as the standard C memmove library function: copies *count* bytes from " "*src* to *dst*. *dst* and *src* must be integers or ctypes instances that " "can be converted to pointers." msgstr "" -#: ../../library/ctypes.rst:2028 +#: ../../library/ctypes.rst:2024 msgid "" "Same as the standard C memset library function: fills the memory block at " "address *dst* with *count* bytes of value *c*. *dst* must be an integer " "specifying an address, or a ctypes instance." msgstr "" -#: ../../library/ctypes.rst:2035 +#: ../../library/ctypes.rst:2031 msgid "" "Create and return a new ctypes pointer type. Pointer types are cached and " "reused internally, so calling this function repeatedly is cheap. *type* must " "be a ctypes type." msgstr "" -#: ../../library/ctypes.rst:2042 +#: ../../library/ctypes.rst:2038 msgid "" "Create a new pointer instance, pointing to *obj*. The returned object is of " "the type ``POINTER(type(obj))``." msgstr "" -#: ../../library/ctypes.rst:2045 +#: ../../library/ctypes.rst:2041 msgid "" "Note: If you just want to pass a pointer to an object to a foreign function " "call, you should use ``byref(obj)`` which is much faster." msgstr "" -#: ../../library/ctypes.rst:2051 +#: ../../library/ctypes.rst:2047 msgid "" "This function resizes the internal memory buffer of *obj*, which must be an " "instance of a ctypes type. It is not possible to make the buffer smaller " @@ -2132,13 +2125,13 @@ msgid "" "but it is possible to enlarge the buffer." msgstr "" -#: ../../library/ctypes.rst:2059 +#: ../../library/ctypes.rst:2055 msgid "" "Set the current value of the ctypes-private copy of the system :data:`errno` " "variable in the calling thread to *value* and return the previous value." msgstr "" -#: ../../library/ctypes.rst:2062 +#: ../../library/ctypes.rst:2058 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." @@ -2146,14 +2139,14 @@ msgstr "" "引發一個附帶引數 ``errno`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_errno``。" -#: ../../library/ctypes.rst:2067 +#: ../../library/ctypes.rst:2063 msgid "" "Windows only: set the current value of the ctypes-private copy of the " "system :data:`!LastError` variable in the calling thread to *value* and " "return the previous value." msgstr "" -#: ../../library/ctypes.rst:2071 +#: ../../library/ctypes.rst:2067 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." @@ -2161,20 +2154,20 @@ msgstr "" "引發一個附帶引數 ``error`` 的\\ :ref:`稽核事件 ` ``ctypes." "get_last_error``。" -#: ../../library/ctypes.rst:2076 +#: ../../library/ctypes.rst:2072 msgid "" "Returns the size in bytes of a ctypes type or instance memory buffer. Does " "the same as the C ``sizeof`` operator." msgstr "" -#: ../../library/ctypes.rst:2082 +#: ../../library/ctypes.rst:2078 msgid "" "This function returns the C string starting at memory address *address* as a " "bytes object. If size is specified, it is used as size, otherwise the string " "is assumed to be zero-terminated." msgstr "" -#: ../../library/ctypes.rst:2086 +#: ../../library/ctypes.rst:2082 msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " "arguments ``address``, ``size``." @@ -2182,7 +2175,7 @@ msgstr "" "引發一個附帶引數 ``error``、``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.string_at``。" -#: ../../library/ctypes.rst:2091 +#: ../../library/ctypes.rst:2087 msgid "" "Windows only: this function is probably the worst-named thing in ctypes. It " "creates an instance of :exc:`OSError`. If *code* is not specified, " @@ -2191,13 +2184,13 @@ msgid "" "error." msgstr "" -#: ../../library/ctypes.rst:2097 +#: ../../library/ctypes.rst:2093 msgid "" "An instance of :exc:`WindowsError` used to be created, which is now an alias " "of :exc:`OSError`." msgstr "" -#: ../../library/ctypes.rst:2104 +#: ../../library/ctypes.rst:2100 msgid "" "This function returns the wide character string starting at memory address " "*address* as a string. If *size* is specified, it is used as the number of " @@ -2205,7 +2198,7 @@ msgid "" "terminated." msgstr "" -#: ../../library/ctypes.rst:2109 +#: ../../library/ctypes.rst:2105 msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " "arguments ``address``, ``size``." @@ -2213,11 +2206,11 @@ msgstr "" "引發一個附帶引數 ``address``、``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.wstring_at``。" -#: ../../library/ctypes.rst:2115 +#: ../../library/ctypes.rst:2111 msgid "Data types" msgstr "" -#: ../../library/ctypes.rst:2120 +#: ../../library/ctypes.rst:2116 msgid "" "This non-public class is the common base class of all ctypes data types. " "Among other things, all ctypes type instances contain a memory block that " @@ -2227,13 +2220,13 @@ msgid "" "alive in case the memory block contains pointers." msgstr "" -#: ../../library/ctypes.rst:2127 +#: ../../library/ctypes.rst:2123 msgid "" "Common methods of ctypes data types, these are all class methods (to be " "exact, they are methods of the :term:`metaclass`):" msgstr "" -#: ../../library/ctypes.rst:2132 +#: ../../library/ctypes.rst:2128 msgid "" "This method returns a ctypes instance that shares the buffer of the *source* " "object. The *source* object must support the writeable buffer interface. " @@ -2242,7 +2235,7 @@ msgid "" "exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2138 ../../library/ctypes.rst:2148 +#: ../../library/ctypes.rst:2134 ../../library/ctypes.rst:2144 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." @@ -2250,7 +2243,7 @@ msgstr "" "引發一個附帶引數 ``pointer``、``size``、``offset`` 的\\ :ref:`稽核事件 " "` ``ctypes.cdata/buffer``。" -#: ../../library/ctypes.rst:2142 +#: ../../library/ctypes.rst:2138 msgid "" "This method creates a ctypes instance, copying the buffer from the *source* " "object buffer which must be readable. The optional *offset* parameter " @@ -2258,13 +2251,13 @@ msgid "" "If the source buffer is not large enough a :exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2152 +#: ../../library/ctypes.rst:2148 msgid "" "This method returns a ctypes type instance using the memory specified by " "*address* which must be an integer." msgstr "" -#: ../../library/ctypes.rst:2155 +#: ../../library/ctypes.rst:2151 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata`` with argument " "``address``." @@ -2272,13 +2265,13 @@ msgstr "" "引發一個附帶引數 ``address`` 的\\ :ref:`稽核事件 ` ``ctypes." "cdata``。" -#: ../../library/ctypes.rst:2157 +#: ../../library/ctypes.rst:2153 msgid "" "This method, and others that indirectly call this method, raises an :ref:" "`auditing event ` ``ctypes.cdata`` with argument ``address``." msgstr "" -#: ../../library/ctypes.rst:2163 +#: ../../library/ctypes.rst:2159 msgid "" "This method adapts *obj* to a ctypes type. It is called with the actual " "object used in a foreign function call when the type is present in the " @@ -2286,25 +2279,25 @@ msgid "" "object that can be used as a function call parameter." msgstr "" -#: ../../library/ctypes.rst:2168 +#: ../../library/ctypes.rst:2164 msgid "" "All ctypes data types have a default implementation of this classmethod that " "normally returns *obj* if that is an instance of the type. Some types " "accept other objects as well." msgstr "" -#: ../../library/ctypes.rst:2174 +#: ../../library/ctypes.rst:2170 msgid "" "This method returns a ctypes type instance exported by a shared library. " "*name* is the name of the symbol that exports the data, *library* is the " "loaded shared library." msgstr "" -#: ../../library/ctypes.rst:2178 +#: ../../library/ctypes.rst:2174 msgid "Common instance variables of ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2182 +#: ../../library/ctypes.rst:2178 msgid "" "Sometimes ctypes data instances do not own the memory block they contain, " "instead they share part of the memory block of a base object. The :attr:" @@ -2312,13 +2305,13 @@ msgid "" "block." msgstr "" -#: ../../library/ctypes.rst:2189 +#: ../../library/ctypes.rst:2185 msgid "" "This read-only variable is true when the ctypes data instance has allocated " "the memory block itself, false otherwise." msgstr "" -#: ../../library/ctypes.rst:2194 +#: ../../library/ctypes.rst:2190 msgid "" "This member is either ``None`` or a dictionary containing Python objects " "that need to be kept alive so that the memory block contents is kept valid. " @@ -2326,7 +2319,7 @@ msgid "" "dictionary." msgstr "" -#: ../../library/ctypes.rst:2207 +#: ../../library/ctypes.rst:2203 msgid "" "This non-public class is the base class of all fundamental ctypes data " "types. It is mentioned here because it contains the common attributes of the " @@ -2335,11 +2328,11 @@ msgid "" "types that are not and do not contain pointers can now be pickled." msgstr "" -#: ../../library/ctypes.rst:2213 +#: ../../library/ctypes.rst:2209 msgid "Instances have a single attribute:" msgstr "" -#: ../../library/ctypes.rst:2217 +#: ../../library/ctypes.rst:2213 msgid "" "This attribute contains the actual value of the instance. For integer and " "pointer types, it is an integer, for character types, it is a single " @@ -2347,7 +2340,7 @@ msgid "" "bytes object or string." msgstr "" -#: ../../library/ctypes.rst:2222 +#: ../../library/ctypes.rst:2218 msgid "" "When the ``value`` attribute is retrieved from a ctypes instance, usually a " "new object is returned each time. :mod:`ctypes` does *not* implement " @@ -2355,7 +2348,7 @@ msgid "" "true for all other ctypes object instances." msgstr "" -#: ../../library/ctypes.rst:2228 +#: ../../library/ctypes.rst:2224 msgid "" "Fundamental data types, when returned as foreign function call results, or, " "for example, by retrieving structure field members or array items, are " @@ -2365,7 +2358,7 @@ msgid "" "instance." msgstr "" -#: ../../library/ctypes.rst:2236 +#: ../../library/ctypes.rst:2232 msgid "" "Subclasses of fundamental data types do *not* inherit this behavior. So, if " "a foreign functions :attr:`!restype` is a subclass of :class:`c_void_p`, you " @@ -2373,25 +2366,25 @@ msgid "" "you can get the value of the pointer by accessing the ``value`` attribute." msgstr "" -#: ../../library/ctypes.rst:2241 +#: ../../library/ctypes.rst:2237 msgid "These are the fundamental ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2245 +#: ../../library/ctypes.rst:2241 msgid "" "Represents the C :c:expr:`signed char` datatype, and interprets the value as " "small integer. The constructor accepts an optional integer initializer; no " "overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2252 +#: ../../library/ctypes.rst:2248 msgid "" "Represents the C :c:expr:`char` datatype, and interprets the value as a " "single character. The constructor accepts an optional string initializer, " "the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2259 +#: ../../library/ctypes.rst:2255 msgid "" "Represents the C :c:expr:`char *` datatype when it points to a zero-" "terminated string. For a general character pointer that may also point to " @@ -2399,182 +2392,182 @@ msgid "" "integer address, or a bytes object." msgstr "" -#: ../../library/ctypes.rst:2267 +#: ../../library/ctypes.rst:2263 msgid "" "Represents the C :c:expr:`double` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2273 +#: ../../library/ctypes.rst:2269 msgid "" "Represents the C :c:expr:`long double` datatype. The constructor accepts an " "optional float initializer. On platforms where ``sizeof(long double) == " "sizeof(double)`` it is an alias to :class:`c_double`." msgstr "" -#: ../../library/ctypes.rst:2279 +#: ../../library/ctypes.rst:2275 msgid "" "Represents the C :c:expr:`float` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2285 +#: ../../library/ctypes.rst:2281 msgid "" "Represents the C :c:expr:`signed int` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias to :class:`c_long`." msgstr "" -#: ../../library/ctypes.rst:2292 +#: ../../library/ctypes.rst:2288 msgid "" "Represents the C 8-bit :c:expr:`signed int` datatype. Usually an alias for :" "class:`c_byte`." msgstr "" -#: ../../library/ctypes.rst:2298 +#: ../../library/ctypes.rst:2294 msgid "" "Represents the C 16-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_short`." msgstr "" -#: ../../library/ctypes.rst:2304 +#: ../../library/ctypes.rst:2300 msgid "" "Represents the C 32-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_int`." msgstr "" -#: ../../library/ctypes.rst:2310 +#: ../../library/ctypes.rst:2306 msgid "" "Represents the C 64-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_longlong`." msgstr "" -#: ../../library/ctypes.rst:2316 +#: ../../library/ctypes.rst:2312 msgid "" "Represents the C :c:expr:`signed long` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2322 +#: ../../library/ctypes.rst:2318 msgid "" "Represents the C :c:expr:`signed long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2328 +#: ../../library/ctypes.rst:2324 msgid "" "Represents the C :c:expr:`signed short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2334 +#: ../../library/ctypes.rst:2330 msgid "Represents the C :c:type:`size_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2339 +#: ../../library/ctypes.rst:2335 msgid "Represents the C :c:type:`ssize_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2346 +#: ../../library/ctypes.rst:2342 msgid "Represents the C :c:type:`time_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2353 +#: ../../library/ctypes.rst:2349 msgid "" "Represents the C :c:expr:`unsigned char` datatype, it interprets the value " "as small integer. The constructor accepts an optional integer initializer; " "no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2360 +#: ../../library/ctypes.rst:2356 msgid "" "Represents the C :c:expr:`unsigned int` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias for :class:`c_ulong`." msgstr "" -#: ../../library/ctypes.rst:2367 +#: ../../library/ctypes.rst:2363 msgid "" "Represents the C 8-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ubyte`." msgstr "" -#: ../../library/ctypes.rst:2373 +#: ../../library/ctypes.rst:2369 msgid "" "Represents the C 16-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ushort`." msgstr "" -#: ../../library/ctypes.rst:2379 +#: ../../library/ctypes.rst:2375 msgid "" "Represents the C 32-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_uint`." msgstr "" -#: ../../library/ctypes.rst:2385 +#: ../../library/ctypes.rst:2381 msgid "" "Represents the C 64-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ulonglong`." msgstr "" -#: ../../library/ctypes.rst:2391 +#: ../../library/ctypes.rst:2387 msgid "" "Represents the C :c:expr:`unsigned long` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2397 +#: ../../library/ctypes.rst:2393 msgid "" "Represents the C :c:expr:`unsigned long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2403 +#: ../../library/ctypes.rst:2399 msgid "" "Represents the C :c:expr:`unsigned short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2409 +#: ../../library/ctypes.rst:2405 msgid "" "Represents the C :c:expr:`void *` type. The value is represented as " "integer. The constructor accepts an optional integer initializer." msgstr "" -#: ../../library/ctypes.rst:2415 +#: ../../library/ctypes.rst:2411 msgid "" "Represents the C :c:type:`wchar_t` datatype, and interprets the value as a " "single character unicode string. The constructor accepts an optional string " "initializer, the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2422 +#: ../../library/ctypes.rst:2418 msgid "" "Represents the C :c:expr:`wchar_t *` datatype, which must be a pointer to a " "zero-terminated wide character string. The constructor accepts an integer " "address, or a string." msgstr "" -#: ../../library/ctypes.rst:2429 +#: ../../library/ctypes.rst:2425 msgid "" "Represent the C :c:expr:`bool` datatype (more accurately, :c:expr:`_Bool` " "from C99). Its value can be ``True`` or ``False``, and the constructor " "accepts any object that has a truth value." msgstr "" -#: ../../library/ctypes.rst:2436 +#: ../../library/ctypes.rst:2432 msgid "" "Windows only: Represents a :c:type:`!HRESULT` value, which contains success " "or error information for a function or method call." msgstr "" -#: ../../library/ctypes.rst:2442 +#: ../../library/ctypes.rst:2438 msgid "" "Represents the C :c:expr:`PyObject *` datatype. Calling this without an " "argument creates a ``NULL`` :c:expr:`PyObject *` pointer." msgstr "" -#: ../../library/ctypes.rst:2445 +#: ../../library/ctypes.rst:2441 msgid "" "The :mod:`!ctypes.wintypes` module provides quite some other Windows " "specific data types, for example :c:type:`!HWND`, :c:type:`!WPARAM`, or :c:" @@ -2582,41 +2575,41 @@ msgid "" "are also defined." msgstr "" -#: ../../library/ctypes.rst:2453 +#: ../../library/ctypes.rst:2449 msgid "Structured data types" msgstr "" -#: ../../library/ctypes.rst:2458 +#: ../../library/ctypes.rst:2454 msgid "Abstract base class for unions in native byte order." msgstr "" -#: ../../library/ctypes.rst:2463 +#: ../../library/ctypes.rst:2459 msgid "Abstract base class for unions in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2469 +#: ../../library/ctypes.rst:2465 msgid "Abstract base class for unions in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2475 +#: ../../library/ctypes.rst:2471 msgid "Abstract base class for structures in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2480 +#: ../../library/ctypes.rst:2476 msgid "Abstract base class for structures in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2482 +#: ../../library/ctypes.rst:2478 msgid "" "Structures and unions with non-native byte order cannot contain pointer type " "fields, or any other data types containing pointer type fields." msgstr "" -#: ../../library/ctypes.rst:2488 +#: ../../library/ctypes.rst:2484 msgid "Abstract base class for structures in *native* byte order." msgstr "" -#: ../../library/ctypes.rst:2490 +#: ../../library/ctypes.rst:2486 msgid "" "Concrete structure and union types must be created by subclassing one of " "these types, and at least define a :attr:`_fields_` class variable. :mod:" @@ -2624,34 +2617,34 @@ msgid "" "the fields by direct attribute accesses. These are the" msgstr "" -#: ../../library/ctypes.rst:2498 +#: ../../library/ctypes.rst:2494 msgid "" "A sequence defining the structure fields. The items must be 2-tuples or 3-" "tuples. The first item is the name of the field, the second item specifies " "the type of the field; it can be any ctypes data type." msgstr "" -#: ../../library/ctypes.rst:2502 +#: ../../library/ctypes.rst:2498 msgid "" "For integer type fields like :class:`c_int`, a third optional item can be " "given. It must be a small positive integer defining the bit width of the " "field." msgstr "" -#: ../../library/ctypes.rst:2506 +#: ../../library/ctypes.rst:2502 msgid "" "Field names must be unique within one structure or union. This is not " "checked, only one field can be accessed when names are repeated." msgstr "" -#: ../../library/ctypes.rst:2509 +#: ../../library/ctypes.rst:2505 msgid "" "It is possible to define the :attr:`_fields_` class variable *after* the " "class statement that defines the Structure subclass, this allows creating " "data types that directly or indirectly reference themselves::" msgstr "" -#: ../../library/ctypes.rst:2519 +#: ../../library/ctypes.rst:2515 msgid "" "The :attr:`_fields_` class variable must, however, be defined before the " "type is first used (an instance is created, :func:`sizeof` is called on it, " @@ -2659,14 +2652,14 @@ msgid "" "raise an AttributeError." msgstr "" -#: ../../library/ctypes.rst:2524 +#: ../../library/ctypes.rst:2520 msgid "" "It is possible to define sub-subclasses of structure types, they inherit the " "fields of the base class plus the :attr:`_fields_` defined in the sub-" "subclass, if any." msgstr "" -#: ../../library/ctypes.rst:2531 +#: ../../library/ctypes.rst:2527 msgid "" "An optional small integer that allows overriding the alignment of structure " "fields in the instance. :attr:`_pack_` must already be defined when :attr:" @@ -2674,14 +2667,14 @@ msgid "" "attribute to 0 is the same as not setting it at all." msgstr "" -#: ../../library/ctypes.rst:2539 +#: ../../library/ctypes.rst:2535 msgid "" "An optional sequence that lists the names of unnamed (anonymous) fields. :" "attr:`_anonymous_` must be already defined when :attr:`_fields_` is " "assigned, otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2543 +#: ../../library/ctypes.rst:2539 msgid "" "The fields listed in this variable must be structure or union type fields. :" "mod:`ctypes` will create descriptors in the structure type that allows " @@ -2689,11 +2682,11 @@ msgid "" "structure or union field." msgstr "" -#: ../../library/ctypes.rst:2548 +#: ../../library/ctypes.rst:2544 msgid "Here is an example type (Windows)::" msgstr "" -#: ../../library/ctypes.rst:2561 +#: ../../library/ctypes.rst:2557 msgid "" "The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field " "specifies which one of the union fields is valid. Since the ``u`` field is " @@ -2703,7 +2696,7 @@ msgid "" "temporary union instance::" msgstr "" -#: ../../library/ctypes.rst:2573 +#: ../../library/ctypes.rst:2569 msgid "" "It is possible to define sub-subclasses of structures, they inherit the " "fields of the base class. If the subclass definition has a separate :attr:" @@ -2711,7 +2704,7 @@ msgid "" "of the base class." msgstr "" -#: ../../library/ctypes.rst:2578 +#: ../../library/ctypes.rst:2574 msgid "" "Structure and union constructors accept both positional and keyword " "arguments. Positional arguments are used to initialize member fields in the " @@ -2721,15 +2714,15 @@ msgid "" "names not present in :attr:`_fields_`." msgstr "" -#: ../../library/ctypes.rst:2589 +#: ../../library/ctypes.rst:2585 msgid "Arrays and pointers" msgstr "" -#: ../../library/ctypes.rst:2593 +#: ../../library/ctypes.rst:2589 msgid "Abstract base class for arrays." msgstr "" -#: ../../library/ctypes.rst:2595 +#: ../../library/ctypes.rst:2591 msgid "" "The recommended way to create concrete array types is by multiplying any :" "mod:`ctypes` data type with a non-negative integer. Alternatively, you can " @@ -2739,34 +2732,34 @@ msgid "" "an :class:`Array`." msgstr "" -#: ../../library/ctypes.rst:2605 +#: ../../library/ctypes.rst:2601 msgid "" "A positive integer specifying the number of elements in the array. Out-of-" "range subscripts result in an :exc:`IndexError`. Will be returned by :func:" "`len`." msgstr "" -#: ../../library/ctypes.rst:2612 +#: ../../library/ctypes.rst:2608 msgid "Specifies the type of each element in the array." msgstr "" -#: ../../library/ctypes.rst:2615 +#: ../../library/ctypes.rst:2611 msgid "" "Array subclass constructors accept positional arguments, used to initialize " "the elements in order." msgstr "" -#: ../../library/ctypes.rst:2621 +#: ../../library/ctypes.rst:2617 msgid "Private, abstract base class for pointers." msgstr "" -#: ../../library/ctypes.rst:2623 +#: ../../library/ctypes.rst:2619 msgid "" "Concrete pointer types are created by calling :func:`POINTER` with the type " "that will be pointed to; this is done automatically by :func:`pointer`." msgstr "" -#: ../../library/ctypes.rst:2627 +#: ../../library/ctypes.rst:2623 msgid "" "If a pointer points to an array, its elements can be read and written using " "standard subscript and slice accesses. Pointer objects have no size, so :" @@ -2775,11 +2768,11 @@ msgid "" "probably crash with an access violation (if you're lucky)." msgstr "" -#: ../../library/ctypes.rst:2637 +#: ../../library/ctypes.rst:2633 msgid "Specifies the type pointed to." msgstr "" -#: ../../library/ctypes.rst:2641 +#: ../../library/ctypes.rst:2637 msgid "" "Returns the object to which to pointer points. Assigning to this attribute " "changes the pointer to point to the assigned object." diff --git a/library/fcntl.po b/library/fcntl.po index 8487abb927..866fd4cf51 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-01 00:03+0000\n" +"POT-Creation-Date: 2024-02-27 00:04+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -24,10 +24,10 @@ msgstr "" #: ../../library/fcntl.rst:16 msgid "" -"This module performs file control and I/O control on file descriptors. It is " -"an interface to the :c:func:`fcntl` and :c:func:`ioctl` Unix routines. For " -"a complete description of these calls, see :manpage:`fcntl(2)` and :manpage:" -"`ioctl(2)` Unix manual pages." +"This module performs file and I/O control on file descriptors. It is an " +"interface to the :c:func:`fcntl` and :c:func:`ioctl` Unix routines. See the :" +"manpage:`fcntl(2)` and :manpage:`ioctl(2)` Unix manual pages for full " +"details." msgstr "" #: ../../library/fcntl.rst:21 @@ -110,7 +110,7 @@ msgid "" msgstr "" #: ../../library/fcntl.rst:83 -msgid "If the :c:func:`fcntl` fails, an :exc:`OSError` is raised." +msgid "If the :c:func:`fcntl` call fails, an :exc:`OSError` is raised." msgstr "" #: ../../library/fcntl.rst:85 @@ -174,7 +174,8 @@ msgid "" msgstr "" #: ../../library/fcntl.rst:121 -msgid "If the :c:func:`ioctl` fails, an :exc:`OSError` exception is raised." +msgid "" +"If the :c:func:`ioctl` call fails, an :exc:`OSError` exception is raised." msgstr "" #: ../../library/fcntl.rst:123 @@ -201,7 +202,8 @@ msgid "" msgstr "" #: ../../library/fcntl.rst:146 -msgid "If the :c:func:`flock` fails, an :exc:`OSError` exception is raised." +msgid "" +"If the :c:func:`flock` call fails, an :exc:`OSError` exception is raised." msgstr "" #: ../../library/fcntl.rst:148 @@ -220,57 +222,61 @@ msgid "" "*cmd* is one of the following values:" msgstr "" -#: ../../library/fcntl.rst:158 -msgid ":const:`LOCK_UN` -- unlock" +#: ../../library/fcntl.rst:160 +msgid "Release an existing lock." msgstr "" -#: ../../library/fcntl.rst:159 -msgid ":const:`LOCK_SH` -- acquire a shared lock" +#: ../../library/fcntl.rst:164 +msgid "Acquire a shared lock." msgstr "" -#: ../../library/fcntl.rst:160 -msgid ":const:`LOCK_EX` -- acquire an exclusive lock" +#: ../../library/fcntl.rst:168 +msgid "Acquire an exclusive lock." msgstr "" -#: ../../library/fcntl.rst:162 +#: ../../library/fcntl.rst:172 msgid "" -"When *cmd* is :const:`LOCK_SH` or :const:`LOCK_EX`, it can also be bitwise " -"ORed with :const:`LOCK_NB` to avoid blocking on lock acquisition. If :const:" -"`LOCK_NB` is used and the lock cannot be acquired, an :exc:`OSError` will be " -"raised and the exception will have an *errno* attribute set to :const:" -"`EACCES` or :const:`EAGAIN` (depending on the operating system; for " -"portability, check for both values). On at least some systems, :const:" -"`LOCK_EX` can only be used if the file descriptor refers to a file opened " -"for writing." +"Bitwise OR with any of the other three ``LOCK_*`` constants to make the " +"request non-blocking." msgstr "" -#: ../../library/fcntl.rst:171 +#: ../../library/fcntl.rst:175 +msgid "" +"If :const:`!LOCK_NB` is used and the lock cannot be acquired, an :exc:" +"`OSError` will be raised and the exception will have an *errno* attribute " +"set to :const:`~errno.EACCES` or :const:`~errno.EAGAIN` (depending on the " +"operating system; for portability, check for both values). On at least some " +"systems, :const:`!LOCK_EX` can only be used if the file descriptor refers to " +"a file opened for writing." +msgstr "" + +#: ../../library/fcntl.rst:182 msgid "" "*len* is the number of bytes to lock, *start* is the byte offset at which " "the lock starts, relative to *whence*, and *whence* is as with :func:`io." "IOBase.seek`, specifically:" msgstr "" -#: ../../library/fcntl.rst:175 +#: ../../library/fcntl.rst:186 msgid "``0`` -- relative to the start of the file (:const:`os.SEEK_SET`)" msgstr "" -#: ../../library/fcntl.rst:176 +#: ../../library/fcntl.rst:187 msgid "``1`` -- relative to the current buffer position (:const:`os.SEEK_CUR`)" msgstr "" -#: ../../library/fcntl.rst:177 +#: ../../library/fcntl.rst:188 msgid "``2`` -- relative to the end of the file (:const:`os.SEEK_END`)" msgstr "" -#: ../../library/fcntl.rst:179 +#: ../../library/fcntl.rst:190 msgid "" "The default for *start* is 0, which means to start at the beginning of the " "file. The default for *len* is 0 which means to lock to the end of the " "file. The default for *whence* is also 0." msgstr "" -#: ../../library/fcntl.rst:183 +#: ../../library/fcntl.rst:194 msgid "" "Raises an :ref:`auditing event ` ``fcntl.lockf`` with arguments " "``fd``, ``cmd``, ``len``, ``start``, ``whence``." @@ -278,11 +284,11 @@ msgstr "" "引發一個附帶引數 ``fd``、``cmd``、``len``、``start``、``whence`` 的\\ :ref:`" "稽核事件 ` ``fcntl.lockf``。" -#: ../../library/fcntl.rst:185 +#: ../../library/fcntl.rst:196 msgid "Examples (all on a SVR4 compliant system)::" msgstr "" -#: ../../library/fcntl.rst:195 +#: ../../library/fcntl.rst:206 msgid "" "Note that in the first example the return value variable *rv* will hold an " "integer value; in the second example it will hold a :class:`bytes` object. " @@ -290,11 +296,11 @@ msgid "" "therefore using the :func:`flock` call may be better." msgstr "" -#: ../../library/fcntl.rst:206 +#: ../../library/fcntl.rst:217 msgid "Module :mod:`os`" msgstr ":mod:`os` 模組" -#: ../../library/fcntl.rst:204 +#: ../../library/fcntl.rst:215 msgid "" "If the locking flags :const:`~os.O_SHLOCK` and :const:`~os.O_EXLOCK` are " "present in the :mod:`os` module (on BSD only), the :func:`os.open` function " diff --git a/library/random.po b/library/random.po index 2008e70ecc..f94d5dd21b 100644 --- a/library/random.po +++ b/library/random.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-29 00:03+0000\n" +"POT-Creation-Date: 2024-02-27 00:04+0000\n" "PO-Revision-Date: 2023-01-23 22:47+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -513,14 +513,15 @@ msgstr "" "a`` 時確保 N 為 ``b <= N <= a``。" #: ../../library/random.rst:303 +#, fuzzy msgid "" "The end-point value ``b`` may or may not be included in the range depending " -"on floating-point rounding in the equation ``a + (b-a) * random()``." +"on floating-point rounding in the expression ``a + (b-a) * random()``." msgstr "" "終點值 ``b`` 可能包含在範圍內,也可能不包含在範圍內,取決於方程式 ``a + (b-" "a) * random()`` 中的浮點捨入。" -#: ../../library/random.rst:309 +#: ../../library/random.rst:310 msgid "" "Return a random floating point number *N* such that ``low <= N <= high`` and " "with the specified *mode* between those bounds. The *low* and *high* bounds " @@ -531,7 +532,7 @@ msgstr "" "的 *mode*。*low* 和 *high* 邊界預設為零和一。*mode* 引數預設為邊界之間的中" "點,從而給出對稱分佈。" -#: ../../library/random.rst:317 +#: ../../library/random.rst:318 msgid "" "Beta distribution. Conditions on the parameters are ``alpha > 0`` and " "``beta > 0``. Returned values range between 0 and 1." @@ -539,7 +540,7 @@ msgstr "" "Beta(貝它)分布。參數的條件為 ``alpha > 0`` 和 ``beta > 0``。回傳值的範圍介" "於 0 和 1 之間。" -#: ../../library/random.rst:323 +#: ../../library/random.rst:324 msgid "" "Exponential distribution. *lambd* is 1.0 divided by the desired mean. It " "should be nonzero. (The parameter would be called \"lambda\", but that is a " @@ -551,11 +552,11 @@ msgstr "" "\"lambda\",但這是 Python 中的保留字)如果 *lambd* 為正,則回傳值的範圍從 0 " "到正無窮大;如果 *lambd* 為負,則回傳值的範圍從負無窮大到 0。" -#: ../../library/random.rst:329 +#: ../../library/random.rst:330 msgid "Added the default value for ``lambd``." msgstr "新增 ``lambd`` 的預設值。" -#: ../../library/random.rst:335 +#: ../../library/random.rst:336 msgid "" "Gamma distribution. (*Not* the gamma function!) The shape and scale " "parameters, *alpha* and *beta*, must have positive values. (Calling " @@ -565,11 +566,11 @@ msgstr "" "*alpha* 和 *beta* 必須具有正值。(根據呼叫習慣不同,部分來源會將 'beta' 定義" "為比例的倒數)。" -#: ../../library/random.rst:340 +#: ../../library/random.rst:341 msgid "The probability distribution function is::" msgstr "Probability distribution function(機率密度函式)是: ::" -#: ../../library/random.rst:349 +#: ../../library/random.rst:350 msgid "" "Normal distribution, also called the Gaussian distribution. *mu* is the " "mean, and *sigma* is the standard deviation. This is slightly faster than " @@ -578,7 +579,7 @@ msgstr "" "常態分佈,也稱為高斯分佈。*mu* 是平均數,*sigma* 是標準差。這比下面定義的 :" "func:`normalvariate` 函式快一點。" -#: ../../library/random.rst:354 +#: ../../library/random.rst:355 msgid "" "Multithreading note: When two threads call this function simultaneously, it " "is possible that they will receive the same return value. This can be " @@ -590,11 +591,11 @@ msgstr "" "可以透過三種方式避免。1)讓每個執行緒使用隨機數產生器的不同實例。2)在所有呼" "叫周圍加鎖。3)使用較慢但執行緒安全的 :func:`normalvariate` 函式代替。" -#: ../../library/random.rst:361 ../../library/random.rst:377 +#: ../../library/random.rst:362 ../../library/random.rst:378 msgid "*mu* and *sigma* now have default arguments." msgstr "*mu* 和 *sigma* 現在有預設引數。" -#: ../../library/random.rst:367 +#: ../../library/random.rst:368 msgid "" "Log normal distribution. If you take the natural logarithm of this " "distribution, you'll get a normal distribution with mean *mu* and standard " @@ -604,13 +605,13 @@ msgstr "" "對數常態分佈。如果你取此分佈的自然對數,你將獲得一個具有平均數 *mu* 和標準差 " "*sigma* 的常態分佈。*mu* 可以為任何值,並且 *sigma* 必須大於零。" -#: ../../library/random.rst:375 +#: ../../library/random.rst:376 msgid "" "Normal distribution. *mu* is the mean, and *sigma* is the standard " "deviation." msgstr "常態分佈。*mu* 是平均數,*sigma* 是標準差。" -#: ../../library/random.rst:383 +#: ../../library/random.rst:384 msgid "" "*mu* is the mean angle, expressed in radians between 0 and 2\\*\\ *pi*, and " "*kappa* is the concentration parameter, which must be greater than or equal " @@ -621,28 +622,28 @@ msgstr "" "大於或等於零。如果 *kappa* 等於零,則此分佈在 0 到 2\\*\\ *pi* 的範圍內將減小" "為均勻的隨機角度。" -#: ../../library/random.rst:391 +#: ../../library/random.rst:392 msgid "Pareto distribution. *alpha* is the shape parameter." msgstr "Pareto distribution(柏拉圖分佈)。*alpha* 是形狀參數。" -#: ../../library/random.rst:396 +#: ../../library/random.rst:397 msgid "" "Weibull distribution. *alpha* is the scale parameter and *beta* is the " "shape parameter." msgstr "" "Weibull distribution(韋伯分佈)。*alpha* 是比例參數,*beta* 是形狀參數。" -#: ../../library/random.rst:401 +#: ../../library/random.rst:402 msgid "Alternative Generator" msgstr "替代產生器" -#: ../../library/random.rst:405 +#: ../../library/random.rst:406 msgid "" "Class that implements the default pseudo-random number generator used by " "the :mod:`random` module." msgstr "實現 :mod:`random` 模組使用的預設偽隨機數產生器的 class。" -#: ../../library/random.rst:408 +#: ../../library/random.rst:409 msgid "" "Formerly the *seed* could be any hashable object. Now it is limited to: " "``None``, :class:`int`, :class:`float`, :class:`str`, :class:`bytes`, or :" @@ -651,14 +652,14 @@ msgstr "" "過去 *seed* 可以是任何可雜湊物件,但現在必須是以下類型之一:``None``、:class:" "`int`、:class:`float`、:class:`str`、:class:`bytes`、:class:`bytearray`。" -#: ../../library/random.rst:413 +#: ../../library/random.rst:414 msgid "" "Subclasses of :class:`!Random` should override the following methods if they " "wish to make use of a different basic generator:" msgstr "" "如果 :class:`!Random` 的子類別希望使用不同的基礎產生器,則應該覆寫以下方法:" -#: ../../library/random.rst:418 +#: ../../library/random.rst:419 msgid "" "Override this method in subclasses to customise the :meth:`~random.seed` " "behaviour of :class:`!Random` instances." @@ -666,7 +667,7 @@ msgstr "" "在子類別中覆寫此方法以自訂 :class:`!Random` 實例的 :meth:`~random.seed` 行" "為。" -#: ../../library/random.rst:423 +#: ../../library/random.rst:424 msgid "" "Override this method in subclasses to customise the :meth:`~random.getstate` " "behaviour of :class:`!Random` instances." @@ -674,7 +675,7 @@ msgstr "" "在子類別中覆寫此方法以自訂 :class:`!Random` 實例的 :meth:`~random.getstate` " "行為。" -#: ../../library/random.rst:428 +#: ../../library/random.rst:429 msgid "" "Override this method in subclasses to customise the :meth:`~random.setstate` " "behaviour of :class:`!Random` instances." @@ -682,7 +683,7 @@ msgstr "" "在子類別中覆寫此方法以自訂 :class:`!Random` 實例的 :meth:`~random.setstate` " "行為。" -#: ../../library/random.rst:433 +#: ../../library/random.rst:434 msgid "" "Override this method in subclasses to customise the :meth:`~random.random` " "behaviour of :class:`!Random` instances." @@ -690,12 +691,12 @@ msgstr "" "在子類別中覆寫此方法以自訂 :class:`!Random` 實例的 :meth:`~random.random` 行" "為。" -#: ../../library/random.rst:436 +#: ../../library/random.rst:437 msgid "" "Optionally, a custom generator subclass can also supply the following method:" msgstr "或者,自訂產生器子類別還可以提供以下方法:" -#: ../../library/random.rst:440 +#: ../../library/random.rst:441 msgid "" "Override this method in subclasses to customise the :meth:`~random." "getrandbits` behaviour of :class:`!Random` instances." @@ -703,7 +704,7 @@ msgstr "" "在子類別中覆寫此方法以自訂 :class:`!Random` 實例的 :meth:`~random." "getrandbits` 行為。" -#: ../../library/random.rst:446 +#: ../../library/random.rst:447 msgid "" "Class that uses the :func:`os.urandom` function for generating random " "numbers from sources provided by the operating system. Not available on all " @@ -717,11 +718,11 @@ msgstr "" "有效果且被忽略。如果呼叫 :meth:`getstate` 和 :meth:`setstate` 方法會引發 :" "exc:`NotImplementedError`。" -#: ../../library/random.rst:455 +#: ../../library/random.rst:456 msgid "Notes on Reproducibility" msgstr "關於 Reproducibility(復現性)的注意事項" -#: ../../library/random.rst:457 +#: ../../library/random.rst:458 msgid "" "Sometimes it is useful to be able to reproduce the sequences given by a " "pseudo-random number generator. By reusing a seed value, the same sequence " @@ -731,7 +732,7 @@ msgstr "" "有時,能夠重現偽隨機數產生器給出的序列很有用。只要多執行緒未運行,透過重複使" "用種子值,同一序列就應該可以被復現。" -#: ../../library/random.rst:461 +#: ../../library/random.rst:462 msgid "" "Most of the random module's algorithms and seeding functions are subject to " "change across Python versions, but two aspects are guaranteed not to change:" @@ -739,13 +740,13 @@ msgstr "" "大多數隨機 module 的演算法和 seed 設定函式在 Python 版本中可能會發生變化,但" "可以保證兩個方面不會改變:" -#: ../../library/random.rst:464 +#: ../../library/random.rst:465 msgid "" "If a new seeding method is added, then a backward compatible seeder will be " "offered." msgstr "如果增加了新的 seed 設定函式,則將提供向後相容的播種器 (seeder)。" -#: ../../library/random.rst:467 +#: ../../library/random.rst:468 msgid "" "The generator's :meth:`~Random.random` method will continue to produce the " "same sequence when the compatible seeder is given the same seed." @@ -753,19 +754,19 @@ msgstr "" "當相容的播種器被賦予相同的種子時,產生器的 :meth:`~Random.random` 方法將持續" "產生相同的序列。" -#: ../../library/random.rst:473 +#: ../../library/random.rst:474 msgid "Examples" msgstr "範例" -#: ../../library/random.rst:475 +#: ../../library/random.rst:476 msgid "Basic examples::" msgstr "基礎範例: ::" -#: ../../library/random.rst:503 +#: ../../library/random.rst:504 msgid "Simulations::" msgstr "模擬: ::" -#: ../../library/random.rst:528 +#: ../../library/random.rst:529 msgid "" "Example of `statistical bootstrapping `_ using resampling with replacement to estimate " @@ -775,7 +776,7 @@ msgstr "" "Bootstrapping_(statistics)>`_\\ 的範例,使用有重置的重新取樣來估計樣本平均數" "的信賴區間: ::" -#: ../../library/random.rst:541 +#: ../../library/random.rst:542 msgid "" "Example of a `resampling permutation test `_ to determine the statistical " @@ -787,12 +788,12 @@ msgstr "" "慰劑之間差異的統計學意義或 `p 值 `_\\ " ": ::" -#: ../../library/random.rst:568 +#: ../../library/random.rst:569 msgid "" "Simulation of arrival times and service deliveries for a multiserver queue::" msgstr "模擬多伺服器佇列 (queue) 的到達時間與服務交付: ::" -#: ../../library/random.rst:597 +#: ../../library/random.rst:598 msgid "" "`Statistics for Hackers `_ a " "video tutorial by `Jake Vanderplas `_ 製作的教" "學影片,僅使用幾個基本概念(包括模擬、取樣、洗牌、交叉驗證)進行統計分析。" -#: ../../library/random.rst:603 +#: ../../library/random.rst:604 msgid "" "`Economics Simulation `_ a simulation of a marketplace by `Peter Norvig `_ a tutorial by `Peter Norvig " @@ -827,11 +828,11 @@ msgstr "" "Probability.ipynb>`_\\ 為 `Peter Norvig `_ 的教" "學課程,涵蓋了機率理論的基礎知識與如何模擬以及使用 Python 執行數據分析。" -#: ../../library/random.rst:618 +#: ../../library/random.rst:619 msgid "Recipes" msgstr "使用方案" -#: ../../library/random.rst:620 +#: ../../library/random.rst:621 msgid "" "These recipes show how to efficiently make random selections from the " "combinatoric iterators in the :mod:`itertools` module:" @@ -839,7 +840,7 @@ msgstr "" "這些使用方案展示了如何有效地從 :mod:`itertools` 模組的組合疊代器 " "(combinatoric iterators) 中進行隨機選擇:" -#: ../../library/random.rst:652 +#: ../../library/random.rst:653 msgid "" "The default :func:`.random` returns multiples of 2⁻⁵³ in the range *0.0 ≤ x " "< 1.0*. All such numbers are evenly spaced and are exactly representable as " @@ -851,7 +852,7 @@ msgstr "" "均勻分佈的,並且可以完全表示為 Python float。但是,該間隔中的許多其他可表示" "的 float 不是可能的選擇。 例如 ``0.05954861408025609`` 不是 2⁻⁵³ 的整數倍。" -#: ../../library/random.rst:658 +#: ../../library/random.rst:659 msgid "" "The following recipe takes a different approach. All floats in the interval " "are possible selections. The mantissa comes from a uniform distribution of " @@ -863,7 +864,7 @@ msgstr "" "數 < 2⁵³* 範圍內的整數均勻分佈。指數來自幾何分佈,其中小於 *-53* 的指數的出現" "頻率是下一個較大指數的一半。" -#: ../../library/random.rst:680 +#: ../../library/random.rst:681 msgid "" "All :ref:`real valued distributions ` in the " "class will use the new method::" @@ -871,7 +872,7 @@ msgstr "" "Class 中的所有\\ :ref:`實數分佈 `\\ 都將使用新方" "法: ::" -#: ../../library/random.rst:689 +#: ../../library/random.rst:690 msgid "" "The recipe is conceptually equivalent to an algorithm that chooses from all " "the multiples of 2⁻¹⁰⁷⁴ in the range *0.0 ≤ x < 1.0*. All such numbers are " @@ -884,7 +885,7 @@ msgstr "" "示的 Python float。(2⁻¹⁰⁷⁴ 是最小為正的非正規化 float,等於 ``math." "ulp(0.0)``)" -#: ../../library/random.rst:698 +#: ../../library/random.rst:699 msgid "" "`Generating Pseudo-random Floating-Point Values `_ a paper by Allen B. Downey describing " diff --git a/library/threading.po b/library/threading.po index 2d8aba54e4..79afeb466f 100644 --- a/library/threading.po +++ b/library/threading.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-01 00:03+0000\n" +"POT-Creation-Date: 2024-02-27 00:04+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-" @@ -949,7 +949,7 @@ msgstr "" #: ../../library/threading.rst:741 ../../library/threading.rst:865 #: ../../library/threading.rst:911 ../../library/threading.rst:963 -#: ../../library/threading.rst:1034 +#: ../../library/threading.rst:1031 msgid "changed from a factory function to a class." msgstr "" @@ -1003,7 +1003,7 @@ msgid "" "it is ``False``." msgstr "" -#: ../../library/threading.rst:780 ../../library/threading.rst:999 +#: ../../library/threading.rst:780 ../../library/threading.rst:996 msgid "Previously, the method always returned ``None``." msgstr "" @@ -1248,31 +1248,25 @@ msgstr "" #: ../../library/threading.rst:986 msgid "" -"Block until the internal flag is true. If the internal flag is true on " -"entry, return immediately. Otherwise, block until another thread calls :" -"meth:`.set` to set the flag to true, or until the optional timeout occurs." +"Block as long as the internal flag is false and the timeout, if given, has " +"not expired. The return value represents the reason that this blocking " +"method returned; ``True`` if returning because the internal flag is set to " +"true, or ``False`` if a timeout is given and the the internal flag did not " +"become true within the given wait time." msgstr "" -#: ../../library/threading.rst:990 +#: ../../library/threading.rst:992 msgid "" "When the timeout argument is present and not ``None``, it should be a " -"floating point number specifying a timeout for the operation in seconds (or " -"fractions thereof)." -msgstr "" - -#: ../../library/threading.rst:994 -msgid "" -"This method returns ``True`` if and only if the internal flag has been set " -"to true, either before the wait call or after the wait starts, so it will " -"always return ``True`` except if a timeout is given and the operation times " -"out." +"floating point number specifying a timeout for the operation in seconds, or " +"fractions thereof." msgstr "" -#: ../../library/threading.rst:1006 +#: ../../library/threading.rst:1003 msgid "Timer Objects" msgstr "" -#: ../../library/threading.rst:1008 +#: ../../library/threading.rst:1005 msgid "" "This class represents an action that should be run only after a certain " "amount of time has passed --- a timer. :class:`Timer` is a subclass of :" @@ -1280,7 +1274,7 @@ msgid "" "threads." msgstr "" -#: ../../library/threading.rst:1012 +#: ../../library/threading.rst:1009 msgid "" "Timers are started, as with threads, by calling their :meth:`Timer.start " "` method. The timer can be stopped (before its action has " @@ -1289,14 +1283,14 @@ msgid "" "interval specified by the user." msgstr "" -#: ../../library/threading.rst:1018 +#: ../../library/threading.rst:1015 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/threading.rst:1029 +#: ../../library/threading.rst:1026 msgid "" "Create a timer that will run *function* with arguments *args* and keyword " "arguments *kwargs*, after *interval* seconds have passed. If *args* is " @@ -1304,17 +1298,17 @@ msgid "" "``None`` (the default) then an empty dict will be used." msgstr "" -#: ../../library/threading.rst:1039 +#: ../../library/threading.rst:1036 msgid "" "Stop the timer, and cancel the execution of the timer's action. This will " "only work if the timer is still in its waiting stage." msgstr "" -#: ../../library/threading.rst:1044 +#: ../../library/threading.rst:1041 msgid "Barrier Objects" msgstr "" -#: ../../library/threading.rst:1048 +#: ../../library/threading.rst:1045 msgid "" "This class provides a simple synchronization primitive for use by a fixed " "number of threads that need to wait for each other. Each of the threads " @@ -1323,18 +1317,18 @@ msgid "" "calls. At this point, the threads are released simultaneously." msgstr "" -#: ../../library/threading.rst:1054 +#: ../../library/threading.rst:1051 msgid "" "The barrier can be reused any number of times for the same number of threads." msgstr "" -#: ../../library/threading.rst:1056 +#: ../../library/threading.rst:1053 msgid "" "As an example, here is a simple way to synchronize a client and server " "thread::" msgstr "" -#: ../../library/threading.rst:1076 +#: ../../library/threading.rst:1073 msgid "" "Create a barrier object for *parties* number of threads. An *action*, when " "provided, is a callable to be called by one of the threads when they are " @@ -1342,7 +1336,7 @@ msgid "" "the :meth:`wait` method." msgstr "" -#: ../../library/threading.rst:1083 +#: ../../library/threading.rst:1080 msgid "" "Pass the barrier. When all the threads party to the barrier have called " "this function, they are all released simultaneously. If a *timeout* is " @@ -1350,44 +1344,44 @@ msgid "" "constructor." msgstr "" -#: ../../library/threading.rst:1088 +#: ../../library/threading.rst:1085 msgid "" "The return value is an integer in the range 0 to *parties* -- 1, different " "for each thread. This can be used to select a thread to do some special " "housekeeping, e.g.::" msgstr "" -#: ../../library/threading.rst:1097 +#: ../../library/threading.rst:1094 msgid "" "If an *action* was provided to the constructor, one of the threads will have " "called it prior to being released. Should this call raise an error, the " "barrier is put into the broken state." msgstr "" -#: ../../library/threading.rst:1101 +#: ../../library/threading.rst:1098 msgid "If the call times out, the barrier is put into the broken state." msgstr "" -#: ../../library/threading.rst:1103 +#: ../../library/threading.rst:1100 msgid "" "This method may raise a :class:`BrokenBarrierError` exception if the barrier " "is broken or reset while a thread is waiting." msgstr "" -#: ../../library/threading.rst:1108 +#: ../../library/threading.rst:1105 msgid "" "Return the barrier to the default, empty state. Any threads waiting on it " "will receive the :class:`BrokenBarrierError` exception." msgstr "" -#: ../../library/threading.rst:1111 +#: ../../library/threading.rst:1108 msgid "" "Note that using this function may require some external synchronization if " "there are other threads whose state is unknown. If a barrier is broken it " "may be better to just leave it and create a new one." msgstr "" -#: ../../library/threading.rst:1117 +#: ../../library/threading.rst:1114 msgid "" "Put the barrier into a broken state. This causes any active or future calls " "to :meth:`wait` to fail with the :class:`BrokenBarrierError`. Use this for " @@ -1395,36 +1389,36 @@ msgid "" "application." msgstr "" -#: ../../library/threading.rst:1122 +#: ../../library/threading.rst:1119 msgid "" "It may be preferable to simply create the barrier with a sensible *timeout* " "value to automatically guard against one of the threads going awry." msgstr "" -#: ../../library/threading.rst:1128 +#: ../../library/threading.rst:1125 msgid "The number of threads required to pass the barrier." msgstr "" -#: ../../library/threading.rst:1132 +#: ../../library/threading.rst:1129 msgid "The number of threads currently waiting in the barrier." msgstr "" -#: ../../library/threading.rst:1136 +#: ../../library/threading.rst:1133 msgid "A boolean that is ``True`` if the barrier is in the broken state." msgstr "" -#: ../../library/threading.rst:1141 +#: ../../library/threading.rst:1138 msgid "" "This exception, a subclass of :exc:`RuntimeError`, is raised when the :class:" "`Barrier` object is reset or broken." msgstr "" -#: ../../library/threading.rst:1148 +#: ../../library/threading.rst:1145 msgid "" "Using locks, conditions, and semaphores in the :keyword:`!with` statement" msgstr "" -#: ../../library/threading.rst:1150 +#: ../../library/threading.rst:1147 msgid "" "All of the objects provided by this module that have ``acquire`` and " "``release`` methods can be used as context managers for a :keyword:`with` " @@ -1433,11 +1427,11 @@ msgid "" "following snippet::" msgstr "" -#: ../../library/threading.rst:1159 +#: ../../library/threading.rst:1156 msgid "is equivalent to::" msgstr "" -#: ../../library/threading.rst:1167 +#: ../../library/threading.rst:1164 msgid "" "Currently, :class:`Lock`, :class:`RLock`, :class:`Condition`, :class:" "`Semaphore`, and :class:`BoundedSemaphore` objects may be used as :keyword:" diff --git a/whatsnew/2.1.po b/whatsnew/2.1.po index 5d11f76114..222ed68e82 100644 --- a/whatsnew/2.1.po +++ b/whatsnew/2.1.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 00:03+0000\n" +"POT-Creation-Date: 2024-02-27 00:04+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-" @@ -75,7 +75,7 @@ msgstr "" #: ../../whatsnew/2.1.rst:51 msgid "" -"The function :func:`g` will always raise a :exc:`NameError` exception, " +"The function :func:`!g` will always raise a :exc:`NameError` exception, " "because the binding of the name ``g`` isn't in either its local namespace or " "in the module-level namespace. This isn't much of a problem in practice " "(how often do you recursively define interior functions like this?), but " @@ -136,7 +136,7 @@ msgstr "" msgid "" "Line 4 containing the ``exec`` statement is a syntax error, since ``exec`` " "would define a new local variable named ``x`` whose value should be accessed " -"by :func:`g`." +"by :func:`!g`." msgstr "" #: ../../whatsnew/2.1.rst:109 @@ -211,7 +211,7 @@ msgstr "" msgid "" "In earlier versions, Python's support for implementing comparisons on user-" "defined classes and extension types was quite simple. Classes could " -"implement a :meth:`__cmp__` method that was given two instances of a class, " +"implement a :meth:`!__cmp__` method that was given two instances of a class, " "and could only return 0 if they were equal or +1 or -1 if they weren't; the " "method couldn't raise an exception or return anything other than a Boolean " "value. Users of Numeric Python often found this model too weak and " @@ -244,7 +244,8 @@ msgid "``<``" msgstr "``<``" #: ../../whatsnew/2.1.rst:181 -msgid ":meth:`__lt__`" +#, fuzzy +msgid ":meth:`~object.__lt__`" msgstr ":meth:`__lt__`" #: ../../whatsnew/2.1.rst:183 @@ -252,7 +253,8 @@ msgid "``<=``" msgstr "``<=``" #: ../../whatsnew/2.1.rst:183 -msgid ":meth:`__le__`" +#, fuzzy +msgid ":meth:`~object.__le__`" msgstr ":meth:`__le__`" #: ../../whatsnew/2.1.rst:185 @@ -260,7 +262,8 @@ msgid "``>``" msgstr "``>``" #: ../../whatsnew/2.1.rst:185 -msgid ":meth:`__gt__`" +#, fuzzy +msgid ":meth:`~object.__gt__`" msgstr ":meth:`__gt__`" #: ../../whatsnew/2.1.rst:187 @@ -268,7 +271,8 @@ msgid "``>=``" msgstr "``>=``" #: ../../whatsnew/2.1.rst:187 -msgid ":meth:`__ge__`" +#, fuzzy +msgid ":meth:`~object.__ge__`" msgstr ":meth:`__ge__`" #: ../../whatsnew/2.1.rst:189 @@ -276,7 +280,8 @@ msgid "``==``" msgstr "``==``" #: ../../whatsnew/2.1.rst:189 -msgid ":meth:`__eq__`" +#, fuzzy +msgid ":meth:`~object.__eq__`" msgstr ":meth:`__eq__`" #: ../../whatsnew/2.1.rst:191 @@ -284,7 +289,8 @@ msgid "``!=``" msgstr "``!=``" #: ../../whatsnew/2.1.rst:191 -msgid ":meth:`__ne__`" +#, fuzzy +msgid ":meth:`~object.__ne__`" msgstr ":meth:`__ne__`" #: ../../whatsnew/2.1.rst:194 @@ -316,7 +322,7 @@ msgid "" "and now accepts an optional argument specifying which comparison operation " "to use; this is given as one of the strings ``\"<\"``, ``\"<=\"``, " "``\">\"``, ``\">=\"``, ``\"==\"``, or ``\"!=\"``. If called without the " -"optional third argument, :func:`cmp` will only return -1, 0, or +1 as in " +"optional third argument, :func:`!cmp` will only return -1, 0, or +1 as in " "previous versions of Python; otherwise it will call the appropriate method " "and can return any Python object." msgstr "" @@ -368,7 +374,7 @@ msgstr "" #: ../../whatsnew/2.1.rst:248 msgid "" -"For example, in Python 2.1 the :mod:`regex` module is deprecated, so " +"For example, in Python 2.1 the :mod:`!regex` module is deprecated, so " "importing it causes a warning to be printed::" msgstr "" @@ -387,7 +393,7 @@ msgid "" "Filters can be added to disable certain warnings; a regular expression " "pattern can be applied to the message or to the module name in order to " "suppress a warning. For example, you may have a program that uses the :mod:" -"`regex` module and not want to spare the time to convert it to use the :mod:" +"`!regex` module and not want to spare the time to convert it to use the :mod:" "`re` module right now. The warning can be suppressed by calling ::" msgstr "" @@ -395,7 +401,7 @@ msgstr "" msgid "" "This adds a filter that will apply only to warnings of the class :class:" "`DeprecationWarning` triggered in the :mod:`__main__` module, and applies a " -"regular expression to only match the message about the :mod:`regex` module " +"regular expression to only match the message about the :mod:`!regex` module " "being deprecated, and will cause such warnings to be ignored. Warnings can " "also be printed only once, printed every time the offending code is " "executed, or turned into exceptions that will cause the program to stop " @@ -512,8 +518,9 @@ msgid "" "This version works for simple things such as integers, but it has a side " "effect; the ``_cache`` dictionary holds a reference to the return values, so " "they'll never be deallocated until the Python process exits and cleans up. " -"This isn't very noticeable for integers, but if :func:`f` returns an object, " -"or a data structure that takes up a lot of memory, this can be a problem." +"This isn't very noticeable for integers, but if :func:`!f` returns an " +"object, or a data structure that takes up a lot of memory, this can be a " +"problem." msgstr "" #: ../../whatsnew/2.1.rst:374 @@ -530,7 +537,7 @@ msgstr "" #: ../../whatsnew/2.1.rst:382 msgid "" -"This makes it possible to write a :func:`memoize` function whose cache " +"This makes it possible to write a :func:`!memoize` function whose cache " "doesn't keep objects alive, by storing weak references in the cache. ::" msgstr "" @@ -541,7 +548,7 @@ msgid "" "deallocated -- but instead of requiring an explicit call to retrieve the " "object, the proxy transparently forwards all operations to the object as " "long as the object still exists. If the object is deallocated, attempting " -"to use a proxy will cause a :exc:`weakref.ReferenceError` exception to be " +"to use a proxy will cause a :exc:`!weakref.ReferenceError` exception to be " "raised. ::" msgstr "" @@ -583,7 +590,7 @@ msgid "" "`~object.__dict__`. Unlike the :attr:`~object.__dict__` attribute of class " "instances, in functions you can actually assign a new dictionary to :attr:" "`~object.__dict__`, though the new value is restricted to a regular Python " -"dictionary; you *can't* be tricky and set it to a :class:`UserDict` " +"dictionary; you *can't* be tricky and set it to a :class:`!UserDict` " "instance, or any other random object that behaves like a mapping." msgstr "" @@ -739,11 +746,11 @@ msgstr "" #: ../../whatsnew/2.1.rst:587 msgid "" -"Ka-Ping Yee contributed two new modules: :mod:`inspect.py`, a module for " -"getting information about live Python code, and :mod:`pydoc.py`, a module " +"Ka-Ping Yee contributed two new modules: :mod:`!inspect.py`, a module for " +"getting information about live Python code, and :mod:`!pydoc.py`, a module " "for interactively converting docstrings to HTML or text. As a bonus, :file:" -"`Tools/scripts/pydoc`, which is now automatically installed, uses :mod:" -"`pydoc.py` to display documentation given a Python module, package, or class " +"`Tools/scripts/pydoc`, which is now automatically installed, uses :mod:`!" +"pydoc.py` to display documentation given a Python module, package, or class " "name. For example, ``pydoc xml.dom`` displays the following::" msgstr "" @@ -766,12 +773,12 @@ msgstr "" #: ../../whatsnew/2.1.rst:620 msgid "" -"The :mod:`difflib` module contains a class, :class:`SequenceMatcher`, which " -"compares two sequences and computes the changes required to transform one " -"sequence into the other. For example, this module can be used to write a " -"tool similar to the Unix :program:`diff` program, and in fact the sample " -"program :file:`Tools/scripts/ndiff.py` demonstrates how to write such a " -"script." +"The :mod:`difflib` module contains a class, :class:`~difflib." +"SequenceMatcher`, which compares two sequences and computes the changes " +"required to transform one sequence into the other. For example, this module " +"can be used to write a tool similar to the Unix :program:`diff` program, and " +"in fact the sample program :file:`Tools/scripts/ndiff.py` demonstrates how " +"to write such a script." msgstr "" #: ../../whatsnew/2.1.rst:626 @@ -789,7 +796,7 @@ msgid "" "Python 2.1 includes an updated version of the :mod:`xml` package. Some of " "the noteworthy changes include support for Expat 1.2 and later versions, the " "ability for Expat parsers to handle files in any encoding supported by " -"Python, and various bugfixes for SAX, DOM, and the :mod:`minidom` module." +"Python, and various bugfixes for SAX, DOM, and the :mod:`!minidom` module." msgstr "" #: ../../whatsnew/2.1.rst:638 @@ -806,14 +813,15 @@ msgstr "" #: ../../whatsnew/2.1.rst:646 msgid "" -"Various functions in the :mod:`time` module, such as :func:`asctime` and :" -"func:`localtime`, require a floating point argument containing the time in " -"seconds since the epoch. The most common use of these functions is to work " -"with the current time, so the floating point argument has been made " -"optional; when a value isn't provided, the current time will be used. For " -"example, log file entries usually need a string containing the current time; " -"in Python 2.1, ``time.asctime()`` can be used, instead of the lengthier " -"``time.asctime(time.localtime(time.time()))`` that was previously required." +"Various functions in the :mod:`time` module, such as :func:`~time.asctime` " +"and :func:`~time.localtime`, require a floating point argument containing " +"the time in seconds since the epoch. The most common use of these functions " +"is to work with the current time, so the floating point argument has been " +"made optional; when a value isn't provided, the current time will be used. " +"For example, log file entries usually need a string containing the current " +"time; in Python 2.1, ``time.asctime()`` can be used, instead of the " +"lengthier ``time.asctime(time.localtime(time.time()))`` that was previously " +"required." msgstr "" #: ../../whatsnew/2.1.rst:655 @@ -921,11 +929,11 @@ msgstr "" #: ../../whatsnew/2.1.rst:726 msgid "" "A new module and method for file objects was also added, contributed by Jeff " -"Epler. The new method, :meth:`xreadlines`, is similar to the existing :func:" -"`xrange` built-in. :func:`xreadlines` returns an opaque sequence object " +"Epler. The new method, :meth:`!xreadlines`, is similar to the existing :func:" +"`!xrange` built-in. :func:`!xreadlines` returns an opaque sequence object " "that only supports being iterated over, reading a line on every iteration " -"but not reading the entire file into memory as the existing :meth:" -"`readlines` method does. You'd use it like this::" +"but not reading the entire file into memory as the existing :meth:`!" +"readlines` method does. You'd use it like this::" msgstr "" #: ../../whatsnew/2.1.rst:737 @@ -937,7 +945,7 @@ msgstr "" #: ../../whatsnew/2.1.rst:740 msgid "" -"A new method, :meth:`popitem`, was added to dictionaries to enable " +"A new method, :meth:`~dict.popitem`, was added to dictionaries to enable " "destructively iterating through the contents of a dictionary; this can be " "faster for large dictionaries because there's no need to construct a list " "containing all the keys or values. ``D.popitem()`` removes a random ``(key, " From d70e91819678b99e1f4f3fafd4031d4d320a5323 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 27 Feb 2024 16:53:02 +0000 Subject: [PATCH 22/33] sync with cpython 3af945fb --- library/time.po | 336 ++++++++++++++++++++++++++---------------------- 1 file changed, 180 insertions(+), 156 deletions(-) diff --git a/library/time.po b/library/time.po index a1e21ae69a..c9dd3924b6 100644 --- a/library/time.po +++ b/library/time.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-14 15:34+0000\n" +"POT-Creation-Date: 2024-02-27 16:51+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-" @@ -235,9 +235,9 @@ msgstr "" #: ../../library/time.rst:161 ../../library/time.rst:174 #: ../../library/time.rst:183 ../../library/time.rst:196 -#: ../../library/time.rst:205 ../../library/time.rst:707 -#: ../../library/time.rst:824 ../../library/time.rst:843 -#: ../../library/time.rst:871 ../../library/time.rst:906 +#: ../../library/time.rst:205 ../../library/time.rst:717 +#: ../../library/time.rst:834 ../../library/time.rst:853 +#: ../../library/time.rst:881 ../../library/time.rst:916 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -589,193 +589,217 @@ msgid "Day of the month as a decimal number [01,31]." msgstr "" #: ../../library/time.rst:431 +msgid "``%f``" +msgstr "" + +#: ../../library/time.rst:432 +msgid "Microseconds as a decimal number" +msgstr "" + +#: ../../library/time.rst:432 +msgid "[000000,999999]." +msgstr "" + +#: ../../library/time.rst:431 +msgid "\\(1)" +msgstr "\\(1)" + +#: ../../library/time.rst:435 msgid "``%H``" msgstr "``%H``" -#: ../../library/time.rst:431 +#: ../../library/time.rst:435 msgid "Hour (24-hour clock) as a decimal number [00,23]." msgstr "" -#: ../../library/time.rst:434 +#: ../../library/time.rst:438 msgid "``%I``" msgstr "``%I``" -#: ../../library/time.rst:434 +#: ../../library/time.rst:438 msgid "Hour (12-hour clock) as a decimal number [01,12]." msgstr "" -#: ../../library/time.rst:437 +#: ../../library/time.rst:441 msgid "``%j``" msgstr "``%j``" -#: ../../library/time.rst:437 +#: ../../library/time.rst:441 msgid "Day of the year as a decimal number [001,366]." msgstr "" -#: ../../library/time.rst:440 +#: ../../library/time.rst:444 msgid "``%m``" msgstr "``%m``" -#: ../../library/time.rst:440 +#: ../../library/time.rst:444 msgid "Month as a decimal number [01,12]." msgstr "" -#: ../../library/time.rst:443 +#: ../../library/time.rst:447 msgid "``%M``" msgstr "``%M``" -#: ../../library/time.rst:443 +#: ../../library/time.rst:447 msgid "Minute as a decimal number [00,59]." msgstr "" -#: ../../library/time.rst:446 +#: ../../library/time.rst:450 msgid "``%p``" msgstr "``%p``" -#: ../../library/time.rst:446 +#: ../../library/time.rst:450 msgid "Locale's equivalent of either AM or PM." msgstr "" -#: ../../library/time.rst:446 -msgid "\\(1)" -msgstr "\\(1)" +#: ../../library/time.rst:450 +msgid "\\(2)" +msgstr "\\(2)" -#: ../../library/time.rst:449 +#: ../../library/time.rst:453 msgid "``%S``" msgstr "``%S``" -#: ../../library/time.rst:449 +#: ../../library/time.rst:453 msgid "Second as a decimal number [00,61]." msgstr "" -#: ../../library/time.rst:449 -msgid "\\(2)" -msgstr "\\(2)" +#: ../../library/time.rst:453 +msgid "\\(3)" +msgstr "\\(3)" -#: ../../library/time.rst:452 +#: ../../library/time.rst:456 msgid "``%U``" msgstr "``%U``" -#: ../../library/time.rst:452 +#: ../../library/time.rst:456 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 " "considered to be in week 0." msgstr "" -#: ../../library/time.rst:452 ../../library/time.rst:463 -msgid "\\(3)" -msgstr "\\(3)" +#: ../../library/time.rst:456 ../../library/time.rst:467 +msgid "\\(4)" +msgstr "" -#: ../../library/time.rst:460 +#: ../../library/time.rst:464 msgid "``%w``" msgstr "``%w``" -#: ../../library/time.rst:460 +#: ../../library/time.rst:464 msgid "Weekday as a decimal number [0(Sunday),6]." msgstr "" -#: ../../library/time.rst:463 +#: ../../library/time.rst:467 msgid "``%W``" msgstr "``%W``" -#: ../../library/time.rst:463 +#: ../../library/time.rst:467 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 " "considered to be in week 0." msgstr "" -#: ../../library/time.rst:471 +#: ../../library/time.rst:475 msgid "``%x``" msgstr "``%x``" -#: ../../library/time.rst:471 +#: ../../library/time.rst:475 msgid "Locale's appropriate date representation." msgstr "" -#: ../../library/time.rst:474 +#: ../../library/time.rst:478 msgid "``%X``" msgstr "``%X``" -#: ../../library/time.rst:474 +#: ../../library/time.rst:478 msgid "Locale's appropriate time representation." msgstr "" -#: ../../library/time.rst:477 +#: ../../library/time.rst:481 msgid "``%y``" msgstr "``%y``" -#: ../../library/time.rst:477 +#: ../../library/time.rst:481 msgid "Year without century as a decimal number [00,99]." msgstr "" -#: ../../library/time.rst:480 +#: ../../library/time.rst:484 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/time.rst:480 +#: ../../library/time.rst:484 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/time.rst:483 +#: ../../library/time.rst:487 msgid "``%z``" msgstr "``%z``" -#: ../../library/time.rst:483 +#: ../../library/time.rst:487 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 " "represents decimal minute digits [-23:59, +23:59]. [1]_" msgstr "" -#: ../../library/time.rst:489 +#: ../../library/time.rst:493 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/time.rst:489 +#: ../../library/time.rst:493 msgid "Time zone name (no characters if no time zone exists). Deprecated. [1]_" msgstr "" -#: ../../library/time.rst:492 +#: ../../library/time.rst:496 msgid "``%%``" msgstr "``%%``" -#: ../../library/time.rst:492 +#: ../../library/time.rst:496 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/time.rst:495 +#: ../../library/time.rst:499 msgid "Notes:" msgstr "註解:" -#: ../../library/time.rst:498 +#: ../../library/time.rst:502 +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 `." +msgstr "" + +#: ../../library/time.rst:508 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 " "hour." msgstr "" -#: ../../library/time.rst:504 +#: ../../library/time.rst:514 msgid "" "The range really is ``0`` to ``61``; value ``60`` is valid in timestamps " "representing `leap seconds`_ and value ``61`` is supported for historical " "reasons." msgstr "" -#: ../../library/time.rst:509 +#: ../../library/time.rst:519 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." msgstr "" -#: ../../library/time.rst:512 +#: ../../library/time.rst:522 msgid "" "Here is an example, a format for dates compatible with that specified in " "the :rfc:`2822` Internet email standard. [1]_ ::" msgstr "" -#: ../../library/time.rst:519 +#: ../../library/time.rst:529 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 " @@ -783,7 +807,7 @@ msgid "" "`strftime(3)` documentation." msgstr "" -#: ../../library/time.rst:524 +#: ../../library/time.rst:534 msgid "" "On some platforms, an optional field width and precision specification can " "immediately follow the initial ``'%'`` of a directive in the following " @@ -791,13 +815,13 @@ msgid "" "``%j`` where it is 3." msgstr "" -#: ../../library/time.rst:535 +#: ../../library/time.rst:545 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 "" -#: ../../library/time.rst:539 +#: ../../library/time.rst:549 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 " @@ -808,11 +832,11 @@ msgid "" "Both *string* and *format* must be strings." msgstr "" -#: ../../library/time.rst:547 +#: ../../library/time.rst:557 msgid "For example:" msgstr "" -#: ../../library/time.rst:554 +#: ../../library/time.rst:564 msgid "" "Support for the ``%Z`` directive is based on the values contained in " "``tzname`` and whether ``daylight`` is true. Because of this, it is " @@ -820,7 +844,7 @@ msgid "" "(and are considered to be non-daylight savings timezones)." msgstr "" -#: ../../library/time.rst:559 +#: ../../library/time.rst:569 msgid "" "Only the directives specified in the documentation are supported. Because " "``strftime()`` is implemented per platform it can sometimes offer more " @@ -829,7 +853,7 @@ msgid "" "are not documented as supported." msgstr "" -#: ../../library/time.rst:568 +#: ../../library/time.rst:578 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 " @@ -837,109 +861,109 @@ msgid "" "The following values are present:" msgstr "" -#: ../../library/time.rst:575 +#: ../../library/time.rst:585 msgid "Index" msgstr "" -#: ../../library/time.rst:576 +#: ../../library/time.rst:586 msgid "Attribute" msgstr "屬性" -#: ../../library/time.rst:577 +#: ../../library/time.rst:587 msgid "Values" msgstr "" -#: ../../library/time.rst:579 +#: ../../library/time.rst:589 msgid "0" msgstr "0" -#: ../../library/time.rst:581 +#: ../../library/time.rst:591 msgid "(for example, 1993)" msgstr "(例如 1993)" -#: ../../library/time.rst:583 +#: ../../library/time.rst:593 msgid "1" msgstr "1" -#: ../../library/time.rst:585 +#: ../../library/time.rst:595 msgid "range [1, 12]" msgstr "" -#: ../../library/time.rst:587 +#: ../../library/time.rst:597 msgid "2" msgstr "2" -#: ../../library/time.rst:589 +#: ../../library/time.rst:599 msgid "range [1, 31]" msgstr "" -#: ../../library/time.rst:591 +#: ../../library/time.rst:601 msgid "3" msgstr "3" -#: ../../library/time.rst:593 +#: ../../library/time.rst:603 msgid "range [0, 23]" msgstr "" -#: ../../library/time.rst:595 +#: ../../library/time.rst:605 msgid "4" msgstr "4" -#: ../../library/time.rst:597 +#: ../../library/time.rst:607 msgid "range [0, 59]" msgstr "" -#: ../../library/time.rst:599 +#: ../../library/time.rst:609 msgid "5" msgstr "5" -#: ../../library/time.rst:601 +#: ../../library/time.rst:611 msgid "range [0, 61]; see :ref:`Note (2) ` in :func:`strftime`" msgstr "" -#: ../../library/time.rst:603 +#: ../../library/time.rst:613 msgid "6" msgstr "6" -#: ../../library/time.rst:605 +#: ../../library/time.rst:615 msgid "range [0, 6]; Monday is 0" msgstr "" -#: ../../library/time.rst:607 +#: ../../library/time.rst:617 msgid "7" msgstr "7" -#: ../../library/time.rst:609 +#: ../../library/time.rst:619 msgid "range [1, 366]" msgstr "" -#: ../../library/time.rst:611 +#: ../../library/time.rst:621 msgid "8" msgstr "8" -#: ../../library/time.rst:613 +#: ../../library/time.rst:623 msgid "0, 1 or -1; see below" msgstr "" -#: ../../library/time.rst:615 ../../library/time.rst:619 +#: ../../library/time.rst:625 ../../library/time.rst:629 msgid "N/A" msgstr "N/A" -#: ../../library/time.rst:617 +#: ../../library/time.rst:627 msgid "abbreviation of timezone name" msgstr "" -#: ../../library/time.rst:621 +#: ../../library/time.rst:631 msgid "offset east of UTC in seconds" msgstr "" -#: ../../library/time.rst:623 +#: ../../library/time.rst:633 msgid "" "Note that unlike the C structure, the month value is a range of [1, 12], not " "[0, 11]." msgstr "" -#: ../../library/time.rst:626 +#: ../../library/time.rst:636 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 " @@ -947,14 +971,14 @@ msgid "" "filled in." msgstr "" -#: ../../library/time.rst:630 +#: ../../library/time.rst:640 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." msgstr "" -#: ../../library/time.rst:636 +#: ../../library/time.rst:646 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 " @@ -963,7 +987,7 @@ msgid "" "org/wiki/Unix_time>`_." msgstr "" -#: ../../library/time.rst:642 +#: ../../library/time.rst:652 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. " @@ -972,7 +996,7 @@ msgid "" "between the two calls." msgstr "" -#: ../../library/time.rst:648 +#: ../../library/time.rst:658 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 :" @@ -982,19 +1006,19 @@ msgid "" "attributes." msgstr "" -#: ../../library/time.rst:655 +#: ../../library/time.rst:665 msgid "" "Use :func:`time_ns` to avoid the precision loss caused by the :class:`float` " "type." msgstr "" -#: ../../library/time.rst:661 +#: ../../library/time.rst:671 msgid "" "Similar to :func:`~time.time` but returns time as an integer number of " "nanoseconds since the epoch_." msgstr "" -#: ../../library/time.rst:674 +#: ../../library/time.rst:684 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 " @@ -1003,25 +1027,25 @@ msgid "" "of two calls in the same thread is valid." msgstr "" -#: ../../library/time.rst:680 +#: ../../library/time.rst:690 msgid "" "Use :func:`thread_time_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: ../../library/time.rst:683 +#: ../../library/time.rst:693 msgid ":ref:`Availability `: Linux, Unix, Windows." msgstr ":ref:`適用 `:Linux、Unix、Windows。" -#: ../../library/time.rst:685 +#: ../../library/time.rst:695 msgid "Unix systems supporting ``CLOCK_THREAD_CPUTIME_ID``." msgstr "" -#: ../../library/time.rst:692 +#: ../../library/time.rst:702 msgid "Similar to :func:`thread_time` but return time as nanoseconds." msgstr "" -#: ../../library/time.rst:699 +#: ../../library/time.rst:709 msgid "" "Reset the time conversion rules used by the library routines. The " "environment variable :envvar:`TZ` specifies how this is done. It will also " @@ -1032,42 +1056,42 @@ msgid "" "when daylight saving time applies)." msgstr "" -#: ../../library/time.rst:711 +#: ../../library/time.rst:721 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." msgstr "" -#: ../../library/time.rst:715 +#: ../../library/time.rst:725 msgid "The :envvar:`TZ` environment variable should contain no whitespace." msgstr "" -#: ../../library/time.rst:717 +#: ../../library/time.rst:727 msgid "" "The standard format of the :envvar:`TZ` environment variable is (whitespace " "added for clarity)::" msgstr "" -#: ../../library/time.rst:722 +#: ../../library/time.rst:732 msgid "Where the components are:" msgstr "" -#: ../../library/time.rst:726 +#: ../../library/time.rst:736 msgid "``std`` and ``dst``" msgstr "``std`` 和 ``dst``" -#: ../../library/time.rst:725 +#: ../../library/time.rst:735 msgid "" "Three or more alphanumerics giving the timezone abbreviations. These will be " "propagated into time.tzname" msgstr "" -#: ../../library/time.rst:732 +#: ../../library/time.rst:742 msgid "``offset``" msgstr "``offset``" -#: ../../library/time.rst:729 +#: ../../library/time.rst:739 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 " @@ -1075,41 +1099,41 @@ msgid "" "summer time is assumed to be one hour ahead of standard time." msgstr "" -#: ../../library/time.rst:754 +#: ../../library/time.rst:764 msgid "``start[/time], end[/time]``" msgstr "``start[/time], end[/time]``" -#: ../../library/time.rst:735 +#: ../../library/time.rst:745 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:740 +#: ../../library/time.rst:750 msgid ":samp:`J{n}`" msgstr ":samp:`J{n}`" -#: ../../library/time.rst:739 +#: ../../library/time.rst:749 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." msgstr "" -#: ../../library/time.rst:744 +#: ../../library/time.rst:754 msgid ":samp:`{n}`" msgstr ":samp:`{n}`" -#: ../../library/time.rst:743 +#: ../../library/time.rst:753 msgid "" "The zero-based Julian day (0 <= *n* <= 365). Leap days are counted, and it " "is possible to refer to February 29." msgstr "" -#: ../../library/time.rst:751 +#: ../../library/time.rst:761 msgid ":samp:`M{m}.{n}.{d}`" msgstr ":samp:`M{m}.{n}.{d}`" -#: ../../library/time.rst:747 +#: ../../library/time.rst:757 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 " @@ -1117,13 +1141,13 @@ msgid "" "first week in which the *d*'th day occurs. Day zero is a Sunday." msgstr "" -#: ../../library/time.rst:753 +#: ../../library/time.rst:763 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." msgstr "" -#: ../../library/time.rst:767 +#: ../../library/time.rst:777 msgid "" "On many Unix systems (including \\*BSD, Linux, Solaris, and Darwin), it is " "more convenient to use the system's zoneinfo (:manpage:`tzfile(5)`) " @@ -1134,23 +1158,23 @@ msgid "" "``'Australia/Melbourne'``, ``'Egypt'`` or ``'Europe/Amsterdam'``. ::" msgstr "" -#: ../../library/time.rst:788 +#: ../../library/time.rst:798 msgid "Clock ID Constants" msgstr "" -#: ../../library/time.rst:790 +#: ../../library/time.rst:800 msgid "" "These constants are used as parameters for :func:`clock_getres` and :func:" "`clock_gettime`." msgstr "" -#: ../../library/time.rst:795 +#: ../../library/time.rst:805 msgid "" "Identical to :data:`CLOCK_MONOTONIC`, except it also includes any time that " "the system is suspended." msgstr "" -#: ../../library/time.rst:798 +#: ../../library/time.rst:808 msgid "" "This allows applications to get a suspend-aware monotonic clock without " "having to deal with the complications of :data:`CLOCK_REALTIME`, which may " @@ -1158,103 +1182,103 @@ msgid "" "similar." msgstr "" -#: ../../library/time.rst:803 +#: ../../library/time.rst:813 msgid ":ref:`Availability `: Linux >= 2.6.39." msgstr ":ref:`適用 `:Linux 2.6.39 以上。" -#: ../../library/time.rst:810 +#: ../../library/time.rst:820 msgid "" "The Solaris OS has a ``CLOCK_HIGHRES`` timer that attempts to use an optimal " "hardware source, and may give close to nanosecond resolution. " "``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock." msgstr "" -#: ../../library/time.rst:814 +#: ../../library/time.rst:824 msgid ":ref:`Availability `: Solaris." msgstr ":ref:`適用 `:Solaris。" -#: ../../library/time.rst:821 +#: ../../library/time.rst:831 msgid "" "Clock that cannot be set and represents monotonic time since some " "unspecified starting point." msgstr "" -#: ../../library/time.rst:831 +#: ../../library/time.rst:841 msgid "" "Similar to :data:`CLOCK_MONOTONIC`, but provides access to a raw hardware-" "based time that is not subject to NTP adjustments." msgstr "" -#: ../../library/time.rst:834 +#: ../../library/time.rst:844 msgid ":ref:`Availability `: Linux >= 2.6.28, macOS >= 10.12." msgstr ":ref:`適用 `:Linux 2.6.28 以上、macOS 10.12 以上。" -#: ../../library/time.rst:841 ../../library/time.rst:850 +#: ../../library/time.rst:851 ../../library/time.rst:860 msgid "High-resolution per-process timer from the CPU." msgstr "" -#: ../../library/time.rst:852 +#: ../../library/time.rst:862 msgid ":ref:`Availability `: FreeBSD, NetBSD >= 7, OpenBSD." msgstr ":ref:`適用 `:FreeBSD、NetBSD 7 以上、OpenBSD。" -#: ../../library/time.rst:858 +#: ../../library/time.rst:868 msgid "" "`International Atomic Time `_" msgstr "" -#: ../../library/time.rst:860 +#: ../../library/time.rst:870 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 "" -#: ../../library/time.rst:863 +#: ../../library/time.rst:873 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/time.rst:869 +#: ../../library/time.rst:879 msgid "Thread-specific CPU-time clock." msgstr "" -#: ../../library/time.rst:878 +#: ../../library/time.rst:888 msgid "" "Time whose absolute value is the time the system has been running and not " "suspended, providing accurate uptime measurement, both absolute and interval." msgstr "" -#: ../../library/time.rst:882 +#: ../../library/time.rst:892 msgid ":ref:`Availability `: FreeBSD, OpenBSD >= 5.5." msgstr ":ref:`適用 `:FreeBSD、OpenBSD 5.5 以上。" -#: ../../library/time.rst:889 +#: ../../library/time.rst:899 msgid "" "Clock that increments monotonically, tracking the time since an arbitrary " "point, unaffected by frequency or time adjustments and not incremented while " "the system is asleep." msgstr "" -#: ../../library/time.rst:893 +#: ../../library/time.rst:903 msgid ":ref:`Availability `: macOS >= 10.12." msgstr ":ref:`適用 `:macOS 10.12 以上。" -#: ../../library/time.rst:897 +#: ../../library/time.rst:907 msgid "" "The following constant is the only parameter that can be sent to :func:" "`clock_settime`." msgstr "" -#: ../../library/time.rst:903 +#: ../../library/time.rst:913 msgid "" "System-wide real-time clock. Setting this clock requires appropriate " "privileges." msgstr "" -#: ../../library/time.rst:914 +#: ../../library/time.rst:924 msgid "Timezone Constants" msgstr "" -#: ../../library/time.rst:918 +#: ../../library/time.rst:928 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 " @@ -1262,25 +1286,25 @@ msgid "" "nonzero. See note below." msgstr "" -#: ../../library/time.rst:924 +#: ../../library/time.rst:934 msgid "Nonzero if a DST timezone is defined. See note below." msgstr "" -#: ../../library/time.rst:928 +#: ../../library/time.rst:938 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 " "below." msgstr "" -#: ../../library/time.rst:933 +#: ../../library/time.rst:943 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 " "defined, the second string should not be used. See note below." msgstr "" -#: ../../library/time.rst:939 +#: ../../library/time.rst:949 msgid "" "For the above Timezone constants (:data:`altzone`, :data:`daylight`, :data:" "`timezone`, and :data:`tzname`), the value is determined by the timezone " @@ -1290,40 +1314,40 @@ msgid "" "func:`localtime` to obtain timezone information." msgstr "" -#: ../../library/time.rst:949 +#: ../../library/time.rst:959 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/time.rst:949 +#: ../../library/time.rst:959 msgid "More object-oriented interface to dates and times." msgstr "" -#: ../../library/time.rst:953 +#: ../../library/time.rst:963 msgid "Module :mod:`locale`" msgstr ":mod:`locale` 模組" -#: ../../library/time.rst:952 +#: ../../library/time.rst:962 msgid "" "Internationalization services. The locale setting affects the " "interpretation of many format specifiers in :func:`strftime` and :func:" "`strptime`." msgstr "" -#: ../../library/time.rst:956 +#: ../../library/time.rst:966 msgid "Module :mod:`calendar`" msgstr ":mod:`calendar` 模組" -#: ../../library/time.rst:956 +#: ../../library/time.rst:966 msgid "" "General calendar-related functions. :func:`~calendar.timegm` is the " "inverse of :func:`gmtime` from this module." msgstr "" -#: ../../library/time.rst:960 +#: ../../library/time.rst:970 msgid "Footnotes" msgstr "註解" -#: ../../library/time.rst:961 +#: ../../library/time.rst:971 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. " @@ -1363,23 +1387,23 @@ msgid "Daylight Saving Time" msgstr "Daylight Saving Time(日光節約時間)" #: ../../library/time.rst:310 ../../library/time.rst:336 -#: ../../library/time.rst:669 +#: ../../library/time.rst:679 msgid "benchmarking" msgstr "benchmarking(基準測試)" -#: ../../library/time.rst:336 ../../library/time.rst:669 +#: ../../library/time.rst:336 ../../library/time.rst:679 msgid "CPU time" msgstr "CPU time(CPU 時間)" -#: ../../library/time.rst:336 ../../library/time.rst:669 +#: ../../library/time.rst:336 ../../library/time.rst:679 msgid "processor time" msgstr "processor time(處理器時間)" -#: ../../library/time.rst:394 ../../library/time.rst:530 +#: ../../library/time.rst:394 ../../library/time.rst:540 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/time.rst:394 ../../library/time.rst:530 +#: ../../library/time.rst:394 ../../library/time.rst:540 msgid "datetime format" msgstr "datetime format(日期時間格式)" From d42ad8141e9e3110faf695e93522d35112872fda Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 29 Feb 2024 00:04:40 +0000 Subject: [PATCH 23/33] sync with cpython d4a1c8e6 --- library/enum.po | 181 +++++++++++++++++----------------- library/itertools.po | 6 +- library/pprint.po | 224 +++++++++++++++++++++---------------------- 3 files changed, 210 insertions(+), 201 deletions(-) diff --git a/library/enum.po b/library/enum.po index bb0f15eaa9..c51df46328 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-10 00:03+0000\n" +"POT-Creation-Date: 2024-02-29 00:03+0000\n" "PO-Revision-Date: 2023-09-11 14:08+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -601,7 +601,16 @@ msgid "" "results in the call ``int('1a', 16)`` and a value of ``17`` for the member." msgstr "" -#: ../../library/enum.rst:395 +#: ../../library/enum.rst:393 +msgid "" +"..note:: When writing a custom ``__new__``, do not use ``super().__new__`` --" +msgstr "" + +#: ../../library/enum.rst:394 +msgid "call the appropriate ``__new__`` instead." +msgstr "" + +#: ../../library/enum.rst:398 msgid "" "Returns the string used for *repr()* calls. By default, returns the *Enum* " "name, member name, and value, but can be overridden::" @@ -609,7 +618,7 @@ msgstr "" "回傳呼叫 *repr()* 時使用的字串。預設回傳 *Enum* 名稱、成員名稱及值,但可以被" "覆寫: ::" -#: ../../library/enum.rst:411 +#: ../../library/enum.rst:414 msgid "" "Returns the string used for *str()* calls. By default, returns the *Enum* " "name and member name, but can be overridden::" @@ -617,7 +626,7 @@ msgstr "" "回傳呼叫 *str()* 時使用的字串。預設回傳 *Enum* 名稱及成員名稱,但可以被覆" "寫: ::" -#: ../../library/enum.rst:426 +#: ../../library/enum.rst:429 msgid "" "Returns the string used for *format()* and *f-string* calls. By default, " "returns :meth:`__str__` return value, but can be overridden::" @@ -625,17 +634,17 @@ msgstr "" "回傳呼叫 *format()* 及 *f-string* 時使用的字串。預設回傳 :meth:`__str__` 的回" "傳值,但可以被覆寫: ::" -#: ../../library/enum.rst:441 +#: ../../library/enum.rst:444 msgid "" "Using :class:`auto` with :class:`Enum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`Enum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:444 +#: ../../library/enum.rst:447 msgid "Added :ref:`enum-dataclass-support`" msgstr "新增 :ref:`enum-dataclass-support`" -#: ../../library/enum.rst:449 +#: ../../library/enum.rst:452 msgid "" "*IntEnum* is the same as *Enum*, but its members are also integers and can " "be used anywhere that an integer can be used. If any integer operation is " @@ -645,13 +654,13 @@ msgstr "" "*IntEnum* 和 *Enum* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" "方。如果 *IntEnum* 成員經過任何整數運算,其結果會失去列舉狀態。" -#: ../../library/enum.rst:470 +#: ../../library/enum.rst:473 msgid "" "Using :class:`auto` with :class:`IntEnum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`IntEnum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:473 +#: ../../library/enum.rst:476 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` was " @@ -661,7 +670,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:480 +#: ../../library/enum.rst:483 msgid "" "*StrEnum* is the same as *Enum*, but its members are also strings and can be " "used in most of the same places that a string can be used. The result of " @@ -671,7 +680,7 @@ msgstr "" "*StrEnum* 和 *Enum* 一樣,但其成員同時也是字串而可以被用在幾乎所有使用字串的" "地方。*StrEnum* 成員經過任何字串操作的結果會不再是列舉的一部份。" -#: ../../library/enum.rst:486 +#: ../../library/enum.rst:489 msgid "" "There are places in the stdlib that check for an exact :class:`str` instead " "of a :class:`str` subclass (i.e. ``type(unknown) == str`` instead of " @@ -682,13 +691,13 @@ msgstr "" "是 ``type(unknown) == str`` 而不是 ``isinstance(unknown, str)``),在這些地方" "你需要使用 ``str(StrEnum.member)``。" -#: ../../library/enum.rst:493 +#: ../../library/enum.rst:496 msgid "" "Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " "name as the value." msgstr ":class:`StrEnum` 使用 :class:`auto` 會產生小寫的成員名稱當作值。" -#: ../../library/enum.rst:498 +#: ../../library/enum.rst:501 msgid "" ":meth:`~object.__str__` is :meth:`!str.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` is " @@ -698,7 +707,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!str.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 也會是 :meth:`!str.__format__`。" -#: ../../library/enum.rst:506 +#: ../../library/enum.rst:509 #, fuzzy msgid "" "``Flag`` is the same as :class:`Enum`, but its members support the bitwise " @@ -708,39 +717,39 @@ msgstr "" "*Flag* 成員支援位元操作 ``&`` (*AND*)、``|`` (*OR*)、``^`` (*XOR*) 及 ``~`` " "(*INVERT*);這些操作的結果會是列舉成員。" -#: ../../library/enum.rst:512 +#: ../../library/enum.rst:515 msgid "Returns *True* if value is in self::" msgstr "如果 value 在 self 裡則回傳 *True*: ::" -#: ../../library/enum.rst:533 +#: ../../library/enum.rst:536 msgid "Returns all contained non-alias members::" msgstr "回傳所有包含的非別名成員: ::" -#: ../../library/enum.rst:544 +#: ../../library/enum.rst:547 msgid "Returns number of members in flag::" msgstr "回傳旗標裡的成員數量: ::" -#: ../../library/enum.rst:553 +#: ../../library/enum.rst:556 msgid "Returns *True* if any members in flag, *False* otherwise::" msgstr "如果成員在旗標裡則回傳 *True*,否則回傳 *False*: ::" -#: ../../library/enum.rst:565 +#: ../../library/enum.rst:568 msgid "Returns current flag binary or'ed with other::" msgstr "回傳和 other 做 OR 過後的二進位旗標: ::" -#: ../../library/enum.rst:572 +#: ../../library/enum.rst:575 msgid "Returns current flag binary and'ed with other::" msgstr "回傳和 other 做 AND 過後的二進位旗標: ::" -#: ../../library/enum.rst:581 +#: ../../library/enum.rst:584 msgid "Returns current flag binary xor'ed with other::" msgstr "回傳和 other 做 XOR 過後的二進位旗標: ::" -#: ../../library/enum.rst:590 +#: ../../library/enum.rst:593 msgid "Returns all the flags in *type(self)* that are not in self::" msgstr "回傳所有在 *type(self)* 但不在 self 裡的旗標: ::" -#: ../../library/enum.rst:601 +#: ../../library/enum.rst:604 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." @@ -748,17 +757,17 @@ msgstr "" "用來格式化任何剩下未命名數值的函式。預設是值的 repr,常見選擇是 :func:`hex` " "和 :func:`oct`。" -#: ../../library/enum.rst:606 +#: ../../library/enum.rst:609 msgid "" "Using :class:`auto` with :class:`Flag` results in integers that are powers " "of two, starting with ``1``." msgstr ":class:`Flag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:609 +#: ../../library/enum.rst:612 msgid "The *repr()* of zero-valued flags has changed. It is now::" msgstr "值為 0 的旗標的 *repr()* 已改變。現在是: ::" -#: ../../library/enum.rst:617 +#: ../../library/enum.rst:620 msgid "" "*IntFlag* is the same as *Flag*, but its members are also integers and can " "be used anywhere that an integer can be used." @@ -766,38 +775,38 @@ msgstr "" "*IntFlag* 和 *Flag* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" "方。" -#: ../../library/enum.rst:631 +#: ../../library/enum.rst:634 msgid "" "If any integer operation is performed with an *IntFlag* member, the result " "is not an *IntFlag*::" msgstr "如果 *IntFlag* 成員經過任何整數運算,其結果不是 *IntFlag*: ::" -#: ../../library/enum.rst:637 +#: ../../library/enum.rst:640 msgid "If a *Flag* operation is performed with an *IntFlag* member and:" msgstr "如果 *IntFlag* 成員經過 *Flag* 操作且:" -#: ../../library/enum.rst:639 +#: ../../library/enum.rst:642 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" msgstr "結果是合法的 *IntFlag*:回傳 *IntFlag*" -#: ../../library/enum.rst:640 +#: ../../library/enum.rst:643 msgid "" "the result is not a valid *IntFlag*: the result depends on the " "*FlagBoundary* setting" msgstr "結果不是合法的 *IntFlag*:結果會根據 *FlagBoundary* 的設定" -#: ../../library/enum.rst:642 +#: ../../library/enum.rst:645 msgid "The *repr()* of unnamed zero-valued flags has changed. It is now:" msgstr "未命名且值為 0 的旗標的 *repr()* 已改變。現在是: ::" -#: ../../library/enum.rst:649 +#: ../../library/enum.rst:652 msgid "" "Using :class:`auto` with :class:`IntFlag` results in integers that are " "powers of two, starting with ``1``." msgstr "" ":class:`IntFlag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:654 +#: ../../library/enum.rst:657 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` " @@ -807,7 +816,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:658 +#: ../../library/enum.rst:661 msgid "" "Inversion of an :class:`!IntFlag` now returns a positive value that is the " "union of all flags not in the given flag, rather than a negative value. This " @@ -816,7 +825,7 @@ msgstr "" ":class:`!IntFlag` 的反轉 (inversion) 現在會回傳正值,該值是不在給定旗標的所有" "旗標聯集,而不是一個負值。這符合現有 :class:`Flag` 的行為。" -#: ../../library/enum.rst:664 +#: ../../library/enum.rst:667 msgid "" ":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" @@ -824,15 +833,15 @@ msgstr "" ":class:`!ReprEnum` 使用 :class:`Enum` 的 :meth:`repr() `,但使" "用混合資料類型的 :class:`str() `:" -#: ../../library/enum.rst:667 +#: ../../library/enum.rst:670 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" msgstr "對 :class:`IntEnum` 和 :class:`IntFlag` 是 :meth:`!int.__str__`" -#: ../../library/enum.rst:668 +#: ../../library/enum.rst:671 msgid ":meth:`!str.__str__` for :class:`StrEnum`" msgstr "對 :class:`StrEnum` 是 :meth:`!str.__str__`" -#: ../../library/enum.rst:670 +#: ../../library/enum.rst:673 msgid "" "Inherit from :class:`!ReprEnum` to keep the :class:`str() ` / :func:" "`format` of the mixed-in data type instead of using the :class:`Enum`-" @@ -841,7 +850,7 @@ msgstr "" "繼承 :class:`!ReprEnum` 來保留混合資料類型的 :class:`str() ` / :func:" "`format`,而不是使用 :class:`Enum` 預設的 :meth:`str() `。" -#: ../../library/enum.rst:679 +#: ../../library/enum.rst:682 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." @@ -849,17 +858,17 @@ msgstr "" "*EnumCheck* 包含 :func:`verify` 裝飾器使用的選項,以確保多樣的限制,不符合限" "制會產生 :exc:`ValueError`。" -#: ../../library/enum.rst:684 +#: ../../library/enum.rst:687 msgid "Ensure that each value has only one name::" msgstr "確保每個值只有一個名稱: ::" -#: ../../library/enum.rst:700 +#: ../../library/enum.rst:703 msgid "" "Ensure that there are no missing values between the lowest-valued member and " "the highest-valued member::" msgstr "確保在最小值成員跟最大值成員間沒有缺少值: ::" -#: ../../library/enum.rst:715 +#: ../../library/enum.rst:718 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`::" @@ -867,35 +876,35 @@ msgstr "" "確保任何旗標群組 / 遮罩只包含命名旗標 -- 當值是用指定而不是透過 :func:`auto` " "產生時是很實用的: ::" -#: ../../library/enum.rst:732 +#: ../../library/enum.rst:735 msgid "" "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." msgstr "CONTINUOUS 和 NAMED_FLAGS 是設計用來運作在整數值的成員上。" -#: ../../library/enum.rst:738 +#: ../../library/enum.rst:741 msgid "" "*FlagBoundary* controls how out-of-range values are handled in *Flag* and " "its subclasses." msgstr "*FlagBoundary* 控制在 *Flag* 及其子類別中如何處理範圍外的值。" -#: ../../library/enum.rst:743 +#: ../../library/enum.rst:746 msgid "" "Out-of-range values cause a :exc:`ValueError` to be raised. This is the " "default for :class:`Flag`::" msgstr "範圍外的值會引發 :exc:`ValueError`。這是 :class:`Flag` 的預設行為: ::" -#: ../../library/enum.rst:761 +#: ../../library/enum.rst:764 msgid "" "Out-of-range values have invalid values removed, leaving a valid *Flag* " "value::" msgstr "範圍外的值會移除非法值,留下合法的 *Flag* 值: ::" -#: ../../library/enum.rst:775 +#: ../../library/enum.rst:778 msgid "" "Out-of-range values lose their *Flag* membership and revert to :class:`int`." msgstr "範圍外的值會失去它們的 *Flag* 成員資格且恢復成 :class:`int`。" -#: ../../library/enum.rst:788 +#: ../../library/enum.rst:791 msgid "" "Out-of-range values are kept, and the *Flag* membership is kept. This is the " "default for :class:`IntFlag`::" @@ -903,11 +912,11 @@ msgstr "" "範圍外的值會被保留,*Flag* 成員資格也會被保留。這是 :class:`IntFlag` 的預設行" "為: ::" -#: ../../library/enum.rst:805 +#: ../../library/enum.rst:808 msgid "Supported ``__dunder__`` names" msgstr "支援 ``__dunder__`` 名稱" -#: ../../library/enum.rst:807 +#: ../../library/enum.rst:810 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." @@ -915,7 +924,7 @@ msgstr "" ":attr:`~EnumType.__members__` 是一個唯讀有序的\\ ``成員名稱``:``成員``\\ 項" "目的對映。只有在類別上可用。" -#: ../../library/enum.rst:810 +#: ../../library/enum.rst:813 msgid "" ":meth:`~object.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`!_value_` " @@ -925,28 +934,28 @@ msgstr "" "的 :attr:`!_value_` 也是一個很好的主意。一旦所有成員都建立之後就不會再被用" "到。" -#: ../../library/enum.rst:816 +#: ../../library/enum.rst:819 msgid "Supported ``_sunder_`` names" msgstr "支援 ``_sunder_`` 名稱" -#: ../../library/enum.rst:818 +#: ../../library/enum.rst:821 #, fuzzy msgid ":attr:`~Enum._name_` -- name of the member" msgstr "``_name_`` -- 成員名稱" -#: ../../library/enum.rst:819 +#: ../../library/enum.rst:822 #, fuzzy msgid ":attr:`~Enum._value_` -- value of the member; can be set in ``__new__``" msgstr "``_value_`` -- 成員的值;可以在 ``__new__`` 設定或修改" -#: ../../library/enum.rst:820 +#: ../../library/enum.rst:823 #, fuzzy msgid "" ":meth:`~Enum._missing_` -- a lookup function used when a value is not found; " "may be overridden" msgstr "``_missing_`` -- 當值沒有被找到時會使用的查詢函式;可以被覆寫" -#: ../../library/enum.rst:822 +#: ../../library/enum.rst:825 #, fuzzy msgid "" ":attr:`~Enum._ignore_` -- a list of names, either as a :class:`list` or a :" @@ -956,7 +965,7 @@ msgstr "" "``_ignore_`` -- 可以是 :class:`list` 或 :class:`str` 的名稱串列,它不會被轉換" "成成員,且在最後的類別上會被移除" -#: ../../library/enum.rst:825 +#: ../../library/enum.rst:828 #, fuzzy msgid "" ":attr:`~Enum._order_` -- no longer used, kept for backward compatibility " @@ -965,21 +974,21 @@ msgstr "" "``_order_`` -- 在 Python 2/3 的程式裡用來確保成員順序是一致的(類別屬性,在類" "別建立時移除)" -#: ../../library/enum.rst:827 +#: ../../library/enum.rst:830 #, fuzzy msgid "" ":meth:`~Enum._generate_next_value_` -- used to get an appropriate value for " "an enum member; may be overridden" msgstr "``_generate_next_value_`` -- 用來為列舉成員取得合適的值;可以被覆寫" -#: ../../library/enum.rst:832 +#: ../../library/enum.rst:835 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" "對標準的 :class:`Enum` 類別來說,下一個被選擇的值是最後一個看見的值加一。" -#: ../../library/enum.rst:835 +#: ../../library/enum.rst:838 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." @@ -987,19 +996,19 @@ msgstr "" "對 :class:`Flag` 類別來說,下一個被選擇的值是下一個最大的 2 的次方,不管最後" "一個看見的值是什麼。" -#: ../../library/enum.rst:838 +#: ../../library/enum.rst:841 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``\\ 、\\ ``_order_``\\ 、\\ ``_generate_next_value_``" -#: ../../library/enum.rst:839 +#: ../../library/enum.rst:842 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:844 +#: ../../library/enum.rst:847 msgid "Utilities and Decorators" msgstr "通用項目與裝飾器" -#: ../../library/enum.rst:848 +#: ../../library/enum.rst:851 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an *Enum*'s :meth:`~Enum._generate_next_value_` to get an appropriate " @@ -1015,16 +1024,16 @@ msgstr "" "2 的次方的數字;對 *StrEnum* 來說,是成員名稱的小寫版本。如果混用 *auto()* 和" "手動指定值的話要特別注意。" -#: ../../library/enum.rst:856 +#: ../../library/enum.rst:859 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "*auto* 實例只有在最上層的賦值時才會被解析:" -#: ../../library/enum.rst:858 +#: ../../library/enum.rst:861 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "``FIRST = auto()`` 可以運作(auto() 會被取代成 ``1``)" -#: ../../library/enum.rst:859 +#: ../../library/enum.rst:862 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is used to create the ``SECOND`` enum member;" @@ -1032,7 +1041,7 @@ msgstr "" "``SECOND = auto(), -2`` 可以運作(auto 會被取代成 ``2``, 因此 ``2, -2`` 會被" "用來建立列舉成員 ``SECOND``;" -#: ../../library/enum.rst:861 +#: ../../library/enum.rst:864 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" @@ -1040,19 +1049,19 @@ msgstr "" "``THREE = [auto(), -3]`` *無法*\\ 運作(\\ ``, -3`` 會被用來建立列" "舉成員 ``THREE``)" -#: ../../library/enum.rst:866 +#: ../../library/enum.rst:869 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "在之前的版本中,``auto()`` 必須是賦值行裡的唯一內容才能運作正確。" -#: ../../library/enum.rst:869 +#: ../../library/enum.rst:872 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "可以覆寫 ``_generate_next_value_`` 來客製 *auto* 使用的值。" -#: ../../library/enum.rst:872 +#: ../../library/enum.rst:875 msgid "" "in 3.13 the default ``_generate_next_value_`` will always return the highest " "member value incremented by 1, and will fail if any member is an " @@ -1061,7 +1070,7 @@ msgstr "" "在 3.13 預設 ``_generate_next_value_`` 總是回傳最大的成員值加一,如果任何成員" "是不相容的類型就會失敗。" -#: ../../library/enum.rst:878 +#: ../../library/enum.rst:881 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " @@ -1070,7 +1079,7 @@ msgstr "" "和內建的 *property* 相似的裝飾器,但只專門針對列舉。它允許成員屬性和成員本身" "有相同名稱。" -#: ../../library/enum.rst:882 +#: ../../library/enum.rst:885 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -1080,7 +1089,7 @@ msgstr "" "*屬性*\\ 和成員必須定義在分開的類別裡;例如 *value* 和 *name* 屬性定義在 " "*Enum* 類別而 *Enum* 子類別可以定義成員名稱為 ``value`` 和 ``name``。" -#: ../../library/enum.rst:891 +#: ../../library/enum.rst:894 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " @@ -1090,7 +1099,7 @@ msgstr "" "__members__`,蒐集任何它找到的別名;如果有找到任何別名則引發 :exc:" "`ValueError` 並附上細節: ::" -#: ../../library/enum.rst:909 +#: ../../library/enum.rst:912 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " @@ -1099,15 +1108,15 @@ msgstr "" "專門針對列舉的 :keyword:`class` 裝飾器。使用 :class:`EnumCheck` 裡的成員來指" "定在裝飾的列舉上應該檢查什麼限制。" -#: ../../library/enum.rst:917 +#: ../../library/enum.rst:920 msgid "A decorator for use in enums: its target will become a member." msgstr "列舉所使用的裝飾器:其目標會變成成員。" -#: ../../library/enum.rst:923 +#: ../../library/enum.rst:926 msgid "A decorator for use in enums: its target will not become a member." msgstr "列舉所使用的裝飾器:其目標不會變成成員。" -#: ../../library/enum.rst:929 +#: ../../library/enum.rst:932 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -1118,19 +1127,19 @@ msgstr "" "組而不是其類別。應該只有當列舉成員被匯出到模組的全域命名空間才使用(範例請參" "考 :class:`re.RegexFlag`)。" -#: ../../library/enum.rst:939 +#: ../../library/enum.rst:942 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "回傳在旗標\\ *值*\\ 中包含的所有 2 的次方的整數串列。" -#: ../../library/enum.rst:946 +#: ../../library/enum.rst:949 msgid "Notes" msgstr "備註" -#: ../../library/enum.rst:948 +#: ../../library/enum.rst:951 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr ":class:`IntEnum`、:class:`StrEnum` 及 :class:`IntFlag`" -#: ../../library/enum.rst:950 +#: ../../library/enum.rst:953 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" @@ -1138,17 +1147,17 @@ msgstr "" "這三種列舉類型是設計來直接取代現有以整數及字串為基底的值;因此它們有額外的限" "制:" -#: ../../library/enum.rst:953 +#: ../../library/enum.rst:956 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "``__str__`` 使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:955 +#: ../../library/enum.rst:958 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "``__format__`` 因為使用 ``__str__``,也會使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:958 +#: ../../library/enum.rst:961 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" @@ -1156,7 +1165,7 @@ msgstr "" "如果你不需要或不想要這些限制,你可以透過混合 ``int`` 或 ``str`` 類型來建立自" "己的基礎類別: ::" -#: ../../library/enum.rst:965 +#: ../../library/enum.rst:968 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "或者你也可以在你的列舉重新給定合適的 :meth:`str`: ::" diff --git a/library/itertools.po b/library/itertools.po index 4a0018b8ab..097243036d 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-26 00:03+0000\n" +"POT-Creation-Date: 2024-02-29 00:03+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-" @@ -864,7 +864,7 @@ msgid "" "show various ways of thinking about individual tools — for example, that " "``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 ``compress()`` and ``range()`` can work together. The recipes " +"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()``." @@ -896,6 +896,6 @@ msgid "" "term:`generator`\\s which incur interpreter overhead." msgstr "" -#: ../../library/itertools.rst:1009 +#: ../../library/itertools.rst:1008 msgid "The following recipes have a more mathematical flavor:" msgstr "" diff --git a/library/pprint.po b/library/pprint.po index 6919c67e24..fc79fa256b 100644 --- a/library/pprint.po +++ b/library/pprint.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2024-02-29 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -56,37 +56,103 @@ msgstr "" msgid "Added support for pretty-printing :class:`dataclasses.dataclass`." msgstr "" -#: ../../library/pprint.rst:34 -msgid "The :mod:`pprint` module defines one class:" +#: ../../library/pprint.rst:37 +msgid "Functions" msgstr "" -#: ../../library/pprint.rst:44 +#: ../../library/pprint.rst:41 +msgid "" +"Prints the formatted representation of *object* followed by a newline. If " +"*sort_dicts* is false (the default), dictionaries will be displayed with " +"their keys in insertion order, otherwise the dict keys will be sorted. " +"*args* and *kwargs* will be passed to :func:`~pprint.pprint` as formatting " +"parameters." +msgstr "" + +#: ../../library/pprint.rst:53 +msgid "" +"Prints the formatted representation of *object* on *stream*, followed by a " +"newline. If *stream* is ``None``, :data:`sys.stdout` is used. This may be " +"used in the interactive interpreter instead of the :func:`print` function " +"for inspecting values (you can even reassign ``print = pprint.pprint`` for " +"use within a scope)." +msgstr "" + +#: ../../library/pprint.rst:59 +msgid "" +"The configuration parameters *stream*, *indent*, *width*, *depth*, " +"*compact*, *sort_dicts* and *underscore_numbers* are passed to the :class:" +"`PrettyPrinter` constructor and their meanings are as described in its " +"documentation above." +msgstr "" + +#: ../../library/pprint.rst:78 +msgid "" +"Return the formatted representation of *object* as a string. *indent*, " +"*width*, *depth*, *compact*, *sort_dicts* and *underscore_numbers* are " +"passed to the :class:`PrettyPrinter` constructor as formatting parameters " +"and their meanings are as described in its documentation above." +msgstr "" + +#: ../../library/pprint.rst:88 +msgid "" +"Determine if the formatted representation of *object* is \"readable\", or " +"can be used to reconstruct the value using :func:`eval`. This always " +"returns ``False`` for recursive objects." +msgstr "" + +#: ../../library/pprint.rst:98 +msgid "" +"Determine if *object* requires a recursive representation. This function is " +"subject to the same limitations as noted in :func:`saferepr` below and may " +"raise an :exc:`RecursionError` if it fails to detect a recursive object." +msgstr "" + +#: ../../library/pprint.rst:105 +msgid "" +"Return a string representation of *object*, protected against recursion in " +"some common data structures, namely instances of :class:`dict`, :class:" +"`list` and :class:`tuple` or subclasses whose ``__repr__`` has not been " +"overridden. If the representation of object exposes a recursive entry, the " +"recursive reference will be represented as ````. The representation is not otherwise formatted." +msgstr "" + +#: ../../library/pprint.rst:118 +msgid "PrettyPrinter Objects" +msgstr "PrettyPrinter 物件" + +#: ../../library/pprint.rst:120 +msgid "This module defines one class:" +msgstr "" + +#: ../../library/pprint.rst:130 msgid "" "Construct a :class:`PrettyPrinter` instance. This constructor understands " "several keyword parameters." msgstr "" -#: ../../library/pprint.rst:47 +#: ../../library/pprint.rst:133 msgid "" -"*stream* (default ``sys.stdout``) is a :term:`file-like object` to which the " -"output will be written by calling its :meth:`!write` method. If both " -"*stream* and ``sys.stdout`` are ``None``, then :meth:`~PrettyPrinter.pprint` " -"silently returns." +"*stream* (default :data:`!sys.stdout`) is a :term:`file-like object` to " +"which the output will be written by calling its :meth:`!write` method. If " +"both *stream* and :data:`!sys.stdout` are ``None``, then :meth:" +"`~PrettyPrinter.pprint` silently returns." msgstr "" -#: ../../library/pprint.rst:52 +#: ../../library/pprint.rst:138 msgid "" "Other values configure the manner in which nesting of complex data " "structures is displayed." msgstr "" -#: ../../library/pprint.rst:55 +#: ../../library/pprint.rst:141 msgid "" "*indent* (default 1) specifies the amount of indentation added for each " "nesting level." msgstr "" -#: ../../library/pprint.rst:58 +#: ../../library/pprint.rst:144 msgid "" "*depth* controls the number of nesting levels which may be printed; if the " "data structure being printed is too deep, the next contained level is " @@ -94,14 +160,14 @@ msgid "" "objects being formatted." msgstr "" -#: ../../library/pprint.rst:63 +#: ../../library/pprint.rst:149 msgid "" "*width* (default 80) specifies the desired maximum number of characters per " "line in the output. If a structure cannot be formatted within the width " "constraint, a best effort will be made." msgstr "" -#: ../../library/pprint.rst:67 +#: ../../library/pprint.rst:153 msgid "" "*compact* impacts the way that long sequences (lists, tuples, sets, etc) are " "formatted. If *compact* is false (the default) then each item of a sequence " @@ -109,118 +175,52 @@ msgid "" "as will fit within the *width* will be formatted on each output line." msgstr "" -#: ../../library/pprint.rst:73 +#: ../../library/pprint.rst:159 msgid "" "If *sort_dicts* is true (the default), dictionaries will be formatted with " "their keys sorted, otherwise they will display in insertion order." msgstr "" -#: ../../library/pprint.rst:76 +#: ../../library/pprint.rst:162 msgid "" "If *underscore_numbers* is true, integers will be formatted with the ``_`` " "character for a thousands separator, otherwise underscores are not displayed " "(the default)." msgstr "" -#: ../../library/pprint.rst:80 +#: ../../library/pprint.rst:166 msgid "Added the *compact* parameter." msgstr "新增 *compact* 參數。" -#: ../../library/pprint.rst:83 +#: ../../library/pprint.rst:169 msgid "Added the *sort_dicts* parameter." msgstr "新增 *sort_dicts* 參數。" -#: ../../library/pprint.rst:86 +#: ../../library/pprint.rst:172 msgid "Added the *underscore_numbers* parameter." msgstr "新增 *underscore_numbers* 參數。" -#: ../../library/pprint.rst:89 -msgid "No longer attempts to write to ``sys.stdout`` if it is ``None``." -msgstr "" - -#: ../../library/pprint.rst:118 -msgid "" -"Return the formatted representation of *object* as a string. *indent*, " -"*width*, *depth*, *compact*, *sort_dicts* and *underscore_numbers* are " -"passed to the :class:`PrettyPrinter` constructor as formatting parameters " -"and their meanings are as described in its documentation above." -msgstr "" - -#: ../../library/pprint.rst:126 -msgid "" -"Prints the formatted representation of *object* followed by a newline. If " -"*sort_dicts* is false (the default), dictionaries will be displayed with " -"their keys in insertion order, otherwise the dict keys will be sorted. " -"*args* and *kwargs* will be passed to :func:`pprint` as formatting " -"parameters." -msgstr "" - -#: ../../library/pprint.rst:138 -msgid "" -"Prints the formatted representation of *object* on *stream*, followed by a " -"newline. If *stream* is ``None``, ``sys.stdout`` is used. This may be used " -"in the interactive interpreter instead of the :func:`print` function for " -"inspecting values (you can even reassign ``print = pprint.pprint`` for use " -"within a scope)." +#: ../../library/pprint.rst:175 +msgid "No longer attempts to write to :data:`!sys.stdout` if it is ``None``." msgstr "" -#: ../../library/pprint.rst:144 -msgid "" -"The configuration parameters *stream*, *indent*, *width*, *depth*, " -"*compact*, *sort_dicts* and *underscore_numbers* are passed to the :class:" -"`PrettyPrinter` constructor and their meanings are as described in its " -"documentation above." -msgstr "" - -#: ../../library/pprint.rst:164 -msgid "" -"Determine if the formatted representation of *object* is \"readable\", or " -"can be used to reconstruct the value using :func:`eval`. This always " -"returns ``False`` for recursive objects." -msgstr "" - -#: ../../library/pprint.rst:174 -msgid "" -"Determine if *object* requires a recursive representation. This function is " -"subject to the same limitations as noted in :func:`saferepr` below and may " -"raise an :exc:`RecursionError` if it fails to detect a recursive object." -msgstr "" - -#: ../../library/pprint.rst:179 -msgid "One more support function is also defined:" -msgstr "" - -#: ../../library/pprint.rst:183 -msgid "" -"Return a string representation of *object*, protected against recursion in " -"some common data structures, namely instances of :class:`dict`, :class:" -"`list` and :class:`tuple` or subclasses whose ``__repr__`` has not been " -"overridden. If the representation of object exposes a recursive entry, the " -"recursive reference will be represented as ````. The representation is not otherwise formatted." -msgstr "" - -#: ../../library/pprint.rst:197 -msgid "PrettyPrinter Objects" -msgstr "PrettyPrinter 物件" - -#: ../../library/pprint.rst:199 +#: ../../library/pprint.rst:202 msgid ":class:`PrettyPrinter` instances have the following methods:" msgstr "" -#: ../../library/pprint.rst:204 +#: ../../library/pprint.rst:207 msgid "" "Return the formatted representation of *object*. This takes into account " "the options passed to the :class:`PrettyPrinter` constructor." msgstr "" -#: ../../library/pprint.rst:210 +#: ../../library/pprint.rst:213 msgid "" "Print the formatted representation of *object* on the configured stream, " "followed by a newline." msgstr "" -#: ../../library/pprint.rst:213 +#: ../../library/pprint.rst:216 msgid "" "The following methods provide the implementations for the corresponding " "functions of the same names. Using these methods on an instance is slightly " @@ -228,7 +228,7 @@ msgid "" "created." msgstr "" -#: ../../library/pprint.rst:223 +#: ../../library/pprint.rst:226 msgid "" "Determine if the formatted representation of the object is \"readable,\" or " "can be used to reconstruct the value using :func:`eval`. Note that this " @@ -237,18 +237,18 @@ msgid "" "returns ``False``." msgstr "" -#: ../../library/pprint.rst:232 +#: ../../library/pprint.rst:235 msgid "Determine if the object requires a recursive representation." msgstr "" -#: ../../library/pprint.rst:234 +#: ../../library/pprint.rst:237 msgid "" "This method is provided as a hook to allow subclasses to modify the way " "objects are converted to strings. The default implementation uses the " "internals of the :func:`saferepr` implementation." msgstr "" -#: ../../library/pprint.rst:241 +#: ../../library/pprint.rst:244 msgid "" "Returns three values: the formatted version of *object* as a string, a flag " "indicating whether the result is readable, and a flag indicating whether " @@ -266,45 +266,45 @@ msgid "" "of the current call." msgstr "" -#: ../../library/pprint.rst:259 +#: ../../library/pprint.rst:262 msgid "Example" msgstr "範例" -#: ../../library/pprint.rst:261 +#: ../../library/pprint.rst:264 msgid "" -"To demonstrate several uses of the :func:`pprint` function and its " +"To demonstrate several uses of the :func:`~pprint.pprint` function and its " "parameters, let's fetch information about a project from `PyPI `_::" msgstr "" -#: ../../library/pprint.rst:270 -msgid "In its basic form, :func:`pprint` shows the whole object::" +#: ../../library/pprint.rst:273 +msgid "In its basic form, :func:`~pprint.pprint` shows the whole object::" msgstr "" -#: ../../library/pprint.rst:326 +#: ../../library/pprint.rst:329 msgid "" "The result can be limited to a certain *depth* (ellipsis is used for deeper " "contents)::" msgstr "" -#: ../../library/pprint.rst:372 +#: ../../library/pprint.rst:375 msgid "" "Additionally, maximum character *width* can be suggested. If a long object " "cannot be split, the specified width will be exceeded::" msgstr "" -#: ../../library/pprint.rst:39 -msgid "..." -msgstr "..." - -#: ../../library/pprint.rst:39 -msgid "placeholder" -msgstr "placeholder(佔位符號)" - -#: ../../library/pprint.rst:162 ../../library/pprint.rst:221 +#: ../../library/pprint.rst:86 ../../library/pprint.rst:224 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/pprint.rst:162 ../../library/pprint.rst:221 +#: ../../library/pprint.rst:86 ../../library/pprint.rst:224 msgid "eval" msgstr "eval" + +#: ../../library/pprint.rst:125 +msgid "..." +msgstr "..." + +#: ../../library/pprint.rst:125 +msgid "placeholder" +msgstr "placeholder(佔位符號)" From 6068d17b306047c91b42e4ef679b6d6dc79f34d3 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Sun, 10 Mar 2024 15:49:20 +0800 Subject: [PATCH 24/33] fix: resolve fuzzy entries --- library/abc.po | 13 +- library/ast.po | 5 +- library/constants.po | 31 ++-- library/exceptions.po | 8 +- library/importlib.po | 4 +- library/inspect.po | 378 ++++++++++++++++++++------------------- library/itertools.po | 4 +- library/numbers.po | 5 +- library/pickle.po | 10 +- library/ssl.po | 336 +++++++++++++++++----------------- library/unittest.mock.po | 12 +- reference/datamodel.po | 34 ++-- reference/expressions.po | 4 +- whatsnew/2.7.po | 6 +- whatsnew/3.10.po | 9 +- whatsnew/3.4.po | 4 +- whatsnew/3.9.po | 12 +- 17 files changed, 448 insertions(+), 427 deletions(-) diff --git a/library/abc.po b/library/abc.po index 4b60588f66..15dffc36ac 100644 --- a/library/abc.po +++ b/library/abc.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-04 13:57+0000\n" +"POT-Creation-Date: 2024-03-01 00:03+0000\n" "PO-Revision-Date: 2022-11-16 03:29+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -150,12 +150,13 @@ msgstr "" "__subclasscheck__` 方法中呼叫。)" #: ../../library/abc.rst:104 +#, fuzzy msgid "" -"This method should return ``True``, ``False`` or ``NotImplemented``. If it " -"returns ``True``, the *subclass* is considered a subclass of this ABC. If it " -"returns ``False``, the *subclass* is not considered a subclass of this ABC, " -"even if it would normally be one. If it returns ``NotImplemented``, the " -"subclass check is continued with the usual mechanism." +"This method should return ``True``, ``False`` or :data:`NotImplemented`. If " +"it returns ``True``, the *subclass* is considered a subclass of this ABC. If " +"it returns ``False``, the *subclass* is not considered a subclass of this " +"ABC, even if it would normally be one. If it returns :data:`!" +"NotImplemented`, the subclass check is continued with the usual mechanism." msgstr "" "此方法必須回傳 ``True``、``False`` 或是 ``NotImplemented``。如果回傳 " "``True``,*subclass* 就會被認為是這個 ABC 的子類別。如果回傳 ``False``," diff --git a/library/ast.po b/library/ast.po index ef3ff38b6e..7445621071 100644 --- a/library/ast.po +++ b/library/ast.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-20 00:03+0000\n" +"POT-Creation-Date: 2024-03-01 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1304,8 +1304,9 @@ msgstr "" "支援的最低版本是 ``(3, 4)``;最高的是 ``sys.version_info[0:2]``。" #: ../../library/ast.rst:2188 +#, fuzzy msgid "" -"If source contains a null character ('\\0'), :exc:`ValueError` is raised." +"If source contains a null character (``\\0``), :exc:`ValueError` is raised." msgstr "如果來源包含 null 字元 ('\\0'),則會引發 :exc:`ValueError`。" #: ../../library/ast.rst:2191 diff --git a/library/constants.po b/library/constants.po index 59e2f6395e..6ede1691c9 100644 --- a/library/constants.po +++ b/library/constants.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2024-03-01 00:03+0000\n" "PO-Revision-Date: 2021-11-19 23:36+0800\n" "Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -58,6 +58,7 @@ msgstr "" "實例。" #: ../../library/constants.rst:30 +#, fuzzy msgid "" "A special value which should be returned by the binary special methods (e." "g. :meth:`~object.__eq__`, :meth:`~object.__lt__`, :meth:`~object.__add__`, :" @@ -65,8 +66,8 @@ msgid "" "implemented with respect to the other type; may be returned by the in-place " "binary special methods (e.g. :meth:`~object.__imul__`, :meth:`~object." "__iand__`, etc.) for the same purpose. It should not be evaluated in a " -"boolean context. ``NotImplemented`` is the sole instance of the :data:`types." -"NotImplementedType` type." +"boolean context. :data:`!NotImplemented` is the sole instance of the :data:" +"`types.NotImplementedType` type." msgstr "" "會被二元特殊方法 (binary special methods)(如::meth:`~object.__eq__`、:meth:" "`~object.__lt__`、:meth:`~object.__add__`、:meth:`~object.__rsub__` 等)所回" @@ -76,13 +77,15 @@ msgstr "" "``NotImplemented`` 是型別 :data:`types.NotImplementedType` 的唯一實例。" #: ../../library/constants.rst:40 +#, fuzzy msgid "" -"When a binary (or in-place) method returns ``NotImplemented`` the " +"When a binary (or in-place) method returns :data:`!NotImplemented` the " "interpreter will try the reflected operation on the other type (or some " -"other fallback, depending on the operator). If all attempts return " -"``NotImplemented``, the interpreter will raise an appropriate exception. " -"Incorrectly returning ``NotImplemented`` will result in a misleading error " -"message or the ``NotImplemented`` value being returned to Python code." +"other fallback, depending on the operator). If all attempts return :data:`!" +"NotImplemented`, the interpreter will raise an appropriate exception. " +"Incorrectly returning :data:`!NotImplemented` will result in a misleading " +"error message or the :data:`!NotImplemented` value being returned to Python " +"code." msgstr "" "當一個二元 (binary) 或原地 (in-place) 方法回傳 ``NotImplemented``,直譯器會嘗" "試反映該操作到其他型別(或是其他後援 (fallback),取決於是哪種運算子)。如果所" @@ -95,19 +98,21 @@ msgid "See :ref:`implementing-the-arithmetic-operations` for examples." msgstr "請參見 :ref:`implementing-the-arithmetic-operations` 以找到更多範例。" #: ../../library/constants.rst:51 +#, fuzzy msgid "" -"``NotImplementedError`` and ``NotImplemented`` are not interchangeable, even " -"though they have similar names and purposes. See :exc:`NotImplementedError` " -"for details on when to use it." +"``NotImplementedError`` and :data:`!NotImplemented` are not interchangeable, " +"even though they have similar names and purposes. See :exc:" +"`NotImplementedError` for details on when to use it." msgstr "" "``NotImplementedError`` 與 ``NotImplemented`` 並不一樣且不可互換。即使它們有" "相似的名稱與用途。欲知更多如何使用它們的細節,請參見 :exc:" "`NotImplementedError`。" #: ../../library/constants.rst:55 +#, fuzzy msgid "" -"Evaluating ``NotImplemented`` in a boolean context is deprecated. While it " -"currently evaluates as true, it will emit a :exc:`DeprecationWarning`. It " +"Evaluating :data:`!NotImplemented` in a boolean context is deprecated. While " +"it currently evaluates as true, it will emit a :exc:`DeprecationWarning`. It " "will raise a :exc:`TypeError` in a future version of Python." msgstr "" "在 boolean(布林)上下文中解讀 ``NotImplemented`` 已經被棄用。雖然目前會被解" diff --git a/library/exceptions.po b/library/exceptions.po index fa3ab182f0..2b28c6d433 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-06 00:03+0000\n" +"POT-Creation-Date: 2024-03-01 00:03+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-" @@ -379,9 +379,9 @@ msgstr "" #: ../../library/exceptions.rst:338 msgid "" -"``NotImplementedError`` and ``NotImplemented`` are not interchangeable, even " -"though they have similar names and purposes. See :data:`NotImplemented` for " -"details on when to use it." +"``NotImplementedError`` and :data:`NotImplemented` are not interchangeable, " +"even though they have similar names and purposes. See :data:`!" +"NotImplemented` for details on when to use it." msgstr "" #: ../../library/exceptions.rst:347 diff --git a/library/importlib.po b/library/importlib.po index 06180afbc9..bc8ced9688 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-14 00:03+0000\n" +"POT-Creation-Date: 2024-03-01 00:03+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-" @@ -400,7 +400,7 @@ msgid "" msgstr "" #: ../../library/importlib.rst:267 -msgid "Returns ``None`` when called instead of ``NotImplemented``." +msgid "Returns ``None`` when called instead of :data:`NotImplemented`." msgstr "" #: ../../library/importlib.rst:273 diff --git a/library/inspect.po b/library/inspect.po index 08b772405d..fa6bc2a177 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 00:03+0000\n" +"POT-Creation-Date: 2024-03-01 00:03+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -911,12 +911,6 @@ msgstr "" #: ../../library/inspect.rst:658 msgid "" -"If the passed object has a ``__signature__`` attribute, this function " -"returns it without further computations." -msgstr "" - -#: ../../library/inspect.rst:661 -msgid "" "For objects defined in modules using stringized annotations (``from " "__future__ import annotations``), :func:`signature` will attempt to " "automatically un-stringize the annotations using :func:`get_annotations`. " @@ -925,7 +919,7 @@ msgid "" "func:`get_annotations` for instructions on how to use these parameters." msgstr "" -#: ../../library/inspect.rst:670 +#: ../../library/inspect.rst:667 msgid "" "Raises :exc:`ValueError` if no signature can be provided, and :exc:" "`TypeError` if that type of object is not supported. Also, if the " @@ -934,39 +928,47 @@ msgid "" "potentially raise any kind of exception." msgstr "" -#: ../../library/inspect.rst:676 +#: ../../library/inspect.rst:673 msgid "" "A slash(/) in the signature of a function denotes that the parameters prior " "to it are positional-only. For more info, see :ref:`the FAQ entry on " "positional-only parameters `." msgstr "" -#: ../../library/inspect.rst:680 +#: ../../library/inspect.rst:677 msgid "" "The *follow_wrapped* parameter was added. Pass ``False`` to get a signature " "of *callable* specifically (``callable.__wrapped__`` will not be used to " "unwrap decorated callables.)" msgstr "" -#: ../../library/inspect.rst:686 ../../library/inspect.rst:789 +#: ../../library/inspect.rst:683 ../../library/inspect.rst:793 msgid "The *globals*, *locals*, and *eval_str* parameters were added." msgstr "" -#: ../../library/inspect.rst:691 +#: ../../library/inspect.rst:688 msgid "" "Some callables may not be introspectable in certain implementations of " "Python. For example, in CPython, some built-in functions defined in C " "provide no metadata about their arguments." msgstr "" -#: ../../library/inspect.rst:698 +#: ../../library/inspect.rst:694 +msgid "" +"If the passed object has a :attr:`!__signature__` attribute, we may use it " +"to create the signature. The exact semantics are an implementation detail " +"and are subject to unannounced changes. Consult the source code for current " +"semantics." +msgstr "" + +#: ../../library/inspect.rst:702 msgid "" "A :class:`!Signature` object represents the call signature of a function and " "its return annotation. For each parameter accepted by the function it " "stores a :class:`Parameter` object in its :attr:`parameters` collection." msgstr "" -#: ../../library/inspect.rst:703 +#: ../../library/inspect.rst:707 msgid "" "The optional *parameters* argument is a sequence of :class:`Parameter` " "objects, which is validated to check that there are no parameters with " @@ -975,54 +977,54 @@ msgid "" "defaults follow parameters without defaults." msgstr "" -#: ../../library/inspect.rst:709 +#: ../../library/inspect.rst:713 msgid "" "The optional *return_annotation* argument can be an arbitrary Python object. " "It represents the \"return\" annotation of the callable." msgstr "" -#: ../../library/inspect.rst:712 +#: ../../library/inspect.rst:716 msgid "" ":class:`!Signature` objects are *immutable*. Use :meth:`Signature.replace` " "to make a modified copy." msgstr "" -#: ../../library/inspect.rst:715 +#: ../../library/inspect.rst:719 msgid ":class:`!Signature` objects are now picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:720 +#: ../../library/inspect.rst:724 msgid "A special class-level marker to specify absence of a return annotation." msgstr "" -#: ../../library/inspect.rst:724 +#: ../../library/inspect.rst:728 msgid "" "An ordered mapping of parameters' names to the corresponding :class:" "`Parameter` objects. Parameters appear in strict definition order, " "including keyword-only parameters." msgstr "" -#: ../../library/inspect.rst:728 ../../library/inspect.rst:1065 +#: ../../library/inspect.rst:732 ../../library/inspect.rst:1069 msgid "" "Python only explicitly guaranteed that it preserved the declaration order of " "keyword-only parameters as of version 3.7, although in practice this order " "had always been preserved in Python 3." msgstr "" -#: ../../library/inspect.rst:735 +#: ../../library/inspect.rst:739 msgid "" "The \"return\" annotation for the callable. If the callable has no " "\"return\" annotation, this attribute is set to :attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:740 +#: ../../library/inspect.rst:744 msgid "" "Create a mapping from positional and keyword arguments to parameters. " "Returns :class:`BoundArguments` if ``*args`` and ``**kwargs`` match the " "signature, or raises a :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:746 +#: ../../library/inspect.rst:750 msgid "" "Works the same way as :meth:`Signature.bind`, but allows the omission of " "some required arguments (mimics :func:`functools.partial` behavior.) " @@ -1030,7 +1032,7 @@ msgid "" "arguments do not match the signature." msgstr "" -#: ../../library/inspect.rst:753 +#: ../../library/inspect.rst:757 msgid "" "Create a new :class:`Signature` instance based on the instance :meth:" "`replace` was invoked on. It is possible to pass different *parameters* and/" @@ -1039,147 +1041,147 @@ msgid "" "Signature`, pass in :attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:773 +#: ../../library/inspect.rst:777 msgid "" "Return a :class:`Signature` (or its subclass) object for a given callable " "*obj*." msgstr "" -#: ../../library/inspect.rst:776 +#: ../../library/inspect.rst:780 msgid "This method simplifies subclassing of :class:`Signature`:" msgstr "" -#: ../../library/inspect.rst:785 +#: ../../library/inspect.rst:789 msgid "Its behavior is otherwise identical to that of :func:`signature`." msgstr "" -#: ../../library/inspect.rst:795 +#: ../../library/inspect.rst:799 msgid "" ":class:`!Parameter` objects are *immutable*. Instead of modifying a :class:`!" "Parameter` object, you can use :meth:`Parameter.replace` to create a " "modified copy." msgstr "" -#: ../../library/inspect.rst:799 +#: ../../library/inspect.rst:803 msgid "Parameter objects are now picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:804 +#: ../../library/inspect.rst:808 msgid "" "A special class-level marker to specify absence of default values and " "annotations." msgstr "" -#: ../../library/inspect.rst:809 +#: ../../library/inspect.rst:813 msgid "" "The name of the parameter as a string. The name must be a valid Python " "identifier." msgstr "" -#: ../../library/inspect.rst:814 +#: ../../library/inspect.rst:818 msgid "" "CPython generates implicit parameter names of the form ``.0`` on the code " "objects used to implement comprehensions and generator expressions." msgstr "" -#: ../../library/inspect.rst:818 +#: ../../library/inspect.rst:822 msgid "" "These parameter names are now exposed by this module as names like " "``implicit0``." msgstr "" -#: ../../library/inspect.rst:824 +#: ../../library/inspect.rst:828 msgid "" "The default value for the parameter. If the parameter has no default value, " "this attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:829 +#: ../../library/inspect.rst:833 msgid "" "The annotation for the parameter. If the parameter has no annotation, this " "attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:834 +#: ../../library/inspect.rst:838 msgid "" "Describes how argument values are bound to the parameter. The possible " "values are accessible via :class:`Parameter` (like ``Parameter." "KEYWORD_ONLY``), and support comparison and ordering, in the following order:" msgstr "" -#: ../../library/inspect.rst:841 +#: ../../library/inspect.rst:845 msgid "Name" msgstr "名稱" -#: ../../library/inspect.rst:841 +#: ../../library/inspect.rst:845 msgid "Meaning" msgstr "意義" -#: ../../library/inspect.rst:843 +#: ../../library/inspect.rst:847 msgid "*POSITIONAL_ONLY*" msgstr "*POSITIONAL_ONLY*" -#: ../../library/inspect.rst:843 +#: ../../library/inspect.rst:847 msgid "" "Value must be supplied as a positional argument. Positional only parameters " "are those which appear before a ``/`` entry (if present) in a Python " "function definition." msgstr "" -#: ../../library/inspect.rst:848 +#: ../../library/inspect.rst:852 msgid "*POSITIONAL_OR_KEYWORD*" msgstr "*POSITIONAL_OR_KEYWORD*" -#: ../../library/inspect.rst:848 +#: ../../library/inspect.rst:852 msgid "" "Value may be supplied as either a keyword or positional argument (this is " "the standard binding behaviour for functions implemented in Python.)" msgstr "" -#: ../../library/inspect.rst:853 +#: ../../library/inspect.rst:857 msgid "*VAR_POSITIONAL*" msgstr "*VAR_POSITIONAL*" -#: ../../library/inspect.rst:853 +#: ../../library/inspect.rst:857 msgid "" "A tuple of positional arguments that aren't bound to any other parameter. " "This corresponds to a ``*args`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:858 +#: ../../library/inspect.rst:862 msgid "*KEYWORD_ONLY*" msgstr "*KEYWORD_ONLY*" -#: ../../library/inspect.rst:858 +#: ../../library/inspect.rst:862 msgid "" "Value must be supplied as a keyword argument. Keyword only parameters are " "those which appear after a ``*`` or ``*args`` entry in a Python function " "definition." msgstr "" -#: ../../library/inspect.rst:863 +#: ../../library/inspect.rst:867 msgid "*VAR_KEYWORD*" msgstr "*VAR_KEYWORD*" -#: ../../library/inspect.rst:863 +#: ../../library/inspect.rst:867 msgid "" "A dict of keyword arguments that aren't bound to any other parameter. This " "corresponds to a ``**kwargs`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:869 +#: ../../library/inspect.rst:873 msgid "Example: print all keyword-only arguments without default values:" msgstr "" -#: ../../library/inspect.rst:885 +#: ../../library/inspect.rst:889 msgid "Describes a enum value of :attr:`Parameter.kind`." msgstr "" -#: ../../library/inspect.rst:889 +#: ../../library/inspect.rst:893 msgid "Example: print all descriptions of arguments:" msgstr "範例:列印所有引數的描述:" -#: ../../library/inspect.rst:906 +#: ../../library/inspect.rst:910 msgid "" "Create a new :class:`Parameter` instance based on the instance replaced was " "invoked on. To override a :class:`!Parameter` attribute, pass the " @@ -1187,94 +1189,94 @@ msgid "" "a :class:`!Parameter`, pass :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:924 +#: ../../library/inspect.rst:928 msgid "" "In Python 3.3 :class:`Parameter` objects were allowed to have ``name`` set " "to ``None`` if their ``kind`` was set to ``POSITIONAL_ONLY``. This is no " "longer permitted." msgstr "" -#: ../../library/inspect.rst:931 +#: ../../library/inspect.rst:935 msgid "" "Result of a :meth:`Signature.bind` or :meth:`Signature.bind_partial` call. " "Holds the mapping of arguments to the function's parameters." msgstr "" -#: ../../library/inspect.rst:936 +#: ../../library/inspect.rst:940 msgid "" "A mutable mapping of parameters' names to arguments' values. Contains only " "explicitly bound arguments. Changes in :attr:`arguments` will reflect in :" "attr:`args` and :attr:`kwargs`." msgstr "" -#: ../../library/inspect.rst:940 +#: ../../library/inspect.rst:944 msgid "" "Should be used in conjunction with :attr:`Signature.parameters` for any " "argument processing purposes." msgstr "" -#: ../../library/inspect.rst:945 +#: ../../library/inspect.rst:949 msgid "" "Arguments for which :meth:`Signature.bind` or :meth:`Signature.bind_partial` " "relied on a default value are skipped. However, if needed, use :meth:" "`BoundArguments.apply_defaults` to add them." msgstr "" -#: ../../library/inspect.rst:950 +#: ../../library/inspect.rst:954 msgid "" ":attr:`arguments` is now of type :class:`dict`. Formerly, it was of type :" "class:`collections.OrderedDict`." msgstr "" -#: ../../library/inspect.rst:956 +#: ../../library/inspect.rst:960 msgid "" "A tuple of positional arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:961 +#: ../../library/inspect.rst:965 msgid "" "A dict of keyword arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:966 +#: ../../library/inspect.rst:970 msgid "A reference to the parent :class:`Signature` object." msgstr "" -#: ../../library/inspect.rst:970 +#: ../../library/inspect.rst:974 msgid "Set default values for missing arguments." msgstr "為遺漏的引數設定預設值。" -#: ../../library/inspect.rst:972 +#: ../../library/inspect.rst:976 msgid "" "For variable-positional arguments (``*args``) the default is an empty tuple." msgstr "" -#: ../../library/inspect.rst:975 +#: ../../library/inspect.rst:979 msgid "" "For variable-keyword arguments (``**kwargs``) the default is an empty dict." msgstr "" -#: ../../library/inspect.rst:988 +#: ../../library/inspect.rst:992 msgid "" "The :attr:`args` and :attr:`kwargs` properties can be used to invoke " "functions:" msgstr "" -#: ../../library/inspect.rst:1003 +#: ../../library/inspect.rst:1007 msgid ":pep:`362` - Function Signature Object." msgstr "" -#: ../../library/inspect.rst:1004 +#: ../../library/inspect.rst:1008 msgid "The detailed specification, implementation details and examples." msgstr "" -#: ../../library/inspect.rst:1010 +#: ../../library/inspect.rst:1014 msgid "Classes and functions" msgstr "類別與函式" -#: ../../library/inspect.rst:1014 +#: ../../library/inspect.rst:1018 msgid "" "Arrange the given list of classes into a hierarchy of nested lists. Where a " "nested list appears, it contains classes derived from the class whose entry " @@ -1285,19 +1287,19 @@ msgid "" "will appear multiple times." msgstr "" -#: ../../library/inspect.rst:1025 +#: ../../library/inspect.rst:1029 msgid "" "Get the names and default values of a Python function's parameters. A :term:" "`named tuple` is returned:" msgstr "" -#: ../../library/inspect.rst:1028 +#: ../../library/inspect.rst:1032 msgid "" "``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, " "annotations)``" msgstr "" -#: ../../library/inspect.rst:1031 +#: ../../library/inspect.rst:1035 msgid "" "*args* is a list of the positional parameter names. *varargs* is the name of " "the ``*`` parameter or ``None`` if arbitrary positional arguments are not " @@ -1312,7 +1314,7 @@ msgid "" "report the function return value annotation (if any)." msgstr "" -#: ../../library/inspect.rst:1046 +#: ../../library/inspect.rst:1050 msgid "" "Note that :func:`signature` and :ref:`Signature Object ` provide the recommended API for callable introspection, and support " @@ -1322,14 +1324,14 @@ msgid "" "``inspect`` module API." msgstr "" -#: ../../library/inspect.rst:1053 +#: ../../library/inspect.rst:1057 msgid "" "This function is now based on :func:`signature`, but still ignores " "``__wrapped__`` attributes and includes the already bound first parameter in " "the signature output for bound methods." msgstr "" -#: ../../library/inspect.rst:1058 +#: ../../library/inspect.rst:1062 msgid "" "This method was previously documented as deprecated in favour of :func:" "`signature` in Python 3.5, but that decision has been reversed in order to " @@ -1337,7 +1339,7 @@ msgid "" "code migrating away from the legacy :func:`getargspec` API." msgstr "" -#: ../../library/inspect.rst:1073 +#: ../../library/inspect.rst:1077 msgid "" "Get information about arguments passed into a particular frame. A :term:" "`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. " @@ -1346,18 +1348,18 @@ msgid "" "dictionary of the given frame." msgstr "" -#: ../../library/inspect.rst:1080 ../../library/inspect.rst:1090 +#: ../../library/inspect.rst:1084 ../../library/inspect.rst:1094 msgid "This function was inadvertently marked as deprecated in Python 3.5." msgstr "" -#: ../../library/inspect.rst:1085 +#: ../../library/inspect.rst:1089 msgid "" "Format a pretty argument spec from the four values returned by :func:" "`getargvalues`. The format\\* arguments are the corresponding optional " "formatting functions that are called to turn names and values into strings." msgstr "" -#: ../../library/inspect.rst:1095 +#: ../../library/inspect.rst:1099 msgid "" "Return a tuple of class cls's base classes, including cls, in method " "resolution order. No class appears more than once in this tuple. Note that " @@ -1365,7 +1367,7 @@ msgid "" "user-defined metatype is in use, cls will be the first element of the tuple." msgstr "" -#: ../../library/inspect.rst:1103 +#: ../../library/inspect.rst:1107 msgid "" "Bind the *args* and *kwds* to the argument names of the Python function or " "method *func*, as if it was called with them. For bound methods, bind also " @@ -1378,11 +1380,11 @@ msgid "" "example:" msgstr "" -#: ../../library/inspect.rst:1129 +#: ../../library/inspect.rst:1133 msgid "Use :meth:`Signature.bind` and :meth:`Signature.bind_partial` instead." msgstr "請改用 :meth:`Signature.bind` 與 :meth:`Signature.bind_partial`。" -#: ../../library/inspect.rst:1135 +#: ../../library/inspect.rst:1139 msgid "" "Get the mapping of external name references in a Python function or method " "*func* to their current values. A :term:`named tuple` " @@ -1394,18 +1396,18 @@ msgid "" "builtins." msgstr "" -#: ../../library/inspect.rst:1144 +#: ../../library/inspect.rst:1148 msgid "" ":exc:`TypeError` is raised if *func* is not a Python function or method." msgstr "如果 *func* 不是 Python 函式或方法,則引發 :exc:`TypeError`。" -#: ../../library/inspect.rst:1151 +#: ../../library/inspect.rst:1155 msgid "" "Get the object wrapped by *func*. It follows the chain of :attr:" "`__wrapped__` attributes returning the last object in the chain." msgstr "" -#: ../../library/inspect.rst:1154 +#: ../../library/inspect.rst:1158 msgid "" "*stop* is an optional callback accepting an object in the wrapper chain as " "its sole argument that allows the unwrapping to be terminated early if the " @@ -1415,68 +1417,68 @@ msgid "" "``__signature__`` attribute defined." msgstr "" -#: ../../library/inspect.rst:1161 +#: ../../library/inspect.rst:1165 msgid ":exc:`ValueError` is raised if a cycle is encountered." msgstr "如果遇到循環,則引發 :exc:`ValueError`。" -#: ../../library/inspect.rst:1168 +#: ../../library/inspect.rst:1172 msgid "Compute the annotations dict for an object." msgstr "" -#: ../../library/inspect.rst:1170 +#: ../../library/inspect.rst:1174 msgid "" "``obj`` may be a callable, class, or module. Passing in an object of any " "other type raises :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:1173 +#: ../../library/inspect.rst:1177 msgid "" "Returns a dict. ``get_annotations()`` returns a new dict every time it's " "called; calling it twice on the same object will return two different but " "equivalent dicts." msgstr "" -#: ../../library/inspect.rst:1177 +#: ../../library/inspect.rst:1181 msgid "This function handles several details for you:" msgstr "" -#: ../../library/inspect.rst:1179 +#: ../../library/inspect.rst:1183 msgid "" "If ``eval_str`` is true, values of type ``str`` will be un-stringized using :" "func:`eval()`. This is intended for use with stringized annotations (``from " "__future__ import annotations``)." msgstr "" -#: ../../library/inspect.rst:1183 +#: ../../library/inspect.rst:1187 msgid "" "If ``obj`` doesn't have an annotations dict, returns an empty dict. " "(Functions and methods always have an annotations dict; classes, modules, " "and other types of callables may not.)" msgstr "" -#: ../../library/inspect.rst:1187 +#: ../../library/inspect.rst:1191 msgid "" "Ignores inherited annotations on classes. If a class doesn't have its own " "annotations dict, returns an empty dict." msgstr "" -#: ../../library/inspect.rst:1189 +#: ../../library/inspect.rst:1193 msgid "" "All accesses to object members and dict values are done using ``getattr()`` " "and ``dict.get()`` for safety." msgstr "" -#: ../../library/inspect.rst:1191 +#: ../../library/inspect.rst:1195 msgid "Always, always, always returns a freshly created dict." msgstr "" -#: ../../library/inspect.rst:1193 +#: ../../library/inspect.rst:1197 msgid "" "``eval_str`` controls whether or not values of type ``str`` are replaced " "with the result of calling :func:`eval()` on those values:" msgstr "" -#: ../../library/inspect.rst:1196 +#: ../../library/inspect.rst:1200 msgid "" "If eval_str is true, :func:`eval()` is called on values of type ``str``. " "(Note that ``get_annotations`` doesn't catch exceptions; if :func:`eval()` " @@ -1484,12 +1486,12 @@ msgid "" "call.)" msgstr "" -#: ../../library/inspect.rst:1200 +#: ../../library/inspect.rst:1204 msgid "" "If eval_str is false (the default), values of type ``str`` are unchanged." msgstr "" -#: ../../library/inspect.rst:1202 +#: ../../library/inspect.rst:1206 msgid "" "``globals`` and ``locals`` are passed in to :func:`eval()`; see the " "documentation for :func:`eval()` for more information. If ``globals`` or " @@ -1497,35 +1499,35 @@ msgid "" "specific default, contingent on ``type(obj)``:" msgstr "" -#: ../../library/inspect.rst:1207 +#: ../../library/inspect.rst:1211 msgid "If ``obj`` is a module, ``globals`` defaults to ``obj.__dict__``." msgstr "" -#: ../../library/inspect.rst:1208 +#: ../../library/inspect.rst:1212 msgid "" "If ``obj`` is a class, ``globals`` defaults to ``sys.modules[obj.__module__]." "__dict__`` and ``locals`` defaults to the ``obj`` class namespace." msgstr "" -#: ../../library/inspect.rst:1211 +#: ../../library/inspect.rst:1215 msgid "" "If ``obj`` is a callable, ``globals`` defaults to :attr:`obj.__globals__ " "`, although if ``obj`` is a wrapped function (using :" "func:`functools.update_wrapper`) it is first unwrapped." msgstr "" -#: ../../library/inspect.rst:1216 +#: ../../library/inspect.rst:1220 msgid "" "Calling ``get_annotations`` is best practice for accessing the annotations " "dict of any object. See :ref:`annotations-howto` for more information on " "annotations best practices." msgstr "" -#: ../../library/inspect.rst:1226 +#: ../../library/inspect.rst:1230 msgid "The interpreter stack" msgstr "" -#: ../../library/inspect.rst:1228 +#: ../../library/inspect.rst:1232 msgid "" "Some of the following functions return :class:`FrameInfo` objects. For " "backwards compatibility these objects allow tuple-like operations on all " @@ -1533,95 +1535,95 @@ msgid "" "may be removed in the future." msgstr "" -#: ../../library/inspect.rst:1237 +#: ../../library/inspect.rst:1241 msgid "The :ref:`frame object ` that the record corresponds to." msgstr "" -#: ../../library/inspect.rst:1241 +#: ../../library/inspect.rst:1245 msgid "" "The file name associated with the code being executed by the frame this " "record corresponds to." msgstr "" -#: ../../library/inspect.rst:1246 +#: ../../library/inspect.rst:1250 msgid "" "The line number of the current line associated with the code being executed " "by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1251 +#: ../../library/inspect.rst:1255 msgid "" "The function name that is being executed by the frame this record " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1255 +#: ../../library/inspect.rst:1259 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1260 ../../library/inspect.rst:1299 +#: ../../library/inspect.rst:1264 ../../library/inspect.rst:1303 msgid "" "The index of the current line being executed in the :attr:`code_context` " "list." msgstr "" -#: ../../library/inspect.rst:1264 +#: ../../library/inspect.rst:1268 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1268 +#: ../../library/inspect.rst:1272 msgid "Return a :term:`named tuple` instead of a :class:`tuple`." msgstr "" -#: ../../library/inspect.rst:1271 +#: ../../library/inspect.rst:1275 msgid "" ":class:`!FrameInfo` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1280 +#: ../../library/inspect.rst:1284 msgid "" "The file name associated with the code being executed by the frame this " "traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1285 +#: ../../library/inspect.rst:1289 msgid "" "The line number of the current line associated with the code being executed " "by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1290 +#: ../../library/inspect.rst:1294 msgid "" "The function name that is being executed by the frame this traceback " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1294 +#: ../../library/inspect.rst:1298 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1303 +#: ../../library/inspect.rst:1307 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1308 +#: ../../library/inspect.rst:1312 msgid "" ":class:`!Traceback` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1315 +#: ../../library/inspect.rst:1319 msgid "" "Keeping references to frame objects, as found in the first element of the " "frame records these functions return, can cause your program to create " @@ -1633,7 +1635,7 @@ msgid "" "consumption which occurs." msgstr "" -#: ../../library/inspect.rst:1323 +#: ../../library/inspect.rst:1327 msgid "" "Though the cycle detector will catch these, destruction of the frames (and " "local variables) can be made deterministic by removing the cycle in a :" @@ -1641,31 +1643,31 @@ msgid "" "disabled when Python was compiled or using :func:`gc.disable`. For example::" msgstr "" -#: ../../library/inspect.rst:1335 +#: ../../library/inspect.rst:1339 msgid "" "If you want to keep the frame around (for example to print a traceback " "later), you can also break reference cycles by using the :meth:`frame.clear` " "method." msgstr "" -#: ../../library/inspect.rst:1339 +#: ../../library/inspect.rst:1343 msgid "" "The optional *context* argument supported by most of these functions " "specifies the number of lines of context to return, which are centered " "around the current line." msgstr "" -#: ../../library/inspect.rst:1346 +#: ../../library/inspect.rst:1350 msgid "" "Get information about a frame or traceback object. A :class:`Traceback` " "object is returned." msgstr "" -#: ../../library/inspect.rst:1349 +#: ../../library/inspect.rst:1353 msgid "A :class:`Traceback` object is returned instead of a named tuple." msgstr "" -#: ../../library/inspect.rst:1354 +#: ../../library/inspect.rst:1358 msgid "" "Get a list of :class:`FrameInfo` objects for a frame and all outer frames. " "These frames represent the calls that lead to the creation of *frame*. The " @@ -1673,19 +1675,19 @@ msgid "" "represents the outermost call on *frame*'s stack." msgstr "" -#: ../../library/inspect.rst:1359 ../../library/inspect.rst:1374 -#: ../../library/inspect.rst:1400 ../../library/inspect.rst:1415 +#: ../../library/inspect.rst:1363 ../../library/inspect.rst:1378 +#: ../../library/inspect.rst:1404 ../../library/inspect.rst:1419 msgid "" "A list of :term:`named tuples ` ``FrameInfo(frame, filename, " "lineno, function, code_context, index)`` is returned." msgstr "" -#: ../../library/inspect.rst:1364 ../../library/inspect.rst:1379 -#: ../../library/inspect.rst:1405 ../../library/inspect.rst:1420 +#: ../../library/inspect.rst:1368 ../../library/inspect.rst:1383 +#: ../../library/inspect.rst:1409 ../../library/inspect.rst:1424 msgid "A list of :class:`FrameInfo` objects is returned." msgstr "回傳一個 :class:`FrameInfo` 物件串列。" -#: ../../library/inspect.rst:1369 +#: ../../library/inspect.rst:1373 msgid "" "Get a list of :class:`FrameInfo` objects for a traceback's frame and all " "inner frames. These frames represent calls made as a consequence of " @@ -1693,11 +1695,11 @@ msgid "" "represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1384 +#: ../../library/inspect.rst:1388 msgid "Return the frame object for the caller's stack frame." msgstr "" -#: ../../library/inspect.rst:1388 +#: ../../library/inspect.rst:1392 msgid "" "This function relies on Python stack frame support in the interpreter, which " "isn't guaranteed to exist in all implementations of Python. If running in " @@ -1705,14 +1707,14 @@ msgid "" "``None``." msgstr "" -#: ../../library/inspect.rst:1396 +#: ../../library/inspect.rst:1400 msgid "" "Return a list of :class:`FrameInfo` objects for the caller's stack. The " "first entry in the returned list represents the caller; the last entry " "represents the outermost call on the stack." msgstr "" -#: ../../library/inspect.rst:1410 +#: ../../library/inspect.rst:1414 msgid "" "Return a list of :class:`FrameInfo` objects for the stack between the " "current frame and the frame in which an exception currently being handled " @@ -1720,11 +1722,11 @@ msgid "" "entry represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1424 +#: ../../library/inspect.rst:1428 msgid "Fetching attributes statically" msgstr "" -#: ../../library/inspect.rst:1426 +#: ../../library/inspect.rst:1430 msgid "" "Both :func:`getattr` and :func:`hasattr` can trigger code execution when " "fetching or checking for the existence of attributes. Descriptors, like " @@ -1732,20 +1734,20 @@ msgid "" "`~object.__getattribute__` may be called." msgstr "" -#: ../../library/inspect.rst:1432 +#: ../../library/inspect.rst:1436 msgid "" "For cases where you want passive introspection, like documentation tools, " "this can be inconvenient. :func:`getattr_static` has the same signature as :" "func:`getattr` but avoids executing code when it fetches attributes." msgstr "" -#: ../../library/inspect.rst:1438 +#: ../../library/inspect.rst:1442 msgid "" "Retrieve attributes without triggering dynamic lookup via the descriptor " "protocol, :meth:`~object.__getattr__` or :meth:`~object.__getattribute__`." msgstr "" -#: ../../library/inspect.rst:1442 +#: ../../library/inspect.rst:1446 msgid "" "Note: this function may not be able to retrieve all attributes that getattr " "can fetch (like dynamically created attributes) and may find attributes that " @@ -1753,31 +1755,31 @@ msgid "" "return descriptors objects instead of instance members." msgstr "" -#: ../../library/inspect.rst:1448 +#: ../../library/inspect.rst:1452 msgid "" "If the instance :attr:`~object.__dict__` is shadowed by another member (for " "example a property) then this function will be unable to find instance " "members." msgstr "" -#: ../../library/inspect.rst:1454 +#: ../../library/inspect.rst:1458 msgid "" ":func:`getattr_static` does not resolve descriptors, for example slot " "descriptors or getset descriptors on objects implemented in C. The " "descriptor object is returned instead of the underlying attribute." msgstr "" -#: ../../library/inspect.rst:1458 +#: ../../library/inspect.rst:1462 msgid "" "You can handle these with code like the following. Note that for arbitrary " "getset descriptors invoking these may trigger code execution::" msgstr "" -#: ../../library/inspect.rst:1484 +#: ../../library/inspect.rst:1488 msgid "Current State of Generators, Coroutines, and Asynchronous Generators" msgstr "" -#: ../../library/inspect.rst:1486 +#: ../../library/inspect.rst:1490 msgid "" "When implementing coroutine schedulers and for other advanced uses of " "generators, it is useful to determine whether a generator is currently " @@ -1786,32 +1788,32 @@ msgid "" "generator to be determined easily." msgstr "" -#: ../../library/inspect.rst:1494 +#: ../../library/inspect.rst:1498 msgid "Get current state of a generator-iterator." msgstr "" -#: ../../library/inspect.rst:1496 ../../library/inspect.rst:1512 -#: ../../library/inspect.rst:1529 +#: ../../library/inspect.rst:1500 ../../library/inspect.rst:1516 +#: ../../library/inspect.rst:1533 msgid "Possible states are:" msgstr "" -#: ../../library/inspect.rst:1498 +#: ../../library/inspect.rst:1502 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1499 +#: ../../library/inspect.rst:1503 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1500 +#: ../../library/inspect.rst:1504 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1501 +#: ../../library/inspect.rst:1505 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1507 +#: ../../library/inspect.rst:1511 msgid "" "Get current state of a coroutine object. The function is intended to be " "used with coroutine objects created by :keyword:`async def` functions, but " @@ -1819,23 +1821,23 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1514 +#: ../../library/inspect.rst:1518 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1515 +#: ../../library/inspect.rst:1519 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1516 +#: ../../library/inspect.rst:1520 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: ../../library/inspect.rst:1517 +#: ../../library/inspect.rst:1521 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1523 +#: ../../library/inspect.rst:1527 msgid "" "Get current state of an asynchronous generator object. The function is " "intended to be used with asynchronous iterator objects created by :keyword:" @@ -1844,30 +1846,30 @@ msgid "" "``ag_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1531 +#: ../../library/inspect.rst:1535 msgid "AGEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1532 +#: ../../library/inspect.rst:1536 msgid "AGEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1533 +#: ../../library/inspect.rst:1537 msgid "AGEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1534 +#: ../../library/inspect.rst:1538 msgid "AGEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1538 +#: ../../library/inspect.rst:1542 msgid "" "The current internal state of the generator can also be queried. This is " "mostly useful for testing purposes, to ensure that internal state is being " "updated as expected:" msgstr "" -#: ../../library/inspect.rst:1544 +#: ../../library/inspect.rst:1548 msgid "" "Get the mapping of live local variables in *generator* to their current " "values. A dictionary is returned that maps from variable names to values. " @@ -1875,14 +1877,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: ../../library/inspect.rst:1549 +#: ../../library/inspect.rst:1553 msgid "" "If *generator* is a :term:`generator` with no currently associated frame, " "then an empty dictionary is returned. :exc:`TypeError` is raised if " "*generator* is not a Python generator object." msgstr "" -#: ../../library/inspect.rst:1555 +#: ../../library/inspect.rst:1559 msgid "" "This function relies on the generator exposing a Python stack frame for " "introspection, which isn't guaranteed to be the case in all implementations " @@ -1890,79 +1892,79 @@ msgid "" "dictionary." msgstr "" -#: ../../library/inspect.rst:1564 +#: ../../library/inspect.rst:1568 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: ../../library/inspect.rst:1571 +#: ../../library/inspect.rst:1575 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for asynchronous generator objects created by :keyword:`async def` functions " "which use the :keyword:`yield` statement." msgstr "" -#: ../../library/inspect.rst:1581 +#: ../../library/inspect.rst:1585 msgid "Code Objects Bit Flags" msgstr "" -#: ../../library/inspect.rst:1583 +#: ../../library/inspect.rst:1587 msgid "" "Python code objects have a :attr:`~codeobject.co_flags` attribute, which is " "a bitmap of the following flags:" msgstr "" -#: ../../library/inspect.rst:1588 +#: ../../library/inspect.rst:1592 msgid "The code object is optimized, using fast locals." msgstr "" -#: ../../library/inspect.rst:1592 +#: ../../library/inspect.rst:1596 msgid "" "If set, a new dict will be created for the frame's :attr:`~frame.f_locals` " "when the code object is executed." msgstr "" -#: ../../library/inspect.rst:1597 +#: ../../library/inspect.rst:1601 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: ../../library/inspect.rst:1601 +#: ../../library/inspect.rst:1605 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: ../../library/inspect.rst:1605 +#: ../../library/inspect.rst:1609 msgid "The flag is set when the code object is a nested function." msgstr "" -#: ../../library/inspect.rst:1609 +#: ../../library/inspect.rst:1613 msgid "" "The flag is set when the code object is a generator function, i.e. a " "generator object is returned when the code object is executed." msgstr "" -#: ../../library/inspect.rst:1614 +#: ../../library/inspect.rst:1618 msgid "" "The flag is set when the code object is a coroutine function. When the code " "object is executed it returns a coroutine object. See :pep:`492` for more " "details." msgstr "" -#: ../../library/inspect.rst:1622 +#: ../../library/inspect.rst:1626 msgid "" "The flag is used to transform generators into generator-based coroutines. " "Generator objects with this flag can be used in ``await`` expression, and " "can ``yield from`` coroutine objects. See :pep:`492` for more details." msgstr "" -#: ../../library/inspect.rst:1631 +#: ../../library/inspect.rst:1635 msgid "" "The flag is set when the code object is an asynchronous generator function. " "When the code object is executed it returns an asynchronous generator " "object. See :pep:`525` for more details." msgstr "" -#: ../../library/inspect.rst:1638 +#: ../../library/inspect.rst:1642 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -1970,39 +1972,39 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: ../../library/inspect.rst:1646 +#: ../../library/inspect.rst:1650 msgid "Buffer flags" msgstr "" -#: ../../library/inspect.rst:1650 +#: ../../library/inspect.rst:1654 msgid "" "This is an :class:`enum.IntFlag` that represents the flags that can be " "passed to the :meth:`~object.__buffer__` method of objects implementing the :" "ref:`buffer protocol `." msgstr "" -#: ../../library/inspect.rst:1654 +#: ../../library/inspect.rst:1658 msgid "The meaning of the flags is explained at :ref:`buffer-request-types`." msgstr "" -#: ../../library/inspect.rst:1681 +#: ../../library/inspect.rst:1685 msgid "Command Line Interface" msgstr "命令列介面" -#: ../../library/inspect.rst:1683 +#: ../../library/inspect.rst:1687 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: ../../library/inspect.rst:1688 +#: ../../library/inspect.rst:1692 msgid "" "By default, accepts the name of a module and prints the source of that " "module. A class or function within the module can be printed instead by " "appended a colon and the qualified name of the target object." msgstr "" -#: ../../library/inspect.rst:1694 +#: ../../library/inspect.rst:1698 msgid "" "Print information about the specified object rather than the source code" msgstr "" diff --git a/library/itertools.po b/library/itertools.po index 097243036d..d7608b8d6c 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-29 00:03+0000\n" +"POT-Creation-Date: 2024-03-01 00:03+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-" @@ -896,6 +896,6 @@ msgid "" "term:`generator`\\s which incur interpreter overhead." msgstr "" -#: ../../library/itertools.rst:1008 +#: ../../library/itertools.rst:989 msgid "The following recipes have a more mathematical flavor:" msgstr "" diff --git a/library/numbers.po b/library/numbers.po index 66b08f5c09..2a1e964fcd 100644 --- a/library/numbers.po +++ b/library/numbers.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-16 00:03+0000\n" +"POT-Creation-Date: 2024-03-01 00:03+0000\n" "PO-Revision-Date: 2022-11-16 04:57+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -208,11 +208,12 @@ msgstr "" "如果 ``A`` 有定義成一個接受 ``b`` 的 :meth:`~object.__add__`,不會發生問題。" #: ../../library/numbers.rst:166 +#, fuzzy msgid "" "If ``A`` falls back to the boilerplate code, and it were to return a value " "from :meth:`~object.__add__`, we'd miss the possibility that ``B`` defines a " "more intelligent :meth:`~object.__radd__`, so the boilerplate should return :" -"const:`NotImplemented` from :meth:`!__add__`. (Or ``A`` may not implement :" +"data:`NotImplemented` from :meth:`!__add__`. (Or ``A`` may not implement :" "meth:`!__add__` at all.)" msgstr "" "如果 ``A`` 回退成模板程式碼,它將回傳一個來自 :meth:`~object.__add__` 的值," diff --git a/library/pickle.po b/library/pickle.po index 5b383fae66..5616534be0 100644 --- a/library/pickle.po +++ b/library/pickle.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-18 00:03+0000\n" +"POT-Creation-Date: 2024-03-01 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -512,7 +512,7 @@ msgid "" "Special reducer that can be defined in :class:`Pickler` subclasses. This " "method has priority over any reducer in the :attr:`dispatch_table`. It " "should conform to the same interface as a :meth:`~object.__reduce__` method, " -"and can optionally return ``NotImplemented`` to fallback on :attr:" +"and can optionally return :data:`NotImplemented` to fallback on :attr:" "`dispatch_table`-registered reducers to pickle ``obj``." msgstr "" @@ -666,8 +666,8 @@ msgstr "" #: ../../library/pickle.rst:497 msgid "" -"built-in constants (``None``, ``True``, ``False``, ``Ellipsis``, and " -"``NotImplemented``);" +"built-in constants (``None``, ``True``, ``False``, ``Ellipsis``, and :data:" +"`NotImplemented`);" msgstr "" #: ../../library/pickle.rst:500 @@ -1114,7 +1114,7 @@ msgid "" "For those cases, it is possible to subclass from the :class:`Pickler` class " "and implement a :meth:`~Pickler.reducer_override` method. This method can " "return an arbitrary reduction tuple (see :meth:`~object.__reduce__`). It can " -"alternatively return ``NotImplemented`` to fallback to the traditional " +"alternatively return :data:`NotImplemented` to fallback to the traditional " "behavior." msgstr "" diff --git a/library/ssl.po b/library/ssl.po index 3b3d5fb05d..b687c635f0 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -598,7 +598,7 @@ msgstr "" "組 OIDS 來指定憑證的用途,或是如果憑證對所有用途都可以使用則回傳 ``True``。" #: ../../library/ssl.rst:426 ../../library/ssl.rst:1542 -#: ../../library/ssl.rst:1837 +#: ../../library/ssl.rst:1840 msgid "Example::" msgstr "範例: ::" @@ -654,7 +654,7 @@ msgstr "" "在伺服器模式下,不會從客戶端請求任何憑證,所以客戶端不用發送任何用於客戶端憑" "證身分驗證的憑證。" -#: ../../library/ssl.rst:470 ../../library/ssl.rst:2245 +#: ../../library/ssl.rst:470 ../../library/ssl.rst:2248 msgid "See the discussion of :ref:`ssl-security` below." msgstr "參閱下方 :ref:`ssl-security` 的討論。" @@ -2191,28 +2191,34 @@ msgstr "" #: ../../library/ssl.rst:1768 msgid "" +"To wrap an :class:`SSLSocket` in another :class:`SSLSocket`, use :meth:" +"`SSLContext.wrap_bio`." +msgstr "" + +#: ../../library/ssl.rst:1771 +msgid "" "Always allow a server_hostname to be passed, even if OpenSSL does not have " "SNI." msgstr "" -#: ../../library/ssl.rst:1772 ../../library/ssl.rst:1798 +#: ../../library/ssl.rst:1775 ../../library/ssl.rst:1801 msgid "*session* argument was added." msgstr "新增 *session* 引數。" -#: ../../library/ssl.rst:1775 +#: ../../library/ssl.rst:1778 msgid "" "The method returns an instance of :attr:`SSLContext.sslsocket_class` instead " "of hard-coded :class:`SSLSocket`." msgstr "" -#: ../../library/ssl.rst:1781 +#: ../../library/ssl.rst:1784 msgid "" "The return type of :meth:`SSLContext.wrap_socket`, defaults to :class:" "`SSLSocket`. The attribute can be overridden on instance of class in order " "to return a custom subclass of :class:`SSLSocket`." msgstr "" -#: ../../library/ssl.rst:1790 +#: ../../library/ssl.rst:1793 msgid "" "Wrap the BIO objects *incoming* and *outgoing* and return an instance of :" "attr:`SSLContext.sslobject_class` (default :class:`SSLObject`). The SSL " @@ -2220,26 +2226,26 @@ msgid "" "outgoing BIO." msgstr "" -#: ../../library/ssl.rst:1795 +#: ../../library/ssl.rst:1798 msgid "" "The *server_side*, *server_hostname* and *session* parameters have the same " "meaning as in :meth:`SSLContext.wrap_socket`." msgstr "" -#: ../../library/ssl.rst:1801 +#: ../../library/ssl.rst:1804 msgid "" "The method returns an instance of :attr:`SSLContext.sslobject_class` instead " "of hard-coded :class:`SSLObject`." msgstr "" -#: ../../library/ssl.rst:1807 +#: ../../library/ssl.rst:1810 msgid "" "The return type of :meth:`SSLContext.wrap_bio`, defaults to :class:" "`SSLObject`. The attribute can be overridden on instance of class in order " "to return a custom subclass of :class:`SSLObject`." msgstr "" -#: ../../library/ssl.rst:1815 +#: ../../library/ssl.rst:1818 msgid "" "Get statistics about the SSL sessions created or managed by this context. A " "dictionary is returned which maps the names of each `piece of information " @@ -2248,7 +2254,7 @@ msgid "" "misses in the session cache since the context was created::" msgstr "" -#: ../../library/ssl.rst:1826 +#: ../../library/ssl.rst:1829 msgid "" "Whether to match the peer cert's hostname in :meth:`SSLSocket.do_handshake`. " "The context's :attr:`~SSLContext.verify_mode` must be set to :data:" @@ -2261,7 +2267,7 @@ msgid "" "With other protocols, hostname checking must be enabled explicitly." msgstr "" -#: ../../library/ssl.rst:1854 +#: ../../library/ssl.rst:1857 msgid "" ":attr:`~SSLContext.verify_mode` is now automatically changed to :data:" "`CERT_REQUIRED` when hostname checking is enabled and :attr:`~SSLContext." @@ -2269,7 +2275,7 @@ msgid "" "failed with a :exc:`ValueError`." msgstr "" -#: ../../library/ssl.rst:1861 +#: ../../library/ssl.rst:1864 msgid "" "Write TLS keys to a keylog file, whenever key material is generated or " "received. The keylog file is designed for debugging purposes only. The file " @@ -2278,7 +2284,7 @@ msgid "" "synchronized between threads, but not between processes." msgstr "" -#: ../../library/ssl.rst:1871 +#: ../../library/ssl.rst:1874 msgid "" "A :class:`TLSVersion` enum member representing the highest supported TLS " "version. The value defaults to :attr:`TLSVersion.MAXIMUM_SUPPORTED`. The " @@ -2286,7 +2292,7 @@ msgid "" "`PROTOCOL_TLS_CLIENT`, and :attr:`PROTOCOL_TLS_SERVER`." msgstr "" -#: ../../library/ssl.rst:1876 +#: ../../library/ssl.rst:1879 msgid "" "The attributes :attr:`~SSLContext.maximum_version`, :attr:`~SSLContext." "minimum_version` and :attr:`SSLContext.options` all affect the supported SSL " @@ -2296,38 +2302,38 @@ msgid "" "`TLSVersion.TLSv1_2` will not be able to establish a TLS 1.2 connection." msgstr "" -#: ../../library/ssl.rst:1889 +#: ../../library/ssl.rst:1892 msgid "" "Like :attr:`SSLContext.maximum_version` except it is the lowest supported " "version or :attr:`TLSVersion.MINIMUM_SUPPORTED`." msgstr "" -#: ../../library/ssl.rst:1896 +#: ../../library/ssl.rst:1899 msgid "" "Control the number of TLS 1.3 session tickets of a :attr:" "`PROTOCOL_TLS_SERVER` context. The setting has no impact on TLS 1.0 to 1.2 " "connections." msgstr "" -#: ../../library/ssl.rst:1904 +#: ../../library/ssl.rst:1907 msgid "" "An integer representing the set of SSL options enabled on this context. The " "default value is :data:`OP_ALL`, but you can specify other options such as :" "data:`OP_NO_SSLv2` by ORing them together." msgstr "" -#: ../../library/ssl.rst:1908 +#: ../../library/ssl.rst:1911 msgid ":attr:`SSLContext.options` returns :class:`Options` flags:" msgstr "" -#: ../../library/ssl.rst:1916 +#: ../../library/ssl.rst:1919 msgid "" "All ``OP_NO_SSL*`` and ``OP_NO_TLS*`` options have been deprecated since " "Python 3.7. Use :attr:`SSLContext.minimum_version` and :attr:`SSLContext." "maximum_version` instead." msgstr "" -#: ../../library/ssl.rst:1922 +#: ../../library/ssl.rst:1925 msgid "" "Enable TLS 1.3 post-handshake client authentication. Post-handshake auth is " "disabled by default and a server can only request a TLS client certificate " @@ -2335,13 +2341,13 @@ msgid "" "client certificate at any time after the handshake." msgstr "" -#: ../../library/ssl.rst:1927 +#: ../../library/ssl.rst:1930 msgid "" "When enabled on client-side sockets, the client signals the server that it " "supports post-handshake authentication." msgstr "" -#: ../../library/ssl.rst:1930 +#: ../../library/ssl.rst:1933 msgid "" "When enabled on server-side sockets, :attr:`SSLContext.verify_mode` must be " "set to :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`, too. The actual " @@ -2349,59 +2355,59 @@ msgid "" "verify_client_post_handshake` is called and some I/O is performed." msgstr "" -#: ../../library/ssl.rst:1940 +#: ../../library/ssl.rst:1943 msgid "" "The protocol version chosen when constructing the context. This attribute " "is read-only." msgstr "" -#: ../../library/ssl.rst:1945 +#: ../../library/ssl.rst:1948 msgid "" "Whether :attr:`~SSLContext.check_hostname` falls back to verify the cert's " "subject common name in the absence of a subject alternative name extension " "(default: true)." msgstr "" -#: ../../library/ssl.rst:1953 +#: ../../library/ssl.rst:1956 msgid "" "The flag had no effect with OpenSSL before version 1.1.1l. Python 3.8.9, " "3.9.3, and 3.10 include workarounds for previous versions." msgstr "" -#: ../../library/ssl.rst:1958 +#: ../../library/ssl.rst:1961 msgid "" "An integer representing the `security level `_ for the context. This " "attribute is read-only." msgstr "" -#: ../../library/ssl.rst:1966 +#: ../../library/ssl.rst:1969 msgid "" "The flags for certificate verification operations. You can set flags like :" "data:`VERIFY_CRL_CHECK_LEAF` by ORing them together. By default OpenSSL does " "neither require nor verify certificate revocation lists (CRLs)." msgstr "" -#: ../../library/ssl.rst:1972 +#: ../../library/ssl.rst:1975 msgid ":attr:`SSLContext.verify_flags` returns :class:`VerifyFlags` flags:" msgstr "" -#: ../../library/ssl.rst:1980 +#: ../../library/ssl.rst:1983 msgid "" "Whether to try to verify other peers' certificates and how to behave if " "verification fails. This attribute must be one of :data:`CERT_NONE`, :data:" "`CERT_OPTIONAL` or :data:`CERT_REQUIRED`." msgstr "" -#: ../../library/ssl.rst:1984 +#: ../../library/ssl.rst:1987 msgid ":attr:`SSLContext.verify_mode` returns :class:`VerifyMode` enum:" msgstr "" -#: ../../library/ssl.rst:1997 +#: ../../library/ssl.rst:2000 msgid "Certificates" msgstr "" -#: ../../library/ssl.rst:1999 +#: ../../library/ssl.rst:2002 msgid "" "Certificates in general are part of a public-key / private-key system. In " "this system, each *principal*, (which may be a machine, or a person, or an " @@ -2412,7 +2418,7 @@ msgid "" "other part, and **only** with the other part." msgstr "" -#: ../../library/ssl.rst:2007 +#: ../../library/ssl.rst:2010 msgid "" "A certificate contains information about two principals. It contains the " "name of a *subject*, and the subject's public key. It also contains a " @@ -2426,7 +2432,7 @@ msgid "" "as two fields, called \"notBefore\" and \"notAfter\"." msgstr "" -#: ../../library/ssl.rst:2017 +#: ../../library/ssl.rst:2020 msgid "" "In the Python use of certificates, a client or server can use a certificate " "to prove who they are. The other side of a network connection can also be " @@ -2439,18 +2445,18 @@ msgid "" "take place." msgstr "" -#: ../../library/ssl.rst:2027 +#: ../../library/ssl.rst:2030 msgid "" "Python uses files to contain certificates. They should be formatted as " "\"PEM\" (see :rfc:`1422`), which is a base-64 encoded form wrapped with a " "header line and a footer line::" msgstr "" -#: ../../library/ssl.rst:2036 +#: ../../library/ssl.rst:2039 msgid "Certificate chains" msgstr "" -#: ../../library/ssl.rst:2038 +#: ../../library/ssl.rst:2041 msgid "" "The Python files which contain certificates can contain a sequence of " "certificates, sometimes called a *certificate chain*. This chain should " @@ -2466,11 +2472,11 @@ msgid "" "agency which issued the certification authority's certificate::" msgstr "" -#: ../../library/ssl.rst:2062 +#: ../../library/ssl.rst:2065 msgid "CA certificates" msgstr "" -#: ../../library/ssl.rst:2064 +#: ../../library/ssl.rst:2067 msgid "" "If you are going to require validation of the other side of the connection's " "certificate, you need to provide a \"CA certs\" file, filled with the " @@ -2482,11 +2488,11 @@ msgid "" "create_default_context`." msgstr "" -#: ../../library/ssl.rst:2073 +#: ../../library/ssl.rst:2076 msgid "Combined key and certificate" msgstr "" -#: ../../library/ssl.rst:2075 +#: ../../library/ssl.rst:2078 msgid "" "Often the private key is stored in the same file as the certificate; in this " "case, only the ``certfile`` parameter to :meth:`SSLContext.load_cert_chain` " @@ -2494,11 +2500,11 @@ msgid "" "should come before the first certificate in the certificate chain::" msgstr "" -#: ../../library/ssl.rst:2089 +#: ../../library/ssl.rst:2092 msgid "Self-signed certificates" msgstr "" -#: ../../library/ssl.rst:2091 +#: ../../library/ssl.rst:2094 msgid "" "If you are going to create a server that provides SSL-encrypted connection " "services, you will need to acquire a certificate for that service. There " @@ -2508,51 +2514,51 @@ msgid "" "package, using something like the following::" msgstr "" -#: ../../library/ssl.rst:2120 +#: ../../library/ssl.rst:2123 msgid "" "The disadvantage of a self-signed certificate is that it is its own root " "certificate, and no one else will have it in their cache of known (and " "trusted) root certificates." msgstr "" -#: ../../library/ssl.rst:2126 +#: ../../library/ssl.rst:2129 msgid "Examples" msgstr "範例" -#: ../../library/ssl.rst:2129 +#: ../../library/ssl.rst:2132 msgid "Testing for SSL support" msgstr "" -#: ../../library/ssl.rst:2131 +#: ../../library/ssl.rst:2134 msgid "" "To test for the presence of SSL support in a Python installation, user code " "should use the following idiom::" msgstr "" -#: ../../library/ssl.rst:2142 +#: ../../library/ssl.rst:2145 msgid "Client-side operation" msgstr "" -#: ../../library/ssl.rst:2144 +#: ../../library/ssl.rst:2147 msgid "" "This example creates a SSL context with the recommended security settings " "for client sockets, including automatic certificate verification::" msgstr "" -#: ../../library/ssl.rst:2149 +#: ../../library/ssl.rst:2152 msgid "" "If you prefer to tune security settings yourself, you might create a context " "from scratch (but beware that you might not get the settings right)::" msgstr "" -#: ../../library/ssl.rst:2156 +#: ../../library/ssl.rst:2159 msgid "" "(this snippet assumes your operating system places a bundle of all CA " "certificates in ``/etc/ssl/certs/ca-bundle.crt``; if not, you'll get an " "error and have to adjust the location)" msgstr "" -#: ../../library/ssl.rst:2160 +#: ../../library/ssl.rst:2163 msgid "" "The :data:`PROTOCOL_TLS_CLIENT` protocol configures the context for cert " "validation and hostname verification. :attr:`~SSLContext.verify_mode` is set " @@ -2560,7 +2566,7 @@ msgid "" "``True``. All other protocols create SSL contexts with insecure defaults." msgstr "" -#: ../../library/ssl.rst:2165 +#: ../../library/ssl.rst:2168 msgid "" "When you use the context to connect to a server, :const:`CERT_REQUIRED` and :" "attr:`~SSLContext.check_hostname` validate the server certificate: it " @@ -2569,27 +2575,27 @@ msgid "" "properties like validity and identity of the hostname::" msgstr "" -#: ../../library/ssl.rst:2175 +#: ../../library/ssl.rst:2178 msgid "You may then fetch the certificate::" msgstr "" -#: ../../library/ssl.rst:2179 +#: ../../library/ssl.rst:2182 msgid "" "Visual inspection shows that the certificate does identify the desired " "service (that is, the HTTPS host ``www.python.org``)::" msgstr "" -#: ../../library/ssl.rst:2222 +#: ../../library/ssl.rst:2225 msgid "" "Now the SSL channel is established and the certificate verified, you can " "proceed to talk with the server::" msgstr "" -#: ../../library/ssl.rst:2249 +#: ../../library/ssl.rst:2252 msgid "Server-side operation" msgstr "" -#: ../../library/ssl.rst:2251 +#: ../../library/ssl.rst:2254 msgid "" "For server operation, typically you'll need to have a server certificate, " "and private key, each in a file. You'll first create a context holding the " @@ -2598,20 +2604,20 @@ msgid "" "start waiting for clients to connect::" msgstr "" -#: ../../library/ssl.rst:2266 +#: ../../library/ssl.rst:2269 msgid "" "When a client connects, you'll call :meth:`accept` on the socket to get the " "new socket from the other end, and use the context's :meth:`SSLContext." "wrap_socket` method to create a server-side SSL socket for the connection::" msgstr "" -#: ../../library/ssl.rst:2279 +#: ../../library/ssl.rst:2282 msgid "" "Then you'll read data from the ``connstream`` and do something with it till " "you are finished with the client (or the client is finished with you)::" msgstr "" -#: ../../library/ssl.rst:2293 +#: ../../library/ssl.rst:2296 msgid "" "And go back to listening for new client connections (of course, a real " "server would probably handle each client connection in a separate thread, or " @@ -2619,18 +2625,18 @@ msgid "" "event loop)." msgstr "" -#: ../../library/ssl.rst:2301 +#: ../../library/ssl.rst:2304 msgid "Notes on non-blocking sockets" msgstr "" -#: ../../library/ssl.rst:2303 +#: ../../library/ssl.rst:2306 msgid "" "SSL sockets behave slightly different than regular sockets in non-blocking " "mode. When working with non-blocking sockets, there are thus several things " "you need to be aware of:" msgstr "" -#: ../../library/ssl.rst:2307 +#: ../../library/ssl.rst:2310 msgid "" "Most :class:`SSLSocket` methods will raise either :exc:`SSLWantWriteError` " "or :exc:`SSLWantReadError` instead of :exc:`BlockingIOError` if an I/O " @@ -2642,13 +2648,13 @@ msgid "" "require a prior *write* to the underlying socket." msgstr "" -#: ../../library/ssl.rst:2319 +#: ../../library/ssl.rst:2322 msgid "" "In earlier Python versions, the :meth:`!SSLSocket.send` method returned zero " "instead of raising :exc:`SSLWantWriteError` or :exc:`SSLWantReadError`." msgstr "" -#: ../../library/ssl.rst:2323 +#: ../../library/ssl.rst:2326 msgid "" "Calling :func:`~select.select` tells you that the OS-level socket can be " "read from (or written to), but it does not imply that there is sufficient " @@ -2658,7 +2664,7 @@ msgid "" "`~select.select`." msgstr "" -#: ../../library/ssl.rst:2330 +#: ../../library/ssl.rst:2333 msgid "" "Conversely, since the SSL layer has its own framing, a SSL socket may still " "have data available for reading without :func:`~select.select` being aware " @@ -2667,13 +2673,13 @@ msgid "" "call if still necessary." msgstr "" -#: ../../library/ssl.rst:2336 +#: ../../library/ssl.rst:2339 msgid "" "(of course, similar provisions apply when using other primitives such as :" "func:`~select.poll`, or those in the :mod:`selectors` module)" msgstr "" -#: ../../library/ssl.rst:2339 +#: ../../library/ssl.rst:2342 msgid "" "The SSL handshake itself will be non-blocking: the :meth:`SSLSocket." "do_handshake` method has to be retried until it returns successfully. Here " @@ -2681,7 +2687,7 @@ msgid "" "readiness::" msgstr "" -#: ../../library/ssl.rst:2355 +#: ../../library/ssl.rst:2358 msgid "" "The :mod:`asyncio` module supports :ref:`non-blocking SSL sockets ` and provides a higher level API. It polls for events using " @@ -2690,26 +2696,26 @@ msgid "" "handshake asynchronously as well." msgstr "" -#: ../../library/ssl.rst:2364 +#: ../../library/ssl.rst:2367 msgid "Memory BIO Support" msgstr "" -#: ../../library/ssl.rst:2368 +#: ../../library/ssl.rst:2371 msgid "" "Ever since the SSL module was introduced in Python 2.6, the :class:" "`SSLSocket` class has provided two related but distinct areas of " "functionality:" msgstr "" -#: ../../library/ssl.rst:2371 +#: ../../library/ssl.rst:2374 msgid "SSL protocol handling" msgstr "" -#: ../../library/ssl.rst:2372 +#: ../../library/ssl.rst:2375 msgid "Network IO" msgstr "" -#: ../../library/ssl.rst:2374 +#: ../../library/ssl.rst:2377 msgid "" "The network IO API is identical to that provided by :class:`socket.socket`, " "from which :class:`SSLSocket` also inherits. This allows an SSL socket to be " @@ -2717,7 +2723,7 @@ msgid "" "add SSL support to an existing application." msgstr "" -#: ../../library/ssl.rst:2379 +#: ../../library/ssl.rst:2382 msgid "" "Combining SSL protocol handling and network IO usually works well, but there " "are some cases where it doesn't. An example is async IO frameworks that want " @@ -2729,7 +2735,7 @@ msgid "" "`SSLObject` is provided." msgstr "" -#: ../../library/ssl.rst:2390 +#: ../../library/ssl.rst:2393 msgid "" "A reduced-scope variant of :class:`SSLSocket` representing an SSL protocol " "instance that does not contain any network IO methods. This class is " @@ -2737,7 +2743,7 @@ msgid "" "for SSL through memory buffers." msgstr "" -#: ../../library/ssl.rst:2395 +#: ../../library/ssl.rst:2398 msgid "" "This class implements an interface on top of a low-level SSL object as " "implemented by OpenSSL. This object captures the state of an SSL connection " @@ -2745,7 +2751,7 @@ msgid "" "separate \"BIO\" objects which are OpenSSL's IO abstraction layer." msgstr "" -#: ../../library/ssl.rst:2400 +#: ../../library/ssl.rst:2403 msgid "" "This class has no public constructor. An :class:`SSLObject` instance must " "be created using the :meth:`~SSLContext.wrap_bio` method. This method will " @@ -2754,207 +2760,207 @@ msgid "" "instance, while the *outgoing* BIO is used to pass data the other way around." msgstr "" -#: ../../library/ssl.rst:2407 +#: ../../library/ssl.rst:2410 msgid "The following methods are available:" msgstr "" -#: ../../library/ssl.rst:2409 +#: ../../library/ssl.rst:2412 msgid ":attr:`~SSLSocket.context`" msgstr ":attr:`~SSLSocket.context`" -#: ../../library/ssl.rst:2410 +#: ../../library/ssl.rst:2413 msgid ":attr:`~SSLSocket.server_side`" msgstr ":attr:`~SSLSocket.server_side`" -#: ../../library/ssl.rst:2411 +#: ../../library/ssl.rst:2414 msgid ":attr:`~SSLSocket.server_hostname`" msgstr ":attr:`~SSLSocket.server_hostname`" -#: ../../library/ssl.rst:2412 +#: ../../library/ssl.rst:2415 msgid ":attr:`~SSLSocket.session`" msgstr ":attr:`~SSLSocket.session`" -#: ../../library/ssl.rst:2413 +#: ../../library/ssl.rst:2416 msgid ":attr:`~SSLSocket.session_reused`" msgstr ":attr:`~SSLSocket.session_reused`" -#: ../../library/ssl.rst:2414 +#: ../../library/ssl.rst:2417 msgid ":meth:`~SSLSocket.read`" msgstr ":meth:`~SSLSocket.read`" -#: ../../library/ssl.rst:2415 +#: ../../library/ssl.rst:2418 msgid ":meth:`~SSLSocket.write`" msgstr ":meth:`~SSLSocket.write`" -#: ../../library/ssl.rst:2416 +#: ../../library/ssl.rst:2419 msgid ":meth:`~SSLSocket.getpeercert`" msgstr ":meth:`~SSLSocket.getpeercert`" -#: ../../library/ssl.rst:2417 +#: ../../library/ssl.rst:2420 msgid ":meth:`~SSLSocket.selected_alpn_protocol`" msgstr ":meth:`~SSLSocket.selected_alpn_protocol`" -#: ../../library/ssl.rst:2418 +#: ../../library/ssl.rst:2421 msgid ":meth:`~SSLSocket.selected_npn_protocol`" msgstr ":meth:`~SSLSocket.selected_npn_protocol`" -#: ../../library/ssl.rst:2419 +#: ../../library/ssl.rst:2422 msgid ":meth:`~SSLSocket.cipher`" msgstr ":meth:`~SSLSocket.cipher`" -#: ../../library/ssl.rst:2420 +#: ../../library/ssl.rst:2423 msgid ":meth:`~SSLSocket.shared_ciphers`" msgstr ":meth:`~SSLSocket.shared_ciphers`" -#: ../../library/ssl.rst:2421 +#: ../../library/ssl.rst:2424 msgid ":meth:`~SSLSocket.compression`" msgstr ":meth:`~SSLSocket.compression`" -#: ../../library/ssl.rst:2422 +#: ../../library/ssl.rst:2425 msgid ":meth:`~SSLSocket.pending`" msgstr ":meth:`~SSLSocket.pending`" -#: ../../library/ssl.rst:2423 +#: ../../library/ssl.rst:2426 msgid ":meth:`~SSLSocket.do_handshake`" msgstr ":meth:`~SSLSocket.do_handshake`" -#: ../../library/ssl.rst:2424 +#: ../../library/ssl.rst:2427 msgid ":meth:`~SSLSocket.verify_client_post_handshake`" msgstr ":meth:`~SSLSocket.verify_client_post_handshake`" -#: ../../library/ssl.rst:2425 +#: ../../library/ssl.rst:2428 msgid ":meth:`~SSLSocket.unwrap`" msgstr ":meth:`~SSLSocket.unwrap`" -#: ../../library/ssl.rst:2426 +#: ../../library/ssl.rst:2429 msgid ":meth:`~SSLSocket.get_channel_binding`" msgstr ":meth:`~SSLSocket.get_channel_binding`" -#: ../../library/ssl.rst:2427 +#: ../../library/ssl.rst:2430 msgid ":meth:`~SSLSocket.version`" msgstr ":meth:`~SSLSocket.version`" -#: ../../library/ssl.rst:2429 +#: ../../library/ssl.rst:2432 msgid "" "When compared to :class:`SSLSocket`, this object lacks the following " "features:" msgstr "" -#: ../../library/ssl.rst:2432 +#: ../../library/ssl.rst:2435 msgid "" "Any form of network IO; ``recv()`` and ``send()`` read and write only to the " "underlying :class:`MemoryBIO` buffers." msgstr "" -#: ../../library/ssl.rst:2435 +#: ../../library/ssl.rst:2438 msgid "" "There is no *do_handshake_on_connect* machinery. You must always manually " "call :meth:`~SSLSocket.do_handshake` to start the handshake." msgstr "" -#: ../../library/ssl.rst:2438 +#: ../../library/ssl.rst:2441 msgid "" "There is no handling of *suppress_ragged_eofs*. All end-of-file conditions " "that are in violation of the protocol are reported via the :exc:" "`SSLEOFError` exception." msgstr "" -#: ../../library/ssl.rst:2442 +#: ../../library/ssl.rst:2445 msgid "" "The method :meth:`~SSLSocket.unwrap` call does not return anything, unlike " "for an SSL socket where it returns the underlying socket." msgstr "" -#: ../../library/ssl.rst:2445 +#: ../../library/ssl.rst:2448 msgid "" "The *server_name_callback* callback passed to :meth:`SSLContext." "set_servername_callback` will get an :class:`SSLObject` instance instead of " "a :class:`SSLSocket` instance as its first parameter." msgstr "" -#: ../../library/ssl.rst:2449 +#: ../../library/ssl.rst:2452 msgid "Some notes related to the use of :class:`SSLObject`:" msgstr "" -#: ../../library/ssl.rst:2451 +#: ../../library/ssl.rst:2454 msgid "" "All IO on an :class:`SSLObject` is :ref:`non-blocking `. " "This means that for example :meth:`~SSLSocket.read` will raise an :exc:" "`SSLWantReadError` if it needs more data than the incoming BIO has available." msgstr "" -#: ../../library/ssl.rst:2456 +#: ../../library/ssl.rst:2459 msgid "" ":class:`SSLObject` instances must be created with :meth:`~SSLContext." "wrap_bio`. In earlier versions, it was possible to create instances " "directly. This was never documented or officially supported." msgstr "" -#: ../../library/ssl.rst:2462 +#: ../../library/ssl.rst:2465 msgid "" "An SSLObject communicates with the outside world using memory buffers. The " "class :class:`MemoryBIO` provides a memory buffer that can be used for this " "purpose. It wraps an OpenSSL memory BIO (Basic IO) object:" msgstr "" -#: ../../library/ssl.rst:2468 +#: ../../library/ssl.rst:2471 msgid "" "A memory buffer that can be used to pass data between Python and an SSL " "protocol instance." msgstr "" -#: ../../library/ssl.rst:2473 +#: ../../library/ssl.rst:2476 msgid "Return the number of bytes currently in the memory buffer." msgstr "" -#: ../../library/ssl.rst:2477 +#: ../../library/ssl.rst:2480 msgid "" "A boolean indicating whether the memory BIO is current at the end-of-file " "position." msgstr "" -#: ../../library/ssl.rst:2482 +#: ../../library/ssl.rst:2485 msgid "" "Read up to *n* bytes from the memory buffer. If *n* is not specified or " "negative, all bytes are returned." msgstr "" -#: ../../library/ssl.rst:2487 +#: ../../library/ssl.rst:2490 msgid "" "Write the bytes from *buf* to the memory BIO. The *buf* argument must be an " "object supporting the buffer protocol." msgstr "" -#: ../../library/ssl.rst:2490 +#: ../../library/ssl.rst:2493 msgid "" "The return value is the number of bytes written, which is always equal to " "the length of *buf*." msgstr "" -#: ../../library/ssl.rst:2495 +#: ../../library/ssl.rst:2498 msgid "" "Write an EOF marker to the memory BIO. After this method has been called, it " "is illegal to call :meth:`~MemoryBIO.write`. The attribute :attr:`eof` will " "become true after all data currently in the buffer has been read." msgstr "" -#: ../../library/ssl.rst:2501 +#: ../../library/ssl.rst:2504 msgid "SSL session" msgstr "" -#: ../../library/ssl.rst:2507 +#: ../../library/ssl.rst:2510 msgid "Session object used by :attr:`~SSLSocket.session`." msgstr "" -#: ../../library/ssl.rst:2519 +#: ../../library/ssl.rst:2522 msgid "Security considerations" msgstr "" -#: ../../library/ssl.rst:2522 +#: ../../library/ssl.rst:2525 msgid "Best defaults" msgstr "" -#: ../../library/ssl.rst:2524 +#: ../../library/ssl.rst:2527 msgid "" "For **client use**, if you don't have any special requirements for your " "security policy, it is highly recommended that you use the :func:" @@ -2964,19 +2970,19 @@ msgid "" "settings." msgstr "" -#: ../../library/ssl.rst:2531 +#: ../../library/ssl.rst:2534 msgid "" "For example, here is how you would use the :class:`smtplib.SMTP` class to " "create a trusted, secure connection to a SMTP server::" msgstr "" -#: ../../library/ssl.rst:2540 +#: ../../library/ssl.rst:2543 msgid "" "If a client certificate is needed for the connection, it can be added with :" "meth:`SSLContext.load_cert_chain`." msgstr "" -#: ../../library/ssl.rst:2543 +#: ../../library/ssl.rst:2546 msgid "" "By contrast, if you create the SSL context by calling the :class:" "`SSLContext` constructor yourself, it will not have certificate validation " @@ -2984,15 +2990,15 @@ msgid "" "paragraphs below to achieve a good security level." msgstr "" -#: ../../library/ssl.rst:2549 +#: ../../library/ssl.rst:2552 msgid "Manual settings" msgstr "手動設定" -#: ../../library/ssl.rst:2552 +#: ../../library/ssl.rst:2555 msgid "Verifying certificates" msgstr "驗證憑證" -#: ../../library/ssl.rst:2554 +#: ../../library/ssl.rst:2557 msgid "" "When calling the :class:`SSLContext` constructor directly, :const:" "`CERT_NONE` is the default. Since it does not authenticate the other peer, " @@ -3007,13 +3013,13 @@ msgid "" "enabled." msgstr "" -#: ../../library/ssl.rst:2566 +#: ../../library/ssl.rst:2569 msgid "" "Hostname matchings is now performed by OpenSSL. Python no longer uses :func:" "`match_hostname`." msgstr "" -#: ../../library/ssl.rst:2570 +#: ../../library/ssl.rst:2573 msgid "" "In server mode, if you want to authenticate your clients using the SSL layer " "(rather than using a higher-level authentication mechanism), you'll also " @@ -3021,11 +3027,11 @@ msgid "" "certificate." msgstr "" -#: ../../library/ssl.rst:2576 +#: ../../library/ssl.rst:2579 msgid "Protocol versions" msgstr "協定版本" -#: ../../library/ssl.rst:2578 +#: ../../library/ssl.rst:2581 msgid "" "SSL versions 2 and 3 are considered insecure and are therefore dangerous to " "use. If you want maximum compatibility between clients and servers, it is " @@ -3034,7 +3040,7 @@ msgid "" "by default." msgstr "" -#: ../../library/ssl.rst:2591 +#: ../../library/ssl.rst:2594 msgid "" "The SSL context created above will only allow TLSv1.3 and later (if " "supported by your system) connections to a server. :const:" @@ -3042,11 +3048,11 @@ msgid "" "default. You have to load certificates into the context." msgstr "" -#: ../../library/ssl.rst:2598 +#: ../../library/ssl.rst:2601 msgid "Cipher selection" msgstr "" -#: ../../library/ssl.rst:2600 +#: ../../library/ssl.rst:2603 msgid "" "If you have advanced security requirements, fine-tuning of the ciphers " "enabled when negotiating a SSL session is possible through the :meth:" @@ -3059,11 +3065,11 @@ msgid "" "ciphers`` command on your system." msgstr "" -#: ../../library/ssl.rst:2611 +#: ../../library/ssl.rst:2614 msgid "Multi-processing" msgstr "" -#: ../../library/ssl.rst:2613 +#: ../../library/ssl.rst:2616 msgid "" "If using this module as part of a multi-processed application (using, for " "example the :mod:`multiprocessing` or :mod:`concurrent.futures` modules), be " @@ -3074,17 +3080,17 @@ msgid "" "sufficient." msgstr "" -#: ../../library/ssl.rst:2625 +#: ../../library/ssl.rst:2628 msgid "TLS 1.3" msgstr "TLS 1.3" -#: ../../library/ssl.rst:2629 +#: ../../library/ssl.rst:2632 msgid "" "The TLS 1.3 protocol behaves slightly differently than previous version of " "TLS/SSL. Some new TLS 1.3 features are not yet available." msgstr "" -#: ../../library/ssl.rst:2632 +#: ../../library/ssl.rst:2635 msgid "" "TLS 1.3 uses a disjunct set of cipher suites. All AES-GCM and ChaCha20 " "cipher suites are enabled by default. The method :meth:`SSLContext." @@ -3092,14 +3098,14 @@ msgid "" "`SSLContext.get_ciphers` returns them." msgstr "" -#: ../../library/ssl.rst:2636 +#: ../../library/ssl.rst:2639 msgid "" "Session tickets are no longer sent as part of the initial handshake and are " "handled differently. :attr:`SSLSocket.session` and :class:`SSLSession` are " "not compatible with TLS 1.3." msgstr "" -#: ../../library/ssl.rst:2639 +#: ../../library/ssl.rst:2642 msgid "" "Client-side certificates are also no longer verified during the initial " "handshake. A server can request a certificate at any time. Clients process " @@ -3107,21 +3113,21 @@ msgid "" "server." msgstr "" -#: ../../library/ssl.rst:2643 +#: ../../library/ssl.rst:2646 msgid "" "TLS 1.3 features like early data, deferred TLS client cert request, " "signature algorithm configuration, and rekeying are not supported yet." msgstr "" -#: ../../library/ssl.rst:2650 +#: ../../library/ssl.rst:2653 msgid "Class :class:`socket.socket`" msgstr ":class:`socket.socket` 類別" -#: ../../library/ssl.rst:2650 +#: ../../library/ssl.rst:2653 msgid "Documentation of underlying :mod:`socket` class" msgstr "底層 :mod:`socket` 類別的文件" -#: ../../library/ssl.rst:2653 +#: ../../library/ssl.rst:2656 msgid "" "`SSL/TLS Strong Encryption: An Introduction `_" @@ -3129,11 +3135,11 @@ msgstr "" "`SSL/TLS Strong Encryption: An Introduction `_" -#: ../../library/ssl.rst:2653 +#: ../../library/ssl.rst:2656 msgid "Intro from the Apache HTTP Server documentation" msgstr "Apache HTTP Server 文件的介紹" -#: ../../library/ssl.rst:2656 +#: ../../library/ssl.rst:2659 msgid "" ":rfc:`RFC 1422: Privacy Enhancement for Internet Electronic Mail: Part II: " "Certificate-Based Key Management <1422>`" @@ -3141,19 +3147,19 @@ msgstr "" ":rfc:`RFC 1422: Privacy Enhancement for Internet Electronic Mail: Part II: " "Certificate-Based Key Management <1422>`" -#: ../../library/ssl.rst:2656 +#: ../../library/ssl.rst:2659 msgid "Steve Kent" msgstr "Steve Kent" -#: ../../library/ssl.rst:2659 +#: ../../library/ssl.rst:2662 msgid ":rfc:`RFC 4086: Randomness Requirements for Security <4086>`" msgstr ":rfc:`RFC 4086: Randomness Requirements for Security <4086>`" -#: ../../library/ssl.rst:2659 +#: ../../library/ssl.rst:2662 msgid "Donald E., Jeffrey I. Schiller" msgstr "Donald E., Jeffrey I. Schiller" -#: ../../library/ssl.rst:2662 +#: ../../library/ssl.rst:2665 msgid "" ":rfc:`RFC 5280: Internet X.509 Public Key Infrastructure Certificate and " "Certificate Revocation List (CRL) Profile <5280>`" @@ -3161,11 +3167,11 @@ msgstr "" ":rfc:`RFC 5280: Internet X.509 Public Key Infrastructure Certificate and " "Certificate Revocation List (CRL) Profile <5280>`" -#: ../../library/ssl.rst:2662 +#: ../../library/ssl.rst:2665 msgid "D. Cooper" msgstr "D. Cooper" -#: ../../library/ssl.rst:2665 +#: ../../library/ssl.rst:2668 msgid "" ":rfc:`RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 " "<5246>`" @@ -3173,19 +3179,19 @@ msgstr "" ":rfc:`RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 " "<5246>`" -#: ../../library/ssl.rst:2665 +#: ../../library/ssl.rst:2668 msgid "T. Dierks et. al." msgstr "T. Dierks et. al." -#: ../../library/ssl.rst:2668 +#: ../../library/ssl.rst:2671 msgid ":rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`" msgstr ":rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`" -#: ../../library/ssl.rst:2668 +#: ../../library/ssl.rst:2671 msgid "D. Eastlake" msgstr "D. Eastlake" -#: ../../library/ssl.rst:2671 +#: ../../library/ssl.rst:2674 msgid "" "`IANA TLS: Transport Layer Security (TLS) Parameters `_" @@ -3193,11 +3199,11 @@ msgstr "" "`IANA TLS: Transport Layer Security (TLS) Parameters `_" -#: ../../library/ssl.rst:2671 +#: ../../library/ssl.rst:2674 msgid "IANA" msgstr "IANA" -#: ../../library/ssl.rst:2674 +#: ../../library/ssl.rst:2677 msgid "" ":rfc:`RFC 7525: Recommendations for Secure Use of Transport Layer Security " "(TLS) and Datagram Transport Layer Security (DTLS) <7525>`" @@ -3205,11 +3211,11 @@ msgstr "" ":rfc:`RFC 7525: Recommendations for Secure Use of Transport Layer Security " "(TLS) and Datagram Transport Layer Security (DTLS) <7525>`" -#: ../../library/ssl.rst:2674 +#: ../../library/ssl.rst:2677 msgid "IETF" msgstr "IETF" -#: ../../library/ssl.rst:2676 +#: ../../library/ssl.rst:2679 msgid "" "`Mozilla's Server Side TLS recommendations `_" @@ -3217,7 +3223,7 @@ msgstr "" "`Mozilla's Server Side TLS recommendations `_" -#: ../../library/ssl.rst:2677 +#: ../../library/ssl.rst:2680 msgid "Mozilla" msgstr "Mozilla" @@ -3245,10 +3251,10 @@ msgstr "Transport Layer Security(傳輸層安全)" msgid "Secure Sockets Layer" msgstr "Secure Sockets Layer(安全 socket 層)" -#: ../../library/ssl.rst:1990 +#: ../../library/ssl.rst:1993 msgid "certificates" msgstr "certificates(憑證)" -#: ../../library/ssl.rst:1992 +#: ../../library/ssl.rst:1995 msgid "X509 certificate" msgstr "X509 certificate(X509 憑證)" diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 24bcd16265..75c049252b 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -2175,19 +2175,23 @@ msgid "Methods and their defaults:" msgstr "方法及其預設值:" #: ../../library/unittest.mock.rst:2097 -msgid "``__lt__``: ``NotImplemented``" +#, fuzzy +msgid "``__lt__``: :data:`NotImplemented`" msgstr "``__lt__``\\ :\\ ``NotImplemented``" #: ../../library/unittest.mock.rst:2098 -msgid "``__gt__``: ``NotImplemented``" +#, fuzzy +msgid "``__gt__``: :data:`!NotImplemented`" msgstr "``__gt__``\\ :\\ ``NotImplemented``" #: ../../library/unittest.mock.rst:2099 -msgid "``__le__``: ``NotImplemented``" +#, fuzzy +msgid "``__le__``: :data:`!NotImplemented`" msgstr "``__le__``\\ :\\ ``NotImplemented``" #: ../../library/unittest.mock.rst:2100 -msgid "``__ge__``: ``NotImplemented``" +#, fuzzy +msgid "``__ge__``: :data:`!NotImplemented`" msgstr "``__ge__``\\ :\\ ``NotImplemented``" #: ../../library/unittest.mock.rst:2101 diff --git a/reference/datamodel.po b/reference/datamodel.po index a389934c1f..762bedddaa 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-26 00:03+0000\n" +"POT-Creation-Date: 2024-03-01 00:03+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-" @@ -176,7 +176,7 @@ msgstr "NotImplemented" #: ../../reference/datamodel.rst:161 msgid "" "This type has a single value. There is a single object with this value. " -"This object is accessed through the built-in name ``NotImplemented``. " +"This object is accessed through the built-in name :data:`NotImplemented`. " "Numeric methods and rich comparison methods should return this value if they " "do not implement the operation for the operands provided. (The interpreter " "will then try the reflected operation, or some other fallback, depending on " @@ -189,8 +189,8 @@ msgstr "更多細節請見 :ref:`implementing-the-arithmetic-operations`\\ 。" #: ../../reference/datamodel.rst:172 msgid "" -"Evaluating ``NotImplemented`` in a boolean context is deprecated. While it " -"currently evaluates as true, it will emit a :exc:`DeprecationWarning`. It " +"Evaluating :data:`NotImplemented` in a boolean context is deprecated. While " +"it currently evaluates as true, it will emit a :exc:`DeprecationWarning`. It " "will raise a :exc:`TypeError` in a future version of Python." msgstr "" @@ -1986,8 +1986,8 @@ msgstr "" #: ../../reference/datamodel.rst:1783 msgid "" -"A rich comparison method may return the singleton ``NotImplemented`` if it " -"does not implement the operation for a given pair of arguments. By " +"A rich comparison method may return the singleton :data:`NotImplemented` if " +"it does not implement the operation for a given pair of arguments. By " "convention, ``False`` and ``True`` are returned for a successful comparison. " "However, these methods can return any value, so if the comparison operator " "is used in a Boolean context (e.g., in the condition of an ``if`` " @@ -1997,11 +1997,11 @@ msgstr "" #: ../../reference/datamodel.rst:1790 msgid "" -"By default, ``object`` implements :meth:`__eq__` by using ``is``, returning " -"``NotImplemented`` in the case of a false comparison: ``True if x is y else " -"NotImplemented``. For :meth:`__ne__`, by default it delegates to :meth:" -"`__eq__` and inverts the result unless it is ``NotImplemented``. There are " -"no other implied relationships among the comparison operators or default " +"By default, ``object`` implements :meth:`__eq__` by using ``is``, returning :" +"data:`NotImplemented` in the case of a false comparison: ``True if x is y " +"else NotImplemented``. For :meth:`__ne__`, by default it delegates to :meth:" +"`__eq__` and inverts the result unless it is :data:`!NotImplemented`. There " +"are no other implied relationships among the comparison operators or default " "implementations; for example, the truth of ``(x=`` 0. The return value may also be :const:" +"The length must be an integer ``>=`` 0. The return value may also be :data:" "`NotImplemented`, which is treated the same as if the ``__length_hint__`` " "method didn't exist at all. This method is purely an optimization and is " "never required for correctness." @@ -3355,7 +3355,7 @@ msgstr "" #: ../../reference/datamodel.rst:2975 msgid "" "If one of those methods does not support the operation with the supplied " -"arguments, it should return ``NotImplemented``." +"arguments, it should return :data:`NotImplemented`." msgstr "" #: ../../reference/datamodel.rst:2998 @@ -3367,8 +3367,8 @@ msgid "" "support the corresponding operation [#]_ and the operands are of different " "types. [#]_ For instance, to evaluate the expression ``x - y``, where *y* is " "an instance of a class that has an :meth:`__rsub__` method, ``type(y)." -"__rsub__(y, x)`` is called if ``type(x).__sub__(x, y)`` returns " -"*NotImplemented*." +"__rsub__(y, x)`` is called if ``type(x).__sub__(x, y)`` returns :data:" +"`NotImplemented`." msgstr "" #: ../../reference/datamodel.rst:3010 @@ -3857,8 +3857,8 @@ msgstr "" #: ../../reference/datamodel.rst:3497 msgid "" "\"Does not support\" here means that the class has no such method, or the " -"method returns ``NotImplemented``. Do not set the method to ``None`` if you " -"want to force fallback to the right operand's reflected method—that will " +"method returns :data:`NotImplemented`. Do not set the method to ``None`` if " +"you want to force fallback to the right operand's reflected method—that will " "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" diff --git a/reference/expressions.po b/reference/expressions.po index 86faa5aec9..53692df74d 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-31 00:03+0000\n" +"POT-Creation-Date: 2024-03-01 00:03+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-" @@ -1577,7 +1577,7 @@ msgstr "" #: ../../reference/expressions.rst:1535 msgid "" -"``None`` and ``NotImplemented`` are singletons. :PEP:`8` advises that " +"``None`` and :data:`NotImplemented` are singletons. :PEP:`8` advises that " "comparisons for singletons should always be done with ``is`` or ``is not``, " "never the equality operators." msgstr "" diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 4c81374906..ef5ace9505 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-13 00:03+0000\n" +"POT-Creation-Date: 2024-03-01 00:03+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-" @@ -1186,8 +1186,8 @@ msgstr "" #: ../../whatsnew/2.7.rst:1132 msgid "" "Finally, the :class:`~collections.abc.Mapping` abstract base class now " -"returns :const:`NotImplemented` if a mapping is compared to another type " -"that isn't a :class:`Mapping`. (Fixed by Daniel Stutzbach; :issue:`8729`.)" +"returns :data:`NotImplemented` if a mapping is compared to another type that " +"isn't a :class:`Mapping`. (Fixed by Daniel Stutzbach; :issue:`8729`.)" msgstr "" #: ../../whatsnew/2.7.rst:1137 diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index 8709e77e02..605d4b8c19 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-16 00:03+0000\n" +"POT-Creation-Date: 2024-03-01 00:03+0000\n" "PO-Revision-Date: 2023-06-26 03:02+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -995,10 +995,11 @@ msgstr "" "Serhiy Storchaka 在 :issue:`37999` 中貢獻。)" #: ../../whatsnew/3.10.rst:831 +#, fuzzy msgid "" -"If :func:`object.__ipow__` returns :const:`NotImplemented`, the operator " -"will correctly fall back to :func:`object.__pow__` and :func:`object." -"__rpow__` as expected. (Contributed by Alex Shkop in :issue:`38302`.)" +"If :func:`object.__ipow__` returns :data:`NotImplemented`, the operator will " +"correctly fall back to :func:`object.__pow__` and :func:`object.__rpow__` as " +"expected. (Contributed by Alex Shkop in :issue:`38302`.)" msgstr "" "如果 :func:`object.__ipow__` 回傳 :const:`NotImplemented`,則該運算子將按預期" "正確回退到 :func:`object.__pow__` 和 :func:`object.__rpow__` 。(由 Alex " diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index c18f91e0f4..dcf608e986 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-03 20:44+0000\n" +"POT-Creation-Date: 2024-03-01 00:03+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-" @@ -1164,7 +1164,7 @@ msgstr "由 Łukasz Langa 撰寫 PEP 與實作。" #: ../../whatsnew/3.4.rst:874 msgid "" -":func:`~functools.total_ordering` now supports a return value of :const:" +":func:`~functools.total_ordering` now supports a return value of :data:" "`NotImplemented` from the underlying comparison function. (Contributed by " "Katie Miller in :issue:`10042`.)" msgstr "" diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 40a825bcba..fbddcf1a2d 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-16 00:03+0000\n" +"POT-Creation-Date: 2024-03-01 00:03+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-" @@ -1635,11 +1635,11 @@ msgstr "" #: ../../whatsnew/3.9.rst:1129 msgid "" -"Division handling of :class:`~pathlib.PurePath` now returns " -"``NotImplemented`` instead of raising a :exc:`TypeError` when passed " -"something other than an instance of ``str`` or :class:`~pathlib.PurePath`. " -"This allows creating compatible classes that don't inherit from those " -"mentioned types. (Contributed by Roger Aiudi in :issue:`34775`)." +"Division handling of :class:`~pathlib.PurePath` now returns :data:" +"`NotImplemented` instead of raising a :exc:`TypeError` when passed something " +"other than an instance of ``str`` or :class:`~pathlib.PurePath`. This " +"allows creating compatible classes that don't inherit from those mentioned " +"types. (Contributed by Roger Aiudi in :issue:`34775`)." msgstr "" #: ../../whatsnew/3.9.rst:1135 From f04d19cb9c45512098749e14475a1952116c8b3b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 2 Mar 2024 00:04:49 +0000 Subject: [PATCH 25/33] sync with cpython 90f75e10 --- library/ast.po | 159 +++++----- library/datetime.po | 689 ++++++++++++++++++++-------------------- library/logging.po | 697 ++++++++++++++++++++++------------------- reference/datamodel.po | 188 +++++------ 4 files changed, 900 insertions(+), 833 deletions(-) diff --git a/library/ast.po b/library/ast.po index 7445621071..5208497eb1 100644 --- a/library/ast.po +++ b/library/ast.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-01 00:03+0000\n" +"POT-Creation-Date: 2024-03-02 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1292,24 +1292,24 @@ msgstr "" #: ../../library/ast.rst:2181 msgid "" -"Also, setting ``feature_version`` to a tuple ``(major, minor)`` will attempt " -"to parse using that Python version's grammar. Currently ``major`` must equal " -"to ``3``. For example, setting ``feature_version=(3, 4)`` will allow the " -"use of ``async`` and ``await`` as variable names. The lowest supported " -"version is ``(3, 4)``; the highest is ``sys.version_info[0:2]``." +"Setting ``feature_version`` to a tuple ``(major, minor)`` will result in a " +"\"best-effort\" attempt to parse using that Python version's grammar. For " +"example, setting ``feature_version=(3, 9)`` will attempt to disallow parsing " +"of :keyword:`match` statements. Currently ``major`` must equal to ``3``. The " +"lowest supported version is ``(3, 4)`` (and this may increase in future " +"Python versions); the highest is ``sys.version_info[0:2]``. \"Best-effort\" " +"attempt means there is no guarantee that the parse (or success of the parse) " +"is the same as when run on the Python version corresponding to " +"``feature_version``." msgstr "" -"此外,將 ``feature_version`` 設定為元組 ``(major, minor)`` 將嘗試使用該 " -"Python 版本的文法進行剖析。當前 ``major`` 必須等於 ``3``。例如,設定 " -"``feature_version=(3, 4)`` 將允許使用 ``async`` 和 ``await`` 作為變數名稱。有" -"支援的最低版本是 ``(3, 4)``;最高的是 ``sys.version_info[0:2]``。" -#: ../../library/ast.rst:2188 +#: ../../library/ast.rst:2191 #, fuzzy msgid "" "If source contains a null character (``\\0``), :exc:`ValueError` is raised." msgstr "如果來源包含 null 字元 ('\\0'),則會引發 :exc:`ValueError`。" -#: ../../library/ast.rst:2191 +#: ../../library/ast.rst:2194 msgid "" "Note that successfully parsing source code into an AST object doesn't " "guarantee that the source code provided is valid Python code that can be " @@ -1323,14 +1323,14 @@ msgstr "" "原始的 ``return 42`` 為 return 陳述式生成一個有效的 AST 節點,但它不能單獨編" "譯(它需要位於函式節點內)。" -#: ../../library/ast.rst:2198 +#: ../../library/ast.rst:2201 msgid "" "In particular, :func:`ast.parse` won't do any scoping checks, which the " "compilation step does." msgstr "" "特別是 :func:`ast.parse` 不會執行任何範圍檢查,而編譯步驟才會執行此操作。" -#: ../../library/ast.rst:2202 +#: ../../library/ast.rst:2205 msgid "" "It is possible to crash the Python interpreter with a sufficiently large/" "complex string due to stack depth limitations in Python's AST compiler." @@ -1338,11 +1338,11 @@ msgstr "" "由於 Python AST 編譯器中的堆疊 (stack) 深度限制,太大或太複雜的字串可能會導" "致 Python 直譯器崩潰。" -#: ../../library/ast.rst:2206 +#: ../../library/ast.rst:2209 msgid "Added ``type_comments``, ``mode='func_type'`` and ``feature_version``." msgstr "新增 ``type_comments``、``mode='func_type'`` 與 ``feature_version``。" -#: ../../library/ast.rst:2212 +#: ../../library/ast.rst:2215 msgid "" "Unparse an :class:`ast.AST` object and generate a string with code that " "would produce an equivalent :class:`ast.AST` object if parsed back with :" @@ -1351,7 +1351,7 @@ msgstr "" "反剖析 :class:`ast.AST` 物件並生成一個帶有程式碼的字串,如果使用 :func:`ast." "parse` 剖析回來,該程式碼將生成等效的 :class:`ast.AST` 物件。" -#: ../../library/ast.rst:2217 +#: ../../library/ast.rst:2220 msgid "" "The produced code string will not necessarily be equal to the original code " "that generated the :class:`ast.AST` object (without any compiler " @@ -1360,13 +1360,13 @@ msgstr "" "生成的程式碼字串不一定等於生成 :class:`ast.AST` 物件的原始程式碼(沒有任何編" "譯器最佳化,例如常數元組/凍結集合)。" -#: ../../library/ast.rst:2222 +#: ../../library/ast.rst:2225 msgid "" "Trying to unparse a highly complex expression would result with :exc:" "`RecursionError`." msgstr "嘗試剖析高度複雜的運算式會導致 :exc:`RecursionError`。" -#: ../../library/ast.rst:2230 +#: ../../library/ast.rst:2233 msgid "" "Evaluate an expression node or a string containing only a Python literal or " "container display. The string or node provided may only consist of the " @@ -1377,7 +1377,7 @@ msgstr "" "能包含以下 Python 文本結構:字串、位元組、數字、元組、串列、字典、集合、布林" "值、``None`` 和 ``Ellipsis``。" -#: ../../library/ast.rst:2235 +#: ../../library/ast.rst:2238 msgid "" "This can be used for evaluating strings containing Python values without the " "need to parse the values oneself. It is not capable of evaluating " @@ -1386,7 +1386,7 @@ msgstr "" "這可用於為包含 Python 值的字串求值,而無需自己剖析這些值。它無法計算任意複雜" "的運算式,例如涉及運算子或索引。" -#: ../../library/ast.rst:2240 +#: ../../library/ast.rst:2243 msgid "" "This function had been documented as \"safe\" in the past without defining " "what that meant. That was misleading. This is specifically designed not to " @@ -1403,13 +1403,13 @@ msgstr "" "盡或 C 堆疊耗盡,從而導致行程崩潰。某些輸入也可能會出現 CPU 消耗過多而導致拒" "絕服務的情況。因此不建議在不受信任的資料上呼叫它。" -#: ../../library/ast.rst:2250 +#: ../../library/ast.rst:2253 msgid "" "It is possible to crash the Python interpreter due to stack depth " "limitations in Python's AST compiler." msgstr "由於 Python AST 編譯器的堆疊深度限制,Python 直譯器可能會崩潰。" -#: ../../library/ast.rst:2253 +#: ../../library/ast.rst:2256 msgid "" "It can raise :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :exc:" "`MemoryError` and :exc:`RecursionError` depending on the malformed input." @@ -1417,19 +1417,19 @@ msgstr "" "它可能會引發 :exc:`ValueError`、:exc:`TypeError`、:exc:`SyntaxError`、:exc:" "`MemoryError` 和 :exc:`RecursionError`,具體取決於格式錯誤的輸入。" -#: ../../library/ast.rst:2257 +#: ../../library/ast.rst:2260 msgid "Now allows bytes and set literals." msgstr "現在允許位元組和集合文本 (set literal)。" -#: ../../library/ast.rst:2260 +#: ../../library/ast.rst:2263 msgid "Now supports creating empty sets with ``'set()'``." msgstr "現在支援使用 ``'set()'`` 建立空集合。" -#: ../../library/ast.rst:2263 +#: ../../library/ast.rst:2266 msgid "For string inputs, leading spaces and tabs are now stripped." msgstr "對於字串輸入,前導空格和定位字元 (tab) 現在已被去除。" -#: ../../library/ast.rst:2269 +#: ../../library/ast.rst:2272 msgid "" "Return the docstring of the given *node* (which must be a :class:" "`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`, or :class:" @@ -1441,11 +1441,11 @@ msgstr "" "件字串則為 ``None``。如果 *clean* 為 true,則使用 :func:`inspect.cleandoc` 清" "理文件字串的縮排。" -#: ../../library/ast.rst:2275 +#: ../../library/ast.rst:2278 msgid ":class:`AsyncFunctionDef` is now supported." msgstr "目前已支援 :class:`AsyncFunctionDef`。" -#: ../../library/ast.rst:2281 +#: ../../library/ast.rst:2284 msgid "" "Get source code segment of the *source* that generated *node*. If some " "location information (:attr:`~ast.AST.lineno`, :attr:`~ast.AST.end_lineno`, :" @@ -1456,7 +1456,7 @@ msgstr "" "lineno`、:attr:`~ast.AST.end_lineno`、:attr:`~ast.AST.col_offset` 或 :attr:" "`~ast.AST.end_col_offset`\\ )遺漏,則回傳 ``None``。" -#: ../../library/ast.rst:2285 +#: ../../library/ast.rst:2288 msgid "" "If *padded* is ``True``, the first line of a multi-line statement will be " "padded with spaces to match its original position." @@ -1464,7 +1464,7 @@ msgstr "" "如果 *padded* 為 ``True``,則多列陳述式的第一列將用空格填充 (padded) 以匹配其" "原始位置。" -#: ../../library/ast.rst:2293 +#: ../../library/ast.rst:2296 msgid "" "When you compile a node tree with :func:`compile`, the compiler expects :" "attr:`~ast.AST.lineno` and :attr:`~ast.AST.col_offset` attributes for every " @@ -1478,7 +1478,7 @@ msgstr "" "要存在。填入生成的節點相當繁瑣,因此該輔助工具透過將這些屬性設定為父節點的" "值,在尚未設定的地方遞迴地新增這些屬性。它從 *node* 開始遞迴地作用。" -#: ../../library/ast.rst:2302 +#: ../../library/ast.rst:2305 msgid "" "Increment the line number and end line number of each node in the tree " "starting at *node* by *n*. This is useful to \"move code\" to a different " @@ -1487,7 +1487,7 @@ msgstr "" "將樹中從 *node* 開始的每個節點的列號和結束列號增加 *n*。這對於「移動程式碼」" "到檔案中的不同位置很有用。" -#: ../../library/ast.rst:2309 +#: ../../library/ast.rst:2312 msgid "" "Copy source location (:attr:`~ast.AST.lineno`, :attr:`~ast.AST.col_offset`, :" "attr:`~ast.AST.end_lineno`, and :attr:`~ast.AST.end_col_offset`) from " @@ -1497,7 +1497,7 @@ msgstr "" "attr:`~ast.AST.end_lineno` 和 :attr:`~ast.AST.end_col_offset` )從 " "*old_node* 複製到 *new_node*,並回傳 *new_node* 。" -#: ../../library/ast.rst:2316 +#: ../../library/ast.rst:2319 msgid "" "Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` " "that is present on *node*." @@ -1505,7 +1505,7 @@ msgstr "" "為 *node* 上存在的 ``node._fields`` 中的每個欄位生成一個 ``(fieldname, " "value)`` 元組。" -#: ../../library/ast.rst:2322 +#: ../../library/ast.rst:2325 msgid "" "Yield all direct child nodes of *node*, that is, all fields that are nodes " "and all items of fields that are lists of nodes." @@ -1513,7 +1513,7 @@ msgstr "" "生成 *node* 的所有直接子節點,即作為節點的所有欄位以及作為節點串列欄位的所有" "項目。" -#: ../../library/ast.rst:2328 +#: ../../library/ast.rst:2331 msgid "" "Recursively yield all descendant nodes in the tree starting at *node* " "(including *node* itself), in no specified order. This is useful if you " @@ -1522,7 +1522,7 @@ msgstr "" "遞迴地生成樹中從 *node* 開始的所有後代節點(包括 *node* 本身),不按指定順" "序。如果你只想就地修改節點而不關心情境,這非常有用。" -#: ../../library/ast.rst:2335 +#: ../../library/ast.rst:2338 msgid "" "A node visitor base class that walks the abstract syntax tree and calls a " "visitor function for every node found. This function may return a value " @@ -1531,13 +1531,13 @@ msgstr "" "節點訪問者基底類別,它遍歷抽象語法樹並為找到的每個節點呼叫訪問者函式。該函式" "可能會回傳一個由 :meth:`visit` 方法轉發的值。" -#: ../../library/ast.rst:2339 +#: ../../library/ast.rst:2342 msgid "" "This class is meant to be subclassed, with the subclass adding visitor " "methods." msgstr "這個類別應該被子類別化,子類別新增訪問者方法。" -#: ../../library/ast.rst:2344 +#: ../../library/ast.rst:2347 msgid "" "Visit a node. The default implementation calls the method called :samp:" "`self.visit_{classname}` where *classname* is the name of the node class, " @@ -1547,11 +1547,11 @@ msgstr "" "*classname* 是節點類別的名稱,或者在該方法不存在時呼叫 :meth:" "`generic_visit`。" -#: ../../library/ast.rst:2350 +#: ../../library/ast.rst:2353 msgid "This visitor calls :meth:`visit` on all children of the node." msgstr "該訪問者對該節點的所有子節點呼叫 :meth:`visit`。" -#: ../../library/ast.rst:2352 +#: ../../library/ast.rst:2355 msgid "" "Note that child nodes of nodes that have a custom visitor method won't be " "visited unless the visitor calls :meth:`generic_visit` or visits them itself." @@ -1559,11 +1559,11 @@ msgstr "" "請注意,除非訪問者呼叫 :meth:`generic_visit` 或訪問它們本身,否則不會訪問具有" "自定義訪問者方法的節點之子節點。" -#: ../../library/ast.rst:2358 +#: ../../library/ast.rst:2361 msgid "Handles all constant nodes." msgstr "處理所有常數節點。" -#: ../../library/ast.rst:2360 +#: ../../library/ast.rst:2363 msgid "" "Don't use the :class:`NodeVisitor` if you want to apply changes to nodes " "during traversal. For this a special visitor exists (:class:" @@ -1573,7 +1573,7 @@ msgstr "" "`NodeVisitor`。為此,有個允許修改的特殊遍歷訪問者工具 :class:" "`NodeTransformer`。" -#: ../../library/ast.rst:2366 +#: ../../library/ast.rst:2369 msgid "" "Methods :meth:`!visit_Num`, :meth:`!visit_Str`, :meth:`!visit_Bytes`, :meth:" "`!visit_NameConstant` and :meth:`!visit_Ellipsis` are deprecated now and " @@ -1584,13 +1584,13 @@ msgstr "" "visit_NameConstant` 和 :meth:`!visit_Ellipsis` 方法現已棄用,並且不會在未來的" "Python 版本中被呼叫。新增 :meth:`visit_Constant` 方法來處理所有常數節點。" -#: ../../library/ast.rst:2374 +#: ../../library/ast.rst:2377 msgid "" "A :class:`NodeVisitor` subclass that walks the abstract syntax tree and " "allows modification of nodes." msgstr "一個 :class:`NodeVisitor` 子類別,它會遍歷抽象語法樹並允許修改節點。" -#: ../../library/ast.rst:2377 +#: ../../library/ast.rst:2380 msgid "" "The :class:`NodeTransformer` will walk the AST and use the return value of " "the visitor methods to replace or remove the old node. If the return value " @@ -1602,7 +1602,7 @@ msgstr "" "點。如果訪問者方法的回傳值為 ``None``,則該節點將從其位置中刪除,否則將被替換" "為回傳值。回傳值可能是原始節點,在這種情況下不會發生替換。" -#: ../../library/ast.rst:2383 +#: ../../library/ast.rst:2386 msgid "" "Here is an example transformer that rewrites all occurrences of name lookups " "(``foo``) to ``data['foo']``::" @@ -1610,7 +1610,7 @@ msgstr "" "下面是一個示範用的 transformer,它將查找所有出現名稱 (``foo``) 並改寫為 " "``data['foo']``: ::" -#: ../../library/ast.rst:2395 +#: ../../library/ast.rst:2398 msgid "" "Keep in mind that if the node you're operating on has child nodes you must " "either transform the child nodes yourself or call the :meth:`~ast." @@ -1619,7 +1619,7 @@ msgstr "" "請記住,如果你正在操作的節點有子節點,你必須自己轉換子節點或先呼叫該節點的 :" "meth:`~ast.NodeVisitor.generic_visit` 方法。" -#: ../../library/ast.rst:2399 +#: ../../library/ast.rst:2402 msgid "" "For nodes that were part of a collection of statements (that applies to all " "statement nodes), the visitor may also return a list of nodes rather than " @@ -1628,7 +1628,7 @@ msgstr "" "對於屬於陳述式總集 (collection) 一部分的節點(適用於所有陳述式節點),訪問者" "還可以回傳節點串列,而不僅僅是單個節點。" -#: ../../library/ast.rst:2403 +#: ../../library/ast.rst:2406 msgid "" "If :class:`NodeTransformer` introduces new nodes (that weren't part of " "original tree) without giving them location information (such as :attr:`~ast." @@ -1639,11 +1639,11 @@ msgstr "" "它們提供位置資訊(例如 :attr:`~ast.AST.lineno`\\ ),則應使用新的子樹呼叫 :" "func:`fix_missing_locations` 以重新計算位置資訊: ::" -#: ../../library/ast.rst:2411 +#: ../../library/ast.rst:2414 msgid "Usually you use the transformer like this::" msgstr "你通常會像這樣使用 transformer: ::" -#: ../../library/ast.rst:2418 +#: ../../library/ast.rst:2421 msgid "" "Return a formatted dump of the tree in *node*. This is mainly useful for " "debugging purposes. If *annotate_fields* is true (by default), the returned " @@ -1659,7 +1659,7 @@ msgstr "" "潔。預設情況下,不會傾印列號和行偏移量等屬性。如果需要,可以設定 " "*include_attributes* 為 true。" -#: ../../library/ast.rst:2426 +#: ../../library/ast.rst:2429 msgid "" "If *indent* is a non-negative integer or string, then the tree will be " "pretty-printed with that indent level. An indent level of 0, negative, or " @@ -1673,21 +1673,21 @@ msgstr "" "(預設值)代表選擇單列表示。使用正整數縮排可以在每個級別縮排相同數量的空格。" "如果 *indent* 是一個字串(例如 ``\"\\t\"``\\ ),則該字串用於縮排每個級別。" -#: ../../library/ast.rst:2433 +#: ../../library/ast.rst:2436 msgid "Added the *indent* option." msgstr "新增 *indent* 選項。" -#: ../../library/ast.rst:2440 +#: ../../library/ast.rst:2443 msgid "Compiler Flags" msgstr "編譯器旗標" -#: ../../library/ast.rst:2442 +#: ../../library/ast.rst:2445 msgid "" "The following flags may be passed to :func:`compile` in order to change " "effects on the compilation of a program:" msgstr "可以將以下旗標傳遞給 :func:`compile` 以變更對程式的編譯效果:" -#: ../../library/ast.rst:2447 +#: ../../library/ast.rst:2450 msgid "" "Enables support for top-level ``await``, ``async for``, ``async with`` and " "async comprehensions." @@ -1695,13 +1695,13 @@ msgstr "" "啟用對最高階 ``await``、``async for``、``async with`` 和非同步綜合運算的支" "援。" -#: ../../library/ast.rst:2454 +#: ../../library/ast.rst:2457 msgid "" "Generates and returns an abstract syntax tree instead of returning a " "compiled code object." msgstr "生成並回傳抽象語法樹,而不是回傳已編譯的程式碼物件。" -#: ../../library/ast.rst:2459 +#: ../../library/ast.rst:2462 msgid "" "Enables support for :pep:`484` and :pep:`526` style type comments (``# type: " "``, ``# type: ignore ``)." @@ -1709,43 +1709,43 @@ msgstr "" "啟用對 :pep:`484` 和 :pep:`526` 樣式型別註釋的支援 (``# type: ``, ``# " "type: ignore ``)。" -#: ../../library/ast.rst:2468 +#: ../../library/ast.rst:2471 msgid "Command-Line Usage" msgstr "命令列用法" -#: ../../library/ast.rst:2472 +#: ../../library/ast.rst:2475 msgid "" "The :mod:`ast` module can be executed as a script from the command line. It " "is as simple as:" msgstr ":mod:`ast` 模組可以作為腳本從命令列執行,可以像這樣簡單地做到:" -#: ../../library/ast.rst:2479 +#: ../../library/ast.rst:2482 msgid "The following options are accepted:" msgstr "以下選項可被接受:" -#: ../../library/ast.rst:2485 +#: ../../library/ast.rst:2488 msgid "Show the help message and exit." msgstr "顯示幫助訊息並退出。" -#: ../../library/ast.rst:2490 +#: ../../library/ast.rst:2493 msgid "" "Specify what kind of code must be compiled, like the *mode* argument in :" "func:`parse`." msgstr "指定必須編譯哪種類型的程式碼,像是 :func:`parse` 中的 *mode* 引數。" -#: ../../library/ast.rst:2495 +#: ../../library/ast.rst:2498 msgid "Don't parse type comments." msgstr "不要剖析型別註解。" -#: ../../library/ast.rst:2499 +#: ../../library/ast.rst:2502 msgid "Include attributes such as line numbers and column offsets." msgstr "包括列號和行偏移量等屬性。" -#: ../../library/ast.rst:2504 +#: ../../library/ast.rst:2507 msgid "Indentation of nodes in AST (number of spaces)." msgstr "AST 中節點的縮進(空格數)。" -#: ../../library/ast.rst:2506 +#: ../../library/ast.rst:2509 msgid "" "If :file:`infile` is specified its contents are parsed to AST and dumped to " "stdout. Otherwise, the content is read from stdin." @@ -1753,7 +1753,7 @@ msgstr "" "如果指定了 :file:`infile`,則其內容將被剖析為 AST 並傾印 (dump) 到 stdout。否" "則會從 stdin 讀取內容。" -#: ../../library/ast.rst:2512 +#: ../../library/ast.rst:2515 msgid "" "`Green Tree Snakes `_, an external " "documentation resource, has good details on working with Python ASTs." @@ -1761,7 +1761,7 @@ msgstr "" "`Green Tree Snakes `_ 是一個外部文件" "資源,提供了有關使用 Python AST 的詳細資訊。" -#: ../../library/ast.rst:2515 +#: ../../library/ast.rst:2518 msgid "" "`ASTTokens `_ " "annotates Python ASTs with the positions of tokens and text in the source " @@ -1772,7 +1772,7 @@ msgstr "" "用生成它們的原始碼中的標記和文本的位置來註釋 Python AST。這對於進行原始碼轉換" "的工具很有幫助。" -#: ../../library/ast.rst:2520 +#: ../../library/ast.rst:2523 msgid "" "`leoAst.py `_ unifies the " "token-based and parse-tree-based views of python programs by inserting two-" @@ -1782,7 +1782,7 @@ msgstr "" "和 ast 節點之間插入雙向鏈結,統一了 python 程式的基於 token 和基於剖析樹的視" "圖。" -#: ../../library/ast.rst:2524 +#: ../../library/ast.rst:2527 msgid "" "`LibCST `_ parses code as a Concrete Syntax " "Tree that looks like an ast tree and keeps all formatting details. It's " @@ -1792,7 +1792,7 @@ msgstr "" "(Concrete Syntax Tree),看起來像 ast 樹並保留所有格式詳細資訊。它對於建置自動" "重構 (codemod) 應用程式和 linter 非常有用。" -#: ../../library/ast.rst:2529 +#: ../../library/ast.rst:2532 msgid "" "`Parso `_ is a Python parser that supports " "error recovery and round-trip parsing for different Python versions (in " @@ -1814,3 +1814,16 @@ msgstr "於 AST 文法中" #: ../../library/ast.rst:60 msgid "* (asterisk)" msgstr "* (星號)" + +#~ msgid "" +#~ "Also, setting ``feature_version`` to a tuple ``(major, minor)`` will " +#~ "attempt to parse using that Python version's grammar. Currently ``major`` " +#~ "must equal to ``3``. For example, setting ``feature_version=(3, 4)`` " +#~ "will allow the use of ``async`` and ``await`` as variable names. The " +#~ "lowest supported version is ``(3, 4)``; the highest is ``sys." +#~ "version_info[0:2]``." +#~ msgstr "" +#~ "此外,將 ``feature_version`` 設定為元組 ``(major, minor)`` 將嘗試使用該 " +#~ "Python 版本的文法進行剖析。當前 ``major`` 必須等於 ``3``。例如,設定 " +#~ "``feature_version=(3, 4)`` 將允許使用 ``async`` 和 ``await`` 作為變數名" +#~ "稱。有支援的最低版本是 ``(3, 4)``;最高的是 ``sys.version_info[0:2]``。" diff --git a/library/datetime.po b/library/datetime.po index d931eaf751..ada6c428d1 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-15 00:03+0000\n" +"POT-Creation-Date: 2024-03-02 00:03+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-" @@ -376,8 +376,8 @@ msgid "" msgstr "" #: ../../library/datetime.rst:265 ../../library/datetime.rst:546 -#: ../../library/datetime.rst:1065 ../../library/datetime.rst:1690 -#: ../../library/datetime.rst:2292 +#: ../../library/datetime.rst:1065 ../../library/datetime.rst:1696 +#: ../../library/datetime.rst:2298 msgid "Class attributes:" msgstr "類別屬性:" @@ -404,7 +404,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:286 ../../library/datetime.rst:564 -#: ../../library/datetime.rst:1085 ../../library/datetime.rst:1710 +#: ../../library/datetime.rst:1085 ../../library/datetime.rst:1716 msgid "Instance attributes (read-only):" msgstr "" @@ -596,7 +596,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:364 ../../library/datetime.rst:603 -#: ../../library/datetime.rst:2523 +#: ../../library/datetime.rst:2529 msgid "Notes:" msgstr "註解:" @@ -656,7 +656,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:408 ../../library/datetime.rst:629 -#: ../../library/datetime.rst:1218 ../../library/datetime.rst:1817 +#: ../../library/datetime.rst:1224 ../../library/datetime.rst:1823 msgid "Instance methods:" msgstr "實例方法:" @@ -795,7 +795,7 @@ msgid "Ordinal dates are not currently supported (``YYYY-OOO``)." msgstr "" #: ../../library/datetime.rst:524 ../../library/datetime.rst:1011 -#: ../../library/datetime.rst:1446 +#: ../../library/datetime.rst:1452 msgid "Examples::" msgstr "" "範例:\n" @@ -936,14 +936,14 @@ msgid "" "values by whichever keyword arguments are specified." msgstr "" -#: ../../library/datetime.rst:636 ../../library/datetime.rst:1860 +#: ../../library/datetime.rst:636 ../../library/datetime.rst:1866 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/datetime.rst:646 ../../library/datetime.rst:1331 +#: ../../library/datetime.rst:646 ../../library/datetime.rst:1337 msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." "localtime`." @@ -954,7 +954,7 @@ msgstr "" msgid "The hours, minutes and seconds are 0, and the DST flag is -1." msgstr "" -#: ../../library/datetime.rst:650 ../../library/datetime.rst:1333 +#: ../../library/datetime.rst:650 ../../library/datetime.rst:1339 msgid "``d.timetuple()`` is equivalent to::" msgstr "" "``d.timetuple()`` 等價於:\n" @@ -1036,7 +1036,7 @@ msgstr "" msgid "Return a string representing the date::" msgstr "" -#: ../../library/datetime.rst:724 ../../library/datetime.rst:1517 +#: ../../library/datetime.rst:724 ../../library/datetime.rst:1523 msgid "``d.ctime()`` is equivalent to::" msgstr "" "``d.ctime()`` 等價於:\n" @@ -1122,28 +1122,28 @@ msgstr "``1 <= month <= 12``," msgid "``1 <= day <= number of days in the given month and year``," msgstr "" -#: ../../library/datetime.rst:838 ../../library/datetime.rst:1681 +#: ../../library/datetime.rst:838 ../../library/datetime.rst:1687 msgid "``0 <= hour < 24``," msgstr "``0 <= hour < 24``," -#: ../../library/datetime.rst:839 ../../library/datetime.rst:1682 +#: ../../library/datetime.rst:839 ../../library/datetime.rst:1688 msgid "``0 <= minute < 60``," msgstr "``0 <= minute < 60``," -#: ../../library/datetime.rst:840 ../../library/datetime.rst:1683 +#: ../../library/datetime.rst:840 ../../library/datetime.rst:1689 msgid "``0 <= second < 60``," msgstr "``0 <= second < 60``," -#: ../../library/datetime.rst:841 ../../library/datetime.rst:1684 +#: ../../library/datetime.rst:841 ../../library/datetime.rst:1690 msgid "``0 <= microsecond < 1000000``," msgstr "``0 <= microsecond < 1000000``," -#: ../../library/datetime.rst:842 ../../library/datetime.rst:1685 +#: ../../library/datetime.rst:842 ../../library/datetime.rst:1691 msgid "``fold in [0, 1]``." msgstr "" -#: ../../library/datetime.rst:846 ../../library/datetime.rst:1252 -#: ../../library/datetime.rst:1827 +#: ../../library/datetime.rst:846 ../../library/datetime.rst:1258 +#: ../../library/datetime.rst:1833 msgid "Added the *fold* parameter." msgstr "新增 *fold* 參數。" @@ -1342,7 +1342,7 @@ msgid "" "ISO 8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1002 ../../library/datetime.rst:1781 +#: ../../library/datetime.rst:1002 ../../library/datetime.rst:1787 msgid "Time zone offsets may have fractional seconds." msgstr "" @@ -1350,7 +1350,7 @@ msgstr "" msgid "The ``T`` separator may be replaced by any single unicode character." msgstr "" -#: ../../library/datetime.rst:1004 ../../library/datetime.rst:1786 +#: ../../library/datetime.rst:1004 ../../library/datetime.rst:1792 msgid "Fractional hours and minutes are not supported." msgstr "" @@ -1406,16 +1406,16 @@ msgid "" "objects, ``timedelta(microseconds=1)``." msgstr "" -#: ../../library/datetime.rst:1104 ../../library/datetime.rst:1714 +#: ../../library/datetime.rst:1104 ../../library/datetime.rst:1720 msgid "In ``range(24)``." msgstr "" #: ../../library/datetime.rst:1109 ../../library/datetime.rst:1114 -#: ../../library/datetime.rst:1719 ../../library/datetime.rst:1724 +#: ../../library/datetime.rst:1725 ../../library/datetime.rst:1730 msgid "In ``range(60)``." msgstr "" -#: ../../library/datetime.rst:1119 ../../library/datetime.rst:1729 +#: ../../library/datetime.rst:1119 ../../library/datetime.rst:1735 msgid "In ``range(1000000)``." msgstr "" @@ -1425,7 +1425,7 @@ msgid "" "constructor, or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1130 ../../library/datetime.rst:1740 +#: ../../library/datetime.rst:1130 ../../library/datetime.rst:1746 msgid "" "In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. " "(A repeated interval occurs when clocks are rolled back at the end of " @@ -1438,10 +1438,10 @@ msgstr "" msgid "``datetime2 = datetime1 + timedelta``" msgstr "``datetime2 = datetime1 + timedelta``" -#: ../../library/datetime.rst:1143 ../../library/datetime.rst:2350 -#: ../../library/datetime.rst:2355 ../../library/datetime.rst:2367 -#: ../../library/datetime.rst:2372 ../../library/datetime.rst:2432 -#: ../../library/datetime.rst:2437 ../../library/datetime.rst:2441 +#: ../../library/datetime.rst:1143 ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2361 ../../library/datetime.rst:2373 +#: ../../library/datetime.rst:2378 ../../library/datetime.rst:2438 +#: ../../library/datetime.rst:2443 ../../library/datetime.rst:2447 msgid "\\(1)" msgstr "\\(1)" @@ -1449,7 +1449,7 @@ msgstr "\\(1)" msgid "``datetime2 = datetime1 - timedelta``" msgstr "``datetime2 = datetime1 - timedelta``" -#: ../../library/datetime.rst:1145 ../../library/datetime.rst:2383 +#: ../../library/datetime.rst:1145 ../../library/datetime.rst:2389 msgid "\\(2)" msgstr "\\(2)" @@ -1539,60 +1539,65 @@ msgstr "" #: ../../library/datetime.rst:1196 msgid "" -"If both comparands are aware and have different :attr:`~.datetime.tzinfo` " -"attributes, the comparison acts as comparands were first converted to UTC " -"datetimes except that the implementation never overflows. :class:`!datetime` " -"instances in a repeated interval are never equal to :class:`!datetime` " -"instances in other time zone." +"If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " +"the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " +"the base datetimes are compared. If both comparands are aware and have " +"different :attr:`~.datetime.tzinfo` attributes, the comparison acts as " +"comparands were first converted to UTC datetimes except that the " +"implementation never overflows. :class:`!datetime` instances in a repeated " +"interval are never equal to :class:`!datetime` instances in other time zone." msgstr "" -#: ../../library/datetime.rst:1203 +#: ../../library/datetime.rst:1206 msgid "" "*datetime1* is considered less than *datetime2* when *datetime1* precedes " "*datetime2* in time, taking into account the time zone." msgstr "" -#: ../../library/datetime.rst:1206 +#: ../../library/datetime.rst:1209 msgid "" "Order comparison between naive and aware :class:`.datetime` objects, as well " "as a :class:`!datetime` object and a :class:`!date` object that is not also " "a :class:`!datetime` instance, raises :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1210 +#: ../../library/datetime.rst:1213 msgid "" -"If both comparands are aware and have different :attr:`~.datetime.tzinfo` " -"attributes, the comparison acts as comparands were first converted to UTC " -"datetimes except that the implementation never overflows." +"If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " +"the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " +"the base datetimes are compared. If both comparands are aware and have " +"different :attr:`~.datetime.tzinfo` attributes, the comparison acts as " +"comparands were first converted to UTC datetimes except that the " +"implementation never overflows." msgstr "" -#: ../../library/datetime.rst:1214 +#: ../../library/datetime.rst:1220 msgid "" "Equality comparisons between aware and naive :class:`.datetime` instances " "don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1222 +#: ../../library/datetime.rst:1228 msgid "Return :class:`date` object with same year, month and day." msgstr "" -#: ../../library/datetime.rst:1227 +#: ../../library/datetime.rst:1233 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond and " "fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`." msgstr "" -#: ../../library/datetime.rst:1230 ../../library/datetime.rst:1239 +#: ../../library/datetime.rst:1236 ../../library/datetime.rst:1245 msgid "The fold value is copied to the returned :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:1236 +#: ../../library/datetime.rst:1242 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond, " "fold, and tzinfo attributes. See also method :meth:`time`." msgstr "" -#: ../../library/datetime.rst:1247 +#: ../../library/datetime.rst:1253 msgid "" "Return a datetime with the same attributes, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1600,21 +1605,21 @@ msgid "" "datetime with no conversion of date and time data." msgstr "" -#: ../../library/datetime.rst:1258 +#: ../../library/datetime.rst:1264 msgid "" "Return a :class:`.datetime` object with new :attr:`.tzinfo` attribute *tz*, " "adjusting the date and time data so the result is the same UTC time as " "*self*, but in *tz*'s local time." msgstr "" -#: ../../library/datetime.rst:1262 +#: ../../library/datetime.rst:1268 msgid "" "If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and " "its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If " "*self* is naive, it is presumed to represent time in the system timezone." msgstr "" -#: ../../library/datetime.rst:1266 +#: ../../library/datetime.rst:1272 msgid "" "If called without arguments (or with ``tz=None``) the system local timezone " "is assumed for the target timezone. The ``.tzinfo`` attribute of the " @@ -1622,7 +1627,7 @@ msgid "" "with the zone name and offset obtained from the OS." msgstr "" -#: ../../library/datetime.rst:1271 +#: ../../library/datetime.rst:1277 msgid "" "If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no " "adjustment of date or time data is performed. Else the result is local time " @@ -1631,7 +1636,7 @@ msgid "" "date and time data as ``dt - dt.utcoffset()``." msgstr "" -#: ../../library/datetime.rst:1277 +#: ../../library/datetime.rst:1283 msgid "" "If you merely want to attach a time zone object *tz* to a datetime *dt* " "without adjustment of date and time data, use ``dt.replace(tzinfo=tz)``. If " @@ -1639,56 +1644,56 @@ msgid "" "without conversion of date and time data, use ``dt.replace(tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1282 +#: ../../library/datetime.rst:1288 msgid "" "Note that the default :meth:`tzinfo.fromutc` method can be overridden in a :" "class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`. " "Ignoring error cases, :meth:`astimezone` acts like::" msgstr "" -#: ../../library/datetime.rst:1294 +#: ../../library/datetime.rst:1300 msgid "*tz* now can be omitted." msgstr "" -#: ../../library/datetime.rst:1297 +#: ../../library/datetime.rst:1303 msgid "" "The :meth:`astimezone` method can now be called on naive instances that are " "presumed to represent system local time." msgstr "" -#: ../../library/datetime.rst:1304 +#: ../../library/datetime.rst:1310 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "utcoffset(self)``, and raises an exception if the latter doesn't return " "``None`` or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1308 ../../library/datetime.rst:1900 -#: ../../library/datetime.rst:2007 ../../library/datetime.rst:2252 -#: ../../library/datetime.rst:2264 ../../library/datetime.rst:2576 +#: ../../library/datetime.rst:1314 ../../library/datetime.rst:1906 +#: ../../library/datetime.rst:2013 ../../library/datetime.rst:2258 +#: ../../library/datetime.rst:2270 ../../library/datetime.rst:2582 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1314 +#: ../../library/datetime.rst:1320 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "dst(self)``, and raises an exception if the latter doesn't return ``None`` " "or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1318 ../../library/datetime.rst:1910 -#: ../../library/datetime.rst:2061 +#: ../../library/datetime.rst:1324 ../../library/datetime.rst:1916 +#: ../../library/datetime.rst:2067 msgid "The DST offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1324 +#: ../../library/datetime.rst:1330 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "tzname(self)``, raises an exception if the latter doesn't return ``None`` or " "a string object," msgstr "" -#: ../../library/datetime.rst:1339 +#: ../../library/datetime.rst:1345 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with ``1`` for January 1st. The :" @@ -1699,7 +1704,7 @@ msgid "" "set to ``0``." msgstr "" -#: ../../library/datetime.rst:1350 +#: ../../library/datetime.rst:1356 msgid "" "If :class:`.datetime` instance *d* is naive, this is the same as ``d." "timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 " @@ -1707,7 +1712,7 @@ msgid "" "time." msgstr "" -#: ../../library/datetime.rst:1354 +#: ../../library/datetime.rst:1360 msgid "" "If *d* is aware, *d* is normalized to UTC time, by subtracting ``d." "utcoffset()``, and a :class:`time.struct_time` for the normalized time is " @@ -1716,7 +1721,7 @@ msgid "" "UTC adjustment spills over a year boundary." msgstr "" -#: ../../library/datetime.rst:1363 +#: ../../library/datetime.rst:1369 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1726,20 +1731,20 @@ msgid "" "meth:`.datetime.timetuple`." msgstr "" -#: ../../library/datetime.rst:1372 +#: ../../library/datetime.rst:1378 msgid "" "Return the proleptic Gregorian ordinal of the date. The same as ``self." "date().toordinal()``." msgstr "" -#: ../../library/datetime.rst:1377 +#: ../../library/datetime.rst:1383 msgid "" "Return POSIX timestamp corresponding to the :class:`.datetime` instance. The " "return value is a :class:`float` similar to that returned by :func:`time." "time`." msgstr "" -#: ../../library/datetime.rst:1381 +#: ../../library/datetime.rst:1387 msgid "" "Naive :class:`.datetime` instances are assumed to represent local time and " "this method relies on the platform C :c:func:`mktime` function to perform " @@ -1749,18 +1754,18 @@ msgid "" "future." msgstr "" -#: ../../library/datetime.rst:1388 +#: ../../library/datetime.rst:1394 msgid "" "For aware :class:`.datetime` instances, the return value is computed as::" msgstr "" -#: ../../library/datetime.rst:1395 +#: ../../library/datetime.rst:1401 msgid "" "The :meth:`timestamp` method uses the :attr:`.fold` attribute to " "disambiguate the times during a repeated interval." msgstr "" -#: ../../library/datetime.rst:1401 +#: ../../library/datetime.rst:1407 msgid "" "There is no method to obtain the POSIX timestamp directly from a naive :" "class:`.datetime` instance representing UTC time. If your application uses " @@ -1768,49 +1773,49 @@ msgid "" "the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" -#: ../../library/datetime.rst:1409 +#: ../../library/datetime.rst:1415 msgid "or by calculating the timestamp directly::" msgstr "" -#: ../../library/datetime.rst:1415 +#: ../../library/datetime.rst:1421 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "The same as ``self.date().weekday()``. See also :meth:`isoweekday`." msgstr "" -#: ../../library/datetime.rst:1421 +#: ../../library/datetime.rst:1427 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "The same as ``self.date().isoweekday()``. See also :meth:`weekday`, :meth:" "`isocalendar`." msgstr "" -#: ../../library/datetime.rst:1428 +#: ../../library/datetime.rst:1434 msgid "" "Return a :term:`named tuple` with three components: ``year``, ``week`` and " "``weekday``. The same as ``self.date().isocalendar()``." msgstr "" -#: ../../library/datetime.rst:1434 +#: ../../library/datetime.rst:1440 msgid "Return a string representing the date and time in ISO 8601 format:" msgstr "" -#: ../../library/datetime.rst:1436 +#: ../../library/datetime.rst:1442 msgid "``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "``YYYY-MM-DDTHH:MM:SS.ffffff``,如果 :attr:`microsecond` 不是 0" -#: ../../library/datetime.rst:1437 +#: ../../library/datetime.rst:1443 msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" msgstr "``YYYY-MM-DDTHH:MM:SS``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1439 +#: ../../library/datetime.rst:1445 msgid "" "If :meth:`utcoffset` does not return ``None``, a string is appended, giving " "the UTC offset:" msgstr "" "如果 :meth:`utcoffset` 没有回傳 ``None``,則會附加一个字串,給出 UTC 偏移:" -#: ../../library/datetime.rst:1442 +#: ../../library/datetime.rst:1448 msgid "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " "is not 0" @@ -1818,99 +1823,99 @@ msgstr "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` " "不是 0" -#: ../../library/datetime.rst:1444 +#: ../../library/datetime.rst:1450 msgid "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0" msgstr "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1454 +#: ../../library/datetime.rst:1460 msgid "" "The optional argument *sep* (default ``'T'``) is a one-character separator, " "placed between the date and time portions of the result. For example::" msgstr "" -#: ../../library/datetime.rst:1468 ../../library/datetime.rst:1840 +#: ../../library/datetime.rst:1474 ../../library/datetime.rst:1846 msgid "" "The optional argument *timespec* specifies the number of additional " "components of the time to include (the default is ``'auto'``). It can be one " "of the following:" msgstr "" -#: ../../library/datetime.rst:1472 ../../library/datetime.rst:1844 +#: ../../library/datetime.rst:1478 ../../library/datetime.rst:1850 msgid "" "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " "``'microseconds'`` otherwise." msgstr "" -#: ../../library/datetime.rst:1474 ../../library/datetime.rst:1846 +#: ../../library/datetime.rst:1480 ../../library/datetime.rst:1852 msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." msgstr "" -#: ../../library/datetime.rst:1475 ../../library/datetime.rst:1847 +#: ../../library/datetime.rst:1481 ../../library/datetime.rst:1853 msgid "" "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." msgstr "" -#: ../../library/datetime.rst:1476 ../../library/datetime.rst:1848 +#: ../../library/datetime.rst:1482 ../../library/datetime.rst:1854 msgid "" "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " "``HH:MM:SS`` format." msgstr "" -#: ../../library/datetime.rst:1478 ../../library/datetime.rst:1850 +#: ../../library/datetime.rst:1484 ../../library/datetime.rst:1856 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" -#: ../../library/datetime.rst:1480 ../../library/datetime.rst:1852 +#: ../../library/datetime.rst:1486 ../../library/datetime.rst:1858 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" -#: ../../library/datetime.rst:1484 ../../library/datetime.rst:1856 +#: ../../library/datetime.rst:1490 ../../library/datetime.rst:1862 msgid "Excluded time components are truncated, not rounded." msgstr "" -#: ../../library/datetime.rst:1486 +#: ../../library/datetime.rst:1492 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" -#: ../../library/datetime.rst:1496 ../../library/datetime.rst:1871 +#: ../../library/datetime.rst:1502 ../../library/datetime.rst:1877 msgid "Added the *timespec* parameter." msgstr "新增 *timespec* 參數。" -#: ../../library/datetime.rst:1502 +#: ../../library/datetime.rst:1508 msgid "" "For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" -#: ../../library/datetime.rst:1508 +#: ../../library/datetime.rst:1514 msgid "Return a string representing the date and time::" msgstr "" -#: ../../library/datetime.rst:1514 +#: ../../library/datetime.rst:1520 msgid "" "The output string will *not* include time zone information, regardless of " "whether the input is aware or naive." msgstr "" -#: ../../library/datetime.rst:1521 +#: ../../library/datetime.rst:1527 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`datetime.ctime` does not invoke) conforms " "to the C standard." msgstr "" -#: ../../library/datetime.rst:1528 +#: ../../library/datetime.rst:1534 msgid "" "Return a string representing the date and time, controlled by an explicit " "format string. See also :ref:`strftime-strptime-behavior` and :meth:" "`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1535 +#: ../../library/datetime.rst:1541 msgid "" "Same as :meth:`.datetime.strftime`. This makes it possible to specify a " "format string for a :class:`.datetime` object in :ref:`formatted string " @@ -1918,102 +1923,102 @@ msgid "" "`strftime-strptime-behavior` and :meth:`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1542 +#: ../../library/datetime.rst:1548 msgid "Examples of Usage: :class:`.datetime`" msgstr "用法範例::class:`.datetime`" -#: ../../library/datetime.rst:1544 +#: ../../library/datetime.rst:1550 msgid "Examples of working with :class:`.datetime` objects:" msgstr "更多 :class:`.datetime` 的用法範例:" -#: ../../library/datetime.rst:1597 +#: ../../library/datetime.rst:1603 msgid "" "The example below defines a :class:`tzinfo` subclass capturing time zone " "information for Kabul, Afghanistan, which used +4 UTC until 1945 and then " "+4:30 UTC thereafter::" msgstr "" -#: ../../library/datetime.rst:1644 +#: ../../library/datetime.rst:1650 msgid "Usage of ``KabulTz`` from above::" msgstr "" -#: ../../library/datetime.rst:1670 +#: ../../library/datetime.rst:1676 msgid ":class:`.time` Objects" msgstr ":class:`.time` 物件" -#: ../../library/datetime.rst:1672 +#: ../../library/datetime.rst:1678 msgid "" "A :class:`.time` object represents a (local) time of day, independent of any " "particular day, and subject to adjustment via a :class:`tzinfo` object." msgstr "" -#: ../../library/datetime.rst:1677 +#: ../../library/datetime.rst:1683 msgid "" "All arguments are optional. *tzinfo* may be ``None``, or an instance of a :" "class:`tzinfo` subclass. The remaining arguments must be integers in the " "following ranges:" msgstr "" -#: ../../library/datetime.rst:1687 +#: ../../library/datetime.rst:1693 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised. " "All default to ``0`` except *tzinfo*, which defaults to :const:`None`." msgstr "" -#: ../../library/datetime.rst:1695 +#: ../../library/datetime.rst:1701 msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." msgstr "" -#: ../../library/datetime.rst:1700 +#: ../../library/datetime.rst:1706 msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." msgstr "" -#: ../../library/datetime.rst:1705 +#: ../../library/datetime.rst:1711 msgid "" "The smallest possible difference between non-equal :class:`.time` objects, " "``timedelta(microseconds=1)``, although note that arithmetic on :class:`." "time` objects is not supported." msgstr "" -#: ../../library/datetime.rst:1734 +#: ../../library/datetime.rst:1740 msgid "" "The object passed as the tzinfo argument to the :class:`.time` constructor, " "or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1748 +#: ../../library/datetime.rst:1754 msgid "" ":class:`.time` objects support equality and order comparisons, where *a* is " "considered less than *b* when *a* precedes *b* in time." msgstr "" -#: ../../library/datetime.rst:1751 +#: ../../library/datetime.rst:1757 msgid "" "Naive and aware :class:`!time` objects are never equal. Order comparison " "between naive and aware :class:`!time` objects raises :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1755 +#: ../../library/datetime.rst:1761 msgid "" "If both comparands are aware, and have the same :attr:`~.time.tzinfo` " -"attribute, the common :attr:`!tzinfo` attribute is ignored and the base " -"times are compared. If both comparands are aware and have different :attr:`!" -"tzinfo` attributes, the comparands are first adjusted by subtracting their " -"UTC offsets (obtained from ``self.utcoffset()``)." +"attribute, the :attr:`!tzinfo` and :attr:`!fold` attributes are ignored and " +"the base times are compared. If both comparands are aware and have " +"different :attr:`!tzinfo` attributes, the comparands are first adjusted by " +"subtracting their UTC offsets (obtained from ``self.utcoffset()``)." msgstr "" -#: ../../library/datetime.rst:1761 +#: ../../library/datetime.rst:1767 msgid "" "Equality comparisons between aware and naive :class:`.time` instances don't " "raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1765 +#: ../../library/datetime.rst:1771 msgid "" "In Boolean contexts, a :class:`.time` object is always considered to be true." msgstr "" -#: ../../library/datetime.rst:1767 +#: ../../library/datetime.rst:1773 msgid "" "Before Python 3.5, a :class:`.time` object was considered to be false if it " "represented midnight in UTC. This behavior was considered obscure and error-" @@ -2021,29 +2026,29 @@ msgid "" "details." msgstr "" -#: ../../library/datetime.rst:1774 +#: ../../library/datetime.rst:1780 msgid "Other constructor:" msgstr "" -#: ../../library/datetime.rst:1778 +#: ../../library/datetime.rst:1784 msgid "" "Return a :class:`.time` corresponding to a *time_string* in any valid ISO " "8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1782 +#: ../../library/datetime.rst:1788 msgid "" "The leading ``T``, normally required in cases where there may be ambiguity " "between a date and a time, is not required." msgstr "" -#: ../../library/datetime.rst:1784 +#: ../../library/datetime.rst:1790 msgid "" "Fractional seconds may have any number of digits (anything beyond 6 will be " "truncated)." msgstr "" -#: ../../library/datetime.rst:1788 +#: ../../library/datetime.rst:1794 #, fuzzy msgid "Examples:" msgstr "" @@ -2051,13 +2056,13 @@ msgstr "" "\n" "::" -#: ../../library/datetime.rst:1812 +#: ../../library/datetime.rst:1818 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`time.isoformat()`." msgstr "" -#: ../../library/datetime.rst:1822 +#: ../../library/datetime.rst:1828 msgid "" "Return a :class:`.time` with the same value, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -2065,46 +2070,46 @@ msgid "" "aware :class:`.time`, without conversion of the time data." msgstr "" -#: ../../library/datetime.rst:1833 +#: ../../library/datetime.rst:1839 msgid "Return a string representing the time in ISO 8601 format, one of:" msgstr "" -#: ../../library/datetime.rst:1835 +#: ../../library/datetime.rst:1841 msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1836 +#: ../../library/datetime.rst:1842 msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1837 +#: ../../library/datetime.rst:1843 msgid "" "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " "return ``None``" msgstr "" -#: ../../library/datetime.rst:1838 +#: ../../library/datetime.rst:1844 msgid "" "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" "`utcoffset` does not return ``None``" msgstr "" -#: ../../library/datetime.rst:1858 +#: ../../library/datetime.rst:1864 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "" -#: ../../library/datetime.rst:1877 +#: ../../library/datetime.rst:1883 msgid "For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" -#: ../../library/datetime.rst:1882 +#: ../../library/datetime.rst:1888 msgid "" "Return a string representing the time, controlled by an explicit format " "string. See also :ref:`strftime-strptime-behavior` and :meth:`time." "isoformat`." msgstr "" -#: ../../library/datetime.rst:1888 +#: ../../library/datetime.rst:1894 msgid "" "Same as :meth:`.time.strftime`. This makes it possible to specify a format " "string for a :class:`.time` object in :ref:`formatted string literals ` file there are some examples of :class:`tzinfo` classes:" msgstr "" -#: ../../library/datetime.rst:2144 +#: ../../library/datetime.rst:2150 msgid "" "Note that there are unavoidable subtleties twice per year in a :class:" "`tzinfo` subclass accounting for both standard and daylight time, at the DST " @@ -2372,7 +2377,7 @@ msgid "" "ends the minute after 1:59 (EDT) on the first Sunday in November::" msgstr "" -#: ../../library/datetime.rst:2158 +#: ../../library/datetime.rst:2164 msgid "" "When DST starts (the \"start\" line), the local wall clock leaps from 1:59 " "to 3:00. A wall time of the form 2:MM doesn't really make sense on that day, " @@ -2381,7 +2386,7 @@ msgid "" "get::" msgstr "" -#: ../../library/datetime.rst:2177 +#: ../../library/datetime.rst:2183 msgid "" "When DST ends (the \"end\" line), there's a potentially worse problem: " "there's an hour that can't be spelled unambiguously in local wall time: the " @@ -2396,13 +2401,13 @@ msgid "" "Fall back transition of 2016, we get::" msgstr "" -#: ../../library/datetime.rst:2199 +#: ../../library/datetime.rst:2205 msgid "" "Note that the :class:`.datetime` instances that differ only by the value of " "the :attr:`~.datetime.fold` attribute are considered equal in comparisons." msgstr "" -#: ../../library/datetime.rst:2202 +#: ../../library/datetime.rst:2208 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " "the value of the :attr:`~.datetime.fold` attribute or avoid using hybrid :" @@ -2412,28 +2417,28 @@ msgid "" "offset -4 hours))." msgstr "" -#: ../../library/datetime.rst:2216 +#: ../../library/datetime.rst:2222 msgid ":mod:`zoneinfo`" msgstr ":mod:`zoneinfo`" -#: ../../library/datetime.rst:2211 +#: ../../library/datetime.rst:2217 msgid "" "The :mod:`!datetime` module has a basic :class:`timezone` class (for " "handling arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` " "attribute (a UTC timezone instance)." msgstr "" -#: ../../library/datetime.rst:2215 +#: ../../library/datetime.rst:2221 msgid "" "``zoneinfo`` brings the *IANA timezone database* (also known as the Olson " "database) to Python, and its usage is recommended." msgstr "" -#: ../../library/datetime.rst:2222 +#: ../../library/datetime.rst:2228 msgid "`IANA timezone database `_" msgstr "`IANA 時區資料庫 `_" -#: ../../library/datetime.rst:2219 +#: ../../library/datetime.rst:2225 msgid "" "The Time Zone Database (often called tz, tzdata or zoneinfo) contains code " "and data that represent the history of local time for many representative " @@ -2442,24 +2447,24 @@ msgid "" "saving rules." msgstr "" -#: ../../library/datetime.rst:2229 +#: ../../library/datetime.rst:2235 msgid ":class:`timezone` Objects" msgstr ":class:`timezone` 物件" -#: ../../library/datetime.rst:2231 +#: ../../library/datetime.rst:2237 msgid "" "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " "of which represents a timezone defined by a fixed offset from UTC." msgstr "" -#: ../../library/datetime.rst:2235 +#: ../../library/datetime.rst:2241 msgid "" "Objects of this class cannot be used to represent timezone information in " "the locations where different offsets are used in different days of the year " "or where historical changes have been made to civil time." msgstr "" -#: ../../library/datetime.rst:2242 +#: ../../library/datetime.rst:2248 msgid "" "The *offset* argument must be specified as a :class:`timedelta` object " "representing the difference between the local time and UTC. It must be " @@ -2467,25 +2472,25 @@ msgid "" "otherwise :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:2247 +#: ../../library/datetime.rst:2253 msgid "" "The *name* argument is optional. If specified it must be a string that will " "be used as the value returned by the :meth:`datetime.tzname` method." msgstr "" -#: ../../library/datetime.rst:2258 ../../library/datetime.rst:2269 +#: ../../library/datetime.rst:2264 ../../library/datetime.rst:2275 msgid "" "Return the fixed value specified when the :class:`timezone` instance is " "constructed." msgstr "" -#: ../../library/datetime.rst:2261 +#: ../../library/datetime.rst:2267 msgid "" "The *dt* argument is ignored. The return value is a :class:`timedelta` " "instance equal to the difference between the local time and UTC." msgstr "" -#: ../../library/datetime.rst:2272 +#: ../../library/datetime.rst:2278 msgid "" "If *name* is not provided in the constructor, the name returned by " "``tzname(dt)`` is generated from the value of the ``offset`` as follows. If " @@ -2494,145 +2499,145 @@ msgid "" "are two digits of ``offset.hours`` and ``offset.minutes`` respectively." msgstr "" -#: ../../library/datetime.rst:2278 +#: ../../library/datetime.rst:2284 msgid "" "Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not " "``'UTC+00:00'``." msgstr "" -#: ../../library/datetime.rst:2285 +#: ../../library/datetime.rst:2291 msgid "Always returns ``None``." msgstr "總是回傳 ``None``。" -#: ../../library/datetime.rst:2289 +#: ../../library/datetime.rst:2295 msgid "" "Return ``dt + offset``. The *dt* argument must be an aware :class:`." "datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" -#: ../../library/datetime.rst:2296 +#: ../../library/datetime.rst:2302 msgid "The UTC timezone, ``timezone(timedelta(0))``." msgstr "UTC 時區,``timezone(timedelta(0))``。" -#: ../../library/datetime.rst:2305 +#: ../../library/datetime.rst:2311 msgid ":meth:`~.datetime.strftime` and :meth:`~.datetime.strptime` Behavior" msgstr ":meth:`~.datetime.strftime` 與 :meth:`~.datetime.strptime` 的行為" -#: ../../library/datetime.rst:2307 +#: ../../library/datetime.rst:2313 msgid "" ":class:`date`, :class:`.datetime`, and :class:`.time` objects all support a " "``strftime(format)`` method, to create a string representing the time under " "the control of an explicit format string." msgstr "" -#: ../../library/datetime.rst:2311 +#: ../../library/datetime.rst:2317 msgid "" "Conversely, the :meth:`datetime.strptime` class method creates a :class:`." "datetime` object from a string representing a date and time and a " "corresponding format string." msgstr "" -#: ../../library/datetime.rst:2315 +#: ../../library/datetime.rst:2321 msgid "" "The table below provides a high-level comparison of :meth:`~.datetime." "strftime` versus :meth:`~.datetime.strptime`:" msgstr "" -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2325 msgid "``strftime``" msgstr "``strftime``" -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2325 msgid "``strptime``" msgstr "``strptime``" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2327 msgid "Usage" msgstr "用法" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2327 msgid "Convert object to a string according to a given format" msgstr "" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2327 msgid "" "Parse a string into a :class:`.datetime` object given a corresponding format" msgstr "" -#: ../../library/datetime.rst:2323 +#: ../../library/datetime.rst:2329 msgid "Type of method" msgstr "" -#: ../../library/datetime.rst:2323 +#: ../../library/datetime.rst:2329 msgid "Instance method" msgstr "實例方法" -#: ../../library/datetime.rst:2323 +#: ../../library/datetime.rst:2329 msgid "Class method" msgstr "類別方法" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2331 msgid "Method of" msgstr "" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2331 msgid ":class:`date`; :class:`.datetime`; :class:`.time`" msgstr ":class:`date`; :class:`.datetime`; :class:`.time`" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2331 msgid ":class:`.datetime`" msgstr ":class:`.datetime`" -#: ../../library/datetime.rst:2327 +#: ../../library/datetime.rst:2333 msgid "Signature" msgstr "" -#: ../../library/datetime.rst:2327 +#: ../../library/datetime.rst:2333 msgid "``strftime(format)``" msgstr "``strftime(format)``" -#: ../../library/datetime.rst:2327 +#: ../../library/datetime.rst:2333 msgid "``strptime(date_string, format)``" msgstr "``strptime(date_string, format)``" -#: ../../library/datetime.rst:2334 +#: ../../library/datetime.rst:2340 msgid "" ":meth:`~.datetime.strftime` and :meth:`~.datetime.strptime` Format Codes" msgstr ":meth:`~.datetime.strftime` 與 :meth:`~.datetime.strptime` 格式碼" -#: ../../library/datetime.rst:2336 +#: ../../library/datetime.rst:2342 msgid "" "These methods accept format codes that can be used to parse and format " "dates::" msgstr "" -#: ../../library/datetime.rst:2344 +#: ../../library/datetime.rst:2350 msgid "" "The following is a list of all the format codes that the 1989 C standard " "requires, and these work on all platforms with a standard C implementation." msgstr "" -#: ../../library/datetime.rst:2348 ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2354 ../../library/datetime.rst:2457 msgid "Directive" msgstr "" -#: ../../library/datetime.rst:2348 ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2354 ../../library/datetime.rst:2457 msgid "Meaning" msgstr "" -#: ../../library/datetime.rst:2348 ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2354 ../../library/datetime.rst:2457 msgid "Example" msgstr "範例" -#: ../../library/datetime.rst:2348 ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2354 ../../library/datetime.rst:2457 msgid "Notes" msgstr "註解" -#: ../../library/datetime.rst:2350 +#: ../../library/datetime.rst:2356 msgid "``%a``" msgstr "``%a``" -#: ../../library/datetime.rst:2350 +#: ../../library/datetime.rst:2356 msgid "Weekday as locale's abbreviated name." msgstr "" @@ -2644,11 +2649,11 @@ msgstr "" msgid "So, Mo, ..., Sa (de_DE)" msgstr "" -#: ../../library/datetime.rst:2355 +#: ../../library/datetime.rst:2361 msgid "``%A``" msgstr "``%A``" -#: ../../library/datetime.rst:2355 +#: ../../library/datetime.rst:2361 msgid "Weekday as locale's full name." msgstr "" @@ -2660,42 +2665,42 @@ msgstr "" msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" -#: ../../library/datetime.rst:2360 +#: ../../library/datetime.rst:2366 msgid "``%w``" msgstr "``%w``" -#: ../../library/datetime.rst:2360 +#: ../../library/datetime.rst:2366 msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." msgstr "" -#: ../../library/datetime.rst:2360 +#: ../../library/datetime.rst:2366 msgid "0, 1, ..., 6" msgstr "0, 1, ..., 6" -#: ../../library/datetime.rst:2364 +#: ../../library/datetime.rst:2370 msgid "``%d``" msgstr "``%d``" -#: ../../library/datetime.rst:2364 +#: ../../library/datetime.rst:2370 msgid "Day of the month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2364 +#: ../../library/datetime.rst:2370 msgid "01, 02, ..., 31" msgstr "01, 02, ..., 31" -#: ../../library/datetime.rst:2364 ../../library/datetime.rst:2377 -#: ../../library/datetime.rst:2380 ../../library/datetime.rst:2386 -#: ../../library/datetime.rst:2389 ../../library/datetime.rst:2395 -#: ../../library/datetime.rst:2413 +#: ../../library/datetime.rst:2370 ../../library/datetime.rst:2383 +#: ../../library/datetime.rst:2386 ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2395 ../../library/datetime.rst:2401 +#: ../../library/datetime.rst:2419 msgid "\\(9)" msgstr "\\(9)" -#: ../../library/datetime.rst:2367 +#: ../../library/datetime.rst:2373 msgid "``%b``" msgstr "``%b``" -#: ../../library/datetime.rst:2367 +#: ../../library/datetime.rst:2373 msgid "Month as locale's abbreviated name." msgstr "" @@ -2707,11 +2712,11 @@ msgstr "" msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" -#: ../../library/datetime.rst:2372 +#: ../../library/datetime.rst:2378 msgid "``%B``" msgstr "``%B``" -#: ../../library/datetime.rst:2372 +#: ../../library/datetime.rst:2378 msgid "Month as locale's full name." msgstr "" @@ -2723,67 +2728,67 @@ msgstr "" msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" -#: ../../library/datetime.rst:2377 +#: ../../library/datetime.rst:2383 msgid "``%m``" msgstr "``%m``" -#: ../../library/datetime.rst:2377 +#: ../../library/datetime.rst:2383 msgid "Month as a zero-padded decimal number." msgstr "以零填充的並以十進位數字表示的月份。" -#: ../../library/datetime.rst:2377 ../../library/datetime.rst:2389 +#: ../../library/datetime.rst:2383 ../../library/datetime.rst:2395 msgid "01, 02, ..., 12" msgstr "01, 02, ..., 12" -#: ../../library/datetime.rst:2380 +#: ../../library/datetime.rst:2386 msgid "``%y``" msgstr "``%y``" -#: ../../library/datetime.rst:2380 +#: ../../library/datetime.rst:2386 msgid "Year without century as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2380 +#: ../../library/datetime.rst:2386 msgid "00, 01, ..., 99" msgstr "00, 01, ..., 99" -#: ../../library/datetime.rst:2383 +#: ../../library/datetime.rst:2389 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/datetime.rst:2383 +#: ../../library/datetime.rst:2389 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/datetime.rst:2383 ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2389 ../../library/datetime.rst:2459 msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgstr "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" -#: ../../library/datetime.rst:2386 +#: ../../library/datetime.rst:2392 msgid "``%H``" msgstr "``%H``" -#: ../../library/datetime.rst:2386 +#: ../../library/datetime.rst:2392 msgid "Hour (24-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2386 +#: ../../library/datetime.rst:2392 msgid "00, 01, ..., 23" msgstr "00, 01, ..., 23" -#: ../../library/datetime.rst:2389 +#: ../../library/datetime.rst:2395 msgid "``%I``" msgstr "``%I``" -#: ../../library/datetime.rst:2389 +#: ../../library/datetime.rst:2395 msgid "Hour (12-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2398 msgid "``%p``" msgstr "``%p``" -#: ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2398 msgid "Locale's equivalent of either AM or PM." msgstr "" @@ -2795,128 +2800,128 @@ msgstr "AM, PM (en_US);" msgid "am, pm (de_DE)" msgstr "am, pm (de_DE)" -#: ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2398 msgid "\\(1), \\(3)" msgstr "\\(1), \\(3)" -#: ../../library/datetime.rst:2395 +#: ../../library/datetime.rst:2401 msgid "``%M``" msgstr "``%M``" -#: ../../library/datetime.rst:2395 +#: ../../library/datetime.rst:2401 msgid "Minute as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2395 ../../library/datetime.rst:2398 +#: ../../library/datetime.rst:2401 ../../library/datetime.rst:2404 msgid "00, 01, ..., 59" msgstr "00, 01, ..., 59" -#: ../../library/datetime.rst:2398 +#: ../../library/datetime.rst:2404 msgid "``%S``" msgstr "``%S``" -#: ../../library/datetime.rst:2398 +#: ../../library/datetime.rst:2404 msgid "Second as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2398 +#: ../../library/datetime.rst:2404 msgid "\\(4), \\(9)" msgstr "\\(4), \\(9)" -#: ../../library/datetime.rst:2401 +#: ../../library/datetime.rst:2407 msgid "``%f``" msgstr "``%f``" -#: ../../library/datetime.rst:2401 +#: ../../library/datetime.rst:2407 msgid "Microsecond as a decimal number, zero-padded to 6 digits." msgstr "" -#: ../../library/datetime.rst:2401 +#: ../../library/datetime.rst:2407 msgid "000000, 000001, ..., 999999" msgstr "000000, 000001, ..., 999999" -#: ../../library/datetime.rst:2401 +#: ../../library/datetime.rst:2407 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/datetime.rst:2405 ../../library/datetime.rst:2574 +#: ../../library/datetime.rst:2411 ../../library/datetime.rst:2580 msgid "``%z``" msgstr "``%z``" -#: ../../library/datetime.rst:2405 +#: ../../library/datetime.rst:2411 msgid "" "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " "naive)." msgstr "" -#: ../../library/datetime.rst:2405 +#: ../../library/datetime.rst:2411 msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" msgstr "" -#: ../../library/datetime.rst:2405 ../../library/datetime.rst:2410 -#: ../../library/datetime.rst:2467 +#: ../../library/datetime.rst:2411 ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2473 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/datetime.rst:2410 ../../library/datetime.rst:2602 +#: ../../library/datetime.rst:2416 ../../library/datetime.rst:2608 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/datetime.rst:2410 +#: ../../library/datetime.rst:2416 msgid "Time zone name (empty string if the object is naive)." msgstr "" -#: ../../library/datetime.rst:2410 +#: ../../library/datetime.rst:2416 msgid "(empty), UTC, GMT" msgstr "" -#: ../../library/datetime.rst:2413 +#: ../../library/datetime.rst:2419 msgid "``%j``" msgstr "``%j``" -#: ../../library/datetime.rst:2413 +#: ../../library/datetime.rst:2419 msgid "Day of the year as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2413 +#: ../../library/datetime.rst:2419 msgid "001, 002, ..., 366" msgstr "001, 002, ..., 366" -#: ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2422 msgid "``%U``" msgstr "``%U``" -#: ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2422 msgid "" "Week number of the year (Sunday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2416 ../../library/datetime.rst:2424 +#: ../../library/datetime.rst:2422 ../../library/datetime.rst:2430 msgid "00, 01, ..., 53" msgstr "00, 01, ..., 53" -#: ../../library/datetime.rst:2416 ../../library/datetime.rst:2424 +#: ../../library/datetime.rst:2422 ../../library/datetime.rst:2430 msgid "\\(7), \\(9)" msgstr "\\(7), \\(9)" -#: ../../library/datetime.rst:2424 +#: ../../library/datetime.rst:2430 msgid "``%W``" msgstr "``%W``" -#: ../../library/datetime.rst:2424 +#: ../../library/datetime.rst:2430 msgid "" "Week number of the year (Monday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Monday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2432 +#: ../../library/datetime.rst:2438 msgid "``%c``" msgstr "``%c``" -#: ../../library/datetime.rst:2432 +#: ../../library/datetime.rst:2438 msgid "Locale's appropriate date and time representation." msgstr "" @@ -2928,11 +2933,11 @@ msgstr "" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2443 msgid "``%x``" msgstr "``%x``" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2443 msgid "Locale's appropriate date representation." msgstr "" @@ -2948,11 +2953,11 @@ msgstr "" msgid "16.08.1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2441 +#: ../../library/datetime.rst:2447 msgid "``%X``" msgstr "``%X``" -#: ../../library/datetime.rst:2441 +#: ../../library/datetime.rst:2447 msgid "Locale's appropriate time representation." msgstr "" @@ -2964,83 +2969,83 @@ msgstr "" msgid "21:30:00 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2444 +#: ../../library/datetime.rst:2450 msgid "``%%``" msgstr "``%%``" -#: ../../library/datetime.rst:2444 +#: ../../library/datetime.rst:2450 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/datetime.rst:2444 +#: ../../library/datetime.rst:2450 msgid "%" msgstr "%" -#: ../../library/datetime.rst:2447 +#: ../../library/datetime.rst:2453 msgid "" "Several additional directives not required by the C89 standard are included " "for convenience. These parameters all correspond to ISO 8601 date values." msgstr "" -#: ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2459 msgid "``%G``" msgstr "``%G``" -#: ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2459 msgid "" "ISO 8601 year with century representing the year that contains the greater " "part of the ISO week (``%V``)." msgstr "" -#: ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2459 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/datetime.rst:2458 +#: ../../library/datetime.rst:2464 msgid "``%u``" msgstr "``%u``" -#: ../../library/datetime.rst:2458 +#: ../../library/datetime.rst:2464 msgid "ISO 8601 weekday as a decimal number where 1 is Monday." msgstr "" -#: ../../library/datetime.rst:2458 +#: ../../library/datetime.rst:2464 msgid "1, 2, ..., 7" msgstr "1, 2, ..., 7" -#: ../../library/datetime.rst:2461 +#: ../../library/datetime.rst:2467 msgid "``%V``" msgstr "``%V``" -#: ../../library/datetime.rst:2461 +#: ../../library/datetime.rst:2467 msgid "" "ISO 8601 week as a decimal number with Monday as the first day of the week. " "Week 01 is the week containing Jan 4." msgstr "" -#: ../../library/datetime.rst:2461 +#: ../../library/datetime.rst:2467 msgid "01, 02, ..., 53" msgstr "01, 02, ..., 53" -#: ../../library/datetime.rst:2461 +#: ../../library/datetime.rst:2467 msgid "\\(8), \\(9)" msgstr "\\(8), \\(9)" -#: ../../library/datetime.rst:2467 ../../library/datetime.rst:2588 +#: ../../library/datetime.rst:2473 ../../library/datetime.rst:2594 msgid "``%:z``" msgstr "``%:z``" -#: ../../library/datetime.rst:2467 +#: ../../library/datetime.rst:2473 msgid "" "UTC offset in the form ``±HH:MM[:SS[.ffffff]]`` (empty string if the object " "is naive)." msgstr "" -#: ../../library/datetime.rst:2467 +#: ../../library/datetime.rst:2473 msgid "(empty), +00:00, -04:00, +10:30, +06:34:15, -03:07:12.345216" msgstr "" -#: ../../library/datetime.rst:2473 +#: ../../library/datetime.rst:2479 msgid "" "These may not be available on all platforms when used with the :meth:`~." "datetime.strftime` method. The ISO 8601 year and ISO 8601 week directives " @@ -3049,7 +3054,7 @@ msgid "" "directives will raise a :exc:`ValueError`." msgstr "" -#: ../../library/datetime.rst:2478 +#: ../../library/datetime.rst:2484 msgid "" "The full set of format codes supported varies across platforms, because " "Python calls the platform C library's :c:func:`strftime` function, and " @@ -3059,44 +3064,44 @@ msgid "" "unsupported format specifiers." msgstr "" -#: ../../library/datetime.rst:2484 +#: ../../library/datetime.rst:2490 msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "新增 ``%G``\\ 、\\ ``%u`` 與 ``%V``\\ 。" -#: ../../library/datetime.rst:2487 +#: ../../library/datetime.rst:2493 msgid "``%:z`` was added." msgstr "新增 ``%:z``。" -#: ../../library/datetime.rst:2491 +#: ../../library/datetime.rst:2497 msgid "Technical Detail" msgstr "技術細節" -#: ../../library/datetime.rst:2493 +#: ../../library/datetime.rst:2499 msgid "" "Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's " "``time.strftime(fmt, d.timetuple())`` although not all objects support a :" "meth:`~date.timetuple` method." msgstr "" -#: ../../library/datetime.rst:2497 +#: ../../library/datetime.rst:2503 msgid "" "For the :meth:`.datetime.strptime` class method, the default value is " "``1900-01-01T00:00:00.000``: any components not specified in the format " "string will be pulled from the default value. [#]_" msgstr "" -#: ../../library/datetime.rst:2501 +#: ../../library/datetime.rst:2507 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:2505 +#: ../../library/datetime.rst:2511 msgid "" "except when the format includes sub-second components or timezone offset " "information, which are supported in ``datetime.strptime`` but are discarded " "by ``time.strptime``." msgstr "" -#: ../../library/datetime.rst:2509 +#: ../../library/datetime.rst:2515 msgid "" "For :class:`.time` objects, the format codes for year, month, and day should " "not be used, as :class:`!time` objects have no such values. If they're used " @@ -3107,7 +3112,7 @@ msgstr "" "time` 物件並沒有這些值。如果使用這些格式碼,年份會以 ``1900`` 代替、月及日會" "以 ``1`` 代替。" -#: ../../library/datetime.rst:2513 +#: ../../library/datetime.rst:2519 msgid "" "For :class:`date` objects, the format codes for hours, minutes, seconds, and " "microseconds should not be used, as :class:`date` objects have no such " @@ -3116,7 +3121,7 @@ msgstr "" "對 :class:`.date` 物件來說,不應該使用時、分、秒、微秒的格式碼,因為 :class:" "`date` 物件並沒有這些值。如果使用這些格式碼,這些值都會以 ``0`` 代替。" -#: ../../library/datetime.rst:2517 +#: ../../library/datetime.rst:2523 msgid "" "For the same reason, handling of format strings containing Unicode code " "points that can't be represented in the charset of the current locale is " @@ -3125,7 +3130,7 @@ msgid "" "`UnicodeError` or return an empty string instead." msgstr "" -#: ../../library/datetime.rst:2526 +#: ../../library/datetime.rst:2532 msgid "" "Because the format depends on the current locale, care should be taken when " "making assumptions about the output value. Field orderings will vary (for " @@ -3133,38 +3138,38 @@ msgid "" "contain non-ASCII characters." msgstr "" -#: ../../library/datetime.rst:2532 +#: ../../library/datetime.rst:2538 msgid "" "The :meth:`~.datetime.strptime` method can parse years in the full [1, 9999] " "range, but years < 1000 must be zero-filled to 4-digit width." msgstr "" -#: ../../library/datetime.rst:2535 +#: ../../library/datetime.rst:2541 msgid "" "In previous versions, :meth:`~.datetime.strftime` method was restricted to " "years >= 1900." msgstr "" -#: ../../library/datetime.rst:2539 +#: ../../library/datetime.rst:2545 msgid "" "In version 3.2, :meth:`~.datetime.strftime` method was restricted to years " ">= 1000." msgstr "" -#: ../../library/datetime.rst:2544 +#: ../../library/datetime.rst:2550 msgid "" "When used with the :meth:`~.datetime.strptime` method, the ``%p`` directive " "only affects the output hour field if the ``%I`` directive is used to parse " "the hour." msgstr "" -#: ../../library/datetime.rst:2548 +#: ../../library/datetime.rst:2554 msgid "" "Unlike the :mod:`time` module, the :mod:`!datetime` module does not support " "leap seconds." msgstr "" -#: ../../library/datetime.rst:2552 +#: ../../library/datetime.rst:2558 msgid "" "When used with the :meth:`~.datetime.strptime` method, the ``%f`` directive " "accepts from one to six digits and zero pads on the right. ``%f`` is an " @@ -3172,17 +3177,17 @@ msgid "" "separately in datetime objects, and therefore always available)." msgstr "" -#: ../../library/datetime.rst:2559 +#: ../../library/datetime.rst:2565 msgid "" "For a naive object, the ``%z``, ``%:z`` and ``%Z`` format codes are replaced " "by empty strings." msgstr "" -#: ../../library/datetime.rst:2562 +#: ../../library/datetime.rst:2568 msgid "For an aware object:" msgstr "" -#: ../../library/datetime.rst:2565 +#: ../../library/datetime.rst:2571 msgid "" ":meth:`~.datetime.utcoffset` is transformed into a string of the form " "``±HHMM[SS[.ffffff]]``, where ``HH`` is a 2-digit string giving the number " @@ -3196,7 +3201,7 @@ msgid "" "replaced with the string ``'-0330'``." msgstr "" -#: ../../library/datetime.rst:2579 +#: ../../library/datetime.rst:2585 msgid "" "When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` " "method, the UTC offsets can have a colon as a separator between hours, " @@ -3205,53 +3210,53 @@ msgid "" "``'+00:00'``." msgstr "" -#: ../../library/datetime.rst:2587 +#: ../../library/datetime.rst:2593 msgid "" "Behaves exactly as ``%z``, but has a colon separator added between hours, " "minutes and seconds." msgstr "" -#: ../../library/datetime.rst:2591 +#: ../../library/datetime.rst:2597 msgid "" "In :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string if :" "meth:`~.datetime.tzname` returns ``None``; otherwise ``%Z`` is replaced by " "the returned value, which must be a string." msgstr "" -#: ../../library/datetime.rst:2595 +#: ../../library/datetime.rst:2601 msgid ":meth:`~.datetime.strptime` only accepts certain values for ``%Z``:" msgstr "" -#: ../../library/datetime.rst:2597 +#: ../../library/datetime.rst:2603 msgid "any value in ``time.tzname`` for your machine's locale" msgstr "" -#: ../../library/datetime.rst:2598 +#: ../../library/datetime.rst:2604 msgid "the hard-coded values ``UTC`` and ``GMT``" msgstr "" -#: ../../library/datetime.rst:2600 +#: ../../library/datetime.rst:2606 msgid "" "So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid " "values, but probably not ``EST``. It will raise ``ValueError`` for invalid " "values." msgstr "" -#: ../../library/datetime.rst:2604 +#: ../../library/datetime.rst:2610 msgid "" "When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` " "method, an aware :class:`.datetime` object will be produced. The ``tzinfo`` " "of the result will be set to a :class:`timezone` instance." msgstr "" -#: ../../library/datetime.rst:2610 +#: ../../library/datetime.rst:2616 msgid "" "When used with the :meth:`~.datetime.strptime` method, ``%U`` and ``%W`` are " "only used in calculations when the day of the week and the calendar year " "(``%Y``) are specified." msgstr "" -#: ../../library/datetime.rst:2615 +#: ../../library/datetime.rst:2621 msgid "" "Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the " "day of the week and the ISO year (``%G``) are specified in a :meth:`~." @@ -3259,7 +3264,7 @@ msgid "" "interchangeable." msgstr "" -#: ../../library/datetime.rst:2621 +#: ../../library/datetime.rst:2627 msgid "" "When used with the :meth:`~.datetime.strptime` method, the leading zero is " "optional for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, " @@ -3267,15 +3272,15 @@ msgid "" "zero." msgstr "" -#: ../../library/datetime.rst:2626 +#: ../../library/datetime.rst:2632 msgid "Footnotes" msgstr "註解" -#: ../../library/datetime.rst:2627 +#: ../../library/datetime.rst:2633 msgid "If, that is, we ignore the effects of Relativity" msgstr "也就是說,我們會忽略相對論的效應" -#: ../../library/datetime.rst:2629 +#: ../../library/datetime.rst:2635 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -3284,23 +3289,23 @@ msgid "" "systems." msgstr "" -#: ../../library/datetime.rst:2635 +#: ../../library/datetime.rst:2641 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " "`_ for a good explanation." msgstr "" -#: ../../library/datetime.rst:2639 +#: ../../library/datetime.rst:2645 msgid "" "Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since ``1900`` is " "not a leap year." msgstr "" -#: ../../library/datetime.rst:2299 +#: ../../library/datetime.rst:2305 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/datetime.rst:2299 +#: ../../library/datetime.rst:2305 msgid "datetime format" msgstr "datetime format(日期時間格式)" diff --git a/library/logging.po b/library/logging.po index 7f58f336e4..9df5536053 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-02 00:03+0000\n" +"POT-Creation-Date: 2024-03-02 00:03+0000\n" "PO-Revision-Date: 2023-08-20 16:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -129,6 +129,36 @@ msgstr "" #: ../../library/logging.rst:82 msgid "" +"This is the logger's name, and is the value that was passed to :func:" +"`getLogger` to obtain the logger." +msgstr "" + +#: ../../library/logging.rst:85 ../../library/logging.rst:145 +msgid "This attribute should be treated as read-only." +msgstr "" + +#: ../../library/logging.rst:89 +msgid "The threshold of this logger, as set by the :meth:`setLevel` method." +msgstr "" + +#: ../../library/logging.rst:91 +msgid "" +"Do not set this attribute directly - always use :meth:`setLevel`, which has " +"checks for the level passed to it." +msgstr "" + +#: ../../library/logging.rst:96 +msgid "" +"The parent logger of this logger. It may change based on later instantiation " +"of loggers which are higher up in the namespace hierarchy." +msgstr "" + +#: ../../library/logging.rst:99 +msgid "This value should be treated as read-only." +msgstr "" + +#: ../../library/logging.rst:103 +msgid "" "If this attribute evaluates to true, events logged to this logger will be " "passed to the handlers of higher level (ancestor) loggers, in addition to " "any handlers attached to this logger. Messages are passed directly to the " @@ -136,13 +166,13 @@ msgid "" "loggers in question are considered." msgstr "" -#: ../../library/logging.rst:88 +#: ../../library/logging.rst:109 msgid "" "If this evaluates to false, logging messages are not passed to the handlers " "of ancestor loggers." msgstr "" -#: ../../library/logging.rst:91 +#: ../../library/logging.rst:112 msgid "" "Spelling it out with an example: If the propagate attribute of the logger " "named ``A.B.C`` evaluates to true, any event logged to ``A.B.C`` via a " @@ -155,11 +185,11 @@ msgid "" "handle, and propagation stops at that point." msgstr "" -#: ../../library/logging.rst:100 +#: ../../library/logging.rst:121 msgid "The constructor sets this attribute to ``True``." msgstr "" -#: ../../library/logging.rst:102 +#: ../../library/logging.rst:123 msgid "" "If you attach a handler to a logger *and* one or more of its ancestors, it " "may emit the same record multiple times. In general, you should not need to " @@ -171,7 +201,24 @@ msgid "" "rest." msgstr "" -#: ../../library/logging.rst:113 +#: ../../library/logging.rst:134 +msgid "The list of handlers directly attached to this logger instance." +msgstr "" + +#: ../../library/logging.rst:136 +msgid "" +"This attribute should be treated as read-only; it is normally changed via " +"the :meth:`addHandler` and :meth:`removeHandler` methods, which use locks to " +"ensure thread-safe operation." +msgstr "" + +#: ../../library/logging.rst:142 +msgid "" +"This attribute disables handling of any events. It is set to ``False`` in " +"the initializer, and only changed by logging configuration code." +msgstr "" + +#: ../../library/logging.rst:149 msgid "" "Sets the threshold for this logger to *level*. Logging messages which are " "less severe than *level* will be ignored; logging messages which have " @@ -180,7 +227,7 @@ msgid "" "severity level than *level*." msgstr "" -#: ../../library/logging.rst:118 +#: ../../library/logging.rst:154 msgid "" "When a logger is created, the level is set to :const:`NOTSET` (which causes " "all messages to be processed when the logger is the root logger, or " @@ -188,32 +235,32 @@ msgid "" "the root logger is created with level :const:`WARNING`." msgstr "" -#: ../../library/logging.rst:123 +#: ../../library/logging.rst:159 msgid "" "The term 'delegation to the parent' means that if a logger has a level of " "NOTSET, its chain of ancestor loggers is traversed until either an ancestor " "with a level other than NOTSET is found, or the root is reached." msgstr "" -#: ../../library/logging.rst:127 +#: ../../library/logging.rst:163 msgid "" "If an ancestor is found with a level other than NOTSET, then that ancestor's " "level is treated as the effective level of the logger where the ancestor " "search began, and is used to determine how a logging event is handled." msgstr "" -#: ../../library/logging.rst:131 +#: ../../library/logging.rst:167 msgid "" "If the root is reached, and it has a level of NOTSET, then all messages will " "be processed. Otherwise, the root's level will be used as the effective " "level." msgstr "" -#: ../../library/logging.rst:134 ../../library/logging.rst:477 +#: ../../library/logging.rst:170 ../../library/logging.rst:513 msgid "See :ref:`levels` for a list of levels." msgstr "層級清單請見 :ref:`levels`\\ 。" -#: ../../library/logging.rst:136 +#: ../../library/logging.rst:172 msgid "" "The *level* parameter now accepts a string representation of the level such " "as 'INFO' as an alternative to the integer constants such as :const:`INFO`. " @@ -222,7 +269,7 @@ msgid "" "expect to be passed integers." msgstr "" -#: ../../library/logging.rst:146 +#: ../../library/logging.rst:182 msgid "" "Indicates if a message of severity *level* would be processed by this " "logger. This method checks first the module-level level set by ``logging." @@ -230,7 +277,7 @@ msgid "" "meth:`getEffectiveLevel`." msgstr "" -#: ../../library/logging.rst:154 +#: ../../library/logging.rst:190 msgid "" "Indicates the effective level for this logger. If a value other than :const:" "`NOTSET` has been set using :meth:`setLevel`, it is returned. Otherwise, the " @@ -239,7 +286,7 @@ msgid "" "integer, typically one of :const:`logging.DEBUG`, :const:`logging.INFO` etc." msgstr "" -#: ../../library/logging.rst:164 +#: ../../library/logging.rst:200 msgid "" "Returns a logger which is a descendant to this logger, as determined by the " "suffix. Thus, ``logging.getLogger('abc').getChild('def.ghi')`` would return " @@ -248,7 +295,7 @@ msgid "" "named using e.g. ``__name__`` rather than a literal string." msgstr "" -#: ../../library/logging.rst:175 +#: ../../library/logging.rst:211 msgid "" "Returns a set of loggers which are immediate children of this logger. So for " "example ``logging.getLogger().getChildren()`` might return a set containing " @@ -258,7 +305,7 @@ msgid "" "include one named ``foo.bar.baz``." msgstr "" -#: ../../library/logging.rst:187 +#: ../../library/logging.rst:223 msgid "" "Logs a message with level :const:`DEBUG` on this logger. The *msg* is the " "message format string, and the *args* are the arguments which are merged " @@ -268,13 +315,13 @@ msgid "" "are supplied." msgstr "" -#: ../../library/logging.rst:193 +#: ../../library/logging.rst:229 msgid "" "There are four keyword arguments in *kwargs* which are inspected: " "*exc_info*, *stack_info*, *stacklevel* and *extra*." msgstr "" -#: ../../library/logging.rst:196 +#: ../../library/logging.rst:232 msgid "" "If *exc_info* does not evaluate as false, it causes exception information to " "be added to the logging message. If an exception tuple (in the format " @@ -283,7 +330,7 @@ msgid "" "information." msgstr "" -#: ../../library/logging.rst:201 ../../library/logging.rst:1116 +#: ../../library/logging.rst:237 ../../library/logging.rst:1152 msgid "" "The second optional keyword argument is *stack_info*, which defaults to " "``False``. If true, stack information is added to the logging message, " @@ -295,20 +342,20 @@ msgid "" "handlers." msgstr "" -#: ../../library/logging.rst:210 ../../library/logging.rst:1125 +#: ../../library/logging.rst:246 ../../library/logging.rst:1161 msgid "" "You can specify *stack_info* independently of *exc_info*, e.g. to just show " "how you got to a certain point in your code, even when no exceptions were " "raised. The stack frames are printed following a header line which says:" msgstr "" -#: ../../library/logging.rst:218 ../../library/logging.rst:1133 +#: ../../library/logging.rst:254 ../../library/logging.rst:1169 msgid "" "This mimics the ``Traceback (most recent call last):`` which is used when " "displaying exception frames." msgstr "" -#: ../../library/logging.rst:221 +#: ../../library/logging.rst:257 msgid "" "The third optional keyword argument is *stacklevel*, which defaults to " "``1``. If greater than 1, the corresponding number of stack frames are " @@ -320,7 +367,7 @@ msgid "" "module." msgstr "" -#: ../../library/logging.rst:229 +#: ../../library/logging.rst:265 msgid "" "The fourth keyword argument is *extra* which can be used to pass a " "dictionary which is used to populate the __dict__ of the :class:`LogRecord` " @@ -329,18 +376,18 @@ msgid "" "incorporated into logged messages. For example::" msgstr "" -#: ../../library/logging.rst:241 +#: ../../library/logging.rst:277 msgid "would print something like" msgstr "" -#: ../../library/logging.rst:247 +#: ../../library/logging.rst:283 msgid "" "The keys in the dictionary passed in *extra* should not clash with the keys " "used by the logging system. (See the section on :ref:`logrecord-attributes` " "for more information on which keys are used by the logging system.)" msgstr "" -#: ../../library/logging.rst:251 +#: ../../library/logging.rst:287 msgid "" "If you choose to use these attributes in logged messages, you need to " "exercise some care. In the above example, for instance, the :class:" @@ -351,7 +398,7 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:258 ../../library/logging.rst:1164 +#: ../../library/logging.rst:294 ../../library/logging.rst:1200 msgid "" "While this might be annoying, this feature is intended for use in " "specialized circumstances, such as multi-threaded servers where the same " @@ -362,78 +409,78 @@ msgid "" "particular :class:`Handler`\\ s." msgstr "" -#: ../../library/logging.rst:265 +#: ../../library/logging.rst:301 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`." msgstr "" -#: ../../library/logging.rst:269 ../../library/logging.rst:1175 +#: ../../library/logging.rst:305 ../../library/logging.rst:1211 msgid "The *stack_info* parameter was added." msgstr "新增 *stack_info* 參數。" -#: ../../library/logging.rst:272 +#: ../../library/logging.rst:308 msgid "The *exc_info* parameter can now accept exception instances." msgstr "" -#: ../../library/logging.rst:275 +#: ../../library/logging.rst:311 msgid "The *stacklevel* parameter was added." msgstr "新增 *stacklevel* 參數。" -#: ../../library/logging.rst:281 +#: ../../library/logging.rst:317 msgid "" "Logs a message with level :const:`INFO` on this logger. The arguments are " "interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:287 +#: ../../library/logging.rst:323 msgid "" "Logs a message with level :const:`WARNING` on this logger. The arguments are " "interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:290 +#: ../../library/logging.rst:326 msgid "" "There is an obsolete method ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:296 +#: ../../library/logging.rst:332 msgid "" "Logs a message with level :const:`ERROR` on this logger. The arguments are " "interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:302 +#: ../../library/logging.rst:338 msgid "" "Logs a message with level :const:`CRITICAL` on this logger. The arguments " "are interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:308 +#: ../../library/logging.rst:344 msgid "" "Logs a message with integer level *level* on this logger. The other " "arguments are interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:314 +#: ../../library/logging.rst:350 msgid "" "Logs a message with level :const:`ERROR` on this logger. The arguments are " "interpreted as for :meth:`debug`. Exception info is added to the logging " "message. This method should only be called from an exception handler." msgstr "" -#: ../../library/logging.rst:321 +#: ../../library/logging.rst:357 msgid "Adds the specified filter *filter* to this logger." msgstr "在該 logger 內增加指定的 filter *filter*。" -#: ../../library/logging.rst:326 +#: ../../library/logging.rst:362 msgid "Removes the specified filter *filter* from this logger." msgstr "在該 logger 內移除指定的 filter *filter*。" -#: ../../library/logging.rst:331 +#: ../../library/logging.rst:367 msgid "" "Apply this logger's filters to the record and return ``True`` if the record " "is to be processed. The filters are consulted in turn, until one of them " @@ -442,22 +489,22 @@ msgid "" "processing of the record occurs." msgstr "" -#: ../../library/logging.rst:340 +#: ../../library/logging.rst:376 msgid "Adds the specified handler *hdlr* to this logger." msgstr "" -#: ../../library/logging.rst:345 +#: ../../library/logging.rst:381 msgid "Removes the specified handler *hdlr* from this logger." msgstr "" -#: ../../library/logging.rst:350 +#: ../../library/logging.rst:386 msgid "" "Finds the caller's source filename and line number. Returns the filename, " "line number, function name and stack information as a 4-element tuple. The " "stack information is returned as ``None`` unless *stack_info* is ``True``." msgstr "" -#: ../../library/logging.rst:354 +#: ../../library/logging.rst:390 msgid "" "The *stacklevel* parameter is passed from code calling the :meth:`debug` and " "other APIs. If greater than 1, the excess is used to skip stack frames " @@ -467,7 +514,7 @@ msgid "" "calls it." msgstr "" -#: ../../library/logging.rst:364 +#: ../../library/logging.rst:400 msgid "" "Handles a record by passing it to all handlers associated with this logger " "and its ancestors (until a false value of *propagate* is found). This method " @@ -476,13 +523,13 @@ msgid "" "filter`." msgstr "" -#: ../../library/logging.rst:372 +#: ../../library/logging.rst:408 msgid "" "This is a factory method which can be overridden in subclasses to create " "specialized :class:`LogRecord` instances." msgstr "" -#: ../../library/logging.rst:377 +#: ../../library/logging.rst:413 msgid "" "Checks to see if this logger has any handlers configured. This is done by " "looking for handlers in this logger and its parents in the logger hierarchy. " @@ -492,15 +539,15 @@ msgid "" "the existence of handlers." msgstr "" -#: ../../library/logging.rst:386 +#: ../../library/logging.rst:422 msgid "Loggers can now be pickled and unpickled." msgstr "" -#: ../../library/logging.rst:392 +#: ../../library/logging.rst:428 msgid "Logging Levels" msgstr "" -#: ../../library/logging.rst:394 +#: ../../library/logging.rst:430 msgid "" "The numeric values of logging levels are given in the following table. These " "are primarily of interest if you want to define your own levels, and need " @@ -509,83 +556,83 @@ msgid "" "value; the predefined name is lost." msgstr "" -#: ../../library/logging.rst:401 +#: ../../library/logging.rst:437 msgid "Level" msgstr "" -#: ../../library/logging.rst:401 +#: ../../library/logging.rst:437 msgid "Numeric value" msgstr "" -#: ../../library/logging.rst:401 +#: ../../library/logging.rst:437 msgid "What it means / When to use it" msgstr "" -#: ../../library/logging.rst:403 +#: ../../library/logging.rst:439 msgid "0" msgstr "0" -#: ../../library/logging.rst:403 +#: ../../library/logging.rst:439 msgid "" "When set on a logger, indicates that ancestor loggers are to be consulted to " "determine the effective level. If that still resolves to :const:`!NOTSET`, " "then all events are logged. When set on a handler, all events are handled." msgstr "" -#: ../../library/logging.rst:411 +#: ../../library/logging.rst:447 msgid "10" msgstr "10" -#: ../../library/logging.rst:411 +#: ../../library/logging.rst:447 msgid "" "Detailed information, typically only of interest to a developer trying to " "diagnose a problem." msgstr "" -#: ../../library/logging.rst:415 +#: ../../library/logging.rst:451 msgid "20" msgstr "20" -#: ../../library/logging.rst:415 +#: ../../library/logging.rst:451 msgid "Confirmation that things are working as expected." msgstr "" -#: ../../library/logging.rst:418 +#: ../../library/logging.rst:454 msgid "30" msgstr "30" -#: ../../library/logging.rst:418 +#: ../../library/logging.rst:454 msgid "" "An indication that something unexpected happened, or that a problem might " "occur in the near future (e.g. 'disk space low'). The software is still " "working as expected." msgstr "" -#: ../../library/logging.rst:425 +#: ../../library/logging.rst:461 msgid "40" msgstr "40" -#: ../../library/logging.rst:425 +#: ../../library/logging.rst:461 msgid "" "Due to a more serious problem, the software has not been able to perform " "some function." msgstr "" -#: ../../library/logging.rst:429 +#: ../../library/logging.rst:465 msgid "50" msgstr "50" -#: ../../library/logging.rst:429 +#: ../../library/logging.rst:465 msgid "" "A serious error, indicating that the program itself may be unable to " "continue running." msgstr "" -#: ../../library/logging.rst:438 +#: ../../library/logging.rst:474 msgid "Handler Objects" msgstr "" -#: ../../library/logging.rst:440 +#: ../../library/logging.rst:476 msgid "" "Handlers have the following attributes and methods. Note that :class:" "`Handler` is never instantiated directly; this class acts as a base for more " @@ -593,53 +640,53 @@ msgid "" "to call :meth:`Handler.__init__`." msgstr "" -#: ../../library/logging.rst:449 +#: ../../library/logging.rst:485 msgid "" "Initializes the :class:`Handler` instance by setting its level, setting the " "list of filters to the empty list and creating a lock (using :meth:" "`createLock`) for serializing access to an I/O mechanism." msgstr "" -#: ../../library/logging.rst:456 +#: ../../library/logging.rst:492 msgid "" "Initializes a thread lock which can be used to serialize access to " "underlying I/O functionality which may not be threadsafe." msgstr "" -#: ../../library/logging.rst:462 +#: ../../library/logging.rst:498 msgid "Acquires the thread lock created with :meth:`createLock`." msgstr "" -#: ../../library/logging.rst:467 +#: ../../library/logging.rst:503 msgid "Releases the thread lock acquired with :meth:`acquire`." msgstr "" -#: ../../library/logging.rst:472 +#: ../../library/logging.rst:508 msgid "" "Sets the threshold for this handler to *level*. Logging messages which are " "less severe than *level* will be ignored. When a handler is created, the " "level is set to :const:`NOTSET` (which causes all messages to be processed)." msgstr "" -#: ../../library/logging.rst:479 +#: ../../library/logging.rst:515 msgid "" "The *level* parameter now accepts a string representation of the level such " "as 'INFO' as an alternative to the integer constants such as :const:`INFO`." msgstr "" -#: ../../library/logging.rst:487 +#: ../../library/logging.rst:523 msgid "Sets the :class:`Formatter` for this handler to *fmt*." msgstr "" -#: ../../library/logging.rst:492 +#: ../../library/logging.rst:528 msgid "Adds the specified filter *filter* to this handler." msgstr "" -#: ../../library/logging.rst:497 +#: ../../library/logging.rst:533 msgid "Removes the specified filter *filter* from this handler." msgstr "" -#: ../../library/logging.rst:502 +#: ../../library/logging.rst:538 msgid "" "Apply this handler's filters to the record and return ``True`` if the record " "is to be processed. The filters are consulted in turn, until one of them " @@ -648,13 +695,13 @@ msgid "" "record." msgstr "" -#: ../../library/logging.rst:511 +#: ../../library/logging.rst:547 msgid "" "Ensure all logging output has been flushed. This version does nothing and is " "intended to be implemented by subclasses." msgstr "" -#: ../../library/logging.rst:517 +#: ../../library/logging.rst:553 msgid "" "Tidy up any resources used by the handler. This version does no output but " "removes the handler from an internal list of handlers which is closed when :" @@ -662,14 +709,14 @@ msgid "" "from overridden :meth:`close` methods." msgstr "" -#: ../../library/logging.rst:525 +#: ../../library/logging.rst:561 msgid "" "Conditionally emits the specified logging record, depending on filters which " "may have been added to the handler. Wraps the actual emission of the record " "with acquisition/release of the I/O thread lock." msgstr "" -#: ../../library/logging.rst:532 +#: ../../library/logging.rst:568 msgid "" "This method should be called from handlers when an exception is encountered " "during an :meth:`emit` call. If the module-level attribute :data:" @@ -682,20 +729,20 @@ msgid "" "is more useful during development)." msgstr "" -#: ../../library/logging.rst:545 +#: ../../library/logging.rst:581 msgid "" "Do formatting for a record - if a formatter is set, use it. Otherwise, use " "the default formatter for the module." msgstr "" -#: ../../library/logging.rst:551 +#: ../../library/logging.rst:587 msgid "" "Do whatever it takes to actually log the specified logging record. This " "version is intended to be implemented by subclasses and so raises a :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/logging.rst:555 +#: ../../library/logging.rst:591 msgid "" "This method is called after a handler-level lock is acquired, which is " "released after this method returns. When you override this method, note that " @@ -704,13 +751,13 @@ msgid "" "Specifically:" msgstr "" -#: ../../library/logging.rst:561 +#: ../../library/logging.rst:597 msgid "" "Logging configuration APIs acquire the module-level lock, and then " "individual handler-level locks as those handlers are configured." msgstr "" -#: ../../library/logging.rst:564 +#: ../../library/logging.rst:600 msgid "" "Many logging APIs lock the module-level lock. If such an API is called from " "this method, it could cause a deadlock if a configuration call is made on " @@ -720,16 +767,16 @@ msgid "" "method, the handler-level lock has already been acquired)." msgstr "" -#: ../../library/logging.rst:571 +#: ../../library/logging.rst:607 msgid "" "For a list of handlers included as standard, see :mod:`logging.handlers`." msgstr "" -#: ../../library/logging.rst:576 +#: ../../library/logging.rst:612 msgid "Formatter Objects" msgstr "" -#: ../../library/logging.rst:582 +#: ../../library/logging.rst:618 msgid "" "Responsible for converting a :class:`LogRecord` to an output string to be " "interpreted by a human or external system." @@ -739,7 +786,7 @@ msgstr "" msgid "Parameters" msgstr "" -#: ../../library/logging.rst:585 +#: ../../library/logging.rst:621 msgid "" "A format string in the given *style* for the logged output as a whole. The " "possible mapping keys are drawn from the :class:`LogRecord` object's :ref:" @@ -747,14 +794,14 @@ msgid "" "is just the logged message." msgstr "" -#: ../../library/logging.rst:593 +#: ../../library/logging.rst:629 msgid "" "A format string in the given *style* for the date/time portion of the logged " "output. If not specified, the default described in :meth:`formatTime` is " "used." msgstr "" -#: ../../library/logging.rst:598 +#: ../../library/logging.rst:634 msgid "" "Can be one of ``'%'``, ``'{'`` or ``'$'`` and determines how the format " "string will be merged with its data: using one of :ref:`old-string-" @@ -765,32 +812,32 @@ msgid "" "use ``{``- and ``$``-formatting for log messages." msgstr "" -#: ../../library/logging.rst:608 +#: ../../library/logging.rst:644 msgid "" "If ``True`` (the default), incorrect or mismatched *fmt* and *style* will " "raise a :exc:`ValueError`; for example, ``logging.Formatter('%(asctime)s - " "%(message)s', style='{')``." msgstr "" -#: ../../library/logging.rst:613 +#: ../../library/logging.rst:649 msgid "" "A dictionary with default values to use in custom fields. For example, " "``logging.Formatter('%(ip)s %(message)s', defaults={\"ip\": None})``" msgstr "" -#: ../../library/logging.rst:618 +#: ../../library/logging.rst:654 msgid "Added the *style* parameter." msgstr "新增 *style* 參數。" -#: ../../library/logging.rst:621 +#: ../../library/logging.rst:657 msgid "Added the *validate* parameter." msgstr "新增 *validate* 參數。" -#: ../../library/logging.rst:624 +#: ../../library/logging.rst:660 msgid "Added the *defaults* parameter." msgstr "新增 *defaults* 參數。" -#: ../../library/logging.rst:630 +#: ../../library/logging.rst:666 msgid "" "The record's attribute dictionary is used as the operand to a string " "formatting operation. Returns the resulting string. Before formatting the " @@ -809,13 +856,13 @@ msgid "" "recalculates it afresh." msgstr "" -#: ../../library/logging.rst:646 +#: ../../library/logging.rst:682 msgid "" "If stack information is available, it's appended after the exception " "information, using :meth:`formatStack` to transform it if necessary." msgstr "" -#: ../../library/logging.rst:652 +#: ../../library/logging.rst:688 msgid "" "This method should be called from :meth:`format` by a formatter which wants " "to make use of a formatted time. This method can be overridden in formatters " @@ -828,7 +875,7 @@ msgid "" "resulting string is returned." msgstr "" -#: ../../library/logging.rst:662 +#: ../../library/logging.rst:698 msgid "" "This function uses a user-configurable function to convert the creation time " "to a tuple. By default, :func:`time.localtime` is used; to change this for a " @@ -838,7 +885,7 @@ msgid "" "be shown in GMT, set the ``converter`` attribute in the ``Formatter`` class." msgstr "" -#: ../../library/logging.rst:670 +#: ../../library/logging.rst:706 msgid "" "Previously, the default format was hard-coded as in this example: " "``2010-09-06 22:38:15,292`` where the part before the comma is handled by a " @@ -853,11 +900,11 @@ msgid "" "the millisecond value)." msgstr "" -#: ../../library/logging.rst:683 +#: ../../library/logging.rst:719 msgid "The ``default_msec_format`` can be ``None``." msgstr "" -#: ../../library/logging.rst:688 +#: ../../library/logging.rst:724 msgid "" "Formats the specified exception information (a standard exception tuple as " "returned by :func:`sys.exc_info`) as a string. This default implementation " @@ -865,14 +912,14 @@ msgid "" "returned." msgstr "" -#: ../../library/logging.rst:695 +#: ../../library/logging.rst:731 msgid "" "Formats the specified stack information (a string as returned by :func:" "`traceback.print_stack`, but with the last newline removed) as a string. " "This default implementation just returns the input value." msgstr "" -#: ../../library/logging.rst:701 +#: ../../library/logging.rst:737 msgid "" "A base formatter class suitable for subclassing when you want to format a " "number of records. You can pass a :class:`Formatter` instance which you want " @@ -881,7 +928,7 @@ msgid "" "used as the line formatter." msgstr "" -#: ../../library/logging.rst:709 +#: ../../library/logging.rst:745 msgid "" "Return a header for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " @@ -889,14 +936,14 @@ msgid "" "separator line." msgstr "" -#: ../../library/logging.rst:716 +#: ../../library/logging.rst:752 msgid "" "Return a footer for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " "specific behaviour, e.g. to show the count of records or a separator line." msgstr "" -#: ../../library/logging.rst:723 +#: ../../library/logging.rst:759 msgid "" "Return formatted text for a list of *records*. The base implementation just " "returns the empty string if there are no records; otherwise, it returns the " @@ -904,11 +951,11 @@ msgid "" "and the footer." msgstr "" -#: ../../library/logging.rst:731 +#: ../../library/logging.rst:767 msgid "Filter Objects" msgstr "" -#: ../../library/logging.rst:733 +#: ../../library/logging.rst:769 msgid "" "``Filters`` can be used by ``Handlers`` and ``Loggers`` for more " "sophisticated filtering than is provided by levels. The base filter class " @@ -918,7 +965,7 @@ msgid "" "If initialized with the empty string, all events are passed." msgstr "" -#: ../../library/logging.rst:743 +#: ../../library/logging.rst:779 msgid "" "Returns an instance of the :class:`Filter` class. If *name* is specified, it " "names a logger which, together with its children, will have its events " @@ -926,7 +973,7 @@ msgid "" "event." msgstr "" -#: ../../library/logging.rst:750 +#: ../../library/logging.rst:786 msgid "" "Is the specified record to be logged? Returns false for no, true for yes. " "Filters can either modify log records in-place or return a completely " @@ -934,7 +981,7 @@ msgid "" "future processing of the event." msgstr "" -#: ../../library/logging.rst:755 +#: ../../library/logging.rst:791 msgid "" "Note that filters attached to handlers are consulted before an event is " "emitted by the handler, whereas filters attached to loggers are consulted " @@ -944,13 +991,13 @@ msgid "" "setting, unless the filter has also been applied to those descendant loggers." msgstr "" -#: ../../library/logging.rst:762 +#: ../../library/logging.rst:798 msgid "" "You don't actually need to subclass ``Filter``: you can pass any instance " "which has a ``filter`` method with the same semantics." msgstr "" -#: ../../library/logging.rst:765 +#: ../../library/logging.rst:801 msgid "" "You don't need to create specialized ``Filter`` classes, or use other " "classes with a ``filter`` method: you can use a function (or other callable) " @@ -961,7 +1008,7 @@ msgid "" "value should conform to that returned by :meth:`~Filter.filter`." msgstr "" -#: ../../library/logging.rst:775 +#: ../../library/logging.rst:811 msgid "" "You can now return a :class:`LogRecord` instance from filters to replace the " "log record rather than modifying it in place. This allows filters attached " @@ -969,7 +1016,7 @@ msgid "" "having side effects on other handlers." msgstr "" -#: ../../library/logging.rst:781 +#: ../../library/logging.rst:817 msgid "" "Although filters are used primarily to filter records based on more " "sophisticated criteria than levels, they get to see every record which is " @@ -981,11 +1028,11 @@ msgid "" "contextual information into logs (see :ref:`filters-contextual`)." msgstr "" -#: ../../library/logging.rst:794 +#: ../../library/logging.rst:830 msgid "LogRecord Objects" msgstr "LogRecord 物件" -#: ../../library/logging.rst:796 +#: ../../library/logging.rst:832 msgid "" ":class:`LogRecord` instances are created automatically by the :class:" "`Logger` every time something is logged, and can be created manually via :" @@ -993,17 +1040,17 @@ msgid "" "wire)." msgstr "" -#: ../../library/logging.rst:804 +#: ../../library/logging.rst:840 msgid "Contains all the information pertinent to the event being logged." msgstr "" -#: ../../library/logging.rst:806 +#: ../../library/logging.rst:842 msgid "" "The primary information is passed in *msg* and *args*, which are combined " "using ``msg % args`` to create the :attr:`!message` attribute of the record." msgstr "" -#: ../../library/logging.rst:810 +#: ../../library/logging.rst:846 msgid "" "The name of the logger used to log the event represented by this :class:`!" "LogRecord`. Note that the logger name in the :class:`!LogRecord` will always " @@ -1011,7 +1058,7 @@ msgid "" "different (ancestor) logger." msgstr "" -#: ../../library/logging.rst:818 +#: ../../library/logging.rst:854 msgid "" "The :ref:`numeric level ` of the logging event (such as ``10`` for " "``DEBUG``, ``20`` for ``INFO``, etc). Note that this is converted to *two* " @@ -1019,46 +1066,46 @@ msgid "" "attr:`!levelname` for the corresponding level name." msgstr "" -#: ../../library/logging.rst:825 +#: ../../library/logging.rst:861 msgid "" "The full string path of the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:829 +#: ../../library/logging.rst:865 msgid "The line number in the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:833 +#: ../../library/logging.rst:869 msgid "" "The event description message, which can be a %-format string with " "placeholders for variable data, or an arbitrary object (see :ref:`arbitrary-" "object-messages`)." msgstr "" -#: ../../library/logging.rst:838 +#: ../../library/logging.rst:874 msgid "" "Variable data to merge into the *msg* argument to obtain the event " "description." msgstr "" -#: ../../library/logging.rst:842 +#: ../../library/logging.rst:878 msgid "" "An exception tuple with the current exception information, as returned by :" "func:`sys.exc_info`, or ``None`` if no exception information is available." msgstr "" -#: ../../library/logging.rst:847 +#: ../../library/logging.rst:883 msgid "" "The name of the function or method from which the logging call was invoked." msgstr "" -#: ../../library/logging.rst:851 +#: ../../library/logging.rst:887 msgid "" "A text string representing stack information from the base of the stack in " "the current thread, up to the logging call." msgstr "" -#: ../../library/logging.rst:858 +#: ../../library/logging.rst:894 msgid "" "Returns the message for this :class:`LogRecord` instance after merging any " "user-supplied arguments with the message. If the user-supplied message " @@ -1067,7 +1114,7 @@ msgid "" "whose ``__str__`` method can return the actual format string to be used." msgstr "" -#: ../../library/logging.rst:865 +#: ../../library/logging.rst:901 msgid "" "The creation of a :class:`LogRecord` has been made more configurable by " "providing a factory which is used to create the record. The factory can be " @@ -1075,24 +1122,24 @@ msgid "" "this for the factory's signature)." msgstr "" -#: ../../library/logging.rst:871 +#: ../../library/logging.rst:907 msgid "" "This functionality can be used to inject your own values into a :class:" "`LogRecord` at creation time. You can use the following pattern::" msgstr "" -#: ../../library/logging.rst:883 +#: ../../library/logging.rst:919 msgid "" "With this pattern, multiple factories could be chained, and as long as they " "don't overwrite each other's attributes or unintentionally overwrite the " "standard attributes listed above, there should be no surprises." msgstr "" -#: ../../library/logging.rst:892 +#: ../../library/logging.rst:928 msgid "LogRecord attributes" msgstr "" -#: ../../library/logging.rst:894 +#: ../../library/logging.rst:930 msgid "" "The LogRecord has a number of attributes, most of which are derived from the " "parameters to the constructor. (Note that the names do not always correspond " @@ -1103,7 +1150,7 @@ msgid "" "style format string." msgstr "" -#: ../../library/logging.rst:902 +#: ../../library/logging.rst:938 msgid "" "If you are using {}-formatting (:func:`str.format`), you can use ``{attrname}" "`` as the placeholder in the format string. If you are using $-formatting (:" @@ -1111,7 +1158,7 @@ msgid "" "course, replace ``attrname`` with the actual attribute name you want to use." msgstr "" -#: ../../library/logging.rst:908 +#: ../../library/logging.rst:944 msgid "" "In the case of {}-formatting, you can specify formatting flags by placing " "them after the attribute name, separated from it with a colon. For example: " @@ -1120,324 +1167,324 @@ msgid "" "on the options available to you." msgstr "" -#: ../../library/logging.rst:915 +#: ../../library/logging.rst:951 msgid "Attribute name" msgstr "" -#: ../../library/logging.rst:915 ../../library/logging.rst:1333 +#: ../../library/logging.rst:951 ../../library/logging.rst:1369 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:915 ../../library/logging.rst:1333 +#: ../../library/logging.rst:951 ../../library/logging.rst:1369 msgid "Description" msgstr "描述" -#: ../../library/logging.rst:0 ../../library/logging.rst:917 +#: ../../library/logging.rst:0 ../../library/logging.rst:953 msgid "args" msgstr "" -#: ../../library/logging.rst:917 ../../library/logging.rst:931 -#: ../../library/logging.rst:959 ../../library/logging.rst:977 +#: ../../library/logging.rst:953 ../../library/logging.rst:967 +#: ../../library/logging.rst:995 ../../library/logging.rst:1013 msgid "You shouldn't need to format this yourself." msgstr "" -#: ../../library/logging.rst:917 +#: ../../library/logging.rst:953 msgid "" "The tuple of arguments merged into ``msg`` to produce ``message``, or a dict " "whose values are used for the merge (when there is only one argument, and it " "is a dictionary)." msgstr "" -#: ../../library/logging.rst:922 +#: ../../library/logging.rst:958 msgid "asctime" msgstr "" -#: ../../library/logging.rst:922 +#: ../../library/logging.rst:958 msgid "``%(asctime)s``" msgstr "``%(asctime)s``" -#: ../../library/logging.rst:922 +#: ../../library/logging.rst:958 msgid "" "Human-readable time when the :class:`LogRecord` was created. By default " "this is of the form '2003-07-08 16:49:45,896' (the numbers after the comma " "are millisecond portion of the time)." msgstr "" -#: ../../library/logging.rst:928 +#: ../../library/logging.rst:964 msgid "created" msgstr "" -#: ../../library/logging.rst:928 +#: ../../library/logging.rst:964 msgid "``%(created)f``" msgstr "``%(created)f``" -#: ../../library/logging.rst:928 +#: ../../library/logging.rst:964 msgid "" "Time when the :class:`LogRecord` was created (as returned by :func:`time." "time`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:931 +#: ../../library/logging.rst:0 ../../library/logging.rst:967 msgid "exc_info" msgstr "exc_info" -#: ../../library/logging.rst:931 +#: ../../library/logging.rst:967 msgid "" "Exception tuple (à la ``sys.exc_info``) or, if no exception has occurred, " "``None``." msgstr "" -#: ../../library/logging.rst:934 +#: ../../library/logging.rst:970 msgid "filename" msgstr "" -#: ../../library/logging.rst:934 +#: ../../library/logging.rst:970 msgid "``%(filename)s``" msgstr "``%(filename)s``" -#: ../../library/logging.rst:934 +#: ../../library/logging.rst:970 msgid "Filename portion of ``pathname``." msgstr "" -#: ../../library/logging.rst:936 +#: ../../library/logging.rst:972 msgid "funcName" msgstr "" -#: ../../library/logging.rst:936 +#: ../../library/logging.rst:972 msgid "``%(funcName)s``" msgstr "``%(funcName)s``" -#: ../../library/logging.rst:936 +#: ../../library/logging.rst:972 msgid "Name of function containing the logging call." msgstr "" -#: ../../library/logging.rst:938 +#: ../../library/logging.rst:974 msgid "levelname" msgstr "" -#: ../../library/logging.rst:938 +#: ../../library/logging.rst:974 msgid "``%(levelname)s``" msgstr "``%(levelname)s``" -#: ../../library/logging.rst:938 +#: ../../library/logging.rst:974 msgid "" "Text logging level for the message (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, " "``'ERROR'``, ``'CRITICAL'``)." msgstr "" -#: ../../library/logging.rst:942 +#: ../../library/logging.rst:978 msgid "levelno" msgstr "" -#: ../../library/logging.rst:942 +#: ../../library/logging.rst:978 msgid "``%(levelno)s``" msgstr "``%(levelno)s``" -#: ../../library/logging.rst:942 +#: ../../library/logging.rst:978 msgid "" "Numeric logging level for the message (:const:`DEBUG`, :const:`INFO`, :const:" "`WARNING`, :const:`ERROR`, :const:`CRITICAL`)." msgstr "" -#: ../../library/logging.rst:947 +#: ../../library/logging.rst:983 msgid "lineno" msgstr "" -#: ../../library/logging.rst:947 +#: ../../library/logging.rst:983 msgid "``%(lineno)d``" msgstr "``%(lineno)d``" -#: ../../library/logging.rst:947 +#: ../../library/logging.rst:983 msgid "Source line number where the logging call was issued (if available)." msgstr "" -#: ../../library/logging.rst:950 +#: ../../library/logging.rst:986 msgid "message" msgstr "" -#: ../../library/logging.rst:950 +#: ../../library/logging.rst:986 msgid "``%(message)s``" msgstr "``%(message)s``" -#: ../../library/logging.rst:950 +#: ../../library/logging.rst:986 msgid "" "The logged message, computed as ``msg % args``. This is set when :meth:" "`Formatter.format` is invoked." msgstr "" -#: ../../library/logging.rst:954 +#: ../../library/logging.rst:990 msgid "module" msgstr "模組" -#: ../../library/logging.rst:954 +#: ../../library/logging.rst:990 msgid "``%(module)s``" msgstr "``%(module)s``" -#: ../../library/logging.rst:954 +#: ../../library/logging.rst:990 msgid "Module (name portion of ``filename``)." msgstr "" -#: ../../library/logging.rst:956 +#: ../../library/logging.rst:992 msgid "msecs" msgstr "" -#: ../../library/logging.rst:956 +#: ../../library/logging.rst:992 msgid "``%(msecs)d``" msgstr "``%(msecs)d``" -#: ../../library/logging.rst:956 +#: ../../library/logging.rst:992 msgid "" "Millisecond portion of the time when the :class:`LogRecord` was created." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:959 +#: ../../library/logging.rst:0 ../../library/logging.rst:995 msgid "msg" msgstr "" -#: ../../library/logging.rst:959 +#: ../../library/logging.rst:995 msgid "" "The format string passed in the original logging call. Merged with ``args`` " "to produce ``message``, or an arbitrary object (see :ref:`arbitrary-object-" "messages`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:964 +#: ../../library/logging.rst:0 ../../library/logging.rst:1000 msgid "name" msgstr "" -#: ../../library/logging.rst:964 +#: ../../library/logging.rst:1000 msgid "``%(name)s``" msgstr "``%(name)s``" -#: ../../library/logging.rst:964 +#: ../../library/logging.rst:1000 msgid "Name of the logger used to log the call." msgstr "" -#: ../../library/logging.rst:966 +#: ../../library/logging.rst:1002 msgid "pathname" msgstr "" -#: ../../library/logging.rst:966 +#: ../../library/logging.rst:1002 msgid "``%(pathname)s``" msgstr "``%(pathname)s``" -#: ../../library/logging.rst:966 +#: ../../library/logging.rst:1002 msgid "" "Full pathname of the source file where the logging call was issued (if " "available)." msgstr "" -#: ../../library/logging.rst:969 +#: ../../library/logging.rst:1005 msgid "process" msgstr "" -#: ../../library/logging.rst:969 +#: ../../library/logging.rst:1005 msgid "``%(process)d``" msgstr "``%(process)d``" -#: ../../library/logging.rst:969 +#: ../../library/logging.rst:1005 msgid "Process ID (if available)." msgstr "" -#: ../../library/logging.rst:971 +#: ../../library/logging.rst:1007 msgid "processName" msgstr "" -#: ../../library/logging.rst:971 +#: ../../library/logging.rst:1007 msgid "``%(processName)s``" msgstr "``%(processName)s``" -#: ../../library/logging.rst:971 +#: ../../library/logging.rst:1007 msgid "Process name (if available)." msgstr "" -#: ../../library/logging.rst:973 +#: ../../library/logging.rst:1009 msgid "relativeCreated" msgstr "" -#: ../../library/logging.rst:973 +#: ../../library/logging.rst:1009 msgid "``%(relativeCreated)d``" msgstr "``%(relativeCreated)d``" -#: ../../library/logging.rst:973 +#: ../../library/logging.rst:1009 msgid "" "Time in milliseconds when the LogRecord was created, relative to the time " "the logging module was loaded." msgstr "" -#: ../../library/logging.rst:977 +#: ../../library/logging.rst:1013 msgid "stack_info" msgstr "stack_info" -#: ../../library/logging.rst:977 +#: ../../library/logging.rst:1013 msgid "" "Stack frame information (where available) from the bottom of the stack in " "the current thread, up to and including the stack frame of the logging call " "which resulted in the creation of this record." msgstr "" -#: ../../library/logging.rst:983 +#: ../../library/logging.rst:1019 msgid "thread" msgstr "" -#: ../../library/logging.rst:983 +#: ../../library/logging.rst:1019 msgid "``%(thread)d``" msgstr "``%(thread)d``" -#: ../../library/logging.rst:983 +#: ../../library/logging.rst:1019 msgid "Thread ID (if available)." msgstr "" -#: ../../library/logging.rst:985 +#: ../../library/logging.rst:1021 msgid "threadName" msgstr "" -#: ../../library/logging.rst:985 +#: ../../library/logging.rst:1021 msgid "``%(threadName)s``" msgstr "``%(threadName)s``" -#: ../../library/logging.rst:985 +#: ../../library/logging.rst:1021 msgid "Thread name (if available)." msgstr "" -#: ../../library/logging.rst:987 +#: ../../library/logging.rst:1023 msgid "taskName" msgstr "taskName" -#: ../../library/logging.rst:987 +#: ../../library/logging.rst:1023 msgid "``%(taskName)s``" msgstr "``%(taskName)s``" -#: ../../library/logging.rst:987 +#: ../../library/logging.rst:1023 msgid ":class:`asyncio.Task` name (if available)." msgstr "" -#: ../../library/logging.rst:990 +#: ../../library/logging.rst:1026 msgid "*processName* was added." msgstr "新增 *processName*。" -#: ../../library/logging.rst:993 +#: ../../library/logging.rst:1029 msgid "*taskName* was added." msgstr "新增 *taskName*。" -#: ../../library/logging.rst:999 +#: ../../library/logging.rst:1035 msgid "LoggerAdapter Objects" msgstr "LoggerAdapter 物件" -#: ../../library/logging.rst:1001 +#: ../../library/logging.rst:1037 msgid "" ":class:`LoggerAdapter` instances are used to conveniently pass contextual " "information into logging calls. For a usage example, see the section on :ref:" "`adding contextual information to your logging output `." msgstr "" -#: ../../library/logging.rst:1007 +#: ../../library/logging.rst:1043 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " "underlying :class:`Logger` instance and a dict-like object." msgstr "" -#: ../../library/logging.rst:1012 +#: ../../library/logging.rst:1048 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1446,15 +1493,15 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:1020 +#: ../../library/logging.rst:1056 msgid "Delegates to the underlying :attr:`!manager`` on *logger*." msgstr "" -#: ../../library/logging.rst:1024 +#: ../../library/logging.rst:1060 msgid "Delegates to the underlying :meth:`!_log`` method on *logger*." msgstr "" -#: ../../library/logging.rst:1026 +#: ../../library/logging.rst:1062 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1466,24 +1513,24 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:1037 +#: ../../library/logging.rst:1073 msgid "" "The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`, :meth:" "`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added to :" "class:`LoggerAdapter`. These methods delegate to the underlying logger." msgstr "" -#: ../../library/logging.rst:1043 +#: ../../library/logging.rst:1079 msgid "" "Attribute :attr:`!manager` and method :meth:`!_log` were added, which " "delegate to the underlying logger and allow adapters to be nested." msgstr "" -#: ../../library/logging.rst:1048 +#: ../../library/logging.rst:1084 msgid "Thread Safety" msgstr "" -#: ../../library/logging.rst:1050 +#: ../../library/logging.rst:1086 msgid "" "The logging module is intended to be thread-safe without any special work " "needing to be done by its clients. It achieves this though using threading " @@ -1492,7 +1539,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:1055 +#: ../../library/logging.rst:1091 msgid "" "If you are implementing asynchronous signal handlers using the :mod:`signal` " "module, you may not be able to use logging from within such handlers. This " @@ -1500,17 +1547,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:1062 +#: ../../library/logging.rst:1098 msgid "Module-Level Functions" msgstr "" -#: ../../library/logging.rst:1064 +#: ../../library/logging.rst:1100 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:1070 +#: ../../library/logging.rst:1106 msgid "" "Return a logger with the specified name or, if name is ``None``, return a " "logger which is the root logger of the hierarchy. If specified, the name is " @@ -1519,14 +1566,14 @@ msgid "" "logging." msgstr "" -#: ../../library/logging.rst:1075 +#: ../../library/logging.rst:1111 msgid "" "All calls to this function with a given name return the same logger " "instance. This means that logger instances never need to be passed between " "different parts of an application." msgstr "" -#: ../../library/logging.rst:1082 +#: ../../library/logging.rst:1118 msgid "" "Return either the standard :class:`Logger` class, or the last class passed " "to :func:`setLoggerClass`. This function may be called from within a new " @@ -1535,24 +1582,24 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:1093 +#: ../../library/logging.rst:1129 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1095 +#: ../../library/logging.rst:1131 msgid "" "This function has been provided, along with :func:`setLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1100 +#: ../../library/logging.rst:1136 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:1105 +#: ../../library/logging.rst:1141 msgid "" "Logs a message with level :const:`DEBUG` on the root logger. The *msg* is " "the message format string, and the *args* are the arguments which are merged " @@ -1561,7 +1608,7 @@ msgid "" "argument.)" msgstr "" -#: ../../library/logging.rst:1110 +#: ../../library/logging.rst:1146 msgid "" "There are three keyword arguments in *kwargs* which are inspected: " "*exc_info* which, if it does not evaluate as false, causes exception " @@ -1571,7 +1618,7 @@ msgid "" "exception information." msgstr "" -#: ../../library/logging.rst:1136 +#: ../../library/logging.rst:1172 msgid "" "The third optional keyword argument is *extra* which can be used to pass a " "dictionary which is used to populate the __dict__ of the LogRecord created " @@ -1580,18 +1627,18 @@ msgid "" "logged messages. For example::" msgstr "" -#: ../../library/logging.rst:1147 +#: ../../library/logging.rst:1183 msgid "would print something like:" msgstr "" -#: ../../library/logging.rst:1153 +#: ../../library/logging.rst:1189 msgid "" "The keys in the dictionary passed in *extra* should not clash with the keys " "used by the logging system. (See the :class:`Formatter` documentation for " "more information on which keys are used by the logging system.)" msgstr "" -#: ../../library/logging.rst:1157 +#: ../../library/logging.rst:1193 msgid "" "If you choose to use these attributes in logged messages, you need to " "exercise some care. In the above example, for instance, the :class:" @@ -1602,58 +1649,58 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:1171 +#: ../../library/logging.rst:1207 msgid "" "This function (as well as :func:`info`, :func:`warning`, :func:`error` and :" "func:`critical`) will call :func:`basicConfig` if the root logger doesn't " "have any handler attached." msgstr "" -#: ../../library/logging.rst:1180 +#: ../../library/logging.rst:1216 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1186 +#: ../../library/logging.rst:1222 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1189 +#: ../../library/logging.rst:1225 msgid "" "There is an obsolete function ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:1196 +#: ../../library/logging.rst:1232 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1202 +#: ../../library/logging.rst:1238 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1208 +#: ../../library/logging.rst:1244 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`. Exception info is added to the logging " "message. This function should only be called from an exception handler." msgstr "" -#: ../../library/logging.rst:1214 +#: ../../library/logging.rst:1250 msgid "" "Logs a message with level *level* on the root logger. The other arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1219 +#: ../../library/logging.rst:1255 msgid "" "Provides an overriding level *level* for all loggers which takes precedence " "over the logger's own level. When the need arises to temporarily throttle " @@ -1667,7 +1714,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1230 +#: ../../library/logging.rst:1266 msgid "" "Note that if you have defined any custom logging level higher than " "``CRITICAL`` (this is not recommended), you won't be able to rely on the " @@ -1675,13 +1722,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1235 +#: ../../library/logging.rst:1271 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1241 +#: ../../library/logging.rst:1277 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1691,24 +1738,24 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1248 +#: ../../library/logging.rst:1284 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1253 +#: ../../library/logging.rst:1289 msgid "" "Returns a mapping from level names to their corresponding logging levels. " "For example, the string \"CRITICAL\" maps to :const:`CRITICAL`. The returned " "mapping is copied from an internal mapping on each call to this function." msgstr "" -#: ../../library/logging.rst:1261 +#: ../../library/logging.rst:1297 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1263 +#: ../../library/logging.rst:1299 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1718,20 +1765,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1270 +#: ../../library/logging.rst:1306 msgid "" "The *level* parameter also accepts a string representation of the level such " "as 'INFO'. In such cases, this functions returns the corresponding numeric " "value of the level." msgstr "" -#: ../../library/logging.rst:1274 +#: ../../library/logging.rst:1310 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1277 +#: ../../library/logging.rst:1313 msgid "" "Levels are internally integers (as they need to be compared in the logging " "logic). This function is used to convert between an integer level and the " @@ -1740,7 +1787,7 @@ msgid "" "vice versa." msgstr "" -#: ../../library/logging.rst:1283 +#: ../../library/logging.rst:1319 msgid "" "In Python versions earlier than 3.4, this function could also be passed a " "text level, and would return the corresponding numeric value of the level. " @@ -1748,17 +1795,17 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1291 +#: ../../library/logging.rst:1327 msgid "" "Returns a handler with the specified *name*, or ``None`` if there is no " "handler with that name." msgstr "" -#: ../../library/logging.rst:1298 +#: ../../library/logging.rst:1334 msgid "Returns an immutable set of all known handler names." msgstr "" -#: ../../library/logging.rst:1304 +#: ../../library/logging.rst:1340 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1766,7 +1813,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1312 +#: ../../library/logging.rst:1348 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1775,13 +1822,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1318 +#: ../../library/logging.rst:1354 msgid "" "This function does nothing if the root logger already has handlers " "configured, unless the keyword argument *force* is set to ``True``." msgstr "" -#: ../../library/logging.rst:1321 +#: ../../library/logging.rst:1357 msgid "" "This function should be called from the main thread before other threads are " "started. In versions of Python prior to 2.7.1 and 3.2, if this function is " @@ -1790,54 +1837,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1328 +#: ../../library/logging.rst:1364 msgid "The following keyword arguments are supported." msgstr "" -#: ../../library/logging.rst:1335 +#: ../../library/logging.rst:1371 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1335 +#: ../../library/logging.rst:1371 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1339 +#: ../../library/logging.rst:1375 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1339 +#: ../../library/logging.rst:1375 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1343 +#: ../../library/logging.rst:1379 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1343 +#: ../../library/logging.rst:1379 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1348 +#: ../../library/logging.rst:1384 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1348 +#: ../../library/logging.rst:1384 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1351 +#: ../../library/logging.rst:1387 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1351 +#: ../../library/logging.rst:1387 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1362 +#: ../../library/logging.rst:1398 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1362 +#: ../../library/logging.rst:1398 msgid "" "Use the specified stream to initialize the :class:`StreamHandler`. Note that " "this argument is incompatible with *filename* - if both are present, a " "``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1368 +#: ../../library/logging.rst:1404 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1368 +#: ../../library/logging.rst:1404 msgid "" "If specified, this should be an iterable of already created handlers to add " "to the root logger. Any handlers which don't already have a formatter set " @@ -1877,33 +1924,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1377 +#: ../../library/logging.rst:1413 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1377 +#: ../../library/logging.rst:1413 msgid "" "If this keyword argument is specified as true, any existing handlers " "attached to the root logger are removed and closed, before carrying out the " "configuration as specified by the other arguments." msgstr "" -#: ../../library/logging.rst:1383 +#: ../../library/logging.rst:1419 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1383 +#: ../../library/logging.rst:1419 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " "the output file." msgstr "" -#: ../../library/logging.rst:1388 +#: ../../library/logging.rst:1424 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1388 +#: ../../library/logging.rst:1424 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " @@ -1912,39 +1959,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1399 +#: ../../library/logging.rst:1435 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1402 +#: ../../library/logging.rst:1438 msgid "" "The *handlers* argument was added. Additional checks were added to catch " "situations where incompatible arguments are specified (e.g. *handlers* " "together with *stream* or *filename*, or *stream* together with *filename*)." msgstr "" -#: ../../library/logging.rst:1408 +#: ../../library/logging.rst:1444 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1411 +#: ../../library/logging.rst:1447 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1416 +#: ../../library/logging.rst:1452 msgid "" "Informs the logging system to perform an orderly shutdown by flushing and " "closing all handlers. This should be called at application exit and no " "further use of the logging system should be made after this call." msgstr "" -#: ../../library/logging.rst:1420 +#: ../../library/logging.rst:1456 msgid "" "When the logging module is imported, it registers this function as an exit " "handler (see :mod:`atexit`), so normally there's no need to do that manually." msgstr "" -#: ../../library/logging.rst:1427 +#: ../../library/logging.rst:1463 msgid "" "Tells the logging system to use the class *klass* when instantiating a " "logger. The class should define :meth:`!__init__` such that only a name " @@ -1956,32 +2003,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1438 +#: ../../library/logging.rst:1474 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1440 +#: ../../library/logging.rst:1476 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1442 +#: ../../library/logging.rst:1478 msgid "" "This function has been provided, along with :func:`getLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1447 +#: ../../library/logging.rst:1483 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1449 +#: ../../library/logging.rst:1485 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1451 +#: ../../library/logging.rst:1487 msgid "The logger name." msgstr "" @@ -1989,7 +2036,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1452 +#: ../../library/logging.rst:1488 msgid "The logging level (numeric)." msgstr "" @@ -1997,7 +2044,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1453 +#: ../../library/logging.rst:1489 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -2005,19 +2052,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1454 +#: ../../library/logging.rst:1490 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1455 +#: ../../library/logging.rst:1491 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1456 +#: ../../library/logging.rst:1492 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1457 +#: ../../library/logging.rst:1493 msgid "An exception tuple, or ``None``." msgstr "" @@ -2025,7 +2072,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1458 +#: ../../library/logging.rst:1494 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -2033,7 +2080,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1460 +#: ../../library/logging.rst:1496 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -2043,15 +2090,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1462 +#: ../../library/logging.rst:1498 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1466 +#: ../../library/logging.rst:1502 msgid "Module-Level Attributes" msgstr "" -#: ../../library/logging.rst:1470 +#: ../../library/logging.rst:1506 msgid "" "A \"handler of last resort\" is available through this attribute. This is a :" "class:`StreamHandler` writing to ``sys.stderr`` with a level of ``WARNING``, " @@ -2062,15 +2109,15 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1482 +#: ../../library/logging.rst:1518 msgid "Used to see if exceptions during handling should be propagated." msgstr "" -#: ../../library/logging.rst:1484 +#: ../../library/logging.rst:1520 msgid "Default: ``True``." msgstr "" -#: ../../library/logging.rst:1486 +#: ../../library/logging.rst:1522 msgid "" "If :data:`raiseExceptions` is ``False``, exceptions get silently ignored. " "This is what is mostly wanted for a logging system - most users will not " @@ -2078,22 +2125,22 @@ msgid "" "application errors." msgstr "" -#: ../../library/logging.rst:1493 +#: ../../library/logging.rst:1529 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1495 +#: ../../library/logging.rst:1531 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1500 +#: ../../library/logging.rst:1536 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1503 +#: ../../library/logging.rst:1539 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -2102,46 +2149,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1508 +#: ../../library/logging.rst:1544 msgid "" "If *capture* is ``False``, the redirection of warnings to the logging system " "will stop, and warnings will be redirected to their original destinations (i." "e. those in effect before ``captureWarnings(True)`` was called)." msgstr "" -#: ../../library/logging.rst:1516 +#: ../../library/logging.rst:1552 msgid "Module :mod:`logging.config`" msgstr "" -#: ../../library/logging.rst:1516 +#: ../../library/logging.rst:1552 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1519 +#: ../../library/logging.rst:1555 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.rst:1519 +#: ../../library/logging.rst:1555 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1523 +#: ../../library/logging.rst:1559 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1522 +#: ../../library/logging.rst:1558 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1528 +#: ../../library/logging.rst:1564 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1526 +#: ../../library/logging.rst:1562 msgid "" "This is the original source for the :mod:`logging` package. The version of " "the package available from this site is suitable for use with Python 1.5.2, " diff --git a/reference/datamodel.po b/reference/datamodel.po index 762bedddaa..f808ce51dd 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-01 00:03+0000\n" +"POT-Creation-Date: 2024-03-02 00:03+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-" @@ -3392,29 +3392,31 @@ msgid "" "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " "``>>=``, ``&=``, ``^=``, ``|=``). These methods should attempt to do the " "operation in-place (modifying *self*) and return the result (which could be, " -"but does not have to be, *self*). If a specific method is not defined, the " -"augmented assignment falls back to the normal methods. For instance, if *x* " -"is an instance of a class with an :meth:`__iadd__` method, ``x += y`` is " -"equivalent to ``x = x.__iadd__(y)`` . Otherwise, ``x.__add__(y)`` and ``y." -"__radd__(x)`` are considered, as with the evaluation of ``x + y``. In " -"certain situations, augmented assignment can result in unexpected errors " -"(see :ref:`faq-augmented-assignment-tuple-error`), but this behavior is in " -"fact part of the data model." +"but does not have to be, *self*). If a specific method is not defined, or " +"if that method returns :data:`NotImplemented`, the augmented assignment " +"falls back to the normal methods. For instance, if *x* is an instance of a " +"class with an :meth:`__iadd__` method, ``x += y`` is equivalent to ``x = x." +"__iadd__(y)`` . If :meth:`__iadd__` does not exist, or if ``x.__iadd__(y)`` " +"returns :data:`!NotImplemented`, ``x.__add__(y)`` and ``y.__radd__(x)`` are " +"considered, as with the evaluation of ``x + y``. In certain situations, " +"augmented assignment can result in unexpected errors (see :ref:`faq-" +"augmented-assignment-tuple-error`), but this behavior is in fact part of the " +"data model." msgstr "" -#: ../../reference/datamodel.rst:3057 +#: ../../reference/datamodel.rst:3059 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:3070 +#: ../../reference/datamodel.rst:3072 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:3077 +#: ../../reference/datamodel.rst:3079 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3423,14 +3425,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:3083 +#: ../../reference/datamodel.rst:3085 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:3095 +#: ../../reference/datamodel.rst:3097 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3439,21 +3441,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:3101 +#: ../../reference/datamodel.rst:3103 msgid "" "The built-in function :func:`int` falls back to :meth:`__trunc__` if " "neither :meth:`__int__` nor :meth:`__index__` is defined." msgstr "" -#: ../../reference/datamodel.rst:3104 +#: ../../reference/datamodel.rst:3106 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:3111 +#: ../../reference/datamodel.rst:3113 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3113 +#: ../../reference/datamodel.rst:3115 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -3463,32 +3465,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:3124 +#: ../../reference/datamodel.rst:3126 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:3127 +#: ../../reference/datamodel.rst:3129 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:3132 +#: ../../reference/datamodel.rst:3134 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:3139 +#: ../../reference/datamodel.rst:3141 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:3143 +#: ../../reference/datamodel.rst:3145 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -3496,27 +3498,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:3147 +#: ../../reference/datamodel.rst:3149 msgid "" "Note that :meth:`~object.__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:3154 +#: ../../reference/datamodel.rst:3156 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:3154 +#: ../../reference/datamodel.rst:3156 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3161 +#: ../../reference/datamodel.rst:3163 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:3163 +#: ../../reference/datamodel.rst:3165 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -3524,7 +3526,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:3170 +#: ../../reference/datamodel.rst:3172 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -3533,7 +3535,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:3176 +#: ../../reference/datamodel.rst:3178 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3543,19 +3545,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:3186 +#: ../../reference/datamodel.rst:3188 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:3187 +#: ../../reference/datamodel.rst:3189 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:3193 +#: ../../reference/datamodel.rst:3195 msgid "Emulating buffer types" msgstr "" -#: ../../reference/datamodel.rst:3195 +#: ../../reference/datamodel.rst:3197 msgid "" "The :ref:`buffer protocol ` provides a way for Python objects " "to expose efficient access to a low-level memory array. This protocol is " @@ -3563,13 +3565,13 @@ msgid "" "and third-party libraries may define additional buffer types." msgstr "" -#: ../../reference/datamodel.rst:3200 +#: ../../reference/datamodel.rst:3202 msgid "" "While buffer types are usually implemented in C, it is also possible to " "implement the protocol in Python." msgstr "" -#: ../../reference/datamodel.rst:3205 +#: ../../reference/datamodel.rst:3207 msgid "" "Called when a buffer is requested from *self* (for example, by the :class:" "`memoryview` constructor). The *flags* argument is an integer representing " @@ -3579,7 +3581,7 @@ msgid "" "`memoryview` object." msgstr "" -#: ../../reference/datamodel.rst:3214 +#: ../../reference/datamodel.rst:3216 msgid "" "Called when a buffer is no longer needed. The *buffer* argument is a :class:" "`memoryview` object that was previously returned by :meth:`~object." @@ -3588,28 +3590,28 @@ msgid "" "to perform any cleanup are not required to implement this method." msgstr "" -#: ../../reference/datamodel.rst:3226 +#: ../../reference/datamodel.rst:3228 msgid ":pep:`688` - Making the buffer protocol accessible in Python" msgstr "" -#: ../../reference/datamodel.rst:3226 +#: ../../reference/datamodel.rst:3228 msgid "" "Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3228 +#: ../../reference/datamodel.rst:3230 msgid ":class:`collections.abc.Buffer`" msgstr ":class:`collections.abc.Buffer`" -#: ../../reference/datamodel.rst:3229 +#: ../../reference/datamodel.rst:3231 msgid "ABC for buffer types." msgstr "" -#: ../../reference/datamodel.rst:3234 +#: ../../reference/datamodel.rst:3236 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:3236 +#: ../../reference/datamodel.rst:3238 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -3617,7 +3619,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:3251 +#: ../../reference/datamodel.rst:3253 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3626,21 +3628,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:3265 +#: ../../reference/datamodel.rst:3267 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:3274 +#: ../../reference/datamodel.rst:3276 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:3300 +#: ../../reference/datamodel.rst:3302 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3649,36 +3651,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:3311 +#: ../../reference/datamodel.rst:3313 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:3315 +#: ../../reference/datamodel.rst:3317 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:3317 +#: ../../reference/datamodel.rst:3319 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:3323 +#: ../../reference/datamodel.rst:3325 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:3329 +#: ../../reference/datamodel.rst:3331 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " "method to be compatible with the :keyword:`await` expression." msgstr "" -#: ../../reference/datamodel.rst:3335 +#: ../../reference/datamodel.rst:3337 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -3686,15 +3688,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:3343 +#: ../../reference/datamodel.rst:3345 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:3349 +#: ../../reference/datamodel.rst:3351 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:3351 +#: ../../reference/datamodel.rst:3353 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3705,18 +3707,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:3359 +#: ../../reference/datamodel.rst:3361 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:3363 +#: ../../reference/datamodel.rst:3365 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3369 +#: ../../reference/datamodel.rst:3371 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3727,7 +3729,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3380 +#: ../../reference/datamodel.rst:3382 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3738,13 +3740,13 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3391 +#: ../../reference/datamodel.rst:3393 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:3396 +#: ../../reference/datamodel.rst:3398 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3754,99 +3756,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3404 +#: ../../reference/datamodel.rst:3406 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3410 +#: ../../reference/datamodel.rst:3412 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3412 +#: ../../reference/datamodel.rst:3414 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3415 +#: ../../reference/datamodel.rst:3417 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3419 +#: ../../reference/datamodel.rst:3421 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3423 +#: ../../reference/datamodel.rst:3425 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3426 +#: ../../reference/datamodel.rst:3428 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3443 +#: ../../reference/datamodel.rst:3445 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3448 +#: ../../reference/datamodel.rst:3450 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3456 +#: ../../reference/datamodel.rst:3458 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3458 +#: ../../reference/datamodel.rst:3460 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3461 +#: ../../reference/datamodel.rst:3463 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3465 +#: ../../reference/datamodel.rst:3467 msgid "" "Semantically similar to :meth:`~object.__enter__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3470 +#: ../../reference/datamodel.rst:3472 msgid "" "Semantically similar to :meth:`~object.__exit__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3473 +#: ../../reference/datamodel.rst:3475 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3486 +#: ../../reference/datamodel.rst:3488 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3487 +#: ../../reference/datamodel.rst:3489 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3491 +#: ../../reference/datamodel.rst:3493 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3854,7 +3856,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3497 +#: ../../reference/datamodel.rst:3499 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns :data:`NotImplemented`. Do not set the method to ``None`` if " @@ -3862,7 +3864,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3503 +#: ../../reference/datamodel.rst:3505 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method -- such as :meth:`~object.__add__` -- fails then the overall " @@ -3901,8 +3903,8 @@ msgstr "data(資料)" #: ../../reference/datamodel.rst:1816 ../../reference/datamodel.rst:2372 #: ../../reference/datamodel.rst:2801 ../../reference/datamodel.rst:2959 #: ../../reference/datamodel.rst:2994 ../../reference/datamodel.rst:3008 -#: ../../reference/datamodel.rst:3055 ../../reference/datamodel.rst:3065 -#: ../../reference/datamodel.rst:3093 +#: ../../reference/datamodel.rst:3057 ../../reference/datamodel.rst:3067 +#: ../../reference/datamodel.rst:3095 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -4035,7 +4037,7 @@ msgstr "number(數字)" msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:3065 +#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:3067 msgid "complex" msgstr "complex(複數)" @@ -4133,7 +4135,7 @@ msgstr "assignment(賦值)" #: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:856 #: ../../reference/datamodel.rst:1444 ../../reference/datamodel.rst:1626 -#: ../../reference/datamodel.rst:3120 +#: ../../reference/datamodel.rst:3122 msgid "statement" msgstr "statement(陳述式)" @@ -4301,7 +4303,7 @@ msgstr "generator(產生器)" msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:761 ../../reference/datamodel.rst:3307 +#: ../../reference/datamodel.rst:761 ../../reference/datamodel.rst:3309 msgid "coroutine" msgstr "coroutine(協程)" @@ -4798,26 +4800,26 @@ msgstr "divmod" msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:3055 +#: ../../reference/datamodel.rst:3057 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:3065 +#: ../../reference/datamodel.rst:3067 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:3065 +#: ../../reference/datamodel.rst:3067 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:3093 +#: ../../reference/datamodel.rst:3095 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:3120 +#: ../../reference/datamodel.rst:3122 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:3120 +#: ../../reference/datamodel.rst:3122 msgid "context manager" msgstr "context manager(情境管理器)" From 38092597ff1959db1c975f5e32724662479066b4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 4 Mar 2024 00:04:51 +0000 Subject: [PATCH 26/33] sync with cpython 722b9cf9 --- faq/general.po | 155 +++++----- reference/datamodel.po | 635 +++++++++++++++++++++-------------------- 2 files changed, 402 insertions(+), 388 deletions(-) diff --git a/faq/general.po b/faq/general.po index bc8ce39472..56acda8cec 100644 --- a/faq/general.po +++ b/faq/general.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-19 00:18+0000\n" +"POT-Creation-Date: 2024-03-04 00:03+0000\n" "PO-Revision-Date: 2023-06-23 16:56+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -272,10 +272,6 @@ msgid "" msgstr "*C* 為微小版本編號 —- 會在每個錯誤修正發布 (bugfix release) 增加。" #: ../../faq/general.rst:136 -msgid "See :pep:`6` for more information about bugfix releases." -msgstr "更多關於錯誤修正發布的資訊請見 :pep:`6`。" - -#: ../../faq/general.rst:138 msgid "" "Not all releases are bugfix releases. In the run-up to a new feature " "release, a series of development releases are made, denoted as alpha, beta, " @@ -291,25 +287,25 @@ msgstr "" "不會令人意外。Beta 則更為穩定,保留了現有的介面,但可能會增加新的模組,而候選" "發布版本會被凍結,除了需要修正關鍵錯誤之外,不會再進行任何變更。" -#: ../../faq/general.rst:146 +#: ../../faq/general.rst:144 msgid "Alpha, beta and release candidate versions have an additional suffix:" msgstr "Alpha、beta 和候選發布版本都有一個額外的後綴:" -#: ../../faq/general.rst:148 +#: ../../faq/general.rst:146 msgid "The suffix for an alpha version is \"aN\" for some small number *N*." msgstr "Alpha 版本的後綴是 \"aN\",其中 *N* 是某個較小的數字。" -#: ../../faq/general.rst:149 +#: ../../faq/general.rst:147 msgid "The suffix for a beta version is \"bN\" for some small number *N*." msgstr "Beta 版本的後綴是 \"bN\",其中 *N* 是某個較小的數字。" -#: ../../faq/general.rst:150 +#: ../../faq/general.rst:148 msgid "" "The suffix for a release candidate version is \"rcN\" for some small number " "*N*." msgstr "候選發布版本的後綴是 \"rcN\",其中 *N* 是某個較小的數字。" -#: ../../faq/general.rst:152 +#: ../../faq/general.rst:150 msgid "" "In other words, all versions labeled *2.0aN* precede the versions labeled " "*2.0bN*, which precede versions labeled *2.0rcN*, and *those* precede 2.0." @@ -317,7 +313,7 @@ msgstr "" "換句話說,所有標記為 *2.0aN* 的版本都在標記為 *2.0bN* 的版本之前,而 *2.0bN* " "版本都在標記為 *2.0rcN* 的版本之前,而\\ *它們*\\ 都是在 2.0 版之前。" -#: ../../faq/general.rst:155 +#: ../../faq/general.rst:153 msgid "" "You may also find version numbers with a \"+\" suffix, e.g. \"2.2+\". These " "are unreleased versions, built directly from the CPython development " @@ -329,19 +325,20 @@ msgstr "" "從 CPython 的開發儲存庫被建置。實際上,在每一次的最終次要版本發布完成之後,版" "本編號將會被增加到下一個次要版本,並成為「a0」版,例如「2.4a0」。" -#: ../../faq/general.rst:160 +#: ../../faq/general.rst:158 msgid "" +"See the `Developer's Guide `__ for more information about the development cycle, " +"and :pep:`387` to learn more about Python's backward compatibility policy. " "See also the documentation for :data:`sys.version`, :data:`sys.hexversion`, " "and :data:`sys.version_info`." msgstr "" -"另請參閱 :data:`sys.version`、\\ :data:`sys.hexversion` 和 :data:`sys." -"version_info` 的說明文件。" -#: ../../faq/general.rst:165 +#: ../../faq/general.rst:167 msgid "How do I obtain a copy of the Python source?" msgstr "我要如何得到 Python 的原始碼複本?" -#: ../../faq/general.rst:167 +#: ../../faq/general.rst:169 msgid "" "The latest Python source distribution is always available from python.org, " "at https://www.python.org/downloads/. The latest development sources can be " @@ -351,7 +348,7 @@ msgstr "" "org/downloads/。最新的開發中原始碼可以在 https://github.com/python/cpython/ " "取得。" -#: ../../faq/general.rst:171 +#: ../../faq/general.rst:173 msgid "" "The source distribution is a gzipped tar file containing the complete C " "source, Sphinx-formatted documentation, Python library modules, example " @@ -362,7 +359,7 @@ msgstr "" "說明文件、Python 函式庫模組、範例程式,以及幾個好用的可自由發行軟體。該原始碼" "在大多數 UNIX 平台上,都是可以立即編譯及運行的。" -#: ../../faq/general.rst:176 +#: ../../faq/general.rst:178 msgid "" "Consult the `Getting Started section of the Python Developer's Guide " "`__ for more information on getting the " @@ -371,11 +368,11 @@ msgstr "" "關於取得和編譯原始碼的詳細資訊,請參閱 `Python 開發人員指南中的 \"Getting " "Started\" 段落 `__。" -#: ../../faq/general.rst:182 +#: ../../faq/general.rst:184 msgid "How do I get documentation on Python?" msgstr "我要如何取得 Python 的說明文件?" -#: ../../faq/general.rst:186 +#: ../../faq/general.rst:188 msgid "" "The standard documentation for the current stable version of Python is " "available at https://docs.python.org/3/. PDF, plain text, and downloadable " @@ -385,7 +382,7 @@ msgstr "" "純文字和可下載的 HTML 版本也可在 https://docs.python.org/3/download.html 找" "到。" -#: ../../faq/general.rst:190 +#: ../../faq/general.rst:192 msgid "" "The documentation is written in reStructuredText and processed by `the " "Sphinx documentation tool `__. The " @@ -396,17 +393,17 @@ msgstr "" "sphinx-doc.org/>`__\\ 處理。說明文件的 reStructuredText 原始碼是 Python 原始" "碼發行版的一部分。" -#: ../../faq/general.rst:196 +#: ../../faq/general.rst:198 msgid "I've never programmed before. Is there a Python tutorial?" msgstr "我從來沒有寫過程式,有沒有 Python 的教學?" -#: ../../faq/general.rst:198 +#: ../../faq/general.rst:200 msgid "" "There are numerous tutorials and books available. The standard " "documentation includes :ref:`tutorial-index`." msgstr "有許多可用的教學和書籍。標準說明文件包括 :ref:`tutorial-index`。" -#: ../../faq/general.rst:201 +#: ../../faq/general.rst:203 msgid "" "Consult `the Beginner's Guide `_ to find information for beginning Python programmers, " @@ -415,11 +412,11 @@ msgstr "" "要尋找 Python 程式設計初學者的資訊,包括教學資源列表,請參閱\\ `初學者指南 " "`_。" -#: ../../faq/general.rst:206 +#: ../../faq/general.rst:208 msgid "Is there a newsgroup or mailing list devoted to Python?" msgstr "有沒有 Python 專屬的新聞群組或郵件討論群?" -#: ../../faq/general.rst:208 +#: ../../faq/general.rst:210 msgid "" "There is a newsgroup, :newsgroup:`comp.lang.python`, and a mailing list, " "`python-list `_. The " @@ -434,7 +431,7 @@ msgstr "" "入郵件討論群。\\ :newsgroup:`comp.lang.python` 的流量很高,每天會收到數百篇文" "章,而 Usenet 的讀者通常較能夠處理這樣的文章數量。" -#: ../../faq/general.rst:215 +#: ../../faq/general.rst:217 msgid "" "Announcements of new software releases and events can be found in comp.lang." "python.announce, a low-traffic moderated list that receives about five " @@ -446,7 +443,7 @@ msgstr "" "論群 `_\\ 的頁面中訂閱。" -#: ../../faq/general.rst:220 +#: ../../faq/general.rst:222 msgid "" "More info about other mailing lists and newsgroups can be found at https://" "www.python.org/community/lists/." @@ -454,11 +451,11 @@ msgstr "" "關於其他郵件討論群和新聞群組的更多資訊,可以在 https://www.python.org/" "community/lists/ 中找到。" -#: ../../faq/general.rst:225 +#: ../../faq/general.rst:227 msgid "How do I get a beta test version of Python?" msgstr "如何取得 Python 的 beta 測試版本?" -#: ../../faq/general.rst:227 +#: ../../faq/general.rst:229 msgid "" "Alpha and beta releases are available from https://www.python.org/" "downloads/. All releases are announced on the comp.lang.python and comp." @@ -469,7 +466,7 @@ msgstr "" "布版本都會在 comp.lang.python 和 comp.lang.python.announce 新聞群組上宣布,也" "會在 Python 首頁 https://www.python.org/ 中宣布;RSS 新聞摘要也是可使用的。" -#: ../../faq/general.rst:232 +#: ../../faq/general.rst:234 msgid "" "You can also access the development version of Python through Git. See `The " "Python Developer's Guide `_ for details." @@ -477,11 +474,11 @@ msgstr "" "你也可以藉由 Git 來存取 Python 的開發版本。更多詳細資訊,請參閱 `Python 開發" "人員指南 `_。" -#: ../../faq/general.rst:237 +#: ../../faq/general.rst:239 msgid "How do I submit bug reports and patches for Python?" msgstr "如何提交 Python 的錯誤報告和修補程式?" -#: ../../faq/general.rst:239 +#: ../../faq/general.rst:241 msgid "" "To report a bug or submit a patch, use the issue tracker at https://github." "com/python/cpython/issues." @@ -489,7 +486,7 @@ msgstr "" "要回報一個錯誤 (bug) 或提交一個修補程式 (patch),請使用於 https://github.com/" "python/cpython/issues 的問題追蹤系統。" -#: ../../faq/general.rst:242 +#: ../../faq/general.rst:244 msgid "" "For more information on how Python is developed, consult `the Python " "Developer's Guide `_." @@ -497,15 +494,15 @@ msgstr "" "關於如何開發 Python 的更多資訊,請參閱 `Python 開發人員指南 `_。" -#: ../../faq/general.rst:247 +#: ../../faq/general.rst:249 msgid "Are there any published articles about Python that I can reference?" msgstr "是否有關於 Python 的任何已出版文章可供參考?" -#: ../../faq/general.rst:249 +#: ../../faq/general.rst:251 msgid "It's probably best to cite your favorite book about Python." msgstr "也許最好是引用你最喜歡的關於 Python 的書。" -#: ../../faq/general.rst:251 +#: ../../faq/general.rst:253 msgid "" "The `very first article `_ about Python was " "written in 1991 and is now quite outdated." @@ -513,7 +510,7 @@ msgstr "" "`最早討論 Python 的文章 `_\\ 是在 1991 年寫的," "但現在來看已經過時了。" -#: ../../faq/general.rst:254 +#: ../../faq/general.rst:256 msgid "" "Guido van Rossum and Jelke de Boer, \"Interactively Testing Remote Servers " "Using the Python Programming Language\", CWI Quarterly, Volume 4, Issue 4 " @@ -523,11 +520,11 @@ msgstr "" "服器」,CWI 季刊,第 4 卷,第 4 期(1991 年 12 月),阿姆斯特丹,第 283–303 " "頁。" -#: ../../faq/general.rst:260 +#: ../../faq/general.rst:262 msgid "Are there any books on Python?" msgstr "有沒有關於 Python 的書?" -#: ../../faq/general.rst:262 +#: ../../faq/general.rst:264 msgid "" "Yes, there are many, and more are being published. See the python.org wiki " "at https://wiki.python.org/moin/PythonBooks for a list." @@ -535,7 +532,7 @@ msgstr "" "有,很多書已經出版,也有更多正在出版中的書。請參閱 python.org 的 wiki 在 " "https://wiki.python.org/moin/PythonBooks 頁面中的書目清單。" -#: ../../faq/general.rst:265 +#: ../../faq/general.rst:267 msgid "" "You can also search online bookstores for \"Python\" and filter out the " "Monty Python references; or perhaps search for \"Python\" and \"language\"." @@ -543,11 +540,11 @@ msgstr "" "你也可以在網路書店搜尋關鍵字「Python」,並過濾掉 Monty Python 的結果;或者可" "以搜尋「Python」和「語言」。" -#: ../../faq/general.rst:270 +#: ../../faq/general.rst:272 msgid "Where in the world is www.python.org located?" msgstr "www.python.org 的真實位置在哪裡?" -#: ../../faq/general.rst:272 +#: ../../faq/general.rst:274 msgid "" "The Python project's infrastructure is located all over the world and is " "managed by the Python Infrastructure Team. Details `here `__。" -#: ../../faq/general.rst:277 +#: ../../faq/general.rst:279 msgid "Why is it called Python?" msgstr "為什麼要取名為 Python?" -#: ../../faq/general.rst:279 +#: ../../faq/general.rst:281 msgid "" "When he began implementing Python, Guido van Rossum was also reading the " "published scripts from `\"Monty Python's Flying Circus\" `__\\ 的出版劇本。Van Rossum 認為他需要一個簡短、獨特且略帶神秘" "的名字,因此他決定將該語言稱為 Python。" -#: ../../faq/general.rst:287 +#: ../../faq/general.rst:289 msgid "Do I have to like \"Monty Python's Flying Circus\"?" msgstr "我需要喜歡「Monty Python 的飛行馬戲團」嗎?" -#: ../../faq/general.rst:289 +#: ../../faq/general.rst:291 msgid "No, but it helps. :)" msgstr "不需要,但它有幫助。:)" -#: ../../faq/general.rst:293 +#: ../../faq/general.rst:295 msgid "Python in the real world" msgstr "在真實世界中的 Python" -#: ../../faq/general.rst:296 +#: ../../faq/general.rst:298 msgid "How stable is Python?" msgstr "Python 的穩定性如何?" -#: ../../faq/general.rst:298 +#: ../../faq/general.rst:300 msgid "" "Very stable. New, stable releases have been coming out roughly every 6 to " "18 months since 1991, and this seems likely to continue. As of version 3.9, " @@ -599,7 +596,7 @@ msgstr "" "看起來會繼續進行。從 3.9 版開始,Python 每隔 12 個月將會釋出一個新功能發行版" "本 (:pep:`602`)。" -#: ../../faq/general.rst:302 +#: ../../faq/general.rst:304 msgid "" "The developers issue bugfix releases of older versions, so the stability of " "existing releases gradually improves. Bugfix releases, indicated by a third " @@ -613,7 +610,7 @@ msgstr "" "版本會被用於改善穩定性;在錯誤修正發布版本中,只會包含針對已知問題的修正,並" "且會保證介面在一系列的錯誤修正發布版本中維持不變。" -#: ../../faq/general.rst:309 +#: ../../faq/general.rst:311 msgid "" "The latest stable releases can always be found on the `Python download page " "`_. There are two production-ready " @@ -626,17 +623,17 @@ msgstr "" "和 3.x。推薦的版本是 3.x,此版本能被那些最為廣泛使用的函式庫所支援。雖然 2.x " "仍然被廣泛使用,但\\ `它已不再被維護 `_。" -#: ../../faq/general.rst:316 +#: ../../faq/general.rst:318 msgid "How many people are using Python?" msgstr "有多少人在使用 Python?" -#: ../../faq/general.rst:318 +#: ../../faq/general.rst:320 msgid "" "There are probably millions of users, though it's difficult to obtain an " "exact count." msgstr "可能有幾百萬個使用者,但實際的數量是難以確定的。" -#: ../../faq/general.rst:321 +#: ../../faq/general.rst:323 msgid "" "Python is available for free download, so there are no sales figures, and " "it's available from many different sites and packaged with many Linux " @@ -645,7 +642,7 @@ msgstr "" "Python 是可以免費下載的,所以不會有銷售數據,而且它可以從許多不同的網站取得," "並與許多 Linux 發行版套裝在一起,所以下載次數的統計也無法反映完整的情況。" -#: ../../faq/general.rst:325 +#: ../../faq/general.rst:327 msgid "" "The comp.lang.python newsgroup is very active, but not all Python users post " "to the group or even read it." @@ -653,11 +650,11 @@ msgstr "" "comp.lang.python 新聞群組非常活躍,但並非所有 Python 使用者都會在該群組發表文" "章或甚至閱讀它。" -#: ../../faq/general.rst:330 +#: ../../faq/general.rst:332 msgid "Have any significant projects been done in Python?" msgstr "有沒有任何重要的專案使用 Python 完成開發?" -#: ../../faq/general.rst:332 +#: ../../faq/general.rst:334 msgid "" "See https://www.python.org/about/success for a list of projects that use " "Python. Consulting the proceedings for `past Python conferences `_\\ 可以看見來自許多不同公司和組織的貢獻。" -#: ../../faq/general.rst:337 +#: ../../faq/general.rst:339 msgid "" "High-profile Python projects include `the Mailman mailing list manager " "`_ and `the Zope application server `_." @@ -708,11 +705,11 @@ msgstr "" "新的開發會在 `python-dev 郵件討論群 `_\\ 中討論。" -#: ../../faq/general.rst:359 +#: ../../faq/general.rst:361 msgid "Is it reasonable to propose incompatible changes to Python?" msgstr "對 Python 提出不相容的變更建議是否適當?" -#: ../../faq/general.rst:361 +#: ../../faq/general.rst:363 msgid "" "In general, no. There are already millions of lines of Python code around " "the world, so any change in the language that invalidates more than a very " @@ -726,7 +723,7 @@ msgstr "" "式,仍然會有需要更新全部說明文件的問題;市面上已經有很多介紹 Python 的書,而" "我們不想一下子就把它們都變為無效。" -#: ../../faq/general.rst:368 +#: ../../faq/general.rst:370 msgid "" "Providing a gradual upgrade path is necessary if a feature has to be " "changed. :pep:`5` describes the procedure followed for introducing backward-" @@ -736,15 +733,15 @@ msgstr "" "進反向不相容 (backward-incompatible) 的變更,同時也要對使用者的擾亂最小化,所" "需遵循的程序。" -#: ../../faq/general.rst:374 +#: ../../faq/general.rst:376 msgid "Is Python a good language for beginning programmers?" msgstr "Python 對於入門的程式設計師而言是否為好的語言?" -#: ../../faq/general.rst:376 +#: ../../faq/general.rst:378 msgid "Yes." msgstr "是的。" -#: ../../faq/general.rst:378 +#: ../../faq/general.rst:380 msgid "" "It is still common to start students with a procedural and statically typed " "language such as Pascal, C, or a subset of C++ or Java. Students may be " @@ -764,7 +761,7 @@ msgstr "" "速地向學生介紹基本觀念,例如迴圈和程序。他們甚至可能在第一堂課中就學到使用者" "自訂的物件。" -#: ../../faq/general.rst:388 +#: ../../faq/general.rst:390 msgid "" "For a student who has never programmed before, using a statically typed " "language seems unnatural. It presents additional complexity that the " @@ -780,7 +777,7 @@ msgstr "" "考、分解問題、設計一致的介面,並封裝資料。雖然從長遠來看,學習使用靜態型別語" "言很重要,但在學生的第一堂程式設計課程中,它不一定是最好的課程主題。" -#: ../../faq/general.rst:396 +#: ../../faq/general.rst:398 msgid "" "Many other aspects of Python make it a good first language. Like Java, " "Python has a large standard library so that students can be assigned " @@ -799,7 +796,7 @@ msgstr "" "用程式的滿足感。使用標準函式庫還可以教導學生程式碼再使用 (code reuse) 的課" "題。像是 PyGame 等第三方模組也有助於延伸學生的學習領域。" -#: ../../faq/general.rst:405 +#: ../../faq/general.rst:407 msgid "" "Python's interactive interpreter enables students to test language features " "while they're programming. They can keep a window with the interpreter " @@ -812,13 +809,13 @@ msgstr "" "\n" "::" -#: ../../faq/general.rst:434 +#: ../../faq/general.rst:436 msgid "" "With the interpreter, documentation is never far from the student as they " "are programming." msgstr "有了直譯器,當學生正在程式設計時,說明文件永遠都不會遠離他們。" -#: ../../faq/general.rst:437 +#: ../../faq/general.rst:439 msgid "" "There are also good IDEs for Python. IDLE is a cross-platform IDE for " "Python that is written in Python using Tkinter. Emacs users will be happy to " @@ -834,7 +831,7 @@ msgstr "" "式時存取互動式直譯器。要查看 Python 編輯環境的完整清單,請參閱 `Python wiki " "`_。" -#: ../../faq/general.rst:445 +#: ../../faq/general.rst:447 msgid "" "If you want to discuss Python's use in education, you may be interested in " "joining `the edu-sig mailing list `_。" + +#~ msgid "See :pep:`6` for more information about bugfix releases." +#~ msgstr "更多關於錯誤修正發布的資訊請見 :pep:`6`。" + +#~ msgid "" +#~ "See also the documentation for :data:`sys.version`, :data:`sys." +#~ "hexversion`, and :data:`sys.version_info`." +#~ msgstr "" +#~ "另請參閱 :data:`sys.version`、\\ :data:`sys.hexversion` 和 :data:`sys." +#~ "version_info` 的說明文件。" diff --git a/reference/datamodel.po b/reference/datamodel.po index f808ce51dd..bd6f7618d4 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-02 00:03+0000\n" +"POT-Creation-Date: 2024-03-04 00:03+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-" @@ -2021,13 +2021,20 @@ msgid "" "rather, :meth:`__lt__` and :meth:`__gt__` are each other's reflection, :meth:" "`__le__` and :meth:`__ge__` are each other's reflection, and :meth:`__eq__` " "and :meth:`__ne__` are their own reflection. If the operands are of " -"different types, and right operand's type is a direct or indirect subclass " -"of the left operand's type, the reflected method of the right operand has " -"priority, otherwise the left operand's method has priority. Virtual " -"subclassing is not considered." +"different types, and the right operand's type is a direct or indirect " +"subclass of the left operand's type, the reflected method of the right " +"operand has priority, otherwise the left operand's method has priority. " +"Virtual subclassing is not considered." msgstr "" -#: ../../reference/datamodel.rst:1820 +#: ../../reference/datamodel.rst:1814 +msgid "" +"When no appropriate method returns any value other than :data:" +"`NotImplemented`, the ``==`` and ``!=`` operators will fall back to ``is`` " +"and ``is not``, respectively." +msgstr "" + +#: ../../reference/datamodel.rst:1823 msgid "" "Called by built-in function :func:`hash` and for operations on members of " "hashed collections including :class:`set`, :class:`frozenset`, and :class:" @@ -2038,7 +2045,7 @@ msgid "" "into a tuple and hashing the tuple. Example::" msgstr "" -#: ../../reference/datamodel.rst:1833 +#: ../../reference/datamodel.rst:1836 msgid "" ":func:`hash` truncates the value returned from an object's custom :meth:" "`__hash__` method to the size of a :c:type:`Py_ssize_t`. This is typically " @@ -2048,7 +2055,7 @@ msgid "" "``python -c \"import sys; print(sys.hash_info.width)\"``." msgstr "" -#: ../../reference/datamodel.rst:1841 +#: ../../reference/datamodel.rst:1844 msgid "" "If a class does not define an :meth:`__eq__` method it should not define a :" "meth:`__hash__` operation either; if it defines :meth:`__eq__` but not :meth:" @@ -2060,7 +2067,7 @@ msgid "" "wrong hash bucket)." msgstr "" -#: ../../reference/datamodel.rst:1850 +#: ../../reference/datamodel.rst:1853 msgid "" "User-defined classes have :meth:`__eq__` and :meth:`__hash__` methods by " "default; with them, all objects compare unequal (except with themselves) and " @@ -2068,7 +2075,7 @@ msgid "" "both that ``x is y`` and ``hash(x) == hash(y)``." msgstr "" -#: ../../reference/datamodel.rst:1855 +#: ../../reference/datamodel.rst:1858 msgid "" "A class that overrides :meth:`__eq__` and does not define :meth:`__hash__` " "will have its :meth:`__hash__` implicitly set to ``None``. When the :meth:" @@ -2078,14 +2085,14 @@ msgid "" "checking ``isinstance(obj, collections.abc.Hashable)``." msgstr "" -#: ../../reference/datamodel.rst:1862 +#: ../../reference/datamodel.rst:1865 msgid "" "If a class that overrides :meth:`__eq__` needs to retain the implementation " "of :meth:`__hash__` from a parent class, the interpreter must be told this " "explicitly by setting ``__hash__ = .__hash__``." msgstr "" -#: ../../reference/datamodel.rst:1866 +#: ../../reference/datamodel.rst:1869 msgid "" "If a class that does not override :meth:`__eq__` wishes to suppress hash " "support, it should include ``__hash__ = None`` in the class definition. A " @@ -2094,7 +2101,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:1875 +#: ../../reference/datamodel.rst:1878 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -2102,7 +2109,7 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:1880 +#: ../../reference/datamodel.rst:1883 msgid "" "This is intended to provide protection against a denial-of-service caused by " "carefully chosen inputs that exploit the worst case performance of a dict " @@ -2110,22 +2117,22 @@ msgid "" "advisories/ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:1885 +#: ../../reference/datamodel.rst:1888 msgid "" "Changing hash values affects the iteration order of sets. Python has never " "made guarantees about this ordering (and it typically varies between 32-bit " "and 64-bit builds)." msgstr "" -#: ../../reference/datamodel.rst:1889 +#: ../../reference/datamodel.rst:1892 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`\\ 。" -#: ../../reference/datamodel.rst:1891 +#: ../../reference/datamodel.rst:1894 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:1899 +#: ../../reference/datamodel.rst:1902 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -2134,18 +2141,18 @@ msgid "" "meth:`!__len__` nor :meth:`!__bool__`, all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:1910 +#: ../../reference/datamodel.rst:1913 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:1912 +#: ../../reference/datamodel.rst:1915 msgid "" "The following methods can be defined to customize the meaning of attribute " "access (use of, assignment to, or deletion of ``x.name``) for class " "instances." msgstr "" -#: ../../reference/datamodel.rst:1920 +#: ../../reference/datamodel.rst:1923 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -2155,7 +2162,7 @@ msgid "" "attribute value or raise an :exc:`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1927 +#: ../../reference/datamodel.rst:1930 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -2168,7 +2175,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:1940 +#: ../../reference/datamodel.rst:1943 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -2180,14 +2187,14 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:1951 +#: ../../reference/datamodel.rst:1954 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or :ref:`built-in " "functions `. See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:1956 +#: ../../reference/datamodel.rst:1959 msgid "" "Raises an :ref:`auditing event ` ``object.__getattr__`` with " "arguments ``obj``, ``name``." @@ -2195,27 +2202,27 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__getattr__``。" -#: ../../reference/datamodel.rst:1958 +#: ../../reference/datamodel.rst:1961 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1965 +#: ../../reference/datamodel.rst:1968 msgid "" "Called when an attribute assignment is attempted. This is called instead of " "the normal mechanism (i.e. store the value in the instance dictionary). " "*name* is the attribute name, *value* is the value to be assigned to it." msgstr "" -#: ../../reference/datamodel.rst:1969 +#: ../../reference/datamodel.rst:1972 msgid "" "If :meth:`__setattr__` wants to assign to an instance attribute, it should " "call the base class method with the same name, for example, ``object." "__setattr__(self, name, value)``." msgstr "" -#: ../../reference/datamodel.rst:1973 +#: ../../reference/datamodel.rst:1976 msgid "" "Raises an :ref:`auditing event ` ``object.__setattr__`` with " "arguments ``obj``, ``name``, ``value``." @@ -2223,21 +2230,21 @@ msgstr "" "引發一個附帶引數 ``obj``、``name``、``value`` 的\\ :ref:`稽核事件 " "` ``object.__setattr__``。" -#: ../../reference/datamodel.rst:1975 +#: ../../reference/datamodel.rst:1978 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:1982 +#: ../../reference/datamodel.rst:1985 msgid "" "Like :meth:`__setattr__` but for attribute deletion instead of assignment. " "This should only be implemented if ``del obj.name`` is meaningful for the " "object." msgstr "" -#: ../../reference/datamodel.rst:1985 +#: ../../reference/datamodel.rst:1988 msgid "" "Raises an :ref:`auditing event ` ``object.__delattr__`` with " "arguments ``obj``, ``name``." @@ -2245,23 +2252,23 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__delattr__``。" -#: ../../reference/datamodel.rst:1987 +#: ../../reference/datamodel.rst:1990 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1994 +#: ../../reference/datamodel.rst:1997 msgid "" "Called when :func:`dir` is called on the object. An iterable must be " "returned. :func:`dir` converts the returned iterable to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:1999 +#: ../../reference/datamodel.rst:2002 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:2006 +#: ../../reference/datamodel.rst:2009 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2273,21 +2280,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:2015 +#: ../../reference/datamodel.rst:2018 msgid "" "The ``__dir__`` function should accept no arguments, and return an iterable " "of strings that represents the names accessible on module. If present, this " "function overrides the standard :func:`dir` search on a module." msgstr "" -#: ../../reference/datamodel.rst:2019 +#: ../../reference/datamodel.rst:2022 msgid "" "For a more fine grained customization of the module behavior (setting " "attributes, properties, etc.), one can set the ``__class__`` attribute of a " "module object to a subclass of :class:`types.ModuleType`. For example::" msgstr "" -#: ../../reference/datamodel.rst:2037 +#: ../../reference/datamodel.rst:2040 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2295,27 +2302,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:2042 +#: ../../reference/datamodel.rst:2045 msgid "``__class__`` module attribute is now writable." msgstr "" -#: ../../reference/datamodel.rst:2045 +#: ../../reference/datamodel.rst:2048 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "" -#: ../../reference/datamodel.rst:2050 +#: ../../reference/datamodel.rst:2053 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:2051 +#: ../../reference/datamodel.rst:2054 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:2057 +#: ../../reference/datamodel.rst:2060 msgid "Implementing Descriptors" msgstr "" -#: ../../reference/datamodel.rst:2059 +#: ../../reference/datamodel.rst:2062 msgid "" "The following methods only apply when an instance of the class containing " "the method (a so-called *descriptor* class) appears in an *owner* class (the " @@ -2325,7 +2332,7 @@ msgid "" "the owner class' :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:2069 +#: ../../reference/datamodel.rst:2072 msgid "" "Called to get the attribute of the owner class (class attribute access) or " "of an instance of that class (instance attribute access). The optional " @@ -2334,13 +2341,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:2075 +#: ../../reference/datamodel.rst:2078 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:2078 +#: ../../reference/datamodel.rst:2081 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2350,31 +2357,31 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:2087 +#: ../../reference/datamodel.rst:2090 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:2090 +#: ../../reference/datamodel.rst:2093 msgid "" "Note, adding :meth:`__set__` or :meth:`__delete__` changes the kind of " "descriptor to a \"data descriptor\". See :ref:`descriptor-invocation` for " "more details." msgstr "" -#: ../../reference/datamodel.rst:2096 +#: ../../reference/datamodel.rst:2099 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:2098 +#: ../../reference/datamodel.rst:2101 msgid "" "Instances of descriptors may also have the :attr:`!__objclass__` attribute " "present:" msgstr "" -#: ../../reference/datamodel.rst:2103 +#: ../../reference/datamodel.rst:2106 msgid "" "The attribute :attr:`!__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2385,11 +2392,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:2114 +#: ../../reference/datamodel.rst:2117 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:2116 +#: ../../reference/datamodel.rst:2119 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2398,7 +2405,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:2122 +#: ../../reference/datamodel.rst:2125 msgid "" "The default behavior for attribute access is to get, set, or delete the " "attribute from an object's dictionary. For instance, ``a.x`` has a lookup " @@ -2406,7 +2413,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:2127 +#: ../../reference/datamodel.rst:2130 msgid "" "However, if the looked-up value is an object defining one of the descriptor " "methods, then Python may override the default behavior and invoke the " @@ -2414,54 +2421,54 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:2132 +#: ../../reference/datamodel.rst:2135 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:2137 +#: ../../reference/datamodel.rst:2140 msgid "Direct Call" msgstr "" -#: ../../reference/datamodel.rst:2136 +#: ../../reference/datamodel.rst:2139 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:2141 +#: ../../reference/datamodel.rst:2144 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:2140 +#: ../../reference/datamodel.rst:2143 msgid "" "If binding to an object instance, ``a.x`` is transformed into the call: " "``type(a).__dict__['x'].__get__(a, type(a))``." msgstr "" -#: ../../reference/datamodel.rst:2145 +#: ../../reference/datamodel.rst:2148 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:2144 +#: ../../reference/datamodel.rst:2147 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:2151 +#: ../../reference/datamodel.rst:2154 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:2148 +#: ../../reference/datamodel.rst:2151 msgid "" "A dotted lookup such as ``super(A, a).x`` searches ``a.__class__.__mro__`` " "for a base class ``B`` following ``A`` and then returns ``B.__dict__['x']." "__get__(a, A)``. If not a descriptor, ``x`` is returned unchanged." msgstr "" -#: ../../reference/datamodel.rst:2185 +#: ../../reference/datamodel.rst:2188 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " @@ -2479,7 +2486,7 @@ msgid "" "instances." msgstr "" -#: ../../reference/datamodel.rst:2200 +#: ../../reference/datamodel.rst:2203 msgid "" "Python methods (including those decorated with :func:`@staticmethod " "` and :func:`@classmethod `) are implemented as " @@ -2488,30 +2495,30 @@ msgid "" "from other instances of the same class." msgstr "" -#: ../../reference/datamodel.rst:2206 +#: ../../reference/datamodel.rst:2209 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:2213 +#: ../../reference/datamodel.rst:2216 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:2215 +#: ../../reference/datamodel.rst:2218 msgid "" "*__slots__* allow us to explicitly declare data members (like properties) " "and deny the creation of :attr:`~object.__dict__` and *__weakref__* (unless " "explicitly declared in *__slots__* or available in a parent.)" msgstr "" -#: ../../reference/datamodel.rst:2219 +#: ../../reference/datamodel.rst:2222 msgid "" "The space saved over using :attr:`~object.__dict__` can be significant. " "Attribute lookup speed can be significantly improved as well." msgstr "" -#: ../../reference/datamodel.rst:2224 +#: ../../reference/datamodel.rst:2227 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -2519,18 +2526,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:2233 +#: ../../reference/datamodel.rst:2236 msgid "Notes on using *__slots__*:" msgstr "" -#: ../../reference/datamodel.rst:2235 +#: ../../reference/datamodel.rst:2238 msgid "" "When inheriting from a class without *__slots__*, the :attr:`~object." "__dict__` and *__weakref__* attribute of the instances will always be " "accessible." msgstr "" -#: ../../reference/datamodel.rst:2239 +#: ../../reference/datamodel.rst:2242 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -2539,7 +2546,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2246 +#: ../../reference/datamodel.rst:2249 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -2547,7 +2554,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2252 +#: ../../reference/datamodel.rst:2255 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -2555,7 +2562,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:2258 +#: ../../reference/datamodel.rst:2261 msgid "" "The action of a *__slots__* declaration is not limited to the class where it " "is defined. *__slots__* declared in parents are available in child classes. " @@ -2564,7 +2571,7 @@ msgid "" "names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:2264 +#: ../../reference/datamodel.rst:2267 msgid "" "If a class defines a slot also defined in a base class, the instance " "variable defined by the base class slot is inaccessible (except by " @@ -2573,7 +2580,7 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:2269 +#: ../../reference/datamodel.rst:2272 msgid "" ":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " "class derived from a :c:member:`\"variable-length\" built-in type " @@ -2581,11 +2588,11 @@ msgid "" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:2274 +#: ../../reference/datamodel.rst:2277 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2276 +#: ../../reference/datamodel.rst:2279 msgid "" "If a :class:`dictionary ` is used to assign *__slots__*, the " "dictionary keys will be used as the slot names. The values of the dictionary " @@ -2593,13 +2600,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:2281 +#: ../../reference/datamodel.rst:2284 msgid "" ":attr:`~instance.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2284 +#: ../../reference/datamodel.rst:2287 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2607,18 +2614,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2290 +#: ../../reference/datamodel.rst:2293 msgid "" "If an :term:`iterator` is used for *__slots__* then a :term:`descriptor` is " "created for each of the iterator's values. However, the *__slots__* " "attribute will be an empty iterator." msgstr "" -#: ../../reference/datamodel.rst:2298 +#: ../../reference/datamodel.rst:2301 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:2300 +#: ../../reference/datamodel.rst:2303 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2628,14 +2635,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:2309 +#: ../../reference/datamodel.rst:2312 msgid "" "This method is called whenever the containing class is subclassed. *cls* is " "then the new subclass. If defined as a normal instance method, this method " "is implicitly converted to a class method." msgstr "" -#: ../../reference/datamodel.rst:2313 +#: ../../reference/datamodel.rst:2316 msgid "" "Keyword arguments which are given to a new class are passed to the parent " "class's ``__init_subclass__``. For compatibility with other classes using " @@ -2643,13 +2650,13 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2327 +#: ../../reference/datamodel.rst:2330 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2332 +#: ../../reference/datamodel.rst:2335 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2657,41 +2664,41 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2340 +#: ../../reference/datamodel.rst:2343 msgid "" "When a class is created, :meth:`type.__new__` scans the class variables and " "makes callbacks to those with a :meth:`~object.__set_name__` hook." msgstr "" -#: ../../reference/datamodel.rst:2345 +#: ../../reference/datamodel.rst:2348 msgid "" "Automatically called at the time the owning class *owner* is created. The " "object has been assigned to *name* in that class::" msgstr "" -#: ../../reference/datamodel.rst:2351 +#: ../../reference/datamodel.rst:2354 msgid "" "If the class variable is assigned after the class is created, :meth:" "`__set_name__` will not be called automatically. If needed, :meth:" "`__set_name__` can be called directly::" msgstr "" -#: ../../reference/datamodel.rst:2362 +#: ../../reference/datamodel.rst:2365 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`\\ 。" -#: ../../reference/datamodel.rst:2370 +#: ../../reference/datamodel.rst:2373 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2377 +#: ../../reference/datamodel.rst:2380 msgid "" "By default, classes are constructed using :func:`type`. The class body is " "executed in a new namespace and the class name is bound locally to the " "result of ``type(name, bases, namespace)``." msgstr "" -#: ../../reference/datamodel.rst:2381 +#: ../../reference/datamodel.rst:2384 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2699,41 +2706,41 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2395 +#: ../../reference/datamodel.rst:2398 msgid "" "Any other keyword arguments that are specified in the class definition are " "passed through to all metaclass operations described below." msgstr "" -#: ../../reference/datamodel.rst:2398 +#: ../../reference/datamodel.rst:2401 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2400 +#: ../../reference/datamodel.rst:2403 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2401 +#: ../../reference/datamodel.rst:2404 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2402 +#: ../../reference/datamodel.rst:2405 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2403 +#: ../../reference/datamodel.rst:2406 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2404 +#: ../../reference/datamodel.rst:2407 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2408 +#: ../../reference/datamodel.rst:2411 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2412 +#: ../../reference/datamodel.rst:2415 msgid "" "If a base that appears in a class definition is not an instance of :class:" "`type`, then an :meth:`!__mro_entries__` method is searched on the base. If " @@ -2745,59 +2752,59 @@ msgid "" "is ignored." msgstr "" -#: ../../reference/datamodel.rst:2424 +#: ../../reference/datamodel.rst:2427 msgid ":func:`types.resolve_bases`" msgstr ":func:`types.resolve_bases`" -#: ../../reference/datamodel.rst:2424 +#: ../../reference/datamodel.rst:2427 msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" -#: ../../reference/datamodel.rst:2428 +#: ../../reference/datamodel.rst:2431 msgid ":func:`types.get_original_bases`" msgstr ":func:`types.get_original_bases`" -#: ../../reference/datamodel.rst:2427 +#: ../../reference/datamodel.rst:2430 msgid "" "Retrieve a class's \"original bases\" prior to modifications by :meth:" "`~object.__mro_entries__`." msgstr "" -#: ../../reference/datamodel.rst:2430 +#: ../../reference/datamodel.rst:2433 msgid ":pep:`560`" msgstr ":pep:`560`" -#: ../../reference/datamodel.rst:2431 +#: ../../reference/datamodel.rst:2434 msgid "Core support for typing module and generic types." msgstr "" -#: ../../reference/datamodel.rst:2435 +#: ../../reference/datamodel.rst:2438 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2439 +#: ../../reference/datamodel.rst:2442 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2441 +#: ../../reference/datamodel.rst:2444 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2442 +#: ../../reference/datamodel.rst:2445 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:2444 +#: ../../reference/datamodel.rst:2447 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:2447 +#: ../../reference/datamodel.rst:2450 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2806,11 +2813,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2457 +#: ../../reference/datamodel.rst:2460 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2462 +#: ../../reference/datamodel.rst:2465 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2822,25 +2829,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2471 +#: ../../reference/datamodel.rst:2474 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2476 +#: ../../reference/datamodel.rst:2479 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2477 +#: ../../reference/datamodel.rst:2480 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2481 +#: ../../reference/datamodel.rst:2484 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2486 +#: ../../reference/datamodel.rst:2489 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2849,7 +2856,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2492 +#: ../../reference/datamodel.rst:2495 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -2858,11 +2865,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2501 +#: ../../reference/datamodel.rst:2504 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2508 +#: ../../reference/datamodel.rst:2511 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2870,7 +2877,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2513 +#: ../../reference/datamodel.rst:2516 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -2881,7 +2888,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2523 +#: ../../reference/datamodel.rst:2526 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -2890,39 +2897,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2529 +#: ../../reference/datamodel.rst:2532 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customization " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2533 +#: ../../reference/datamodel.rst:2536 msgid "" "The ``type.__new__`` method collects all of the attributes in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2535 +#: ../../reference/datamodel.rst:2538 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2537 +#: ../../reference/datamodel.rst:2540 msgid "" "The :meth:`~object.__init_subclass__` hook is called on the immediate parent " "of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2540 +#: ../../reference/datamodel.rst:2543 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2544 +#: ../../reference/datamodel.rst:2547 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -2930,19 +2937,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2551 +#: ../../reference/datamodel.rst:2554 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2552 +#: ../../reference/datamodel.rst:2555 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2556 +#: ../../reference/datamodel.rst:2559 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2558 +#: ../../reference/datamodel.rst:2561 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2950,17 +2957,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2565 +#: ../../reference/datamodel.rst:2568 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2567 +#: ../../reference/datamodel.rst:2570 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2570 +#: ../../reference/datamodel.rst:2573 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2968,21 +2975,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2577 +#: ../../reference/datamodel.rst:2580 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2584 +#: ../../reference/datamodel.rst:2587 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2589 +#: ../../reference/datamodel.rst:2592 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -2990,11 +2997,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2600 +#: ../../reference/datamodel.rst:2603 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2597 +#: ../../reference/datamodel.rst:2600 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -3003,11 +3010,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2605 +#: ../../reference/datamodel.rst:2608 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2607 +#: ../../reference/datamodel.rst:2610 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -3015,65 +3022,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2615 +#: ../../reference/datamodel.rst:2618 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2615 +#: ../../reference/datamodel.rst:2618 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2618 +#: ../../reference/datamodel.rst:2621 msgid ":ref:`Generic Alias Types`" msgstr ":ref:`泛型別名型別 `" -#: ../../reference/datamodel.rst:2618 +#: ../../reference/datamodel.rst:2621 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2621 +#: ../../reference/datamodel.rst:2624 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2621 +#: ../../reference/datamodel.rst:2624 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2624 +#: ../../reference/datamodel.rst:2627 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2629 +#: ../../reference/datamodel.rst:2632 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2632 +#: ../../reference/datamodel.rst:2635 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " "method. As such, there is no need for it to be decorated with :func:" "`@classmethod` when it is defined." msgstr "" -#: ../../reference/datamodel.rst:2638 +#: ../../reference/datamodel.rst:2641 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2640 +#: ../../reference/datamodel.rst:2643 msgid "" "The purpose of :meth:`~object.__class_getitem__` is to allow runtime " "parameterization of standard-library generic classes in order to more easily " "apply :term:`type hints` to these classes." msgstr "" -#: ../../reference/datamodel.rst:2644 +#: ../../reference/datamodel.rst:2647 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -3082,7 +3089,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2650 +#: ../../reference/datamodel.rst:2653 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -3090,11 +3097,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2660 +#: ../../reference/datamodel.rst:2663 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2662 +#: ../../reference/datamodel.rst:2665 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -3104,14 +3111,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2669 +#: ../../reference/datamodel.rst:2672 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " "follows something like the following process to decide whether :meth:" "`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" -#: ../../reference/datamodel.rst:2697 +#: ../../reference/datamodel.rst:2700 msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " @@ -3121,40 +3128,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2716 +#: ../../reference/datamodel.rst:2719 msgid "" "However, if a class has a custom metaclass that defines :meth:`~object." "__getitem__`, subscribing the class may result in different behaviour. An " "example of this can be found in the :mod:`enum` module::" msgstr "" -#: ../../reference/datamodel.rst:2741 +#: ../../reference/datamodel.rst:2744 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2740 +#: ../../reference/datamodel.rst:2743 msgid "" "Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" "`subscription` results in ``__class_getitem__()`` being " "called instead of :meth:`~object.__getitem__`" msgstr "" -#: ../../reference/datamodel.rst:2748 +#: ../../reference/datamodel.rst:2751 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2755 +#: ../../reference/datamodel.rst:2758 msgid "" "Called when the instance is \"called\" as a function; if this method is " "defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " "arg1, ...)``." msgstr "" -#: ../../reference/datamodel.rst:2762 +#: ../../reference/datamodel.rst:2765 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2764 +#: ../../reference/datamodel.rst:2767 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -3190,7 +3197,7 @@ msgid "" "should iterate through the values." msgstr "" -#: ../../reference/datamodel.rst:2805 +#: ../../reference/datamodel.rst:2808 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -3198,7 +3205,7 @@ msgid "" "returns zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2812 +#: ../../reference/datamodel.rst:2815 msgid "" "In CPython, the length is required to be at most :data:`sys.maxsize`. If the " "length is larger than :data:`!sys.maxsize` some features (such as :func:" @@ -3207,7 +3214,7 @@ msgid "" "`~object.__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2821 +#: ../../reference/datamodel.rst:2824 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -3217,20 +3224,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2835 +#: ../../reference/datamodel.rst:2838 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2839 +#: ../../reference/datamodel.rst:2842 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2843 +#: ../../reference/datamodel.rst:2846 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2848 +#: ../../reference/datamodel.rst:2851 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers. Optionally, they may support :class:" @@ -3242,20 +3249,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2860 +#: ../../reference/datamodel.rst:2863 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:2865 +#: ../../reference/datamodel.rst:2868 msgid "" "When :ref:`subscripting` a *class*, the special class method :" "meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " "See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:2873 +#: ../../reference/datamodel.rst:2876 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3264,7 +3271,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2882 +#: ../../reference/datamodel.rst:2885 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3273,13 +3280,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2891 +#: ../../reference/datamodel.rst:2894 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:2897 +#: ../../reference/datamodel.rst:2900 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3287,14 +3294,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2905 +#: ../../reference/datamodel.rst:2908 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:2909 +#: ../../reference/datamodel.rst:2912 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -3303,7 +3310,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2916 +#: ../../reference/datamodel.rst:2919 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3311,14 +3318,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2923 +#: ../../reference/datamodel.rst:2926 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:2927 +#: ../../reference/datamodel.rst:2930 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3326,11 +3333,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2936 +#: ../../reference/datamodel.rst:2939 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2938 +#: ../../reference/datamodel.rst:2941 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3338,7 +3345,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2964 +#: ../../reference/datamodel.rst:2967 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3352,13 +3359,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2975 +#: ../../reference/datamodel.rst:2978 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return :data:`NotImplemented`." msgstr "" -#: ../../reference/datamodel.rst:2998 +#: ../../reference/datamodel.rst:3001 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3371,13 +3378,13 @@ msgid "" "`NotImplemented`." msgstr "" -#: ../../reference/datamodel.rst:3010 +#: ../../reference/datamodel.rst:3013 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:3015 +#: ../../reference/datamodel.rst:3018 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -3386,7 +3393,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:3036 +#: ../../reference/datamodel.rst:3039 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3404,19 +3411,19 @@ msgid "" "data model." msgstr "" -#: ../../reference/datamodel.rst:3059 +#: ../../reference/datamodel.rst:3062 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:3072 +#: ../../reference/datamodel.rst:3075 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:3079 +#: ../../reference/datamodel.rst:3082 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3425,14 +3432,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:3085 +#: ../../reference/datamodel.rst:3088 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:3097 +#: ../../reference/datamodel.rst:3100 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3441,21 +3448,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:3103 +#: ../../reference/datamodel.rst:3106 msgid "" "The built-in function :func:`int` falls back to :meth:`__trunc__` if " "neither :meth:`__int__` nor :meth:`__index__` is defined." msgstr "" -#: ../../reference/datamodel.rst:3106 +#: ../../reference/datamodel.rst:3109 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:3113 +#: ../../reference/datamodel.rst:3116 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3115 +#: ../../reference/datamodel.rst:3118 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -3465,32 +3472,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:3126 +#: ../../reference/datamodel.rst:3129 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:3129 +#: ../../reference/datamodel.rst:3132 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:3134 +#: ../../reference/datamodel.rst:3137 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:3141 +#: ../../reference/datamodel.rst:3144 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:3145 +#: ../../reference/datamodel.rst:3148 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -3498,27 +3505,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:3149 +#: ../../reference/datamodel.rst:3152 msgid "" "Note that :meth:`~object.__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:3156 +#: ../../reference/datamodel.rst:3159 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:3156 +#: ../../reference/datamodel.rst:3159 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3163 +#: ../../reference/datamodel.rst:3166 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:3165 +#: ../../reference/datamodel.rst:3168 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -3526,7 +3533,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:3172 +#: ../../reference/datamodel.rst:3175 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -3535,7 +3542,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:3178 +#: ../../reference/datamodel.rst:3181 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3545,19 +3552,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:3188 +#: ../../reference/datamodel.rst:3191 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:3189 +#: ../../reference/datamodel.rst:3192 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:3195 +#: ../../reference/datamodel.rst:3198 msgid "Emulating buffer types" msgstr "" -#: ../../reference/datamodel.rst:3197 +#: ../../reference/datamodel.rst:3200 msgid "" "The :ref:`buffer protocol ` provides a way for Python objects " "to expose efficient access to a low-level memory array. This protocol is " @@ -3565,13 +3572,13 @@ msgid "" "and third-party libraries may define additional buffer types." msgstr "" -#: ../../reference/datamodel.rst:3202 +#: ../../reference/datamodel.rst:3205 msgid "" "While buffer types are usually implemented in C, it is also possible to " "implement the protocol in Python." msgstr "" -#: ../../reference/datamodel.rst:3207 +#: ../../reference/datamodel.rst:3210 msgid "" "Called when a buffer is requested from *self* (for example, by the :class:" "`memoryview` constructor). The *flags* argument is an integer representing " @@ -3581,7 +3588,7 @@ msgid "" "`memoryview` object." msgstr "" -#: ../../reference/datamodel.rst:3216 +#: ../../reference/datamodel.rst:3219 msgid "" "Called when a buffer is no longer needed. The *buffer* argument is a :class:" "`memoryview` object that was previously returned by :meth:`~object." @@ -3590,28 +3597,28 @@ msgid "" "to perform any cleanup are not required to implement this method." msgstr "" -#: ../../reference/datamodel.rst:3228 +#: ../../reference/datamodel.rst:3231 msgid ":pep:`688` - Making the buffer protocol accessible in Python" msgstr "" -#: ../../reference/datamodel.rst:3228 +#: ../../reference/datamodel.rst:3231 msgid "" "Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3230 +#: ../../reference/datamodel.rst:3233 msgid ":class:`collections.abc.Buffer`" msgstr ":class:`collections.abc.Buffer`" -#: ../../reference/datamodel.rst:3231 +#: ../../reference/datamodel.rst:3234 msgid "ABC for buffer types." msgstr "" -#: ../../reference/datamodel.rst:3236 +#: ../../reference/datamodel.rst:3239 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:3238 +#: ../../reference/datamodel.rst:3241 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -3619,7 +3626,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:3253 +#: ../../reference/datamodel.rst:3256 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3628,21 +3635,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:3267 +#: ../../reference/datamodel.rst:3270 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:3276 +#: ../../reference/datamodel.rst:3279 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:3302 +#: ../../reference/datamodel.rst:3305 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3651,36 +3658,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:3313 +#: ../../reference/datamodel.rst:3316 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:3317 +#: ../../reference/datamodel.rst:3320 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:3319 +#: ../../reference/datamodel.rst:3322 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:3325 +#: ../../reference/datamodel.rst:3328 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:3331 +#: ../../reference/datamodel.rst:3334 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " "method to be compatible with the :keyword:`await` expression." msgstr "" -#: ../../reference/datamodel.rst:3337 +#: ../../reference/datamodel.rst:3340 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -3688,15 +3695,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:3345 +#: ../../reference/datamodel.rst:3348 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:3351 +#: ../../reference/datamodel.rst:3354 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:3353 +#: ../../reference/datamodel.rst:3356 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3707,18 +3714,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:3361 +#: ../../reference/datamodel.rst:3364 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:3365 +#: ../../reference/datamodel.rst:3368 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3371 +#: ../../reference/datamodel.rst:3374 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3729,7 +3736,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3382 +#: ../../reference/datamodel.rst:3385 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3740,13 +3747,13 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3393 +#: ../../reference/datamodel.rst:3396 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:3398 +#: ../../reference/datamodel.rst:3401 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3756,99 +3763,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3406 +#: ../../reference/datamodel.rst:3409 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3412 +#: ../../reference/datamodel.rst:3415 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3414 +#: ../../reference/datamodel.rst:3417 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3417 +#: ../../reference/datamodel.rst:3420 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3421 +#: ../../reference/datamodel.rst:3424 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3425 +#: ../../reference/datamodel.rst:3428 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3428 +#: ../../reference/datamodel.rst:3431 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3445 +#: ../../reference/datamodel.rst:3448 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3450 +#: ../../reference/datamodel.rst:3453 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3458 +#: ../../reference/datamodel.rst:3461 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3460 +#: ../../reference/datamodel.rst:3463 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3463 +#: ../../reference/datamodel.rst:3466 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3467 +#: ../../reference/datamodel.rst:3470 msgid "" "Semantically similar to :meth:`~object.__enter__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3472 +#: ../../reference/datamodel.rst:3475 msgid "" "Semantically similar to :meth:`~object.__exit__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3475 +#: ../../reference/datamodel.rst:3478 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3488 +#: ../../reference/datamodel.rst:3491 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3489 +#: ../../reference/datamodel.rst:3492 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3493 +#: ../../reference/datamodel.rst:3496 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3856,7 +3863,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3499 +#: ../../reference/datamodel.rst:3502 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns :data:`NotImplemented`. Do not set the method to ``None`` if " @@ -3864,7 +3871,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3505 +#: ../../reference/datamodel.rst:3508 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method -- such as :meth:`~object.__add__` -- fails then the overall " @@ -3887,7 +3894,7 @@ msgstr "" #: ../../reference/datamodel.rst:1007 ../../reference/datamodel.rst:1034 #: ../../reference/datamodel.rst:1096 ../../reference/datamodel.rst:1200 #: ../../reference/datamodel.rst:1307 ../../reference/datamodel.rst:1407 -#: ../../reference/datamodel.rst:1816 ../../reference/datamodel.rst:2831 +#: ../../reference/datamodel.rst:1819 ../../reference/datamodel.rst:2834 msgid "object" msgstr "object(物件)" @@ -3900,11 +3907,11 @@ msgstr "data(資料)" #: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:799 #: ../../reference/datamodel.rst:1053 ../../reference/datamodel.rst:1490 #: ../../reference/datamodel.rst:1730 ../../reference/datamodel.rst:1735 -#: ../../reference/datamodel.rst:1816 ../../reference/datamodel.rst:2372 -#: ../../reference/datamodel.rst:2801 ../../reference/datamodel.rst:2959 -#: ../../reference/datamodel.rst:2994 ../../reference/datamodel.rst:3008 -#: ../../reference/datamodel.rst:3057 ../../reference/datamodel.rst:3067 -#: ../../reference/datamodel.rst:3095 +#: ../../reference/datamodel.rst:1819 ../../reference/datamodel.rst:2375 +#: ../../reference/datamodel.rst:2804 ../../reference/datamodel.rst:2962 +#: ../../reference/datamodel.rst:2997 ../../reference/datamodel.rst:3011 +#: ../../reference/datamodel.rst:3060 ../../reference/datamodel.rst:3070 +#: ../../reference/datamodel.rst:3098 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -3913,7 +3920,7 @@ msgid "id" msgstr "id" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:122 -#: ../../reference/datamodel.rst:2372 +#: ../../reference/datamodel.rst:2375 msgid "type" msgstr "type(型別)" @@ -4037,12 +4044,12 @@ msgstr "number(數字)" msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:3067 +#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:3070 msgid "complex" msgstr "complex(複數)" #: ../../reference/datamodel.rst:292 ../../reference/datamodel.rst:420 -#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2801 +#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2804 msgid "len" msgstr "len" @@ -4135,7 +4142,7 @@ msgstr "assignment(賦值)" #: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:856 #: ../../reference/datamodel.rst:1444 ../../reference/datamodel.rst:1626 -#: ../../reference/datamodel.rst:3122 +#: ../../reference/datamodel.rst:3125 msgid "statement" msgstr "statement(陳述式)" @@ -4172,7 +4179,7 @@ msgid "mapping" msgstr "mapping(對映)" #: ../../reference/datamodel.rst:476 ../../reference/datamodel.rst:938 -#: ../../reference/datamodel.rst:1816 +#: ../../reference/datamodel.rst:1819 msgid "dictionary" msgstr "dictionary(字典)" @@ -4195,7 +4202,7 @@ msgid "function" msgstr "function (函式)" #: ../../reference/datamodel.rst:512 ../../reference/datamodel.rst:938 -#: ../../reference/datamodel.rst:961 ../../reference/datamodel.rst:2753 +#: ../../reference/datamodel.rst:961 ../../reference/datamodel.rst:2756 msgid "call" msgstr "call(呼叫)" @@ -4303,7 +4310,7 @@ msgstr "generator(產生器)" msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:761 ../../reference/datamodel.rst:3309 +#: ../../reference/datamodel.rst:761 ../../reference/datamodel.rst:3312 msgid "coroutine" msgstr "coroutine(協程)" @@ -4349,7 +4356,7 @@ msgstr "__dict__ (模組屬性)" #: ../../reference/datamodel.rst:938 ../../reference/datamodel.rst:956 #: ../../reference/datamodel.rst:1007 ../../reference/datamodel.rst:1609 -#: ../../reference/datamodel.rst:2483 +#: ../../reference/datamodel.rst:2486 msgid "class" msgstr "class(類別)" @@ -4359,7 +4366,7 @@ msgid "class instance" msgstr "class instance(類別實例)" #: ../../reference/datamodel.rst:938 ../../reference/datamodel.rst:1007 -#: ../../reference/datamodel.rst:2753 +#: ../../reference/datamodel.rst:2756 msgid "instance" msgstr "instance(實例)" @@ -4647,7 +4654,7 @@ msgstr "try" msgid "tb_next (traceback attribute)" msgstr "tb_next (traceback 屬性)" -#: ../../reference/datamodel.rst:1490 ../../reference/datamodel.rst:2831 +#: ../../reference/datamodel.rst:1490 ../../reference/datamodel.rst:2834 msgid "slice" msgstr "slice(切片)" @@ -4735,91 +4742,91 @@ msgstr "print" msgid "comparisons" msgstr "comparison(比較)" -#: ../../reference/datamodel.rst:1816 +#: ../../reference/datamodel.rst:1819 msgid "hash" msgstr "hash(雜湊)" -#: ../../reference/datamodel.rst:1897 +#: ../../reference/datamodel.rst:1900 msgid "__len__() (mapping object method)" msgstr "__len__() (對映物件方法)" -#: ../../reference/datamodel.rst:2001 +#: ../../reference/datamodel.rst:2004 msgid "__getattr__ (module attribute)" msgstr "__getattr__ (模組屬性)" -#: ../../reference/datamodel.rst:2001 +#: ../../reference/datamodel.rst:2004 msgid "__dir__ (module attribute)" msgstr "__dir__ (模組屬性)" -#: ../../reference/datamodel.rst:2001 +#: ../../reference/datamodel.rst:2004 msgid "__class__ (module attribute)" msgstr "__class__ (模組屬性)" -#: ../../reference/datamodel.rst:2372 +#: ../../reference/datamodel.rst:2375 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../reference/datamodel.rst:2372 +#: ../../reference/datamodel.rst:2375 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/datamodel.rst:2372 +#: ../../reference/datamodel.rst:2375 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/datamodel.rst:2436 +#: ../../reference/datamodel.rst:2439 msgid "metaclass hint" msgstr "metaclass hint(元類別提示)" -#: ../../reference/datamodel.rst:2459 +#: ../../reference/datamodel.rst:2462 msgid "__prepare__ (metaclass method)" msgstr "__prepare__ (元類別方法)" -#: ../../reference/datamodel.rst:2483 +#: ../../reference/datamodel.rst:2486 msgid "body" msgstr "body" -#: ../../reference/datamodel.rst:2503 +#: ../../reference/datamodel.rst:2506 msgid "__class__ (method cell)" msgstr "__class__ (方法 cell)" -#: ../../reference/datamodel.rst:2503 +#: ../../reference/datamodel.rst:2506 msgid "__classcell__ (class namespace entry)" msgstr "__classcell__ (類別命名空間項目)" -#: ../../reference/datamodel.rst:2801 +#: ../../reference/datamodel.rst:2804 msgid "__bool__() (object method)" msgstr "__bool__() (物件方法)" -#: ../../reference/datamodel.rst:2959 ../../reference/datamodel.rst:2994 +#: ../../reference/datamodel.rst:2962 ../../reference/datamodel.rst:2997 msgid "divmod" msgstr "divmod" -#: ../../reference/datamodel.rst:2959 ../../reference/datamodel.rst:2994 -#: ../../reference/datamodel.rst:3008 +#: ../../reference/datamodel.rst:2962 ../../reference/datamodel.rst:2997 +#: ../../reference/datamodel.rst:3011 msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:3057 +#: ../../reference/datamodel.rst:3060 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:3067 +#: ../../reference/datamodel.rst:3070 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:3067 +#: ../../reference/datamodel.rst:3070 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:3095 +#: ../../reference/datamodel.rst:3098 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:3122 +#: ../../reference/datamodel.rst:3125 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:3122 +#: ../../reference/datamodel.rst:3125 msgid "context manager" msgstr "context manager(情境管理器)" From 9add43e95250055ae3be292b9fc0db91bca9ded6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 5 Mar 2024 00:04:31 +0000 Subject: [PATCH 27/33] sync with cpython 8785eab3 --- library/http.server.po | 21 +- library/itertools.po | 19 +- tutorial/introduction.po | 64 +++-- using/configure.po | 596 +++++++++++++++++++-------------------- 4 files changed, 359 insertions(+), 341 deletions(-) diff --git a/library/http.server.po b/library/http.server.po index a1b88b1600..37163484b8 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-24 00:03+0000\n" +"POT-Creation-Date: 2024-03-05 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -619,18 +619,25 @@ msgid "" "the ``--cgi`` option::" msgstr "" -#: ../../library/http.server.rst:513 +#: ../../library/http.server.rst:512 +msgid "" +":class:`CGIHTTPRequestHandler` and the ``--cgi`` command line option are not " +"intended for use by untrusted clients and may be vulnerable to exploitation. " +"Always use within a secure environment." +msgstr "" + +#: ../../library/http.server.rst:519 msgid "Security Considerations" msgstr "" -#: ../../library/http.server.rst:517 +#: ../../library/http.server.rst:523 msgid "" ":class:`SimpleHTTPRequestHandler` will follow symbolic links when handling " "requests, this makes it possible for files outside of the specified " "directory to be served." msgstr "" -#: ../../library/http.server.rst:521 +#: ../../library/http.server.rst:527 msgid "" "Earlier versions of Python did not scrub control characters from the log " "messages emitted to stderr from ``python -m http.server`` or the default :" @@ -639,7 +646,7 @@ msgid "" "codes to your terminal." msgstr "" -#: ../../library/http.server.rst:527 +#: ../../library/http.server.rst:533 msgid "Control characters are scrubbed in stderr logs." msgstr "" @@ -667,10 +674,10 @@ msgstr "URL(統一資源定位器)" msgid "httpd" msgstr "httpd" -#: ../../library/http.server.rst:515 +#: ../../library/http.server.rst:521 msgid "http.server" msgstr "http.server" -#: ../../library/http.server.rst:515 +#: ../../library/http.server.rst:521 msgid "security" msgstr "security(安全)" diff --git a/library/itertools.po b/library/itertools.po index d7608b8d6c..6e197c4b74 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-01 00:03+0000\n" +"POT-Creation-Date: 2024-03-05 00:03+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-" @@ -210,12 +210,14 @@ msgstr ":func:`dropwhile`" #: ../../library/itertools.rst:59 ../../library/itertools.rst:60 #: ../../library/itertools.rst:65 -msgid "pred, seq" +#, fuzzy +msgid "predicate, seq" msgstr "pred, seq" #: ../../library/itertools.rst:59 -msgid "seq[n], seq[n+1], starting when pred fails" -msgstr "" +#, fuzzy +msgid "seq[n], seq[n+1], starting when predicate fails" +msgstr "seq[0], seq[1], until pred fails" #: ../../library/itertools.rst:59 msgid "``dropwhile(lambda x: x<5, [1,4,6,4,1]) --> 6 4 1``" @@ -226,7 +228,7 @@ msgid ":func:`filterfalse`" msgstr ":func:`filterfalse`" #: ../../library/itertools.rst:60 -msgid "elements of seq where pred(elem) is false" +msgid "elements of seq where predicate(elem) fails" msgstr "" #: ../../library/itertools.rst:60 @@ -294,7 +296,8 @@ msgid ":func:`takewhile`" msgstr ":func:`takewhile`" #: ../../library/itertools.rst:65 -msgid "seq[0], seq[1], until pred fails" +#, fuzzy +msgid "seq[0], seq[1], until predicate fails" msgstr "seq[0], seq[1], until pred fails" #: ../../library/itertools.rst:65 @@ -410,7 +413,7 @@ msgid "``AA AB AC AD BB BC BD CC CD DD``" msgstr "``AA AB AC AD BB BC BD CC CD DD``" #: ../../library/itertools.rst:94 -msgid "Itertool functions" +msgid "Itertool Functions" msgstr "" #: ../../library/itertools.rst:96 @@ -896,6 +899,6 @@ msgid "" "term:`generator`\\s which incur interpreter overhead." msgstr "" -#: ../../library/itertools.rst:989 +#: ../../library/itertools.rst:982 msgid "The following recipes have a more mathematical flavor:" msgstr "" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 75ee915511..4fc67638cb 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-22 12:58+0000\n" +"POT-Creation-Date: 2024-03-05 00:03+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -520,24 +520,13 @@ msgstr "" "::" #: ../../tutorial/introduction.rst:408 -msgid "" -"All slice operations return a new list containing the requested elements. " -"This means that the following slice returns a :ref:`shallow copy " -"` of the list::" -msgstr "" -"所有切片操作都會回傳一個新的 list ,包含要求的元素。這意謂著以下這個切片回傳" -"了原本 list 的 :ref:`淺複製 ` :\n" -"\n" -"::" - -#: ../../tutorial/introduction.rst:415 msgid "Lists also support operations like concatenation::" msgstr "" "List 對支援如接合 (concatenation) 等操作:\n" "\n" "::" -#: ../../tutorial/introduction.rst:420 +#: ../../tutorial/introduction.rst:413 msgid "" "Unlike strings, which are :term:`immutable`, lists are a :term:`mutable` " "type, i.e. it is possible to change their content::" @@ -547,7 +536,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:430 +#: ../../tutorial/introduction.rst:423 msgid "" "You can also add new items at the end of the list, by using the :meth:`!list." "append` *method* (we will see more about methods later)::" @@ -557,7 +546,26 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:438 +#: ../../tutorial/introduction.rst:431 +msgid "" +"Simple assignment in Python never copies data. When you assign a list to a " +"variable, the variable refers to the *existing list*. Any changes you make " +"to the list through one variable will be seen through all other variables " +"that refer to it.::" +msgstr "" + +#: ../../tutorial/introduction.rst:444 +msgid "" +"All slice operations return a new list containing the requested elements. " +"This means that the following slice returns a :ref:`shallow copy " +"` of the list::" +msgstr "" +"所有切片操作都會回傳一個新的 list ,包含要求的元素。這意謂著以下這個切片回傳" +"了原本 list 的 :ref:`淺複製 ` :\n" +"\n" +"::" + +#: ../../tutorial/introduction.rst:455 msgid "" "Assignment to slices is also possible, and this can even change the size of " "the list or clear it entirely::" @@ -566,14 +574,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:457 +#: ../../tutorial/introduction.rst:474 msgid "The built-in function :func:`len` also applies to lists::" msgstr "" "內建的函式 :func:`len` 亦可以作用在 list 上:\n" "\n" "::" -#: ../../tutorial/introduction.rst:463 +#: ../../tutorial/introduction.rst:480 msgid "" "It is possible to nest lists (create lists containing other lists), for " "example::" @@ -582,11 +590,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:479 +#: ../../tutorial/introduction.rst:496 msgid "First Steps Towards Programming" msgstr "初探程式設計的前幾步" -#: ../../tutorial/introduction.rst:481 +#: ../../tutorial/introduction.rst:498 msgid "" "Of course, we can use Python for more complicated tasks than adding two and " "two together. For instance, we can write an initial sub-sequence of the " @@ -599,11 +607,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:501 +#: ../../tutorial/introduction.rst:518 msgid "This example introduces several new features." msgstr "這例子引入了許多新的特性。" -#: ../../tutorial/introduction.rst:503 +#: ../../tutorial/introduction.rst:520 msgid "" "The first line contains a *multiple assignment*: the variables ``a`` and " "``b`` simultaneously get the new values 0 and 1. On the last line this is " @@ -615,7 +623,7 @@ msgstr "" "同樣的賦值再被使用了一次,示範了等號的右項運算 (expression) 會先被計算 " "(evaluate),賦值再發生。右項的運算式由左至右依序被計算。" -#: ../../tutorial/introduction.rst:509 +#: ../../tutorial/introduction.rst:526 msgid "" "The :keyword:`while` loop executes as long as the condition (here: ``a < " "10``) remains true. In Python, like in C, any non-zero integer value is " @@ -633,7 +641,7 @@ msgstr "" "使用如同 C 語言一樣的符號:``<``\\ (小於)、``>``\\ (大於)、``==``\\ (等" "於)、``<=``\\ (小於等於)、``>=``\\ (大於等於)以及 ``!=``\\ (不等於)。" -#: ../../tutorial/introduction.rst:518 +#: ../../tutorial/introduction.rst:535 msgid "" "The *body* of the loop is *indented*: indentation is Python's way of " "grouping statements. At the interactive prompt, you have to type a tab or " @@ -651,7 +659,7 @@ msgstr "" "法剖析器無法判斷你何時輸入複合陳述的最後一行)。注意在一個縮排段落內的縮排方" "式與數量必須維持一致。" -#: ../../tutorial/introduction.rst:527 +#: ../../tutorial/introduction.rst:544 msgid "" "The :func:`print` function writes the value of the argument(s) it is given. " "It differs from just writing the expression you want to write (as we did " @@ -667,7 +675,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:538 +#: ../../tutorial/introduction.rst:555 msgid "" "The keyword argument *end* can be used to avoid the newline after the " "output, or end the output with a different string::" @@ -677,11 +685,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:550 +#: ../../tutorial/introduction.rst:567 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/introduction.rst:551 +#: ../../tutorial/introduction.rst:568 msgid "" "Since ``**`` has higher precedence than ``-``, ``-3**2`` will be interpreted " "as ``-(3**2)`` and thus result in ``-9``. To avoid this and get ``9``, you " @@ -690,7 +698,7 @@ msgstr "" "因為 ``**`` 擁有較 ``-`` 高的優先次序,``-3**2`` 會被解釋為 ``-(3**2)`` 並得" "到 ``-9``。如果要避免這樣的優先順序以得到 ``9``,你可以使用 ``(-3)**2``。" -#: ../../tutorial/introduction.rst:555 +#: ../../tutorial/introduction.rst:572 msgid "" "Unlike other languages, special characters such as ``\\n`` have the same " "meaning with both single (``'...'``) and double (``\"...\"``) quotes. The " diff --git a/using/configure.po b/using/configure.po index e3a1689fc3..54a0ba82a4 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-17 00:03+0000\n" +"POT-Creation-Date: 2024-03-05 00:03+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-" @@ -22,91 +22,91 @@ msgstr "" msgid "Configure Python" msgstr "配置 Python" -#: ../../using/configure.rst:6 +#: ../../using/configure.rst:8 msgid "Build Requirements" msgstr "" -#: ../../using/configure.rst:8 +#: ../../using/configure.rst:10 msgid "Features required to build CPython:" msgstr "" -#: ../../using/configure.rst:10 +#: ../../using/configure.rst:12 msgid "" "A `C11 `_ compiler. `Optional C11 " "features `_ are not required." msgstr "" -#: ../../using/configure.rst:15 +#: ../../using/configure.rst:17 msgid "" "Support for `IEEE 754 `_ floating " "point numbers and `floating point Not-a-Number (NaN) `_." msgstr "" -#: ../../using/configure.rst:19 +#: ../../using/configure.rst:21 msgid "Support for threads." msgstr "thread 的支援。" -#: ../../using/configure.rst:21 +#: ../../using/configure.rst:23 msgid "OpenSSL 1.1.1 or newer for the :mod:`ssl` and :mod:`hashlib` modules." msgstr "" -#: ../../using/configure.rst:23 +#: ../../using/configure.rst:25 msgid "On Windows, Microsoft Visual Studio 2017 or later is required." msgstr "在 Windows 上需要 Microsoft Visual Studio 2017 或更新版本。" -#: ../../using/configure.rst:25 +#: ../../using/configure.rst:27 +msgid "On Windows, Visual Studio 2015 or later is required." +msgstr "在 Windows 上需要 Visual Studio 2015 或更新版本。" + +#: ../../using/configure.rst:30 msgid "" -"C11 compiler, IEEE 754 and NaN support are now required. On Windows, Visual " -"Studio 2017 or later is required." +"Selected C99 features are now required, like ```` and ``static " +"inline`` functions." msgstr "" -#: ../../using/configure.rst:29 -msgid "OpenSSL 1.1.1 is now required." -msgstr "OpenSSL 1.1.1 現在是必要的。" - -#: ../../using/configure.rst:32 +#: ../../using/configure.rst:34 msgid "Thread support and OpenSSL 1.0.2 are now required." msgstr "對執行緒與 OpenSSL 1.0.2 的支援現在是必要的。" -#: ../../using/configure.rst:35 +#: ../../using/configure.rst:37 +msgid "OpenSSL 1.1.1 is now required." +msgstr "OpenSSL 1.1.1 現在是必要的。" + +#: ../../using/configure.rst:40 msgid "" -"Selected C99 features are now required, like ```` and ``static " -"inline`` functions." +"C11 compiler, IEEE 754 and NaN support are now required. On Windows, Visual " +"Studio 2017 or later is required." msgstr "" -#: ../../using/configure.rst:39 -msgid "On Windows, Visual Studio 2015 or later is required." -msgstr "在 Windows 上需要 Visual Studio 2015 或更新版本。" - -#: ../../using/configure.rst:42 +#: ../../using/configure.rst:44 msgid "" "See also :pep:`7` \"Style Guide for C Code\" and :pep:`11` \"CPython " "platform support\"." msgstr "" -#: ../../using/configure.rst:47 +#: ../../using/configure.rst:49 msgid "Generated files" msgstr "產生的檔案" -#: ../../using/configure.rst:49 +#: ../../using/configure.rst:51 msgid "" "To reduce build dependencies, Python source code contains multiple generated " "files. Commands to regenerate all generated files::" msgstr "" -#: ../../using/configure.rst:57 +#: ../../using/configure.rst:59 msgid "" "The ``Makefile.pre.in`` file documents generated files, their inputs, and " "tools used to regenerate them. Search for ``regen-*`` make targets." msgstr "" -#: ../../using/configure.rst:61 +#: ../../using/configure.rst:63 msgid "configure script" msgstr "設定腳本" -#: ../../using/configure.rst:63 +#: ../../using/configure.rst:65 msgid "" "The ``make regen-configure`` command regenerates the ``aclocal.m4`` file and " "the ``configure`` script using the ``Tools/build/regen-configure.sh`` shell " @@ -114,41 +114,41 @@ msgid "" "have a reproducible output." msgstr "" -#: ../../using/configure.rst:68 +#: ../../using/configure.rst:70 msgid "The container is optional, the following command can be run locally::" msgstr "" -#: ../../using/configure.rst:72 +#: ../../using/configure.rst:74 msgid "" "The generated files can change depending on the exact ``autoconf-archive``, " "``aclocal`` and ``pkg-config`` versions." msgstr "" -#: ../../using/configure.rst:79 +#: ../../using/configure.rst:81 msgid "Configure Options" msgstr "設定選項" -#: ../../using/configure.rst:81 +#: ../../using/configure.rst:83 msgid "List all ``./configure`` script options using::" msgstr "" -#: ../../using/configure.rst:85 +#: ../../using/configure.rst:87 msgid "" "See also the :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution." msgstr "請見 Python 原始碼發行版中的 :file:`Misc/SpecialBuilds.txt`。" -#: ../../using/configure.rst:88 +#: ../../using/configure.rst:90 msgid "General Options" msgstr "一般選項" -#: ../../using/configure.rst:92 +#: ../../using/configure.rst:94 msgid "" "Support loadable extensions in the :mod:`!_sqlite` extension module (default " "is no) of the :mod:`sqlite3` module." msgstr "" -#: ../../using/configure.rst:95 +#: ../../using/configure.rst:97 msgid "" "See the :meth:`sqlite3.Connection.enable_load_extension` method of the :mod:" "`sqlite3` module." @@ -156,33 +156,33 @@ msgstr "" "請見 :mod:`sqlite3` 模組的 :meth:`sqlite3.Connection.enable_load_extension` " "方法。" -#: ../../using/configure.rst:102 +#: ../../using/configure.rst:104 msgid "" "Disable IPv6 support (enabled by default if supported), see the :mod:" "`socket` module." msgstr "停用 IPv6 支援(如果支援的話預設是啟用的),請見 :mod:`socket` 模組。" -#: ../../using/configure.rst:107 +#: ../../using/configure.rst:109 msgid "Define the size in bits of Python :class:`int` digits: 15 or 30 bits." msgstr "" -#: ../../using/configure.rst:109 +#: ../../using/configure.rst:111 msgid "By default, the digit size is 30." msgstr "" -#: ../../using/configure.rst:111 +#: ../../using/configure.rst:113 msgid "Define the ``PYLONG_BITS_IN_DIGIT`` to ``15`` or ``30``." msgstr "將 ``PYLONG_BITS_IN_DIGIT`` 定義為 ``15`` 或 ``30``。" -#: ../../using/configure.rst:113 +#: ../../using/configure.rst:115 msgid "See :data:`sys.int_info.bits_per_digit `." msgstr "參閱 :data:`sys.int_info.bits_per_digit `。" -#: ../../using/configure.rst:117 +#: ../../using/configure.rst:119 msgid "Set the Python executable suffix to *SUFFIX*." msgstr "將 Python 執行檔的後綴設定為 *SUFFIX*。" -#: ../../using/configure.rst:119 +#: ../../using/configure.rst:121 msgid "" "The default suffix is ``.exe`` on Windows and macOS (``python.exe`` " "executable), ``.js`` on Emscripten node, ``.html`` on Emscripten browser, ``." @@ -193,20 +193,20 @@ msgstr "" "Emscripten node 上為 ``.js``、在 Emscripten 瀏覽器為 ``.html``、在 WASI 上為 " "``.wasm``,以及在其他平台為空字串(``python`` 執行檔)。" -#: ../../using/configure.rst:124 +#: ../../using/configure.rst:126 msgid "" "The default suffix on WASM platform is one of ``.js``, ``.html`` or ``." "wasm``." msgstr "在 WASM 平台上預設的後綴是 ``.js``、``.html`` 或 ``.wasm`` 中的一個。" -#: ../../using/configure.rst:130 +#: ../../using/configure.rst:132 msgid "" "Select the default time zone search path for :const:`zoneinfo.TZPATH`. See " "the :ref:`Compile-time configuration ` of " "the :mod:`zoneinfo` module." msgstr "" -#: ../../using/configure.rst:134 +#: ../../using/configure.rst:136 msgid "" "Default: ``/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/" "etc/zoneinfo``." @@ -214,76 +214,76 @@ msgstr "" "預設值:``/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/" "zoneinfo``。" -#: ../../using/configure.rst:136 +#: ../../using/configure.rst:138 msgid "See :data:`os.pathsep` path separator." msgstr "請見 :data:`os.pathsep` 路徑分隔符號。" -#: ../../using/configure.rst:142 +#: ../../using/configure.rst:144 msgid "" "Build the ``_decimal`` extension module using a thread-local context rather " "than a coroutine-local context (default), see the :mod:`decimal` module." msgstr "" -#: ../../using/configure.rst:145 +#: ../../using/configure.rst:147 msgid "See :const:`decimal.HAVE_CONTEXTVAR` and the :mod:`contextvars` module." msgstr "請見 :const:`decimal.HAVE_CONTEXTVAR` 與 :mod:`contextvars` 模組。" -#: ../../using/configure.rst:151 +#: ../../using/configure.rst:153 msgid "Override order to check db backends for the :mod:`dbm` module" msgstr "" -#: ../../using/configure.rst:153 +#: ../../using/configure.rst:155 msgid "" "A valid value is a colon (``:``) separated string with the backend names:" msgstr "" -#: ../../using/configure.rst:155 +#: ../../using/configure.rst:157 msgid "``ndbm``;" msgstr "``ndbm``;" -#: ../../using/configure.rst:156 +#: ../../using/configure.rst:158 msgid "``gdbm``;" msgstr "``gdbm``;" -#: ../../using/configure.rst:157 +#: ../../using/configure.rst:159 msgid "``bdb``." msgstr "``bdb``." -#: ../../using/configure.rst:161 +#: ../../using/configure.rst:163 msgid "Disable C locale coercion to a UTF-8 based locale (enabled by default)." msgstr "" -#: ../../using/configure.rst:163 +#: ../../using/configure.rst:165 msgid "Don't define the ``PY_COERCE_C_LOCALE`` macro." msgstr "不要定義 ``PY_COERCE_C_LOCALE`` 巨集。" -#: ../../using/configure.rst:165 +#: ../../using/configure.rst:167 msgid "See :envvar:`PYTHONCOERCECLOCALE` and the :pep:`538`." msgstr "請見 :envvar:`PYTHONCOERCECLOCALE` 與 :pep:`538`。" -#: ../../using/configure.rst:169 +#: ../../using/configure.rst:171 msgid "Disable all freelists except the empty tuple singleton." msgstr "" -#: ../../using/configure.rst:175 +#: ../../using/configure.rst:177 msgid "Python library directory name (default is ``lib``)." msgstr "Python 函式庫目錄名稱(預設為 ``lib`` )。" -#: ../../using/configure.rst:177 +#: ../../using/configure.rst:179 msgid "Fedora and SuSE use ``lib64`` on 64-bit platforms." msgstr "Fedora 和 SuSE 在 64 位元平台上使用 ``lib64``。" -#: ../../using/configure.rst:179 +#: ../../using/configure.rst:181 msgid "See :data:`sys.platlibdir`." msgstr "參閱 :data:`sys.platlibdir`。" -#: ../../using/configure.rst:185 +#: ../../using/configure.rst:187 msgid "" "Directory of wheel packages used by the :mod:`ensurepip` module (none by " "default)." msgstr "" -#: ../../using/configure.rst:188 +#: ../../using/configure.rst:190 msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" @@ -291,110 +291,110 @@ msgid "" "_bundled` package." msgstr "" -#: ../../using/configure.rst:197 +#: ../../using/configure.rst:199 msgid "" "Whether configure should use :program:`pkg-config` to detect build " "dependencies." msgstr "" -#: ../../using/configure.rst:200 +#: ../../using/configure.rst:202 msgid "``check`` (default): :program:`pkg-config` is optional" msgstr "``check`` (預設)::program:`pkg-config` 是可選的" -#: ../../using/configure.rst:201 +#: ../../using/configure.rst:203 msgid "``yes``: :program:`pkg-config` is mandatory" msgstr "``yes``::program:`pkg-config` 是必要的" -#: ../../using/configure.rst:202 +#: ../../using/configure.rst:204 msgid "``no``: configure does not use :program:`pkg-config` even when present" msgstr "``no``:即使存在也不使用 :program:`pkg-config` 來配置" -#: ../../using/configure.rst:208 +#: ../../using/configure.rst:210 msgid "Turn on internal statistics gathering." msgstr "" -#: ../../using/configure.rst:210 +#: ../../using/configure.rst:212 msgid "" "The statistics will be dumped to a arbitrary (probably unique) file in ``/" "tmp/py_stats/``, or ``C:\\temp\\py_stats\\`` on Windows. If that directory " "does not exist, results will be printed on stdout." msgstr "" -#: ../../using/configure.rst:214 +#: ../../using/configure.rst:216 msgid "Use ``Tools/scripts/summarize_stats.py`` to read the stats." msgstr "使用 ``Tools/scripts/summarize_stats.py`` 來讀取統計資料。" -#: ../../using/configure.rst:219 +#: ../../using/configure.rst:221 msgid "WebAssembly Options" msgstr "WebAssembly 選項" -#: ../../using/configure.rst:223 +#: ../../using/configure.rst:225 msgid "Set build flavor for ``wasm32-emscripten``." msgstr "" -#: ../../using/configure.rst:225 +#: ../../using/configure.rst:227 msgid "``browser`` (default): preload minimal stdlib, default MEMFS." msgstr "" -#: ../../using/configure.rst:226 +#: ../../using/configure.rst:228 msgid "``node``: NODERAWFS and pthread support." msgstr "``node``:對 NODERAWFS 和 pthread 支援。" -#: ../../using/configure.rst:232 +#: ../../using/configure.rst:234 msgid "Turn on dynamic linking support for WASM." msgstr "" -#: ../../using/configure.rst:234 +#: ../../using/configure.rst:236 msgid "" "Dynamic linking enables ``dlopen``. File size of the executable increases " "due to limited dead code elimination and additional features." msgstr "" -#: ../../using/configure.rst:241 +#: ../../using/configure.rst:243 msgid "Turn on pthreads support for WASM." msgstr "" -#: ../../using/configure.rst:247 +#: ../../using/configure.rst:249 msgid "Install Options" msgstr "安裝選項" -#: ../../using/configure.rst:251 +#: ../../using/configure.rst:253 msgid "" "Install architecture-independent files in PREFIX. On Unix, it defaults to :" "file:`/usr/local`." msgstr "" -#: ../../using/configure.rst:254 +#: ../../using/configure.rst:256 msgid "This value can be retrieved at runtime using :data:`sys.prefix`." msgstr "這個值可以在 runtime 使用 :data:`sys.prefix` 取得。" -#: ../../using/configure.rst:256 +#: ../../using/configure.rst:258 msgid "" "As an example, one can use ``--prefix=\"$HOME/.local/\"`` to install a " "Python in its home directory." msgstr "" -#: ../../using/configure.rst:261 +#: ../../using/configure.rst:263 msgid "" "Install architecture-dependent files in EPREFIX, defaults to :option:`--" "prefix`." msgstr "" -#: ../../using/configure.rst:263 +#: ../../using/configure.rst:265 msgid "This value can be retrieved at runtime using :data:`sys.exec_prefix`." msgstr "這個值可以在 runtime 使用 :data:`sys.exec_prefix` 取得" -#: ../../using/configure.rst:267 +#: ../../using/configure.rst:269 msgid "" "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:274 +#: ../../using/configure.rst:276 msgid "Select the :mod:`ensurepip` command run on Python installation:" msgstr "選擇在 Python 安裝時執行的 :mod:`ensurepip` 命令:" -#: ../../using/configure.rst:276 +#: ../../using/configure.rst:278 msgid "" "``upgrade`` (default): run ``python -m ensurepip --altinstall --upgrade`` " "command." @@ -402,92 +402,92 @@ msgstr "" "``upgrade`` (預設):執行 ``python -m ensurepip --altinstall --upgrade`` 命" "令。" -#: ../../using/configure.rst:278 +#: ../../using/configure.rst:280 msgid "``install``: run ``python -m ensurepip --altinstall`` command;" msgstr "``install``:執行 ``python -m ensurepip --altinstall`` 命令;" -#: ../../using/configure.rst:279 +#: ../../using/configure.rst:281 msgid "``no``: don't run ensurepip;" msgstr "``no``:不要執行 ensurepip;" -#: ../../using/configure.rst:285 +#: ../../using/configure.rst:287 msgid "Performance options" msgstr "" -#: ../../using/configure.rst:287 +#: ../../using/configure.rst:289 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:293 +#: ../../using/configure.rst:295 msgid "" "Enable Profile Guided Optimization (PGO) using :envvar:`PROFILE_TASK` " "(disabled by default)." msgstr "" -#: ../../using/configure.rst:296 +#: ../../using/configure.rst:298 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:299 +#: ../../using/configure.rst:301 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:305 +#: ../../using/configure.rst:307 msgid "Use ``-fno-semantic-interposition`` on GCC." msgstr "在 GCC 上使用 ``-fno-semantic-interposition``。" -#: ../../using/configure.rst:310 +#: ../../using/configure.rst:312 msgid "" "Environment variable used in the Makefile: Python command line arguments for " "the PGO generation task." msgstr "" -#: ../../using/configure.rst:313 +#: ../../using/configure.rst:315 msgid "Default: ``-m test --pgo --timeout=$(TESTTIMEOUT)``." msgstr "預設值:``-m test --pgo --timeout=$(TESTTIMEOUT)``。" -#: ../../using/configure.rst:319 +#: ../../using/configure.rst:321 msgid "Enable Link Time Optimization (LTO) in any build (disabled by default)." msgstr "" -#: ../../using/configure.rst:321 +#: ../../using/configure.rst:323 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:326 +#: ../../using/configure.rst:328 msgid "To use ThinLTO feature, use ``--with-lto=thin`` on Clang." msgstr "" -#: ../../using/configure.rst:329 +#: ../../using/configure.rst:331 msgid "" "Use ThinLTO as the default optimization policy on Clang if the compiler " "accepts the flag." msgstr "" -#: ../../using/configure.rst:334 +#: ../../using/configure.rst:336 msgid "" "Enable usage of the `BOLT post-link binary optimizer `_ (disabled by default)." msgstr "" -#: ../../using/configure.rst:338 +#: ../../using/configure.rst:340 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:342 +#: ../../using/configure.rst:344 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 " @@ -498,7 +498,7 @@ msgid "" "encouraged." msgstr "" -#: ../../using/configure.rst:350 +#: ../../using/configure.rst:352 msgid "" "The :envvar:`!BOLT_INSTRUMENT_FLAGS` and :envvar:`!BOLT_APPLY_FLAGS` :" "program:`configure` variables can be defined to override the default set of " @@ -506,101 +506,101 @@ msgid "" "binaries, respectively." msgstr "" -#: ../../using/configure.rst:359 +#: ../../using/configure.rst:361 msgid "" "Enable computed gotos in evaluation loop (enabled by default on supported " "compilers)." msgstr "" -#: ../../using/configure.rst:364 +#: ../../using/configure.rst:366 msgid "" "Disable the specialized Python memory allocator :ref:`pymalloc ` " "(enabled by default)." msgstr "" -#: ../../using/configure.rst:367 +#: ../../using/configure.rst:369 msgid "See also :envvar:`PYTHONMALLOC` environment variable." msgstr "另請參閱 :envvar:`PYTHONMALLOC` 環境變數。" -#: ../../using/configure.rst:371 +#: ../../using/configure.rst:373 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:374 +#: ../../using/configure.rst:376 msgid "Don't define the ``WITH_DOC_STRINGS`` macro." msgstr "不要定義 ``WITH_DOC_STRINGS`` 巨集。" -#: ../../using/configure.rst:376 +#: ../../using/configure.rst:378 msgid "See the ``PyDoc_STRVAR()`` macro." msgstr "請見 ``PyDoc_STRVAR()`` 巨集。" -#: ../../using/configure.rst:380 +#: ../../using/configure.rst:382 msgid "Enable C-level code profiling with ``gprof`` (disabled by default)." msgstr "" -#: ../../using/configure.rst:384 +#: ../../using/configure.rst:386 msgid "" "Add ``-fstrict-overflow`` to the C compiler flags (by default we add ``-fno-" "strict-overflow`` instead)." msgstr "" -#: ../../using/configure.rst:391 +#: ../../using/configure.rst:393 msgid "Python Debug Build" msgstr "" -#: ../../using/configure.rst:393 +#: ../../using/configure.rst:395 msgid "" "A debug build is Python built with the :option:`--with-pydebug` configure " "option." msgstr "" -#: ../../using/configure.rst:396 +#: ../../using/configure.rst:398 msgid "Effects of a debug build:" msgstr "" -#: ../../using/configure.rst:398 +#: ../../using/configure.rst:400 msgid "" "Display all warnings by default: the list of default warning filters is " "empty in the :mod:`warnings` module." msgstr "" -#: ../../using/configure.rst:400 +#: ../../using/configure.rst:402 msgid "Add ``d`` to :data:`sys.abiflags`." msgstr "新增 ``d`` 到 :data:`sys.abiflags`。" -#: ../../using/configure.rst:401 +#: ../../using/configure.rst:403 msgid "Add :func:`!sys.gettotalrefcount` function." msgstr "新增 :func:`!sys.gettotalrefcount` 函式。" -#: ../../using/configure.rst:402 +#: ../../using/configure.rst:404 msgid "Add :option:`-X showrefcount <-X>` command line option." msgstr "新增 :option:`-X showrefcount <-X>` 命令列選項。" -#: ../../using/configure.rst:403 +#: ../../using/configure.rst:405 msgid "" "Add :option:`-d` command line option and :envvar:`PYTHONDEBUG` environment " "variable to debug the parser." msgstr "" -#: ../../using/configure.rst:405 +#: ../../using/configure.rst:407 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:407 +#: ../../using/configure.rst:409 msgid "" "Install :ref:`debug hooks on memory allocators ` " "to detect buffer overflow and other memory errors." msgstr "" -#: ../../using/configure.rst:409 +#: ../../using/configure.rst:411 msgid "Define ``Py_DEBUG`` and ``Py_REF_DEBUG`` macros." msgstr "定義 ``Py_DEBUG`` 和 ``Py_REF_DEBUG`` 巨集。" -#: ../../using/configure.rst:410 +#: ../../using/configure.rst:412 msgid "" "Add runtime checks: code surrounded by ``#ifdef Py_DEBUG`` and ``#endif``. " "Enable ``assert(...)`` and ``_PyObject_ASSERT(...)`` assertions: don't set " @@ -608,45 +608,45 @@ msgid "" "option). Main runtime checks:" msgstr "" -#: ../../using/configure.rst:415 +#: ../../using/configure.rst:417 msgid "Add sanity checks on the function arguments." msgstr "" -#: ../../using/configure.rst:416 +#: ../../using/configure.rst:418 msgid "" "Unicode and int objects are created with their memory filled with a pattern " "to detect usage of uninitialized objects." msgstr "" -#: ../../using/configure.rst:418 +#: ../../using/configure.rst:420 msgid "" "Ensure that functions which can clear or replace the current exception are " "not called with an exception raised." msgstr "" -#: ../../using/configure.rst:420 +#: ../../using/configure.rst:422 msgid "Check that deallocator functions don't change the current exception." msgstr "" -#: ../../using/configure.rst:421 +#: ../../using/configure.rst:423 msgid "" "The garbage collector (:func:`gc.collect` function) runs some basic checks " "on objects consistency." msgstr "" -#: ../../using/configure.rst:423 +#: ../../using/configure.rst:425 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:426 +#: ../../using/configure.rst:428 msgid "" "See also the :ref:`Python Development Mode ` and the :option:`--" "with-trace-refs` configure option." msgstr "" -#: ../../using/configure.rst:429 +#: ../../using/configure.rst:431 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 :" @@ -654,320 +654,320 @@ msgid "" "incompatibility." msgstr "" -#: ../../using/configure.rst:437 +#: ../../using/configure.rst:439 msgid "Debug options" msgstr "" -#: ../../using/configure.rst:441 +#: ../../using/configure.rst:443 msgid "" ":ref:`Build Python in debug mode `: define the ``Py_DEBUG`` " "macro (disabled by default)." msgstr "" -#: ../../using/configure.rst:446 +#: ../../using/configure.rst:448 msgid "Enable tracing references for debugging purpose (disabled by default)." msgstr "" -#: ../../using/configure.rst:448 +#: ../../using/configure.rst:450 msgid "Effects:" msgstr "" -#: ../../using/configure.rst:450 +#: ../../using/configure.rst:452 msgid "Define the ``Py_TRACE_REFS`` macro." msgstr "定義 ``Py_TRACE_REFS`` 巨集。" -#: ../../using/configure.rst:451 +#: ../../using/configure.rst:453 msgid "Add :func:`!sys.getobjects` function." msgstr "新增 :func:`!sys.getobjects` 函式。" -#: ../../using/configure.rst:452 +#: ../../using/configure.rst:454 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." msgstr "新增 :envvar:`PYTHONDUMPREFS` 環境變數。" -#: ../../using/configure.rst:454 +#: ../../using/configure.rst:456 msgid "" "This build is not ABI compatible with release build (default build) or debug " "build (``Py_DEBUG`` and ``Py_REF_DEBUG`` macros)." msgstr "" -#: ../../using/configure.rst:461 +#: ../../using/configure.rst:463 msgid "" "Build with C assertions enabled (default is no): ``assert(...);`` and " "``_PyObject_ASSERT(...);``." msgstr "" -#: ../../using/configure.rst:464 +#: ../../using/configure.rst:466 msgid "" "If set, the ``NDEBUG`` macro is not defined in the :envvar:`OPT` compiler " "variable." msgstr "" -#: ../../using/configure.rst:467 +#: ../../using/configure.rst:469 msgid "" "See also the :option:`--with-pydebug` option (:ref:`debug build `) which also enables assertions." msgstr "" -#: ../../using/configure.rst:474 +#: ../../using/configure.rst:476 msgid "Enable Valgrind support (default is no)." msgstr "啟用 Valgrind 支援(預設不啟用)。" -#: ../../using/configure.rst:478 +#: ../../using/configure.rst:480 msgid "Enable DTrace support (default is no)." msgstr "啟用 DTrace 支援(預設不啟用)。" -#: ../../using/configure.rst:480 +#: ../../using/configure.rst:482 msgid "" "See :ref:`Instrumenting CPython with DTrace and SystemTap `." msgstr "" -#: ../../using/configure.rst:487 +#: ../../using/configure.rst:489 msgid "" "Enable AddressSanitizer memory error detector, ``asan`` (default is no)." msgstr "" -#: ../../using/configure.rst:493 +#: ../../using/configure.rst:495 msgid "" "Enable MemorySanitizer allocation error detector, ``msan`` (default is no)." msgstr "" -#: ../../using/configure.rst:499 +#: ../../using/configure.rst:501 msgid "" "Enable UndefinedBehaviorSanitizer undefined behaviour detector, ``ubsan`` " "(default is no)." msgstr "" -#: ../../using/configure.rst:506 +#: ../../using/configure.rst:508 msgid "Linker options" msgstr "" -#: ../../using/configure.rst:510 +#: ../../using/configure.rst:512 msgid "Enable building a shared Python library: ``libpython`` (default is no)." msgstr "" -#: ../../using/configure.rst:514 +#: ../../using/configure.rst:516 msgid "" "Do not build ``libpythonMAJOR.MINOR.a`` and do not install ``python.o`` " "(built and enabled by default)." msgstr "" -#: ../../using/configure.rst:521 +#: ../../using/configure.rst:523 msgid "Libraries options" msgstr "函式庫選項" -#: ../../using/configure.rst:525 +#: ../../using/configure.rst:527 msgid "Link against additional libraries (default is no)." msgstr "" -#: ../../using/configure.rst:529 +#: ../../using/configure.rst:531 msgid "" "Build the :mod:`!pyexpat` module using an installed ``expat`` library " "(default is no)." msgstr "" -#: ../../using/configure.rst:534 +#: ../../using/configure.rst:536 msgid "" "Build the ``_decimal`` extension module using an installed ``mpdec`` " "library, see the :mod:`decimal` module (default is no)." msgstr "" -#: ../../using/configure.rst:541 +#: ../../using/configure.rst:543 msgid "Use ``editline`` library for backend of the :mod:`readline` module." msgstr "" -#: ../../using/configure.rst:543 +#: ../../using/configure.rst:545 msgid "Define the ``WITH_EDITLINE`` macro." msgstr "定義 ``WITH_EDITLINE`` 巨集。" -#: ../../using/configure.rst:549 +#: ../../using/configure.rst:551 msgid "Don't build the :mod:`readline` module (built by default)." msgstr "" -#: ../../using/configure.rst:551 +#: ../../using/configure.rst:553 msgid "Don't define the ``HAVE_LIBREADLINE`` macro." msgstr "不要定義 ``HAVE_LIBREADLINE`` 巨集。" -#: ../../using/configure.rst:557 +#: ../../using/configure.rst:559 msgid "" "Override ``libm`` math library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:561 +#: ../../using/configure.rst:563 msgid "Override ``libc`` C library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:565 +#: ../../using/configure.rst:567 msgid "Root of the OpenSSL directory." msgstr "" -#: ../../using/configure.rst:571 +#: ../../using/configure.rst:573 msgid "Set runtime library directory (rpath) for OpenSSL libraries:" msgstr "" -#: ../../using/configure.rst:573 +#: ../../using/configure.rst:575 msgid "``no`` (default): don't set rpath;" msgstr "" -#: ../../using/configure.rst:574 +#: ../../using/configure.rst:576 msgid "" "``auto``: auto-detect rpath from :option:`--with-openssl` and ``pkg-config``;" msgstr "" -#: ../../using/configure.rst:576 +#: ../../using/configure.rst:578 msgid "*DIR*: set an explicit rpath." msgstr "" -#: ../../using/configure.rst:582 +#: ../../using/configure.rst:584 msgid "Security Options" msgstr "" -#: ../../using/configure.rst:586 +#: ../../using/configure.rst:588 msgid "Select hash algorithm for use in ``Python/pyhash.c``:" msgstr "" -#: ../../using/configure.rst:588 +#: ../../using/configure.rst:590 msgid "``siphash13`` (default);" msgstr "" -#: ../../using/configure.rst:589 +#: ../../using/configure.rst:591 msgid "``siphash24``;" msgstr "``siphash24``;" -#: ../../using/configure.rst:590 +#: ../../using/configure.rst:592 msgid "``fnv``." msgstr "``fnv``。" -#: ../../using/configure.rst:594 +#: ../../using/configure.rst:596 msgid "``siphash13`` is added and it is the new default." msgstr "" -#: ../../using/configure.rst:599 +#: ../../using/configure.rst:601 msgid "Built-in hash modules:" msgstr "內建雜湊模組:" -#: ../../using/configure.rst:601 +#: ../../using/configure.rst:603 msgid "``md5``;" msgstr "``md5``;" -#: ../../using/configure.rst:602 +#: ../../using/configure.rst:604 msgid "``sha1``;" msgstr "``sha1``;" -#: ../../using/configure.rst:603 +#: ../../using/configure.rst:605 msgid "``sha256``;" msgstr "``sha256``;" -#: ../../using/configure.rst:604 +#: ../../using/configure.rst:606 msgid "``sha512``;" msgstr "``sha512``;" -#: ../../using/configure.rst:605 +#: ../../using/configure.rst:607 msgid "``sha3`` (with shake);" msgstr "" -#: ../../using/configure.rst:606 +#: ../../using/configure.rst:608 msgid "``blake2``." msgstr "``blake2``。" -#: ../../using/configure.rst:612 +#: ../../using/configure.rst:614 msgid "Override the OpenSSL default cipher suites string:" msgstr "" -#: ../../using/configure.rst:614 +#: ../../using/configure.rst:616 msgid "``python`` (default): use Python's preferred selection;" msgstr "" -#: ../../using/configure.rst:615 +#: ../../using/configure.rst:617 msgid "``openssl``: leave OpenSSL's defaults untouched;" msgstr "" -#: ../../using/configure.rst:616 +#: ../../using/configure.rst:618 msgid "*STRING*: use a custom string" msgstr "" -#: ../../using/configure.rst:618 +#: ../../using/configure.rst:620 msgid "See the :mod:`ssl` module." msgstr "請見 :mod:`ssl` 模組。" -#: ../../using/configure.rst:624 +#: ../../using/configure.rst:626 msgid "" "The settings ``python`` and *STRING* also set TLS 1.2 as minimum protocol " "version." msgstr "" -#: ../../using/configure.rst:628 +#: ../../using/configure.rst:630 msgid "macOS Options" msgstr "macOS 選項" -#: ../../using/configure.rst:630 +#: ../../using/configure.rst:632 msgid "See ``Mac/README.rst``." msgstr "參閱 ``Mac/README.rst``。" -#: ../../using/configure.rst:635 +#: ../../using/configure.rst:637 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:641 +#: ../../using/configure.rst:643 msgid "" "Create a Python.framework rather than a traditional Unix install. Optional " "*INSTALLDIR* specifies the installation path (default is no)." msgstr "" -#: ../../using/configure.rst:646 +#: ../../using/configure.rst:648 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:649 +#: ../../using/configure.rst:651 msgid "Options:" msgstr "選項:" -#: ../../using/configure.rst:651 +#: ../../using/configure.rst:653 msgid "``universal2``;" msgstr "``universal2``;" -#: ../../using/configure.rst:652 +#: ../../using/configure.rst:654 msgid "``32-bit``;" msgstr "``32-bit``;" -#: ../../using/configure.rst:653 +#: ../../using/configure.rst:655 msgid "``64-bit``;" msgstr "``64-bit``;" -#: ../../using/configure.rst:654 +#: ../../using/configure.rst:656 msgid "``3-way``;" msgstr "``3-way``;" -#: ../../using/configure.rst:655 +#: ../../using/configure.rst:657 msgid "``intel``;" msgstr "``intel``;" -#: ../../using/configure.rst:656 +#: ../../using/configure.rst:658 msgid "``intel-32``;" msgstr "``intel-32``;" -#: ../../using/configure.rst:657 +#: ../../using/configure.rst:659 msgid "``intel-64``;" msgstr "``intel-64``;" -#: ../../using/configure.rst:658 +#: ../../using/configure.rst:660 msgid "``all``." msgstr "``all``。" -#: ../../using/configure.rst:662 +#: ../../using/configure.rst:664 msgid "" "Specify the name for the python framework on macOS only valid when :option:" "`--enable-framework` is set (default: ``Python``)." msgstr "" -#: ../../using/configure.rst:667 +#: ../../using/configure.rst:669 msgid "Cross Compiling Options" msgstr "" -#: ../../using/configure.rst:669 +#: ../../using/configure.rst:671 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 " @@ -975,95 +975,95 @@ msgid "" "match the version of the cross compiled host Python." msgstr "" -#: ../../using/configure.rst:676 +#: ../../using/configure.rst:678 msgid "" "configure for building on BUILD, usually guessed by :program:`config.guess`." msgstr "" -#: ../../using/configure.rst:680 +#: ../../using/configure.rst:682 msgid "cross-compile to build programs to run on HOST (target platform)" msgstr "" -#: ../../using/configure.rst:684 +#: ../../using/configure.rst:686 msgid "path to build ``python`` binary for cross compiling" msgstr "" -#: ../../using/configure.rst:690 +#: ../../using/configure.rst:692 msgid "An environment variable that points to a file with configure overrides." msgstr "" -#: ../../using/configure.rst:692 -msgid "Example *config.site* file::" +#: ../../using/configure.rst:694 +msgid "Example *config.site* file:" msgstr "" -#: ../../using/configure.rst:700 +#: ../../using/configure.rst:704 msgid "Cross compiling example::" msgstr "" -#: ../../using/configure.rst:709 +#: ../../using/configure.rst:713 msgid "Python Build System" msgstr "" -#: ../../using/configure.rst:712 +#: ../../using/configure.rst:716 msgid "Main files of the build system" msgstr "" -#: ../../using/configure.rst:714 +#: ../../using/configure.rst:718 msgid ":file:`configure.ac` => :file:`configure`;" msgstr ":file:`configure.ac` => :file:`configure`\\ ;" -#: ../../using/configure.rst:715 +#: ../../using/configure.rst:719 msgid "" ":file:`Makefile.pre.in` => :file:`Makefile` (created by :file:`configure`);" msgstr "" -#: ../../using/configure.rst:716 +#: ../../using/configure.rst:720 msgid ":file:`pyconfig.h` (created by :file:`configure`);" msgstr ":file:`pyconfig.h` (created by :file:`configure`)\\ ;" -#: ../../using/configure.rst:717 +#: ../../using/configure.rst:721 msgid "" ":file:`Modules/Setup`: C extensions built by the Makefile using :file:" "`Module/makesetup` shell script;" msgstr "" -#: ../../using/configure.rst:721 +#: ../../using/configure.rst:725 msgid "Main build steps" msgstr "主要建置步驟" -#: ../../using/configure.rst:723 +#: ../../using/configure.rst:727 msgid "C files (``.c``) are built as object files (``.o``)." msgstr "" -#: ../../using/configure.rst:724 +#: ../../using/configure.rst:728 msgid "A static ``libpython`` library (``.a``) is created from objects files." msgstr "" -#: ../../using/configure.rst:725 +#: ../../using/configure.rst:729 msgid "" "``python.o`` and the static ``libpython`` library are linked into the final " "``python`` program." msgstr "" -#: ../../using/configure.rst:727 +#: ../../using/configure.rst:731 msgid "C extensions are built by the Makefile (see :file:`Modules/Setup`)." msgstr "" -#: ../../using/configure.rst:730 +#: ../../using/configure.rst:734 msgid "Main Makefile targets" msgstr "主要 Makefile 目標" -#: ../../using/configure.rst:732 +#: ../../using/configure.rst:736 msgid "``make``: Build Python with the standard library." msgstr "" -#: ../../using/configure.rst:733 +#: ../../using/configure.rst:737 msgid "" "``make platform:``: build the ``python`` program, but don't build the " "standard library extension modules." msgstr "" -#: ../../using/configure.rst:735 +#: ../../using/configure.rst:739 msgid "" "``make profile-opt``: build Python using Profile Guided Optimization (PGO). " "You can use the configure :option:`--enable-optimizations` option to make " @@ -1071,53 +1071,53 @@ msgid "" "``make``)." msgstr "" -#: ../../using/configure.rst:739 +#: ../../using/configure.rst:743 msgid "" "``make buildbottest``: Build Python and run the Python test suite, the same " "way than buildbots test Python. Set ``TESTTIMEOUT`` variable (in seconds) to " "change the test timeout (1200 by default: 20 minutes)." msgstr "" -#: ../../using/configure.rst:742 +#: ../../using/configure.rst:746 msgid "``make install``: Build and install Python." msgstr "" -#: ../../using/configure.rst:743 +#: ../../using/configure.rst:747 msgid "" "``make regen-all``: Regenerate (almost) all generated files; ``make regen-" "stdlib-module-names`` and ``autoconf`` must be run separately for the " "remaining generated files." msgstr "" -#: ../../using/configure.rst:746 +#: ../../using/configure.rst:750 msgid "``make clean``: Remove built files." msgstr "" -#: ../../using/configure.rst:747 +#: ../../using/configure.rst:751 msgid "" "``make distclean``: Same than ``make clean``, but remove also files created " "by the configure script." msgstr "" -#: ../../using/configure.rst:751 +#: ../../using/configure.rst:755 msgid "C extensions" msgstr "C 擴充模組" -#: ../../using/configure.rst:753 +#: ../../using/configure.rst:757 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::" +"modules have no ``__file__`` attribute:" msgstr "" -#: ../../using/configure.rst:765 +#: ../../using/configure.rst:771 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::" +"Example on Linux x86-64:" msgstr "" -#: ../../using/configure.rst:775 +#: ../../using/configure.rst:783 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-" @@ -1125,303 +1125,303 @@ msgid "" "dynamic libraries." msgstr "" -#: ../../using/configure.rst:779 +#: ../../using/configure.rst:787 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:" msgstr "" -#: ../../using/configure.rst:783 +#: ../../using/configure.rst:791 msgid "Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined" msgstr "如果定義了 ``Py_BUILD_CORE_MODULE``,則使用 ``Py_EXPORTED_SYMBOL``" -#: ../../using/configure.rst:784 +#: ../../using/configure.rst:792 msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." msgstr "否則使用 ``Py_IMPORTED_SYMBOL``。" -#: ../../using/configure.rst:786 +#: ../../using/configure.rst:794 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:792 +#: ../../using/configure.rst:800 msgid "Compiler and linker flags" msgstr "" -#: ../../using/configure.rst:794 +#: ../../using/configure.rst:802 msgid "" "Options set by the ``./configure`` script and environment variables and used " "by ``Makefile``." msgstr "" -#: ../../using/configure.rst:798 +#: ../../using/configure.rst:806 msgid "Preprocessor flags" msgstr "" -#: ../../using/configure.rst:802 +#: ../../using/configure.rst:810 msgid "" "Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:808 +#: ../../using/configure.rst:816 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:811 ../../using/configure.rst:1001 +#: ../../using/configure.rst:819 ../../using/configure.rst:1009 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:821 +#: ../../using/configure.rst:829 msgid "" "Extra preprocessor flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:823 +#: ../../using/configure.rst:831 msgid "" "Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " "$(CPPFLAGS)``." msgstr "" -#: ../../using/configure.rst:828 +#: ../../using/configure.rst:836 msgid "Compiler flags" msgstr "編譯器旗標" -#: ../../using/configure.rst:832 +#: ../../using/configure.rst:840 msgid "C compiler command." msgstr "C 編譯器指令。" -#: ../../using/configure.rst:834 +#: ../../using/configure.rst:842 msgid "Example: ``gcc -pthread``." msgstr "" -#: ../../using/configure.rst:838 +#: ../../using/configure.rst:846 msgid "C++ compiler command." msgstr "C++ 編譯器指令。" -#: ../../using/configure.rst:840 +#: ../../using/configure.rst:848 msgid "Example: ``g++ -pthread``." msgstr "範例:``g++ -pthread``。" -#: ../../using/configure.rst:844 +#: ../../using/configure.rst:852 msgid "C compiler flags." msgstr "C 編譯器旗標。" -#: ../../using/configure.rst:848 +#: ../../using/configure.rst:856 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`)." msgstr "" -#: ../../using/configure.rst:852 +#: ../../using/configure.rst:860 msgid "In particular, :envvar:`CFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:854 +#: ../../using/configure.rst:862 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." msgstr "" -#: ../../using/configure.rst:859 +#: ../../using/configure.rst:867 msgid "" "hardening flags such as ``-Werror`` because distributions cannot control " "whether packages installed by users conform to such heightened standards." msgstr "" -#: ../../using/configure.rst:867 +#: ../../using/configure.rst:875 msgid "" "Options passed to the :mod:`compileall` command line when building PYC files " "in ``make install``. Default: ``-j0``." msgstr "" -#: ../../using/configure.rst:874 +#: ../../using/configure.rst:882 msgid "Extra C compiler flags." msgstr "額外的 C 編譯器旗標。" -#: ../../using/configure.rst:878 +#: ../../using/configure.rst:886 msgid "" "Value of :envvar:`CFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:885 +#: ../../using/configure.rst:893 msgid "" "Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:892 +#: ../../using/configure.rst:900 msgid "Base compiler flags." msgstr "基本編譯器旗標。" -#: ../../using/configure.rst:896 +#: ../../using/configure.rst:904 msgid "Optimization flags." msgstr "最佳化旗標。" -#: ../../using/configure.rst:900 +#: ../../using/configure.rst:908 msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" -#: ../../using/configure.rst:906 +#: ../../using/configure.rst:914 msgid "Compiler flags used to build a shared library." msgstr "" -#: ../../using/configure.rst:908 +#: ../../using/configure.rst:916 msgid "For example, ``-fPIC`` is used on Linux and on BSD." msgstr "例如說 ``-fPIC`` 被使用於 Linux 與 BSD 上。" -#: ../../using/configure.rst:912 +#: ../../using/configure.rst:920 msgid "Extra C flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:914 +#: ../../using/configure.rst:922 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" -#: ../../using/configure.rst:919 +#: ../../using/configure.rst:927 msgid "" "Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``." msgstr "" -#: ../../using/configure.rst:923 +#: ../../using/configure.rst:931 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." msgstr "" -#: ../../using/configure.rst:929 +#: ../../using/configure.rst:937 msgid "C flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:931 +#: ../../using/configure.rst:939 msgid "" "Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``." msgstr "" -#: ../../using/configure.rst:937 +#: ../../using/configure.rst:945 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." msgstr "" -#: ../../using/configure.rst:943 +#: ../../using/configure.rst:951 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" -#: ../../using/configure.rst:946 +#: ../../using/configure.rst:954 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." msgstr "" -#: ../../using/configure.rst:952 +#: ../../using/configure.rst:960 msgid "Purify command. Purify is a memory debugger program." msgstr "" -#: ../../using/configure.rst:954 +#: ../../using/configure.rst:962 msgid "Default: empty string (not used)." msgstr "" -#: ../../using/configure.rst:958 +#: ../../using/configure.rst:966 msgid "Linker flags" msgstr "" -#: ../../using/configure.rst:962 +#: ../../using/configure.rst:970 msgid "" "Linker command used to build programs like ``python`` and ``_testembed``." msgstr "" -#: ../../using/configure.rst:964 +#: ../../using/configure.rst:972 msgid "Default: ``$(PURIFY) $(CC)``." msgstr "" -#: ../../using/configure.rst:968 +#: ../../using/configure.rst:976 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:970 +#: ../../using/configure.rst:978 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:978 +#: ../../using/configure.rst:986 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`)." msgstr "" -#: ../../using/configure.rst:982 +#: ../../using/configure.rst:990 msgid "In particular, :envvar:`LDFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:984 +#: ../../using/configure.rst:992 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." msgstr "" -#: ../../using/configure.rst:991 +#: ../../using/configure.rst:999 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:998 +#: ../../using/configure.rst:1006 msgid "" "Linker flags, e.g. :samp:`-L{lib_dir}` if you have libraries in a " "nonstandard directory *lib_dir*." msgstr "" -#: ../../using/configure.rst:1007 +#: ../../using/configure.rst:1015 msgid "" "Linker flags to pass libraries to the linker when linking the Python " "executable." msgstr "" -#: ../../using/configure.rst:1010 +#: ../../using/configure.rst:1018 msgid "Example: ``-lrt``." msgstr "範例:``-lrt``。" -#: ../../using/configure.rst:1014 +#: ../../using/configure.rst:1022 msgid "Command to build a shared library." msgstr "" -#: ../../using/configure.rst:1016 +#: ../../using/configure.rst:1024 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." msgstr "預設值:``@LDSHARED@ $(PY_LDFLAGS)``。" -#: ../../using/configure.rst:1020 +#: ../../using/configure.rst:1028 msgid "Command to build ``libpython`` shared library." msgstr "" -#: ../../using/configure.rst:1022 +#: ../../using/configure.rst:1030 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." msgstr "預設值:``@BLDSHARED@ $(PY_CORE_LDFLAGS)``。" -#: ../../using/configure.rst:1026 +#: ../../using/configure.rst:1034 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``。" -#: ../../using/configure.rst:1030 +#: ../../using/configure.rst:1038 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``。" -#: ../../using/configure.rst:1036 +#: ../../using/configure.rst:1044 msgid "Linker flags used for building the interpreter object files." msgstr "" From daaf78c4f25a68fb0804273bee9824e1ea1eaf90 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 6 Mar 2024 00:05:16 +0000 Subject: [PATCH 28/33] sync with cpython 88fdb082 --- c-api/structures.po | 8 +- library/asyncio-eventloop.po | 4 +- library/audit_events.po | 5 +- library/decimal.po | 6 +- library/idle.po | 4 +- library/ipaddress.po | 263 +++++----- library/pprint.po | 6 +- library/ssl.po | 7 +- library/typing.po | 946 +++++++++++++++++------------------ 9 files changed, 618 insertions(+), 631 deletions(-) diff --git a/c-api/structures.po b/c-api/structures.po index 38d4aec16d..6084fc5f31 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-12 00:03+0000\n" +"POT-Creation-Date: 2024-03-06 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -812,13 +812,13 @@ msgstr "可選的文件字串" #: ../../c-api/structures.rst:705 msgid "" -"Optional function pointer, providing additional data for getter and setter." +"Optional user data pointer, providing additional data for getter and setter." msgstr "" #: ../../c-api/structures.rst:709 msgid "" "The ``get`` function takes one :c:expr:`PyObject*` parameter (the instance) " -"and a function pointer (the associated ``closure``):" +"and a user data pointer (the associated ``closure``):" msgstr "" #: ../../c-api/structures.rst:712 @@ -830,7 +830,7 @@ msgstr "" #: ../../c-api/structures.rst:717 msgid "" "``set`` functions take two :c:expr:`PyObject*` parameters (the instance and " -"the value to be set) and a function pointer (the associated ``closure``):" +"the value to be set) and a user data pointer (the associated ``closure``):" msgstr "" #: ../../c-api/structures.rst:720 diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index ff4ea8f2f0..11c0b652aa 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-30 00:03+0000\n" +"POT-Creation-Date: 2024-03-06 00:03+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-" @@ -864,7 +864,7 @@ msgstr "新增對於 Windows 的支援。" #: ../../library/asyncio-eventloop.rst:628 msgid "" -"The *reuse_address* parameter, disabled since Python 3.9.0, 3.8.1, 3.7.6 and " +"The *reuse_address* parameter, disabled since Python 3.8.1, 3.7.6 and " "3.6.10, has been entirely removed." msgstr "" diff --git a/library/audit_events.po b/library/audit_events.po index d4385e78c7..ce76723467 100644 --- a/library/audit_events.po +++ b/library/audit_events.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2024-03-06 00:03+0000\n" "PO-Revision-Date: 2021-12-06 21:50+0800\n" "Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -23,10 +23,11 @@ msgid "Audit events table" msgstr "稽核事件表" #: ../../library/audit_events.rst:8 +#, fuzzy msgid "" "This table contains all events raised by :func:`sys.audit` or :c:func:" "`PySys_Audit` calls throughout the CPython runtime and the standard " -"library. These calls were added in 3.8.0 or later (see :pep:`578`)." +"library. These calls were added in 3.8 or later (see :pep:`578`)." msgstr "" "這張表包含了所有在 CPython 運行環境 (runtime) 與標準函式庫對於 :func:`sys." "audit` 或 :c:func:`PySys_Audit` 的呼叫所觸發的事件。這些呼叫是在 3.8.0 或更新" diff --git a/library/decimal.po b/library/decimal.po index 44de644176..12f5c2b577 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2024-03-06 00:03+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-" @@ -1533,10 +1533,6 @@ msgid "" "scenarios." msgstr "" -#: ../../library/decimal.rst:1520 -msgid "backported to 3.7 and 3.8." -msgstr "" - #: ../../library/decimal.rst:1524 msgid "Rounding modes" msgstr "" diff --git a/library/idle.po b/library/idle.po index ddb0bbe1e2..4bdb7a2e09 100644 --- a/library/idle.po +++ b/library/idle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-18 00:03+0000\n" +"POT-Creation-Date: 2024-03-06 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1085,7 +1085,7 @@ msgid "" msgstr "" #: ../../library/idle.rst:607 -msgid ":kbd:`C-c` attemps to interrupt statement execution (but may fail)." +msgid ":kbd:`C-c` attempts to interrupt statement execution (but may fail)." msgstr "" #: ../../library/idle.rst:609 diff --git a/library/ipaddress.po b/library/ipaddress.po index 95bee5e142..356dc58bb5 100644 --- a/library/ipaddress.po +++ b/library/ipaddress.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-12 19:07+0000\n" +"POT-Creation-Date: 2024-03-06 00:03+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-" @@ -155,39 +155,28 @@ msgid "" msgstr "" #: ../../library/ipaddress.rst:132 -msgid "" -"The above change was also included in Python 3.9 starting with version 3.9.5." -msgstr "" - -#: ../../library/ipaddress.rst:137 -msgid "" -"The above change was also included in Python 3.8 starting with version " -"3.8.12." -msgstr "" - -#: ../../library/ipaddress.rst:142 msgid "The appropriate version number: ``4`` for IPv4, ``6`` for IPv6." msgstr "" -#: ../../library/ipaddress.rst:146 +#: ../../library/ipaddress.rst:136 msgid "" "The total number of bits in the address representation for this version: " "``32`` for IPv4, ``128`` for IPv6." msgstr "" -#: ../../library/ipaddress.rst:149 +#: ../../library/ipaddress.rst:139 msgid "" "The prefix defines the number of leading bits in an address that are " "compared to determine whether or not an address is part of a network." msgstr "" -#: ../../library/ipaddress.rst:156 +#: ../../library/ipaddress.rst:146 msgid "" "The string representation in dotted decimal notation. Leading zeroes are " "never included in the representation." msgstr "" -#: ../../library/ipaddress.rst:159 +#: ../../library/ipaddress.rst:149 msgid "" "As IPv4 does not define a shorthand notation for addresses with octets set " "to zero, these two attributes are always the same as ``str(addr)`` for IPv4 " @@ -195,63 +184,63 @@ msgid "" "that can handle both IPv4 and IPv6 addresses." msgstr "" -#: ../../library/ipaddress.rst:166 +#: ../../library/ipaddress.rst:156 msgid "" "The binary representation of this address - a :class:`bytes` object of the " "appropriate length (most significant octet first). This is 4 bytes for IPv4 " "and 16 bytes for IPv6." msgstr "" -#: ../../library/ipaddress.rst:172 +#: ../../library/ipaddress.rst:162 msgid "The name of the reverse DNS PTR record for the IP address, e.g.::" msgstr "" -#: ../../library/ipaddress.rst:179 +#: ../../library/ipaddress.rst:169 msgid "" "This is the name that could be used for performing a PTR lookup, not the " "resolved hostname itself." msgstr "" -#: ../../library/ipaddress.rst:186 +#: ../../library/ipaddress.rst:176 msgid "" "``True`` if the address is reserved for multicast use. See :RFC:`3171` (for " "IPv4) or :RFC:`2373` (for IPv6)." msgstr "" -#: ../../library/ipaddress.rst:191 +#: ../../library/ipaddress.rst:181 msgid "" "``True`` if the address is allocated for private networks. See iana-ipv4-" "special-registry_ (for IPv4) or iana-ipv6-special-registry_ (for IPv6)." msgstr "" -#: ../../library/ipaddress.rst:197 +#: ../../library/ipaddress.rst:187 msgid "" "``True`` if the address is allocated for public networks. See iana-ipv4-" "special-registry_ (for IPv4) or iana-ipv6-special-registry_ (for IPv6)." msgstr "" -#: ../../library/ipaddress.rst:205 +#: ../../library/ipaddress.rst:195 msgid "" "``True`` if the address is unspecified. See :RFC:`5735` (for IPv4) or :RFC:" "`2373` (for IPv6)." msgstr "" -#: ../../library/ipaddress.rst:210 +#: ../../library/ipaddress.rst:200 msgid "``True`` if the address is otherwise IETF reserved." msgstr "" -#: ../../library/ipaddress.rst:214 +#: ../../library/ipaddress.rst:204 msgid "" "``True`` if this is a loopback address. See :RFC:`3330` (for IPv4) or :RFC:" "`2373` (for IPv6)." msgstr "" -#: ../../library/ipaddress.rst:219 +#: ../../library/ipaddress.rst:209 msgid "" "``True`` if the address is reserved for link-local usage. See :RFC:`3927`." msgstr "" -#: ../../library/ipaddress.rst:227 +#: ../../library/ipaddress.rst:217 msgid "" "Returns a string representation of the IP address, controlled by an explicit " "format string. *fmt* can be one of the following: ``'s'``, the default " @@ -263,17 +252,17 @@ msgid "" "used by ``format``, ``str.format`` and f-strings." msgstr "" -#: ../../library/ipaddress.rst:254 +#: ../../library/ipaddress.rst:244 msgid "" "Construct an IPv6 address. An :exc:`AddressValueError` is raised if " "*address* is not a valid IPv6 address." msgstr "" -#: ../../library/ipaddress.rst:257 +#: ../../library/ipaddress.rst:247 msgid "The following constitutes a valid IPv6 address:" msgstr "" -#: ../../library/ipaddress.rst:259 +#: ../../library/ipaddress.rst:249 msgid "" "A string consisting of eight groups of four hexadecimal digits, each group " "representing 16 bits. The groups are separated by colons. This describes an " @@ -283,7 +272,7 @@ msgid "" "to ``\"::abc:7:def\"``." msgstr "" -#: ../../library/ipaddress.rst:267 +#: ../../library/ipaddress.rst:257 msgid "" "Optionally, the string may also have a scope zone ID, expressed with a " "suffix ``%scope_id``. If present, the scope ID must be non-empty, and may " @@ -292,43 +281,43 @@ msgid "" "the node." msgstr "" -#: ../../library/ipaddress.rst:272 +#: ../../library/ipaddress.rst:262 msgid "An integer that fits into 128 bits." msgstr "" -#: ../../library/ipaddress.rst:273 +#: ../../library/ipaddress.rst:263 msgid "" "An integer packed into a :class:`bytes` object of length 16, big-endian." msgstr "" -#: ../../library/ipaddress.rst:283 +#: ../../library/ipaddress.rst:273 msgid "" "The short form of the address representation, with leading zeroes in groups " "omitted and the longest sequence of groups consisting entirely of zeroes " "collapsed to a single empty group." msgstr "" -#: ../../library/ipaddress.rst:287 +#: ../../library/ipaddress.rst:277 msgid "This is also the value returned by ``str(addr)`` for IPv6 addresses." msgstr "" -#: ../../library/ipaddress.rst:291 +#: ../../library/ipaddress.rst:281 msgid "" "The long form of the address representation, with all leading zeroes and " "groups consisting entirely of zeroes included." msgstr "" -#: ../../library/ipaddress.rst:295 +#: ../../library/ipaddress.rst:285 msgid "" "For the following attributes and methods, see the corresponding " "documentation of the :class:`IPv4Address` class:" msgstr "" -#: ../../library/ipaddress.rst:310 +#: ../../library/ipaddress.rst:300 msgid "is_global" msgstr "is_global" -#: ../../library/ipaddress.rst:315 +#: ../../library/ipaddress.rst:305 msgid "" "``True`` if the address is reserved for site-local usage. Note that the " "site-local address space has been deprecated by :RFC:`3879`. Use :attr:" @@ -336,21 +325,21 @@ msgid "" "local addresses as defined by :RFC:`4193`." msgstr "" -#: ../../library/ipaddress.rst:322 +#: ../../library/ipaddress.rst:312 msgid "" "For addresses that appear to be IPv4 mapped addresses (starting with ``::" "FFFF/96``), this property will report the embedded IPv4 address. For any " "other address, this property will be ``None``." msgstr "" -#: ../../library/ipaddress.rst:328 +#: ../../library/ipaddress.rst:318 msgid "" "For scoped addresses as defined by :RFC:`4007`, this property identifies the " "particular zone of the address's scope that the address belongs to, as a " "string. When no scope zone is specified, this property will be ``None``." msgstr "" -#: ../../library/ipaddress.rst:334 +#: ../../library/ipaddress.rst:324 msgid "" "For addresses that appear to be 6to4 addresses (starting with " "``2002::/16``) as defined by :RFC:`3056`, this property will report the " @@ -358,7 +347,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/ipaddress.rst:341 +#: ../../library/ipaddress.rst:331 msgid "" "For addresses that appear to be Teredo addresses (starting with " "``2001::/32``) as defined by :RFC:`4380`, this property will report the " @@ -366,65 +355,65 @@ msgid "" "property will be ``None``." msgstr "" -#: ../../library/ipaddress.rst:348 +#: ../../library/ipaddress.rst:338 msgid "" "Refer to the corresponding method documentation in :class:`IPv4Address`." msgstr "" -#: ../../library/ipaddress.rst:354 +#: ../../library/ipaddress.rst:344 msgid "Conversion to Strings and Integers" msgstr "" -#: ../../library/ipaddress.rst:356 +#: ../../library/ipaddress.rst:346 msgid "" "To interoperate with networking interfaces such as the socket module, " "addresses must be converted to strings or integers. This is handled using " "the :func:`str` and :func:`int` builtin functions::" msgstr "" -#: ../../library/ipaddress.rst:369 +#: ../../library/ipaddress.rst:359 msgid "" "Note that IPv6 scoped addresses are converted to integers without scope zone " "ID." msgstr "" -#: ../../library/ipaddress.rst:373 ../../library/ipaddress.rst:757 -#: ../../library/ipaddress.rst:893 +#: ../../library/ipaddress.rst:363 ../../library/ipaddress.rst:747 +#: ../../library/ipaddress.rst:883 msgid "Operators" msgstr "" -#: ../../library/ipaddress.rst:375 +#: ../../library/ipaddress.rst:365 msgid "" "Address objects support some operators. Unless stated otherwise, operators " "can only be applied between compatible objects (i.e. IPv4 with IPv4, IPv6 " "with IPv6)." msgstr "" -#: ../../library/ipaddress.rst:381 +#: ../../library/ipaddress.rst:371 msgid "Comparison operators" msgstr "" -#: ../../library/ipaddress.rst:383 +#: ../../library/ipaddress.rst:373 msgid "" "Address objects can be compared with the usual set of comparison operators. " "Same IPv6 addresses with different scope zone IDs are not equal. Some " "examples::" msgstr "" -#: ../../library/ipaddress.rst:400 +#: ../../library/ipaddress.rst:390 msgid "Arithmetic operators" msgstr "" -#: ../../library/ipaddress.rst:402 +#: ../../library/ipaddress.rst:392 msgid "" "Integers can be added to or subtracted from address objects. Some examples::" msgstr "" -#: ../../library/ipaddress.rst:415 +#: ../../library/ipaddress.rst:405 msgid "IP Network definitions" msgstr "" -#: ../../library/ipaddress.rst:417 +#: ../../library/ipaddress.rst:407 msgid "" "The :class:`IPv4Network` and :class:`IPv6Network` objects provide a " "mechanism for defining and inspecting IP network definitions. A network " @@ -435,11 +424,11 @@ msgid "" "addresses in the inclusive range ``192.168.1.0`` to ``192.168.1.255``." msgstr "" -#: ../../library/ipaddress.rst:427 +#: ../../library/ipaddress.rst:417 msgid "Prefix, net mask and host mask" msgstr "" -#: ../../library/ipaddress.rst:429 +#: ../../library/ipaddress.rst:419 msgid "" "There are several equivalent ways to specify IP network masks. A *prefix* " "``/`` is a notation that denotes how many high-order bits are set in " @@ -451,11 +440,11 @@ msgid "" "mask equivalent to ``/24`` in IPv4 is ``0.0.0.255``." msgstr "" -#: ../../library/ipaddress.rst:440 +#: ../../library/ipaddress.rst:430 msgid "Network objects" msgstr "" -#: ../../library/ipaddress.rst:442 +#: ../../library/ipaddress.rst:432 msgid "" "All attributes implemented by address objects are implemented by network " "objects as well. In addition, network objects implement additional " @@ -465,12 +454,12 @@ msgid "" "keys in dictionaries." msgstr "" -#: ../../library/ipaddress.rst:451 +#: ../../library/ipaddress.rst:441 msgid "" "Construct an IPv4 network definition. *address* can be one of the following:" msgstr "" -#: ../../library/ipaddress.rst:453 +#: ../../library/ipaddress.rst:443 msgid "" "A string consisting of an IP address and an optional mask, separated by a " "slash (``/``). The IP address is the network address, and the mask can be " @@ -482,26 +471,26 @@ msgid "" "it's considered to be ``/32``." msgstr "" -#: ../../library/ipaddress.rst:462 +#: ../../library/ipaddress.rst:452 msgid "" "For example, the following *address* specifications are equivalent: " "``192.168.1.0/24``, ``192.168.1.0/255.255.255.0`` and " "``192.168.1.0/0.0.0.255``." msgstr "" -#: ../../library/ipaddress.rst:466 +#: ../../library/ipaddress.rst:456 msgid "" "An integer that fits into 32 bits. This is equivalent to a single-address " "network, with the network address being *address* and the mask being ``/32``." msgstr "" -#: ../../library/ipaddress.rst:470 +#: ../../library/ipaddress.rst:460 msgid "" "An integer packed into a :class:`bytes` object of length 4, big-endian. The " "interpretation is similar to an integer *address*." msgstr "" -#: ../../library/ipaddress.rst:473 +#: ../../library/ipaddress.rst:463 msgid "" "A two-tuple of an address description and a netmask, where the address " "description is either a string, a 32-bits integer, a 4-bytes packed integer, " @@ -510,92 +499,92 @@ msgid "" "prefix mask (e.g. ``255.255.255.0``)." msgstr "" -#: ../../library/ipaddress.rst:479 +#: ../../library/ipaddress.rst:469 msgid "" "An :exc:`AddressValueError` is raised if *address* is not a valid IPv4 " "address. A :exc:`NetmaskValueError` is raised if the mask is not valid for " "an IPv4 address." msgstr "" -#: ../../library/ipaddress.rst:483 ../../library/ipaddress.rst:703 +#: ../../library/ipaddress.rst:473 ../../library/ipaddress.rst:693 msgid "" "If *strict* is ``True`` and host bits are set in the supplied address, then :" "exc:`ValueError` is raised. Otherwise, the host bits are masked out to " "determine the appropriate network address." msgstr "" -#: ../../library/ipaddress.rst:487 +#: ../../library/ipaddress.rst:477 msgid "" "Unless stated otherwise, all network methods accepting other network/address " "objects will raise :exc:`TypeError` if the argument's IP version is " "incompatible to ``self``." msgstr "" -#: ../../library/ipaddress.rst:493 ../../library/ipaddress.rst:709 +#: ../../library/ipaddress.rst:483 ../../library/ipaddress.rst:699 msgid "Added the two-tuple form for the *address* constructor parameter." msgstr "" -#: ../../library/ipaddress.rst:498 +#: ../../library/ipaddress.rst:488 msgid "" "Refer to the corresponding attribute documentation in :class:`IPv4Address`." msgstr "" -#: ../../library/ipaddress.rst:508 +#: ../../library/ipaddress.rst:498 msgid "" "These attributes are true for the network as a whole if they are true for " "both the network address and the broadcast address." msgstr "" -#: ../../library/ipaddress.rst:513 +#: ../../library/ipaddress.rst:503 msgid "" "The network address for the network. The network address and the prefix " "length together uniquely define a network." msgstr "" -#: ../../library/ipaddress.rst:518 +#: ../../library/ipaddress.rst:508 msgid "" "The broadcast address for the network. Packets sent to the broadcast address " "should be received by every host on the network." msgstr "" -#: ../../library/ipaddress.rst:523 +#: ../../library/ipaddress.rst:513 msgid "The host mask, as an :class:`IPv4Address` object." msgstr "" -#: ../../library/ipaddress.rst:527 +#: ../../library/ipaddress.rst:517 msgid "The net mask, as an :class:`IPv4Address` object." msgstr "" -#: ../../library/ipaddress.rst:533 +#: ../../library/ipaddress.rst:523 msgid "" "A string representation of the network, with the mask in prefix notation." msgstr "" -#: ../../library/ipaddress.rst:536 +#: ../../library/ipaddress.rst:526 msgid "" "``with_prefixlen`` and ``compressed`` are always the same as " "``str(network)``. ``exploded`` uses the exploded form the network address." msgstr "" -#: ../../library/ipaddress.rst:542 +#: ../../library/ipaddress.rst:532 msgid "" "A string representation of the network, with the mask in net mask notation." msgstr "" -#: ../../library/ipaddress.rst:547 +#: ../../library/ipaddress.rst:537 msgid "" "A string representation of the network, with the mask in host mask notation." msgstr "" -#: ../../library/ipaddress.rst:552 +#: ../../library/ipaddress.rst:542 msgid "The total number of addresses in the network." msgstr "" -#: ../../library/ipaddress.rst:556 +#: ../../library/ipaddress.rst:546 msgid "Length of the network prefix, in bits." msgstr "" -#: ../../library/ipaddress.rst:560 +#: ../../library/ipaddress.rst:550 msgid "" "Returns an iterator over the usable hosts in the network. The usable hosts " "are all the IP addresses that belong to the network, except the network " @@ -605,20 +594,20 @@ msgid "" "containing the single host address." msgstr "" -#: ../../library/ipaddress.rst:578 +#: ../../library/ipaddress.rst:568 msgid "" "``True`` if this network is partly or wholly contained in *other* or *other* " "is wholly contained in this network." msgstr "" -#: ../../library/ipaddress.rst:583 +#: ../../library/ipaddress.rst:573 msgid "" "Computes the network definitions resulting from removing the given *network* " "from this one. Returns an iterator of network objects. Raises :exc:" "`ValueError` if *network* is not completely contained in this network." msgstr "" -#: ../../library/ipaddress.rst:596 +#: ../../library/ipaddress.rst:586 msgid "" "The subnets that join to make the current network definition, depending on " "the argument values. *prefixlen_diff* is the amount our prefix length " @@ -628,7 +617,7 @@ msgid "" "network objects." msgstr "" -#: ../../library/ipaddress.rst:621 +#: ../../library/ipaddress.rst:611 msgid "" "The supernet containing this network definition, depending on the argument " "values. *prefixlen_diff* is the amount our prefix length should be " @@ -637,33 +626,33 @@ msgid "" "*new_prefix* must be set. Returns a single network object." msgstr "" -#: ../../library/ipaddress.rst:637 +#: ../../library/ipaddress.rst:627 msgid "Return ``True`` if this network is a subnet of *other*." msgstr "" -#: ../../library/ipaddress.rst:648 +#: ../../library/ipaddress.rst:638 msgid "Return ``True`` if this network is a supernet of *other*." msgstr "" -#: ../../library/ipaddress.rst:659 +#: ../../library/ipaddress.rst:649 msgid "" "Compare this network to *other*. In this comparison only the network " "addresses are considered; host bits aren't. Returns either ``-1``, ``0`` or " "``1``." msgstr "" -#: ../../library/ipaddress.rst:670 +#: ../../library/ipaddress.rst:660 msgid "" "It uses the same ordering and comparison algorithm as \"<\", \"==\", and " "\">\"" msgstr "" -#: ../../library/ipaddress.rst:676 +#: ../../library/ipaddress.rst:666 msgid "" "Construct an IPv6 network definition. *address* can be one of the following:" msgstr "" -#: ../../library/ipaddress.rst:678 +#: ../../library/ipaddress.rst:668 msgid "" "A string consisting of an IP address and an optional prefix length, " "separated by a slash (``/``). The IP address is the network address, and " @@ -671,26 +660,26 @@ msgid "" "length is provided, it's considered to be ``/128``." msgstr "" -#: ../../library/ipaddress.rst:683 +#: ../../library/ipaddress.rst:673 msgid "" "Note that currently expanded netmasks are not supported. That means ``2001:" "db00::0/24`` is a valid argument while ``2001:db00::0/ffff:ff00::`` is not." msgstr "" -#: ../../library/ipaddress.rst:687 +#: ../../library/ipaddress.rst:677 msgid "" "An integer that fits into 128 bits. This is equivalent to a single-address " "network, with the network address being *address* and the mask being " "``/128``." msgstr "" -#: ../../library/ipaddress.rst:691 +#: ../../library/ipaddress.rst:681 msgid "" "An integer packed into a :class:`bytes` object of length 16, big-endian. The " "interpretation is similar to an integer *address*." msgstr "" -#: ../../library/ipaddress.rst:694 +#: ../../library/ipaddress.rst:684 msgid "" "A two-tuple of an address description and a netmask, where the address " "description is either a string, a 128-bits integer, a 16-bytes packed " @@ -698,14 +687,14 @@ msgid "" "representing the prefix length." msgstr "" -#: ../../library/ipaddress.rst:699 +#: ../../library/ipaddress.rst:689 msgid "" "An :exc:`AddressValueError` is raised if *address* is not a valid IPv6 " "address. A :exc:`NetmaskValueError` is raised if the mask is not valid for " "an IPv6 address." msgstr "" -#: ../../library/ipaddress.rst:732 +#: ../../library/ipaddress.rst:722 msgid "" "Returns an iterator over the usable hosts in the network. The usable hosts " "are all the IP addresses that belong to the network, except the Subnet-" @@ -714,139 +703,139 @@ msgid "" "of 128 will return a list containing the single host address." msgstr "" -#: ../../library/ipaddress.rst:747 +#: ../../library/ipaddress.rst:737 msgid "" "Refer to the corresponding attribute documentation in :class:`IPv4Network`." msgstr "" -#: ../../library/ipaddress.rst:752 +#: ../../library/ipaddress.rst:742 msgid "" "These attribute is true for the network as a whole if it is true for both " "the network address and the broadcast address." msgstr "" -#: ../../library/ipaddress.rst:759 +#: ../../library/ipaddress.rst:749 msgid "" "Network objects support some operators. Unless stated otherwise, operators " "can only be applied between compatible objects (i.e. IPv4 with IPv4, IPv6 " "with IPv6)." msgstr "" -#: ../../library/ipaddress.rst:765 ../../library/ipaddress.rst:901 +#: ../../library/ipaddress.rst:755 ../../library/ipaddress.rst:891 msgid "Logical operators" msgstr "" -#: ../../library/ipaddress.rst:767 +#: ../../library/ipaddress.rst:757 msgid "" "Network objects can be compared with the usual set of logical operators. " "Network objects are ordered first by network address, then by net mask." msgstr "" -#: ../../library/ipaddress.rst:772 +#: ../../library/ipaddress.rst:762 msgid "Iteration" msgstr "" -#: ../../library/ipaddress.rst:774 +#: ../../library/ipaddress.rst:764 msgid "" "Network objects can be iterated to list all the addresses belonging to the " "network. For iteration, *all* hosts are returned, including unusable hosts " "(for usable hosts, use the :meth:`~IPv4Network.hosts` method). An example::" msgstr "" -#: ../../library/ipaddress.rst:801 +#: ../../library/ipaddress.rst:791 msgid "Networks as containers of addresses" msgstr "" -#: ../../library/ipaddress.rst:803 +#: ../../library/ipaddress.rst:793 msgid "Network objects can act as containers of addresses. Some examples::" msgstr "" -#: ../../library/ipaddress.rst:816 +#: ../../library/ipaddress.rst:806 msgid "Interface objects" msgstr "" -#: ../../library/ipaddress.rst:818 +#: ../../library/ipaddress.rst:808 msgid "" "Interface objects are :term:`hashable`, so they can be used as keys in " "dictionaries." msgstr "" -#: ../../library/ipaddress.rst:823 +#: ../../library/ipaddress.rst:813 msgid "" "Construct an IPv4 interface. The meaning of *address* is as in the " "constructor of :class:`IPv4Network`, except that arbitrary host addresses " "are always accepted." msgstr "" -#: ../../library/ipaddress.rst:827 +#: ../../library/ipaddress.rst:817 msgid "" ":class:`IPv4Interface` is a subclass of :class:`IPv4Address`, so it inherits " "all the attributes from that class. In addition, the following attributes " "are available:" msgstr "" -#: ../../library/ipaddress.rst:833 +#: ../../library/ipaddress.rst:823 msgid "The address (:class:`IPv4Address`) without network information." msgstr "" -#: ../../library/ipaddress.rst:841 +#: ../../library/ipaddress.rst:831 msgid "The network (:class:`IPv4Network`) this interface belongs to." msgstr "" -#: ../../library/ipaddress.rst:849 +#: ../../library/ipaddress.rst:839 msgid "" "A string representation of the interface with the mask in prefix notation." msgstr "" -#: ../../library/ipaddress.rst:857 +#: ../../library/ipaddress.rst:847 msgid "" "A string representation of the interface with the network as a net mask." msgstr "" -#: ../../library/ipaddress.rst:865 +#: ../../library/ipaddress.rst:855 msgid "" "A string representation of the interface with the network as a host mask." msgstr "" -#: ../../library/ipaddress.rst:874 +#: ../../library/ipaddress.rst:864 msgid "" "Construct an IPv6 interface. The meaning of *address* is as in the " "constructor of :class:`IPv6Network`, except that arbitrary host addresses " "are always accepted." msgstr "" -#: ../../library/ipaddress.rst:878 +#: ../../library/ipaddress.rst:868 msgid "" ":class:`IPv6Interface` is a subclass of :class:`IPv6Address`, so it inherits " "all the attributes from that class. In addition, the following attributes " "are available:" msgstr "" -#: ../../library/ipaddress.rst:888 +#: ../../library/ipaddress.rst:878 msgid "" "Refer to the corresponding attribute documentation in :class:`IPv4Interface`." msgstr "" -#: ../../library/ipaddress.rst:895 +#: ../../library/ipaddress.rst:885 msgid "" "Interface objects support some operators. Unless stated otherwise, " "operators can only be applied between compatible objects (i.e. IPv4 with " "IPv4, IPv6 with IPv6)." msgstr "" -#: ../../library/ipaddress.rst:903 +#: ../../library/ipaddress.rst:893 msgid "" "Interface objects can be compared with the usual set of logical operators." msgstr "" -#: ../../library/ipaddress.rst:905 +#: ../../library/ipaddress.rst:895 msgid "" "For equality comparison (``==`` and ``!=``), both the IP address and network " "must be the same for the objects to be equal. An interface will not compare " "equal to any address or network object." msgstr "" -#: ../../library/ipaddress.rst:909 +#: ../../library/ipaddress.rst:899 msgid "" "For ordering (``<``, ``>``, etc) the rules are different. Interface and " "address objects with the same IP version can be compared, and the address " @@ -855,15 +844,15 @@ msgid "" "then by their IP addresses." msgstr "" -#: ../../library/ipaddress.rst:917 +#: ../../library/ipaddress.rst:907 msgid "Other Module Level Functions" msgstr "" -#: ../../library/ipaddress.rst:919 +#: ../../library/ipaddress.rst:909 msgid "The module also provides the following module level functions:" msgstr "" -#: ../../library/ipaddress.rst:923 +#: ../../library/ipaddress.rst:913 msgid "" "Represent an address as 4 packed bytes in network (big-endian) order. " "*address* is an integer representation of an IPv4 IP address. A :exc:" @@ -871,7 +860,7 @@ msgid "" "IP address." msgstr "" -#: ../../library/ipaddress.rst:936 +#: ../../library/ipaddress.rst:926 msgid "" "Represent an address as 16 packed bytes in network (big-endian) order. " "*address* is an integer representation of an IPv6 IP address. A :exc:" @@ -879,7 +868,7 @@ msgid "" "IP address." msgstr "" -#: ../../library/ipaddress.rst:944 +#: ../../library/ipaddress.rst:934 msgid "" "Return an iterator of the summarized network range given the first and last " "IP addresses. *first* is the first :class:`IPv4Address` or :class:" @@ -890,7 +879,7 @@ msgid "" "address version is not 4 or 6." msgstr "" -#: ../../library/ipaddress.rst:960 +#: ../../library/ipaddress.rst:950 msgid "" "Return an iterator of the collapsed :class:`IPv4Network` or :class:" "`IPv6Network` objects. *addresses* is an iterator of :class:`IPv4Network` " @@ -898,38 +887,38 @@ msgid "" "*addresses* contains mixed version objects." msgstr "" -#: ../../library/ipaddress.rst:973 +#: ../../library/ipaddress.rst:963 msgid "" "Return a key suitable for sorting between networks and addresses. Address " "and Network objects are not sortable by default; they're fundamentally " "different, so the expression::" msgstr "" -#: ../../library/ipaddress.rst:979 +#: ../../library/ipaddress.rst:969 msgid "" "doesn't make sense. There are some times however, where you may wish to " "have :mod:`ipaddress` sort these anyway. If you need to do this, you can " "use this function as the *key* argument to :func:`sorted()`." msgstr "" -#: ../../library/ipaddress.rst:983 +#: ../../library/ipaddress.rst:973 msgid "*obj* is either a network or address object." msgstr "" -#: ../../library/ipaddress.rst:987 +#: ../../library/ipaddress.rst:977 msgid "Custom Exceptions" msgstr "" -#: ../../library/ipaddress.rst:989 +#: ../../library/ipaddress.rst:979 msgid "" "To support more specific error reporting from class constructors, the module " "defines the following exceptions:" msgstr "" -#: ../../library/ipaddress.rst:994 +#: ../../library/ipaddress.rst:984 msgid "Any value error related to the address." msgstr "" -#: ../../library/ipaddress.rst:999 +#: ../../library/ipaddress.rst:989 msgid "Any value error related to the net mask." msgstr "" diff --git a/library/pprint.po b/library/pprint.po index fc79fa256b..d6fc11af9a 100644 --- a/library/pprint.po +++ b/library/pprint.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-29 00:03+0000\n" +"POT-Creation-Date: 2024-03-06 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -83,7 +83,7 @@ msgid "" "The configuration parameters *stream*, *indent*, *width*, *depth*, " "*compact*, *sort_dicts* and *underscore_numbers* are passed to the :class:" "`PrettyPrinter` constructor and their meanings are as described in its " -"documentation above." +"documentation below." msgstr "" #: ../../library/pprint.rst:78 @@ -91,7 +91,7 @@ msgid "" "Return the formatted representation of *object* as a string. *indent*, " "*width*, *depth*, *compact*, *sort_dicts* and *underscore_numbers* are " "passed to the :class:`PrettyPrinter` constructor as formatting parameters " -"and their meanings are as described in its documentation above." +"and their meanings are as described in its documentation below." msgstr "" #: ../../library/pprint.rst:88 diff --git a/library/ssl.po b/library/ssl.po index b687c635f0..8600f8e6a6 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-25 06:20+0000\n" +"POT-Creation-Date: 2024-03-06 00:03+0000\n" "PO-Revision-Date: 2024-02-26 10:39+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -967,9 +967,10 @@ msgstr "" "Python 編譯舊版的 OpenSSL 時,該標志預設為 *0*。" #: ../../library/ssl.rst:740 +#, fuzzy msgid "" -"The option is deprecated since OpenSSL 1.1.0. It was added to 2.7.15, 3.6.3 " -"and 3.7.0 for backwards compatibility with OpenSSL 1.0.2." +"The option is deprecated since OpenSSL 1.1.0. It was added to 2.7.15 and " +"3.6.3 for backwards compatibility with OpenSSL 1.0.2." msgstr "" "此選項自 OpenSSL 1.1.0 以後已被棄用。它被添加到 2.7.15、3.6.3 和 3.7.0 中,以" "向後相容 OpenSSL 1.0.2。" diff --git a/library/typing.po b/library/typing.po index 10ae6d8bbb..6ff0ebf67a 100644 --- a/library/typing.po +++ b/library/typing.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-09 00:04+0000\n" +"POT-Creation-Date: 2024-03-06 00:03+0000\n" "PO-Revision-Date: 2023-12-15 14:45+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -473,8 +473,8 @@ msgstr "" "Callable` 或 :data:`typing.Callable` 進行註釋。 ``Callable[[int], str]`` 象徵" "為一個函式,可以接受一個型別為 :class:`int` 的引數,並回傳一個 :class:`str`。" -#: ../../library/typing.rst:271 ../../library/typing.rst:2890 -#: ../../library/typing.rst:3032 +#: ../../library/typing.rst:271 ../../library/typing.rst:2889 +#: ../../library/typing.rst:3031 msgid "For example:" msgstr "舉例來說:" @@ -527,7 +527,7 @@ msgstr "" "``Callable[Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable], " "ReturnType]`` 的形式。" -#: ../../library/typing.rst:341 ../../library/typing.rst:3561 +#: ../../library/typing.rst:341 ../../library/typing.rst:3557 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." @@ -982,9 +982,9 @@ msgid "" msgstr "" #: ../../library/typing.rst:843 ../../library/typing.rst:934 -#: ../../library/typing.rst:954 ../../library/typing.rst:1011 -#: ../../library/typing.rst:1177 ../../library/typing.rst:1234 -#: ../../library/typing.rst:1443 ../../library/typing.rst:2830 +#: ../../library/typing.rst:953 ../../library/typing.rst:1010 +#: ../../library/typing.rst:1176 ../../library/typing.rst:1233 +#: ../../library/typing.rst:1442 ../../library/typing.rst:2829 msgid "For example::" msgstr "" "舉例來說:\n" @@ -1010,7 +1010,7 @@ msgid "" "``LiteralString``." msgstr "" -#: ../../library/typing.rst:877 ../../library/typing.rst:1958 +#: ../../library/typing.rst:877 ../../library/typing.rst:1957 msgid "Example:" msgstr "" "舉例來說:\n" @@ -1059,17 +1059,17 @@ msgid "" "checkers should treat the two equivalently." msgstr "" -#: ../../library/typing.rst:952 +#: ../../library/typing.rst:951 msgid "Special type to represent the current enclosed class." msgstr "" -#: ../../library/typing.rst:968 +#: ../../library/typing.rst:967 msgid "" "This annotation is semantically equivalent to the following, albeit in a " "more succinct fashion::" msgstr "" -#: ../../library/typing.rst:980 +#: ../../library/typing.rst:979 msgid "" "In general, if something returns ``self``, as in the above examples, you " "should use ``Self`` as the return annotation. If ``Foo.return_self`` was " @@ -1078,48 +1078,48 @@ msgid "" "rather than ``SubclassOfFoo``." msgstr "" -#: ../../library/typing.rst:986 +#: ../../library/typing.rst:985 msgid "Other common use cases include:" msgstr "" -#: ../../library/typing.rst:988 +#: ../../library/typing.rst:987 msgid "" ":class:`classmethod`\\s that are used as alternative constructors and return " "instances of the ``cls`` parameter." msgstr "" -#: ../../library/typing.rst:990 +#: ../../library/typing.rst:989 msgid "Annotating an :meth:`~object.__enter__` method which returns self." msgstr "" -#: ../../library/typing.rst:992 +#: ../../library/typing.rst:991 msgid "" "You should not use ``Self`` as the return annotation if the method is not " "guaranteed to return an instance of a subclass when the class is subclassed::" msgstr "" -#: ../../library/typing.rst:1003 +#: ../../library/typing.rst:1002 msgid "See :pep:`673` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:1009 +#: ../../library/typing.rst:1008 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `." msgstr "" -#: ../../library/typing.rst:1017 +#: ../../library/typing.rst:1016 msgid "" "``TypeAlias`` is particularly useful on older Python versions for annotating " "aliases that make use of forward references, as it can be hard for type " "checkers to distinguish these from normal variable assignments:" msgstr "" -#: ../../library/typing.rst:1037 +#: ../../library/typing.rst:1036 msgid "See :pep:`613` for more details." msgstr "更多細節請見 :pep:`613`。" -#: ../../library/typing.rst:1041 +#: ../../library/typing.rst:1040 msgid "" ":data:`TypeAlias` is deprecated in favor of the :keyword:`type` statement, " "which creates instances of :class:`TypeAliasType` and which natively " @@ -1130,71 +1130,71 @@ msgid "" "to :keyword:`type` statements." msgstr "" -#: ../../library/typing.rst:1052 +#: ../../library/typing.rst:1051 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:1054 +#: ../../library/typing.rst:1053 msgid "" "These can be used as types in annotations. They all support subscription " "using ``[]``, but each has a unique syntax." msgstr "" -#: ../../library/typing.rst:1059 +#: ../../library/typing.rst:1058 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:1061 +#: ../../library/typing.rst:1060 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Using that shorthand is recommended. Details:" msgstr "" -#: ../../library/typing.rst:1063 +#: ../../library/typing.rst:1062 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:1065 +#: ../../library/typing.rst:1064 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:1069 +#: ../../library/typing.rst:1068 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:1073 +#: ../../library/typing.rst:1072 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:1077 +#: ../../library/typing.rst:1076 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:1081 +#: ../../library/typing.rst:1080 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:1083 +#: ../../library/typing.rst:1082 msgid "You cannot write ``Union[X][Y]``." msgstr "你不能寫成 ``Union[X][Y]``。" -#: ../../library/typing.rst:1085 +#: ../../library/typing.rst:1084 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:1088 +#: ../../library/typing.rst:1087 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:1094 +#: ../../library/typing.rst:1093 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:1096 +#: ../../library/typing.rst:1095 msgid "" "Note that this is not the same concept as an optional argument, which is one " "that has a default. An optional argument with a default does not require " @@ -1202,24 +1202,24 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:1104 +#: ../../library/typing.rst:1103 msgid "" "On the other hand, if an explicit value of ``None`` is allowed, the use of " "``Optional`` is appropriate, whether the argument is optional or not. For " "example::" msgstr "" -#: ../../library/typing.rst:1111 +#: ../../library/typing.rst:1110 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:1117 +#: ../../library/typing.rst:1116 msgid "Special form for annotating higher-order functions." msgstr "" -#: ../../library/typing.rst:1119 +#: ../../library/typing.rst:1118 msgid "" "``Concatenate`` can be used in conjunction with :ref:`Callable ` and :class:`ParamSpec` to annotate a higher-order callable which " @@ -1230,7 +1230,7 @@ msgid "" "``Concatenate`` must be a :class:`ParamSpec` or ellipsis (``...``)." msgstr "" -#: ../../library/typing.rst:1128 +#: ../../library/typing.rst:1127 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -1241,38 +1241,38 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:1164 ../../library/typing.rst:1926 +#: ../../library/typing.rst:1163 ../../library/typing.rst:1925 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)" msgstr "" -#: ../../library/typing.rst:1166 +#: ../../library/typing.rst:1165 msgid ":class:`ParamSpec`" msgstr ":class:`ParamSpec`" -#: ../../library/typing.rst:1167 ../../library/typing.rst:1929 +#: ../../library/typing.rst:1166 ../../library/typing.rst:1928 msgid ":ref:`annotating-callables`" msgstr ":ref:`annotating-callables`" -#: ../../library/typing.rst:1171 +#: ../../library/typing.rst:1170 msgid "Special typing form to define \"literal types\"." msgstr "" -#: ../../library/typing.rst:1173 +#: ../../library/typing.rst:1172 msgid "" "``Literal`` can be used to indicate to type checkers that the annotated " "object has a value equivalent to one of the provided literals." msgstr "" -#: ../../library/typing.rst:1189 +#: ../../library/typing.rst:1188 msgid "" "``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is " "allowed as type argument to ``Literal[...]``, but type checkers may impose " "restrictions. See :pep:`586` for more details about literal types." msgstr "" -#: ../../library/typing.rst:1195 +#: ../../library/typing.rst:1194 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -1280,22 +1280,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:1203 +#: ../../library/typing.rst:1202 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:1205 +#: ../../library/typing.rst:1204 msgid "" "As introduced in :pep:`526`, a variable annotation wrapped in ClassVar " "indicates that a given attribute is intended to be used as a class variable " "and should not be set on instances of that class. Usage::" msgstr "" -#: ../../library/typing.rst:1213 +#: ../../library/typing.rst:1212 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:1215 +#: ../../library/typing.rst:1214 msgid "" ":data:`ClassVar` is not a class itself, and should not be used with :func:" "`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " @@ -1303,27 +1303,27 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:1229 +#: ../../library/typing.rst:1228 msgid "Special typing construct to indicate final names to type checkers." msgstr "" -#: ../../library/typing.rst:1231 +#: ../../library/typing.rst:1230 msgid "" "Final names cannot be reassigned in any scope. Final names declared in class " "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1245 ../../library/typing.rst:2846 +#: ../../library/typing.rst:1244 ../../library/typing.rst:2845 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:1252 +#: ../../library/typing.rst:1251 msgid "Special typing construct to mark a :class:`TypedDict` key as required." msgstr "" -#: ../../library/typing.rst:1254 +#: ../../library/typing.rst:1253 msgid "" "This is mainly useful for ``total=False`` TypedDicts. See :class:`TypedDict` " "and :pep:`655` for more details." @@ -1331,21 +1331,21 @@ msgstr "" "主要用於 ``total=False`` 的 TypedDict。更多細節請見 :class:`TypedDict` 與 :" "pep:`655`。" -#: ../../library/typing.rst:1261 +#: ../../library/typing.rst:1260 msgid "" "Special typing construct to mark a :class:`TypedDict` key as potentially " "missing." msgstr "" -#: ../../library/typing.rst:1264 +#: ../../library/typing.rst:1263 msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1270 +#: ../../library/typing.rst:1269 msgid "Special typing form to add context-specific metadata to an annotation." msgstr "" -#: ../../library/typing.rst:1272 +#: ../../library/typing.rst:1271 msgid "" "Add metadata ``x`` to a given type ``T`` by using the annotation " "``Annotated[T, x]``. Metadata added using ``Annotated`` can be used by " @@ -1353,7 +1353,7 @@ msgid "" "a :attr:`!__metadata__` attribute." msgstr "" -#: ../../library/typing.rst:1277 +#: ../../library/typing.rst:1276 msgid "" "If a library or tool encounters an annotation ``Annotated[T, x]`` and has no " "special logic for the metadata, it should ignore the metadata and simply " @@ -1362,7 +1362,7 @@ msgid "" "system." msgstr "" -#: ../../library/typing.rst:1283 +#: ../../library/typing.rst:1282 msgid "" "Using ``Annotated[T, x]`` as an annotation still allows for static " "typechecking of ``T``, as type checkers will simply ignore the metadata " @@ -1372,7 +1372,7 @@ msgid "" "for a function or class." msgstr "" -#: ../../library/typing.rst:1290 +#: ../../library/typing.rst:1289 msgid "" "The responsibility of how to interpret the metadata lies with the tool or " "library encountering an ``Annotated`` annotation. A tool or library " @@ -1380,108 +1380,108 @@ msgid "" "determine if they are of interest (e.g., using :func:`isinstance`)." msgstr "" -#: ../../library/typing.rst:1298 +#: ../../library/typing.rst:1297 msgid "" "Here is an example of how you might use ``Annotated`` to add metadata to " "type annotations if you were doing range analysis:" msgstr "" -#: ../../library/typing.rst:1311 +#: ../../library/typing.rst:1310 msgid "Details of the syntax:" msgstr "" -#: ../../library/typing.rst:1313 +#: ../../library/typing.rst:1312 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:1315 +#: ../../library/typing.rst:1314 msgid "" "Multiple metadata elements can be supplied (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:1324 +#: ../../library/typing.rst:1323 msgid "" "It is up to the tool consuming the annotations to decide whether the client " "is allowed to add multiple metadata elements to one annotation and how to " "merge those annotations." msgstr "" -#: ../../library/typing.rst:1328 +#: ../../library/typing.rst:1327 msgid "" "``Annotated`` must be subscripted with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:1331 +#: ../../library/typing.rst:1330 msgid "" "The order of the metadata elements is preserved and matters for equality " "checks::" msgstr "" -#: ../../library/typing.rst:1338 +#: ../../library/typing.rst:1337 msgid "" "Nested ``Annotated`` types are flattened. The order of the metadata elements " "starts with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1345 +#: ../../library/typing.rst:1344 msgid "Duplicated metadata elements are not removed::" msgstr "" -#: ../../library/typing.rst:1351 +#: ../../library/typing.rst:1350 msgid "``Annotated`` can be used with nested and generic aliases:" msgstr "" -#: ../../library/typing.rst:1365 +#: ../../library/typing.rst:1364 msgid "``Annotated`` cannot be used with an unpacked :class:`TypeVarTuple`::" msgstr "" -#: ../../library/typing.rst:1369 +#: ../../library/typing.rst:1368 msgid "This would be equivalent to::" msgstr "" "這會等價於:\n" "\n" "::" -#: ../../library/typing.rst:1373 +#: ../../library/typing.rst:1372 msgid "" "where ``T1``, ``T2``, etc. are :class:`TypeVars `. This would be " "invalid: only one type should be passed to Annotated." msgstr "" -#: ../../library/typing.rst:1376 +#: ../../library/typing.rst:1375 msgid "" "By default, :func:`get_type_hints` strips the metadata from annotations. " "Pass ``include_extras=True`` to have the metadata preserved:" msgstr "" -#: ../../library/typing.rst:1389 +#: ../../library/typing.rst:1388 msgid "" "At runtime, the metadata associated with an ``Annotated`` type can be " "retrieved via the :attr:`!__metadata__` attribute:" msgstr "" -#: ../../library/typing.rst:1403 +#: ../../library/typing.rst:1402 msgid ":pep:`593` - Flexible function and variable annotations" msgstr "" -#: ../../library/typing.rst:1404 +#: ../../library/typing.rst:1403 msgid "The PEP introducing ``Annotated`` to the standard library." msgstr "" -#: ../../library/typing.rst:1411 +#: ../../library/typing.rst:1410 msgid "Special typing construct for marking user-defined type guard functions." msgstr "" -#: ../../library/typing.rst:1413 +#: ../../library/typing.rst:1412 msgid "" "``TypeGuard`` can be used to annotate the return type of a user-defined type " "guard function. ``TypeGuard`` only accepts a single type argument. At " "runtime, functions marked this way should return a boolean." msgstr "" -#: ../../library/typing.rst:1417 +#: ../../library/typing.rst:1416 msgid "" "``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " @@ -1490,44 +1490,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1432 +#: ../../library/typing.rst:1431 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " "type guard. Such a function should use ``TypeGuard[...]`` as its return " "type to alert static type checkers to this intention." msgstr "" -#: ../../library/typing.rst:1436 +#: ../../library/typing.rst:1435 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1439 +#: ../../library/typing.rst:1438 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1440 +#: ../../library/typing.rst:1439 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1457 +#: ../../library/typing.rst:1456 msgid "" "If ``is_str_list`` is a class or instance method, then the type in " "``TypeGuard`` maps to the type of the second parameter after ``cls`` or " "``self``." msgstr "" -#: ../../library/typing.rst:1461 +#: ../../library/typing.rst:1460 msgid "" "In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``, means " "that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from ``TypeA`` " "to ``TypeB``." msgstr "" -#: ../../library/typing.rst:1467 +#: ../../library/typing.rst:1466 msgid "" "``TypeB`` need not be a narrower form of ``TypeA`` -- it can even be a wider " "form. The main reason is to allow for things like narrowing ``list[object]`` " @@ -1536,24 +1536,24 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1473 +#: ../../library/typing.rst:1472 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1480 +#: ../../library/typing.rst:1479 msgid "Typing operator to conceptually mark an object as having been unpacked." msgstr "" -#: ../../library/typing.rst:1482 +#: ../../library/typing.rst:1481 msgid "" "For example, using the unpack operator ``*`` on a :ref:`type variable tuple " "` is equivalent to using ``Unpack`` to mark the type variable " "tuple as having been unpacked::" msgstr "" -#: ../../library/typing.rst:1491 +#: ../../library/typing.rst:1490 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context " "of :class:`typing.TypeVarTuple ` and :class:`builtins.tuple " @@ -1561,29 +1561,29 @@ msgid "" "versions of Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1505 +#: ../../library/typing.rst:1504 msgid "" "``Unpack`` can also be used along with :class:`typing.TypedDict` for typing " "``**kwargs`` in a function signature::" msgstr "" -#: ../../library/typing.rst:1518 +#: ../../library/typing.rst:1517 msgid "" "See :pep:`692` for more details on using ``Unpack`` for ``**kwargs`` typing." msgstr "" -#: ../../library/typing.rst:1523 +#: ../../library/typing.rst:1522 msgid "Building generic types and type aliases" msgstr "" -#: ../../library/typing.rst:1525 +#: ../../library/typing.rst:1524 msgid "" "The following classes should not be used directly as annotations. Their " "intended purpose is to be building blocks for creating generic types and " "type aliases." msgstr "" -#: ../../library/typing.rst:1529 +#: ../../library/typing.rst:1528 msgid "" "These objects can be created through special syntax (:ref:`type parameter " "lists ` and the :keyword:`type` statement). For compatibility " @@ -1591,62 +1591,62 @@ msgid "" "syntax, as documented below." msgstr "" -#: ../../library/typing.rst:1536 +#: ../../library/typing.rst:1535 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1538 +#: ../../library/typing.rst:1537 msgid "" "A generic type is typically declared by adding a list of type parameters " "after the class name::" msgstr "" -#: ../../library/typing.rst:1546 +#: ../../library/typing.rst:1545 msgid "" "Such a class implicitly inherits from ``Generic``. The runtime semantics of " "this syntax are discussed in the :ref:`Language Reference `." msgstr "" -#: ../../library/typing.rst:1550 +#: ../../library/typing.rst:1549 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1558 +#: ../../library/typing.rst:1557 msgid "" "Here the brackets after the function name indicate a :ref:`generic function " "`." msgstr "" -#: ../../library/typing.rst:1561 +#: ../../library/typing.rst:1560 msgid "" "For backwards compatibility, generic classes can also be declared by " "explicitly inheriting from ``Generic``. In this case, the type parameters " "must be declared separately::" msgstr "" -#: ../../library/typing.rst:1578 +#: ../../library/typing.rst:1577 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1580 +#: ../../library/typing.rst:1579 msgid "" "The preferred way to construct a type variable is via the dedicated syntax " "for :ref:`generic functions `, :ref:`generic classes " "`, and :ref:`generic type aliases `::" msgstr "" -#: ../../library/typing.rst:1588 +#: ../../library/typing.rst:1587 msgid "" "This syntax can also be used to create bound and constrained type variables::" msgstr "" -#: ../../library/typing.rst:1598 +#: ../../library/typing.rst:1597 msgid "" "However, if desired, reusable type variables can also be constructed " "manually, like so::" msgstr "" -#: ../../library/typing.rst:1604 +#: ../../library/typing.rst:1603 msgid "" "Type variables exist primarily for the benefit of static type checkers. " "They serve as the parameters for generic types as well as for generic " @@ -1654,13 +1654,13 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1625 +#: ../../library/typing.rst:1624 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1628 +#: ../../library/typing.rst:1627 msgid "" "The variance of type variables is inferred by type checkers when they are " "created through the :ref:`type parameter syntax ` or when " @@ -1670,92 +1670,92 @@ msgid "" "invariant. See :pep:`484` and :pep:`695` for more details." msgstr "" -#: ../../library/typing.rst:1636 +#: ../../library/typing.rst:1635 msgid "" "Bound type variables and constrained type variables have different semantics " "in several important ways. Using a *bound* type variable means that the " "``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1651 +#: ../../library/typing.rst:1650 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1663 +#: ../../library/typing.rst:1662 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1674 +#: ../../library/typing.rst:1673 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1678 +#: ../../library/typing.rst:1677 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1682 +#: ../../library/typing.rst:1681 msgid "Whether the type var has been explicitly marked as covariant." msgstr "" -#: ../../library/typing.rst:1686 +#: ../../library/typing.rst:1685 msgid "Whether the type var has been explicitly marked as contravariant." msgstr "" -#: ../../library/typing.rst:1690 +#: ../../library/typing.rst:1689 msgid "" "Whether the type variable's variance should be inferred by type checkers." msgstr "" -#: ../../library/typing.rst:1696 +#: ../../library/typing.rst:1695 msgid "The bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1700 +#: ../../library/typing.rst:1699 msgid "" "For type variables created through :ref:`type parameter syntax `, the bound is evaluated only when the attribute is accessed, not " "when the type variable is created (see :ref:`lazy-evaluation`)." msgstr "" -#: ../../library/typing.rst:1706 +#: ../../library/typing.rst:1705 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1710 +#: ../../library/typing.rst:1709 msgid "" "For type variables created through :ref:`type parameter syntax `, the constraints are evaluated only when the attribute is accessed, " "not when the type variable is created (see :ref:`lazy-evaluation`)." msgstr "" -#: ../../library/typing.rst:1716 +#: ../../library/typing.rst:1715 msgid "" "Type variables can now be declared using the :ref:`type parameter ` syntax introduced by :pep:`695`. The ``infer_variance`` parameter " "was added." msgstr "" -#: ../../library/typing.rst:1724 +#: ../../library/typing.rst:1723 msgid "" "Type variable tuple. A specialized form of :ref:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1727 +#: ../../library/typing.rst:1726 msgid "" "Type variable tuples can be declared in :ref:`type parameter lists ` using a single asterisk (``*``) before the name::" msgstr "" -#: ../../library/typing.rst:1733 +#: ../../library/typing.rst:1732 msgid "Or by explicitly invoking the ``TypeVarTuple`` constructor::" msgstr "" -#: ../../library/typing.rst:1741 +#: ../../library/typing.rst:1740 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1763,7 +1763,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1763 +#: ../../library/typing.rst:1762 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1773,36 +1773,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1771 +#: ../../library/typing.rst:1770 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1778 +#: ../../library/typing.rst:1777 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1786 +#: ../../library/typing.rst:1785 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:1802 +#: ../../library/typing.rst:1801 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1809 +#: ../../library/typing.rst:1808 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1819 +#: ../../library/typing.rst:1818 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1811,39 +1811,39 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1826 +#: ../../library/typing.rst:1825 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1830 +#: ../../library/typing.rst:1829 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:1836 +#: ../../library/typing.rst:1835 msgid "" "Type variable tuples can now be declared using the :ref:`type parameter " "` syntax introduced by :pep:`695`." msgstr "" -#: ../../library/typing.rst:1841 +#: ../../library/typing.rst:1840 msgid "" "Parameter specification variable. A specialized version of :ref:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1844 +#: ../../library/typing.rst:1843 msgid "" "In :ref:`type parameter lists `, parameter specifications can " "be declared with two asterisks (``**``)::" msgstr "" -#: ../../library/typing.rst:1849 +#: ../../library/typing.rst:1848 msgid "" "For compatibility with Python 3.11 and earlier, ``ParamSpec`` objects can " "also be created as follows::" msgstr "" -#: ../../library/typing.rst:1854 +#: ../../library/typing.rst:1853 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1853,7 +1853,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1861 +#: ../../library/typing.rst:1860 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1861,27 +1861,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1881 +#: ../../library/typing.rst:1880 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1885 +#: ../../library/typing.rst:1884 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1887 +#: ../../library/typing.rst:1886 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1894 +#: ../../library/typing.rst:1893 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1894,11 +1894,11 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1906 +#: ../../library/typing.rst:1905 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:1908 +#: ../../library/typing.rst:1907 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1907,23 +1907,23 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1918 +#: ../../library/typing.rst:1917 msgid "" "Parameter specifications can now be declared using the :ref:`type parameter " "` syntax introduced by :pep:`695`." msgstr "" -#: ../../library/typing.rst:1922 +#: ../../library/typing.rst:1921 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1928 +#: ../../library/typing.rst:1927 msgid ":data:`Concatenate`" msgstr ":data:`Concatenate`" -#: ../../library/typing.rst:1934 +#: ../../library/typing.rst:1933 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1931,75 +1931,75 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1939 +#: ../../library/typing.rst:1938 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``:" msgstr "" -#: ../../library/typing.rst:1956 +#: ../../library/typing.rst:1955 msgid "The type of type aliases created through the :keyword:`type` statement." msgstr "" -#: ../../library/typing.rst:1970 +#: ../../library/typing.rst:1969 msgid "The name of the type alias:" msgstr "" -#: ../../library/typing.rst:1980 +#: ../../library/typing.rst:1979 msgid "The module in which the type alias was defined::" msgstr "" -#: ../../library/typing.rst:1988 +#: ../../library/typing.rst:1987 msgid "" "The type parameters of the type alias, or an empty tuple if the alias is not " "generic:" msgstr "" -#: ../../library/typing.rst:2002 +#: ../../library/typing.rst:2001 msgid "" "The type alias's value. This is :ref:`lazily evaluated `, " "so names used in the definition of the alias are not resolved until the " "``__value__`` attribute is accessed:" msgstr "" -#: ../../library/typing.rst:2020 +#: ../../library/typing.rst:2019 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:2022 +#: ../../library/typing.rst:2021 msgid "" "These functions and classes should not be used directly as annotations. " "Their intended purpose is to be building blocks for creating and declaring " "types." msgstr "" -#: ../../library/typing.rst:2028 +#: ../../library/typing.rst:2027 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:2030 ../../library/typing.rst:2107 -#: ../../library/typing.rst:3072 +#: ../../library/typing.rst:2029 ../../library/typing.rst:2106 +#: ../../library/typing.rst:3071 msgid "Usage::" msgstr "" -#: ../../library/typing.rst:2036 +#: ../../library/typing.rst:2035 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:2040 +#: ../../library/typing.rst:2039 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:2049 +#: ../../library/typing.rst:2048 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:2051 +#: ../../library/typing.rst:2050 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -2008,83 +2008,83 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:2057 +#: ../../library/typing.rst:2056 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:2067 +#: ../../library/typing.rst:2066 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:2073 +#: ../../library/typing.rst:2072 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:2083 +#: ../../library/typing.rst:2082 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:2086 +#: ../../library/typing.rst:2085 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:2089 +#: ../../library/typing.rst:2088 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:2093 +#: ../../library/typing.rst:2092 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:2097 +#: ../../library/typing.rst:2096 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:2102 +#: ../../library/typing.rst:2101 msgid "Helper class to create low-overhead :ref:`distinct types `." msgstr "" -#: ../../library/typing.rst:2104 +#: ../../library/typing.rst:2103 msgid "" "A ``NewType`` is considered a distinct type by a typechecker. At runtime, " "however, calling a ``NewType`` returns its argument unchanged." msgstr "" -#: ../../library/typing.rst:2114 +#: ../../library/typing.rst:2113 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:2118 +#: ../../library/typing.rst:2117 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:2122 +#: ../../library/typing.rst:2121 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:2126 +#: ../../library/typing.rst:2125 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:2131 +#: ../../library/typing.rst:2130 msgid "Base class for protocol classes." msgstr "" -#: ../../library/typing.rst:2133 +#: ../../library/typing.rst:2132 msgid "Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:2139 +#: ../../library/typing.rst:2138 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:2151 +#: ../../library/typing.rst:2150 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -2092,21 +2092,21 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:2156 +#: ../../library/typing.rst:2155 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:2162 +#: ../../library/typing.rst:2161 msgid "" "In code that needs to be compatible with Python 3.11 or older, generic " "Protocols can be written as follows::" msgstr "" -#: ../../library/typing.rst:2175 +#: ../../library/typing.rst:2174 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:2177 +#: ../../library/typing.rst:2176 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This raises :exc:`TypeError` when applied to a non-protocol class. This " @@ -2115,7 +2115,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:2197 +#: ../../library/typing.rst:2196 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -2126,7 +2126,7 @@ msgid "" "(instantiate) :class:`ssl.SSLObject`." msgstr "" -#: ../../library/typing.rst:2208 +#: ../../library/typing.rst:2207 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -2134,7 +2134,7 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:2216 +#: ../../library/typing.rst:2215 msgid "" "The internal implementation of :func:`isinstance` checks against runtime-" "checkable protocols now uses :func:`inspect.getattr_static` to look up " @@ -2144,7 +2144,7 @@ msgid "" "versa. Most users are unlikely to be affected by this change." msgstr "" -#: ../../library/typing.rst:2225 +#: ../../library/typing.rst:2224 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " @@ -2153,13 +2153,13 @@ msgid "" "`\"What's new in Python 3.12\" ` for more details." msgstr "" -#: ../../library/typing.rst:2236 +#: ../../library/typing.rst:2235 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:2239 +#: ../../library/typing.rst:2238 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -2167,53 +2167,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:2255 +#: ../../library/typing.rst:2254 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms:" msgstr "" -#: ../../library/typing.rst:2259 +#: ../../library/typing.rst:2258 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:2263 +#: ../../library/typing.rst:2262 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:2270 +#: ../../library/typing.rst:2269 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:2271 +#: ../../library/typing.rst:2270 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:2283 +#: ../../library/typing.rst:2282 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:2294 +#: ../../library/typing.rst:2293 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:2297 +#: ../../library/typing.rst:2296 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:2307 +#: ../../library/typing.rst:2306 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -2221,53 +2221,53 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:2312 +#: ../../library/typing.rst:2311 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:2327 +#: ../../library/typing.rst:2326 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:2334 +#: ../../library/typing.rst:2333 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:2342 +#: ../../library/typing.rst:2341 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:2357 +#: ../../library/typing.rst:2356 msgid "A ``TypedDict`` can be generic::" msgstr "" -#: ../../library/typing.rst:2363 +#: ../../library/typing.rst:2362 msgid "" "To create a generic ``TypedDict`` that is compatible with Python 3.11 or " "lower, inherit from :class:`Generic` explicitly:" msgstr "" -#: ../../library/typing.rst:2374 +#: ../../library/typing.rst:2373 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:2380 +#: ../../library/typing.rst:2379 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2396 +#: ../../library/typing.rst:2395 msgid "" "This attribute reflects *only* the value of the ``total`` argument to the " "current ``TypedDict`` class, not whether the class is semantically total. " @@ -2278,21 +2278,21 @@ msgid "" "introspection." msgstr "" -#: ../../library/typing.rst:2409 +#: ../../library/typing.rst:2408 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2412 +#: ../../library/typing.rst:2411 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:2415 +#: ../../library/typing.rst:2414 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -2301,7 +2301,7 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2440 +#: ../../library/typing.rst:2439 msgid "" "If ``from __future__ import annotations`` is used or if annotations are " "given as strings, annotations are not evaluated when the ``TypedDict`` is " @@ -2310,133 +2310,133 @@ msgid "" "attributes may be incorrect." msgstr "" -#: ../../library/typing.rst:2446 +#: ../../library/typing.rst:2445 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2450 +#: ../../library/typing.rst:2449 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2454 +#: ../../library/typing.rst:2453 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2458 +#: ../../library/typing.rst:2457 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2460 +#: ../../library/typing.rst:2459 msgid "" "The following protocols are provided by the typing module. All are decorated " "with :func:`@runtime_checkable `." msgstr "" -#: ../../library/typing.rst:2465 +#: ../../library/typing.rst:2464 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2470 +#: ../../library/typing.rst:2469 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2474 +#: ../../library/typing.rst:2473 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2478 +#: ../../library/typing.rst:2477 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2482 +#: ../../library/typing.rst:2481 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2488 +#: ../../library/typing.rst:2487 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2492 +#: ../../library/typing.rst:2491 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2496 +#: ../../library/typing.rst:2495 msgid "ABCs for working with IO" msgstr "" -#: ../../library/typing.rst:2502 +#: ../../library/typing.rst:2501 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:2508 +#: ../../library/typing.rst:2507 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2512 +#: ../../library/typing.rst:2511 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2514 +#: ../../library/typing.rst:2513 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2521 +#: ../../library/typing.rst:2520 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2523 +#: ../../library/typing.rst:2522 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2526 +#: ../../library/typing.rst:2525 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2533 +#: ../../library/typing.rst:2532 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2547 +#: ../../library/typing.rst:2546 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2549 +#: ../../library/typing.rst:2548 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2560 +#: ../../library/typing.rst:2559 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " "and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2565 +#: ../../library/typing.rst:2564 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -2446,47 +2446,47 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2573 +#: ../../library/typing.rst:2572 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2576 +#: ../../library/typing.rst:2575 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2584 +#: ../../library/typing.rst:2583 msgid "Ask a static type checker to reveal the inferred type of an expression." msgstr "" -#: ../../library/typing.rst:2586 +#: ../../library/typing.rst:2585 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the inferred type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2592 +#: ../../library/typing.rst:2591 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2595 +#: ../../library/typing.rst:2594 msgid "" "At runtime, this function prints the runtime type of its argument to :data:" "`sys.stderr` and returns the argument unchanged (allowing the call to be " "used within an expression)::" msgstr "" -#: ../../library/typing.rst:2602 +#: ../../library/typing.rst:2601 msgid "" "Note that the runtime type may be different from (more or less specific " "than) the type statically inferred by a type checker." msgstr "" -#: ../../library/typing.rst:2605 +#: ../../library/typing.rst:2604 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing``, however, " @@ -2494,13 +2494,13 @@ msgid "" "clearly." msgstr "" -#: ../../library/typing.rst:2616 +#: ../../library/typing.rst:2615 msgid "" "Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:2619 +#: ../../library/typing.rst:2618 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -2509,19 +2509,19 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:2626 +#: ../../library/typing.rst:2625 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2640 +#: ../../library/typing.rst:2639 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2649 +#: ../../library/typing.rst:2648 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2660 +#: ../../library/typing.rst:2659 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*." msgstr "" -#: ../../library/typing.rst:2800 +#: ../../library/typing.rst:2799 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -2739,32 +2739,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2807 +#: ../../library/typing.rst:2806 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2815 +#: ../../library/typing.rst:2814 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2817 +#: ../../library/typing.rst:2816 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2824 +#: ../../library/typing.rst:2823 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2826 +#: ../../library/typing.rst:2825 msgid "" "Decorating a method with ``@final`` indicates to a type checker that the " "method cannot be overridden in a subclass. Decorating a class with " "``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:2851 +#: ../../library/typing.rst:2850 msgid "" "The decorator will now attempt to set a ``__final__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2774,11 +2774,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2862 +#: ../../library/typing.rst:2861 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2864 +#: ../../library/typing.rst:2863 msgid "" "This works as a class or function :term:`decorator`. With a class, it " "applies recursively to all methods and classes defined in that class (but " @@ -2786,38 +2786,38 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2870 +#: ../../library/typing.rst:2869 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2874 +#: ../../library/typing.rst:2873 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2876 +#: ../../library/typing.rst:2875 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2882 +#: ../../library/typing.rst:2881 msgid "" "Decorator to indicate that a method in a subclass is intended to override a " "method or attribute in a superclass." msgstr "" -#: ../../library/typing.rst:2885 +#: ../../library/typing.rst:2884 msgid "" "Type checkers should emit an error if a method decorated with ``@override`` " "does not, in fact, override anything. This helps prevent bugs that may occur " "when a base class is changed without an equivalent change to a child class." msgstr "" -#: ../../library/typing.rst:2907 +#: ../../library/typing.rst:2906 msgid "There is no runtime checking of this property." msgstr "" -#: ../../library/typing.rst:2909 +#: ../../library/typing.rst:2908 msgid "" "The decorator will attempt to set an ``__override__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, " @@ -2827,38 +2827,38 @@ msgid "" "without raising an exception." msgstr "" -#: ../../library/typing.rst:2916 +#: ../../library/typing.rst:2915 msgid "See :pep:`698` for more details." msgstr "更多細節請見 :pep:`698`。" -#: ../../library/typing.rst:2923 +#: ../../library/typing.rst:2922 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2925 +#: ../../library/typing.rst:2924 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2936 +#: ../../library/typing.rst:2935 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2940 +#: ../../library/typing.rst:2939 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2944 +#: ../../library/typing.rst:2943 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2947 +#: ../../library/typing.rst:2946 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2867,21 +2867,21 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2953 +#: ../../library/typing.rst:2952 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example:" msgstr "" -#: ../../library/typing.rst:2970 +#: ../../library/typing.rst:2969 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2975 +#: ../../library/typing.rst:2974 msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." @@ -2889,20 +2889,20 @@ msgstr "" "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。更多資訊請見 :data:" "`Annotated` 的文件。" -#: ../../library/typing.rst:2979 +#: ../../library/typing.rst:2978 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2986 +#: ../../library/typing.rst:2985 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:2989 +#: ../../library/typing.rst:2988 msgid "" "If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " "it will be normalized to the original class. If ``X`` is an instance of :" @@ -2910,17 +2910,17 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:2995 ../../library/typing.rst:3018 +#: ../../library/typing.rst:2994 ../../library/typing.rst:3017 msgid "Examples:" msgstr "舉例:" -#: ../../library/typing.rst:3010 +#: ../../library/typing.rst:3009 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: ../../library/typing.rst:3013 +#: ../../library/typing.rst:3012 msgid "" "If ``X`` is a union or :class:`Literal` contained in another generic type, " "the order of ``(Y, Z, ...)`` may be different from the order of the original " @@ -2928,40 +2928,40 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:3030 +#: ../../library/typing.rst:3029 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:3051 +#: ../../library/typing.rst:3050 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:3053 +#: ../../library/typing.rst:3052 msgid "" "For example, ``List[\"SomeClass\"]`` is implicitly transformed into " "``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:3058 +#: ../../library/typing.rst:3057 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:3065 +#: ../../library/typing.rst:3064 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:3069 +#: ../../library/typing.rst:3068 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:3080 +#: ../../library/typing.rst:3079 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2969,7 +2969,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:3087 +#: ../../library/typing.rst:3086 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2977,11 +2977,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:3099 +#: ../../library/typing.rst:3098 msgid "Deprecated aliases" msgstr "棄用的別名" -#: ../../library/typing.rst:3101 +#: ../../library/typing.rst:3100 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the typing module in " @@ -2990,7 +2990,7 @@ msgid "" "existing classes were enhanced to support ``[]`` (see :pep:`585`)." msgstr "" -#: ../../library/typing.rst:3108 +#: ../../library/typing.rst:3107 msgid "" "The redundant types are deprecated as of Python 3.9. However, while the " "aliases may be removed at some point, removal of these aliases is not " @@ -2998,7 +2998,7 @@ msgid "" "the interpreter for these aliases." msgstr "" -#: ../../library/typing.rst:3113 +#: ../../library/typing.rst:3112 msgid "" "If at some point it is decided to remove these deprecated aliases, a " "deprecation warning will be issued by the interpreter for at least two " @@ -3006,188 +3006,188 @@ msgid "" "typing module without deprecation warnings until at least Python 3.14." msgstr "" -#: ../../library/typing.rst:3118 +#: ../../library/typing.rst:3117 msgid "" "Type checkers are encouraged to flag uses of the deprecated types if the " "program they are checking targets a minimum Python version of 3.9 or newer." msgstr "" -#: ../../library/typing.rst:3124 +#: ../../library/typing.rst:3123 msgid "Aliases to built-in types" msgstr "內建型別的別名" -#: ../../library/typing.rst:3128 +#: ../../library/typing.rst:3127 msgid "Deprecated alias to :class:`dict`." msgstr "棄用 :class:`dict` 的別名。" -#: ../../library/typing.rst:3130 +#: ../../library/typing.rst:3129 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:3134 ../../library/typing.rst:3376 +#: ../../library/typing.rst:3133 ../../library/typing.rst:3372 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:3139 +#: ../../library/typing.rst:3138 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3145 +#: ../../library/typing.rst:3144 msgid "Deprecated alias to :class:`list`." msgstr "棄用 :class:`list` 的別名。" -#: ../../library/typing.rst:3147 +#: ../../library/typing.rst:3146 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:3151 +#: ../../library/typing.rst:3150 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:3159 +#: ../../library/typing.rst:3158 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3165 +#: ../../library/typing.rst:3164 msgid "Deprecated alias to :class:`builtins.set `." msgstr "棄用 :class:`builtins.set ` 的別名。" -#: ../../library/typing.rst:3167 +#: ../../library/typing.rst:3166 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:3171 +#: ../../library/typing.rst:3170 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3177 +#: ../../library/typing.rst:3176 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "棄用 :class:`builtins.frozenset ` 的別名。" -#: ../../library/typing.rst:3179 +#: ../../library/typing.rst:3178 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3186 +#: ../../library/typing.rst:3185 msgid "Deprecated alias for :class:`tuple`." msgstr "棄用 :class:`tuple` 的別名。" -#: ../../library/typing.rst:3188 +#: ../../library/typing.rst:3187 msgid "" ":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" "`annotating-tuples` for more details." msgstr "" -#: ../../library/typing.rst:3191 +#: ../../library/typing.rst:3190 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3197 +#: ../../library/typing.rst:3196 msgid "Deprecated alias to :class:`type`." msgstr "棄用 :class:`type` 的別名。" -#: ../../library/typing.rst:3199 +#: ../../library/typing.rst:3198 msgid "" "See :ref:`type-of-class-objects` for details on using :class:`type` or " "``typing.Type`` in type annotations." msgstr "" -#: ../../library/typing.rst:3204 +#: ../../library/typing.rst:3203 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3211 +#: ../../library/typing.rst:3210 msgid "Aliases to types in :mod:`collections`" msgstr ":mod:`collections` 中型別的別名" -#: ../../library/typing.rst:3215 +#: ../../library/typing.rst:3214 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "棄用 :class:`collections.defaultdict` 的別名。" -#: ../../library/typing.rst:3219 +#: ../../library/typing.rst:3218 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3225 +#: ../../library/typing.rst:3224 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "棄用 :class:`collections.OrderedDict` 的別名。" -#: ../../library/typing.rst:3229 +#: ../../library/typing.rst:3228 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3235 +#: ../../library/typing.rst:3234 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "棄用 :class:`collections.ChainMap` 的別名。" -#: ../../library/typing.rst:3240 +#: ../../library/typing.rst:3238 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3246 +#: ../../library/typing.rst:3244 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "棄用 :class:`collections.Counter` 的別名。" -#: ../../library/typing.rst:3251 +#: ../../library/typing.rst:3248 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3257 +#: ../../library/typing.rst:3254 msgid "Deprecated alias to :class:`collections.deque`." msgstr "棄用 :class:`collections.deque` 的別名。" -#: ../../library/typing.rst:3262 +#: ../../library/typing.rst:3258 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3269 +#: ../../library/typing.rst:3265 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:3274 +#: ../../library/typing.rst:3270 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:3278 +#: ../../library/typing.rst:3274 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3277 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -3195,391 +3195,391 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:3289 +#: ../../library/typing.rst:3285 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:3290 +#: ../../library/typing.rst:3286 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3296 +#: ../../library/typing.rst:3292 msgid "Deprecated alias for :class:`str`." msgstr "棄用 :class:`str` 的別名。" -#: ../../library/typing.rst:3298 +#: ../../library/typing.rst:3294 msgid "" "``Text`` is provided to supply a forward compatible path for Python 2 code: " "in Python 2, ``Text`` is an alias for ``unicode``." msgstr "" -#: ../../library/typing.rst:3302 +#: ../../library/typing.rst:3298 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:3310 +#: ../../library/typing.rst:3306 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:3320 +#: ../../library/typing.rst:3316 msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr ":mod:`collections.abc` 中容器 ABC 的別名" -#: ../../library/typing.rst:3324 +#: ../../library/typing.rst:3320 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "棄用 :class:`collections.abc.Set` 的別名。" -#: ../../library/typing.rst:3326 +#: ../../library/typing.rst:3322 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3332 +#: ../../library/typing.rst:3328 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:3336 +#: ../../library/typing.rst:3332 msgid "" "Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray " "| memoryview``." msgstr "" -#: ../../library/typing.rst:3340 +#: ../../library/typing.rst:3336 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "棄用 :class:`collections.abc.Collection` 的別名。" -#: ../../library/typing.rst:3344 +#: ../../library/typing.rst:3340 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3350 +#: ../../library/typing.rst:3346 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "棄用 :class:`collections.abc.Container` 的別名。" -#: ../../library/typing.rst:3352 +#: ../../library/typing.rst:3348 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3358 +#: ../../library/typing.rst:3354 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "棄用 :class:`collections.abc.ItemsView` 的別名。" -#: ../../library/typing.rst:3360 +#: ../../library/typing.rst:3356 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3366 +#: ../../library/typing.rst:3362 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "棄用 :class:`collections.abc.KeysView` 的別名。" -#: ../../library/typing.rst:3368 +#: ../../library/typing.rst:3364 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3374 +#: ../../library/typing.rst:3370 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "棄用 :class:`collections.abc.Mapping` 的別名。" -#: ../../library/typing.rst:3381 +#: ../../library/typing.rst:3377 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3387 +#: ../../library/typing.rst:3383 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "棄用 :class:`collections.abc.MappingView` 的別名。" -#: ../../library/typing.rst:3389 +#: ../../library/typing.rst:3385 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3395 +#: ../../library/typing.rst:3391 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "棄用 :class:`collections.abc.MutableMapping` 的別名。" -#: ../../library/typing.rst:3397 +#: ../../library/typing.rst:3393 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3404 +#: ../../library/typing.rst:3400 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "棄用 :class:`collections.abc.MutableSequence` 的別名。" -#: ../../library/typing.rst:3406 +#: ../../library/typing.rst:3402 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3413 +#: ../../library/typing.rst:3409 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "棄用 :class:`collections.abc.MutableSet` 的別名。" -#: ../../library/typing.rst:3415 +#: ../../library/typing.rst:3411 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3421 +#: ../../library/typing.rst:3417 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "棄用 :class:`collections.abc.Sequence` 的別名。" -#: ../../library/typing.rst:3423 +#: ../../library/typing.rst:3419 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3429 +#: ../../library/typing.rst:3425 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "棄用 :class:`collections.abc.ValuesView` 的別名。" -#: ../../library/typing.rst:3431 +#: ../../library/typing.rst:3427 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3438 +#: ../../library/typing.rst:3434 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3442 +#: ../../library/typing.rst:3438 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "棄用 :class:`collections.abc.Coroutine` 的別名。" -#: ../../library/typing.rst:3444 +#: ../../library/typing.rst:3440 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:3455 +#: ../../library/typing.rst:3451 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3461 +#: ../../library/typing.rst:3457 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "棄用 :class:`collections.abc.AsyncGenerator` 的別名。" -#: ../../library/typing.rst:3463 +#: ../../library/typing.rst:3459 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3472 +#: ../../library/typing.rst:3468 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:3476 +#: ../../library/typing.rst:3472 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3484 +#: ../../library/typing.rst:3480 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3494 +#: ../../library/typing.rst:3490 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3501 +#: ../../library/typing.rst:3497 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "棄用 :class:`collections.abc.AsyncIterable` 的別名。" -#: ../../library/typing.rst:3505 +#: ../../library/typing.rst:3501 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3511 +#: ../../library/typing.rst:3507 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "棄用 :class:`collections.abc.AsyncIterator` 的別名。" -#: ../../library/typing.rst:3515 +#: ../../library/typing.rst:3511 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3521 +#: ../../library/typing.rst:3517 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "棄用 :class:`collections.abc.Awaitable` 的別名。" -#: ../../library/typing.rst:3525 +#: ../../library/typing.rst:3521 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3532 +#: ../../library/typing.rst:3528 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3536 +#: ../../library/typing.rst:3532 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "棄用 :class:`collections.abc.Iterable` 的別名。" -#: ../../library/typing.rst:3538 +#: ../../library/typing.rst:3534 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3544 +#: ../../library/typing.rst:3540 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "棄用 :class:`collections.abc.Iterator` 的別名。" -#: ../../library/typing.rst:3546 +#: ../../library/typing.rst:3542 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3552 +#: ../../library/typing.rst:3548 msgid "Deprecated alias to :class:`collections.abc.Callable`." msgstr "棄用 :class:`collections.abc.Callable` 的別名。" -#: ../../library/typing.rst:3554 +#: ../../library/typing.rst:3550 msgid "" "See :ref:`annotating-callables` for details on how to use :class:" "`collections.abc.Callable` and ``typing.Callable`` in type annotations." msgstr "" -#: ../../library/typing.rst:3557 +#: ../../library/typing.rst:3553 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3567 +#: ../../library/typing.rst:3563 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "棄用 :class:`collections.abc.Generator` 的別名。" -#: ../../library/typing.rst:3569 +#: ../../library/typing.rst:3565 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:3578 +#: ../../library/typing.rst:3574 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:3582 +#: ../../library/typing.rst:3578 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3590 +#: ../../library/typing.rst:3586 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3598 +#: ../../library/typing.rst:3594 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3604 +#: ../../library/typing.rst:3600 msgid "Deprecated alias to :class:`collections.abc.Hashable`." msgstr "棄用 :class:`collections.abc.Hashable` 的別名。" -#: ../../library/typing.rst:3606 +#: ../../library/typing.rst:3602 msgid "Use :class:`collections.abc.Hashable` directly instead." msgstr "改為直接使用 :class:`collections.abc.Hashable`。" -#: ../../library/typing.rst:3611 +#: ../../library/typing.rst:3607 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "棄用 :class:`collections.abc.Reversible` 的別名。" -#: ../../library/typing.rst:3613 +#: ../../library/typing.rst:3609 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3619 +#: ../../library/typing.rst:3615 msgid "Deprecated alias to :class:`collections.abc.Sized`." msgstr "棄用 :class:`collections.abc.Sized` 的別名。" -#: ../../library/typing.rst:3621 +#: ../../library/typing.rst:3617 msgid "Use :class:`collections.abc.Sized` directly instead." msgstr "改為直接使用 :class:`collections.abc.Sized`。" -#: ../../library/typing.rst:3627 +#: ../../library/typing.rst:3623 msgid "Aliases to :mod:`contextlib` ABCs" msgstr ":mod:`contextlib` ABC 的別名" -#: ../../library/typing.rst:3631 +#: ../../library/typing.rst:3627 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3636 +#: ../../library/typing.rst:3631 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3643 +#: ../../library/typing.rst:3638 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3648 +#: ../../library/typing.rst:3642 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3654 +#: ../../library/typing.rst:3648 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3656 +#: ../../library/typing.rst:3650 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3587,99 +3587,99 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3663 +#: ../../library/typing.rst:3657 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3664 +#: ../../library/typing.rst:3658 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3665 +#: ../../library/typing.rst:3659 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3666 +#: ../../library/typing.rst:3660 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3667 +#: ../../library/typing.rst:3661 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "``typing.io`` 和 ``typing.re`` 子模組" -#: ../../library/typing.rst:3668 +#: ../../library/typing.rst:3662 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3669 +#: ../../library/typing.rst:3663 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3670 +#: ../../library/typing.rst:3664 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3671 +#: ../../library/typing.rst:3665 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3672 ../../library/typing.rst:3676 +#: ../../library/typing.rst:3666 ../../library/typing.rst:3670 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3673 +#: ../../library/typing.rst:3667 msgid "Undecided (see :ref:`deprecated-aliases` for more information)" msgstr "" -#: ../../library/typing.rst:3674 +#: ../../library/typing.rst:3668 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3675 +#: ../../library/typing.rst:3669 msgid ":class:`typing.ByteString`" msgstr ":class:`typing.ByteString`" -#: ../../library/typing.rst:3677 +#: ../../library/typing.rst:3671 msgid "3.14" msgstr "3.14" -#: ../../library/typing.rst:3678 +#: ../../library/typing.rst:3672 msgid ":gh:`91896`" msgstr ":gh:`91896`" -#: ../../library/typing.rst:3679 +#: ../../library/typing.rst:3673 msgid ":data:`typing.Text`" msgstr ":data:`typing.Text`" -#: ../../library/typing.rst:3680 +#: ../../library/typing.rst:3674 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3681 ../../library/typing.rst:3685 -#: ../../library/typing.rst:3689 +#: ../../library/typing.rst:3675 ../../library/typing.rst:3679 +#: ../../library/typing.rst:3683 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:3682 +#: ../../library/typing.rst:3676 msgid ":gh:`92332`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:3683 +#: ../../library/typing.rst:3677 msgid ":class:`typing.Hashable` and :class:`typing.Sized`" msgstr ":class:`typing.Hashable` 和 :class:`typing.Sized`" -#: ../../library/typing.rst:3684 ../../library/typing.rst:3688 +#: ../../library/typing.rst:3678 ../../library/typing.rst:3682 msgid "3.12" msgstr "" -#: ../../library/typing.rst:3686 +#: ../../library/typing.rst:3680 msgid ":gh:`94309`" msgstr ":gh:`94309`" -#: ../../library/typing.rst:3687 +#: ../../library/typing.rst:3681 msgid ":data:`typing.TypeAlias`" msgstr ":data:`typing.TypeAlias`" -#: ../../library/typing.rst:3690 +#: ../../library/typing.rst:3684 msgid ":pep:`695`" msgstr ":pep:`695`" From 948b7f4101edad98b34f7e12f3ab7796244d784d Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Wed, 6 Mar 2024 13:32:08 +0800 Subject: [PATCH 29/33] fix: resolve fuzzy entries --- howto/descriptor.po | 3 +- howto/pyporting.po | 30 ------- howto/sorting.po | 14 ++- library/abc.po | 7 +- library/ast.po | 3 +- library/audit_events.po | 5 +- library/datetime.po | 6 +- library/itertools.po | 9 +- library/multiprocessing.po | 9 +- library/numbers.po | 3 +- library/pyexpat.po | 5 +- library/random.po | 3 +- library/socket.po | 3 +- library/ssl.po | 5 +- library/unittest.mock.po | 32 +++---- library/xml.po | 18 ++-- tutorial/introduction.po | 179 +++++++++---------------------------- using/mac.po | 68 ++++++-------- whatsnew/2.0.po | 3 +- whatsnew/2.1.po | 21 ++--- whatsnew/2.7.po | 3 +- whatsnew/3.10.po | 3 +- whatsnew/3.2.po | 18 ++-- whatsnew/3.5.po | 2 +- whatsnew/3.6.po | 14 +-- whatsnew/3.7.po | 10 +-- whatsnew/3.8.po | 14 +-- whatsnew/3.9.po | 13 ++- 28 files changed, 164 insertions(+), 339 deletions(-) diff --git a/howto/descriptor.po b/howto/descriptor.po index 14c4920eb4..15242f52c8 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -19,9 +19,8 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/descriptor.rst:5 -#, fuzzy msgid "Descriptor Guide" -msgstr "描述器 HowTo 指南" +msgstr "描述器 (Descriptor) 指南" #: ../../howto/descriptor.rst:0 msgid "Author" diff --git a/howto/pyporting.po b/howto/pyporting.po index 4e4d90aa6e..4be4e852b8 100644 --- a/howto/pyporting.po +++ b/howto/pyporting.po @@ -84,33 +84,3 @@ msgid "" "`Guide by ActiveState `_" msgstr "" - -#~ msgid "Abstract" -#~ msgstr "摘要" - -#~ msgid "The Short Explanation" -#~ msgstr "簡短的說明" - -#~ msgid "Learn the differences between Python 2 and 3" -#~ msgstr "瞭解 Python 2 & 3 的差異" - -#~ msgid "Details" -#~ msgstr "詳細的" - -#~ msgid "Have good test coverage" -#~ msgstr "有好的測試覆蓋率" - -#~ msgid "Be aware of the differences between Python 2 and 3" -#~ msgstr "注意 Python 2 & 3 的差異" - -#~ msgid "Update your code" -#~ msgstr "更新你的程式碼" - -#~ msgid "\\" -#~ msgstr "\\" - -#~ msgid "isdecimal" -#~ msgstr "isdecimal" - -#~ msgid "isnumeric" -#~ msgstr "isnumeric" diff --git a/howto/sorting.po b/howto/sorting.po index 8b88e5541f..9f807932b3 100644 --- a/howto/sorting.po +++ b/howto/sorting.po @@ -20,9 +20,8 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/sorting.rst:4 -#, fuzzy msgid "Sorting Techniques" -msgstr "基礎排序" +msgstr "排序技法" #: ../../howto/sorting.rst:0 msgid "Author" @@ -127,21 +126,20 @@ msgid "" msgstr "" #: ../../howto/sorting.rst:104 -#, fuzzy msgid "Operator Module Functions and Partial Function Evaluation" -msgstr "Operator 模組的函式" +msgstr "" #: ../../howto/sorting.rst:106 -#, fuzzy msgid "" "The :term:`key function` patterns shown above are very common, so Python " "provides convenience functions to make accessor functions easier and faster. " "The :mod:`operator` module has :func:`~operator.itemgetter`, :func:" "`~operator.attrgetter`, and a :func:`~operator.methodcaller` function." msgstr "" -"上述的鍵函式模式非常常見,所以 Python 提供了方便的函式讓物件存取更簡單且快" -"速。:mod:`operator` 模組裡有 :func:`~operator.itemgetter`、:func:`~operator." -"attrgetter` 及 :func:`~operator.methodcaller` 函式可以使用。" +"上述的\\ :term:`鍵函式 `\\ 模式非常常見,所以 Python 提供了方便" +"的函式讓物件存取更簡單且快速。:mod:`operator` 模組裡有 :func:`~operator." +"itemgetter`、:func:`~operator.attrgetter` 及 :func:`~operator.methodcaller` " +"函式可以使用。" #: ../../howto/sorting.rst:111 msgid "Using those functions, the above examples become simpler and faster:" diff --git a/library/abc.po b/library/abc.po index 15dffc36ac..744f7f87e4 100644 --- a/library/abc.po +++ b/library/abc.po @@ -150,7 +150,6 @@ msgstr "" "__subclasscheck__` 方法中呼叫。)" #: ../../library/abc.rst:104 -#, fuzzy msgid "" "This method should return ``True``, ``False`` or :data:`NotImplemented`. If " "it returns ``True``, the *subclass* is considered a subclass of this ABC. If " @@ -158,10 +157,10 @@ msgid "" "ABC, even if it would normally be one. If it returns :data:`!" "NotImplemented`, the subclass check is continued with the usual mechanism." msgstr "" -"此方法必須回傳 ``True``、``False`` 或是 ``NotImplemented``。如果回傳 " +"此方法必須回傳 ``True``、``False`` 或是 :data:`NotImplemented`。如果回傳 " "``True``,*subclass* 就會被認為是這個 ABC 的子類別。如果回傳 ``False``," -"*subclass* 就會被判定並非該 ABC 的子類別,即便正常情況應如此。如果回傳 " -"``NotImplemented``,子類別檢查會按照正常機制繼續執行。" +"*subclass* 就會被判定並非該 ABC 的子類別,即便正常情況應如此。如果回傳 :data:" +"`!NotImplemented`,子類別檢查會按照正常機制繼續執行。" #: ../../library/abc.rst:114 msgid "" diff --git a/library/ast.po b/library/ast.po index 5208497eb1..7384b4376d 100644 --- a/library/ast.po +++ b/library/ast.po @@ -1304,10 +1304,9 @@ msgid "" msgstr "" #: ../../library/ast.rst:2191 -#, fuzzy msgid "" "If source contains a null character (``\\0``), :exc:`ValueError` is raised." -msgstr "如果來源包含 null 字元 ('\\0'),則會引發 :exc:`ValueError`。" +msgstr "如果來源包含 null 字元 (``\\0``),則會引發 :exc:`ValueError`。" #: ../../library/ast.rst:2194 msgid "" diff --git a/library/audit_events.po b/library/audit_events.po index ce76723467..935f0dbc57 100644 --- a/library/audit_events.po +++ b/library/audit_events.po @@ -23,15 +23,14 @@ msgid "Audit events table" msgstr "稽核事件表" #: ../../library/audit_events.rst:8 -#, fuzzy msgid "" "This table contains all events raised by :func:`sys.audit` or :c:func:" "`PySys_Audit` calls throughout the CPython runtime and the standard " "library. These calls were added in 3.8 or later (see :pep:`578`)." msgstr "" "這張表包含了所有在 CPython 運行環境 (runtime) 與標準函式庫對於 :func:`sys." -"audit` 或 :c:func:`PySys_Audit` 的呼叫所觸發的事件。這些呼叫是在 3.8.0 或更新" -"的版本中被新增(請見 :pep:`578`\\ )。" +"audit` 或 :c:func:`PySys_Audit` 的呼叫所觸發的事件。這些呼叫是在 3.8 或更新的" +"版本中被新增(請見 :pep:`578`\\ )。" #: ../../library/audit_events.rst:12 msgid "" diff --git a/library/datetime.po b/library/datetime.po index ada6c428d1..f533117cdb 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -2049,12 +2049,8 @@ msgid "" msgstr "" #: ../../library/datetime.rst:1794 -#, fuzzy msgid "Examples:" -msgstr "" -"範例:\n" -"\n" -"::" +msgstr "範例: ::" #: ../../library/datetime.rst:1818 msgid "" diff --git a/library/itertools.po b/library/itertools.po index 6e197c4b74..9440dcf5a6 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -210,14 +210,12 @@ msgstr ":func:`dropwhile`" #: ../../library/itertools.rst:59 ../../library/itertools.rst:60 #: ../../library/itertools.rst:65 -#, fuzzy msgid "predicate, seq" -msgstr "pred, seq" +msgstr "predicate, seq" #: ../../library/itertools.rst:59 -#, fuzzy msgid "seq[n], seq[n+1], starting when predicate fails" -msgstr "seq[0], seq[1], until pred fails" +msgstr "" #: ../../library/itertools.rst:59 msgid "``dropwhile(lambda x: x<5, [1,4,6,4,1]) --> 6 4 1``" @@ -296,9 +294,8 @@ msgid ":func:`takewhile`" msgstr ":func:`takewhile`" #: ../../library/itertools.rst:65 -#, fuzzy msgid "seq[0], seq[1], until predicate fails" -msgstr "seq[0], seq[1], until pred fails" +msgstr "" #: ../../library/itertools.rst:65 msgid "``takewhile(lambda x: x<5, [1,4,6,4,1]) --> 1 4``" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 3049265a60..49c0878d26 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -479,9 +479,8 @@ msgid "" msgstr "" #: ../../library/multiprocessing.rst:521 -#, fuzzy msgid "Added the *daemon* parameter." -msgstr "新增 *daemon* 引數。" +msgstr "新增 *daemon* 參數。" #: ../../library/multiprocessing.rst:526 msgid "Method representing the process's activity." @@ -2465,14 +2464,12 @@ msgid "" msgstr "" #: ../../library/multiprocessing.rst:2245 -#, fuzzy msgid "Added the *maxtasksperchild* parameter." -msgstr "新增 *shutdown_timeout* 參數。" +msgstr "新增 *maxtasksperchild* 參數。" #: ../../library/multiprocessing.rst:2248 -#, fuzzy msgid "Added the *context* parameter." -msgstr "新增 *shutdown_timeout* 參數。" +msgstr "新增 *context* 參數。" #: ../../library/multiprocessing.rst:2253 msgid "" diff --git a/library/numbers.po b/library/numbers.po index 2a1e964fcd..4036074932 100644 --- a/library/numbers.po +++ b/library/numbers.po @@ -208,7 +208,6 @@ msgstr "" "如果 ``A`` 有定義成一個接受 ``b`` 的 :meth:`~object.__add__`,不會發生問題。" #: ../../library/numbers.rst:166 -#, fuzzy msgid "" "If ``A`` falls back to the boilerplate code, and it were to return a value " "from :meth:`~object.__add__`, we'd miss the possibility that ``B`` defines a " @@ -218,7 +217,7 @@ msgid "" msgstr "" "如果 ``A`` 回退成模板程式碼,它將回傳一個來自 :meth:`~object.__add__` 的值," "並喪失讓 ``B`` 定義一個更完善的 :meth:`~object.__radd__` 的機會,因此模板需要" -"回傳一個來自 :meth:`!__add__` 的 :const:`NotImplemented`。(或者 ``A`` 可能完" +"回傳一個來自 :meth:`!__add__` 的 :data:`NotImplemented`。(或者 ``A`` 可能完" "全不實作 :meth:`!__add__`。)" #: ../../library/numbers.rst:172 diff --git a/library/pyexpat.po b/library/pyexpat.po index 4760c62bad..335e889b0a 100644 --- a/library/pyexpat.po +++ b/library/pyexpat.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -58,7 +57,7 @@ msgstr "" #: ../../library/pyexpat.rst:52 msgid "Alias for :exc:`ExpatError`." -msgstr "" +msgstr ":exc:`ExpatError` 的別名。" #: ../../library/pyexpat.rst:57 msgid "The type of the return values from the :func:`ParserCreate` function." diff --git a/library/random.po b/library/random.po index f94d5dd21b..5ada4c6bcd 100644 --- a/library/random.po +++ b/library/random.po @@ -513,12 +513,11 @@ msgstr "" "a`` 時確保 N 為 ``b <= N <= a``。" #: ../../library/random.rst:303 -#, fuzzy msgid "" "The end-point value ``b`` may or may not be included in the range depending " "on floating-point rounding in the expression ``a + (b-a) * random()``." msgstr "" -"終點值 ``b`` 可能包含在範圍內,也可能不包含在範圍內,取決於方程式 ``a + (b-" +"終點值 ``b`` 可能包含在範圍內,也可能不包含在範圍內,取決於運算式 ``a + (b-" "a) * random()`` 中的浮點捨入。" #: ../../library/random.rst:310 diff --git a/library/socket.po b/library/socket.po index bb52ed1747..47b348dc47 100644 --- a/library/socket.po +++ b/library/socket.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: diff --git a/library/ssl.po b/library/ssl.po index 8600f8e6a6..9f2cf16f18 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -967,13 +967,12 @@ msgstr "" "Python 編譯舊版的 OpenSSL 時,該標志預設為 *0*。" #: ../../library/ssl.rst:740 -#, fuzzy msgid "" "The option is deprecated since OpenSSL 1.1.0. It was added to 2.7.15 and " "3.6.3 for backwards compatibility with OpenSSL 1.0.2." msgstr "" -"此選項自 OpenSSL 1.1.0 以後已被棄用。它被添加到 2.7.15、3.6.3 和 3.7.0 中,以" -"向後相容 OpenSSL 1.0.2。" +"此選項自 OpenSSL 1.1.0 以後已被棄用。它被添加到 2.7.15 和 3.6.3 中,以向後相" +"容 OpenSSL 1.0.2。" #: ../../library/ssl.rst:746 msgid "" diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 75c049252b..eaa1c30c4c 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -2175,64 +2175,60 @@ msgid "Methods and their defaults:" msgstr "方法及其預設值:" #: ../../library/unittest.mock.rst:2097 -#, fuzzy msgid "``__lt__``: :data:`NotImplemented`" -msgstr "``__lt__``\\ :\\ ``NotImplemented``" +msgstr "``__lt__``::data:`NotImplemented`" #: ../../library/unittest.mock.rst:2098 -#, fuzzy msgid "``__gt__``: :data:`!NotImplemented`" -msgstr "``__gt__``\\ :\\ ``NotImplemented``" +msgstr "``__gt__``::data:`!NotImplemented`" #: ../../library/unittest.mock.rst:2099 -#, fuzzy msgid "``__le__``: :data:`!NotImplemented`" -msgstr "``__le__``\\ :\\ ``NotImplemented``" +msgstr "``__le__``::data:`!NotImplemented`" #: ../../library/unittest.mock.rst:2100 -#, fuzzy msgid "``__ge__``: :data:`!NotImplemented`" -msgstr "``__ge__``\\ :\\ ``NotImplemented``" +msgstr "``__ge__``::data:`!NotImplemented`" #: ../../library/unittest.mock.rst:2101 msgid "``__int__``: ``1``" -msgstr "``__int__``\\ :\\ ``1``" +msgstr "``__int__``:``1``" #: ../../library/unittest.mock.rst:2102 msgid "``__contains__``: ``False``" -msgstr "``__contains__``\\ :\\ ``False``" +msgstr "``__contains__``:``False``" #: ../../library/unittest.mock.rst:2103 msgid "``__len__``: ``0``" -msgstr "``__len__``\\ :\\ ``0``" +msgstr "``__len__``:``0``" #: ../../library/unittest.mock.rst:2104 msgid "``__iter__``: ``iter([])``" -msgstr "``__iter__``\\ :\\ ``iter([])``" +msgstr "``__iter__``:``iter([])``" #: ../../library/unittest.mock.rst:2105 msgid "``__exit__``: ``False``" -msgstr "``__exit__``\\ :\\ ``False``" +msgstr "``__exit__``:``False``" #: ../../library/unittest.mock.rst:2106 msgid "``__aexit__``: ``False``" -msgstr "``__aexit__``\\ :\\ ``False``" +msgstr "``__aexit__``:``False``" #: ../../library/unittest.mock.rst:2107 msgid "``__complex__``: ``1j``" -msgstr "``__complex__``\\ :\\ ``1j``" +msgstr "``__complex__``:``1j``" #: ../../library/unittest.mock.rst:2108 msgid "``__float__``: ``1.0``" -msgstr "``__float__``\\ :\\ ``1.0``" +msgstr "``__float__``:``1.0``" #: ../../library/unittest.mock.rst:2109 msgid "``__bool__``: ``True``" -msgstr "``__bool__``\\ :\\ ``True``" +msgstr "``__bool__``:``True``" #: ../../library/unittest.mock.rst:2110 msgid "``__index__``: ``1``" -msgstr "``__index__``\\ :\\ ``1``" +msgstr "``__index__``:``1``" #: ../../library/unittest.mock.rst:2111 msgid "``__hash__``: default hash for the mock" diff --git a/library/xml.po b/library/xml.po index a58bd89b93..6d44e025d5 100644 --- a/library/xml.po +++ b/library/xml.po @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -186,12 +186,11 @@ msgstr "**脆弱**" #: ../../library/xml.rst:71 ../../library/xml.rst:128 msgid "large tokens" -msgstr "" +msgstr "大型 token" #: ../../library/xml.rst:71 -#, fuzzy msgid "**Vulnerable** (6)" -msgstr "**脆弱** (1)" +msgstr "**脆弱** (6)" #: ../../library/xml.rst:74 msgid "" @@ -229,16 +228,15 @@ msgid "" msgstr "從 Python 3.7.1 開始,預設情況下不再處理外部通用實體。" #: ../../library/xml.rst:85 -#, fuzzy msgid "" "Expat 2.6.0 and newer is not vulnerable to denial of service through " "quadratic runtime caused by parsing large tokens. Items still listed as " "vulnerable due to potential reliance on system-provided libraries. Check :" "const:`!pyexpat.EXPAT_VERSION`." msgstr "" -"Expat 2.4.1 及更新的版本不易受到「十億笑聲」和「二次爆炸」漏洞的影響。但仍可" -"能由於依賴系統提供的函式庫而被列為易受攻擊的項目。請檢查 :const:`!pyexpat." -"EXPAT_VERSION`。" +"Expat 2.6.0 及更新版本不易受到剖析大型 token 所導致的二次 runtime 阻斷服務的" +"影響。由於可能依賴系統提供的函式庫,因此仍被列為易受攻擊的項目。請參考 :" +"const:`!pyexpat.EXPAT_VERSION`。" #: ../../library/xml.rst:97 msgid "billion laughs / exponential entity expansion" @@ -309,6 +307,10 @@ msgid "" "`CVE-2023-52425 `_." msgstr "" +"Expat 需要重新剖析未完成的 token;如果沒有 Expat 2.6.0 中引入的保護,這可能會" +"導致二次 runtime 而導致剖析 XML 的應用程式出現阻斷服務。此問題記錄於 " +"`CVE-2023-52425 `_。" #: ../../library/xml.rst:130 msgid "" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 4fc67638cb..080f8e2a06 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -69,10 +68,7 @@ msgstr "" #: ../../tutorial/introduction.rst:31 msgid "Some examples::" -msgstr "" -"一些範例如下:\n" -"\n" -"::" +msgstr "一些範例如下: ::" #: ../../tutorial/introduction.rst:42 msgid "Using Python as a Calculator" @@ -99,9 +95,7 @@ msgid "" msgstr "" "直譯器如同一台簡單的計算機:你可以輸入一個 expression(運算式),它會寫出該式" "的值。Expression 的語法可以使用:運算子 ``+``、``-``、``*`` 和 ``/`` 可以用來" -"執行運算;括號 ``()`` 可以用來分群。例如:\n" -"\n" -"::" +"執行運算;括號 ``()`` 可以用來分群。例如: ::" #: ../../tutorial/introduction.rst:68 msgid "" @@ -120,18 +114,13 @@ msgid "" "remainder you can use ``%``::" msgstr "" "除法 (``/``) 永遠回傳一個 float。如果要做 :term:`floor division` 並拿到整數的" -"結果,你可以使用 ``//`` 運算子;計算餘數可以使用 ``%``:\n" -"\n" -"::" +"結果,你可以使用 ``//`` 運算子;計算餘數可以使用 ``%``: ::" #: ../../tutorial/introduction.rst:86 msgid "" "With Python, it is possible to use the ``**`` operator to calculate powers " "[#]_::" -msgstr "" -"在 Python 中,計算冪次 (powers) 可以使用 ``**`` 運算子 [#]_:\n" -"\n" -"::" +msgstr "在 Python 中,計算冪次 (powers) 可以使用 ``**`` 運算子 [#]_: ::" #: ../../tutorial/introduction.rst:93 msgid "" @@ -139,9 +128,7 @@ msgid "" "no result is displayed before the next interactive prompt::" msgstr "" "等於符號 (``=``) 可以用於為變數賦值。賦值完之後,在下個指示字元前並不會顯示任" -"何結果:\n" -"\n" -"::" +"何結果: ::" #: ../../tutorial/introduction.rst:101 msgid "" @@ -149,9 +136,7 @@ msgid "" "give you an error::" msgstr "" "如果一個變數未被「定義 (defined)」(即變數未被賦值),試著使用它時會出現一個" -"錯誤:\n" -"\n" -"::" +"錯誤: ::" #: ../../tutorial/introduction.rst:109 msgid "" @@ -159,9 +144,7 @@ msgid "" "convert the integer operand to floating point::" msgstr "" "浮點數的運算有完善的支援,運算子 (operator) 遇上混合的運算元 (operand) 時會把" -"整數的運算元轉換為浮點數:\n" -"\n" -"::" +"整數的運算元轉換為浮點數: ::" #: ../../tutorial/introduction.rst:115 msgid "" @@ -170,9 +153,7 @@ msgid "" "is somewhat easier to continue calculations, for example::" msgstr "" "在互動式模式中,最後一個印出的運算式的結果會被指派至變數 ``_`` 中。這表示當你" -"把 Python 當作桌上計算機使用者,要接續計算變得容易許多:\n" -"\n" -"::" +"把 Python 當作桌上計算機使用者,要接續計算變得容易許多: ::" #: ../../tutorial/introduction.rst:128 msgid "" @@ -219,9 +200,7 @@ msgid "" "Alternatively, we can use the other type of quotation marks::" msgstr "" "要引用引文,我們需要在其前面加上 ``\\`` 來「跳脫」它。或者我們也可以使用其他" -"種類的引號:\n" -"\n" -"::" +"種類的引號: ::" #: ../../tutorial/introduction.rst:171 msgid "" @@ -231,9 +210,7 @@ msgid "" "characters::" msgstr "" "在 Python shell 中,字串定義和輸出字串可能看起來不同。:func:`print` 函式透過" -"省略引號並印出跳脫字元和特殊字元來生成更具可讀性的輸出:\n" -"\n" -"::" +"省略引號並印出跳脫字元和特殊字元來生成更具可讀性的輸出: ::" #: ../../tutorial/introduction.rst:182 msgid "" @@ -242,9 +219,7 @@ msgid "" "quote::" msgstr "" "如果你不希望字元前出現 ``\\`` 就被當成特殊字元時,可以改使用 *raw string*,在" -"第一個包圍引號前加上 ``r`` :\n" -"\n" -"::" +"第一個包圍引號前加上 ``r`` : ::" #: ../../tutorial/introduction.rst:192 msgid "" @@ -265,9 +240,7 @@ msgid "" msgstr "" "字串文本可以跨越數行。其中一方式是使用三個重覆引號:\\ ``\"\"\"...\"\"\"`` " "或 ``'''...'''``。此時換行會被自動加入字串值中,但也可以在換行前加入 ``\\`` " -"來取消這個行為。在以下的例子中:\n" -"\n" -"::" +"來取消這個行為。在以下的例子中: ::" #: ../../tutorial/introduction.rst:208 msgid "" @@ -280,9 +253,7 @@ msgid "" "Strings can be concatenated (glued together) with the ``+`` operator, and " "repeated with ``*``::" msgstr "" -"字串可以使用 ``+`` 運算子連接 (concatenate),並用 ``*`` 重覆該字串的內容:\n" -"\n" -"::" +"字串可以使用 ``+`` 運算子連接 (concatenate),並用 ``*`` 重覆該字串的內容: ::" #: ../../tutorial/introduction.rst:223 msgid "" @@ -290,33 +261,23 @@ msgid "" "to each other are automatically concatenated. ::" msgstr "" "兩個以上相鄰的字串文本(*string literal*,即被引號包圍的字串)會被自動連接起" -"來:\n" -"\n" -"::" +"來: ::" #: ../../tutorial/introduction.rst:229 msgid "" "This feature is particularly useful when you want to break long strings::" msgstr "" -"當你想要分段一個非常長的字串時,兩相鄰字串值自動連接的特性十分有用:\n" -"\n" -"::" +"當你想要分段一個非常長的字串時,兩相鄰字串值自動連接的特性十分有用: ::" #: ../../tutorial/introduction.rst:236 msgid "" "This only works with two literals though, not with variables or expressions::" -msgstr "" -"但這特性只限於兩相鄰的字串值間,而非兩相鄰變數或表達式:\n" -"\n" -"::" +msgstr "但這特性只限於兩相鄰的字串值間,而非兩相鄰變數或表達式: ::" #: ../../tutorial/introduction.rst:250 msgid "" "If you want to concatenate variables or a variable and a literal, use ``+``::" -msgstr "" -"如果要連接變數們或一個變數與一個字串值,使用 ``+``:\n" -"\n" -"::" +msgstr "如果要連接變數們或一個變數與一個字串值,使用 ``+``: ::" #: ../../tutorial/introduction.rst:255 msgid "" @@ -325,17 +286,12 @@ msgid "" "of size one::" msgstr "" "字串可以被「索引 *indexed*」(下標,即 subscripted),第一個字元的索引值為 0。" -"沒有獨立表示字元的型別;一個字元就是一個大小為 1 的字串:\n" -"\n" -"::" +"沒有獨立表示字元的型別;一個字元就是一個大小為 1 的字串: ::" #: ../../tutorial/introduction.rst:265 msgid "" "Indices may also be negative numbers, to start counting from the right::" -msgstr "" -"索引值可以是負的,此時改成從右開始計數:\n" -"\n" -"::" +msgstr "索引值可以是負的,此時改成從右開始計數: ::" #: ../../tutorial/introduction.rst:274 msgid "Note that since -0 is the same as 0, negative indices start from -1." @@ -348,9 +304,7 @@ msgid "" "substring::" msgstr "" "除了索引外,字串亦支援「切片 *slicing*」。索引用來拿到單獨的字元,而切片則可" -"以讓你拿到一個子字串 (substring):\n" -"\n" -"::" +"以讓你拿到一個子字串 (substring): ::" #: ../../tutorial/introduction.rst:284 msgid "" @@ -358,9 +312,7 @@ msgid "" "an omitted second index defaults to the size of the string being sliced. ::" msgstr "" "切片索引 (slice indices) 有很常用的預設值,省略起點索引值時預設為 0,而省略第" -"二個索引值時預設整個字串被包含在 slice 中:\n" -"\n" -"::" +"二個索引值時預設整個字串被包含在 slice 中: ::" #: ../../tutorial/introduction.rst:294 msgid "" @@ -368,9 +320,7 @@ msgid "" "makes sure that ``s[:i] + s[i:]`` is always equal to ``s``::" msgstr "" "注意到起點永遠被包含,而結尾永遠不被包含。這確保了 ``s[:i] + s[i:]`` 永遠等" -"於 ``s``:\n" -"\n" -"::" +"於 ``s``: ::" #: ../../tutorial/introduction.rst:302 msgid "" @@ -381,9 +331,7 @@ msgid "" msgstr "" "這裡有個簡單記住 slice 是如何運作的方式。想像 slice 的索引值指著字元們之間," "其中第一個字元的左側邊緣由 0 計數。則 *n* 個字元的字串中最後一個字元的右側邊" -"緣會有索引值 *n*,例如:\n" -"\n" -"::" +"緣會有索引值 *n*,例如: ::" #: ../../tutorial/introduction.rst:313 msgid "" @@ -406,19 +354,13 @@ msgstr "" #: ../../tutorial/introduction.rst:322 msgid "Attempting to use an index that is too large will result in an error::" -msgstr "" -"嘗試使用一個過大的索引值會造成錯誤:\n" -"\n" -"::" +msgstr "嘗試使用一個過大的索引值會造成錯誤: ::" #: ../../tutorial/introduction.rst:329 msgid "" "However, out of range slice indexes are handled gracefully when used for " "slicing::" -msgstr "" -"然而,超出範圍的索引值在 slice 中會被妥善的處理:\n" -"\n" -"::" +msgstr "然而,超出範圍的索引值在 slice 中會被妥善的處理: ::" #: ../../tutorial/introduction.rst:337 msgid "" @@ -426,23 +368,15 @@ msgid "" "assigning to an indexed position in the string results in an error::" msgstr "" "Python 字串無法被改變 --- 它們是 :term:`immutable`。因此,嘗試對字串中某個索" -"引位置賦值會產生錯誤:\n" -"\n" -"::" +"引位置賦值會產生錯誤: ::" #: ../../tutorial/introduction.rst:349 msgid "If you need a different string, you should create a new one::" -msgstr "" -"如果你需要一個不一樣的字串,你必須建立一個新的:\n" -"\n" -"::" +msgstr "如果你需要一個不一樣的字串,你必須建立一個新的: ::" #: ../../tutorial/introduction.rst:356 msgid "The built-in function :func:`len` returns the length of a string::" -msgstr "" -"內建的函式 :func:`len` 回傳一個字串的長度:\n" -"\n" -"::" +msgstr "內建的函式 :func:`len` 回傳一個字串的長度: ::" #: ../../tutorial/introduction.rst:367 msgid ":ref:`textseq`" @@ -505,9 +439,7 @@ msgid "" msgstr "" "Python 理解數種複合型資料型別,用來組合不同的數值。當中最多樣變化的型別為 " "*list*,可以寫成一系列以逗號分隔的數值(稱之元素,即 item),包含在方括號之" -"中。List 可以包合不同型別的元素,但通常這些元素會有相同的型別:\n" -"\n" -"::" +"中。List 可以包合不同型別的元素,但通常這些元素會有相同的型別: ::" #: ../../tutorial/introduction.rst:398 msgid "" @@ -515,16 +447,11 @@ msgid "" "indexed and sliced::" msgstr "" "如同字串(以及其他內建的 :term:`sequence` 型別),list 可以被索引和切片 " -"(slice):\n" -"\n" -"::" +"(slice): ::" #: ../../tutorial/introduction.rst:408 msgid "Lists also support operations like concatenation::" -msgstr "" -"List 對支援如接合 (concatenation) 等操作:\n" -"\n" -"::" +msgstr "List 對支援如接合 (concatenation) 等操作: ::" #: ../../tutorial/introduction.rst:413 msgid "" @@ -532,9 +459,7 @@ msgid "" "type, i.e. it is possible to change their content::" msgstr "" "不同於字串是 :term:`immutable`,list 是 :term:`mutable` 型別,即改變 list 的" -"內容是可能的:\n" -"\n" -"::" +"內容是可能的: ::" #: ../../tutorial/introduction.rst:423 msgid "" @@ -542,9 +467,7 @@ msgid "" "append` *method* (we will see more about methods later)::" msgstr "" "你也可以在 list 的最後加入新元素,透過使用 :meth:`!list.append` *方法* " -"(method)(我們稍後會看到更多方法的說明):\n" -"\n" -"::" +"(method)(我們稍後會看到更多方法的說明): ::" #: ../../tutorial/introduction.rst:431 msgid "" @@ -553,6 +476,9 @@ msgid "" "to the list through one variable will be seen through all other variables " "that refer to it.::" msgstr "" +"Python 中的簡單賦值永遠不會複製資料。當你將 list 指派給變數時,該變數會參照" +"\\ *現有 list*。任何透過一個變數對 list 所做的更改都將能夠透過參照該變數的所" +"有其他變數看到。 ::" #: ../../tutorial/introduction.rst:444 msgid "" @@ -561,34 +487,23 @@ msgid "" "` of the list::" msgstr "" "所有切片操作都會回傳一個新的 list ,包含要求的元素。這意謂著以下這個切片回傳" -"了原本 list 的 :ref:`淺複製 ` :\n" -"\n" -"::" +"了原本 list 的\\ :ref:`淺複製 `: ::" #: ../../tutorial/introduction.rst:455 msgid "" "Assignment to slices is also possible, and this can even change the size of " "the list or clear it entirely::" -msgstr "" -"也可以對 slice 賦值,這能改變 list 的大小,甚至是清空一個 list:\n" -"\n" -"::" +msgstr "也可以對 slice 賦值,這能改變 list 的大小,甚至是清空一個 list: ::" #: ../../tutorial/introduction.rst:474 msgid "The built-in function :func:`len` also applies to lists::" -msgstr "" -"內建的函式 :func:`len` 亦可以作用在 list 上:\n" -"\n" -"::" +msgstr "內建的函式 :func:`len` 亦可以作用在 list 上: ::" #: ../../tutorial/introduction.rst:480 msgid "" "It is possible to nest lists (create lists containing other lists), for " "example::" -msgstr "" -"也可以嵌套多層 list (建立 list 包含其他 list),例如:\n" -"\n" -"::" +msgstr "也可以嵌套多層 list (建立 list 包含其他 list),例如: ::" #: ../../tutorial/introduction.rst:496 msgid "First Steps Towards Programming" @@ -603,9 +518,7 @@ msgid "" msgstr "" "當然,我們可以用 Python 來處理比 2 加 2 更複雜的工作。例如,我們可以印出\\ `" "費氏數列 `_\\ 的首幾項序列:\n" -"\n" -"::" +"%E6%96%90%E6%B3%A2%E9%82%A3%E5%A5%91%E6%95%B0%E5%88%97>`_\\ 的首幾項序列: ::" #: ../../tutorial/introduction.rst:518 msgid "This example introduces several new features." @@ -671,9 +584,7 @@ msgstr "" ":func:`print` 函式印出它接收到引數(們)的值。不同於先前僅我們寫下想要的運算" "(像是先前的計算機範例),它可以處理複數個引數、浮點數數值和字串。印出的字串" "將不帶有引號,並且不同項目間會插入一個空白,因此可以讓你容易格式化輸出,例" -"如:\n" -"\n" -"::" +"如: ::" #: ../../tutorial/introduction.rst:555 msgid "" @@ -681,9 +592,7 @@ msgid "" "output, or end the output with a different string::" msgstr "" "關鍵字引數 *end* 可以被用來避免額外的換行符加入到輸出中,或者以不同的字串結束" -"輸出:\n" -"\n" -"::" +"輸出: ::" #: ../../tutorial/introduction.rst:567 msgid "Footnotes" diff --git a/using/mac.po b/using/mac.po index 644ebf5398..33f738ff3a 100644 --- a/using/mac.po +++ b/using/mac.po @@ -46,9 +46,8 @@ msgstr "" "得一提的是在 macOS 上有其他額外的功能,例如 IDE 與套件管理。" #: ../../using/mac.rst:21 -#, fuzzy msgid "Getting and Installing Python" -msgstr "取得和安裝 MacPython" +msgstr "取得和安裝 Python" #: ../../using/mac.rst:23 #, fuzzy @@ -72,19 +71,17 @@ msgid "What you get after installing is a number of things:" msgstr "在安裝後你必須要做幾件事:" #: ../../using/mac.rst:32 -#, fuzzy msgid "" "A |python_version_literal| folder in your :file:`Applications` folder. In " "here you find IDLE, the development environment that is a standard part of " "official Python distributions; and :program:`Python Launcher`, which handles " "double-clicking Python scripts from the Finder." msgstr "" -"會有一個 :file:`Python 3.12` 資料夾在你的 :file:`Applications` 資料夾中。在這" -"裡你可以找到 IDLE,它是作為官方 Python 發行版標準組成的開發環境;以及 " -"PythonLauncher,它負責處理在 Finder 中雙擊 Python 腳本的操作。" +"會有一個 |python_version_literal| 資料夾在你的 :file:`Applications` 資料夾" +"中。在這裡你可以找到 IDLE,它是作為官方 Python 發行版標準組成的開發環境;以" +"及 :program:`Python Launcher`,它負責處理在 Finder 中雙擊 Python 腳本的操作。" #: ../../using/mac.rst:37 -#, fuzzy msgid "" "A framework :file:`/Library/Frameworks/Python.framework`, which includes the " "Python executable and libraries. The installer adds this location to your " @@ -93,8 +90,8 @@ msgid "" msgstr "" ":file:`/Library/Frameworks/Python.framework` 框架,包括 Python 可執行檔案 " "(executable) 和函式庫 (library)。安裝程式將此位置新增到 shell 路徑。要解除安" -"裝 MacPython ,你可以簡單地移除這三個專案。Python 可執行檔案的符號連結 " -"(symlink) 則放在 /usr/local/bin/ 中。" +"裝 Python ,你可以移除這三個專案。Python 可執行檔案的符號連結 (symlink) 則放" +"在 :file:`/usr/local/bin/` 中。" #: ../../using/mac.rst:44 #, fuzzy @@ -115,14 +112,13 @@ msgstr "" "的 Python,因此你的路徑和用法與你想要執行的操作一致非常重要。" #: ../../using/mac.rst:52 -#, fuzzy msgid "" "IDLE includes a Help menu that allows you to access Python documentation. If " "you are completely new to Python you should start reading the tutorial " "introduction in that document." msgstr "" -"IDLE 包含一個幫助選單,讓你可以參閱 Python 文件。如果你是 Python 的新手,你應" -"該開始閱讀該文件中的教學介紹。" +"IDLE 包含一個幫助 (Help) 選單,讓你可以參閱 Python 文件。如果你是 Python 的新" +"手,你應該開始閱讀該文件中的教學介紹。" #: ../../using/mac.rst:56 msgid "" @@ -179,12 +175,10 @@ msgid "To run your script from the Finder you have two options:" msgstr "從 Finder 執行你的腳本時,你有兩個選項:" #: ../../using/mac.rst:82 -#, fuzzy msgid "Drag it to :program:`Python Launcher`." -msgstr "把它拖曳到 :program:`PythonLauncher`" +msgstr "把它拖曳到 :program:`Python Launcher`" #: ../../using/mac.rst:84 -#, fuzzy msgid "" "Select :program:`Python Launcher` as the default application to open your " "script (or any ``.py`` script) through the finder Info window and double-" @@ -192,10 +186,10 @@ msgid "" "your script is launched. Option-dragging allows you to change these for one " "invocation, or use its Preferences menu to change things globally." msgstr "" -"透過 finder Info 視窗選擇 :program:`PythonLauncher` 作為開啟腳本(或任何 .py " -"腳本)的預設應用程式,然後雙擊腳本。\\ :program:`PythonLauncher` 有各種用來控" -"制腳本啟動方式的選項。拖曳選項可以讓你一次更改多個選項,或使用其偏好設定選單" -"以全域性地更改內容。" +"透過 finder Info 視窗選擇 :program:`Python Launcher` 作為開啟腳本(或任何 ``." +"py`` 腳本)的預設應用程式,然後雙擊腳本。:program:`Python Launcher` 有各種用" +"來控制腳本啟動方式的選項。拖曳選項可以讓你一次更改多個選項,或使用其偏好設定" +"選單以全域性地更改內容。" #: ../../using/mac.rst:94 msgid "Running scripts with a GUI" @@ -223,7 +217,6 @@ msgid "Configuration" msgstr "設定" #: ../../using/mac.rst:107 -#, fuzzy msgid "" "Python on macOS honors all standard Unix environment variables such as :" "envvar:`PYTHONPATH`, but setting these variables for programs started from " @@ -232,34 +225,30 @@ msgid "" "environment.plist`. See Apple's `Technical Q&A QA1067 `__ for details." msgstr "" -"macOS 上的 Python 遵循所有標準的 Unix 環境變數,例如 :envvar:" -"`PYTHONPATH`\\ ,但是為 Finder 啟動的程式設定這些變數並非是標準做法,因為 " -"Finder 在啟動時不會讀取你的 :file:`.profile` 或 :file:`.cshrc`\\ 。你需要建立" -"一個檔案 :file:`~/.MacOSX/environment.plist`\\ 。相關資訊請參閱 Apple 的技術" -"文件 QA1067。" +"macOS 上的 Python 遵循所有標準的 Unix 環境變數,例如 :envvar:`PYTHONPATH`,但" +"是為 Finder 啟動的程式設定這些變數並非是標準做法,因為 Finder 在啟動時不會讀" +"取你的 :file:`.profile` 或 :file:`.cshrc`。你需要建立一個檔案 :file:`~/." +"MacOSX/environment.plist`。相關資訊請參閱 Apple 的\\ `技術問答集 QA1067 " +"`__。" #: ../../using/mac.rst:115 -#, fuzzy msgid "" "For more information on installation Python packages, see section :ref:`mac-" "package-manager`." -msgstr "" -"更多關於在 MacPython 中安裝 Python 套件的資訊,參閱 :ref:`mac-package-" -"manager` 部分。" +msgstr "更多關於安裝 Python 套件的資訊,參閱 :ref:`mac-package-manager` 部分。" #: ../../using/mac.rst:122 msgid "The IDE" msgstr "整合化開發工具 (IDE)" #: ../../using/mac.rst:124 -#, fuzzy msgid "" "Python ships with the standard IDLE development environment. A good " "introduction to using IDLE can be found at https://www.hashcollision.org/hkn/" "python/idle_intro/index.html." msgstr "" -"MacPython 附帶標準的 IDLE 開發環境。有關使用 IDLE 的詳細介紹,請見 http://" -"www.hashcollision.org/hkn/python/idle_intro/index.html\\ 。" +"Python 附帶標準的 IDLE 開發環境。有關使用 IDLE 的詳細介紹,請見 https://www." +"hashcollision.org/hkn/python/idle_intro/index.html。" #: ../../using/mac.rst:132 msgid "Installing Additional Python Packages" @@ -270,9 +259,8 @@ msgid "This section has moved to the `Python Packaging User Guide`_." msgstr "這個章節已經被移動到 `Python Packaging User Guide`_。" #: ../../using/mac.rst:142 -#, fuzzy msgid "GUI Programming" -msgstr "於 Mac 上開發 GUI 程式" +msgstr "開發 GUI 程式" #: ../../using/mac.rst:144 msgid "" @@ -326,31 +314,29 @@ msgid "" msgstr "" #: ../../using/mac.rst:169 -#, fuzzy msgid "Distributing Python Applications" -msgstr "於 Mac 上發行 Python 應用程式" +msgstr "發行 Python 應用程式" #: ../../using/mac.rst:171 -#, fuzzy msgid "" "The standard tool for deploying standalone Python applications on the Mac " "is :program:`py2app`. More information on installing and using :program:" "`py2app` can be found at https://pypi.org/project/py2app/." msgstr "" -"在 Mac 上部署獨立 Python 應用程式的標準工具是 :program:`py2app`\\ 。有關安裝" -"和使用 py2app 的更多資訊,請參考 https://pypi.org/project/py2app/\\ 。" +"在 Mac 上部署獨立 Python 應用程式的標準工具是 :program:`py2app`。有關安裝和使" +"用 :program:`py2app` 的更多資訊,請參考 https://pypi.org/project/py2app/。" #: ../../using/mac.rst:177 msgid "Other Resources" msgstr "其他資源" #: ../../using/mac.rst:179 -#, fuzzy msgid "" "The Pythonmac-SIG mailing list is an excellent support resource for Python " "users and developers on the Mac:" msgstr "" -"MacPython 郵件清單對於 Mac 上的 Python 使用者和開發者是一個極佳的支援資源:" +"Pythonmac-SIG 郵件清單對於 Mac 上的 Python 使用者和開發者是一個極佳的支援資" +"源:" #: ../../using/mac.rst:182 msgid "https://www.python.org/community/sigs/current/pythonmac-sig/" diff --git a/whatsnew/2.0.po b/whatsnew/2.0.po index 4097f3dda4..d151245b72 100644 --- a/whatsnew/2.0.po +++ b/whatsnew/2.0.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: diff --git a/whatsnew/2.1.po b/whatsnew/2.1.po index 222ed68e82..121614837b 100644 --- a/whatsnew/2.1.po +++ b/whatsnew/2.1.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -244,54 +243,48 @@ msgid "``<``" msgstr "``<``" #: ../../whatsnew/2.1.rst:181 -#, fuzzy msgid ":meth:`~object.__lt__`" -msgstr ":meth:`__lt__`" +msgstr ":meth:`~object.__lt__`" #: ../../whatsnew/2.1.rst:183 msgid "``<=``" msgstr "``<=``" #: ../../whatsnew/2.1.rst:183 -#, fuzzy msgid ":meth:`~object.__le__`" -msgstr ":meth:`__le__`" +msgstr ":meth:`~object.__le__`" #: ../../whatsnew/2.1.rst:185 msgid "``>``" msgstr "``>``" #: ../../whatsnew/2.1.rst:185 -#, fuzzy msgid ":meth:`~object.__gt__`" -msgstr ":meth:`__gt__`" +msgstr ":meth:`~object.__gt__`" #: ../../whatsnew/2.1.rst:187 msgid "``>=``" msgstr "``>=``" #: ../../whatsnew/2.1.rst:187 -#, fuzzy msgid ":meth:`~object.__ge__`" -msgstr ":meth:`__ge__`" +msgstr ":meth:`~object.__ge__`" #: ../../whatsnew/2.1.rst:189 msgid "``==``" msgstr "``==``" #: ../../whatsnew/2.1.rst:189 -#, fuzzy msgid ":meth:`~object.__eq__`" -msgstr ":meth:`__eq__`" +msgstr ":meth:`~object.__eq__`" #: ../../whatsnew/2.1.rst:191 msgid "``!=``" msgstr "``!=``" #: ../../whatsnew/2.1.rst:191 -#, fuzzy msgid ":meth:`~object.__ne__`" -msgstr ":meth:`__ne__`" +msgstr ":meth:`~object.__ne__`" #: ../../whatsnew/2.1.rst:194 msgid "" diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index ef5ace9505..4616147969 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index 605d4b8c19..c10335ee70 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -995,13 +995,12 @@ msgstr "" "Serhiy Storchaka 在 :issue:`37999` 中貢獻。)" #: ../../whatsnew/3.10.rst:831 -#, fuzzy msgid "" "If :func:`object.__ipow__` returns :data:`NotImplemented`, the operator will " "correctly fall back to :func:`object.__pow__` and :func:`object.__rpow__` as " "expected. (Contributed by Alex Shkop in :issue:`38302`.)" msgstr "" -"如果 :func:`object.__ipow__` 回傳 :const:`NotImplemented`,則該運算子將按預期" +"如果 :func:`object.__ipow__` 回傳 :data:`NotImplemented`,則該運算子將按預期" "正確回退到 :func:`object.__pow__` 和 :func:`object.__rpow__` 。(由 Alex " "Shkop 在 :issue:`38302` 中貢獻。)" diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index 2fc5215c4a..851c3dac0e 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -2030,45 +2029,40 @@ msgid "Preferred Name" msgstr "" #: ../../whatsnew/3.2.rst:1815 -#, fuzzy msgid ":meth:`!assert_`" -msgstr ":meth:`assert_`" +msgstr ":meth:`!assert_`" #: ../../whatsnew/3.2.rst:1815 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" #: ../../whatsnew/3.2.rst:1816 -#, fuzzy msgid ":meth:`!assertEquals`" -msgstr ":meth:`assertEquals`" +msgstr ":meth:`!assertEquals`" #: ../../whatsnew/3.2.rst:1816 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" #: ../../whatsnew/3.2.rst:1817 -#, fuzzy msgid ":meth:`!assertNotEquals`" -msgstr ":meth:`assertNotEquals`" +msgstr ":meth:`!assertNotEquals`" #: ../../whatsnew/3.2.rst:1817 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" #: ../../whatsnew/3.2.rst:1818 -#, fuzzy msgid ":meth:`!assertAlmostEquals`" -msgstr ":meth:`assertAlmostEquals`" +msgstr ":meth:`!assertAlmostEquals`" #: ../../whatsnew/3.2.rst:1818 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" #: ../../whatsnew/3.2.rst:1819 -#, fuzzy msgid ":meth:`!assertNotAlmostEquals`" -msgstr ":meth:`assertNotAlmostEquals`" +msgstr ":meth:`!assertNotAlmostEquals`" #: ../../whatsnew/3.2.rst:1819 msgid ":meth:`.assertNotAlmostEqual`" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index 4aafaec1c2..e3f0a810c4 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -3314,7 +3314,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:2542 msgid "Notable changes in Python 3.5.4" -msgstr "" +msgstr "Python 3.5.4 中顯著的變更" #: ../../whatsnew/3.5.rst:2545 msgid "New ``make regen-all`` build target" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index 4f6139fb59..85e5a4c76e 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -3143,7 +3143,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:2395 msgid "Notable changes in Python 3.6.2" -msgstr "" +msgstr "Python 3.6.2 中顯著的變更" #: ../../whatsnew/3.6.rst:2398 msgid "New ``make regen-all`` build target" @@ -3191,7 +3191,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:2431 msgid "Notable changes in Python 3.6.4" -msgstr "" +msgstr "Python 3.6.4 中顯著的變更" #: ../../whatsnew/3.6.rst:2433 msgid "" @@ -3203,7 +3203,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:2440 msgid "Notable changes in Python 3.6.5" -msgstr "" +msgstr "Python 3.6.5 中顯著的變更" #: ../../whatsnew/3.6.rst:2442 msgid "" @@ -3214,7 +3214,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:2448 msgid "Notable changes in Python 3.6.7" -msgstr "" +msgstr "Python 3.6.7 中顯著的變更" #: ../../whatsnew/3.6.rst:2450 msgid "" @@ -3232,7 +3232,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:2459 msgid "Notable changes in Python 3.6.10" -msgstr "" +msgstr "Python 3.6.10 中顯著的變更" #: ../../whatsnew/3.6.rst:2461 msgid "" @@ -3246,7 +3246,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:2469 msgid "Notable changes in Python 3.6.13" -msgstr "" +msgstr "Python 3.6.13 中顯著的變更" #: ../../whatsnew/3.6.rst:2471 msgid "" @@ -3262,7 +3262,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:2482 msgid "Notable changes in Python 3.6.14" -msgstr "" +msgstr "Python 3.6.14 中顯著的變更" #: ../../whatsnew/3.6.rst:2484 msgid "" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index ef976caeaf..67cd26c9bc 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -3567,7 +3567,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:2537 msgid "Notable changes in Python 3.7.1" -msgstr "" +msgstr "Python 3.7.1 中顯著的變更" #: ../../whatsnew/3.7.rst:2539 msgid "" @@ -3596,7 +3596,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:2556 msgid "Notable changes in Python 3.7.2" -msgstr "" +msgstr "Python 3.7.2 中顯著的變更" #: ../../whatsnew/3.7.rst:2558 msgid "" @@ -3610,7 +3610,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:2566 msgid "Notable changes in Python 3.7.6" -msgstr "" +msgstr "Python 3.7.6 中顯著的變更" #: ../../whatsnew/3.7.rst:2568 msgid "" @@ -3624,7 +3624,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:2576 msgid "Notable changes in Python 3.7.10" -msgstr "" +msgstr "Python 3.7.10 中顯著的變更" #: ../../whatsnew/3.7.rst:2578 msgid "" @@ -3640,7 +3640,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:2589 msgid "Notable changes in Python 3.7.11" -msgstr "" +msgstr "Python 3.7.11 中顯著的變更" #: ../../whatsnew/3.7.rst:2591 msgid "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index d654f7bb7c..760173a390 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -2843,7 +2843,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:2237 msgid "Notable changes in Python 3.8.1" -msgstr "" +msgstr "Python 3.8.1 中顯著的變更" #: ../../whatsnew/3.8.rst:2239 msgid "" @@ -2857,7 +2857,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:2247 msgid "Notable changes in Python 3.8.2" -msgstr "" +msgstr "Python 3.8.2 中顯著的變更" #: ../../whatsnew/3.8.rst:2249 msgid "" @@ -2868,7 +2868,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:2254 msgid "Notable changes in Python 3.8.3" -msgstr "" +msgstr "Python 3.8.3 中顯著的變更" #: ../../whatsnew/3.8.rst:2256 msgid "" @@ -2880,7 +2880,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:2262 msgid "Notable changes in Python 3.8.8" -msgstr "" +msgstr "Python 3.8.8 中顯著的變更" #: ../../whatsnew/3.8.rst:2264 msgid "" @@ -2896,7 +2896,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:2275 msgid "Notable changes in Python 3.8.9" -msgstr "" +msgstr "Python 3.8.9 中顯著的變更" #: ../../whatsnew/3.8.rst:2277 msgid "" @@ -2909,7 +2909,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:2284 ../../whatsnew/3.8.rst:2304 msgid "Notable changes in Python 3.8.10" -msgstr "" +msgstr "Python 3.8.10 中顯著的變更" #: ../../whatsnew/3.8.rst:2287 msgid "macOS 11.0 (Big Sur) and Apple Silicon Mac support" @@ -2951,7 +2951,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:2318 msgid "Notable changes in Python 3.8.12" -msgstr "" +msgstr "Python 3.8.12 中顯著的變更" #: ../../whatsnew/3.8.rst:2323 msgid "" diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index fbddcf1a2d..626da68527 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # @@ -2205,7 +2204,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:1492 msgid "Notable changes in Python 3.9.1" -msgstr "" +msgstr "Python 3.9.1 中顯著的變更" #: ../../whatsnew/3.9.rst:1497 msgid "" @@ -2264,7 +2263,7 @@ msgstr "(由 Ronald Oussoren 和 Lawrence D'Anna 在 :issue:`41100` 中貢獻 #: ../../whatsnew/3.9.rst:1535 msgid "Notable changes in Python 3.9.2" -msgstr "" +msgstr "Python 3.9.2 中顯著的變更" #: ../../whatsnew/3.9.rst:1538 msgid "collections.abc" @@ -2304,7 +2303,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:1567 msgid "Notable changes in Python 3.9.3" -msgstr "" +msgstr "Python 3.9.3 中顯著的變更" #: ../../whatsnew/3.9.rst:1569 msgid "" @@ -2317,7 +2316,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:1576 msgid "Notable changes in Python 3.9.5" -msgstr "" +msgstr "Python 3.9.5 中顯著的變更" #: ../../whatsnew/3.9.rst:1581 msgid "" @@ -2353,7 +2352,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:1606 msgid "tarfile" -msgstr "" +msgstr "tarfile" #: ../../whatsnew/3.9.rst:1608 msgid "" From 09bccdb621fd127c5e0fb4c93ed23b7f88cdba6a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 7 Mar 2024 00:04:48 +0000 Subject: [PATCH 30/33] sync with cpython 01505953 --- library/pyexpat.po | 246 +++++++++------- library/xml.etree.elementtree.po | 464 ++++++++++++++++--------------- 2 files changed, 386 insertions(+), 324 deletions(-) diff --git a/library/pyexpat.po b/library/pyexpat.po index 335e889b0a..7b635feaae 100644 --- a/library/pyexpat.po +++ b/library/pyexpat.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-24 00:03+0000\n" +"POT-Creation-Date: 2024-03-07 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -213,18 +213,54 @@ msgid "" "``errors.codes[errors.XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING]``." msgstr "" -#: ../../library/pyexpat.rst:199 +#: ../../library/pyexpat.rst:203 +msgid "" +"Calling ``SetReparseDeferralEnabled(False)`` has security implications, as " +"detailed below; please make sure to understand these consequences prior to " +"using the ``SetReparseDeferralEnabled`` method." +msgstr "" + +#: ../../library/pyexpat.rst:207 +msgid "" +"Expat 2.6.0 introduced a security mechanism called \"reparse deferral\" " +"where instead of causing denial of service through quadratic runtime from " +"reparsing large tokens, reparsing of unfinished tokens is now delayed by " +"default until a sufficient amount of input is reached. Due to this delay, " +"registered handlers may — depending of the sizing of input chunks pushed to " +"Expat — no longer be called right after pushing new input to the parser. " +"Where immediate feedback and taking over responsiblity of protecting against " +"denial of service from large tokens are both wanted, calling " +"``SetReparseDeferralEnabled(False)`` disables reparse deferral for the " +"current Expat parser instance, temporarily or altogether. Calling " +"``SetReparseDeferralEnabled(True)`` allows re-enabling reparse deferral." +msgstr "" + +#: ../../library/pyexpat.rst:220 +msgid "" +"Note that :meth:`SetReparseDeferralEnabled` has been backported to some " +"prior releases of CPython as a security fix. Check for availability of :" +"meth:`SetReparseDeferralEnabled` using :func:`hasattr` if used in code " +"running across a variety of Python versions." +msgstr "" + +#: ../../library/pyexpat.rst:229 +msgid "" +"Returns whether reparse deferral is currently enabled for the given Expat " +"parser instance." +msgstr "" + +#: ../../library/pyexpat.rst:235 msgid ":class:`xmlparser` objects have the following attributes:" msgstr ":class:`xmlparser` 物件擁有以下屬性:" -#: ../../library/pyexpat.rst:204 +#: ../../library/pyexpat.rst:240 msgid "" "The size of the buffer used when :attr:`buffer_text` is true. A new buffer " "size can be set by assigning a new integer value to this attribute. When the " "size is changed, the buffer will be flushed." msgstr "" -#: ../../library/pyexpat.rst:212 +#: ../../library/pyexpat.rst:248 msgid "" "Setting this to true causes the :class:`xmlparser` object to buffer textual " "content returned by Expat to avoid multiple calls to the :meth:" @@ -235,14 +271,14 @@ msgid "" "newlines may be chunked too." msgstr "" -#: ../../library/pyexpat.rst:223 +#: ../../library/pyexpat.rst:259 msgid "" "If :attr:`buffer_text` is enabled, the number of bytes stored in the buffer. " "These bytes represent UTF-8 encoded text. This attribute has no meaningful " "interpretation when :attr:`buffer_text` is false." msgstr "" -#: ../../library/pyexpat.rst:230 +#: ../../library/pyexpat.rst:266 msgid "" "Setting this attribute to a non-zero integer causes the attributes to be " "reported as a list rather than a dictionary. The attributes are presented " @@ -252,7 +288,7 @@ msgid "" "is false; it may be changed at any time." msgstr "" -#: ../../library/pyexpat.rst:240 +#: ../../library/pyexpat.rst:276 msgid "" "If set to a non-zero integer, the parser will report only those attributes " "which were specified in the document instance and not those which were " @@ -263,7 +299,7 @@ msgid "" "time." msgstr "" -#: ../../library/pyexpat.rst:248 +#: ../../library/pyexpat.rst:284 msgid "" "The following attributes contain values relating to the most recent error " "encountered by an :class:`xmlparser` object, and will only have correct " @@ -271,26 +307,26 @@ msgid "" "`xml.parsers.expat.ExpatError` exception." msgstr "" -#: ../../library/pyexpat.rst:256 +#: ../../library/pyexpat.rst:292 msgid "Byte index at which an error occurred." msgstr "" -#: ../../library/pyexpat.rst:261 +#: ../../library/pyexpat.rst:297 msgid "" "Numeric code specifying the problem. This value can be passed to the :func:" "`ErrorString` function, or compared to one of the constants defined in the " "``errors`` object." msgstr "" -#: ../../library/pyexpat.rst:268 +#: ../../library/pyexpat.rst:304 msgid "Column number at which an error occurred." msgstr "" -#: ../../library/pyexpat.rst:273 +#: ../../library/pyexpat.rst:309 msgid "Line number at which an error occurred." msgstr "" -#: ../../library/pyexpat.rst:275 +#: ../../library/pyexpat.rst:311 msgid "" "The following attributes contain values relating to the current parse " "location in an :class:`xmlparser` object. During a callback reporting a " @@ -300,19 +336,19 @@ msgid "" "whether there was an associated callback)." msgstr "" -#: ../../library/pyexpat.rst:285 +#: ../../library/pyexpat.rst:321 msgid "Current byte index in the parser input." msgstr "" -#: ../../library/pyexpat.rst:290 +#: ../../library/pyexpat.rst:326 msgid "Current column number in the parser input." msgstr "" -#: ../../library/pyexpat.rst:295 +#: ../../library/pyexpat.rst:331 msgid "Current line number in the parser input." msgstr "" -#: ../../library/pyexpat.rst:297 +#: ../../library/pyexpat.rst:333 msgid "" "Here is the list of handlers that can be set. To set a handler on an :class:" "`xmlparser` object *o*, use ``o.handlername = func``. *handlername* must be " @@ -321,7 +357,7 @@ msgid "" "unless otherwise stated." msgstr "" -#: ../../library/pyexpat.rst:306 +#: ../../library/pyexpat.rst:342 msgid "" "Called when the XML declaration is parsed. The XML declaration is the " "(optional) declaration of the applicable version of the XML recommendation, " @@ -332,7 +368,7 @@ msgid "" "only available with Expat version 1.95.0 or newer." msgstr "" -#: ../../library/pyexpat.rst:317 +#: ../../library/pyexpat.rst:353 msgid "" "Called when Expat begins parsing the document type declaration (``'``." msgstr "" -#: ../../library/pyexpat.rst:434 +#: ../../library/pyexpat.rst:470 msgid "" "Called at the start of a CDATA section. This and :attr:" "`EndCdataSectionHandler` are needed to be able to identify the syntactical " "start and end for CDATA sections." msgstr "" -#: ../../library/pyexpat.rst:441 +#: ../../library/pyexpat.rst:477 msgid "Called at the end of a CDATA section." msgstr "" -#: ../../library/pyexpat.rst:446 +#: ../../library/pyexpat.rst:482 msgid "" "Called for any characters in the XML document for which no applicable " "handler has been specified. This means characters that are part of a " @@ -466,14 +502,14 @@ msgid "" "supplied." msgstr "" -#: ../../library/pyexpat.rst:453 +#: ../../library/pyexpat.rst:489 msgid "" "This is the same as the :func:`DefaultHandler`, but doesn't inhibit " "expansion of internal entities. The entity reference will not be passed to " "the default handler." msgstr "" -#: ../../library/pyexpat.rst:460 +#: ../../library/pyexpat.rst:496 msgid "" "Called if the XML document hasn't been declared as being a standalone " "document. This happens when there is an external subset or a reference to a " @@ -483,7 +519,7 @@ msgid "" "set, no exception is raised by the parser for this condition." msgstr "" -#: ../../library/pyexpat.rst:470 +#: ../../library/pyexpat.rst:506 msgid "" "Called for references to external entities. *base* is the current base, as " "set by a previous call to :meth:`SetBase`. The public and system " @@ -492,7 +528,7 @@ msgid "" "is opaque and should only be used as described below." msgstr "" -#: ../../library/pyexpat.rst:476 +#: ../../library/pyexpat.rst:512 msgid "" "For external entities to be parsed, this handler must be implemented. It is " "responsible for creating the sub-parser using " @@ -502,130 +538,130 @@ msgid "" "`XML_ERROR_EXTERNAL_ENTITY_HANDLING` error, otherwise parsing will continue." msgstr "" -#: ../../library/pyexpat.rst:484 +#: ../../library/pyexpat.rst:520 msgid "" "If this handler is not provided, external entities are reported by the :attr:" "`DefaultHandler` callback, if provided." msgstr "" -#: ../../library/pyexpat.rst:491 +#: ../../library/pyexpat.rst:527 msgid "ExpatError Exceptions" msgstr "ExpatError 例外" -#: ../../library/pyexpat.rst:496 +#: ../../library/pyexpat.rst:532 msgid ":exc:`ExpatError` exceptions have a number of interesting attributes:" msgstr "" -#: ../../library/pyexpat.rst:501 +#: ../../library/pyexpat.rst:537 msgid "" "Expat's internal error number for the specific error. The :data:`errors." "messages ` dictionary maps these error " "numbers to Expat's error messages. For example::" msgstr "" -#: ../../library/pyexpat.rst:513 +#: ../../library/pyexpat.rst:549 msgid "" "The :mod:`~xml.parsers.expat.errors` module also provides error message " "constants and a dictionary :data:`~xml.parsers.expat.errors.codes` mapping " "these messages back to the error codes, see below." msgstr "" -#: ../../library/pyexpat.rst:520 +#: ../../library/pyexpat.rst:556 msgid "" "Line number on which the error was detected. The first line is numbered " "``1``." msgstr "" -#: ../../library/pyexpat.rst:525 +#: ../../library/pyexpat.rst:561 msgid "" "Character offset into the line where the error occurred. The first column " "is numbered ``0``." msgstr "" -#: ../../library/pyexpat.rst:532 +#: ../../library/pyexpat.rst:568 msgid "Example" msgstr "範例" -#: ../../library/pyexpat.rst:534 +#: ../../library/pyexpat.rst:570 msgid "" "The following program defines three handlers that just print out their " "arguments. ::" msgstr "" -#: ../../library/pyexpat.rst:558 +#: ../../library/pyexpat.rst:594 msgid "The output from this program is::" msgstr "" -#: ../../library/pyexpat.rst:575 +#: ../../library/pyexpat.rst:611 msgid "Content Model Descriptions" msgstr "" -#: ../../library/pyexpat.rst:581 +#: ../../library/pyexpat.rst:617 msgid "" "Content models are described using nested tuples. Each tuple contains four " "values: the type, the quantifier, the name, and a tuple of children. " "Children are simply additional content model descriptions." msgstr "" -#: ../../library/pyexpat.rst:585 +#: ../../library/pyexpat.rst:621 msgid "" "The values of the first two fields are constants defined in the :mod:`xml." "parsers.expat.model` module. These constants can be collected in two " "groups: the model type group and the quantifier group." msgstr "" -#: ../../library/pyexpat.rst:589 +#: ../../library/pyexpat.rst:625 msgid "The constants in the model type group are:" msgstr "" -#: ../../library/pyexpat.rst:595 +#: ../../library/pyexpat.rst:631 msgid "" "The element named by the model name was declared to have a content model of " "``ANY``." msgstr "" -#: ../../library/pyexpat.rst:602 +#: ../../library/pyexpat.rst:638 msgid "" "The named element allows a choice from a number of options; this is used for " "content models such as ``(A | B | C)``." msgstr "" -#: ../../library/pyexpat.rst:609 +#: ../../library/pyexpat.rst:645 msgid "Elements which are declared to be ``EMPTY`` have this model type." msgstr "" -#: ../../library/pyexpat.rst:623 +#: ../../library/pyexpat.rst:659 msgid "" "Models which represent a series of models which follow one after the other " "are indicated with this model type. This is used for models such as ``(A, " "B, C)``." msgstr "" -#: ../../library/pyexpat.rst:626 +#: ../../library/pyexpat.rst:662 msgid "The constants in the quantifier group are:" msgstr "" -#: ../../library/pyexpat.rst:632 +#: ../../library/pyexpat.rst:668 msgid "No modifier is given, so it can appear exactly once, as for ``A``." msgstr "" -#: ../../library/pyexpat.rst:638 +#: ../../library/pyexpat.rst:674 msgid "The model is optional: it can appear once or not at all, as for ``A?``." msgstr "" -#: ../../library/pyexpat.rst:644 +#: ../../library/pyexpat.rst:680 msgid "The model must occur one or more times (like ``A+``)." msgstr "" -#: ../../library/pyexpat.rst:650 +#: ../../library/pyexpat.rst:686 msgid "The model must occur zero or more times, as for ``A*``." msgstr "" -#: ../../library/pyexpat.rst:656 +#: ../../library/pyexpat.rst:692 msgid "Expat error constants" msgstr "" -#: ../../library/pyexpat.rst:660 +#: ../../library/pyexpat.rst:696 msgid "" "The following constants are provided in the :mod:`xml.parsers.expat.errors` " "module. These constants are useful in interpreting some of the attributes " @@ -636,206 +672,206 @@ msgid "" "XML_ERROR_{CONSTANT_NAME}]`." msgstr "" -#: ../../library/pyexpat.rst:668 +#: ../../library/pyexpat.rst:704 msgid "The ``errors`` module has the following attributes:" msgstr "" -#: ../../library/pyexpat.rst:672 +#: ../../library/pyexpat.rst:708 msgid "A dictionary mapping string descriptions to their error codes." msgstr "" -#: ../../library/pyexpat.rst:679 +#: ../../library/pyexpat.rst:715 msgid "A dictionary mapping numeric error codes to their string descriptions." msgstr "" -#: ../../library/pyexpat.rst:689 +#: ../../library/pyexpat.rst:725 msgid "" "An entity reference in an attribute value referred to an external entity " "instead of an internal entity." msgstr "" -#: ../../library/pyexpat.rst:695 +#: ../../library/pyexpat.rst:731 msgid "" "A character reference referred to a character which is illegal in XML (for " "example, character ``0``, or '``�``')." msgstr "" -#: ../../library/pyexpat.rst:701 +#: ../../library/pyexpat.rst:737 msgid "" "An entity reference referred to an entity which was declared with a " "notation, so cannot be parsed." msgstr "" -#: ../../library/pyexpat.rst:707 +#: ../../library/pyexpat.rst:743 msgid "An attribute was used more than once in a start tag." msgstr "" -#: ../../library/pyexpat.rst:715 +#: ../../library/pyexpat.rst:751 msgid "" "Raised when an input byte could not properly be assigned to a character; for " "example, a NUL byte (value ``0``) in a UTF-8 input stream." msgstr "" -#: ../../library/pyexpat.rst:721 +#: ../../library/pyexpat.rst:757 msgid "Something other than whitespace occurred after the document element." msgstr "" -#: ../../library/pyexpat.rst:726 +#: ../../library/pyexpat.rst:762 msgid "" "An XML declaration was found somewhere other than the start of the input " "data." msgstr "" -#: ../../library/pyexpat.rst:731 +#: ../../library/pyexpat.rst:767 msgid "" "The document contains no elements (XML requires all documents to contain " "exactly one top-level element).." msgstr "" -#: ../../library/pyexpat.rst:737 +#: ../../library/pyexpat.rst:773 msgid "Expat was not able to allocate memory internally." msgstr "" -#: ../../library/pyexpat.rst:742 +#: ../../library/pyexpat.rst:778 msgid "A parameter entity reference was found where it was not allowed." msgstr "" -#: ../../library/pyexpat.rst:747 +#: ../../library/pyexpat.rst:783 msgid "An incomplete character was found in the input." msgstr "" -#: ../../library/pyexpat.rst:752 +#: ../../library/pyexpat.rst:788 msgid "" "An entity reference contained another reference to the same entity; possibly " "via a different name, and possibly indirectly." msgstr "" -#: ../../library/pyexpat.rst:758 +#: ../../library/pyexpat.rst:794 msgid "Some unspecified syntax error was encountered." msgstr "" -#: ../../library/pyexpat.rst:763 +#: ../../library/pyexpat.rst:799 msgid "An end tag did not match the innermost open start tag." msgstr "" -#: ../../library/pyexpat.rst:768 +#: ../../library/pyexpat.rst:804 msgid "" "Some token (such as a start tag) was not closed before the end of the stream " "or the next token was encountered." msgstr "" -#: ../../library/pyexpat.rst:774 +#: ../../library/pyexpat.rst:810 msgid "A reference was made to an entity which was not defined." msgstr "" -#: ../../library/pyexpat.rst:779 +#: ../../library/pyexpat.rst:815 msgid "The document encoding is not supported by Expat." msgstr "" -#: ../../library/pyexpat.rst:784 +#: ../../library/pyexpat.rst:820 msgid "A CDATA marked section was not closed." msgstr "" -#: ../../library/pyexpat.rst:792 +#: ../../library/pyexpat.rst:828 msgid "" "The parser determined that the document was not \"standalone\" though it " "declared itself to be in the XML declaration, and the :attr:" "`NotStandaloneHandler` was set and returned ``0``." msgstr "" -#: ../../library/pyexpat.rst:805 +#: ../../library/pyexpat.rst:841 msgid "" "An operation was requested that requires DTD support to be compiled in, but " "Expat was configured without DTD support. This should never be reported by " "a standard build of the :mod:`xml.parsers.expat` module." msgstr "" -#: ../../library/pyexpat.rst:812 +#: ../../library/pyexpat.rst:848 msgid "" "A behavioral change was requested after parsing started that can only be " "changed before parsing has started. This is (currently) only raised by :" "meth:`UseForeignDTD`." msgstr "" -#: ../../library/pyexpat.rst:819 +#: ../../library/pyexpat.rst:855 msgid "An undeclared prefix was found when namespace processing was enabled." msgstr "" -#: ../../library/pyexpat.rst:824 +#: ../../library/pyexpat.rst:860 msgid "" "The document attempted to remove the namespace declaration associated with a " "prefix." msgstr "" -#: ../../library/pyexpat.rst:830 +#: ../../library/pyexpat.rst:866 msgid "A parameter entity contained incomplete markup." msgstr "" -#: ../../library/pyexpat.rst:835 +#: ../../library/pyexpat.rst:871 msgid "The document contained no document element at all." msgstr "" -#: ../../library/pyexpat.rst:840 +#: ../../library/pyexpat.rst:876 msgid "There was an error parsing a text declaration in an external entity." msgstr "" -#: ../../library/pyexpat.rst:845 +#: ../../library/pyexpat.rst:881 msgid "Characters were found in the public id that are not allowed." msgstr "" -#: ../../library/pyexpat.rst:850 +#: ../../library/pyexpat.rst:886 msgid "" "The requested operation was made on a suspended parser, but isn't allowed. " "This includes attempts to provide additional input or to stop the parser." msgstr "" -#: ../../library/pyexpat.rst:856 +#: ../../library/pyexpat.rst:892 msgid "" "An attempt to resume the parser was made when the parser had not been " "suspended." msgstr "" -#: ../../library/pyexpat.rst:861 ../../library/pyexpat.rst:894 -#: ../../library/pyexpat.rst:899 +#: ../../library/pyexpat.rst:897 ../../library/pyexpat.rst:930 +#: ../../library/pyexpat.rst:935 msgid "This should not be reported to Python applications." msgstr "" -#: ../../library/pyexpat.rst:866 +#: ../../library/pyexpat.rst:902 msgid "" "The requested operation was made on a parser which was finished parsing " "input, but isn't allowed. This includes attempts to provide additional " "input or to stop the parser." msgstr "" -#: ../../library/pyexpat.rst:876 +#: ../../library/pyexpat.rst:912 msgid "" "An attempt was made to undeclare reserved namespace prefix ``xml`` or to " "bind it to another namespace URI." msgstr "" -#: ../../library/pyexpat.rst:883 +#: ../../library/pyexpat.rst:919 msgid "" "An attempt was made to declare or undeclare reserved namespace prefix " "``xmlns``." msgstr "" -#: ../../library/pyexpat.rst:888 +#: ../../library/pyexpat.rst:924 msgid "" "An attempt was made to bind the URI of one the reserved namespace prefixes " "``xml`` and ``xmlns`` to another namespace prefix." msgstr "" -#: ../../library/pyexpat.rst:904 +#: ../../library/pyexpat.rst:940 msgid "" "The limit on input amplification factor (from DTD and entities) has been " "breached." msgstr "" -#: ../../library/pyexpat.rst:909 +#: ../../library/pyexpat.rst:945 msgid "Footnotes" msgstr "註解" -#: ../../library/pyexpat.rst:910 +#: ../../library/pyexpat.rst:946 msgid "" "The encoding string included in XML output should conform to the appropriate " "standards. For example, \"UTF-8\" is valid, but \"UTF8\" is not. See https://" diff --git a/library/xml.etree.elementtree.po b/library/xml.etree.elementtree.po index ccd18e84da..7420008ab9 100644 --- a/library/xml.etree.elementtree.po +++ b/library/xml.etree.elementtree.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-02 00:03+0000\n" +"POT-Creation-Date: 2024-03-07 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -164,18 +164,25 @@ msgid "" "memory." msgstr "" -#: ../../library/xml.etree.elementtree.rst:170 +#: ../../library/xml.etree.elementtree.rst:169 +msgid "" +"Where *immediate* feedback through events is wanted, calling method :meth:" +"`XMLPullParser.flush` can help reduce delay; please make sure to study the " +"related security notes." +msgstr "" + +#: ../../library/xml.etree.elementtree.rst:175 msgid "Finding interesting elements" msgstr "" -#: ../../library/xml.etree.elementtree.rst:172 +#: ../../library/xml.etree.elementtree.rst:177 msgid "" ":class:`Element` has some useful methods that help iterate recursively over " "all the sub-tree below it (its children, their children, and so on). For " "example, :meth:`Element.iter`::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:185 +#: ../../library/xml.etree.elementtree.rst:190 msgid "" ":meth:`Element.findall` finds only elements with a tag which are direct " "children of the current element. :meth:`Element.find` finds the *first* " @@ -183,23 +190,23 @@ msgid "" "text content. :meth:`Element.get` accesses the element's attributes::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:199 +#: ../../library/xml.etree.elementtree.rst:204 msgid "" "More sophisticated specification of which elements to look for is possible " "by using :ref:`XPath `." msgstr "" -#: ../../library/xml.etree.elementtree.rst:203 +#: ../../library/xml.etree.elementtree.rst:208 msgid "Modifying an XML File" msgstr "改動 XML 檔案" -#: ../../library/xml.etree.elementtree.rst:205 +#: ../../library/xml.etree.elementtree.rst:210 msgid "" ":class:`ElementTree` provides a simple way to build XML documents and write " "them to files. The :meth:`ElementTree.write` method serves this purpose." msgstr "" -#: ../../library/xml.etree.elementtree.rst:208 +#: ../../library/xml.etree.elementtree.rst:213 msgid "" "Once created, an :class:`Element` object may be manipulated by directly " "changing its fields (such as :attr:`Element.text`), adding and modifying " @@ -207,24 +214,24 @@ msgid "" "example with :meth:`Element.append`)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:213 +#: ../../library/xml.etree.elementtree.rst:218 msgid "" "Let's say we want to add one to each country's rank, and add an ``updated`` " "attribute to the rank element::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:223 -#: ../../library/xml.etree.elementtree.rst:267 +#: ../../library/xml.etree.elementtree.rst:228 +#: ../../library/xml.etree.elementtree.rst:272 msgid "Our XML now looks like this:" msgstr "XML 現在看起來像這樣:" -#: ../../library/xml.etree.elementtree.rst:251 +#: ../../library/xml.etree.elementtree.rst:256 msgid "" "We can remove elements using :meth:`Element.remove`. Let's say we want to " "remove all countries with a rank higher than 50::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:262 +#: ../../library/xml.etree.elementtree.rst:267 msgid "" "Note that concurrent modification while iterating can lead to problems, just " "like when iterating and modifying Python lists or dicts. Therefore, the " @@ -232,21 +239,21 @@ msgid "" "only then iterates over the list of matches." msgstr "" -#: ../../library/xml.etree.elementtree.rst:289 +#: ../../library/xml.etree.elementtree.rst:294 msgid "Building XML documents" msgstr "" -#: ../../library/xml.etree.elementtree.rst:291 +#: ../../library/xml.etree.elementtree.rst:296 msgid "" "The :func:`SubElement` function also provides a convenient way to create new " "sub-elements for a given element::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:302 +#: ../../library/xml.etree.elementtree.rst:307 msgid "Parsing XML with Namespaces" msgstr "" -#: ../../library/xml.etree.elementtree.rst:304 +#: ../../library/xml.etree.elementtree.rst:309 msgid "" "If the XML input has `namespaces `__, tags and attributes with prefixes in the form ``prefix:" @@ -256,34 +263,34 @@ msgid "" "prefixed tags." msgstr "" -#: ../../library/xml.etree.elementtree.rst:312 +#: ../../library/xml.etree.elementtree.rst:317 msgid "" "Here is an XML example that incorporates two namespaces, one with the prefix " "\"fictional\" and the other serving as the default namespace:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:333 +#: ../../library/xml.etree.elementtree.rst:338 msgid "" "One way to search and explore this XML example is to manually add the URI to " "every tag or attribute in the xpath of a :meth:`~Element.find` or :meth:" "`~Element.findall`::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:344 +#: ../../library/xml.etree.elementtree.rst:349 msgid "" "A better way to search the namespaced XML example is to create a dictionary " "with your own prefixes and use those in the search functions::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:356 +#: ../../library/xml.etree.elementtree.rst:361 msgid "These two approaches both output::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:370 +#: ../../library/xml.etree.elementtree.rst:375 msgid "XPath support" msgstr "XPath 支援" -#: ../../library/xml.etree.elementtree.rst:372 +#: ../../library/xml.etree.elementtree.rst:377 msgid "" "This module provides limited support for `XPath expressions `_ for locating elements in a tree. The goal is to support a " @@ -291,41 +298,41 @@ msgid "" "scope of the module." msgstr "" -#: ../../library/xml.etree.elementtree.rst:378 -#: ../../library/xml.etree.elementtree.rst:772 +#: ../../library/xml.etree.elementtree.rst:383 +#: ../../library/xml.etree.elementtree.rst:777 msgid "Example" msgstr "範例" -#: ../../library/xml.etree.elementtree.rst:380 +#: ../../library/xml.etree.elementtree.rst:385 msgid "" "Here's an example that demonstrates some of the XPath capabilities of the " "module. We'll be using the ``countrydata`` XML document from the :ref:" "`Parsing XML ` section::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:404 +#: ../../library/xml.etree.elementtree.rst:409 msgid "" "For XML with namespaces, use the usual qualified ``{namespace}tag`` " "notation::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:411 +#: ../../library/xml.etree.elementtree.rst:416 msgid "Supported XPath syntax" msgstr "" -#: ../../library/xml.etree.elementtree.rst:416 +#: ../../library/xml.etree.elementtree.rst:421 msgid "Syntax" msgstr "語法" -#: ../../library/xml.etree.elementtree.rst:416 +#: ../../library/xml.etree.elementtree.rst:421 msgid "Meaning" msgstr "意義" -#: ../../library/xml.etree.elementtree.rst:418 +#: ../../library/xml.etree.elementtree.rst:423 msgid "``tag``" msgstr "``tag``" -#: ../../library/xml.etree.elementtree.rst:418 +#: ../../library/xml.etree.elementtree.rst:423 msgid "" "Selects all child elements with the given tag. For example, ``spam`` selects " "all child elements named ``spam``, and ``spam/egg`` selects all " @@ -335,133 +342,133 @@ msgid "" "not in a namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:427 +#: ../../library/xml.etree.elementtree.rst:432 msgid "Support for star-wildcards was added." msgstr "新增對星號萬用字元的支援。" -#: ../../library/xml.etree.elementtree.rst:430 +#: ../../library/xml.etree.elementtree.rst:435 msgid "``*``" msgstr "``*``" -#: ../../library/xml.etree.elementtree.rst:430 +#: ../../library/xml.etree.elementtree.rst:435 msgid "" "Selects all child elements, including comments and processing instructions. " "For example, ``*/egg`` selects all grandchildren named ``egg``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:434 +#: ../../library/xml.etree.elementtree.rst:439 msgid "``.``" msgstr "``.``" -#: ../../library/xml.etree.elementtree.rst:434 +#: ../../library/xml.etree.elementtree.rst:439 msgid "" "Selects the current node. This is mostly useful at the beginning of the " "path, to indicate that it's a relative path." msgstr "" -#: ../../library/xml.etree.elementtree.rst:438 +#: ../../library/xml.etree.elementtree.rst:443 msgid "``//``" msgstr "``//``" -#: ../../library/xml.etree.elementtree.rst:438 +#: ../../library/xml.etree.elementtree.rst:443 msgid "" "Selects all subelements, on all levels beneath the current element. For " "example, ``.//egg`` selects all ``egg`` elements in the entire tree." msgstr "" -#: ../../library/xml.etree.elementtree.rst:442 +#: ../../library/xml.etree.elementtree.rst:447 msgid "``..``" msgstr "``..``" -#: ../../library/xml.etree.elementtree.rst:442 +#: ../../library/xml.etree.elementtree.rst:447 msgid "" "Selects the parent element. Returns ``None`` if the path attempts to reach " "the ancestors of the start element (the element ``find`` was called on)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:446 +#: ../../library/xml.etree.elementtree.rst:451 msgid "``[@attrib]``" msgstr "``[@attrib]``" -#: ../../library/xml.etree.elementtree.rst:446 +#: ../../library/xml.etree.elementtree.rst:451 msgid "Selects all elements that have the given attribute." msgstr "選擇所有具有給定屬性的元素。" -#: ../../library/xml.etree.elementtree.rst:448 +#: ../../library/xml.etree.elementtree.rst:453 msgid "``[@attrib='value']``" msgstr "``[@attrib='value']``" -#: ../../library/xml.etree.elementtree.rst:448 +#: ../../library/xml.etree.elementtree.rst:453 msgid "" "Selects all elements for which the given attribute has the given value. The " "value cannot contain quotes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:452 +#: ../../library/xml.etree.elementtree.rst:457 msgid "``[@attrib!='value']``" msgstr "``[@attrib!='value']``" -#: ../../library/xml.etree.elementtree.rst:452 +#: ../../library/xml.etree.elementtree.rst:457 msgid "" "Selects all elements for which the given attribute does not have the given " "value. The value cannot contain quotes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:458 +#: ../../library/xml.etree.elementtree.rst:463 msgid "``[tag]``" msgstr "``[tag]``" -#: ../../library/xml.etree.elementtree.rst:458 +#: ../../library/xml.etree.elementtree.rst:463 msgid "" "Selects all elements that have a child named ``tag``. Only immediate " "children are supported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:461 +#: ../../library/xml.etree.elementtree.rst:466 msgid "``[.='text']``" msgstr "``[.='text']``" -#: ../../library/xml.etree.elementtree.rst:461 +#: ../../library/xml.etree.elementtree.rst:466 msgid "" "Selects all elements whose complete text content, including descendants, " "equals the given ``text``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:466 +#: ../../library/xml.etree.elementtree.rst:471 msgid "``[.!='text']``" msgstr "``[.!='text']``" -#: ../../library/xml.etree.elementtree.rst:466 +#: ../../library/xml.etree.elementtree.rst:471 msgid "" "Selects all elements whose complete text content, including descendants, " "does not equal the given ``text``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:472 +#: ../../library/xml.etree.elementtree.rst:477 msgid "``[tag='text']``" msgstr "``[tag='text']``" -#: ../../library/xml.etree.elementtree.rst:472 +#: ../../library/xml.etree.elementtree.rst:477 msgid "" "Selects all elements that have a child named ``tag`` whose complete text " "content, including descendants, equals the given ``text``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:476 +#: ../../library/xml.etree.elementtree.rst:481 msgid "``[tag!='text']``" msgstr "``[tag!='text']``" -#: ../../library/xml.etree.elementtree.rst:476 +#: ../../library/xml.etree.elementtree.rst:481 msgid "" "Selects all elements that have a child named ``tag`` whose complete text " "content, including descendants, does not equal the given ``text``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:482 +#: ../../library/xml.etree.elementtree.rst:487 msgid "``[position]``" msgstr "``[position]``" -#: ../../library/xml.etree.elementtree.rst:482 +#: ../../library/xml.etree.elementtree.rst:487 msgid "" "Selects all elements that are located at the given position. The position " "can be either an integer (1 is the first position), the expression " @@ -469,28 +476,28 @@ msgid "" "position (e.g. ``last()-1``)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:489 +#: ../../library/xml.etree.elementtree.rst:494 msgid "" "Predicates (expressions within square brackets) must be preceded by a tag " "name, an asterisk, or another predicate. ``position`` predicates must be " "preceded by a tag name." msgstr "" -#: ../../library/xml.etree.elementtree.rst:494 -#: ../../library/xml.etree.elementtree.rst:824 +#: ../../library/xml.etree.elementtree.rst:499 +#: ../../library/xml.etree.elementtree.rst:829 msgid "Reference" msgstr "" -#: ../../library/xml.etree.elementtree.rst:499 -#: ../../library/xml.etree.elementtree.rst:829 +#: ../../library/xml.etree.elementtree.rst:504 +#: ../../library/xml.etree.elementtree.rst:834 msgid "Functions" msgstr "函式" -#: ../../library/xml.etree.elementtree.rst:503 +#: ../../library/xml.etree.elementtree.rst:508 msgid "`C14N 2.0 `_ transformation function." msgstr "" -#: ../../library/xml.etree.elementtree.rst:505 +#: ../../library/xml.etree.elementtree.rst:510 msgid "" "Canonicalization is a way to normalise XML output in a way that allows byte-" "by-byte comparisons and digital signatures. It reduced the freedom that XML " @@ -499,7 +506,7 @@ msgid "" "declarations, the ordering of attributes, and ignorable whitespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:511 +#: ../../library/xml.etree.elementtree.rst:516 msgid "" "This function takes an XML data string (*xml_data*) or a file path or file-" "like object (*from_file*) as input, converts it to the canonical form, and " @@ -508,63 +515,63 @@ msgid "" "should therefore be opened in text mode with ``utf-8`` encoding." msgstr "" -#: ../../library/xml.etree.elementtree.rst:518 +#: ../../library/xml.etree.elementtree.rst:523 msgid "Typical uses::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:529 +#: ../../library/xml.etree.elementtree.rst:534 msgid "The configuration *options* are as follows:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:531 +#: ../../library/xml.etree.elementtree.rst:536 msgid "*with_comments*: set to true to include comments (default: false)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:532 +#: ../../library/xml.etree.elementtree.rst:537 msgid "" "*strip_text*: set to true to strip whitespace before and after text content" msgstr "" -#: ../../library/xml.etree.elementtree.rst:533 -#: ../../library/xml.etree.elementtree.rst:535 +#: ../../library/xml.etree.elementtree.rst:538 +#: ../../library/xml.etree.elementtree.rst:540 msgid "(default: false)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:534 +#: ../../library/xml.etree.elementtree.rst:539 msgid "" "*rewrite_prefixes*: set to true to replace namespace prefixes by " "\"n{number}\"" msgstr "" -#: ../../library/xml.etree.elementtree.rst:536 +#: ../../library/xml.etree.elementtree.rst:541 msgid "*qname_aware_tags*: a set of qname aware tag names in which prefixes" msgstr "" -#: ../../library/xml.etree.elementtree.rst:537 -#: ../../library/xml.etree.elementtree.rst:539 +#: ../../library/xml.etree.elementtree.rst:542 +#: ../../library/xml.etree.elementtree.rst:544 msgid "should be replaced in text content (default: empty)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:538 +#: ../../library/xml.etree.elementtree.rst:543 msgid "" "*qname_aware_attrs*: a set of qname aware attribute names in which prefixes" msgstr "" -#: ../../library/xml.etree.elementtree.rst:540 +#: ../../library/xml.etree.elementtree.rst:545 msgid "*exclude_attrs*: a set of attribute names that should not be serialised" msgstr "" -#: ../../library/xml.etree.elementtree.rst:541 +#: ../../library/xml.etree.elementtree.rst:546 msgid "*exclude_tags*: a set of tag names that should not be serialised" msgstr "" -#: ../../library/xml.etree.elementtree.rst:543 +#: ../../library/xml.etree.elementtree.rst:548 msgid "" "In the option list above, \"a set\" refers to any collection or iterable of " "strings, no ordering is expected." msgstr "" -#: ../../library/xml.etree.elementtree.rst:551 +#: ../../library/xml.etree.elementtree.rst:556 msgid "" "Comment element factory. This factory function creates a special element " "that will be serialized as an XML comment by the standard serializer. The " @@ -573,7 +580,7 @@ msgid "" "representing a comment." msgstr "" -#: ../../library/xml.etree.elementtree.rst:557 +#: ../../library/xml.etree.elementtree.rst:562 msgid "" "Note that :class:`XMLParser` skips over comments in the input instead of " "creating comment objects for them. An :class:`ElementTree` will only contain " @@ -581,29 +588,29 @@ msgid "" "class:`Element` methods." msgstr "" -#: ../../library/xml.etree.elementtree.rst:564 +#: ../../library/xml.etree.elementtree.rst:569 msgid "" "Writes an element tree or element structure to sys.stdout. This function " "should be used for debugging only." msgstr "" -#: ../../library/xml.etree.elementtree.rst:567 +#: ../../library/xml.etree.elementtree.rst:572 msgid "" "The exact output format is implementation dependent. In this version, it's " "written as an ordinary XML file." msgstr "" -#: ../../library/xml.etree.elementtree.rst:570 +#: ../../library/xml.etree.elementtree.rst:575 msgid "*elem* is an element tree or an individual element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:572 +#: ../../library/xml.etree.elementtree.rst:577 msgid "" "The :func:`dump` function now preserves the attribute order specified by the " "user." msgstr "" -#: ../../library/xml.etree.elementtree.rst:579 +#: ../../library/xml.etree.elementtree.rst:584 msgid "" "Parses an XML section from a string constant. Same as :func:`XML`. *text* " "is a string containing XML data. *parser* is an optional parser instance. " @@ -611,7 +618,7 @@ msgid "" "class:`Element` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:587 +#: ../../library/xml.etree.elementtree.rst:592 msgid "" "Parses an XML document from a sequence of string fragments. *sequence* is a " "list or other sequence containing XML data fragments. *parser* is an " @@ -619,7 +626,7 @@ msgid "" "parser is used. Returns an :class:`Element` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:597 +#: ../../library/xml.etree.elementtree.rst:602 msgid "" "Appends whitespace to the subtree to indent the tree visually. This can be " "used to generate pretty-printed XML output. *tree* can be an Element or " @@ -629,13 +636,13 @@ msgid "" "indentation level as *level*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:609 +#: ../../library/xml.etree.elementtree.rst:614 msgid "" "Check if an object appears to be a valid element object. *element* is an " "element instance. Return ``True`` if this is an element object." msgstr "" -#: ../../library/xml.etree.elementtree.rst:615 +#: ../../library/xml.etree.elementtree.rst:620 msgid "" "Parses an XML section into an element tree incrementally, and reports what's " "going on to the user. *source* is a filename or :term:`file object` " @@ -652,7 +659,7 @@ msgid "" "read." msgstr "" -#: ../../library/xml.etree.elementtree.rst:629 +#: ../../library/xml.etree.elementtree.rst:634 msgid "" "Note that while :func:`iterparse` builds the tree incrementally, it issues " "blocking reads on *source* (or the file it names). As such, it's unsuitable " @@ -660,7 +667,7 @@ msgid "" "parsing, see :class:`XMLPullParser`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:636 +#: ../../library/xml.etree.elementtree.rst:641 msgid "" ":func:`iterparse` only guarantees that it has seen the \">\" character of a " "starting tag when it emits a \"start\" event, so the attributes are defined, " @@ -669,21 +676,21 @@ msgid "" "present." msgstr "" -#: ../../library/xml.etree.elementtree.rst:642 -#: ../../library/xml.etree.elementtree.rst:1481 +#: ../../library/xml.etree.elementtree.rst:647 +#: ../../library/xml.etree.elementtree.rst:1520 msgid "If you need a fully populated element, look for \"end\" events instead." msgstr "" -#: ../../library/xml.etree.elementtree.rst:644 +#: ../../library/xml.etree.elementtree.rst:649 msgid "The *parser* argument." msgstr "*parser* 引數。" -#: ../../library/xml.etree.elementtree.rst:647 -#: ../../library/xml.etree.elementtree.rst:1485 +#: ../../library/xml.etree.elementtree.rst:652 +#: ../../library/xml.etree.elementtree.rst:1524 msgid "The ``comment`` and ``pi`` events were added." msgstr "新增 *context* 與 *check_hostname* 事件。" -#: ../../library/xml.etree.elementtree.rst:653 +#: ../../library/xml.etree.elementtree.rst:658 msgid "" "Parses an XML section into an element tree. *source* is a filename or file " "object containing XML data. *parser* is an optional parser instance. If " @@ -691,7 +698,7 @@ msgid "" "class:`ElementTree` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:661 +#: ../../library/xml.etree.elementtree.rst:666 msgid "" "PI element factory. This factory function creates a special element that " "will be serialized as an XML processing instruction. *target* is a string " @@ -699,7 +706,7 @@ msgid "" "given. Returns an element instance, representing a processing instruction." msgstr "" -#: ../../library/xml.etree.elementtree.rst:666 +#: ../../library/xml.etree.elementtree.rst:671 msgid "" "Note that :class:`XMLParser` skips over processing instructions in the input " "instead of creating PI objects for them. An :class:`ElementTree` will only " @@ -707,7 +714,7 @@ msgid "" "tree using one of the :class:`Element` methods." msgstr "" -#: ../../library/xml.etree.elementtree.rst:674 +#: ../../library/xml.etree.elementtree.rst:679 msgid "" "Registers a namespace prefix. The registry is global, and any existing " "mapping for either the given prefix or the namespace URI will be removed. " @@ -716,13 +723,13 @@ msgid "" "all possible." msgstr "" -#: ../../library/xml.etree.elementtree.rst:685 +#: ../../library/xml.etree.elementtree.rst:690 msgid "" "Subelement factory. This function creates an element instance, and appends " "it to an existing element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:688 +#: ../../library/xml.etree.elementtree.rst:693 msgid "" "The element name, attribute names, and attribute values can be either " "bytestrings or Unicode strings. *parent* is the parent element. *tag* is " @@ -731,7 +738,7 @@ msgid "" "arguments. Returns an element instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:699 +#: ../../library/xml.etree.elementtree.rst:704 msgid "" "Generates a string representation of an XML element, including all " "subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is " @@ -743,24 +750,24 @@ msgid "" "Returns an (optionally) encoded string containing the XML data." msgstr "" -#: ../../library/xml.etree.elementtree.rst:708 -#: ../../library/xml.etree.elementtree.rst:735 -#: ../../library/xml.etree.elementtree.rst:1192 +#: ../../library/xml.etree.elementtree.rst:713 +#: ../../library/xml.etree.elementtree.rst:740 +#: ../../library/xml.etree.elementtree.rst:1197 msgid "Added the *short_empty_elements* parameter." msgstr "新增 *short_empty_elements* 參數。" -#: ../../library/xml.etree.elementtree.rst:711 -#: ../../library/xml.etree.elementtree.rst:738 +#: ../../library/xml.etree.elementtree.rst:716 +#: ../../library/xml.etree.elementtree.rst:743 msgid "Added the *xml_declaration* and *default_namespace* parameters." msgstr "新增 *xml_declaration* 與 *default_namespace* 參數。" -#: ../../library/xml.etree.elementtree.rst:714 +#: ../../library/xml.etree.elementtree.rst:719 msgid "" "The :func:`tostring` function now preserves the attribute order specified by " "the user." msgstr "" -#: ../../library/xml.etree.elementtree.rst:723 +#: ../../library/xml.etree.elementtree.rst:728 msgid "" "Generates a string representation of an XML element, including all " "subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is " @@ -774,13 +781,13 @@ msgid "" "join(tostringlist(element)) == tostring(element)``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:741 +#: ../../library/xml.etree.elementtree.rst:746 msgid "" "The :func:`tostringlist` function now preserves the attribute order " "specified by the user." msgstr "" -#: ../../library/xml.etree.elementtree.rst:748 +#: ../../library/xml.etree.elementtree.rst:753 msgid "" "Parses an XML section from a string constant. This function can be used to " "embed \"XML literals\" in Python code. *text* is a string containing XML " @@ -788,7 +795,7 @@ msgid "" "class:`XMLParser` parser is used. Returns an :class:`Element` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:756 +#: ../../library/xml.etree.elementtree.rst:761 msgid "" "Parses an XML section from a string constant, and also returns a dictionary " "which maps from element id:s to elements. *text* is a string containing XML " @@ -797,11 +804,11 @@ msgid "" "`Element` instance and a dictionary." msgstr "" -#: ../../library/xml.etree.elementtree.rst:766 +#: ../../library/xml.etree.elementtree.rst:771 msgid "XInclude support" msgstr "" -#: ../../library/xml.etree.elementtree.rst:768 +#: ../../library/xml.etree.elementtree.rst:773 msgid "" "This module provides limited support for `XInclude directives `_, via the :mod:`xml.etree.ElementInclude` helper " @@ -809,7 +816,7 @@ msgid "" "element trees, based on information in the tree." msgstr "" -#: ../../library/xml.etree.elementtree.rst:774 +#: ../../library/xml.etree.elementtree.rst:779 msgid "" "Here's an example that demonstrates use of the XInclude module. To include " "an XML document in the current document, use the ``{http://www.w3.org/2001/" @@ -817,43 +824,43 @@ msgid "" "and use the **href** attribute to specify the document to include." msgstr "" -#: ../../library/xml.etree.elementtree.rst:783 +#: ../../library/xml.etree.elementtree.rst:788 msgid "" "By default, the **href** attribute is treated as a file name. You can use " "custom loaders to override this behaviour. Also note that the standard " "helper does not support XPointer syntax." msgstr "" -#: ../../library/xml.etree.elementtree.rst:785 +#: ../../library/xml.etree.elementtree.rst:790 msgid "" "To process this file, load it as usual, and pass the root element to the :" "mod:`xml.etree.ElementTree` module:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:796 +#: ../../library/xml.etree.elementtree.rst:801 msgid "" "The ElementInclude module replaces the ``{http://www.w3.org/2001/XInclude}" "include`` element with the root element from the **source.xml** document. " "The result might look something like this:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:804 +#: ../../library/xml.etree.elementtree.rst:809 msgid "" "If the **parse** attribute is omitted, it defaults to \"xml\". The href " "attribute is required." msgstr "" -#: ../../library/xml.etree.elementtree.rst:806 +#: ../../library/xml.etree.elementtree.rst:811 msgid "" "To include a text document, use the ``{http://www.w3.org/2001/XInclude}" "include`` element, and set the **parse** attribute to \"text\":" msgstr "" -#: ../../library/xml.etree.elementtree.rst:815 +#: ../../library/xml.etree.elementtree.rst:820 msgid "The result might look something like:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:836 +#: ../../library/xml.etree.elementtree.rst:841 msgid "" "Default loader. This default loader reads an included resource from disk. " "*href* is a URL. *parse* is for parse mode either \"xml\" or \"text\". " @@ -864,7 +871,7 @@ msgid "" "or raise an exception." msgstr "" -#: ../../library/xml.etree.elementtree.rst:848 +#: ../../library/xml.etree.elementtree.rst:853 msgid "" "This function expands XInclude directives. *elem* is the root element. " "*loader* is an optional resource loader. If omitted, it defaults to :func:" @@ -875,28 +882,28 @@ msgid "" "malicious content explosion. Pass a negative value to disable the limitation." msgstr "" -#: ../../library/xml.etree.elementtree.rst:856 +#: ../../library/xml.etree.elementtree.rst:861 msgid "" "Returns the expanded resource. If the parse mode is ``\"xml\"``, this is an " "ElementTree instance. If the parse mode is \"text\", this is a Unicode " "string. If the loader fails, it can return None or raise an exception." msgstr "" -#: ../../library/xml.etree.elementtree.rst:861 +#: ../../library/xml.etree.elementtree.rst:866 msgid "Added the *base_url* and *max_depth* parameters." msgstr "新增 *base_url* 與 *max_depth* 參數。" -#: ../../library/xml.etree.elementtree.rst:868 +#: ../../library/xml.etree.elementtree.rst:873 msgid "Element Objects" msgstr "Element 物件" -#: ../../library/xml.etree.elementtree.rst:875 +#: ../../library/xml.etree.elementtree.rst:880 msgid "" "Element class. This class defines the Element interface, and provides a " "reference implementation of this interface." msgstr "" -#: ../../library/xml.etree.elementtree.rst:878 +#: ../../library/xml.etree.elementtree.rst:883 msgid "" "The element name, attribute names, and attribute values can be either " "bytestrings or Unicode strings. *tag* is the element name. *attrib* is an " @@ -904,13 +911,13 @@ msgid "" "additional attributes, given as keyword arguments." msgstr "" -#: ../../library/xml.etree.elementtree.rst:886 +#: ../../library/xml.etree.elementtree.rst:891 msgid "" "A string identifying what kind of data this element represents (the element " "type, in other words)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:893 +#: ../../library/xml.etree.elementtree.rst:898 msgid "" "These attributes can be used to hold additional data associated with the " "element. Their values are usually strings but may be any application-" @@ -921,7 +928,7 @@ msgid "" "the XML data" msgstr "" -#: ../../library/xml.etree.elementtree.rst:905 +#: ../../library/xml.etree.elementtree.rst:910 msgid "" "the *a* element has ``None`` for both *text* and *tail* attributes, the *b* " "element has *text* ``\"1\"`` and *tail* ``\"4\"``, the *c* element has " @@ -929,17 +936,17 @@ msgid "" "``None`` and *tail* ``\"3\"``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:910 +#: ../../library/xml.etree.elementtree.rst:915 msgid "" "To collect the inner text of an element, see :meth:`itertext`, for example " "``\"\".join(element.itertext())``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:913 +#: ../../library/xml.etree.elementtree.rst:918 msgid "Applications may store arbitrary objects in these attributes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:918 +#: ../../library/xml.etree.elementtree.rst:923 msgid "" "A dictionary containing the element's attributes. Note that while the " "*attrib* value is always a real mutable Python dictionary, an ElementTree " @@ -948,59 +955,59 @@ msgid "" "implementations, use the dictionary methods below whenever possible." msgstr "" -#: ../../library/xml.etree.elementtree.rst:924 +#: ../../library/xml.etree.elementtree.rst:929 msgid "The following dictionary-like methods work on the element attributes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:929 +#: ../../library/xml.etree.elementtree.rst:934 msgid "" "Resets an element. This function removes all subelements, clears all " "attributes, and sets the text and tail attributes to ``None``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:935 +#: ../../library/xml.etree.elementtree.rst:940 msgid "Gets the element attribute named *key*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:937 +#: ../../library/xml.etree.elementtree.rst:942 msgid "" "Returns the attribute value, or *default* if the attribute was not found." msgstr "" -#: ../../library/xml.etree.elementtree.rst:942 +#: ../../library/xml.etree.elementtree.rst:947 msgid "" "Returns the element attributes as a sequence of (name, value) pairs. The " "attributes are returned in an arbitrary order." msgstr "" -#: ../../library/xml.etree.elementtree.rst:948 +#: ../../library/xml.etree.elementtree.rst:953 msgid "" "Returns the elements attribute names as a list. The names are returned in " "an arbitrary order." msgstr "" -#: ../../library/xml.etree.elementtree.rst:954 +#: ../../library/xml.etree.elementtree.rst:959 msgid "Set the attribute *key* on the element to *value*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:956 +#: ../../library/xml.etree.elementtree.rst:961 msgid "The following methods work on the element's children (subelements)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:961 +#: ../../library/xml.etree.elementtree.rst:966 msgid "" "Adds the element *subelement* to the end of this element's internal list of " "subelements. Raises :exc:`TypeError` if *subelement* is not an :class:" "`Element`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:968 +#: ../../library/xml.etree.elementtree.rst:973 msgid "" "Appends *subelements* from a sequence object with zero or more elements. " "Raises :exc:`TypeError` if a subelement is not an :class:`Element`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:976 +#: ../../library/xml.etree.elementtree.rst:981 msgid "" "Finds the first subelement matching *match*. *match* may be a tag name or " "a :ref:`path `. Returns an element instance or " @@ -1009,7 +1016,7 @@ msgid "" "expression into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:985 +#: ../../library/xml.etree.elementtree.rst:990 msgid "" "Finds all matching subelements, by tag name or :ref:`path `. Returns a list containing all matching elements in document " @@ -1018,7 +1025,7 @@ msgid "" "expression into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:994 +#: ../../library/xml.etree.elementtree.rst:999 msgid "" "Finds text for the first subelement matching *match*. *match* may be a tag " "name or a :ref:`path `. Returns the text content of the " @@ -1029,13 +1036,13 @@ msgid "" "into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1005 +#: ../../library/xml.etree.elementtree.rst:1010 msgid "" "Inserts *subelement* at the given position in this element. Raises :exc:" "`TypeError` if *subelement* is not an :class:`Element`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1011 +#: ../../library/xml.etree.elementtree.rst:1016 msgid "" "Creates a tree :term:`iterator` with the current element as the root. The " "iterator iterates over this element and all elements below it, in document " @@ -1044,7 +1051,7 @@ msgid "" "structure is modified during iteration, the result is undefined." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1022 +#: ../../library/xml.etree.elementtree.rst:1027 msgid "" "Finds all matching subelements, by tag name or :ref:`path `. Returns an iterable yielding all matching elements in document " @@ -1052,44 +1059,44 @@ msgid "" "name." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1033 +#: ../../library/xml.etree.elementtree.rst:1038 msgid "" "Creates a text iterator. The iterator loops over this element and all " "subelements, in document order, and returns all inner text." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1041 +#: ../../library/xml.etree.elementtree.rst:1046 msgid "" "Creates a new element object of the same type as this element. Do not call " "this method, use the :func:`SubElement` factory function instead." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1047 +#: ../../library/xml.etree.elementtree.rst:1052 msgid "" "Removes *subelement* from the element. Unlike the find\\* methods this " "method compares elements based on the instance identity, not on tag value or " "contents." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1051 +#: ../../library/xml.etree.elementtree.rst:1056 msgid "" ":class:`Element` objects also support the following sequence type methods " "for working with subelements: :meth:`~object.__delitem__`, :meth:`~object." "__getitem__`, :meth:`~object.__setitem__`, :meth:`~object.__len__`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1056 +#: ../../library/xml.etree.elementtree.rst:1061 msgid "" "Caution: Elements with no subelements will test as ``False``. Testing the " "truth value of an Element is deprecated and will raise an exception in " "Python 3.14. Use specific ``len(elem)`` or ``elem is None`` test instead.::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1068 +#: ../../library/xml.etree.elementtree.rst:1073 msgid "Testing the truth value of an Element emits :exc:`DeprecationWarning`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1071 +#: ../../library/xml.etree.elementtree.rst:1076 msgid "" "Prior to Python 3.8, the serialisation order of the XML attributes of " "elements was artificially made predictable by sorting the attributes by " @@ -1098,7 +1105,7 @@ msgid "" "attributes were originally parsed or created by user code." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1077 +#: ../../library/xml.etree.elementtree.rst:1082 msgid "" "In general, user code should try not to depend on a specific ordering of " "attributes, given that the `XML Information Set `_ writer. Arguments are the " "same as for the :func:`canonicalize` function. This class does not build a " @@ -1334,11 +1341,11 @@ msgid "" "using the *write* function." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1356 +#: ../../library/xml.etree.elementtree.rst:1361 msgid "XMLParser Objects" msgstr "XMLParser 物件" -#: ../../library/xml.etree.elementtree.rst:1361 +#: ../../library/xml.etree.elementtree.rst:1366 msgid "" "This class is the low-level building block of the module. It uses :mod:`xml." "parsers.expat` for efficient, event-based parsing of XML. It can be fed XML " @@ -1349,24 +1356,43 @@ msgid "" "XML file." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1369 +#: ../../library/xml.etree.elementtree.rst:1374 msgid "" "Parameters are now :ref:`keyword-only `. The *html* " "argument no longer supported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1376 +#: ../../library/xml.etree.elementtree.rst:1381 msgid "" "Finishes feeding data to the parser. Returns the result of calling the " "``close()`` method of the *target* passed during construction; by default, " "this is the toplevel document element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1383 +#: ../../library/xml.etree.elementtree.rst:1388 msgid "Feeds data to the parser. *data* is encoded data." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1385 +#: ../../library/xml.etree.elementtree.rst:1393 +#: ../../library/xml.etree.elementtree.rst:1471 +msgid "" +"Triggers parsing of any previously fed unparsed data, which can be used to " +"ensure more immediate feedback, in particular with Expat >=2.6.0. The " +"implementation of :meth:`flush` temporarily disables reparse deferral with " +"Expat (if currently enabled) and triggers a reparse. Disabling reparse " +"deferral has security consequences; please see :meth:`xml.parsers.expat." +"xmlparser.SetReparseDeferralEnabled` for details." +msgstr "" + +#: ../../library/xml.etree.elementtree.rst:1400 +#: ../../library/xml.etree.elementtree.rst:1478 +msgid "" +"Note that :meth:`flush` has been backported to some prior releases of " +"CPython as a security fix. Check for availability of :meth:`flush` using :" +"func:`hasattr` if used in code running across a variety of Python versions." +msgstr "" + +#: ../../library/xml.etree.elementtree.rst:1408 msgid "" ":meth:`XMLParser.feed` calls *target*\\'s ``start(tag, attrs_dict)`` method " "for each opening tag, its ``end(tag)`` method for each closing tag, and data " @@ -1377,11 +1403,11 @@ msgid "" "of an XML file::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1429 +#: ../../library/xml.etree.elementtree.rst:1452 msgid "XMLPullParser Objects" msgstr "XMLPullParser 物件" -#: ../../library/xml.etree.elementtree.rst:1433 +#: ../../library/xml.etree.elementtree.rst:1456 msgid "" "A pull parser suitable for non-blocking applications. Its input-side API is " "similar to that of :class:`XMLParser`, but instead of pushing calls to a " @@ -1393,11 +1419,11 @@ msgid "" "If *events* is omitted, only ``\"end\"`` events are reported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1444 +#: ../../library/xml.etree.elementtree.rst:1467 msgid "Feed the given bytes data to the parser." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1448 +#: ../../library/xml.etree.elementtree.rst:1487 msgid "" "Signal the parser that the data stream is terminated. Unlike :meth:" "`XMLParser.close`, this method always returns :const:`None`. Any events not " @@ -1405,7 +1431,7 @@ msgid "" "`read_events`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1455 +#: ../../library/xml.etree.elementtree.rst:1494 msgid "" "Return an iterator over the events which have been encountered in the data " "fed to the parser. The iterator yields ``(event, elem)`` pairs, where " @@ -1414,25 +1440,25 @@ msgid "" "follows." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1461 +#: ../../library/xml.etree.elementtree.rst:1500 msgid "``start``, ``end``: the current Element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1462 +#: ../../library/xml.etree.elementtree.rst:1501 msgid "``comment``, ``pi``: the current comment / processing instruction" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1463 +#: ../../library/xml.etree.elementtree.rst:1502 msgid "" "``start-ns``: a tuple ``(prefix, uri)`` naming the declared namespace " "mapping." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1465 +#: ../../library/xml.etree.elementtree.rst:1504 msgid "``end-ns``: :const:`None` (this may change in a future version)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1467 +#: ../../library/xml.etree.elementtree.rst:1506 msgid "" "Events provided in a previous call to :meth:`read_events` will not be " "yielded again. Events are consumed from the internal queue only when they " @@ -1441,7 +1467,7 @@ msgid "" "results." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1475 +#: ../../library/xml.etree.elementtree.rst:1514 msgid "" ":class:`XMLPullParser` only guarantees that it has seen the \">\" character " "of a starting tag when it emits a \"start\" event, so the attributes are " @@ -1450,11 +1476,11 @@ msgid "" "be present." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1490 +#: ../../library/xml.etree.elementtree.rst:1529 msgid "Exceptions" msgstr "例外" -#: ../../library/xml.etree.elementtree.rst:1494 +#: ../../library/xml.etree.elementtree.rst:1533 msgid "" "XML parse error, raised by the various parsing methods in this module when " "parsing fails. The string representation of an instance of this exception " @@ -1462,22 +1488,22 @@ msgid "" "following attributes available:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1501 +#: ../../library/xml.etree.elementtree.rst:1540 msgid "" "A numeric error code from the expat parser. See the documentation of :mod:" "`xml.parsers.expat` for the list of error codes and their meanings." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1506 +#: ../../library/xml.etree.elementtree.rst:1545 msgid "" "A tuple of *line*, *column* numbers, specifying where the error occurred." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1509 +#: ../../library/xml.etree.elementtree.rst:1548 msgid "Footnotes" msgstr "註解" -#: ../../library/xml.etree.elementtree.rst:1510 +#: ../../library/xml.etree.elementtree.rst:1549 msgid "" "The encoding string included in XML output should conform to the appropriate " "standards. For example, \"UTF-8\" is valid, but \"UTF8\" is not. See " From 723e8f6114016d9477e134d86461acbc124346d8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 7 Mar 2024 17:27:57 +0000 Subject: [PATCH 31/33] sync with cpython 0ab2384c --- c-api/contextvars.po | 6 +- c-api/import.po | 6 +- c-api/init.po | 4 +- c-api/refcounting.po | 10 +- library/asyncio-eventloop.po | 14 +- library/bz2.po | 76 +-- library/faulthandler.po | 6 +- library/functools.po | 33 +- library/hashlib.po | 301 +++++---- library/importlib.metadata.po | 56 +- library/os.po | 1166 ++++++++++++++++----------------- library/pdb.po | 14 +- library/threading.po | 11 +- library/time.po | 360 +++++----- library/urllib.request.po | 518 +++++++-------- reference/lexical_analysis.po | 346 +++++----- reference/simple_stmts.po | 246 +++---- using/cmdline.po | 258 ++++---- 18 files changed, 1720 insertions(+), 1711 deletions(-) diff --git a/c-api/contextvars.po b/c-api/contextvars.po index 03fefa50b5..2fdf77de8e 100644 --- a/c-api/contextvars.po +++ b/c-api/contextvars.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2024-03-07 17:26+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -19,14 +19,14 @@ msgstr "" msgid "Context Variables Objects" msgstr "" -#: ../../c-api/contextvars.rst:13 +#: ../../c-api/contextvars.rst:15 msgid "" "In Python 3.7.1 the signatures of all context variables C APIs were " "**changed** to use :c:type:`PyObject` pointers instead of :c:type:" "`PyContext`, :c:type:`PyContextVar`, and :c:type:`PyContextToken`, e.g.::" msgstr "" -#: ../../c-api/contextvars.rst:24 +#: ../../c-api/contextvars.rst:26 msgid "See :issue:`34762` for more details." msgstr "更多細節請見 :issue:`34762`\\ 。" diff --git a/c-api/import.po b/c-api/import.po index 8d0842081b..9ed586449a 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-06 00:03+0000\n" +"POT-Creation-Date: 2024-03-07 17:26+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -320,6 +320,10 @@ msgstr "" msgid "The module name, as an ASCII encoded string." msgstr "" +#: ../../c-api/import.rst:297 +msgid "Initialization function for a module built into the interpreter." +msgstr "" + #: ../../c-api/import.rst:302 msgid "" "Add a collection of modules to the table of built-in modules. The *newtab* " diff --git a/c-api/init.po b/c-api/init.po index 06e27d8dd3..d8ab0e4714 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-12 00:03+0000\n" +"POT-Creation-Date: 2024-03-07 17:26+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-" @@ -2074,7 +2074,7 @@ msgid "" "`PyGILState API`." msgstr "" -#: ../../c-api/init.rst:1825 +#: ../../c-api/init.rst:1827 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 " diff --git a/c-api/refcounting.po b/c-api/refcounting.po index 855b69a842..042b8619a8 100644 --- a/c-api/refcounting.po +++ b/c-api/refcounting.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-14 22:55+0800\n" +"POT-Creation-Date: 2024-03-07 17:26+0000\n" "PO-Revision-Date: 2023-08-06 14:19+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -52,13 +52,13 @@ msgid "" msgstr "使用 :c:func:`Py_SET_REFCNT()` 函式設定物件參照計數。" #: ../../c-api/refcounting.rst:26 -msgid "The parameter type is no longer :c:expr:`const PyObject*`." -msgstr "參數型別不再是 :c:expr:`const PyObject*`。" - -#: ../../c-api/refcounting.rst:29 msgid ":c:func:`Py_REFCNT()` is changed to the inline static function." msgstr ":c:func:`Py_REFCNT()` 更改為行內靜態函式 (inline static function)。" +#: ../../c-api/refcounting.rst:29 +msgid "The parameter type is no longer :c:expr:`const PyObject*`." +msgstr "參數型別不再是 :c:expr:`const PyObject*`。" + #: ../../c-api/refcounting.rst:35 msgid "Set the object *o* reference counter to *refcnt*." msgstr "設定物件 *o* 的參照計數。" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 11c0b652aa..a4901ba503 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-06 00:03+0000\n" +"POT-Creation-Date: 2024-03-07 17:26+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-" @@ -837,20 +837,24 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:608 +msgid "Added support for Windows." +msgstr "新增對於 Windows 的支援。" + +#: ../../library/asyncio-eventloop.rst:611 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." msgstr "" -#: ../../library/asyncio-eventloop.rst:614 +#: ../../library/asyncio-eventloop.rst:617 msgid "" "When multiple processes with differing UIDs assign sockets to an identical " "UDP socket address with ``SO_REUSEADDR``, incoming packets can become " "randomly distributed among the sockets." msgstr "" -#: ../../library/asyncio-eventloop.rst:618 +#: ../../library/asyncio-eventloop.rst:621 msgid "" "For supported platforms, *reuse_port* can be used as a replacement for " "similar functionality. With *reuse_port*, :ref:`socket.SO_REUSEPORT \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -99,11 +99,11 @@ msgid "" "handling behavior, and line ending(s)." msgstr "" -#: ../../library/bz2.rst:59 ../../library/bz2.rst:163 +#: ../../library/bz2.rst:59 ../../library/bz2.rst:162 msgid "The ``'x'`` (exclusive creation) mode was added." msgstr "" -#: ../../library/bz2.rst:62 ../../library/bz2.rst:170 +#: ../../library/bz2.rst:62 ../../library/bz2.rst:169 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -222,77 +222,77 @@ msgid "" "stream files." msgstr "" -#: ../../library/bz2.rst:166 +#: ../../library/bz2.rst:165 msgid "" "The :meth:`~io.BufferedIOBase.read` method now accepts an argument of " "``None``." msgstr "" -#: ../../library/bz2.rst:173 +#: ../../library/bz2.rst:172 msgid "" "The *buffering* parameter has been removed. It was ignored and deprecated " "since Python 3.0. Pass an open file object to control how the file is opened." msgstr "" -#: ../../library/bz2.rst:178 +#: ../../library/bz2.rst:177 msgid "The *compresslevel* parameter became keyword-only." msgstr "" -#: ../../library/bz2.rst:180 +#: ../../library/bz2.rst:179 msgid "" "This class is thread unsafe in the face of multiple simultaneous readers or " "writers, just like its equivalent classes in :mod:`gzip` and :mod:`lzma` " "have always been." msgstr "" -#: ../../library/bz2.rst:187 +#: ../../library/bz2.rst:186 msgid "Incremental (de)compression" msgstr "" -#: ../../library/bz2.rst:191 +#: ../../library/bz2.rst:190 msgid "" "Create a new compressor object. This object may be used to compress data " "incrementally. For one-shot compression, use the :func:`compress` function " "instead." msgstr "" -#: ../../library/bz2.rst:195 ../../library/bz2.rst:283 +#: ../../library/bz2.rst:194 ../../library/bz2.rst:282 msgid "" "*compresslevel*, if given, must be an integer between ``1`` and ``9``. The " "default is ``9``." msgstr "" -#: ../../library/bz2.rst:200 +#: ../../library/bz2.rst:199 msgid "" "Provide data to the compressor object. Returns a chunk of compressed data if " "possible, or an empty byte string otherwise." msgstr "" -#: ../../library/bz2.rst:203 +#: ../../library/bz2.rst:202 msgid "" "When you have finished providing data to the compressor, call the :meth:" "`flush` method to finish the compression process." msgstr "" -#: ../../library/bz2.rst:209 +#: ../../library/bz2.rst:208 msgid "" "Finish the compression process. Returns the compressed data left in internal " "buffers." msgstr "" -#: ../../library/bz2.rst:212 +#: ../../library/bz2.rst:211 msgid "" "The compressor object may not be used after this method has been called." msgstr "" -#: ../../library/bz2.rst:217 +#: ../../library/bz2.rst:216 msgid "" "Create a new decompressor object. This object may be used to decompress data " "incrementally. For one-shot compression, use the :func:`decompress` function " "instead." msgstr "" -#: ../../library/bz2.rst:222 +#: ../../library/bz2.rst:221 msgid "" "This class does not transparently handle inputs containing multiple " "compressed streams, unlike :func:`decompress` and :class:`BZ2File`. If you " @@ -300,7 +300,7 @@ msgid "" "must use a new decompressor for each stream." msgstr "" -#: ../../library/bz2.rst:229 +#: ../../library/bz2.rst:228 msgid "" "Decompress *data* (a :term:`bytes-like object`), returning uncompressed data " "as bytes. Some of *data* may be buffered internally, for use in later calls " @@ -308,7 +308,7 @@ msgid "" "output of any previous calls to :meth:`decompress`." msgstr "" -#: ../../library/bz2.rst:235 +#: ../../library/bz2.rst:234 msgid "" "If *max_length* is nonnegative, returns at most *max_length* bytes of " "decompressed data. If this limit is reached and further output can be " @@ -317,99 +317,99 @@ msgid "" "``b''`` to obtain more of the output." msgstr "" -#: ../../library/bz2.rst:242 +#: ../../library/bz2.rst:241 msgid "" "If all of the input data was decompressed and returned (either because this " "was less than *max_length* bytes, or because *max_length* was negative), " "the :attr:`~.needs_input` attribute will be set to ``True``." msgstr "" -#: ../../library/bz2.rst:247 +#: ../../library/bz2.rst:246 msgid "" "Attempting to decompress data after the end of stream is reached raises an :" "exc:`EOFError`. Any data found after the end of the stream is ignored and " "saved in the :attr:`~.unused_data` attribute." msgstr "" -#: ../../library/bz2.rst:251 +#: ../../library/bz2.rst:250 msgid "Added the *max_length* parameter." msgstr "新增 *max_length* 參數。" -#: ../../library/bz2.rst:256 +#: ../../library/bz2.rst:255 msgid "``True`` if the end-of-stream marker has been reached." msgstr "" -#: ../../library/bz2.rst:263 +#: ../../library/bz2.rst:262 msgid "Data found after the end of the compressed stream." msgstr "" -#: ../../library/bz2.rst:265 +#: ../../library/bz2.rst:264 msgid "" "If this attribute is accessed before the end of the stream has been reached, " "its value will be ``b''``." msgstr "" -#: ../../library/bz2.rst:270 +#: ../../library/bz2.rst:269 msgid "" "``False`` if the :meth:`.decompress` method can provide more decompressed " "data before requiring new uncompressed input." msgstr "" -#: ../../library/bz2.rst:277 +#: ../../library/bz2.rst:276 msgid "One-shot (de)compression" msgstr "" -#: ../../library/bz2.rst:281 +#: ../../library/bz2.rst:280 msgid "Compress *data*, a :term:`bytes-like object `." msgstr "" -#: ../../library/bz2.rst:286 +#: ../../library/bz2.rst:285 msgid "For incremental compression, use a :class:`BZ2Compressor` instead." msgstr "" -#: ../../library/bz2.rst:291 +#: ../../library/bz2.rst:290 msgid "Decompress *data*, a :term:`bytes-like object `." msgstr "" -#: ../../library/bz2.rst:293 +#: ../../library/bz2.rst:292 msgid "" "If *data* is the concatenation of multiple compressed streams, decompress " "all of the streams." msgstr "" -#: ../../library/bz2.rst:296 +#: ../../library/bz2.rst:295 msgid "For incremental decompression, use a :class:`BZ2Decompressor` instead." msgstr "" -#: ../../library/bz2.rst:298 +#: ../../library/bz2.rst:297 msgid "Support for multi-stream inputs was added." msgstr "" -#: ../../library/bz2.rst:304 +#: ../../library/bz2.rst:303 msgid "Examples of usage" msgstr "用法範例" -#: ../../library/bz2.rst:306 +#: ../../library/bz2.rst:305 msgid "Below are some examples of typical usage of the :mod:`bz2` module." msgstr "" -#: ../../library/bz2.rst:308 +#: ../../library/bz2.rst:307 msgid "" "Using :func:`compress` and :func:`decompress` to demonstrate round-trip " "compression:" msgstr "" -#: ../../library/bz2.rst:326 +#: ../../library/bz2.rst:325 msgid "Using :class:`BZ2Compressor` for incremental compression:" msgstr "" -#: ../../library/bz2.rst:344 +#: ../../library/bz2.rst:343 msgid "" "The example above uses a very \"nonrandom\" stream of data (a stream of " "``b\"z\"`` chunks). Random data tends to compress poorly, while ordered, " "repetitive data usually yields a high compression ratio." msgstr "" -#: ../../library/bz2.rst:348 +#: ../../library/bz2.rst:347 msgid "Writing and reading a bzip2-compressed file in binary mode:" msgstr "" diff --git a/library/faulthandler.po b/library/faulthandler.po index 4d1eeeb54b..d9e44f6b49 100644 --- a/library/faulthandler.po +++ b/library/faulthandler.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-05 00:18+0000\n" +"POT-Creation-Date: 2024-03-07 17:26+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-" @@ -126,7 +126,7 @@ msgid "" msgstr "" #: ../../library/faulthandler.rst:64 ../../library/faulthandler.rst:82 -#: ../../library/faulthandler.rst:124 ../../library/faulthandler.rst:146 +#: ../../library/faulthandler.rst:121 ../../library/faulthandler.rst:146 msgid "Added support for passing file descriptor to this function." msgstr "" @@ -194,7 +194,7 @@ msgstr "" msgid "This function is implemented using a watchdog thread." msgstr "" -#: ../../library/faulthandler.rst:121 +#: ../../library/faulthandler.rst:124 msgid "This function is now always available." msgstr "" diff --git a/library/functools.po b/library/functools.po index 9326da869c..338d33e6bf 100644 --- a/library/functools.po +++ b/library/functools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-24 00:03+0000\n" +"POT-Creation-Date: 2024-03-07 17:26+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-" @@ -583,25 +583,20 @@ msgid "" msgstr "" #: ../../library/functools.rst:668 -msgid "Automatic addition of the ``__wrapped__`` attribute." -msgstr "" - -#: ../../library/functools.rst:671 -msgid "Copying of the ``__annotations__`` attribute by default." -msgstr "" - -#: ../../library/functools.rst:674 -msgid "Missing attributes no longer trigger an :exc:`AttributeError`." +msgid "" +"The ``__wrapped__`` attribute is now automatically added. The " +"``__annotations__`` attribute is now copied by default. Missing attributes " +"no longer trigger an :exc:`AttributeError`." msgstr "" -#: ../../library/functools.rst:677 +#: ../../library/functools.rst:673 msgid "" "The ``__wrapped__`` attribute now always refers to the wrapped function, " "even if that function defined a ``__wrapped__`` attribute. (see :issue:" "`17482`)" msgstr "" -#: ../../library/functools.rst:685 +#: ../../library/functools.rst:681 msgid "" "This is a convenience function for invoking :func:`update_wrapper` as a " "function decorator when defining a wrapper function. It is equivalent to " @@ -609,42 +604,42 @@ msgid "" "updated=updated)``. For example::" msgstr "" -#: ../../library/functools.rst:711 +#: ../../library/functools.rst:707 msgid "" "Without the use of this decorator factory, the name of the example function " "would have been ``'wrapper'``, and the docstring of the original :func:" "`example` would have been lost." msgstr "" -#: ../../library/functools.rst:719 +#: ../../library/functools.rst:715 msgid ":class:`partial` Objects" msgstr ":class:`partial` 物件" -#: ../../library/functools.rst:721 +#: ../../library/functools.rst:717 msgid "" ":class:`partial` objects are callable objects created by :func:`partial`. " "They have three read-only attributes:" msgstr "" -#: ../../library/functools.rst:727 +#: ../../library/functools.rst:723 msgid "" "A callable object or function. Calls to the :class:`partial` object will be " "forwarded to :attr:`func` with new arguments and keywords." msgstr "" -#: ../../library/functools.rst:733 +#: ../../library/functools.rst:729 msgid "" "The leftmost positional arguments that will be prepended to the positional " "arguments provided to a :class:`partial` object call." msgstr "" -#: ../../library/functools.rst:739 +#: ../../library/functools.rst:735 msgid "" "The keyword arguments that will be supplied when the :class:`partial` object " "is called." msgstr "" -#: ../../library/functools.rst:742 +#: ../../library/functools.rst:738 msgid "" ":class:`partial` objects are like :class:`function` objects in that they are " "callable, weak referenceable, and can have attributes. There are some " diff --git a/library/hashlib.po b/library/hashlib.po index 1e8e308682..50a5746b96 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2024-03-07 17:26+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -96,14 +96,10 @@ msgstr "" msgid "" "SHA3 (Keccak) and SHAKE constructors :func:`sha3_224`, :func:`sha3_256`, :" "func:`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:`shake_256` were " -"added." +"added. :func:`blake2b` and :func:`blake2s` were added." msgstr "" -#: ../../library/hashlib.rst:81 -msgid ":func:`blake2b` and :func:`blake2s` were added." -msgstr "加入 :func:`blake2b` 和 :func:`blake2s`\\ 。" - -#: ../../library/hashlib.rst:86 +#: ../../library/hashlib.rst:84 msgid "" "All hashlib constructors take a keyword-only argument *usedforsecurity* with " "default value ``True``. A false value allows the use of insecure and blocked " @@ -112,36 +108,36 @@ msgid "" "cryptographic one-way compression function." msgstr "" -#: ../../library/hashlib.rst:93 +#: ../../library/hashlib.rst:91 msgid "Hashlib now uses SHA3 and SHAKE from OpenSSL if it provides it." msgstr "" -#: ../../library/hashlib.rst:96 +#: ../../library/hashlib.rst:94 msgid "" "For any of the MD5, SHA1, SHA2, or SHA3 algorithms that the linked OpenSSL " "does not provide we fall back to a verified implementation from the `HACL\\* " "project`_." msgstr "" -#: ../../library/hashlib.rst:102 +#: ../../library/hashlib.rst:100 msgid "Usage" msgstr "用法" -#: ../../library/hashlib.rst:104 +#: ../../library/hashlib.rst:102 msgid "" "To obtain the digest of the byte string ``b\"Nobody inspects the spammish " "repetition\"``::" msgstr "" -#: ../../library/hashlib.rst:116 +#: ../../library/hashlib.rst:114 msgid "More condensed:" msgstr "" -#: ../../library/hashlib.rst:122 +#: ../../library/hashlib.rst:120 msgid "Constructors" msgstr "建構函式" -#: ../../library/hashlib.rst:126 +#: ../../library/hashlib.rst:124 msgid "" "Is a generic constructor that takes the string *name* of the desired " "algorithm as its first parameter. It also exists to allow access to the " @@ -149,25 +145,25 @@ msgid "" "library may offer." msgstr "" -#: ../../library/hashlib.rst:131 +#: ../../library/hashlib.rst:129 msgid "Using :func:`new` with an algorithm name:" msgstr "" -#: ../../library/hashlib.rst:150 +#: ../../library/hashlib.rst:148 msgid "" "Named constructors such as these are faster than passing an algorithm name " "to :func:`new`." msgstr "" -#: ../../library/hashlib.rst:154 +#: ../../library/hashlib.rst:152 msgid "Attributes" msgstr "" -#: ../../library/hashlib.rst:156 +#: ../../library/hashlib.rst:154 msgid "Hashlib provides the following constant module attributes:" msgstr "" -#: ../../library/hashlib.rst:160 +#: ../../library/hashlib.rst:158 msgid "" "A set containing the names of the hash algorithms guaranteed to be supported " "by this module on all platforms. Note that 'md5' is in this list despite " @@ -175,7 +171,7 @@ msgid "" "excludes it." msgstr "" -#: ../../library/hashlib.rst:169 +#: ../../library/hashlib.rst:167 msgid "" "A set containing the names of the hash algorithms that are available in the " "running Python interpreter. These names will be recognized when passed to :" @@ -184,77 +180,77 @@ msgid "" "(thanks to OpenSSL)." msgstr "" -#: ../../library/hashlib.rst:178 +#: ../../library/hashlib.rst:176 msgid "Hash Objects" msgstr "" -#: ../../library/hashlib.rst:180 +#: ../../library/hashlib.rst:178 msgid "" "The following values are provided as constant attributes of the hash objects " "returned by the constructors:" msgstr "" -#: ../../library/hashlib.rst:185 +#: ../../library/hashlib.rst:183 msgid "The size of the resulting hash in bytes." msgstr "" -#: ../../library/hashlib.rst:189 +#: ../../library/hashlib.rst:187 msgid "The internal block size of the hash algorithm in bytes." msgstr "" -#: ../../library/hashlib.rst:191 +#: ../../library/hashlib.rst:189 msgid "A hash object has the following attributes:" msgstr "" -#: ../../library/hashlib.rst:195 +#: ../../library/hashlib.rst:193 msgid "" "The canonical name of this hash, always lowercase and always suitable as a " "parameter to :func:`new` to create another hash of this type." msgstr "" -#: ../../library/hashlib.rst:198 +#: ../../library/hashlib.rst:196 msgid "" "The name attribute has been present in CPython since its inception, but " "until Python 3.4 was not formally specified, so may not exist on some " "platforms." msgstr "" -#: ../../library/hashlib.rst:203 +#: ../../library/hashlib.rst:201 msgid "A hash object has the following methods:" msgstr "" -#: ../../library/hashlib.rst:208 +#: ../../library/hashlib.rst:206 msgid "" "Update the hash object with the :term:`bytes-like object`. Repeated calls " "are equivalent to a single call with the concatenation of all the arguments: " "``m.update(a); m.update(b)`` is equivalent to ``m.update(a+b)``." msgstr "" -#: ../../library/hashlib.rst:216 +#: ../../library/hashlib.rst:214 msgid "" "Return the digest of the data passed to the :meth:`update` method so far. " "This is a bytes object of size :attr:`digest_size` which may contain bytes " "in the whole range from 0 to 255." msgstr "" -#: ../../library/hashlib.rst:223 +#: ../../library/hashlib.rst:221 msgid "" "Like :meth:`digest` except the digest is returned as a string object of " "double length, containing only hexadecimal digits. This may be used to " "exchange the value safely in email or other non-binary environments." msgstr "" -#: ../../library/hashlib.rst:230 +#: ../../library/hashlib.rst:228 msgid "" "Return a copy (\"clone\") of the hash object. This can be used to " "efficiently compute the digests of data sharing a common initial substring." msgstr "" -#: ../../library/hashlib.rst:235 +#: ../../library/hashlib.rst:233 msgid "SHAKE variable length digests" msgstr "" -#: ../../library/hashlib.rst:240 +#: ../../library/hashlib.rst:238 msgid "" "The :func:`shake_128` and :func:`shake_256` algorithms provide variable " "length digests with length_in_bits//2 up to 128 or 256 bits of security. As " @@ -262,40 +258,40 @@ msgid "" "by the SHAKE algorithm." msgstr "" -#: ../../library/hashlib.rst:247 +#: ../../library/hashlib.rst:245 msgid "" "Return the digest of the data passed to the :meth:`~hash.update` method so " "far. This is a bytes object of size *length* which may contain bytes in the " "whole range from 0 to 255." msgstr "" -#: ../../library/hashlib.rst:254 +#: ../../library/hashlib.rst:252 msgid "" "Like :meth:`digest` except the digest is returned as a string object of " "double length, containing only hexadecimal digits. This may be used to " "exchange the value in email or other non-binary environments." msgstr "" -#: ../../library/hashlib.rst:258 +#: ../../library/hashlib.rst:256 msgid "Example use:" msgstr "範例:" -#: ../../library/hashlib.rst:265 +#: ../../library/hashlib.rst:263 msgid "File hashing" msgstr "" -#: ../../library/hashlib.rst:267 +#: ../../library/hashlib.rst:265 msgid "" "The hashlib module provides a helper function for efficient hashing of a " "file or file-like object." msgstr "" -#: ../../library/hashlib.rst:272 +#: ../../library/hashlib.rst:270 msgid "" "Return a digest object that has been updated with contents of file object." msgstr "" -#: ../../library/hashlib.rst:274 +#: ../../library/hashlib.rst:272 msgid "" "*fileobj* must be a file-like object opened for reading in binary mode. It " "accepts file objects from builtin :func:`open`, :class:`~io.BytesIO` " @@ -306,21 +302,21 @@ msgid "" "caller to close *fileobj*." msgstr "" -#: ../../library/hashlib.rst:282 +#: ../../library/hashlib.rst:280 msgid "" "*digest* must either be a hash algorithm name as a *str*, a hash " "constructor, or a callable that returns a hash object." msgstr "" -#: ../../library/hashlib.rst:285 +#: ../../library/hashlib.rst:283 msgid "Example:" msgstr "範例:" -#: ../../library/hashlib.rst:308 +#: ../../library/hashlib.rst:306 msgid "Key derivation" msgstr "" -#: ../../library/hashlib.rst:310 +#: ../../library/hashlib.rst:308 msgid "" "Key derivation and key stretching algorithms are designed for secure " "password hashing. Naive algorithms such as ``sha1(password)`` are not " @@ -329,13 +325,13 @@ msgid "" "Salt_%28cryptography%29>`_." msgstr "" -#: ../../library/hashlib.rst:318 +#: ../../library/hashlib.rst:316 msgid "" "The function provides PKCS#5 password-based key derivation function 2. It " "uses HMAC as pseudorandom function." msgstr "" -#: ../../library/hashlib.rst:321 +#: ../../library/hashlib.rst:319 msgid "" "The string *hash_name* is the desired name of the hash digest algorithm for " "HMAC, e.g. 'sha1' or 'sha256'. *password* and *salt* are interpreted as " @@ -344,7 +340,7 @@ msgid "" "proper source, e.g. :func:`os.urandom`." msgstr "" -#: ../../library/hashlib.rst:327 +#: ../../library/hashlib.rst:325 msgid "" "The number of *iterations* should be chosen based on the hash algorithm and " "computing power. As of 2022, hundreds of thousands of iterations of SHA-256 " @@ -353,29 +349,29 @@ msgid "" "the `stackexchange pbkdf2 iterations question`_ explain in detail." msgstr "" -#: ../../library/hashlib.rst:333 +#: ../../library/hashlib.rst:331 msgid "" "*dklen* is the length of the derived key. If *dklen* is ``None`` then the " "digest size of the hash algorithm *hash_name* is used, e.g. 64 for SHA-512." msgstr "" -#: ../../library/hashlib.rst:342 +#: ../../library/hashlib.rst:340 msgid "Function only available when Python is compiled with OpenSSL." msgstr "" -#: ../../library/hashlib.rst:346 +#: ../../library/hashlib.rst:344 msgid "" "Function now only available when Python is built with OpenSSL. The slow pure " "Python implementation has been removed." msgstr "" -#: ../../library/hashlib.rst:352 +#: ../../library/hashlib.rst:350 msgid "" "The function provides scrypt password-based key derivation function as " "defined in :rfc:`7914`." msgstr "" -#: ../../library/hashlib.rst:355 +#: ../../library/hashlib.rst:353 msgid "" "*password* and *salt* must be :term:`bytes-like objects `. Applications and libraries should limit *password* to a sensible " @@ -383,138 +379,138 @@ msgid "" "source, e.g. :func:`os.urandom`." msgstr "" -#: ../../library/hashlib.rst:360 +#: ../../library/hashlib.rst:358 msgid "" "*n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization " "factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). " "*dklen* is the length of the derived key." msgstr "" -#: ../../library/hashlib.rst:368 +#: ../../library/hashlib.rst:366 msgid "BLAKE2" msgstr "BLAKE2" -#: ../../library/hashlib.rst:375 +#: ../../library/hashlib.rst:373 msgid "" "BLAKE2_ is a cryptographic hash function defined in :rfc:`7693` that comes " "in two flavors:" msgstr "" -#: ../../library/hashlib.rst:378 +#: ../../library/hashlib.rst:376 msgid "" "**BLAKE2b**, optimized for 64-bit platforms and produces digests of any size " "between 1 and 64 bytes," msgstr "" -#: ../../library/hashlib.rst:381 +#: ../../library/hashlib.rst:379 msgid "" "**BLAKE2s**, optimized for 8- to 32-bit platforms and produces digests of " "any size between 1 and 32 bytes." msgstr "" -#: ../../library/hashlib.rst:384 +#: ../../library/hashlib.rst:382 msgid "" "BLAKE2 supports **keyed mode** (a faster and simpler replacement for HMAC_), " "**salted hashing**, **personalization**, and **tree hashing**." msgstr "" -#: ../../library/hashlib.rst:387 +#: ../../library/hashlib.rst:385 msgid "" "Hash objects from this module follow the API of standard library's :mod:" "`hashlib` objects." msgstr "" -#: ../../library/hashlib.rst:392 +#: ../../library/hashlib.rst:390 msgid "Creating hash objects" msgstr "" -#: ../../library/hashlib.rst:394 +#: ../../library/hashlib.rst:392 msgid "New hash objects are created by calling constructor functions:" msgstr "" -#: ../../library/hashlib.rst:408 +#: ../../library/hashlib.rst:406 msgid "" "These functions return the corresponding hash objects for calculating " "BLAKE2b or BLAKE2s. They optionally take these general parameters:" msgstr "" -#: ../../library/hashlib.rst:411 +#: ../../library/hashlib.rst:409 msgid "" "*data*: initial chunk of data to hash, which must be :term:`bytes-like " "object`. It can be passed only as positional argument." msgstr "" -#: ../../library/hashlib.rst:414 +#: ../../library/hashlib.rst:412 msgid "*digest_size*: size of output digest in bytes." msgstr "" -#: ../../library/hashlib.rst:416 +#: ../../library/hashlib.rst:414 msgid "" "*key*: key for keyed hashing (up to 64 bytes for BLAKE2b, up to 32 bytes for " "BLAKE2s)." msgstr "" -#: ../../library/hashlib.rst:419 +#: ../../library/hashlib.rst:417 msgid "" "*salt*: salt for randomized hashing (up to 16 bytes for BLAKE2b, up to 8 " "bytes for BLAKE2s)." msgstr "" -#: ../../library/hashlib.rst:422 +#: ../../library/hashlib.rst:420 msgid "" "*person*: personalization string (up to 16 bytes for BLAKE2b, up to 8 bytes " "for BLAKE2s)." msgstr "" -#: ../../library/hashlib.rst:425 +#: ../../library/hashlib.rst:423 msgid "The following table shows limits for general parameters (in bytes):" msgstr "" -#: ../../library/hashlib.rst:428 +#: ../../library/hashlib.rst:426 msgid "Hash" msgstr "" -#: ../../library/hashlib.rst:428 +#: ../../library/hashlib.rst:426 msgid "digest_size" msgstr "digest_size" -#: ../../library/hashlib.rst:428 +#: ../../library/hashlib.rst:426 msgid "len(key)" msgstr "len(key)" -#: ../../library/hashlib.rst:428 +#: ../../library/hashlib.rst:426 msgid "len(salt)" msgstr "len(salt)" -#: ../../library/hashlib.rst:428 +#: ../../library/hashlib.rst:426 msgid "len(person)" msgstr "len(person)" -#: ../../library/hashlib.rst:430 +#: ../../library/hashlib.rst:428 msgid "BLAKE2b" msgstr "BLAKE2b" -#: ../../library/hashlib.rst:430 +#: ../../library/hashlib.rst:428 msgid "64" msgstr "64" -#: ../../library/hashlib.rst:430 +#: ../../library/hashlib.rst:428 msgid "16" msgstr "16" -#: ../../library/hashlib.rst:431 +#: ../../library/hashlib.rst:429 msgid "BLAKE2s" msgstr "BLAKE2s" -#: ../../library/hashlib.rst:431 +#: ../../library/hashlib.rst:429 msgid "32" msgstr "32" -#: ../../library/hashlib.rst:431 +#: ../../library/hashlib.rst:429 msgid "8" msgstr "8" -#: ../../library/hashlib.rst:436 +#: ../../library/hashlib.rst:434 msgid "" "BLAKE2 specification defines constant lengths for salt and personalization " "parameters, however, for convenience, this implementation accepts byte " @@ -524,49 +520,49 @@ msgid "" "the case for *key*.)" msgstr "" -#: ../../library/hashlib.rst:443 +#: ../../library/hashlib.rst:441 msgid "These sizes are available as module `constants`_ described below." msgstr "" -#: ../../library/hashlib.rst:445 +#: ../../library/hashlib.rst:443 msgid "" "Constructor functions also accept the following tree hashing parameters:" msgstr "" -#: ../../library/hashlib.rst:447 +#: ../../library/hashlib.rst:445 msgid "*fanout*: fanout (0 to 255, 0 if unlimited, 1 in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:449 +#: ../../library/hashlib.rst:447 msgid "" "*depth*: maximal depth of tree (1 to 255, 255 if unlimited, 1 in sequential " "mode)." msgstr "" -#: ../../library/hashlib.rst:452 +#: ../../library/hashlib.rst:450 msgid "" "*leaf_size*: maximal byte length of leaf (0 to ``2**32-1``, 0 if unlimited " "or in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:455 +#: ../../library/hashlib.rst:453 msgid "" "*node_offset*: node offset (0 to ``2**64-1`` for BLAKE2b, 0 to ``2**48-1`` " "for BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:458 +#: ../../library/hashlib.rst:456 msgid "" "*node_depth*: node depth (0 to 255, 0 for leaves, or in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:460 +#: ../../library/hashlib.rst:458 msgid "" "*inner_size*: inner digest size (0 to 64 for BLAKE2b, 0 to 32 for BLAKE2s, 0 " "in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:463 +#: ../../library/hashlib.rst:461 msgid "" "*last_node*: boolean indicating whether the processed node is the last one " "(``False`` for sequential mode)." @@ -576,42 +572,42 @@ msgstr "" msgid "Explanation of tree mode parameters." msgstr "" -#: ../../library/hashlib.rst:470 +#: ../../library/hashlib.rst:468 msgid "" "See section 2.10 in `BLAKE2 specification `_ for comprehensive review of tree hashing." msgstr "" -#: ../../library/hashlib.rst:476 +#: ../../library/hashlib.rst:474 msgid "Constants" msgstr "常數" -#: ../../library/hashlib.rst:481 +#: ../../library/hashlib.rst:479 msgid "Salt length (maximum length accepted by constructors)." msgstr "" -#: ../../library/hashlib.rst:487 +#: ../../library/hashlib.rst:485 msgid "" "Personalization string length (maximum length accepted by constructors)." msgstr "" -#: ../../library/hashlib.rst:493 +#: ../../library/hashlib.rst:491 msgid "Maximum key size." msgstr "" -#: ../../library/hashlib.rst:499 +#: ../../library/hashlib.rst:497 msgid "Maximum digest size that the hash function can output." msgstr "" -#: ../../library/hashlib.rst:503 +#: ../../library/hashlib.rst:501 msgid "Examples" msgstr "範例" -#: ../../library/hashlib.rst:506 +#: ../../library/hashlib.rst:504 msgid "Simple hashing" msgstr "" -#: ../../library/hashlib.rst:508 +#: ../../library/hashlib.rst:506 msgid "" "To calculate hash of some data, you should first construct a hash object by " "calling the appropriate constructor function (:func:`blake2b` or :func:" @@ -620,41 +616,41 @@ msgid "" "`~hash.digest` (or :meth:`~hash.hexdigest` for hex-encoded string)." msgstr "" -#: ../../library/hashlib.rst:521 +#: ../../library/hashlib.rst:519 msgid "" "As a shortcut, you can pass the first chunk of data to update directly to " "the constructor as the positional argument:" msgstr "" -#: ../../library/hashlib.rst:528 +#: ../../library/hashlib.rst:526 msgid "" "You can call :meth:`hash.update` as many times as you need to iteratively " "update the hash:" msgstr "" -#: ../../library/hashlib.rst:542 +#: ../../library/hashlib.rst:540 msgid "Using different digest sizes" msgstr "" -#: ../../library/hashlib.rst:544 +#: ../../library/hashlib.rst:542 msgid "" "BLAKE2 has configurable size of digests up to 64 bytes for BLAKE2b and up to " "32 bytes for BLAKE2s. For example, to replace SHA-1 with BLAKE2b without " "changing the size of output, we can tell BLAKE2b to produce 20-byte digests:" msgstr "" -#: ../../library/hashlib.rst:558 +#: ../../library/hashlib.rst:556 msgid "" "Hash objects with different digest sizes have completely different outputs " "(shorter hashes are *not* prefixes of longer hashes); BLAKE2b and BLAKE2s " "produce different outputs even if the output length is the same:" msgstr "" -#: ../../library/hashlib.rst:574 +#: ../../library/hashlib.rst:572 msgid "Keyed hashing" msgstr "" -#: ../../library/hashlib.rst:576 +#: ../../library/hashlib.rst:574 msgid "" "Keyed hashing can be used for authentication as a faster and simpler " "replacement for `Hash-based message authentication code `_)" msgstr "" -#: ../../library/hashlib.rst:660 +#: ../../library/hashlib.rst:658 msgid "" "In BLAKE2 the salt is processed as a one-time input to the hash function " "during initialization, rather than as an input to each compression function." msgstr "" -#: ../../library/hashlib.rst:665 +#: ../../library/hashlib.rst:663 msgid "" "*Salted hashing* (or just hashing) with BLAKE2 or any other general-purpose " "cryptographic hash function, such as SHA-256, is not suitable for hashing " @@ -732,18 +728,18 @@ msgid "" "information." msgstr "" -#: ../../library/hashlib.rst:688 +#: ../../library/hashlib.rst:686 msgid "Personalization" msgstr "" -#: ../../library/hashlib.rst:690 +#: ../../library/hashlib.rst:688 msgid "" "Sometimes it is useful to force hash function to produce different digests " "for the same input for different purposes. Quoting the authors of the Skein " "hash function:" msgstr "" -#: ../../library/hashlib.rst:694 +#: ../../library/hashlib.rst:692 msgid "" "We recommend that all application designers seriously consider doing this; " "we have seen many protocols where a hash that is computed in one part of the " @@ -753,41 +749,41 @@ msgid "" "hash function used in the protocol summarily stops this type of attack." msgstr "" -#: ../../library/hashlib.rst:701 +#: ../../library/hashlib.rst:699 msgid "" "(`The Skein Hash Function Family `_, p. 21)" msgstr "" -#: ../../library/hashlib.rst:705 +#: ../../library/hashlib.rst:703 msgid "BLAKE2 can be personalized by passing bytes to the *person* argument::" msgstr "" -#: ../../library/hashlib.rst:719 +#: ../../library/hashlib.rst:717 msgid "" "Personalization together with the keyed mode can also be used to derive " "different keys from a single one." msgstr "" -#: ../../library/hashlib.rst:733 +#: ../../library/hashlib.rst:731 msgid "Tree mode" msgstr "" -#: ../../library/hashlib.rst:735 +#: ../../library/hashlib.rst:733 msgid "Here's an example of hashing a minimal tree with two leaf nodes::" msgstr "" -#: ../../library/hashlib.rst:741 +#: ../../library/hashlib.rst:739 msgid "" "This example uses 64-byte internal digests, and returns the 32-byte final " "digest::" msgstr "" -#: ../../library/hashlib.rst:771 +#: ../../library/hashlib.rst:769 msgid "Credits" msgstr "" -#: ../../library/hashlib.rst:773 +#: ../../library/hashlib.rst:771 msgid "" "BLAKE2_ was designed by *Jean-Philippe Aumasson*, *Samuel Neves*, *Zooko " "Wilcox-O'Hearn*, and *Christian Winnerlein* based on SHA-3_ finalist BLAKE_ " @@ -795,119 +791,119 @@ msgid "" "*Raphael C.-W. Phan*." msgstr "" -#: ../../library/hashlib.rst:778 +#: ../../library/hashlib.rst:776 msgid "" "It uses core algorithm from ChaCha_ cipher designed by *Daniel J. " "Bernstein*." msgstr "" -#: ../../library/hashlib.rst:780 +#: ../../library/hashlib.rst:778 msgid "" "The stdlib implementation is based on pyblake2_ module. It was written by " "*Dmitry Chestnykh* based on C implementation written by *Samuel Neves*. The " "documentation was copied from pyblake2_ and written by *Dmitry Chestnykh*." msgstr "" -#: ../../library/hashlib.rst:784 +#: ../../library/hashlib.rst:782 msgid "The C code was partly rewritten for Python by *Christian Heimes*." msgstr "" -#: ../../library/hashlib.rst:786 +#: ../../library/hashlib.rst:784 msgid "" "The following public domain dedication applies for both C hash function " "implementation, extension code, and this documentation:" msgstr "" -#: ../../library/hashlib.rst:789 +#: ../../library/hashlib.rst:787 msgid "" "To the extent possible under law, the author(s) have dedicated all copyright " "and related and neighboring rights to this software to the public domain " "worldwide. This software is distributed without any warranty." msgstr "" -#: ../../library/hashlib.rst:793 +#: ../../library/hashlib.rst:791 msgid "" "You should have received a copy of the CC0 Public Domain Dedication along " "with this software. If not, see https://creativecommons.org/publicdomain/" "zero/1.0/." msgstr "" -#: ../../library/hashlib.rst:797 +#: ../../library/hashlib.rst:795 msgid "" "The following people have helped with development or contributed their " "changes to the project and the public domain according to the Creative " "Commons Public Domain Dedication 1.0 Universal:" msgstr "" -#: ../../library/hashlib.rst:801 +#: ../../library/hashlib.rst:799 msgid "*Alexandr Sokolovskiy*" msgstr "*Alexandr Sokolovskiy*" -#: ../../library/hashlib.rst:822 +#: ../../library/hashlib.rst:820 msgid "Module :mod:`hmac`" msgstr ":mod:`hmac` 模組" -#: ../../library/hashlib.rst:822 +#: ../../library/hashlib.rst:820 msgid "A module to generate message authentication codes using hashes." msgstr "" -#: ../../library/hashlib.rst:825 +#: ../../library/hashlib.rst:823 msgid "Module :mod:`base64`" msgstr ":mod:`base64` 模組" -#: ../../library/hashlib.rst:825 +#: ../../library/hashlib.rst:823 msgid "Another way to encode binary hashes for non-binary environments." msgstr "" -#: ../../library/hashlib.rst:828 +#: ../../library/hashlib.rst:826 msgid "https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.180-4.pdf" msgstr "" -#: ../../library/hashlib.rst:828 +#: ../../library/hashlib.rst:826 msgid "The FIPS 180-4 publication on Secure Hash Algorithms." msgstr "" -#: ../../library/hashlib.rst:831 +#: ../../library/hashlib.rst:829 msgid "https://csrc.nist.gov/publications/detail/fips/202/final" msgstr "" -#: ../../library/hashlib.rst:831 +#: ../../library/hashlib.rst:829 msgid "The FIPS 202 publication on the SHA-3 Standard." msgstr "" -#: ../../library/hashlib.rst:834 +#: ../../library/hashlib.rst:832 msgid "https://www.blake2.net/" msgstr "https://www.blake2.net/" -#: ../../library/hashlib.rst:834 +#: ../../library/hashlib.rst:832 msgid "Official BLAKE2 website." msgstr "BLAKE2 官方網站。" -#: ../../library/hashlib.rst:838 +#: ../../library/hashlib.rst:836 msgid "https://en.wikipedia.org/wiki/Cryptographic_hash_function" msgstr "https://en.wikipedia.org/wiki/Cryptographic_hash_function" -#: ../../library/hashlib.rst:837 +#: ../../library/hashlib.rst:835 msgid "" "Wikipedia article with information on which algorithms have known issues and " "what that means regarding their use." msgstr "" -#: ../../library/hashlib.rst:841 +#: ../../library/hashlib.rst:839 msgid "https://www.ietf.org/rfc/rfc8018.txt" msgstr "https://www.ietf.org/rfc/rfc8018.txt" -#: ../../library/hashlib.rst:841 +#: ../../library/hashlib.rst:839 msgid "PKCS #5: Password-Based Cryptography Specification Version 2.1" msgstr "" -#: ../../library/hashlib.rst:843 +#: ../../library/hashlib.rst:841 msgid "" "https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf" msgstr "" "https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf" -#: ../../library/hashlib.rst:844 +#: ../../library/hashlib.rst:842 msgid "NIST Recommendation for Password-Based Key Derivation." msgstr "" @@ -929,6 +925,9 @@ msgstr "OpenSSL" msgid "(use in module hashlib)" msgstr "(使用於 hashlib 模組中)" -#: ../../library/hashlib.rst:372 +#: ../../library/hashlib.rst:370 msgid "blake2b, blake2s" msgstr "blake2b, blake2s" + +#~ msgid ":func:`blake2b` and :func:`blake2s` were added." +#~ msgstr "加入 :func:`blake2b` 和 :func:`blake2s`\\ 。" diff --git a/library/importlib.metadata.po b/library/importlib.metadata.po index 8c311c0c79..8ede71d6bb 100644 --- a/library/importlib.metadata.po +++ b/library/importlib.metadata.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2024-03-07 17:26+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-" @@ -243,22 +243,22 @@ msgstr "" msgid "The ``json`` attribute was added." msgstr "" -#: ../../library/importlib.metadata.rst:227 +#: ../../library/importlib.metadata.rst:226 msgid "Distribution versions" msgstr "" -#: ../../library/importlib.metadata.rst:229 +#: ../../library/importlib.metadata.rst:228 msgid "" "The ``version()`` function is the quickest way to get a `Distribution " "Package `_'s version number, as a string::" msgstr "" -#: ../../library/importlib.metadata.rst:240 +#: ../../library/importlib.metadata.rst:239 msgid "Distribution files" msgstr "" -#: ../../library/importlib.metadata.rst:242 +#: ../../library/importlib.metadata.rst:241 msgid "" "You can also get the full set of files contained within a distribution. The " "``files()`` function takes a `Distribution Package `_, use " "the ``requires()`` function::" msgstr "" -#: ../../library/importlib.metadata.rst:301 +#: ../../library/importlib.metadata.rst:300 msgid "Mapping import to distribution packages" msgstr "" -#: ../../library/importlib.metadata.rst:303 +#: ../../library/importlib.metadata.rst:302 msgid "" "A convenience method to resolve the `Distribution Package `_ name (or names, " @@ -313,18 +313,18 @@ msgid "" "glossary/#term-Import-Package>`_::" msgstr "" -#: ../../library/importlib.metadata.rst:311 +#: ../../library/importlib.metadata.rst:310 msgid "" "Some editable installs, `do not supply top-level names `_, and thus this function is not " "reliable with such installs." msgstr "" -#: ../../library/importlib.metadata.rst:320 +#: ../../library/importlib.metadata.rst:319 msgid "Distributions" msgstr "" -#: ../../library/importlib.metadata.rst:322 +#: ../../library/importlib.metadata.rst:321 msgid "" "While the above API is the most common and convenient usage, you can get all " "of that information from the ``Distribution`` class. A ``Distribution`` is " @@ -333,30 +333,30 @@ msgid "" "Package>`_. You can get the ``Distribution`` instance::" msgstr "" -#: ../../library/importlib.metadata.rst:331 +#: ../../library/importlib.metadata.rst:330 msgid "" "Thus, an alternative way to get the version number is through the " "``Distribution`` instance::" msgstr "" -#: ../../library/importlib.metadata.rst:337 +#: ../../library/importlib.metadata.rst:336 msgid "" "There are all kinds of additional metadata available on the ``Distribution`` " "instance::" msgstr "" -#: ../../library/importlib.metadata.rst:345 +#: ../../library/importlib.metadata.rst:344 msgid "" "The full set of available metadata is not described here. See the `Core " "metadata specifications `_ for additional details." msgstr "" -#: ../../library/importlib.metadata.rst:350 +#: ../../library/importlib.metadata.rst:349 msgid "Distribution Discovery" msgstr "" -#: ../../library/importlib.metadata.rst:352 +#: ../../library/importlib.metadata.rst:351 msgid "" "By default, this package provides built-in support for discovery of metadata " "for file system and zip file `Distribution Package `_ metadata is not available through :" @@ -391,14 +391,14 @@ msgid "" "on :data:`sys.meta_path`." msgstr "" -#: ../../library/importlib.metadata.rst:371 +#: ../../library/importlib.metadata.rst:370 msgid "" "By default ``importlib.metadata`` installs a finder for distribution " "packages found on the file system. This finder doesn't actually find any " "*distributions*, but it can find their metadata." msgstr "" -#: ../../library/importlib.metadata.rst:376 +#: ../../library/importlib.metadata.rst:375 msgid "" "The abstract class :py:class:`importlib.abc.MetaPathFinder` defines the " "interface expected of finders by Python's import system. ``importlib." @@ -408,14 +408,14 @@ msgid "" "base class, which defines this abstract method::" msgstr "" -#: ../../library/importlib.metadata.rst:390 +#: ../../library/importlib.metadata.rst:389 msgid "" "The ``DistributionFinder.Context`` object provides ``.path`` and ``.name`` " "properties indicating the path to search and name to match and may supply " "other relevant context." msgstr "" -#: ../../library/importlib.metadata.rst:394 +#: ../../library/importlib.metadata.rst:393 msgid "" "What this means in practice is that to support finding distribution package " "metadata in locations other than the file system, subclass ``Distribution`` " diff --git a/library/os.po b/library/os.po index 1c06f1108e..36ef859416 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-24 00:03+0000\n" +"POT-Creation-Date: 2024-03-07 17:26+0000\n" "PO-Revision-Date: 2023-08-30 23:53+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -306,27 +306,27 @@ msgstr "" #: ../../library/os.rst:1637 ../../library/os.rst:2021 #: ../../library/os.rst:2110 ../../library/os.rst:2150 #: ../../library/os.rst:2433 ../../library/os.rst:2455 -#: ../../library/os.rst:4040 ../../library/os.rst:4047 -#: ../../library/os.rst:4054 ../../library/os.rst:4061 -#: ../../library/os.rst:4068 ../../library/os.rst:4075 -#: ../../library/os.rst:4082 ../../library/os.rst:4090 -#: ../../library/os.rst:4098 ../../library/os.rst:4105 -#: ../../library/os.rst:4112 ../../library/os.rst:4121 -#: ../../library/os.rst:4129 ../../library/os.rst:4137 -#: ../../library/os.rst:4144 ../../library/os.rst:4151 -#: ../../library/os.rst:4227 ../../library/os.rst:4267 -#: ../../library/os.rst:4274 ../../library/os.rst:4304 -#: ../../library/os.rst:4431 ../../library/os.rst:4480 -#: ../../library/os.rst:4717 ../../library/os.rst:4751 -#: ../../library/os.rst:4812 ../../library/os.rst:4826 -#: ../../library/os.rst:4843 ../../library/os.rst:4858 -#: ../../library/os.rst:4869 ../../library/os.rst:4881 -#: ../../library/os.rst:4894 ../../library/os.rst:4903 -#: ../../library/os.rst:4913 ../../library/os.rst:4926 -#: ../../library/os.rst:4977 ../../library/os.rst:4988 -#: ../../library/os.rst:5000 ../../library/os.rst:5007 -#: ../../library/os.rst:5016 ../../library/os.rst:5025 -#: ../../library/os.rst:5034 ../../library/os.rst:5043 +#: ../../library/os.rst:4036 ../../library/os.rst:4043 +#: ../../library/os.rst:4050 ../../library/os.rst:4057 +#: ../../library/os.rst:4064 ../../library/os.rst:4071 +#: ../../library/os.rst:4078 ../../library/os.rst:4086 +#: ../../library/os.rst:4094 ../../library/os.rst:4101 +#: ../../library/os.rst:4108 ../../library/os.rst:4117 +#: ../../library/os.rst:4125 ../../library/os.rst:4133 +#: ../../library/os.rst:4140 ../../library/os.rst:4147 +#: ../../library/os.rst:4223 ../../library/os.rst:4263 +#: ../../library/os.rst:4270 ../../library/os.rst:4300 +#: ../../library/os.rst:4427 ../../library/os.rst:4476 +#: ../../library/os.rst:4713 ../../library/os.rst:4747 +#: ../../library/os.rst:4808 ../../library/os.rst:4822 +#: ../../library/os.rst:4839 ../../library/os.rst:4854 +#: ../../library/os.rst:4865 ../../library/os.rst:4877 +#: ../../library/os.rst:4890 ../../library/os.rst:4899 +#: ../../library/os.rst:4909 ../../library/os.rst:4922 +#: ../../library/os.rst:4973 ../../library/os.rst:4984 +#: ../../library/os.rst:4996 ../../library/os.rst:5003 +#: ../../library/os.rst:5012 ../../library/os.rst:5021 +#: ../../library/os.rst:5030 ../../library/os.rst:5039 msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" @@ -484,10 +484,10 @@ msgstr "" #: ../../library/os.rst:322 ../../library/os.rst:1086 ../../library/os.rst:1097 #: ../../library/os.rst:1110 ../../library/os.rst:1357 #: ../../library/os.rst:1649 ../../library/os.rst:1797 -#: ../../library/os.rst:2533 ../../library/os.rst:3379 -#: ../../library/os.rst:3416 ../../library/os.rst:4032 -#: ../../library/os.rst:4568 ../../library/os.rst:4579 -#: ../../library/os.rst:4696 +#: ../../library/os.rst:2533 ../../library/os.rst:3375 +#: ../../library/os.rst:3412 ../../library/os.rst:4028 +#: ../../library/os.rst:4564 ../../library/os.rst:4575 +#: ../../library/os.rst:4692 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" @@ -516,11 +516,11 @@ msgstr "" #: ../../library/os.rst:1735 ../../library/os.rst:1770 #: ../../library/os.rst:2093 ../../library/os.rst:2124 #: ../../library/os.rst:2181 ../../library/os.rst:2499 -#: ../../library/os.rst:2511 ../../library/os.rst:3245 -#: ../../library/os.rst:3402 ../../library/os.rst:3635 -#: ../../library/os.rst:5191 ../../library/os.rst:5200 -#: ../../library/os.rst:5221 ../../library/os.rst:5231 -#: ../../library/os.rst:5240 +#: ../../library/os.rst:2511 ../../library/os.rst:3241 +#: ../../library/os.rst:3398 ../../library/os.rst:3631 +#: ../../library/os.rst:5187 ../../library/os.rst:5196 +#: ../../library/os.rst:5217 ../../library/os.rst:5227 +#: ../../library/os.rst:5236 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -592,10 +592,10 @@ msgid "" "getpwuid(os.getuid())[0]`` to get the login name of the current real user id." msgstr "" -#: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3997 -#: ../../library/os.rst:4251 ../../library/os.rst:4549 -#: ../../library/os.rst:4673 ../../library/os.rst:4792 -#: ../../library/os.rst:4961 +#: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3993 +#: ../../library/os.rst:4247 ../../library/os.rst:4545 +#: ../../library/os.rst:4669 ../../library/os.rst:4788 +#: ../../library/os.rst:4957 msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" @@ -893,7 +893,7 @@ msgid "" "or even ``socket.gethostbyaddr(socket.gethostname())``." msgstr "" -#: ../../library/os.rst:789 ../../library/os.rst:4698 +#: ../../library/os.rst:789 ../../library/os.rst:4694 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." @@ -1134,7 +1134,7 @@ msgstr "" #: ../../library/os.rst:1006 ../../library/os.rst:1021 #: ../../library/os.rst:1112 ../../library/os.rst:1651 #: ../../library/os.rst:2066 ../../library/os.rst:2095 -#: ../../library/os.rst:3381 +#: ../../library/os.rst:3377 msgid "" "The function is limited on Emscripten and WASI, see :ref:`wasm-availability` " "for more information." @@ -1239,7 +1239,7 @@ msgstr "" "引發一個附帶引數 ``fd``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:1099 ../../library/os.rst:3420 +#: ../../library/os.rst:1099 ../../library/os.rst:3416 msgid "Added support for Windows" msgstr "新增對 Windows 的支援" @@ -1439,13 +1439,13 @@ msgstr "" #: ../../library/os.rst:1254 ../../library/os.rst:2331 #: ../../library/os.rst:2367 ../../library/os.rst:2435 #: ../../library/os.rst:2457 ../../library/os.rst:2538 -#: ../../library/os.rst:2569 ../../library/os.rst:2676 -#: ../../library/os.rst:3436 +#: ../../library/os.rst:2568 ../../library/os.rst:2675 +#: ../../library/os.rst:3432 msgid "Added the *dir_fd* parameter." msgstr "新增 *dir_fd* 參數。" #: ../../library/os.rst:1257 ../../library/os.rst:1576 -#: ../../library/os.rst:1752 ../../library/os.rst:4794 +#: ../../library/os.rst:1752 ../../library/os.rst:4790 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the function now retries the system call instead of raising an :" @@ -1460,13 +1460,13 @@ msgstr "" #: ../../library/os.rst:2334 ../../library/os.rst:2370 #: ../../library/os.rst:2411 ../../library/os.rst:2438 #: ../../library/os.rst:2460 ../../library/os.rst:2501 -#: ../../library/os.rst:2572 ../../library/os.rst:2591 -#: ../../library/os.rst:2679 ../../library/os.rst:2969 -#: ../../library/os.rst:3259 ../../library/os.rst:3423 -#: ../../library/os.rst:3439 ../../library/os.rst:3479 -#: ../../library/os.rst:3578 ../../library/os.rst:3639 -#: ../../library/os.rst:3823 ../../library/os.rst:4003 -#: ../../library/os.rst:4556 +#: ../../library/os.rst:2571 ../../library/os.rst:2590 +#: ../../library/os.rst:2678 ../../library/os.rst:2968 +#: ../../library/os.rst:3255 ../../library/os.rst:3419 +#: ../../library/os.rst:3435 ../../library/os.rst:3475 +#: ../../library/os.rst:3574 ../../library/os.rst:3635 +#: ../../library/os.rst:3819 ../../library/os.rst:3999 +#: ../../library/os.rst:4552 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -2009,8 +2009,8 @@ msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" #: ../../library/os.rst:1849 ../../library/os.rst:1855 -#: ../../library/os.rst:3928 ../../library/os.rst:4591 -#: ../../library/os.rst:4636 +#: ../../library/os.rst:3924 ../../library/os.rst:4587 +#: ../../library/os.rst:4632 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -2329,7 +2329,7 @@ msgid ":const:`stat.S_IXOTH`" msgstr ":const:`stat.S_IXOTH`" #: ../../library/os.rst:2056 ../../library/os.rst:2084 -#: ../../library/os.rst:3469 +#: ../../library/os.rst:3465 msgid "" "This function can support :ref:`specifying a file descriptor `, :" "ref:`paths relative to directory descriptors ` and :ref:`not " @@ -2450,7 +2450,7 @@ msgstr "" msgid ":ref:`Availability `: Unix, Windows, not Emscripten." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten。" -#: ../../library/os.rst:2199 ../../library/os.rst:4253 +#: ../../library/os.rst:2199 ../../library/os.rst:4249 msgid "Added Windows support." msgstr "新支援 Windows。" @@ -2458,8 +2458,8 @@ msgstr "新支援 Windows。" msgid "Added the *src_dir_fd*, *dst_dir_fd*, and *follow_symlinks* parameters." msgstr "新增 *src_dir_fd*、*dst_dir_fd* 與 *follow_symlinks* 參數。" -#: ../../library/os.rst:2205 ../../library/os.rst:2623 -#: ../../library/os.rst:2660 ../../library/os.rst:3391 +#: ../../library/os.rst:2205 ../../library/os.rst:2622 +#: ../../library/os.rst:2659 ../../library/os.rst:3387 msgid "Accepts a :term:`path-like object` for *src* and *dst*." msgstr "" @@ -2480,7 +2480,7 @@ msgid "" "circumstances, they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2222 ../../library/os.rst:2708 +#: ../../library/os.rst:2222 ../../library/os.rst:2707 msgid "" "This function can also support :ref:`specifying a file descriptor " "`; the file descriptor must refer to a directory." @@ -2507,7 +2507,7 @@ msgstr "" msgid "The *path* parameter became optional." msgstr "" -#: ../../library/os.rst:2239 ../../library/os.rst:3250 +#: ../../library/os.rst:2239 ../../library/os.rst:3246 msgid "Added support for specifying *path* as an open file descriptor." msgstr "" @@ -2622,7 +2622,7 @@ msgid "" msgstr "" #: ../../library/os.rst:2328 ../../library/os.rst:2535 -#: ../../library/os.rst:3384 +#: ../../library/os.rst:3380 msgid "Added support for Windows 6.0 (Vista) symbolic links." msgstr "" @@ -2771,8 +2771,8 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:2496 ../../library/os.rst:3243 -#: ../../library/os.rst:3412 +#: ../../library/os.rst:2496 ../../library/os.rst:3239 +#: ../../library/os.rst:3408 msgid "" "This function can support :ref:`specifying a file descriptor `." msgstr "" @@ -2821,21 +2821,21 @@ msgid "" "the optional \"print name\" field that was previously returned." msgstr "" -#: ../../library/os.rst:2554 +#: ../../library/os.rst:2553 msgid "" "Remove (delete) the file *path*. If *path* is a directory, an :exc:" "`OSError` is raised. Use :func:`rmdir` to remove directories. If the file " "does not exist, a :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/os.rst:2558 ../../library/os.rst:2671 -#: ../../library/os.rst:3363 +#: ../../library/os.rst:2557 ../../library/os.rst:2670 +#: ../../library/os.rst:3359 msgid "" "This function can support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2561 +#: ../../library/os.rst:2560 msgid "" "On Windows, attempting to remove a file that is in use causes an exception " "to be raised; on Unix, the directory entry is removed but the storage " @@ -2843,12 +2843,12 @@ msgid "" "longer in use." msgstr "" -#: ../../library/os.rst:2565 +#: ../../library/os.rst:2564 msgid "This function is semantically identical to :func:`unlink`." msgstr "" -#: ../../library/os.rst:2567 ../../library/os.rst:2589 -#: ../../library/os.rst:3434 +#: ../../library/os.rst:2566 ../../library/os.rst:2588 +#: ../../library/os.rst:3430 msgid "" "Raises an :ref:`auditing event ` ``os.remove`` with arguments " "``path``, ``dir_fd``." @@ -2856,7 +2856,7 @@ msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` ``os." "remove``。" -#: ../../library/os.rst:2580 +#: ../../library/os.rst:2579 msgid "" "Remove directories recursively. Works like :func:`rmdir` except that, if " "the leaf directory is successfully removed, :func:`removedirs` tries to " @@ -2868,20 +2868,20 @@ msgid "" "could not be successfully removed." msgstr "" -#: ../../library/os.rst:2597 +#: ../../library/os.rst:2596 msgid "" "Rename the file or directory *src* to *dst*. If *dst* exists, the operation " "will fail with an :exc:`OSError` subclass in a number of cases:" msgstr "" -#: ../../library/os.rst:2600 +#: ../../library/os.rst:2599 msgid "" "On Windows, if *dst* exists a :exc:`FileExistsError` is always raised. The " "operation may fail if *src* and *dst* are on different filesystems. Use :" "func:`shutil.move` to support moves to a different filesystem." msgstr "" -#: ../../library/os.rst:2604 +#: ../../library/os.rst:2603 msgid "" "On Unix, if *src* is a file and *dst* is a directory or vice-versa, an :exc:" "`IsADirectoryError` or a :exc:`NotADirectoryError` will be raised " @@ -2893,20 +2893,20 @@ msgid "" "operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2613 ../../library/os.rst:2653 +#: ../../library/os.rst:2612 ../../library/os.rst:2652 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `." msgstr "" -#: ../../library/os.rst:2616 +#: ../../library/os.rst:2615 msgid "" "If you want cross-platform overwriting of the destination, use :func:" "`replace`." msgstr "" -#: ../../library/os.rst:2618 ../../library/os.rst:2639 -#: ../../library/os.rst:2656 +#: ../../library/os.rst:2617 ../../library/os.rst:2638 +#: ../../library/os.rst:2655 msgid "" "Raises an :ref:`auditing event ` ``os.rename`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2914,11 +2914,11 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``src_dir_fd``、``dst_dir_fd`` 的\\ :ref:`" "稽核事件 ` ``os.rename``。" -#: ../../library/os.rst:2620 +#: ../../library/os.rst:2619 msgid "Added the *src_dir_fd* and *dst_dir_fd* parameters." msgstr "新增 *src_dir_fd* 與 *dst_dir_fd* 參數。" -#: ../../library/os.rst:2629 +#: ../../library/os.rst:2628 msgid "" "Recursive directory or file renaming function. Works like :func:`rename`, " "except creation of any intermediate directories needed to make the new " @@ -2927,17 +2927,17 @@ msgid "" "using :func:`removedirs`." msgstr "" -#: ../../library/os.rst:2636 +#: ../../library/os.rst:2635 msgid "" "This function can fail with the new directory structure made if you lack " "permissions needed to remove the leaf directory or file." msgstr "" -#: ../../library/os.rst:2641 +#: ../../library/os.rst:2640 msgid "Accepts a :term:`path-like object` for *old* and *new*." msgstr "" -#: ../../library/os.rst:2647 +#: ../../library/os.rst:2646 msgid "" "Rename the file or directory *src* to *dst*. If *dst* is a non-empty " "directory, :exc:`OSError` will be raised. If *dst* exists and is a file, it " @@ -2946,7 +2946,7 @@ msgid "" "renaming will be an atomic operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2666 +#: ../../library/os.rst:2665 msgid "" "Remove (delete) the directory *path*. If the directory does not exist or is " "not empty, a :exc:`FileNotFoundError` or an :exc:`OSError` is raised " @@ -2954,7 +2954,7 @@ msgid "" "rmtree` can be used." msgstr "" -#: ../../library/os.rst:2674 +#: ../../library/os.rst:2673 msgid "" "Raises an :ref:`auditing event ` ``os.rmdir`` with arguments " "``path``, ``dir_fd``." @@ -2962,7 +2962,7 @@ msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` ``os." "rmdir``。" -#: ../../library/os.rst:2685 +#: ../../library/os.rst:2684 msgid "" "Return an iterator of :class:`os.DirEntry` objects corresponding to the " "entries in the directory given by *path*. The entries are yielded in " @@ -2972,7 +2972,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:2692 +#: ../../library/os.rst:2691 msgid "" "Using :func:`scandir` instead of :func:`listdir` can significantly increase " "the performance of code that also needs file type or file attribute " @@ -2984,7 +2984,7 @@ msgid "" "Unix but only requires one for symbolic links on Windows." msgstr "" -#: ../../library/os.rst:2702 +#: ../../library/os.rst:2701 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the type " @@ -2993,31 +2993,31 @@ msgid "" "they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2711 +#: ../../library/os.rst:2710 msgid "" "Raises an :ref:`auditing event ` ``os.scandir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.scandir``。" -#: ../../library/os.rst:2713 +#: ../../library/os.rst:2712 msgid "" "The :func:`scandir` iterator supports the :term:`context manager` protocol " "and has the following method:" msgstr "" -#: ../../library/os.rst:2718 +#: ../../library/os.rst:2717 msgid "Close the iterator and free acquired resources." msgstr "" -#: ../../library/os.rst:2720 +#: ../../library/os.rst:2719 msgid "" "This is called automatically when the iterator is exhausted or garbage " "collected, or when an error happens during iterating. However it is " "advisable to call it explicitly or use the :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:2727 +#: ../../library/os.rst:2726 msgid "" "The following example shows a simple use of :func:`scandir` to display all " "the files (excluding directories) in the given *path* that don't start with " @@ -3025,7 +3025,7 @@ msgid "" "system call::" msgstr "" -#: ../../library/os.rst:2739 +#: ../../library/os.rst:2738 msgid "" "On Unix-based systems, :func:`scandir` uses the system's `opendir() `_ and " @@ -3036,7 +3036,7 @@ msgid "" "desktop/aa364428(v=vs.85).aspx>`_ functions." msgstr "" -#: ../../library/os.rst:2751 +#: ../../library/os.rst:2750 msgid "" "Added support for the :term:`context manager` protocol and the :func:" "`~scandir.close()` method. If a :func:`scandir` iterator is neither " @@ -3044,28 +3044,28 @@ msgid "" "its destructor." msgstr "" -#: ../../library/os.rst:2757 +#: ../../library/os.rst:2756 msgid "The function accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2759 +#: ../../library/os.rst:2758 msgid "Added support for :ref:`file descriptors ` on Unix." msgstr "" -#: ../../library/os.rst:2765 +#: ../../library/os.rst:2764 msgid "" "Object yielded by :func:`scandir` to expose the file path and other file " "attributes of a directory entry." msgstr "" -#: ../../library/os.rst:2768 +#: ../../library/os.rst:2767 msgid "" ":func:`scandir` will provide as much of this information as possible without " "making additional system calls. When a ``stat()`` or ``lstat()`` system call " "is made, the ``os.DirEntry`` object will cache the result." msgstr "" -#: ../../library/os.rst:2772 +#: ../../library/os.rst:2771 msgid "" "``os.DirEntry`` instances are not intended to be stored in long-lived data " "structures; if you know the file metadata has changed or if a long time has " @@ -3073,7 +3073,7 @@ msgid "" "up-to-date information." msgstr "" -#: ../../library/os.rst:2777 +#: ../../library/os.rst:2776 msgid "" "Because the ``os.DirEntry`` methods can make operating system calls, they " "may also raise :exc:`OSError`. If you need very fine-grained control over " @@ -3081,29 +3081,29 @@ msgid "" "methods and handle as appropriate." msgstr "" -#: ../../library/os.rst:2782 +#: ../../library/os.rst:2781 msgid "" "To be directly usable as a :term:`path-like object`, ``os.DirEntry`` " "implements the :class:`PathLike` interface." msgstr "" -#: ../../library/os.rst:2785 +#: ../../library/os.rst:2784 msgid "Attributes and methods on a ``os.DirEntry`` instance are as follows:" msgstr "" -#: ../../library/os.rst:2789 +#: ../../library/os.rst:2788 msgid "" "The entry's base filename, relative to the :func:`scandir` *path* argument." msgstr "" -#: ../../library/os.rst:2792 +#: ../../library/os.rst:2791 msgid "" "The :attr:`name` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: ../../library/os.rst:2798 +#: ../../library/os.rst:2797 msgid "" "The entry's full path name: equivalent to ``os.path.join(scandir_path, entry." "name)`` where *scandir_path* is the :func:`scandir` *path* argument. The " @@ -3113,51 +3113,51 @@ msgid "" "attribute." msgstr "" -#: ../../library/os.rst:2805 +#: ../../library/os.rst:2804 msgid "" "The :attr:`path` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: ../../library/os.rst:2811 +#: ../../library/os.rst:2810 msgid "Return the inode number of the entry." msgstr "" -#: ../../library/os.rst:2813 +#: ../../library/os.rst:2812 msgid "" "The result is cached on the ``os.DirEntry`` object. Use ``os.stat(entry." "path, follow_symlinks=False).st_ino`` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2817 +#: ../../library/os.rst:2816 msgid "" "On the first, uncached call, a system call is required on Windows but not on " "Unix." msgstr "" -#: ../../library/os.rst:2822 +#: ../../library/os.rst:2821 msgid "" "Return ``True`` if this entry is a directory or a symbolic link pointing to " "a directory; return ``False`` if the entry is or points to any other kind of " "file, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2826 +#: ../../library/os.rst:2825 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "directory (without following symlinks); return ``False`` if the entry is any " "other kind of file or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2830 +#: ../../library/os.rst:2829 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` along " "with :func:`stat.S_ISDIR` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2834 +#: ../../library/os.rst:2833 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, for non-symlinks, neither Windows or Unix require a system " @@ -3167,46 +3167,46 @@ msgid "" "is ``False``." msgstr "" -#: ../../library/os.rst:2841 ../../library/os.rst:2871 +#: ../../library/os.rst:2840 ../../library/os.rst:2870 msgid "" "This method can raise :exc:`OSError`, such as :exc:`PermissionError`, but :" "exc:`FileNotFoundError` is caught and not raised." msgstr "" -#: ../../library/os.rst:2846 +#: ../../library/os.rst:2845 msgid "" "Return ``True`` if this entry is a file or a symbolic link pointing to a " "file; return ``False`` if the entry is or points to a directory or other non-" "file entry, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2850 +#: ../../library/os.rst:2849 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "file (without following symlinks); return ``False`` if the entry is a " "directory or other non-file entry, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2854 +#: ../../library/os.rst:2853 msgid "" "The result is cached on the ``os.DirEntry`` object. Caching, system calls " "made, and exceptions raised are as per :func:`~os.DirEntry.is_dir`." msgstr "" -#: ../../library/os.rst:2859 +#: ../../library/os.rst:2858 msgid "" "Return ``True`` if this entry is a symbolic link (even if broken); return " "``False`` if the entry points to a directory or any kind of file, or if it " "doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2863 +#: ../../library/os.rst:2862 msgid "" "The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." "islink` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2866 +#: ../../library/os.rst:2865 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, neither Windows or Unix require a system call, except on " @@ -3214,48 +3214,48 @@ msgid "" "``dirent.d_type == DT_UNKNOWN``." msgstr "" -#: ../../library/os.rst:2876 +#: ../../library/os.rst:2875 msgid "" "Return ``True`` if this entry is a junction (even if broken); return " "``False`` if the entry points to a regular directory, any kind of file, a " "symlink, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2880 +#: ../../library/os.rst:2879 msgid "" "The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." "isjunction` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2887 +#: ../../library/os.rst:2886 msgid "" "Return a :class:`stat_result` object for this entry. This method follows " "symbolic links by default; to stat a symbolic link add the " "``follow_symlinks=False`` argument." msgstr "" -#: ../../library/os.rst:2891 +#: ../../library/os.rst:2890 msgid "" "On Unix, this method always requires a system call. On Windows, it only " "requires a system call if *follow_symlinks* is ``True`` and the entry is a " "reparse point (for example, a symbolic link or directory junction)." msgstr "" -#: ../../library/os.rst:2896 +#: ../../library/os.rst:2895 msgid "" "On Windows, the ``st_ino``, ``st_dev`` and ``st_nlink`` attributes of the :" "class:`stat_result` are always set to zero. Call :func:`os.stat` to get " "these attributes." msgstr "" -#: ../../library/os.rst:2900 +#: ../../library/os.rst:2899 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` to fetch " "up-to-date information." msgstr "" -#: ../../library/os.rst:2904 +#: ../../library/os.rst:2903 msgid "" "Note that there is a nice correspondence between several attributes and " "methods of ``os.DirEntry`` and of :class:`pathlib.Path`. In particular, the " @@ -3263,13 +3263,13 @@ msgid "" "``is_file()``, ``is_symlink()``, ``is_junction()``, and ``stat()`` methods." msgstr "" -#: ../../library/os.rst:2912 +#: ../../library/os.rst:2911 msgid "" "Added support for the :class:`~os.PathLike` interface. Added support for :" "class:`bytes` paths on Windows." msgstr "" -#: ../../library/os.rst:2916 +#: ../../library/os.rst:2915 msgid "" "The ``st_ctime`` attribute of a stat result is deprecated on Windows. The " "file creation time is properly available as ``st_birthtime``, and in the " @@ -3277,7 +3277,7 @@ msgid "" "time, if available." msgstr "" -#: ../../library/os.rst:2925 +#: ../../library/os.rst:2924 msgid "" "Get the status of a file or a file descriptor. Perform the equivalent of a :" "c:func:`stat` system call on the given path. *path* may be specified as " @@ -3286,21 +3286,21 @@ msgid "" "`stat_result` object." msgstr "" -#: ../../library/os.rst:2931 +#: ../../library/os.rst:2930 msgid "" "This function normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :func:`lstat`." msgstr "" -#: ../../library/os.rst:2934 ../../library/os.rst:3802 -#: ../../library/os.rst:3818 ../../library/os.rst:3834 -#: ../../library/os.rst:3854 +#: ../../library/os.rst:2933 ../../library/os.rst:3798 +#: ../../library/os.rst:3814 ../../library/os.rst:3830 +#: ../../library/os.rst:3850 msgid "" "This function can support :ref:`specifying a file descriptor ` and :" "ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:2937 +#: ../../library/os.rst:2936 msgid "" "On Windows, passing ``follow_symlinks=False`` will disable following all " "name-surrogate reparse points, which includes symlinks and directory " @@ -3314,21 +3314,21 @@ msgid "" "junction points, which will raise the usual exceptions." msgstr "" -#: ../../library/os.rst:2950 ../../library/os.rst:3722 +#: ../../library/os.rst:2949 ../../library/os.rst:3718 msgid "Example::" msgstr "範例: ::" -#: ../../library/os.rst:2963 +#: ../../library/os.rst:2962 msgid ":func:`fstat` and :func:`lstat` functions." msgstr ":func:`fstat` 和 :func:`lstat` 函式。" -#: ../../library/os.rst:2965 +#: ../../library/os.rst:2964 msgid "" "Added the *dir_fd* and *follow_symlinks* parameters, specifying a file " "descriptor instead of a path." msgstr "新增 *dir_fd* 與 *follow_symlinks* 參數,指定一個檔案描述器而非路徑。" -#: ../../library/os.rst:2972 +#: ../../library/os.rst:2971 msgid "" "On Windows, all reparse points that can be resolved by the operating system " "are now followed, and passing ``follow_symlinks=False`` disables following " @@ -3338,122 +3338,122 @@ msgid "" "of raising an error." msgstr "" -#: ../../library/os.rst:2983 +#: ../../library/os.rst:2982 msgid "" "Object whose attributes correspond roughly to the members of the :c:struct:" "`stat` structure. It is used for the result of :func:`os.stat`, :func:`os." "fstat` and :func:`os.lstat`." msgstr "" -#: ../../library/os.rst:2987 +#: ../../library/os.rst:2986 msgid "Attributes:" msgstr "" -#: ../../library/os.rst:2991 +#: ../../library/os.rst:2990 msgid "File mode: file type and file mode bits (permissions)." msgstr "" -#: ../../library/os.rst:2995 +#: ../../library/os.rst:2994 msgid "" "Platform dependent, but if non-zero, uniquely identifies the file for a " "given value of ``st_dev``. Typically:" msgstr "" -#: ../../library/os.rst:2998 +#: ../../library/os.rst:2997 msgid "the inode number on Unix," msgstr "" -#: ../../library/os.rst:2999 +#: ../../library/os.rst:2998 msgid "" "the `file index `_ on " "Windows" msgstr "" -#: ../../library/os.rst:3005 +#: ../../library/os.rst:3004 msgid "Identifier of the device on which this file resides." msgstr "" -#: ../../library/os.rst:3009 +#: ../../library/os.rst:3008 msgid "Number of hard links." msgstr "" -#: ../../library/os.rst:3013 +#: ../../library/os.rst:3012 msgid "User identifier of the file owner." msgstr "" -#: ../../library/os.rst:3017 +#: ../../library/os.rst:3016 msgid "Group identifier of the file owner." msgstr "" -#: ../../library/os.rst:3021 +#: ../../library/os.rst:3020 msgid "" "Size of the file in bytes, if it is a regular file or a symbolic link. The " "size of a symbolic link is the length of the pathname it contains, without a " "terminating null byte." msgstr "" -#: ../../library/os.rst:3025 +#: ../../library/os.rst:3024 msgid "Timestamps:" msgstr "" -#: ../../library/os.rst:3029 +#: ../../library/os.rst:3028 msgid "Time of most recent access expressed in seconds." msgstr "" -#: ../../library/os.rst:3033 +#: ../../library/os.rst:3032 msgid "Time of most recent content modification expressed in seconds." msgstr "" -#: ../../library/os.rst:3037 +#: ../../library/os.rst:3036 msgid "Time of most recent metadata change expressed in seconds." msgstr "" -#: ../../library/os.rst:3039 +#: ../../library/os.rst:3038 msgid "" "``st_ctime`` is deprecated on Windows. Use ``st_birthtime`` for the file " "creation time. In the future, ``st_ctime`` will contain the time of the most " "recent metadata change, as for other platforms." msgstr "" -#: ../../library/os.rst:3046 +#: ../../library/os.rst:3045 msgid "Time of most recent access expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:3052 +#: ../../library/os.rst:3051 msgid "" "Time of most recent content modification expressed in nanoseconds as an " "integer." msgstr "" -#: ../../library/os.rst:3059 +#: ../../library/os.rst:3058 msgid "" "Time of most recent metadata change expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:3064 +#: ../../library/os.rst:3063 msgid "" "``st_ctime_ns`` is deprecated on Windows. Use ``st_birthtime_ns`` for the " "file creation time. In the future, ``st_ctime`` will contain the time of the " "most recent metadata change, as for other platforms." msgstr "" -#: ../../library/os.rst:3071 +#: ../../library/os.rst:3070 msgid "" "Time of file creation expressed in seconds. This attribute is not always " "available, and may raise :exc:`AttributeError`." msgstr "" -#: ../../library/os.rst:3074 +#: ../../library/os.rst:3073 msgid "``st_birthtime`` is now available on Windows." msgstr "" -#: ../../library/os.rst:3079 +#: ../../library/os.rst:3078 msgid "" "Time of file creation expressed in nanoseconds as an integer. This attribute " "is not always available, and may raise :exc:`AttributeError`." msgstr "" -#: ../../library/os.rst:3087 +#: ../../library/os.rst:3086 msgid "" "The exact meaning and resolution of the :attr:`st_atime`, :attr:`st_mtime`, :" "attr:`st_ctime` and :attr:`st_birthtime` attributes depend on the operating " @@ -3463,7 +3463,7 @@ msgid "" "details." msgstr "" -#: ../../library/os.rst:3094 +#: ../../library/os.rst:3093 msgid "" "Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`, :attr:" "`st_ctime_ns` and :attr:`st_birthtime_ns` are always expressed in " @@ -3476,74 +3476,74 @@ msgid "" "`st_birthtime_ns`." msgstr "" -#: ../../library/os.rst:3104 +#: ../../library/os.rst:3103 msgid "" "On some Unix systems (such as Linux), the following attributes may also be " "available:" msgstr "" -#: ../../library/os.rst:3109 +#: ../../library/os.rst:3108 msgid "" "Number of 512-byte blocks allocated for file. This may be smaller than :attr:" "`st_size`/512 when the file has holes." msgstr "" -#: ../../library/os.rst:3114 +#: ../../library/os.rst:3113 msgid "" "\"Preferred\" blocksize for efficient file system I/O. Writing to a file in " "smaller chunks may cause an inefficient read-modify-rewrite." msgstr "" -#: ../../library/os.rst:3119 +#: ../../library/os.rst:3118 msgid "Type of device if an inode device." msgstr "" -#: ../../library/os.rst:3123 +#: ../../library/os.rst:3122 msgid "User defined flags for file." msgstr "" -#: ../../library/os.rst:3125 +#: ../../library/os.rst:3124 msgid "" "On other Unix systems (such as FreeBSD), the following attributes may be " "available (but may be only filled out if root tries to use them):" msgstr "" -#: ../../library/os.rst:3130 +#: ../../library/os.rst:3129 msgid "File generation number." msgstr "" -#: ../../library/os.rst:3132 +#: ../../library/os.rst:3131 msgid "" "On Solaris and derivatives, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:3137 +#: ../../library/os.rst:3136 msgid "" "String that uniquely identifies the type of the filesystem that contains the " "file." msgstr "" -#: ../../library/os.rst:3140 +#: ../../library/os.rst:3139 msgid "On macOS systems, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:3144 +#: ../../library/os.rst:3143 msgid "Real size of the file." msgstr "" -#: ../../library/os.rst:3148 +#: ../../library/os.rst:3147 msgid "Creator of the file." msgstr "" -#: ../../library/os.rst:3152 +#: ../../library/os.rst:3151 msgid "File type." msgstr "" -#: ../../library/os.rst:3154 +#: ../../library/os.rst:3153 msgid "On Windows systems, the following attributes are also available:" msgstr "" -#: ../../library/os.rst:3158 +#: ../../library/os.rst:3157 msgid "" "Windows file attributes: ``dwFileAttributes`` member of the " "``BY_HANDLE_FILE_INFORMATION`` structure returned by :c:func:`!" @@ -3551,7 +3551,7 @@ msgid "" "FILE_ATTRIBUTE_ARCHIVE>` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:3168 +#: ../../library/os.rst:3167 msgid "" "When :attr:`st_file_attributes` has the :const:`~stat." "FILE_ATTRIBUTE_REPARSE_POINT` set, this field contains the tag identifying " @@ -3559,14 +3559,14 @@ msgid "" "IO_REPARSE_TAG_SYMLINK>` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:3173 +#: ../../library/os.rst:3172 msgid "" "The standard module :mod:`stat` defines functions and constants that are " "useful for extracting information from a :c:struct:`stat` structure. (On " "Windows, some items are filled with dummy values.)" msgstr "" -#: ../../library/os.rst:3177 +#: ../../library/os.rst:3176 msgid "" "For backward compatibility, a :class:`stat_result` instance is also " "accessible as a tuple of at least 10 integers giving the most important (and " @@ -3578,49 +3578,49 @@ msgid "" "class:`stat_result` as a tuple always returns integers." msgstr "" -#: ../../library/os.rst:3186 +#: ../../library/os.rst:3185 msgid "Windows now returns the file index as :attr:`st_ino` when available." msgstr "" -#: ../../library/os.rst:3190 +#: ../../library/os.rst:3189 msgid "Added the :attr:`st_fstype` member to Solaris/derivatives." msgstr "" -#: ../../library/os.rst:3193 +#: ../../library/os.rst:3192 msgid "Added the :attr:`st_reparse_tag` member on Windows." msgstr "在 Windows 上新增 :attr:`st_reparse_tag` 成員。" -#: ../../library/os.rst:3196 +#: ../../library/os.rst:3195 msgid "" "On Windows, the :attr:`st_mode` member now identifies special files as :" "const:`S_IFCHR`, :const:`S_IFIFO` or :const:`S_IFBLK` as appropriate." msgstr "" -#: ../../library/os.rst:3201 +#: ../../library/os.rst:3200 msgid "" "On Windows, :attr:`st_ctime` is deprecated. Eventually, it will contain the " "last metadata change time, for consistency with other platforms, but for now " "still contains creation time. Use :attr:`st_birthtime` for the creation time." msgstr "" -#: ../../library/os.rst:3207 +#: ../../library/os.rst:3206 msgid "" "On Windows, :attr:`st_ino` may now be up to 128 bits, depending on the file " "system. Previously it would not be above 64 bits, and larger file " "identifiers would be arbitrarily packed." msgstr "" -#: ../../library/os.rst:3212 +#: ../../library/os.rst:3210 msgid "" "On Windows, :attr:`st_rdev` no longer returns a value. Previously it would " "contain the same as :attr:`st_dev`, which was incorrect." msgstr "" -#: ../../library/os.rst:3216 +#: ../../library/os.rst:3213 msgid "Added the :attr:`st_birthtime` member on Windows." msgstr "在 Windows 上新增 :attr:`st_birthtime` 成員。" -#: ../../library/os.rst:3222 +#: ../../library/os.rst:3218 msgid "" "Perform a :c:func:`!statvfs` system call on the given path. The return " "value is an object whose attributes describe the filesystem on the given " @@ -3630,7 +3630,7 @@ msgid "" "`f_favail`, :attr:`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." msgstr "" -#: ../../library/os.rst:3229 +#: ../../library/os.rst:3225 msgid "" "Two module-level constants are defined for the :attr:`f_flag` attribute's " "bit-flags: if :const:`ST_RDONLY` is set, the filesystem is mounted read-" @@ -3638,7 +3638,7 @@ msgid "" "are disabled or not supported." msgstr "" -#: ../../library/os.rst:3234 +#: ../../library/os.rst:3230 msgid "" "Additional module-level constants are defined for GNU/glibc based systems. " "These are :const:`ST_NODEV` (disallow access to device special files), :" @@ -3651,11 +3651,11 @@ msgid "" "relative to mtime/ctime)." msgstr "" -#: ../../library/os.rst:3247 +#: ../../library/os.rst:3243 msgid "The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added." msgstr "新增 :const:`ST_RDONLY` 與 :const:`ST_NOSUID` 常數。" -#: ../../library/os.rst:3253 +#: ../../library/os.rst:3249 msgid "" "The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`, :const:" "`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`, :const:" @@ -3663,11 +3663,11 @@ msgid "" "`ST_RELATIME` constants were added." msgstr "" -#: ../../library/os.rst:3262 +#: ../../library/os.rst:3258 msgid "Added the :attr:`f_fsid` attribute." msgstr "新增 :attr:`f_fsid` 屬性。" -#: ../../library/os.rst:3268 +#: ../../library/os.rst:3264 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept an open file descriptor for their *dir_fd* parameter. Different " @@ -3679,7 +3679,7 @@ msgid "" "(Specifying ``None`` for *dir_fd* is always supported on all platforms.)" msgstr "" -#: ../../library/os.rst:3278 +#: ../../library/os.rst:3274 msgid "" "To check whether a particular function accepts an open file descriptor for " "its *dir_fd* parameter, use the ``in`` operator on ``supports_dir_fd``. As " @@ -3687,13 +3687,13 @@ msgid "" "open file descriptors for *dir_fd* on the local platform::" msgstr "" -#: ../../library/os.rst:3285 +#: ../../library/os.rst:3281 msgid "" "Currently *dir_fd* parameters only work on Unix platforms; none of them work " "on Windows." msgstr "" -#: ../../library/os.rst:3293 +#: ../../library/os.rst:3289 msgid "" "A :class:`set` object indicating whether :func:`os.access` permits " "specifying ``True`` for its *effective_ids* parameter on the local platform. " @@ -3702,19 +3702,19 @@ msgid "" "func:`os.access`; otherwise it will be empty." msgstr "" -#: ../../library/os.rst:3299 +#: ../../library/os.rst:3295 msgid "" "This expression evaluates to ``True`` if :func:`os.access` supports " "``effective_ids=True`` on the local platform::" msgstr "" -#: ../../library/os.rst:3304 +#: ../../library/os.rst:3300 msgid "" "Currently *effective_ids* is only supported on Unix platforms; it does not " "work on Windows." msgstr "" -#: ../../library/os.rst:3312 +#: ../../library/os.rst:3308 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "permit specifying their *path* parameter as an open file descriptor on the " @@ -3723,7 +3723,7 @@ msgid "" "*path* arguments is not available on all platforms Python supports." msgstr "" -#: ../../library/os.rst:3319 +#: ../../library/os.rst:3315 msgid "" "To determine whether a particular function permits specifying an open file " "descriptor for its *path* parameter, use the ``in`` operator on " @@ -3732,7 +3732,7 @@ msgid "" "platform::" msgstr "" -#: ../../library/os.rst:3332 +#: ../../library/os.rst:3328 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept ``False`` for their *follow_symlinks* parameter on the local " @@ -3745,7 +3745,7 @@ msgid "" "on all platforms.)" msgstr "" -#: ../../library/os.rst:3342 +#: ../../library/os.rst:3338 msgid "" "To check whether a particular function accepts ``False`` for its " "*follow_symlinks* parameter, use the ``in`` operator on " @@ -3754,11 +3754,11 @@ msgid "" "stat` on the local platform::" msgstr "" -#: ../../library/os.rst:3355 +#: ../../library/os.rst:3351 msgid "Create a symbolic link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:3357 +#: ../../library/os.rst:3353 msgid "" "On Windows, a symlink represents either a file or a directory, and does not " "morph to the target dynamically. If the target is present, the type of the " @@ -3768,7 +3768,7 @@ msgid "" "ignored." msgstr "" -#: ../../library/os.rst:3368 +#: ../../library/os.rst:3364 msgid "" "On newer versions of Windows 10, unprivileged accounts can create symlinks " "if Developer Mode is enabled. When Developer Mode is not available/enabled, " @@ -3776,12 +3776,12 @@ msgid "" "must be run as an administrator." msgstr "" -#: ../../library/os.rst:3374 +#: ../../library/os.rst:3370 msgid "" ":exc:`OSError` is raised when the function is called by an unprivileged user." msgstr "" -#: ../../library/os.rst:3377 +#: ../../library/os.rst:3373 msgid "" "Raises an :ref:`auditing event ` ``os.symlink`` with arguments " "``src``, ``dst``, ``dir_fd``." @@ -3789,27 +3789,27 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.symlink``。" -#: ../../library/os.rst:3387 +#: ../../library/os.rst:3383 msgid "" "Added the *dir_fd* parameter, and now allow *target_is_directory* on non-" "Windows platforms." msgstr "" -#: ../../library/os.rst:3394 +#: ../../library/os.rst:3390 msgid "Added support for unelevated symlinks on Windows with Developer Mode." msgstr "" -#: ../../library/os.rst:3400 +#: ../../library/os.rst:3396 msgid "Force write of everything to disk." msgstr "" -#: ../../library/os.rst:3409 +#: ../../library/os.rst:3405 msgid "" "Truncate the file corresponding to *path*, so that it is at most *length* " "bytes in size." msgstr "" -#: ../../library/os.rst:3414 +#: ../../library/os.rst:3410 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``path``, ``length``." @@ -3817,46 +3817,46 @@ msgstr "" "引發一個附帶引數 ``path``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:3429 +#: ../../library/os.rst:3425 msgid "" "Remove (delete) the file *path*. This function is semantically identical " "to :func:`remove`; the ``unlink`` name is its traditional Unix name. Please " "see the documentation for :func:`remove` for further information." msgstr "" -#: ../../library/os.rst:3445 +#: ../../library/os.rst:3441 msgid "Set the access and modified times of the file specified by *path*." msgstr "" -#: ../../library/os.rst:3447 +#: ../../library/os.rst:3443 msgid "" ":func:`utime` takes two optional parameters, *times* and *ns*. These specify " "the times set on *path* and are used as follows:" msgstr "" -#: ../../library/os.rst:3450 +#: ../../library/os.rst:3446 msgid "" "If *ns* is specified, it must be a 2-tuple of the form ``(atime_ns, " "mtime_ns)`` where each member is an int expressing nanoseconds." msgstr "" -#: ../../library/os.rst:3453 +#: ../../library/os.rst:3449 msgid "" "If *times* is not ``None``, it must be a 2-tuple of the form ``(atime, " "mtime)`` where each member is an int or float expressing seconds." msgstr "" -#: ../../library/os.rst:3456 +#: ../../library/os.rst:3452 msgid "" "If *times* is ``None`` and *ns* is unspecified, this is equivalent to " "specifying ``ns=(atime_ns, mtime_ns)`` where both times are the current time." msgstr "" -#: ../../library/os.rst:3460 +#: ../../library/os.rst:3456 msgid "It is an error to specify tuples for both *times* and *ns*." msgstr "" -#: ../../library/os.rst:3462 +#: ../../library/os.rst:3458 msgid "" "Note that the exact times you set here may not be returned by a subsequent :" "func:`~os.stat` call, depending on the resolution with which your operating " @@ -3866,7 +3866,7 @@ msgid "" "func:`utime`." msgstr "" -#: ../../library/os.rst:3473 +#: ../../library/os.rst:3469 msgid "" "Raises an :ref:`auditing event ` ``os.utime`` with arguments " "``path``, ``times``, ``ns``, ``dir_fd``." @@ -3874,13 +3874,13 @@ msgstr "" "引發一個附帶引數 ``path``、``times``、``ns``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.utime``。" -#: ../../library/os.rst:3475 +#: ../../library/os.rst:3471 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd*, *follow_symlinks*, and *ns* parameters." msgstr "" -#: ../../library/os.rst:3489 +#: ../../library/os.rst:3485 msgid "" "Generate the file names in a directory tree by walking the tree either top-" "down or bottom-up. For each directory in the tree rooted at directory *top* " @@ -3888,7 +3888,7 @@ msgid "" "filenames)``." msgstr "" -#: ../../library/os.rst:3494 +#: ../../library/os.rst:3490 msgid "" "*dirpath* is a string, the path to the directory. *dirnames* is a list of " "the names of the subdirectories in *dirpath* (including symlinks to " @@ -3902,7 +3902,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:3505 +#: ../../library/os.rst:3501 msgid "" "If optional argument *topdown* is ``True`` or not specified, the triple for " "a directory is generated before the triples for any of its subdirectories " @@ -3913,7 +3913,7 @@ msgid "" "its subdirectories are generated." msgstr "" -#: ../../library/os.rst:3513 +#: ../../library/os.rst:3509 msgid "" "When *topdown* is ``True``, the caller can modify the *dirnames* list in-" "place (perhaps using :keyword:`del` or slice assignment), and :func:`walk` " @@ -3926,7 +3926,7 @@ msgid "" "itself is generated." msgstr "" -#: ../../library/os.rst:3522 +#: ../../library/os.rst:3518 msgid "" "By default, errors from the :func:`scandir` call are ignored. If optional " "argument *onerror* is specified, it should be a function; it will be called " @@ -3936,42 +3936,42 @@ msgid "" "object." msgstr "" -#: ../../library/os.rst:3528 +#: ../../library/os.rst:3524 msgid "" "By default, :func:`walk` will not walk down into symbolic links that resolve " "to directories. Set *followlinks* to ``True`` to visit directories pointed " "to by symlinks, on systems that support them." msgstr "" -#: ../../library/os.rst:3534 +#: ../../library/os.rst:3530 msgid "" "Be aware that setting *followlinks* to ``True`` can lead to infinite " "recursion if a link points to a parent directory of itself. :func:`walk` " "does not keep track of the directories it visited already." msgstr "" -#: ../../library/os.rst:3540 +#: ../../library/os.rst:3536 msgid "" "If you pass a relative pathname, don't change the current working directory " "between resumptions of :func:`walk`. :func:`walk` never changes the current " "directory, and assumes that its caller doesn't either." msgstr "" -#: ../../library/os.rst:3544 ../../library/os.rst:3605 +#: ../../library/os.rst:3540 ../../library/os.rst:3601 msgid "" "This example displays the number of bytes taken by non-directory files in " "each directory under the starting directory, except that it doesn't look " "under any CVS subdirectory::" msgstr "" -#: ../../library/os.rst:3557 +#: ../../library/os.rst:3553 msgid "" "In the next example (simple implementation of :func:`shutil.rmtree`), " "walking the tree bottom-up is essential, :func:`rmdir` doesn't allow " "deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:3572 +#: ../../library/os.rst:3568 msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." @@ -3979,25 +3979,25 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``followlinks`` 的\\ :" "ref:`稽核事件 ` ``os.walk``。" -#: ../../library/os.rst:3574 +#: ../../library/os.rst:3570 msgid "" "This function now calls :func:`os.scandir` instead of :func:`os.listdir`, " "making it faster by reducing the number of calls to :func:`os.stat`." msgstr "" -#: ../../library/os.rst:3588 +#: ../../library/os.rst:3584 msgid "" "This behaves exactly like :func:`walk`, except that it yields a 4-tuple " "``(dirpath, dirnames, filenames, dirfd)``, and it supports ``dir_fd``." msgstr "" -#: ../../library/os.rst:3591 +#: ../../library/os.rst:3587 msgid "" "*dirpath*, *dirnames* and *filenames* are identical to :func:`walk` output, " "and *dirfd* is a file descriptor referring to the directory *dirpath*." msgstr "" -#: ../../library/os.rst:3594 +#: ../../library/os.rst:3590 msgid "" "This function always supports :ref:`paths relative to directory descriptors " "` and :ref:`not following symlinks `. Note however " @@ -4005,20 +4005,20 @@ msgid "" "*follow_symlinks* is ``False``." msgstr "" -#: ../../library/os.rst:3601 +#: ../../library/os.rst:3597 msgid "" "Since :func:`fwalk` yields file descriptors, those are only valid until the " "next iteration step, so you should duplicate them (e.g. with :func:`dup`) if " "you want to keep them longer." msgstr "" -#: ../../library/os.rst:3618 +#: ../../library/os.rst:3614 msgid "" "In the next example, walking the tree bottom-up is essential: :func:`rmdir` " "doesn't allow deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:3633 +#: ../../library/os.rst:3629 msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." @@ -4026,11 +4026,11 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``follow_symlinks``、" "``dir_fd`` 的\\ :ref:`稽核事件 ` ``os.fwalk``。" -#: ../../library/os.rst:3642 +#: ../../library/os.rst:3638 msgid "Added support for :class:`bytes` paths." msgstr "新增對 :class:`bytes` 路徑的支援。" -#: ../../library/os.rst:3648 +#: ../../library/os.rst:3644 msgid "" "Create an anonymous file and return a file descriptor that refers to it. " "*flags* must be one of the ``os.MFD_*`` constants available on the system " @@ -4038,7 +4038,7 @@ msgid "" "descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3653 +#: ../../library/os.rst:3649 msgid "" "The name supplied in *name* is used as a filename and will be displayed as " "the target of the corresponding symbolic link in the directory ``/proc/self/" @@ -4048,23 +4048,23 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3660 +#: ../../library/os.rst:3656 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27." msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上。" -#: ../../library/os.rst:3683 +#: ../../library/os.rst:3679 msgid "These flags can be passed to :func:`memfd_create`." msgstr "這些旗標可以傳給 :func:`memfd_create`。" -#: ../../library/os.rst:3685 +#: ../../library/os.rst:3681 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27" msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上" -#: ../../library/os.rst:3687 +#: ../../library/os.rst:3683 msgid "The ``MFD_HUGE*`` flags are only available since Linux 4.14." msgstr "``MFD_HUGE*`` 旗標僅在 Linux 4.14 以上可用。" -#: ../../library/os.rst:3694 +#: ../../library/os.rst:3690 msgid "" "Create and return an event file descriptor. The file descriptors supports " "raw :func:`read` and :func:`write` with a buffer size of 8, :func:`~select." @@ -4073,7 +4073,7 @@ msgid "" "ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3700 +#: ../../library/os.rst:3696 msgid "" "*initval* is the initial value of the event counter. The initial value must " "be an 32 bit unsigned integer. Please note that the initial value is limited " @@ -4081,87 +4081,87 @@ msgid "" "integer with a maximum value of 2\\ :sup:`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3705 +#: ../../library/os.rst:3701 msgid "" "*flags* can be constructed from :const:`EFD_CLOEXEC`, :const:`EFD_NONBLOCK`, " "and :const:`EFD_SEMAPHORE`." msgstr "" -#: ../../library/os.rst:3708 +#: ../../library/os.rst:3704 msgid "" "If :const:`EFD_SEMAPHORE` is specified and the event counter is non-zero, :" "func:`eventfd_read` returns 1 and decrements the counter by one." msgstr "" -#: ../../library/os.rst:3711 +#: ../../library/os.rst:3707 msgid "" "If :const:`EFD_SEMAPHORE` is not specified and the event counter is non-" "zero, :func:`eventfd_read` returns the current event counter value and " "resets the counter to zero." msgstr "" -#: ../../library/os.rst:3715 +#: ../../library/os.rst:3711 msgid "" "If the event counter is zero and :const:`EFD_NONBLOCK` is not specified, :" "func:`eventfd_read` blocks." msgstr "" -#: ../../library/os.rst:3718 +#: ../../library/os.rst:3714 msgid "" ":func:`eventfd_write` increments the event counter. Write blocks if the " "write operation would increment the counter to a value larger than 2\\ :sup:" "`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3739 +#: ../../library/os.rst:3735 msgid ":ref:`Availability `: Linux >= 2.6.27 with glibc >= 2.8" msgstr ":ref:`適用 `:Linux 2.6.27 以上且具有 glibc 2.8 以上" -#: ../../library/os.rst:3745 +#: ../../library/os.rst:3741 msgid "" "Read value from an :func:`eventfd` file descriptor and return a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3748 ../../library/os.rst:3757 -#: ../../library/os.rst:3765 ../../library/os.rst:3774 +#: ../../library/os.rst:3744 ../../library/os.rst:3753 +#: ../../library/os.rst:3761 ../../library/os.rst:3770 msgid ":ref:`Availability `: Linux >= 2.6.27" msgstr ":ref:`適用 `:Linux 2.6.27 以上" -#: ../../library/os.rst:3754 +#: ../../library/os.rst:3750 msgid "" "Add value to an :func:`eventfd` file descriptor. *value* must be a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3763 +#: ../../library/os.rst:3759 msgid "Set close-on-exec flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3771 +#: ../../library/os.rst:3767 msgid "" "Set :const:`O_NONBLOCK` status flag for new :func:`eventfd` file descriptor." msgstr "設定新的 :func:`eventfd` 檔案描述器的 :const:`O_NONBLOCK` 狀態旗標。" -#: ../../library/os.rst:3780 +#: ../../library/os.rst:3776 msgid "" "Provide semaphore-like semantics for reads from a :func:`eventfd` file " "descriptor. On read the internal counter is decremented by one." msgstr "" -#: ../../library/os.rst:3783 +#: ../../library/os.rst:3779 msgid ":ref:`Availability `: Linux >= 2.6.30" msgstr ":ref:`適用 `:Linux 2.6.30 以上" -#: ../../library/os.rst:3789 +#: ../../library/os.rst:3785 msgid "Linux extended attributes" msgstr "" -#: ../../library/os.rst:3793 +#: ../../library/os.rst:3789 msgid "These functions are all available on Linux only." msgstr "" -#: ../../library/os.rst:3797 +#: ../../library/os.rst:3793 msgid "" "Return the value of the extended filesystem attribute *attribute* for " "*path*. *attribute* can be bytes or str (directly or indirectly through the :" @@ -4169,7 +4169,7 @@ msgid "" "encoding." msgstr "" -#: ../../library/os.rst:3805 +#: ../../library/os.rst:3801 msgid "" "Raises an :ref:`auditing event ` ``os.getxattr`` with arguments " "``path``, ``attribute``." @@ -4177,12 +4177,12 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.getxattr``。" -#: ../../library/os.rst:3807 ../../library/os.rst:3839 -#: ../../library/os.rst:3864 +#: ../../library/os.rst:3803 ../../library/os.rst:3835 +#: ../../library/os.rst:3860 msgid "Accepts a :term:`path-like object` for *path* and *attribute*." msgstr "" -#: ../../library/os.rst:3813 +#: ../../library/os.rst:3809 msgid "" "Return a list of the extended filesystem attributes on *path*. The " "attributes in the list are represented as strings decoded with the " @@ -4190,14 +4190,14 @@ msgid "" "the current directory." msgstr "" -#: ../../library/os.rst:3821 +#: ../../library/os.rst:3817 msgid "" "Raises an :ref:`auditing event ` ``os.listxattr`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listxattr``。" -#: ../../library/os.rst:3829 +#: ../../library/os.rst:3825 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " "*attribute* should be bytes or str (directly or indirectly through the :" @@ -4205,7 +4205,7 @@ msgid "" "`filesystem encoding and error handler`." msgstr "" -#: ../../library/os.rst:3837 +#: ../../library/os.rst:3833 msgid "" "Raises an :ref:`auditing event ` ``os.removexattr`` with arguments " "``path``, ``attribute``." @@ -4213,7 +4213,7 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.removexattr``。" -#: ../../library/os.rst:3845 +#: ../../library/os.rst:3841 msgid "" "Set the extended filesystem attribute *attribute* on *path* to *value*. " "*attribute* must be a bytes or str with no embedded NULs (directly or " @@ -4225,13 +4225,13 @@ msgid "" "will not be created and ``EEXISTS`` will be raised." msgstr "" -#: ../../library/os.rst:3859 +#: ../../library/os.rst:3855 msgid "" "A bug in Linux kernel versions less than 2.6.39 caused the flags argument to " "be ignored on some filesystems." msgstr "" -#: ../../library/os.rst:3862 +#: ../../library/os.rst:3858 msgid "" "Raises an :ref:`auditing event ` ``os.setxattr`` with arguments " "``path``, ``attribute``, ``value``, ``flags``." @@ -4239,33 +4239,33 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute``、``value``、``flags`` 的\\ :ref:`稽" "核事件 ` ``os.setxattr``。" -#: ../../library/os.rst:3870 +#: ../../library/os.rst:3866 msgid "" "The maximum size the value of an extended attribute can be. Currently, this " "is 64 KiB on Linux." msgstr "" -#: ../../library/os.rst:3876 +#: ../../library/os.rst:3872 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must create an attribute." msgstr "" -#: ../../library/os.rst:3882 +#: ../../library/os.rst:3878 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must replace an existing attribute." msgstr "" -#: ../../library/os.rst:3889 +#: ../../library/os.rst:3885 msgid "Process Management" msgstr "行程管理" -#: ../../library/os.rst:3891 +#: ../../library/os.rst:3887 msgid "These functions may be used to create and manage processes." msgstr "" -#: ../../library/os.rst:3893 +#: ../../library/os.rst:3889 msgid "" "The various :func:`exec\\* ` functions take a list of arguments for " "the new program loaded into the process. In each case, the first of these " @@ -4276,7 +4276,7 @@ msgid "" "standard output; ``foo`` will seem to be ignored." msgstr "" -#: ../../library/os.rst:3904 +#: ../../library/os.rst:3900 msgid "" "Generate a :const:`SIGABRT` signal to the current process. On Unix, the " "default behavior is to produce a core dump; on Windows, the process " @@ -4285,31 +4285,31 @@ msgid "" "`SIGABRT` with :func:`signal.signal`." msgstr "" -#: ../../library/os.rst:3913 +#: ../../library/os.rst:3909 msgid "Add a path to the DLL search path." msgstr "" -#: ../../library/os.rst:3915 +#: ../../library/os.rst:3911 msgid "" "This search path is used when resolving dependencies for imported extension " "modules (the module itself is resolved through :data:`sys.path`), and also " "by :mod:`ctypes`." msgstr "" -#: ../../library/os.rst:3919 +#: ../../library/os.rst:3915 msgid "" "Remove the directory by calling **close()** on the returned object or using " "it in a :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:3922 +#: ../../library/os.rst:3918 msgid "" "See the `Microsoft documentation `_ for more information about how " "DLLs are loaded." msgstr "" -#: ../../library/os.rst:3926 +#: ../../library/os.rst:3922 msgid "" "Raises an :ref:`auditing event ` ``os.add_dll_directory`` with " "argument ``path``." @@ -4317,7 +4317,7 @@ msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os." "add_dll_directory``。" -#: ../../library/os.rst:3930 +#: ../../library/os.rst:3926 msgid "" "Previous versions of CPython would resolve DLLs using the default behavior " "for the current process. This led to inconsistencies, such as only sometimes " @@ -4325,14 +4325,14 @@ msgid "" "such as ``AddDllDirectory`` having no effect." msgstr "" -#: ../../library/os.rst:3937 +#: ../../library/os.rst:3933 msgid "" "In 3.8, the two primary ways DLLs are loaded now explicitly override the " "process-wide behavior to ensure consistency. See the :ref:`porting notes " "` for information on updating libraries." msgstr "" -#: ../../library/os.rst:3952 +#: ../../library/os.rst:3948 msgid "" "These functions all execute a new program, replacing the current process; " "they do not return. On Unix, the new executable is loaded into the current " @@ -4340,7 +4340,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" -#: ../../library/os.rst:3957 +#: ../../library/os.rst:3953 msgid "" "The current process is replaced immediately. Open file objects and " "descriptors are not flushed, so if there may be data buffered on these open " @@ -4348,7 +4348,7 @@ msgid "" "fsync` before calling an :func:`exec\\* ` function." msgstr "" -#: ../../library/os.rst:3963 +#: ../../library/os.rst:3959 msgid "" "The \"l\" and \"v\" variants of the :func:`exec\\* ` functions differ " "in how command-line arguments are passed. The \"l\" variants are perhaps " @@ -4361,7 +4361,7 @@ msgid "" "is not enforced." msgstr "" -#: ../../library/os.rst:3972 +#: ../../library/os.rst:3968 msgid "" "The variants which include a \"p\" near the end (:func:`execlp`, :func:" "`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " @@ -4375,7 +4375,7 @@ msgid "" "even on Windows, as plain names will not be resolved." msgstr "" -#: ../../library/os.rst:3983 +#: ../../library/os.rst:3979 msgid "" "For :func:`execle`, :func:`execlpe`, :func:`execve`, and :func:`execvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -4385,7 +4385,7 @@ msgid "" "process to inherit the environment of the current process." msgstr "" -#: ../../library/os.rst:3990 +#: ../../library/os.rst:3986 msgid "" "For :func:`execve` on some platforms, *path* may also be specified as an " "open file descriptor. This functionality may not be supported on your " @@ -4394,7 +4394,7 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:3995 +#: ../../library/os.rst:3991 msgid "" "Raises an :ref:`auditing event ` ``os.exec`` with arguments " "``path``, ``args``, ``env``." @@ -4402,25 +4402,25 @@ msgstr "" "引發一個附帶引數 ``path``、``args``、``env`` 的\\ :ref:`稽核事件 ` " "``os.exec``。" -#: ../../library/os.rst:3999 +#: ../../library/os.rst:3995 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4008 +#: ../../library/os.rst:4004 msgid "" "Exit the process with status *n*, without calling cleanup handlers, flushing " "stdio buffers, etc." msgstr "" -#: ../../library/os.rst:4013 +#: ../../library/os.rst:4009 msgid "" "The standard way to exit is :func:`sys.exit(n) `. :func:`!_exit` " "should normally only be used in the child process after a :func:`fork`." msgstr "" -#: ../../library/os.rst:4016 +#: ../../library/os.rst:4012 msgid "" "The following exit codes are defined and can be used with :func:`_exit`, " "although they are not required. These are typically used for system " @@ -4428,139 +4428,139 @@ msgid "" "delivery program." msgstr "" -#: ../../library/os.rst:4022 +#: ../../library/os.rst:4018 msgid "" "Some of these may not be available on all Unix platforms, since there is " "some variation. These constants are defined where they are defined by the " "underlying platform." msgstr "" -#: ../../library/os.rst:4029 +#: ../../library/os.rst:4025 msgid "" "Exit code that means no error occurred. May be taken from the defined value " "of ``EXIT_SUCCESS`` on some platforms. Generally has a value of zero." msgstr "" -#: ../../library/os.rst:4037 +#: ../../library/os.rst:4033 msgid "" "Exit code that means the command was used incorrectly, such as when the " "wrong number of arguments are given." msgstr "" -#: ../../library/os.rst:4045 +#: ../../library/os.rst:4041 msgid "Exit code that means the input data was incorrect." msgstr "" -#: ../../library/os.rst:4052 +#: ../../library/os.rst:4048 msgid "Exit code that means an input file did not exist or was not readable." msgstr "" -#: ../../library/os.rst:4059 +#: ../../library/os.rst:4055 msgid "Exit code that means a specified user did not exist." msgstr "" -#: ../../library/os.rst:4066 +#: ../../library/os.rst:4062 msgid "Exit code that means a specified host did not exist." msgstr "" -#: ../../library/os.rst:4073 +#: ../../library/os.rst:4069 msgid "Exit code that means that a required service is unavailable." msgstr "" -#: ../../library/os.rst:4080 +#: ../../library/os.rst:4076 msgid "Exit code that means an internal software error was detected." msgstr "" -#: ../../library/os.rst:4087 +#: ../../library/os.rst:4083 msgid "" "Exit code that means an operating system error was detected, such as the " "inability to fork or create a pipe." msgstr "" -#: ../../library/os.rst:4095 +#: ../../library/os.rst:4091 msgid "" "Exit code that means some system file did not exist, could not be opened, or " "had some other kind of error." msgstr "" -#: ../../library/os.rst:4103 +#: ../../library/os.rst:4099 msgid "Exit code that means a user specified output file could not be created." msgstr "" -#: ../../library/os.rst:4110 +#: ../../library/os.rst:4106 msgid "" "Exit code that means that an error occurred while doing I/O on some file." msgstr "" -#: ../../library/os.rst:4117 +#: ../../library/os.rst:4113 msgid "" "Exit code that means a temporary failure occurred. This indicates something " "that may not really be an error, such as a network connection that couldn't " "be made during a retryable operation." msgstr "" -#: ../../library/os.rst:4126 +#: ../../library/os.rst:4122 msgid "" "Exit code that means that a protocol exchange was illegal, invalid, or not " "understood." msgstr "" -#: ../../library/os.rst:4134 +#: ../../library/os.rst:4130 msgid "" "Exit code that means that there were insufficient permissions to perform the " "operation (but not intended for file system problems)." msgstr "" -#: ../../library/os.rst:4142 +#: ../../library/os.rst:4138 msgid "Exit code that means that some kind of configuration error occurred." msgstr "" -#: ../../library/os.rst:4149 +#: ../../library/os.rst:4145 msgid "Exit code that means something like \"an entry was not found\"." msgstr "" -#: ../../library/os.rst:4156 +#: ../../library/os.rst:4152 msgid "" "Fork a child process. Return ``0`` in the child and the child's process id " "in the parent. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4159 +#: ../../library/os.rst:4155 msgid "" "Note that some platforms including FreeBSD <= 6.3 and Cygwin have known " "issues when using ``fork()`` from a thread." msgstr "" -#: ../../library/os.rst:4162 +#: ../../library/os.rst:4158 msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.fork``。" -#: ../../library/os.rst:4166 +#: ../../library/os.rst:4162 msgid "" "If you use TLS sockets in an application calling ``fork()``, see the warning " "in the :mod:`ssl` documentation." msgstr "" -#: ../../library/os.rst:4171 ../../library/os.rst:4215 +#: ../../library/os.rst:4167 ../../library/os.rst:4211 msgid "" "On macOS the use of this function is unsafe when mixed with using higher-" "level system APIs, and that includes using :mod:`urllib.request`." msgstr "" -#: ../../library/os.rst:4174 +#: ../../library/os.rst:4170 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4178 +#: ../../library/os.rst:4174 msgid "" "If Python is able to detect that your process has multiple threads, :func:" "`os.fork` now raises a :exc:`DeprecationWarning`." msgstr "" -#: ../../library/os.rst:4182 +#: ../../library/os.rst:4178 msgid "" "We chose to surface this as a warning, when detectable, to better inform " "developers of a design problem that the POSIX platform specifically notes as " @@ -4571,25 +4571,25 @@ msgid "" "``free``)." msgstr "" -#: ../../library/os.rst:4191 +#: ../../library/os.rst:4187 msgid "" "Users of macOS or users of libc or malloc implementations other than those " "typically found in glibc to date are among those already more likely to " "experience deadlocks running such code." msgstr "" -#: ../../library/os.rst:4195 +#: ../../library/os.rst:4191 msgid "" "See `this discussion on fork being incompatible with threads `_ for technical details of why we're surfacing " "this longstanding platform compatibility problem to developers." msgstr "" -#: ../../library/os.rst:4200 ../../library/os.rst:4447 +#: ../../library/os.rst:4196 ../../library/os.rst:4443 msgid ":ref:`Availability `: POSIX, not Emscripten, not WASI." msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" -#: ../../library/os.rst:4205 +#: ../../library/os.rst:4201 msgid "" "Fork a child process, using a new pseudo-terminal as the child's controlling " "terminal. Return a pair of ``(pid, fd)``, where *pid* is ``0`` in the child, " @@ -4598,11 +4598,17 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4211 +#: ../../library/os.rst:4207 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.forkpty``。" +#: ../../library/os.rst:4214 +msgid "" +"Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" +"`RuntimeError` is raised)." +msgstr "" + #: ../../library/os.rst:4218 msgid "" "If Python is able to detect that your process has multiple threads, this now " @@ -4610,19 +4616,13 @@ msgid "" "fork`." msgstr "" -#: ../../library/os.rst:4223 -msgid "" -"Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" -"`RuntimeError` is raised)." -msgstr "" - -#: ../../library/os.rst:4236 +#: ../../library/os.rst:4232 msgid "" "Send signal *sig* to the process *pid*. Constants for the specific signals " "available on the host platform are defined in the :mod:`signal` module." msgstr "" -#: ../../library/os.rst:4239 +#: ../../library/os.rst:4235 msgid "" "Windows: The :const:`signal.CTRL_C_EVENT` and :const:`signal." "CTRL_BREAK_EVENT` signals are special signals which can only be sent to " @@ -4633,11 +4633,11 @@ msgid "" "process handles to be killed." msgstr "" -#: ../../library/os.rst:4247 +#: ../../library/os.rst:4243 msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`\\ 。" -#: ../../library/os.rst:4249 +#: ../../library/os.rst:4245 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." @@ -4645,11 +4645,11 @@ msgstr "" "引發一個附帶引數 ``pid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "kill``。" -#: ../../library/os.rst:4263 +#: ../../library/os.rst:4259 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:4265 +#: ../../library/os.rst:4261 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." @@ -4657,27 +4657,27 @@ msgstr "" "引發一個附帶引數 ``pgid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "killpg``。" -#: ../../library/os.rst:4272 +#: ../../library/os.rst:4268 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:4279 +#: ../../library/os.rst:4275 msgid "" "Return a file descriptor referring to the process *pid* with *flags* set. " "This descriptor can be used to perform process management without races and " "signals." msgstr "" -#: ../../library/os.rst:4283 +#: ../../library/os.rst:4279 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:4285 +#: ../../library/os.rst:4281 msgid ":ref:`Availability `: Linux >= 5.3" msgstr ":ref:`適用 `:Linux 5.3 以上" -#: ../../library/os.rst:4290 +#: ../../library/os.rst:4286 msgid "" "This flag indicates that the file descriptor will be non-blocking. If the " "process referred to by the file descriptor has not yet terminated, then an " @@ -4685,17 +4685,17 @@ msgid "" "immediately return the error :const:`~errno.EAGAIN` rather than blocking." msgstr "" -#: ../../library/os.rst:4295 +#: ../../library/os.rst:4291 msgid ":ref:`Availability `: Linux >= 5.10" msgstr ":ref:`適用 `:Linux 5.10 以上" -#: ../../library/os.rst:4301 +#: ../../library/os.rst:4297 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: ../../library/os.rst:4309 +#: ../../library/os.rst:4305 msgid "" "Open a pipe to or from command *cmd*. The return value is an open file " "object connected to the pipe, which can be read or written depending on " @@ -4705,7 +4705,7 @@ msgid "" "rather than bytes." msgstr "" -#: ../../library/os.rst:4317 +#: ../../library/os.rst:4313 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -4717,60 +4717,60 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:4327 +#: ../../library/os.rst:4323 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the ``close`` " "method result (exit status) into an exit code if it is not ``None``. On " "Windows, the ``close`` method result is directly the exit code (or ``None``)." msgstr "" -#: ../../library/os.rst:4332 +#: ../../library/os.rst:4328 msgid "" "This is implemented using :class:`subprocess.Popen`; see that class's " "documentation for more powerful ways to manage and communicate with " "subprocesses." msgstr "" -#: ../../library/os.rst:4336 +#: ../../library/os.rst:4332 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" -#: ../../library/os.rst:4339 +#: ../../library/os.rst:4335 msgid "" "The :ref:`Python UTF-8 Mode ` affects encodings used for *cmd* " "and pipe contents." msgstr "" -#: ../../library/os.rst:4342 +#: ../../library/os.rst:4338 msgid "" ":func:`popen` is a simple wrapper around :class:`subprocess.Popen`. Use :" "class:`subprocess.Popen` or :func:`subprocess.run` to control options like " "encodings." msgstr "" -#: ../../library/os.rst:4351 +#: ../../library/os.rst:4347 msgid "Wraps the :c:func:`!posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4353 +#: ../../library/os.rst:4349 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:4355 +#: ../../library/os.rst:4351 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4358 +#: ../../library/os.rst:4354 msgid "" "The *path* parameter is the path to the executable file. The *path* should " "contain a directory. Use :func:`posix_spawnp` to pass an executable file " "without directory." msgstr "" -#: ../../library/os.rst:4362 +#: ../../library/os.rst:4358 msgid "" "The *file_actions* argument may be a sequence of tuples describing actions " "to take on specific file descriptors in the child process between the C " @@ -4779,31 +4779,31 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:4370 +#: ../../library/os.rst:4366 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" -#: ../../library/os.rst:4372 +#: ../../library/os.rst:4368 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:4376 +#: ../../library/os.rst:4372 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSE``, *fd*)" -#: ../../library/os.rst:4378 +#: ../../library/os.rst:4374 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:4382 +#: ../../library/os.rst:4378 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" -#: ../../library/os.rst:4384 +#: ../../library/os.rst:4380 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:4386 +#: ../../library/os.rst:4382 msgid "" "These tuples correspond to the C library :c:func:`!" "posix_spawn_file_actions_addopen`, :c:func:`!" @@ -4812,7 +4812,7 @@ msgid "" "`!posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:4392 +#: ../../library/os.rst:4388 msgid "" "The *setpgroup* argument will set the process group of the child to the " "value specified. If the value specified is 0, the child's process group ID " @@ -4821,7 +4821,7 @@ msgid "" "corresponds to the C library :c:macro:`!POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:4398 +#: ../../library/os.rst:4394 msgid "" "If the *resetids* argument is ``True`` it will reset the effective UID and " "GID of the child to the real UID and GID of the parent process. If the " @@ -4832,7 +4832,7 @@ msgid "" "library :c:macro:`!POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:4406 +#: ../../library/os.rst:4402 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " "``posix_spawn``. *setsid* requires :c:macro:`!POSIX_SPAWN_SETSID` or :c:" @@ -4840,7 +4840,7 @@ msgid "" "is raised." msgstr "" -#: ../../library/os.rst:4411 +#: ../../library/os.rst:4407 msgid "" "The *setsigmask* argument will set the signal mask to the signal set " "specified. If the parameter is not used, then the child inherits the " @@ -4848,14 +4848,14 @@ msgid "" "POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:4416 +#: ../../library/os.rst:4412 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " "specified. This argument corresponds to the C library :c:macro:`!" "POSIX_SPAWN_SETSIGDEF` flag." msgstr "" -#: ../../library/os.rst:4420 +#: ../../library/os.rst:4416 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " @@ -4865,7 +4865,7 @@ msgid "" "POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:4427 ../../library/os.rst:4443 +#: ../../library/os.rst:4423 ../../library/os.rst:4439 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." @@ -4873,72 +4873,72 @@ msgstr "" "引發一個附帶引數 ``path``、``argv``、``env`` 的\\ :ref:`稽核事件 ` " "``os.posix_spawn``。" -#: ../../library/os.rst:4437 +#: ../../library/os.rst:4433 msgid "Wraps the :c:func:`!posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4439 +#: ../../library/os.rst:4435 msgid "" "Similar to :func:`posix_spawn` except that the system searches for the " "*executable* file in the list of directories specified by the :envvar:`PATH` " "environment variable (in the same way as for ``execvp(3)``)." msgstr "" -#: ../../library/os.rst:4449 +#: ../../library/os.rst:4445 msgid "See :func:`posix_spawn` documentation." msgstr "見 :func:`posix_spawn` 文件。" -#: ../../library/os.rst:4455 +#: ../../library/os.rst:4451 msgid "" "Register callables to be executed when a new child process is forked using :" "func:`os.fork` or similar process cloning APIs. The parameters are optional " "and keyword-only. Each specifies a different call point." msgstr "" -#: ../../library/os.rst:4460 +#: ../../library/os.rst:4456 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:4461 +#: ../../library/os.rst:4457 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:4463 +#: ../../library/os.rst:4459 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:4465 +#: ../../library/os.rst:4461 msgid "" "These calls are only made if control is expected to return to the Python " "interpreter. A typical :mod:`subprocess` launch will not trigger them as " "the child is not going to re-enter the interpreter." msgstr "" -#: ../../library/os.rst:4469 +#: ../../library/os.rst:4465 msgid "" "Functions registered for execution before forking are called in reverse " "registration order. Functions registered for execution after forking " "(either in the parent or in the child) are called in registration order." msgstr "" -#: ../../library/os.rst:4474 +#: ../../library/os.rst:4470 msgid "" "Note that :c:func:`fork` calls made by third-party C code may not call those " "functions, unless it explicitly calls :c:func:`PyOS_BeforeFork`, :c:func:" "`PyOS_AfterFork_Parent` and :c:func:`PyOS_AfterFork_Child`." msgstr "" -#: ../../library/os.rst:4478 +#: ../../library/os.rst:4474 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:4494 +#: ../../library/os.rst:4490 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:4496 +#: ../../library/os.rst:4492 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -4946,7 +4946,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:4501 +#: ../../library/os.rst:4497 msgid "" "If *mode* is :const:`P_NOWAIT`, this function returns the process id of the " "new process; if *mode* is :const:`P_WAIT`, returns the process's exit code " @@ -4955,13 +4955,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:4507 +#: ../../library/os.rst:4503 msgid "" "Note on VxWorks, this function doesn't return ``-signal`` when the new " "process is killed. Instead it raises OSError exception." msgstr "" -#: ../../library/os.rst:4510 +#: ../../library/os.rst:4506 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -4973,7 +4973,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:4519 +#: ../../library/os.rst:4515 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -4986,7 +4986,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:4529 +#: ../../library/os.rst:4525 msgid "" "For :func:`spawnle`, :func:`spawnlpe`, :func:`spawnve`, and :func:`spawnvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -4998,13 +4998,13 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:4538 +#: ../../library/os.rst:4534 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" msgstr "" -#: ../../library/os.rst:4547 +#: ../../library/os.rst:4543 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." @@ -5012,7 +5012,7 @@ msgstr "" "引發一個附帶引數 ``mode``、``path``、``args``、``env`` 的\\ :ref:`稽核事件 " "` ``os.spawn``。" -#: ../../library/os.rst:4551 +#: ../../library/os.rst:4547 msgid "" ":func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are " "not available on Windows. :func:`spawnle` and :func:`spawnve` are not " @@ -5020,7 +5020,7 @@ msgid "" "instead." msgstr "" -#: ../../library/os.rst:4563 +#: ../../library/os.rst:4559 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:" @@ -5028,7 +5028,7 @@ msgid "" "been created, with the process id as the return value." msgstr "" -#: ../../library/os.rst:4573 +#: ../../library/os.rst:4569 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\* " @@ -5037,7 +5037,7 @@ msgid "" "successful, or ``-signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:4585 +#: ../../library/os.rst:4581 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -5047,11 +5047,11 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:4596 +#: ../../library/os.rst:4592 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:4598 +#: ../../library/os.rst:4594 msgid "" "When *operation* is not specified, this acts like double-clicking the file " "in Windows Explorer, or giving the file name as an argument to the :program:" @@ -5059,7 +5059,7 @@ msgid "" "whatever application (if any) its extension is associated." msgstr "" -#: ../../library/os.rst:4603 +#: ../../library/os.rst:4599 msgid "" "When another *operation* is given, it must be a \"command verb\" that " "specifies what should be done with the file. Common verbs documented by " @@ -5067,28 +5067,28 @@ msgid "" "as well as ``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:4608 +#: ../../library/os.rst:4604 msgid "" "When launching an application, specify *arguments* to be passed as a single " "string. This argument may have no effect when using this function to launch " "a document." msgstr "" -#: ../../library/os.rst:4612 +#: ../../library/os.rst:4608 msgid "" "The default working directory is inherited, but may be overridden by the " "*cwd* argument. This should be an absolute path. A relative *path* will be " "resolved against this argument." msgstr "" -#: ../../library/os.rst:4616 +#: ../../library/os.rst:4612 msgid "" "Use *show_cmd* to override the default window style. Whether this has any " "effect will depend on the application being launched. Values are integers as " "supported by the Win32 :c:func:`!ShellExecute` function." msgstr "" -#: ../../library/os.rst:4620 +#: ../../library/os.rst:4616 msgid "" ":func:`startfile` returns as soon as the associated application is launched. " "There is no option to wait for the application to close, and no way to " @@ -5099,14 +5099,14 @@ msgid "" "encoded for Win32." msgstr "" -#: ../../library/os.rst:4628 +#: ../../library/os.rst:4624 msgid "" "To reduce interpreter startup overhead, the Win32 :c:func:`!ShellExecute` " "function is not resolved until this function is first called. If the " "function cannot be resolved, :exc:`NotImplementedError` will be raised." msgstr "" -#: ../../library/os.rst:4632 +#: ../../library/os.rst:4628 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." @@ -5114,7 +5114,7 @@ msgstr "" "引發一個附帶引數 ``path``、``operation`` 的\\ :ref:`稽核事件 ` " "``os.startfile``。" -#: ../../library/os.rst:4634 +#: ../../library/os.rst:4630 msgid "" "Raises an :ref:`auditing event ` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." @@ -5122,13 +5122,13 @@ msgstr "" "引發一個附帶引數 ``path``、``operation``、``arguments``、``cwd``、" "``show_cmd`` 的\\ :ref:`稽核事件 ` ``os.startfile/2``。" -#: ../../library/os.rst:4638 +#: ../../library/os.rst:4634 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: ../../library/os.rst:4645 +#: ../../library/os.rst:4641 msgid "" "Execute the command (a string) in a subshell. This is implemented by " "calling the Standard C function :c:func:`system`, and has the same " @@ -5139,13 +5139,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:4653 +#: ../../library/os.rst:4649 msgid "" "On Unix, the return value is the exit status of the process encoded in the " "format specified for :func:`wait`." msgstr "" -#: ../../library/os.rst:4656 +#: ../../library/os.rst:4652 msgid "" "On Windows, the return value is that returned by the system shell after " "running *command*. The shell is given by the Windows environment variable :" @@ -5154,7 +5154,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:4662 +#: ../../library/os.rst:4658 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is preferable " @@ -5162,54 +5162,54 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:4667 +#: ../../library/os.rst:4663 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the result " "(exit status) into an exit code. On Windows, the result is directly the exit " "code." msgstr "" -#: ../../library/os.rst:4671 +#: ../../library/os.rst:4667 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." msgstr "" "引發一個附帶引數 ``command`` 的\\ :ref:`稽核事件 ` ``os.system``。" -#: ../../library/os.rst:4678 +#: ../../library/os.rst:4674 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:4681 +#: ../../library/os.rst:4677 msgid ":attr:`!user` - user time" msgstr ":attr:`!user` - 使用者時間" -#: ../../library/os.rst:4682 +#: ../../library/os.rst:4678 msgid ":attr:`!system` - system time" msgstr ":attr:`!system` - 系統時間" -#: ../../library/os.rst:4683 +#: ../../library/os.rst:4679 msgid ":attr:`!children_user` - user time of all child processes" msgstr ":attr:`!children_user` - 所有子行程的使用者時間" -#: ../../library/os.rst:4684 +#: ../../library/os.rst:4680 msgid ":attr:`!children_system` - system time of all child processes" msgstr ":attr:`!children_system` - 所有子行程的系統時間" -#: ../../library/os.rst:4685 +#: ../../library/os.rst:4681 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:4687 +#: ../../library/os.rst:4683 msgid "" "For backwards compatibility, this object also behaves like a five-tuple " "containing :attr:`!user`, :attr:`!system`, :attr:`!children_user`, :attr:`!" "children_system`, and :attr:`!elapsed` in that order." msgstr "" -#: ../../library/os.rst:4691 +#: ../../library/os.rst:4687 msgid "" "See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " @@ -5219,7 +5219,7 @@ msgid "" "attributes are zero." msgstr "" -#: ../../library/os.rst:4705 +#: ../../library/os.rst:4701 msgid "" "Wait for completion of a child process, and return a tuple containing its " "pid and exit status indication: a 16-bit number, whose low byte is the " @@ -5228,87 +5228,87 @@ msgid "" "if a core file was produced." msgstr "" -#: ../../library/os.rst:4711 +#: ../../library/os.rst:4707 msgid "" "If there are no children that could be waited for, :exc:`ChildProcessError` " "is raised." msgstr "" -#: ../../library/os.rst:4714 ../../library/os.rst:4789 +#: ../../library/os.rst:4710 ../../library/os.rst:4785 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exit code." msgstr "" -#: ../../library/os.rst:4721 +#: ../../library/os.rst:4717 msgid "" "The other :func:`!wait*` functions documented below can be used to wait for " "the completion of a specific child process and have more options. :func:" "`waitpid` is the only one also available on Windows." msgstr "" -#: ../../library/os.rst:4728 +#: ../../library/os.rst:4724 msgid "Wait for the completion of a child process." msgstr "" -#: ../../library/os.rst:4730 +#: ../../library/os.rst:4726 msgid "" "*idtype* can be :data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or (on Linux) :" "data:`P_PIDFD`. The interpretation of *id* depends on it; see their " "individual descriptions." msgstr "" -#: ../../library/os.rst:4733 +#: ../../library/os.rst:4729 msgid "" "*options* is an OR combination of flags. At least one of :data:`WEXITED`, :" "data:`WSTOPPED` or :data:`WCONTINUED` is required; :data:`WNOHANG` and :data:" "`WNOWAIT` are additional optional flags." msgstr "" -#: ../../library/os.rst:4737 +#: ../../library/os.rst:4733 msgid "" "The return value is an object representing the data contained in the :c:type:" "`siginfo_t` structure with the following attributes:" msgstr "" -#: ../../library/os.rst:4740 +#: ../../library/os.rst:4736 msgid ":attr:`!si_pid` (process ID)" msgstr "" -#: ../../library/os.rst:4741 +#: ../../library/os.rst:4737 msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" -#: ../../library/os.rst:4742 +#: ../../library/os.rst:4738 msgid ":attr:`!si_signo` (always :const:`~signal.SIGCHLD`)" msgstr "" -#: ../../library/os.rst:4743 +#: ../../library/os.rst:4739 msgid "" ":attr:`!si_status` (the exit status or signal number, depending on :attr:`!" "si_code`)" msgstr "" -#: ../../library/os.rst:4744 +#: ../../library/os.rst:4740 msgid ":attr:`!si_code` (see :data:`CLD_EXITED` for possible values)" msgstr "" -#: ../../library/os.rst:4746 +#: ../../library/os.rst:4742 msgid "" "If :data:`WNOHANG` is specified and there are no matching children in the " "requested state, ``None`` is returned. Otherwise, if there are no matching " "children that could be waited for, :exc:`ChildProcessError` is raised." msgstr "" -#: ../../library/os.rst:4754 +#: ../../library/os.rst:4750 msgid "This function is not available on macOS." msgstr "" -#: ../../library/os.rst:4761 +#: ../../library/os.rst:4757 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:4763 +#: ../../library/os.rst:4759 msgid "" "On Unix: Wait for completion of a child process given by process id *pid*, " "and return a tuple containing its process id and exit status indication " @@ -5317,7 +5317,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:4768 +#: ../../library/os.rst:4764 msgid "" "If *pid* is greater than ``0``, :func:`waitpid` requests status information " "for that specific process. If *pid* is ``0``, the request is for the status " @@ -5327,7 +5327,7 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:4775 +#: ../../library/os.rst:4771 msgid "" "*options* is an OR combination of flags. If it contains :data:`WNOHANG` and " "there are no matching children in the requested state, ``(0, 0)`` is " @@ -5336,7 +5336,7 @@ msgid "" "are :data:`WUNTRACED` and :data:`WCONTINUED`." msgstr "" -#: ../../library/os.rst:4781 +#: ../../library/os.rst:4777 msgid "" "On Windows: Wait for completion of a process given by process handle *pid*, " "and return a tuple containing *pid*, and its exit status shifted left by 8 " @@ -5348,7 +5348,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:4802 +#: ../../library/os.rst:4798 msgid "" "Similar to :func:`waitpid`, except no process id argument is given and a 3-" "element tuple containing the child's process id, exit status indication, and " @@ -5357,13 +5357,13 @@ msgid "" "same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:4809 ../../library/os.rst:4823 +#: ../../library/os.rst:4805 ../../library/os.rst:4819 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:4817 +#: ../../library/os.rst:4813 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -5372,118 +5372,118 @@ msgid "" "to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:4834 +#: ../../library/os.rst:4830 msgid "" "These are the possible values for *idtype* in :func:`waitid`. They affect " "how *id* is interpreted:" msgstr "" -#: ../../library/os.rst:4837 +#: ../../library/os.rst:4833 msgid ":data:`!P_PID` - wait for the child whose PID is *id*." msgstr "" -#: ../../library/os.rst:4838 +#: ../../library/os.rst:4834 msgid ":data:`!P_PGID` - wait for any child whose progress group ID is *id*." msgstr "" -#: ../../library/os.rst:4839 +#: ../../library/os.rst:4835 msgid ":data:`!P_ALL` - wait for any child; *id* is ignored." msgstr "" -#: ../../library/os.rst:4840 +#: ../../library/os.rst:4836 msgid "" ":data:`!P_PIDFD` - wait for the child identified by the file descriptor *id* " "(a process file descriptor created with :func:`pidfd_open`)." msgstr "" -#: ../../library/os.rst:4845 +#: ../../library/os.rst:4841 msgid ":data:`!P_PIDFD` is only available on Linux >= 5.4." msgstr "" -#: ../../library/os.rst:4848 +#: ../../library/os.rst:4844 msgid "The :data:`!P_PIDFD` constant." msgstr "" -#: ../../library/os.rst:4854 +#: ../../library/os.rst:4850 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, :func:`wait4`, and :" "func:`waitid` causes child processes to be reported if they have been " "continued from a job control stop since they were last reported." msgstr "" -#: ../../library/os.rst:4863 +#: ../../library/os.rst:4859 msgid "" "This *options* flag for :func:`waitid` causes child processes that have " "terminated to be reported." msgstr "" -#: ../../library/os.rst:4866 +#: ../../library/os.rst:4862 msgid "" "The other ``wait*`` functions always report children that have terminated, " "so this option is not available for them." msgstr "" -#: ../../library/os.rst:4876 +#: ../../library/os.rst:4872 msgid "" "This *options* flag for :func:`waitid` causes child processes that have been " "stopped by the delivery of a signal to be reported." msgstr "" -#: ../../library/os.rst:4879 ../../library/os.rst:4911 +#: ../../library/os.rst:4875 ../../library/os.rst:4907 msgid "This option is not available for the other ``wait*`` functions." msgstr "" -#: ../../library/os.rst:4888 +#: ../../library/os.rst:4884 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, and :func:`wait4` " "causes child processes to also be reported if they have been stopped but " "their current state has not been reported since they were stopped." msgstr "" -#: ../../library/os.rst:4892 +#: ../../library/os.rst:4888 msgid "This option is not available for :func:`waitid`." msgstr "" -#: ../../library/os.rst:4899 +#: ../../library/os.rst:4895 msgid "" "This *options* flag causes :func:`waitpid`, :func:`wait3`, :func:`wait4`, " "and :func:`waitid` to return right away if no child process status is " "available immediately." msgstr "" -#: ../../library/os.rst:4908 +#: ../../library/os.rst:4904 msgid "" "This *options* flag causes :func:`waitid` to leave the child in a waitable " "state, so that a later :func:`!wait*` call can be used to retrieve the child " "status information again." msgstr "" -#: ../../library/os.rst:4923 +#: ../../library/os.rst:4919 msgid "" "These are the possible values for :attr:`!si_code` in the result returned " "by :func:`waitid`." msgstr "" -#: ../../library/os.rst:4930 +#: ../../library/os.rst:4926 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "" -#: ../../library/os.rst:4936 +#: ../../library/os.rst:4932 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:4938 +#: ../../library/os.rst:4934 msgid "On Unix:" msgstr "" -#: ../../library/os.rst:4940 +#: ../../library/os.rst:4936 msgid "" "If the process exited normally (if ``WIFEXITED(status)`` is true), return " "the process exit status (return ``WEXITSTATUS(status)``): result greater " "than or equal to 0." msgstr "" -#: ../../library/os.rst:4943 +#: ../../library/os.rst:4939 msgid "" "If the process was terminated by a signal (if ``WIFSIGNALED(status)`` is " "true), return ``-signum`` where *signum* is the number of the signal that " @@ -5491,15 +5491,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:4947 +#: ../../library/os.rst:4943 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: ../../library/os.rst:4949 +#: ../../library/os.rst:4945 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:4951 +#: ../../library/os.rst:4947 msgid "" "On Unix, if the process is being traced or if :func:`waitpid` was called " "with :data:`WUNTRACED` option, the caller must first check if " @@ -5507,221 +5507,221 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:4958 +#: ../../library/os.rst:4954 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:4966 +#: ../../library/os.rst:4962 msgid "" "The following functions take a process status code as returned by :func:" "`system`, :func:`wait`, or :func:`waitpid` as a parameter. They may be used " "to determine the disposition of a process." msgstr "" -#: ../../library/os.rst:4972 +#: ../../library/os.rst:4968 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:4975 ../../library/os.rst:5041 +#: ../../library/os.rst:4971 ../../library/os.rst:5037 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:4982 +#: ../../library/os.rst:4978 msgid "" "Return ``True`` if a stopped child has been resumed by delivery of :const:" "`~signal.SIGCONT` (if the process has been continued from a job control " "stop), otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4986 +#: ../../library/os.rst:4982 msgid "See :data:`WCONTINUED` option." msgstr "參閱 :data:`WCONTINUED` 選項。" -#: ../../library/os.rst:4993 +#: ../../library/os.rst:4989 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4996 +#: ../../library/os.rst:4992 msgid "" ":func:`WIFSTOPPED` only returns ``True`` if the :func:`waitpid` call was " "done using :data:`WUNTRACED` option or when the process is being traced " "(see :manpage:`ptrace(2)`)." msgstr "" -#: ../../library/os.rst:5004 +#: ../../library/os.rst:5000 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:5012 +#: ../../library/os.rst:5008 msgid "" "Return ``True`` if the process exited terminated normally, that is, by " "calling ``exit()`` or ``_exit()``, or by returning from ``main()``; " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:5021 +#: ../../library/os.rst:5017 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:5023 +#: ../../library/os.rst:5019 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:5030 +#: ../../library/os.rst:5026 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:5032 +#: ../../library/os.rst:5028 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:5039 +#: ../../library/os.rst:5035 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:5047 +#: ../../library/os.rst:5043 msgid "Interface to the scheduler" msgstr "" -#: ../../library/os.rst:5049 +#: ../../library/os.rst:5045 msgid "" "These functions control how a process is allocated CPU time by the operating " "system. They are only available on some Unix platforms. For more detailed " "information, consult your Unix manpages." msgstr "" -#: ../../library/os.rst:5055 +#: ../../library/os.rst:5051 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:5060 +#: ../../library/os.rst:5056 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:5064 +#: ../../library/os.rst:5060 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:5069 +#: ../../library/os.rst:5065 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:5073 +#: ../../library/os.rst:5069 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:5077 +#: ../../library/os.rst:5073 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:5081 +#: ../../library/os.rst:5077 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:5085 +#: ../../library/os.rst:5081 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:5092 +#: ../../library/os.rst:5088 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:5096 +#: ../../library/os.rst:5092 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:5100 +#: ../../library/os.rst:5096 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:5105 +#: ../../library/os.rst:5101 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5111 +#: ../../library/os.rst:5107 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5117 +#: ../../library/os.rst:5113 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:5124 +#: ../../library/os.rst:5120 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:5131 +#: ../../library/os.rst:5127 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:5137 +#: ../../library/os.rst:5133 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:5143 +#: ../../library/os.rst:5139 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:5149 +#: ../../library/os.rst:5145 msgid "Voluntarily relinquish the CPU." msgstr "" -#: ../../library/os.rst:5154 +#: ../../library/os.rst:5150 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:5161 +#: ../../library/os.rst:5157 msgid "Return the set of CPUs the process with PID *pid* is restricted to." msgstr "" -#: ../../library/os.rst:5163 +#: ../../library/os.rst:5159 msgid "" "If *pid* is zero, return the set of CPUs the calling thread of the current " "process is restricted to." msgstr "" -#: ../../library/os.rst:5170 +#: ../../library/os.rst:5166 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:5175 +#: ../../library/os.rst:5171 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 " @@ -5732,13 +5732,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:5183 +#: ../../library/os.rst:5179 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:5186 +#: ../../library/os.rst:5182 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 " @@ -5746,34 +5746,34 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:5196 +#: ../../library/os.rst:5192 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:5205 +#: ../../library/os.rst:5201 msgid "" "Return the number of logical CPUs in the system. Returns ``None`` if " "undetermined." msgstr "" -#: ../../library/os.rst:5208 +#: ../../library/os.rst:5204 msgid "" "This number is not equivalent to the number of logical CPUs the current " "process can use. ``len(os.sched_getaffinity(0))`` gets the number of logical " "CPUs the calling thread of the current process is restricted to" msgstr "" -#: ../../library/os.rst:5217 +#: ../../library/os.rst:5213 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:5226 +#: ../../library/os.rst:5222 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -5782,44 +5782,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:5236 +#: ../../library/os.rst:5232 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:5242 +#: ../../library/os.rst:5238 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: ../../library/os.rst:5245 +#: ../../library/os.rst:5241 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:5248 +#: ../../library/os.rst:5244 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:5254 +#: ../../library/os.rst:5250 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:5262 +#: ../../library/os.rst:5258 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:5271 +#: ../../library/os.rst:5267 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -5828,7 +5828,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5281 +#: ../../library/os.rst:5277 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -5836,27 +5836,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5290 +#: ../../library/os.rst:5286 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:5298 +#: ../../library/os.rst:5294 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:5305 +#: ../../library/os.rst:5301 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:5312 +#: ../../library/os.rst:5308 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 " @@ -5865,36 +5865,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:5321 +#: ../../library/os.rst:5317 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:5332 +#: ../../library/os.rst:5328 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:5340 +#: ../../library/os.rst:5336 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:5345 +#: ../../library/os.rst:5341 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:5348 +#: ../../library/os.rst:5344 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:5351 +#: ../../library/os.rst:5347 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -5902,36 +5902,36 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:5356 +#: ../../library/os.rst:5352 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:5360 +#: ../../library/os.rst:5356 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:5363 +#: ../../library/os.rst:5359 msgid ":ref:`Availability `: Linux >= 3.17." msgstr ":ref:`適用 `:Linux 3.17 以上。" -#: ../../library/os.rst:5369 +#: ../../library/os.rst:5365 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:5371 +#: ../../library/os.rst:5367 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:5375 +#: ../../library/os.rst:5371 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -5941,63 +5941,63 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:5382 +#: ../../library/os.rst:5378 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:5386 +#: ../../library/os.rst:5382 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: ../../library/os.rst:5389 +#: ../../library/os.rst:5385 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:5393 +#: ../../library/os.rst:5389 msgid "" -"On Linux, ``getrandom()`` is now used in blocking mode to increase the " -"security." +"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:5397 +#: ../../library/os.rst:5395 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:5401 +#: ../../library/os.rst:5399 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." +"On Linux, ``getrandom()`` is now used in blocking mode to increase the " +"security." msgstr "" -#: ../../library/os.rst:5407 +#: ../../library/os.rst:5403 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: ../../library/os.rst:5413 +#: ../../library/os.rst:5409 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:5417 +#: ../../library/os.rst:5413 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:5424 +#: ../../library/os.rst:5420 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." @@ -6013,7 +6013,7 @@ msgstr "" #: ../../library/os.rst:372 ../../library/os.rst:438 ../../library/os.rst:447 #: ../../library/os.rst:456 ../../library/os.rst:470 ../../library/os.rst:666 -#: ../../library/os.rst:4232 ../../library/os.rst:4259 +#: ../../library/os.rst:4228 ../../library/os.rst:4255 msgid "process" msgstr "process" @@ -6053,11 +6053,11 @@ msgstr "gethostname()(於 socket 模組)" msgid "gethostbyaddr() (in module socket)" msgstr "gethostbyaddr()(於 socket 模組)" -#: ../../library/os.rst:796 ../../library/os.rst:2578 +#: ../../library/os.rst:796 ../../library/os.rst:2577 msgid "deleting" msgstr "deleting(刪除)" -#: ../../library/os.rst:1338 ../../library/os.rst:2948 +#: ../../library/os.rst:1338 ../../library/os.rst:2947 msgid "module" msgstr "module(模組)" @@ -6066,8 +6066,8 @@ msgid "pty" msgstr "pty" #: ../../library/os.rst:1979 ../../library/os.rst:2376 -#: ../../library/os.rst:2578 ../../library/os.rst:3485 -#: ../../library/os.rst:3584 +#: ../../library/os.rst:2577 ../../library/os.rst:3481 +#: ../../library/os.rst:3580 msgid "directory" msgstr "directory(目錄)" @@ -6087,60 +6087,60 @@ msgstr "UNC paths(UNC 路徑)" msgid "and os.makedirs()" msgstr "以及 os.makedirs()" -#: ../../library/os.rst:2948 +#: ../../library/os.rst:2947 msgid "stat" msgstr "stat" -#: ../../library/os.rst:3485 ../../library/os.rst:3584 +#: ../../library/os.rst:3481 ../../library/os.rst:3580 msgid "walking" msgstr "" -#: ../../library/os.rst:3485 ../../library/os.rst:3584 +#: ../../library/os.rst:3481 ../../library/os.rst:3580 msgid "traversal" msgstr "traversal(遍歷)" -#: ../../library/os.rst:4232 ../../library/os.rst:4259 +#: ../../library/os.rst:4228 ../../library/os.rst:4255 msgid "killing" msgstr "" -#: ../../library/os.rst:4232 ../../library/os.rst:4259 +#: ../../library/os.rst:4228 ../../library/os.rst:4255 msgid "signalling" msgstr "signalling(信號)" -#: ../../library/os.rst:5251 ../../library/os.rst:5287 +#: ../../library/os.rst:5247 ../../library/os.rst:5283 msgid ". (dot)" msgstr ". (點)" -#: ../../library/os.rst:5251 ../../library/os.rst:5259 -#: ../../library/os.rst:5267 ../../library/os.rst:5278 -#: ../../library/os.rst:5287 +#: ../../library/os.rst:5247 ../../library/os.rst:5255 +#: ../../library/os.rst:5263 ../../library/os.rst:5274 +#: ../../library/os.rst:5283 msgid "in pathnames" msgstr "於 pathnames(路徑名稱)中" -#: ../../library/os.rst:5259 +#: ../../library/os.rst:5255 msgid ".." msgstr ".." -#: ../../library/os.rst:5267 ../../library/os.rst:5278 +#: ../../library/os.rst:5263 ../../library/os.rst:5274 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../library/os.rst:5268 +#: ../../library/os.rst:5264 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/os.rst:5268 +#: ../../library/os.rst:5264 msgid "in pathnames (Windows)" msgstr "in pathnames (Windows)(在路徑名稱中 (Windows))" -#: ../../library/os.rst:5294 +#: ../../library/os.rst:5290 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/os.rst:5294 +#: ../../library/os.rst:5290 msgid "path separator (POSIX)" msgstr "path separator (POSIX)(路徑分隔器 (POSIX))" -#: ../../library/os.rst:5294 +#: ../../library/os.rst:5290 msgid "; (semicolon)" msgstr "; (分號)" diff --git a/library/pdb.po b/library/pdb.po index f84d5529ed..ceffb0bc67 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-24 00:03+0000\n" +"POT-Creation-Date: 2024-03-07 17:26+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -346,17 +346,17 @@ msgstr "" #: ../../library/pdb.rst:291 msgid "" -":file:`.pdbrc` is now read with ``'utf-8'`` encoding. Previously, it was " -"read with the system locale encoding." -msgstr "" - -#: ../../library/pdb.rst:295 -msgid "" ":file:`.pdbrc` can now contain commands that continue debugging, such as :" "pdbcmd:`continue` or :pdbcmd:`next`. Previously, these commands had no " "effect." msgstr "" +#: ../../library/pdb.rst:296 +msgid "" +":file:`.pdbrc` is now read with ``'utf-8'`` encoding. Previously, it was " +"read with the system locale encoding." +msgstr "" + #: ../../library/pdb.rst:303 msgid "" "Without argument, print the list of available commands. With a *command* as " diff --git a/library/threading.po b/library/threading.po index 79afeb466f..eda693cb00 100644 --- a/library/threading.po +++ b/library/threading.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-27 00:04+0000\n" +"POT-Creation-Date: 2024-03-07 17:26+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-" @@ -485,12 +485,13 @@ msgid "" msgstr "" #: ../../library/threading.rst:363 -msgid "Use the *target* name if *name* argument is omitted." -msgstr "" +#, fuzzy +msgid "Added the *daemon* parameter." +msgstr "新增 *daemon* 引數。" #: ../../library/threading.rst:366 -msgid "Added the *daemon* argument." -msgstr "新增 *daemon* 引數。" +msgid "Use the *target* name if *name* argument is omitted." +msgstr "" #: ../../library/threading.rst:371 msgid "Start the thread's activity." diff --git a/library/time.po b/library/time.po index c9dd3924b6..163e61668a 100644 --- a/library/time.po +++ b/library/time.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-27 16:51+0000\n" +"POT-Creation-Date: 2024-03-07 17:26+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-" @@ -235,9 +235,9 @@ msgstr "" #: ../../library/time.rst:161 ../../library/time.rst:174 #: ../../library/time.rst:183 ../../library/time.rst:196 -#: ../../library/time.rst:205 ../../library/time.rst:717 -#: ../../library/time.rst:834 ../../library/time.rst:853 -#: ../../library/time.rst:881 ../../library/time.rst:916 +#: ../../library/time.rst:205 ../../library/time.rst:716 +#: ../../library/time.rst:833 ../../library/time.rst:852 +#: ../../library/time.rst:880 ../../library/time.rst:915 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -495,18 +495,18 @@ msgstr "" #: ../../library/time.rst:384 msgid "" -"On Unix, the ``clock_nanosleep()`` and ``nanosleep()`` functions are now " -"used if available. On Windows, a waitable timer is now used." -msgstr "" - -#: ../../library/time.rst:388 -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` " "for the rationale)." msgstr "" -#: ../../library/time.rst:399 +#: ../../library/time.rst:389 +msgid "" +"On Unix, the ``clock_nanosleep()`` and ``nanosleep()`` functions are now " +"used if available. On Windows, a waitable timer is now used." +msgstr "" + +#: ../../library/time.rst:398 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* " @@ -515,257 +515,257 @@ msgid "" "raised if any field in *t* is outside of the allowed range." msgstr "" -#: ../../library/time.rst:405 +#: ../../library/time.rst:404 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." msgstr "" -#: ../../library/time.rst:408 +#: ../../library/time.rst:407 msgid "" "The following directives can be embedded in the *format* string. They are " "shown without the optional field width and precision specification, and are " "replaced by the indicated characters in the :func:`strftime` result:" msgstr "" -#: ../../library/time.rst:413 +#: ../../library/time.rst:412 msgid "Directive" msgstr "" -#: ../../library/time.rst:413 +#: ../../library/time.rst:412 msgid "Meaning" msgstr "" -#: ../../library/time.rst:413 +#: ../../library/time.rst:412 msgid "Notes" msgstr "註解" -#: ../../library/time.rst:415 +#: ../../library/time.rst:414 msgid "``%a``" msgstr "``%a``" -#: ../../library/time.rst:415 +#: ../../library/time.rst:414 msgid "Locale's abbreviated weekday name." msgstr "" -#: ../../library/time.rst:418 +#: ../../library/time.rst:417 msgid "``%A``" msgstr "``%A``" -#: ../../library/time.rst:418 +#: ../../library/time.rst:417 msgid "Locale's full weekday name." msgstr "" -#: ../../library/time.rst:420 +#: ../../library/time.rst:419 msgid "``%b``" msgstr "``%b``" -#: ../../library/time.rst:420 +#: ../../library/time.rst:419 msgid "Locale's abbreviated month name." msgstr "" -#: ../../library/time.rst:423 +#: ../../library/time.rst:422 msgid "``%B``" msgstr "``%B``" -#: ../../library/time.rst:423 +#: ../../library/time.rst:422 msgid "Locale's full month name." msgstr "" -#: ../../library/time.rst:425 +#: ../../library/time.rst:424 msgid "``%c``" msgstr "``%c``" -#: ../../library/time.rst:425 +#: ../../library/time.rst:424 msgid "Locale's appropriate date and time representation." msgstr "" -#: ../../library/time.rst:428 +#: ../../library/time.rst:427 msgid "``%d``" msgstr "``%d``" -#: ../../library/time.rst:428 +#: ../../library/time.rst:427 msgid "Day of the month as a decimal number [01,31]." msgstr "" -#: ../../library/time.rst:431 +#: ../../library/time.rst:430 msgid "``%f``" msgstr "" -#: ../../library/time.rst:432 +#: ../../library/time.rst:431 msgid "Microseconds as a decimal number" msgstr "" -#: ../../library/time.rst:432 +#: ../../library/time.rst:431 msgid "[000000,999999]." msgstr "" -#: ../../library/time.rst:431 +#: ../../library/time.rst:430 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/time.rst:435 +#: ../../library/time.rst:434 msgid "``%H``" msgstr "``%H``" -#: ../../library/time.rst:435 +#: ../../library/time.rst:434 msgid "Hour (24-hour clock) as a decimal number [00,23]." msgstr "" -#: ../../library/time.rst:438 +#: ../../library/time.rst:437 msgid "``%I``" msgstr "``%I``" -#: ../../library/time.rst:438 +#: ../../library/time.rst:437 msgid "Hour (12-hour clock) as a decimal number [01,12]." msgstr "" -#: ../../library/time.rst:441 +#: ../../library/time.rst:440 msgid "``%j``" msgstr "``%j``" -#: ../../library/time.rst:441 +#: ../../library/time.rst:440 msgid "Day of the year as a decimal number [001,366]." msgstr "" -#: ../../library/time.rst:444 +#: ../../library/time.rst:443 msgid "``%m``" msgstr "``%m``" -#: ../../library/time.rst:444 +#: ../../library/time.rst:443 msgid "Month as a decimal number [01,12]." msgstr "" -#: ../../library/time.rst:447 +#: ../../library/time.rst:446 msgid "``%M``" msgstr "``%M``" -#: ../../library/time.rst:447 +#: ../../library/time.rst:446 msgid "Minute as a decimal number [00,59]." msgstr "" -#: ../../library/time.rst:450 +#: ../../library/time.rst:449 msgid "``%p``" msgstr "``%p``" -#: ../../library/time.rst:450 +#: ../../library/time.rst:449 msgid "Locale's equivalent of either AM or PM." msgstr "" -#: ../../library/time.rst:450 +#: ../../library/time.rst:449 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/time.rst:453 +#: ../../library/time.rst:452 msgid "``%S``" msgstr "``%S``" -#: ../../library/time.rst:453 +#: ../../library/time.rst:452 msgid "Second as a decimal number [00,61]." msgstr "" -#: ../../library/time.rst:453 +#: ../../library/time.rst:452 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/time.rst:456 +#: ../../library/time.rst:455 msgid "``%U``" msgstr "``%U``" -#: ../../library/time.rst:456 +#: ../../library/time.rst:455 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 " "considered to be in week 0." msgstr "" -#: ../../library/time.rst:456 ../../library/time.rst:467 +#: ../../library/time.rst:455 ../../library/time.rst:466 msgid "\\(4)" msgstr "" -#: ../../library/time.rst:464 +#: ../../library/time.rst:463 msgid "``%w``" msgstr "``%w``" -#: ../../library/time.rst:464 +#: ../../library/time.rst:463 msgid "Weekday as a decimal number [0(Sunday),6]." msgstr "" -#: ../../library/time.rst:467 +#: ../../library/time.rst:466 msgid "``%W``" msgstr "``%W``" -#: ../../library/time.rst:467 +#: ../../library/time.rst:466 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 " "considered to be in week 0." msgstr "" -#: ../../library/time.rst:475 +#: ../../library/time.rst:474 msgid "``%x``" msgstr "``%x``" -#: ../../library/time.rst:475 +#: ../../library/time.rst:474 msgid "Locale's appropriate date representation." msgstr "" -#: ../../library/time.rst:478 +#: ../../library/time.rst:477 msgid "``%X``" msgstr "``%X``" -#: ../../library/time.rst:478 +#: ../../library/time.rst:477 msgid "Locale's appropriate time representation." msgstr "" -#: ../../library/time.rst:481 +#: ../../library/time.rst:480 msgid "``%y``" msgstr "``%y``" -#: ../../library/time.rst:481 +#: ../../library/time.rst:480 msgid "Year without century as a decimal number [00,99]." msgstr "" -#: ../../library/time.rst:484 +#: ../../library/time.rst:483 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/time.rst:484 +#: ../../library/time.rst:483 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/time.rst:487 +#: ../../library/time.rst:486 msgid "``%z``" msgstr "``%z``" -#: ../../library/time.rst:487 +#: ../../library/time.rst:486 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 " "represents decimal minute digits [-23:59, +23:59]. [1]_" msgstr "" -#: ../../library/time.rst:493 +#: ../../library/time.rst:492 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/time.rst:493 +#: ../../library/time.rst:492 msgid "Time zone name (no characters if no time zone exists). Deprecated. [1]_" msgstr "" -#: ../../library/time.rst:496 +#: ../../library/time.rst:495 msgid "``%%``" msgstr "``%%``" -#: ../../library/time.rst:496 +#: ../../library/time.rst:495 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/time.rst:499 +#: ../../library/time.rst:498 msgid "Notes:" msgstr "註解:" -#: ../../library/time.rst:502 +#: ../../library/time.rst:501 msgid "" "The ``%f`` format directive only applies to :func:`strptime`, not to :func:" "`strftime`. However, see also :meth:`datetime.datetime.strptime` and :meth:" @@ -773,33 +773,33 @@ msgid "" "to microseconds `." msgstr "" -#: ../../library/time.rst:508 +#: ../../library/time.rst:507 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 " "hour." msgstr "" -#: ../../library/time.rst:514 +#: ../../library/time.rst:513 msgid "" "The range really is ``0`` to ``61``; value ``60`` is valid in timestamps " "representing `leap seconds`_ and value ``61`` is supported for historical " "reasons." msgstr "" -#: ../../library/time.rst:519 +#: ../../library/time.rst:518 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." msgstr "" -#: ../../library/time.rst:522 +#: ../../library/time.rst:521 msgid "" "Here is an example, a format for dates compatible with that specified in " "the :rfc:`2822` Internet email standard. [1]_ ::" msgstr "" -#: ../../library/time.rst:529 +#: ../../library/time.rst:528 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 " @@ -807,7 +807,7 @@ msgid "" "`strftime(3)` documentation." msgstr "" -#: ../../library/time.rst:534 +#: ../../library/time.rst:533 msgid "" "On some platforms, an optional field width and precision specification can " "immediately follow the initial ``'%'`` of a directive in the following " @@ -815,13 +815,13 @@ msgid "" "``%j`` where it is 3." msgstr "" -#: ../../library/time.rst:545 +#: ../../library/time.rst:544 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 "" -#: ../../library/time.rst:549 +#: ../../library/time.rst:548 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 " @@ -832,11 +832,11 @@ msgid "" "Both *string* and *format* must be strings." msgstr "" -#: ../../library/time.rst:557 +#: ../../library/time.rst:556 msgid "For example:" msgstr "" -#: ../../library/time.rst:564 +#: ../../library/time.rst:563 msgid "" "Support for the ``%Z`` directive is based on the values contained in " "``tzname`` and whether ``daylight`` is true. Because of this, it is " @@ -844,7 +844,7 @@ msgid "" "(and are considered to be non-daylight savings timezones)." msgstr "" -#: ../../library/time.rst:569 +#: ../../library/time.rst:568 msgid "" "Only the directives specified in the documentation are supported. Because " "``strftime()`` is implemented per platform it can sometimes offer more " @@ -853,7 +853,7 @@ msgid "" "are not documented as supported." msgstr "" -#: ../../library/time.rst:578 +#: ../../library/time.rst:577 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 " @@ -861,109 +861,109 @@ msgid "" "The following values are present:" msgstr "" -#: ../../library/time.rst:585 +#: ../../library/time.rst:584 msgid "Index" msgstr "" -#: ../../library/time.rst:586 +#: ../../library/time.rst:585 msgid "Attribute" msgstr "屬性" -#: ../../library/time.rst:587 +#: ../../library/time.rst:586 msgid "Values" msgstr "" -#: ../../library/time.rst:589 +#: ../../library/time.rst:588 msgid "0" msgstr "0" -#: ../../library/time.rst:591 +#: ../../library/time.rst:590 msgid "(for example, 1993)" msgstr "(例如 1993)" -#: ../../library/time.rst:593 +#: ../../library/time.rst:592 msgid "1" msgstr "1" -#: ../../library/time.rst:595 +#: ../../library/time.rst:594 msgid "range [1, 12]" msgstr "" -#: ../../library/time.rst:597 +#: ../../library/time.rst:596 msgid "2" msgstr "2" -#: ../../library/time.rst:599 +#: ../../library/time.rst:598 msgid "range [1, 31]" msgstr "" -#: ../../library/time.rst:601 +#: ../../library/time.rst:600 msgid "3" msgstr "3" -#: ../../library/time.rst:603 +#: ../../library/time.rst:602 msgid "range [0, 23]" msgstr "" -#: ../../library/time.rst:605 +#: ../../library/time.rst:604 msgid "4" msgstr "4" -#: ../../library/time.rst:607 +#: ../../library/time.rst:606 msgid "range [0, 59]" msgstr "" -#: ../../library/time.rst:609 +#: ../../library/time.rst:608 msgid "5" msgstr "5" -#: ../../library/time.rst:611 +#: ../../library/time.rst:610 msgid "range [0, 61]; see :ref:`Note (2) ` in :func:`strftime`" msgstr "" -#: ../../library/time.rst:613 +#: ../../library/time.rst:612 msgid "6" msgstr "6" -#: ../../library/time.rst:615 +#: ../../library/time.rst:614 msgid "range [0, 6]; Monday is 0" msgstr "" -#: ../../library/time.rst:617 +#: ../../library/time.rst:616 msgid "7" msgstr "7" -#: ../../library/time.rst:619 +#: ../../library/time.rst:618 msgid "range [1, 366]" msgstr "" -#: ../../library/time.rst:621 +#: ../../library/time.rst:620 msgid "8" msgstr "8" -#: ../../library/time.rst:623 +#: ../../library/time.rst:622 msgid "0, 1 or -1; see below" msgstr "" -#: ../../library/time.rst:625 ../../library/time.rst:629 +#: ../../library/time.rst:624 ../../library/time.rst:628 msgid "N/A" msgstr "N/A" -#: ../../library/time.rst:627 +#: ../../library/time.rst:626 msgid "abbreviation of timezone name" msgstr "" -#: ../../library/time.rst:631 +#: ../../library/time.rst:630 msgid "offset east of UTC in seconds" msgstr "" -#: ../../library/time.rst:633 +#: ../../library/time.rst:632 msgid "" "Note that unlike the C structure, the month value is a range of [1, 12], not " "[0, 11]." msgstr "" -#: ../../library/time.rst:636 +#: ../../library/time.rst:635 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 " @@ -971,14 +971,14 @@ msgid "" "filled in." msgstr "" -#: ../../library/time.rst:640 +#: ../../library/time.rst:639 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." msgstr "" -#: ../../library/time.rst:646 +#: ../../library/time.rst:645 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 " @@ -987,7 +987,7 @@ msgid "" "org/wiki/Unix_time>`_." msgstr "" -#: ../../library/time.rst:652 +#: ../../library/time.rst:651 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. " @@ -996,7 +996,7 @@ msgid "" "between the two calls." msgstr "" -#: ../../library/time.rst:658 +#: ../../library/time.rst:657 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 :" @@ -1006,19 +1006,19 @@ msgid "" "attributes." msgstr "" -#: ../../library/time.rst:665 +#: ../../library/time.rst:664 msgid "" "Use :func:`time_ns` to avoid the precision loss caused by the :class:`float` " "type." msgstr "" -#: ../../library/time.rst:671 +#: ../../library/time.rst:670 msgid "" "Similar to :func:`~time.time` but returns time as an integer number of " "nanoseconds since the epoch_." msgstr "" -#: ../../library/time.rst:684 +#: ../../library/time.rst:683 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 " @@ -1027,25 +1027,25 @@ msgid "" "of two calls in the same thread is valid." msgstr "" -#: ../../library/time.rst:690 +#: ../../library/time.rst:689 msgid "" "Use :func:`thread_time_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: ../../library/time.rst:693 +#: ../../library/time.rst:692 msgid ":ref:`Availability `: Linux, Unix, Windows." msgstr ":ref:`適用 `:Linux、Unix、Windows。" -#: ../../library/time.rst:695 +#: ../../library/time.rst:694 msgid "Unix systems supporting ``CLOCK_THREAD_CPUTIME_ID``." msgstr "" -#: ../../library/time.rst:702 +#: ../../library/time.rst:701 msgid "Similar to :func:`thread_time` but return time as nanoseconds." msgstr "" -#: ../../library/time.rst:709 +#: ../../library/time.rst:708 msgid "" "Reset the time conversion rules used by the library routines. The " "environment variable :envvar:`TZ` specifies how this is done. It will also " @@ -1056,42 +1056,42 @@ msgid "" "when daylight saving time applies)." msgstr "" -#: ../../library/time.rst:721 +#: ../../library/time.rst:720 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." msgstr "" -#: ../../library/time.rst:725 +#: ../../library/time.rst:724 msgid "The :envvar:`TZ` environment variable should contain no whitespace." msgstr "" -#: ../../library/time.rst:727 +#: ../../library/time.rst:726 msgid "" "The standard format of the :envvar:`TZ` environment variable is (whitespace " "added for clarity)::" msgstr "" -#: ../../library/time.rst:732 +#: ../../library/time.rst:731 msgid "Where the components are:" msgstr "" -#: ../../library/time.rst:736 +#: ../../library/time.rst:735 msgid "``std`` and ``dst``" msgstr "``std`` 和 ``dst``" -#: ../../library/time.rst:735 +#: ../../library/time.rst:734 msgid "" "Three or more alphanumerics giving the timezone abbreviations. These will be " "propagated into time.tzname" msgstr "" -#: ../../library/time.rst:742 +#: ../../library/time.rst:741 msgid "``offset``" msgstr "``offset``" -#: ../../library/time.rst:739 +#: ../../library/time.rst:738 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 " @@ -1099,41 +1099,41 @@ msgid "" "summer time is assumed to be one hour ahead of standard time." msgstr "" -#: ../../library/time.rst:764 +#: ../../library/time.rst:763 msgid "``start[/time], end[/time]``" msgstr "``start[/time], end[/time]``" -#: ../../library/time.rst:745 +#: ../../library/time.rst:744 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:750 +#: ../../library/time.rst:749 msgid ":samp:`J{n}`" msgstr ":samp:`J{n}`" -#: ../../library/time.rst:749 +#: ../../library/time.rst:748 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." msgstr "" -#: ../../library/time.rst:754 +#: ../../library/time.rst:753 msgid ":samp:`{n}`" msgstr ":samp:`{n}`" -#: ../../library/time.rst:753 +#: ../../library/time.rst:752 msgid "" "The zero-based Julian day (0 <= *n* <= 365). Leap days are counted, and it " "is possible to refer to February 29." msgstr "" -#: ../../library/time.rst:761 +#: ../../library/time.rst:760 msgid ":samp:`M{m}.{n}.{d}`" msgstr ":samp:`M{m}.{n}.{d}`" -#: ../../library/time.rst:757 +#: ../../library/time.rst:756 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 " @@ -1141,13 +1141,13 @@ msgid "" "first week in which the *d*'th day occurs. Day zero is a Sunday." msgstr "" -#: ../../library/time.rst:763 +#: ../../library/time.rst:762 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." msgstr "" -#: ../../library/time.rst:777 +#: ../../library/time.rst:776 msgid "" "On many Unix systems (including \\*BSD, Linux, Solaris, and Darwin), it is " "more convenient to use the system's zoneinfo (:manpage:`tzfile(5)`) " @@ -1158,23 +1158,23 @@ msgid "" "``'Australia/Melbourne'``, ``'Egypt'`` or ``'Europe/Amsterdam'``. ::" msgstr "" -#: ../../library/time.rst:798 +#: ../../library/time.rst:797 msgid "Clock ID Constants" msgstr "" -#: ../../library/time.rst:800 +#: ../../library/time.rst:799 msgid "" "These constants are used as parameters for :func:`clock_getres` and :func:" "`clock_gettime`." msgstr "" -#: ../../library/time.rst:805 +#: ../../library/time.rst:804 msgid "" "Identical to :data:`CLOCK_MONOTONIC`, except it also includes any time that " "the system is suspended." msgstr "" -#: ../../library/time.rst:808 +#: ../../library/time.rst:807 msgid "" "This allows applications to get a suspend-aware monotonic clock without " "having to deal with the complications of :data:`CLOCK_REALTIME`, which may " @@ -1182,103 +1182,103 @@ msgid "" "similar." msgstr "" -#: ../../library/time.rst:813 +#: ../../library/time.rst:812 msgid ":ref:`Availability `: Linux >= 2.6.39." msgstr ":ref:`適用 `:Linux 2.6.39 以上。" -#: ../../library/time.rst:820 +#: ../../library/time.rst:819 msgid "" "The Solaris OS has a ``CLOCK_HIGHRES`` timer that attempts to use an optimal " "hardware source, and may give close to nanosecond resolution. " "``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock." msgstr "" -#: ../../library/time.rst:824 +#: ../../library/time.rst:823 msgid ":ref:`Availability `: Solaris." msgstr ":ref:`適用 `:Solaris。" -#: ../../library/time.rst:831 +#: ../../library/time.rst:830 msgid "" "Clock that cannot be set and represents monotonic time since some " "unspecified starting point." msgstr "" -#: ../../library/time.rst:841 +#: ../../library/time.rst:840 msgid "" "Similar to :data:`CLOCK_MONOTONIC`, but provides access to a raw hardware-" "based time that is not subject to NTP adjustments." msgstr "" -#: ../../library/time.rst:844 +#: ../../library/time.rst:843 msgid ":ref:`Availability `: Linux >= 2.6.28, macOS >= 10.12." msgstr ":ref:`適用 `:Linux 2.6.28 以上、macOS 10.12 以上。" -#: ../../library/time.rst:851 ../../library/time.rst:860 +#: ../../library/time.rst:850 ../../library/time.rst:859 msgid "High-resolution per-process timer from the CPU." msgstr "" -#: ../../library/time.rst:862 +#: ../../library/time.rst:861 msgid ":ref:`Availability `: FreeBSD, NetBSD >= 7, OpenBSD." msgstr ":ref:`適用 `:FreeBSD、NetBSD 7 以上、OpenBSD。" -#: ../../library/time.rst:868 +#: ../../library/time.rst:867 msgid "" "`International Atomic Time `_" msgstr "" -#: ../../library/time.rst:870 +#: ../../library/time.rst:869 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 "" -#: ../../library/time.rst:873 +#: ../../library/time.rst:872 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/time.rst:879 +#: ../../library/time.rst:878 msgid "Thread-specific CPU-time clock." msgstr "" -#: ../../library/time.rst:888 +#: ../../library/time.rst:887 msgid "" "Time whose absolute value is the time the system has been running and not " "suspended, providing accurate uptime measurement, both absolute and interval." msgstr "" -#: ../../library/time.rst:892 +#: ../../library/time.rst:891 msgid ":ref:`Availability `: FreeBSD, OpenBSD >= 5.5." msgstr ":ref:`適用 `:FreeBSD、OpenBSD 5.5 以上。" -#: ../../library/time.rst:899 +#: ../../library/time.rst:898 msgid "" "Clock that increments monotonically, tracking the time since an arbitrary " "point, unaffected by frequency or time adjustments and not incremented while " "the system is asleep." msgstr "" -#: ../../library/time.rst:903 +#: ../../library/time.rst:902 msgid ":ref:`Availability `: macOS >= 10.12." msgstr ":ref:`適用 `:macOS 10.12 以上。" -#: ../../library/time.rst:907 +#: ../../library/time.rst:906 msgid "" "The following constant is the only parameter that can be sent to :func:" "`clock_settime`." msgstr "" -#: ../../library/time.rst:913 +#: ../../library/time.rst:912 msgid "" "System-wide real-time clock. Setting this clock requires appropriate " "privileges." msgstr "" -#: ../../library/time.rst:924 +#: ../../library/time.rst:923 msgid "Timezone Constants" msgstr "" -#: ../../library/time.rst:928 +#: ../../library/time.rst:927 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 " @@ -1286,25 +1286,25 @@ msgid "" "nonzero. See note below." msgstr "" -#: ../../library/time.rst:934 +#: ../../library/time.rst:933 msgid "Nonzero if a DST timezone is defined. See note below." msgstr "" -#: ../../library/time.rst:938 +#: ../../library/time.rst:937 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 " "below." msgstr "" -#: ../../library/time.rst:943 +#: ../../library/time.rst:942 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 " "defined, the second string should not be used. See note below." msgstr "" -#: ../../library/time.rst:949 +#: ../../library/time.rst:948 msgid "" "For the above Timezone constants (:data:`altzone`, :data:`daylight`, :data:" "`timezone`, and :data:`tzname`), the value is determined by the timezone " @@ -1314,40 +1314,40 @@ msgid "" "func:`localtime` to obtain timezone information." msgstr "" -#: ../../library/time.rst:959 +#: ../../library/time.rst:958 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/time.rst:959 +#: ../../library/time.rst:958 msgid "More object-oriented interface to dates and times." msgstr "" -#: ../../library/time.rst:963 +#: ../../library/time.rst:962 msgid "Module :mod:`locale`" msgstr ":mod:`locale` 模組" -#: ../../library/time.rst:962 +#: ../../library/time.rst:961 msgid "" "Internationalization services. The locale setting affects the " "interpretation of many format specifiers in :func:`strftime` and :func:" "`strptime`." msgstr "" -#: ../../library/time.rst:966 +#: ../../library/time.rst:965 msgid "Module :mod:`calendar`" msgstr ":mod:`calendar` 模組" -#: ../../library/time.rst:966 +#: ../../library/time.rst:965 msgid "" "General calendar-related functions. :func:`~calendar.timegm` is the " "inverse of :func:`gmtime` from this module." msgstr "" -#: ../../library/time.rst:970 +#: ../../library/time.rst:969 msgid "Footnotes" msgstr "註解" -#: ../../library/time.rst:971 +#: ../../library/time.rst:970 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. " @@ -1387,23 +1387,23 @@ msgid "Daylight Saving Time" msgstr "Daylight Saving Time(日光節約時間)" #: ../../library/time.rst:310 ../../library/time.rst:336 -#: ../../library/time.rst:679 +#: ../../library/time.rst:678 msgid "benchmarking" msgstr "benchmarking(基準測試)" -#: ../../library/time.rst:336 ../../library/time.rst:679 +#: ../../library/time.rst:336 ../../library/time.rst:678 msgid "CPU time" msgstr "CPU time(CPU 時間)" -#: ../../library/time.rst:336 ../../library/time.rst:679 +#: ../../library/time.rst:336 ../../library/time.rst:678 msgid "processor time" msgstr "processor time(處理器時間)" -#: ../../library/time.rst:394 ../../library/time.rst:540 +#: ../../library/time.rst:393 ../../library/time.rst:539 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/time.rst:394 ../../library/time.rst:540 +#: ../../library/time.rst:393 ../../library/time.rst:539 msgid "datetime format" msgstr "datetime format(日期時間格式)" diff --git a/library/urllib.request.po b/library/urllib.request.po index 0937803bc7..bc8625618b 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-15 00:03+0000\n" +"POT-Creation-Date: 2024-03-07 17:26+0000\n" "PO-Revision-Date: 2022-04-21 17:59+0800\n" "Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -235,19 +235,19 @@ msgstr "" "HTTPS 虛擬主機 (virtual hosts) 現已支援,只要 :const:`ssl.HAS_SNI` 的值為 " "true。" -#: ../../library/urllib.request.rst:112 +#: ../../library/urllib.request.rst:111 msgid "*data* can be an iterable object." msgstr "*data* 可以是一個可疊代物件。" -#: ../../library/urllib.request.rst:115 +#: ../../library/urllib.request.rst:113 msgid "*cadefault* was added." msgstr "*cadefault* 被新增。" -#: ../../library/urllib.request.rst:118 +#: ../../library/urllib.request.rst:116 msgid "*context* was added." msgstr "*context* 被新增。" -#: ../../library/urllib.request.rst:121 +#: ../../library/urllib.request.rst:119 msgid "" "HTTPS connection now send an ALPN extension with protocol indicator " "``http/1.1`` when no *context* is given. Custom *context* should set ALPN " @@ -257,7 +257,7 @@ msgstr "" "``http/1.1`` 的 ALPN 擴充 (extension)。自訂的 *context* 應該利用 :meth:`~ssl." "SSLContext.set_alpn_protocols` 來自行設定 ALPN 協定。" -#: ../../library/urllib.request.rst:128 +#: ../../library/urllib.request.rst:126 msgid "" "*cafile*, *capath* and *cadefault* are deprecated in favor of *context*. " "Please use :meth:`ssl.SSLContext.load_cert_chain` instead, or let :func:`ssl." @@ -267,7 +267,7 @@ msgstr "" "meth:`ssl.SSLContext.load_cert_chain`,或是讓 :func:`ssl." "create_default_context` 選取系統中受信任的 CA 憑證。" -#: ../../library/urllib.request.rst:136 +#: ../../library/urllib.request.rst:134 msgid "" "Install an :class:`OpenerDirector` instance as the default global opener. " "Installing an opener is only necessary if you want urlopen to use that " @@ -281,7 +281,7 @@ msgstr "" "查 class 是否真的為 :class:`OpenerDirector`,而是任何具有正確介面的 class 都" "能適用。" -#: ../../library/urllib.request.rst:146 +#: ../../library/urllib.request.rst:144 msgid "" "Return an :class:`OpenerDirector` instance, which chains the handlers in the " "order given. *handler*\\s can be either instances of :class:`BaseHandler`, " @@ -304,7 +304,7 @@ msgstr "" "`FTPHandler`\\ 、\\ :class:`FileHandler`\\ 、\\ :class:" "`HTTPErrorProcessor`\\ 。" -#: ../../library/urllib.request.rst:156 +#: ../../library/urllib.request.rst:154 msgid "" "If the Python installation has SSL support (i.e., if the :mod:`ssl` module " "can be imported), :class:`HTTPSHandler` will also be added." @@ -312,7 +312,7 @@ msgstr "" "如果 Python 安裝時已帶有 SSL 支援(如果 :mod:`ssl` module 能夠被 import)," "則 :class:`HTTPSHandler` 也在上述 class 之中。" -#: ../../library/urllib.request.rst:159 +#: ../../library/urllib.request.rst:157 msgid "" "A :class:`BaseHandler` subclass may also change its :attr:`handler_order` " "attribute to modify its position in the handlers list." @@ -320,7 +320,7 @@ msgstr "" "一個 :class:`BaseHandler` 的 subclass 可能透過改變其 :attr:`handler_order` 屬" "性來調整它在 handlers list 中的位置。" -#: ../../library/urllib.request.rst:165 +#: ../../library/urllib.request.rst:163 msgid "" "Convert the pathname *path* from the local syntax for a path to the form " "used in the path component of a URL. This does not produce a complete URL. " @@ -331,7 +331,7 @@ msgstr "" "component(路徑元件)格式。本函式並不會產生完整的 URL。回傳值將使用 :func:" "`~urllib.parse.quote` 函式先進行編碼過。" -#: ../../library/urllib.request.rst:172 +#: ../../library/urllib.request.rst:170 msgid "" "Convert the path component *path* from a percent-encoded URL to the local " "syntax for a path. This does not accept a complete URL. This function " @@ -341,7 +341,7 @@ msgstr "" "(local syntax)。本函式並不接受完整的 URL。本函式使用 :func:`~urllib.parse." "unquote` 來將 *path* 解碼。" -#: ../../library/urllib.request.rst:178 +#: ../../library/urllib.request.rst:176 msgid "" "This helper function returns a dictionary of scheme to proxy server URL " "mappings. It scans the environment for variables named ``_proxy``, " @@ -356,7 +356,7 @@ msgstr "" "Configuration) 或是 Windows 系統中的 Windows Systems Registry 尋找代理服務設" "定。如果大小寫的環境變數同時存在且值有不同,小寫的環境變數會被選用。" -#: ../../library/urllib.request.rst:188 +#: ../../library/urllib.request.rst:186 msgid "" "If the environment variable ``REQUEST_METHOD`` is set, which usually " "indicates your script is running in a CGI environment, the environment " @@ -373,19 +373,19 @@ msgstr "" "``ProxyHandler``,亦或是確認變數名稱是小寫的(或至少 ``_proxy`` 後綴是小寫" "的)。" -#: ../../library/urllib.request.rst:197 +#: ../../library/urllib.request.rst:195 msgid "The following classes are provided:" msgstr "提供了以下的 classes:" -#: ../../library/urllib.request.rst:201 +#: ../../library/urllib.request.rst:199 msgid "This class is an abstraction of a URL request." msgstr "這個 class 是一個 URL 請求的抽象 class。" -#: ../../library/urllib.request.rst:203 +#: ../../library/urllib.request.rst:201 msgid "*url* should be a string containing a valid, properly encoded URL." msgstr "*url* 是一個包含有效且適當編碼的 URL 字串。" -#: ../../library/urllib.request.rst:205 +#: ../../library/urllib.request.rst:203 msgid "" "*data* must be an object specifying additional data to send to the server, " "or ``None`` if no such data is needed. Currently HTTP requests are the only " @@ -406,7 +406,7 @@ msgstr "" "``Transfer-Encoding: chunked`` 則會被用來傳送檔案或是其它可疊代物件 " "(iterables)。" -#: ../../library/urllib.request.rst:215 +#: ../../library/urllib.request.rst:213 msgid "" "For an HTTP POST request method, *data* should be a buffer in the standard :" "mimetype:`application/x-www-form-urlencoded` format. The :func:`urllib." @@ -419,7 +419,7 @@ msgstr "" "個 mapping 或是 sequence(序列)的 2-tuples,並回傳一個對應格式的 ASCII 字" "串。在被作為 *data* 參數前它應該被編碼成位元組串。" -#: ../../library/urllib.request.rst:221 +#: ../../library/urllib.request.rst:219 msgid "" "*headers* should be a dictionary, and will be treated as if :meth:" "`add_header` was called with each key and value as arguments. This is often " @@ -440,7 +440,7 @@ msgstr "" "(在 Python 2.6 上)。所有 header 的鍵都會以 camel case(駝峰式大小寫)來傳" "送。" -#: ../../library/urllib.request.rst:232 +#: ../../library/urllib.request.rst:230 msgid "" "An appropriate ``Content-Type`` header should be included if the *data* " "argument is present. If this header has not been provided and *data* is not " @@ -451,14 +451,14 @@ msgstr "" "個 header 沒有被提供且 *data* 也不為 None 時,預設值 ``Content-Type: " "application/x-www-form-urlencoded`` 會被新增至請求中。" -#: ../../library/urllib.request.rst:237 +#: ../../library/urllib.request.rst:235 msgid "" "The next two arguments are only of interest for correct handling of third-" "party HTTP cookies:" msgstr "" "接下來的兩個引數的介紹提供給那些有興趣正確處理第三方 HTTP cookies 的使用者:" -#: ../../library/urllib.request.rst:240 +#: ../../library/urllib.request.rst:238 msgid "" "*origin_req_host* should be the request-host of the origin transaction, as " "defined by :rfc:`2965`. It defaults to ``http.cookiejar." @@ -472,7 +472,7 @@ msgstr "" "者發起的原始請求的主機名稱或是 IP 位址。例如當請求是要求一個 HTML 文件中的一" "個影像,則這個屬性應為請求包含影像頁面的請求主機。" -#: ../../library/urllib.request.rst:248 +#: ../../library/urllib.request.rst:246 msgid "" "*unverifiable* should indicate whether the request is unverifiable, as " "defined by :rfc:`2965`. It defaults to ``False``. An unverifiable request " @@ -485,7 +485,7 @@ msgstr "" "URL,例如一個對於 HTML 文件中的影像所做的請求,而使用者沒有機會去批准是否能自" "動擷取影像,則這個值應該為 true。" -#: ../../library/urllib.request.rst:255 +#: ../../library/urllib.request.rst:253 msgid "" "*method* should be a string that indicates the HTTP request method that will " "be used (e.g. ``'HEAD'``). If provided, its value is stored in the :attr:" @@ -500,7 +500,7 @@ msgstr "" "Subclasses 可以透過設置其 :attr:`~Request.method` 屬性來設定不一樣的預設請求" "方法。" -#: ../../library/urllib.request.rst:263 +#: ../../library/urllib.request.rst:261 msgid "" "The request will not work as expected if the data object is unable to " "deliver its content more than once (e.g. a file or an iterable that can " @@ -514,15 +514,15 @@ msgstr "" "新嘗試傳送,則該請求不會正常運作。*data* 會接在 headers 之後被送至 HTTP 伺服" "器。此函式庫沒有支援 100-continue expectation。" -#: ../../library/urllib.request.rst:270 +#: ../../library/urllib.request.rst:268 msgid ":attr:`Request.method` argument is added to the Request class." msgstr "新增 :attr:`Request.method` 引數到 Request class。" -#: ../../library/urllib.request.rst:273 +#: ../../library/urllib.request.rst:271 msgid "Default :attr:`Request.method` may be indicated at the class level." msgstr "能夠在 class 中設置預設的 :attr:`Request.method`\\ 。" -#: ../../library/urllib.request.rst:276 +#: ../../library/urllib.request.rst:274 msgid "" "Do not raise an error if the ``Content-Length`` has not been provided and " "*data* is neither ``None`` nor a bytes object. Fall back to use chunked " @@ -532,34 +532,34 @@ msgstr "" "串物件,則不會觸發錯誤,並 fall back(後備)使用分塊傳輸編碼 (chunked " "transfer encoding)。" -#: ../../library/urllib.request.rst:283 +#: ../../library/urllib.request.rst:281 msgid "" "The :class:`OpenerDirector` class opens URLs via :class:`BaseHandler`\\ s " "chained together. It manages the chaining of handlers, and recovery from " "errors." msgstr "" -#: ../../library/urllib.request.rst:289 +#: ../../library/urllib.request.rst:287 msgid "" "This is the base class for all registered handlers --- and handles only the " "simple mechanics of registration." msgstr "" -#: ../../library/urllib.request.rst:295 +#: ../../library/urllib.request.rst:293 msgid "" "A class which defines a default handler for HTTP error responses; all " "responses are turned into :exc:`~urllib.error.HTTPError` exceptions." msgstr "" -#: ../../library/urllib.request.rst:301 +#: ../../library/urllib.request.rst:299 msgid "A class to handle redirections." msgstr "" -#: ../../library/urllib.request.rst:306 +#: ../../library/urllib.request.rst:304 msgid "A class to handle HTTP Cookies." msgstr "" -#: ../../library/urllib.request.rst:311 +#: ../../library/urllib.request.rst:309 msgid "" "Cause requests to go through a proxy. If *proxies* is given, it must be a " "dictionary mapping protocol names to URLs of proxies. The default is to read " @@ -570,11 +570,11 @@ msgid "" "Configuration Framework." msgstr "" -#: ../../library/urllib.request.rst:319 +#: ../../library/urllib.request.rst:317 msgid "To disable autodetected proxy pass an empty dictionary." msgstr "" -#: ../../library/urllib.request.rst:321 +#: ../../library/urllib.request.rst:319 msgid "" "The :envvar:`no_proxy` environment variable can be used to specify hosts " "which shouldn't be reached via proxy; if set, it should be a comma-separated " @@ -582,24 +582,24 @@ msgid "" "``cern.ch,ncsa.uiuc.edu,some.host:8080``." msgstr "" -#: ../../library/urllib.request.rst:328 +#: ../../library/urllib.request.rst:326 msgid "" "``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set; see " "the documentation on :func:`~urllib.request.getproxies`." msgstr "" -#: ../../library/urllib.request.rst:334 +#: ../../library/urllib.request.rst:332 msgid "Keep a database of ``(realm, uri) -> (user, password)`` mappings." msgstr "" -#: ../../library/urllib.request.rst:339 +#: ../../library/urllib.request.rst:337 msgid "" "Keep a database of ``(realm, uri) -> (user, password)`` mappings. A realm " "of ``None`` is considered a catch-all realm, which is searched if no other " "realm fits." msgstr "" -#: ../../library/urllib.request.rst:346 +#: ../../library/urllib.request.rst:344 msgid "" "A variant of :class:`HTTPPasswordMgrWithDefaultRealm` that also has a " "database of ``uri -> is_authenticated`` mappings. Can be used by a " @@ -607,7 +607,7 @@ msgid "" "immediately instead of waiting for a ``401`` response first." msgstr "" -#: ../../library/urllib.request.rst:356 +#: ../../library/urllib.request.rst:354 msgid "" "This is a mixin class that helps with HTTP authentication, both to the " "remote host and to a proxy. *password_mgr*, if given, should be something " @@ -626,11 +626,11 @@ msgid "" "will automatically include the authentication credentials." msgstr "" -#: ../../library/urllib.request.rst:373 +#: ../../library/urllib.request.rst:371 msgid "Added ``is_authenticated`` support." msgstr "新增 ``is_authenticated`` 的支援。" -#: ../../library/urllib.request.rst:379 +#: ../../library/urllib.request.rst:377 msgid "" "Handle authentication with the remote host. *password_mgr*, if given, should " "be something that is compatible with :class:`HTTPPasswordMgr`; refer to " @@ -639,7 +639,7 @@ msgid "" "presented with a wrong Authentication scheme." msgstr "" -#: ../../library/urllib.request.rst:388 ../../library/urllib.request.rst:422 +#: ../../library/urllib.request.rst:386 ../../library/urllib.request.rst:420 msgid "" "Handle authentication with the proxy. *password_mgr*, if given, should be " "something that is compatible with :class:`HTTPPasswordMgr`; refer to " @@ -647,7 +647,7 @@ msgid "" "be supported." msgstr "" -#: ../../library/urllib.request.rst:396 +#: ../../library/urllib.request.rst:394 msgid "" "This is a mixin class that helps with HTTP authentication, both to the " "remote host and to a proxy. *password_mgr*, if given, should be something " @@ -655,7 +655,7 @@ msgid "" "`http-password-mgr` for information on the interface that must be supported." msgstr "" -#: ../../library/urllib.request.rst:405 +#: ../../library/urllib.request.rst:403 msgid "" "Handle authentication with the remote host. *password_mgr*, if given, should " "be something that is compatible with :class:`HTTPPasswordMgr`; refer to " @@ -668,108 +668,108 @@ msgid "" "Digest or Basic." msgstr "" -#: ../../library/urllib.request.rst:415 +#: ../../library/urllib.request.rst:413 msgid "Raise :exc:`ValueError` on unsupported Authentication Scheme." msgstr "" -#: ../../library/urllib.request.rst:430 +#: ../../library/urllib.request.rst:428 msgid "A class to handle opening of HTTP URLs." msgstr "" -#: ../../library/urllib.request.rst:435 +#: ../../library/urllib.request.rst:433 msgid "" "A class to handle opening of HTTPS URLs. *context* and *check_hostname* " "have the same meaning as in :class:`http.client.HTTPSConnection`." msgstr "" -#: ../../library/urllib.request.rst:438 +#: ../../library/urllib.request.rst:436 msgid "*context* and *check_hostname* were added." msgstr "新增 *context* 與 *check_hostname*\\ 。" -#: ../../library/urllib.request.rst:444 +#: ../../library/urllib.request.rst:442 msgid "Open local files." msgstr "" -#: ../../library/urllib.request.rst:448 +#: ../../library/urllib.request.rst:446 msgid "Open data URLs." msgstr "" -#: ../../library/urllib.request.rst:454 +#: ../../library/urllib.request.rst:452 msgid "Open FTP URLs." msgstr "" -#: ../../library/urllib.request.rst:459 +#: ../../library/urllib.request.rst:457 msgid "" "Open FTP URLs, keeping a cache of open FTP connections to minimize delays." msgstr "" -#: ../../library/urllib.request.rst:464 +#: ../../library/urllib.request.rst:462 msgid "A catch-all class to handle unknown URLs." msgstr "" -#: ../../library/urllib.request.rst:469 ../../library/urllib.request.rst:1175 +#: ../../library/urllib.request.rst:467 ../../library/urllib.request.rst:1173 msgid "Process HTTP error responses." msgstr "" -#: ../../library/urllib.request.rst:475 +#: ../../library/urllib.request.rst:473 msgid "Request Objects" msgstr "" -#: ../../library/urllib.request.rst:477 +#: ../../library/urllib.request.rst:475 msgid "" "The following methods describe :class:`Request`'s public interface, and so " "all may be overridden in subclasses. It also defines several public " "attributes that can be used by clients to inspect the parsed request." msgstr "" -#: ../../library/urllib.request.rst:484 +#: ../../library/urllib.request.rst:482 msgid "The original URL passed to the constructor." msgstr "" -#: ../../library/urllib.request.rst:488 +#: ../../library/urllib.request.rst:486 msgid "" "Request.full_url is a property with setter, getter and a deleter. Getting :" "attr:`~Request.full_url` returns the original request URL with the fragment, " "if it was present." msgstr "" -#: ../../library/urllib.request.rst:494 +#: ../../library/urllib.request.rst:492 msgid "The URI scheme." msgstr "" -#: ../../library/urllib.request.rst:498 +#: ../../library/urllib.request.rst:496 msgid "" "The URI authority, typically a host, but may also contain a port separated " "by a colon." msgstr "" -#: ../../library/urllib.request.rst:503 +#: ../../library/urllib.request.rst:501 msgid "The original host for the request, without port." msgstr "" -#: ../../library/urllib.request.rst:507 +#: ../../library/urllib.request.rst:505 msgid "" "The URI path. If the :class:`Request` uses a proxy, then selector will be " "the full URL that is passed to the proxy." msgstr "" -#: ../../library/urllib.request.rst:512 +#: ../../library/urllib.request.rst:510 msgid "The entity body for the request, or ``None`` if not specified." msgstr "" -#: ../../library/urllib.request.rst:514 +#: ../../library/urllib.request.rst:512 msgid "" "Changing value of :attr:`Request.data` now deletes \"Content-Length\" header " "if it was previously set or calculated." msgstr "" -#: ../../library/urllib.request.rst:520 +#: ../../library/urllib.request.rst:518 msgid "" "boolean, indicates whether the request is unverifiable as defined by :rfc:" "`2965`." msgstr "" -#: ../../library/urllib.request.rst:525 +#: ../../library/urllib.request.rst:523 msgid "" "The HTTP request method to use. By default its value is :const:`None`, " "which means that :meth:`~Request.get_method` will do its normal computation " @@ -780,13 +780,13 @@ msgid "" "argument." msgstr "" -#: ../../library/urllib.request.rst:535 +#: ../../library/urllib.request.rst:533 msgid "" "A default value can now be set in subclasses; previously it could only be " "set via the constructor argument." msgstr "" -#: ../../library/urllib.request.rst:542 +#: ../../library/urllib.request.rst:540 msgid "" "Return a string indicating the HTTP request method. If :attr:`Request." "method` is not ``None``, return its value, otherwise return ``'GET'`` if :" @@ -794,11 +794,11 @@ msgid "" "meaningful for HTTP requests." msgstr "" -#: ../../library/urllib.request.rst:547 +#: ../../library/urllib.request.rst:545 msgid "get_method now looks at the value of :attr:`Request.method`." msgstr "" -#: ../../library/urllib.request.rst:553 +#: ../../library/urllib.request.rst:551 msgid "" "Add another header to the request. Headers are currently ignored by all " "handlers except HTTP handlers, where they are added to the list of headers " @@ -810,64 +810,64 @@ msgid "" "headers added using this method are also added to redirected requests." msgstr "" -#: ../../library/urllib.request.rst:565 +#: ../../library/urllib.request.rst:563 msgid "Add a header that will not be added to a redirected request." msgstr "" -#: ../../library/urllib.request.rst:570 +#: ../../library/urllib.request.rst:568 msgid "" "Return whether the instance has the named header (checks both regular and " "unredirected)." msgstr "" -#: ../../library/urllib.request.rst:576 +#: ../../library/urllib.request.rst:574 msgid "" "Remove named header from the request instance (both from regular and " "unredirected headers)." msgstr "" -#: ../../library/urllib.request.rst:584 +#: ../../library/urllib.request.rst:582 msgid "Return the URL given in the constructor." msgstr "" -#: ../../library/urllib.request.rst:588 +#: ../../library/urllib.request.rst:586 msgid "Returns :attr:`Request.full_url`" msgstr "" -#: ../../library/urllib.request.rst:593 +#: ../../library/urllib.request.rst:591 msgid "" "Prepare the request by connecting to a proxy server. The *host* and *type* " "will replace those of the instance, and the instance's selector will be the " "original URL given in the constructor." msgstr "" -#: ../../library/urllib.request.rst:600 +#: ../../library/urllib.request.rst:598 msgid "" "Return the value of the given header. If the header is not present, return " "the default value." msgstr "" -#: ../../library/urllib.request.rst:606 +#: ../../library/urllib.request.rst:604 msgid "" "Return a list of tuples (header_name, header_value) of the Request headers." msgstr "" -#: ../../library/urllib.request.rst:608 +#: ../../library/urllib.request.rst:606 msgid "" "The request methods add_data, has_data, get_data, get_type, get_host, " "get_selector, get_origin_req_host and is_unverifiable that were deprecated " "since 3.3 have been removed." msgstr "" -#: ../../library/urllib.request.rst:617 +#: ../../library/urllib.request.rst:615 msgid "OpenerDirector Objects" msgstr "OpenerDirector 物件" -#: ../../library/urllib.request.rst:619 +#: ../../library/urllib.request.rst:617 msgid ":class:`OpenerDirector` instances have the following methods:" msgstr "" -#: ../../library/urllib.request.rst:624 +#: ../../library/urllib.request.rst:622 msgid "" "*handler* should be an instance of :class:`BaseHandler`. The following " "methods are searched, and added to the possible chains (note that HTTP " @@ -878,53 +878,53 @@ msgid "" "`http_error_404` would handle HTTP 404 errors." msgstr "" -#: ../../library/urllib.request.rst:632 +#: ../../library/urllib.request.rst:630 msgid "" ":meth:`!_open` --- signal that the handler knows how to open " "*protocol* URLs." msgstr "" -#: ../../library/urllib.request.rst:635 +#: ../../library/urllib.request.rst:633 msgid "See |protocol_open|_ for more information." msgstr "更多資訊請見 |protocol_open|_\\ 。" -#: ../../library/urllib.request.rst:637 +#: ../../library/urllib.request.rst:635 msgid "" ":meth:`!http_error_\\` --- signal that the handler knows how to " "handle HTTP errors with HTTP error code *type*." msgstr "" -#: ../../library/urllib.request.rst:640 +#: ../../library/urllib.request.rst:638 msgid "See |http_error_nnn|_ for more information." msgstr "更多資訊請見 |http_error_nnn|_\\ 。" -#: ../../library/urllib.request.rst:642 +#: ../../library/urllib.request.rst:640 msgid "" ":meth:`!_error` --- signal that the handler knows how to handle " "errors from (non-\\ ``http``) *protocol*." msgstr "" -#: ../../library/urllib.request.rst:645 +#: ../../library/urllib.request.rst:643 msgid "" ":meth:`!_request` --- signal that the handler knows how to pre-" "process *protocol* requests." msgstr "" -#: ../../library/urllib.request.rst:648 +#: ../../library/urllib.request.rst:646 msgid "See |protocol_request|_ for more information." msgstr "更多資訊請見 |protocol_request|_\\ 。" -#: ../../library/urllib.request.rst:650 +#: ../../library/urllib.request.rst:648 msgid "" ":meth:`!_response` --- signal that the handler knows how to post-" "process *protocol* responses." msgstr "" -#: ../../library/urllib.request.rst:653 +#: ../../library/urllib.request.rst:651 msgid "See |protocol_response|_ for more information." msgstr "更多資訊請見 |protocol_response|_\\ 。" -#: ../../library/urllib.request.rst:662 +#: ../../library/urllib.request.rst:660 msgid "" "Open the given *url* (which can be a request object or a string), optionally " "passing the given *data*. Arguments, return values and exceptions raised are " @@ -936,7 +936,7 @@ msgid "" "HTTP, HTTPS and FTP connections." msgstr "" -#: ../../library/urllib.request.rst:674 +#: ../../library/urllib.request.rst:672 msgid "" "Handle an error of the given protocol. This will call the registered error " "handlers for the given protocol with the given arguments (which are protocol " @@ -945,28 +945,28 @@ msgid "" "http_error_\\` methods of the handler classes." msgstr "" -#: ../../library/urllib.request.rst:680 +#: ../../library/urllib.request.rst:678 msgid "" "Return values and exceptions raised are the same as those of :func:`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:682 +#: ../../library/urllib.request.rst:680 msgid "OpenerDirector objects open URLs in three stages:" msgstr "" -#: ../../library/urllib.request.rst:684 +#: ../../library/urllib.request.rst:682 msgid "" "The order in which these methods are called within each stage is determined " "by sorting the handler instances." msgstr "" -#: ../../library/urllib.request.rst:687 +#: ../../library/urllib.request.rst:685 msgid "" "Every handler with a method named like :meth:`!_request` has that " "method called to pre-process the request." msgstr "" -#: ../../library/urllib.request.rst:690 +#: ../../library/urllib.request.rst:688 msgid "" "Handlers with a method named like :meth:`!_open` are called to " "handle the request. This stage ends when a handler either returns a non-\\ :" @@ -974,7 +974,7 @@ msgid "" "`~urllib.error.URLError`). Exceptions are allowed to propagate." msgstr "" -#: ../../library/urllib.request.rst:695 +#: ../../library/urllib.request.rst:693 msgid "" "In fact, the above algorithm is first tried for methods named :meth:" "`~BaseHandler.default_open`. If all such methods return :const:`None`, the " @@ -983,64 +983,64 @@ msgid "" "named :meth:`~BaseHandler.unknown_open`." msgstr "" -#: ../../library/urllib.request.rst:701 +#: ../../library/urllib.request.rst:699 msgid "" "Note that the implementation of these methods may involve calls of the " "parent :class:`OpenerDirector` instance's :meth:`~OpenerDirector.open` and :" "meth:`~OpenerDirector.error` methods." msgstr "" -#: ../../library/urllib.request.rst:705 +#: ../../library/urllib.request.rst:703 msgid "" "Every handler with a method named like :meth:`!_response` has that " "method called to post-process the response." msgstr "" -#: ../../library/urllib.request.rst:712 +#: ../../library/urllib.request.rst:710 msgid "BaseHandler Objects" msgstr "BaseHandler 物件" -#: ../../library/urllib.request.rst:714 +#: ../../library/urllib.request.rst:712 msgid "" ":class:`BaseHandler` objects provide a couple of methods that are directly " "useful, and others that are meant to be used by derived classes. These are " "intended for direct use:" msgstr "" -#: ../../library/urllib.request.rst:721 +#: ../../library/urllib.request.rst:719 msgid "Add a director as parent." msgstr "" -#: ../../library/urllib.request.rst:726 +#: ../../library/urllib.request.rst:724 msgid "Remove any parents." msgstr "" -#: ../../library/urllib.request.rst:728 +#: ../../library/urllib.request.rst:726 msgid "" "The following attribute and methods should only be used by classes derived " "from :class:`BaseHandler`." msgstr "" -#: ../../library/urllib.request.rst:733 +#: ../../library/urllib.request.rst:731 msgid "" "The convention has been adopted that subclasses defining :meth:`!" "_request` or :meth:`!_response` methods are named :class:" "`!\\*Processor`; all others are named :class:`!\\*Handler`." msgstr "" -#: ../../library/urllib.request.rst:740 +#: ../../library/urllib.request.rst:738 msgid "" "A valid :class:`OpenerDirector`, which can be used to open using a different " "protocol, or handle errors." msgstr "" -#: ../../library/urllib.request.rst:746 +#: ../../library/urllib.request.rst:744 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to catch all URLs." msgstr "" -#: ../../library/urllib.request.rst:749 +#: ../../library/urllib.request.rst:747 msgid "" "This method, if implemented, will be called by the parent :class:" "`OpenerDirector`. It should return a file-like object as described in the " @@ -1050,38 +1050,38 @@ msgid "" "`MemoryError` should not be mapped to :exc:`~urllib.error.URLError`)." msgstr "" -#: ../../library/urllib.request.rst:756 +#: ../../library/urllib.request.rst:754 msgid "This method will be called before any protocol-specific open method." msgstr "" -#: ../../library/urllib.request.rst:763 +#: ../../library/urllib.request.rst:761 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to handle URLs with the given protocol." msgstr "" -#: ../../library/urllib.request.rst:766 +#: ../../library/urllib.request.rst:764 msgid "" "This method, if defined, will be called by the parent :class:" "`OpenerDirector`. Return values should be the same as for :meth:" "`~BaseHandler.default_open`." msgstr "" -#: ../../library/urllib.request.rst:772 +#: ../../library/urllib.request.rst:770 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to catch all URLs with no specific registered handler " "to open it." msgstr "" -#: ../../library/urllib.request.rst:776 +#: ../../library/urllib.request.rst:774 msgid "" "This method, if implemented, will be called by the :attr:`parent` :class:" "`OpenerDirector`. Return values should be the same as for :meth:" "`default_open`." msgstr "" -#: ../../library/urllib.request.rst:783 +#: ../../library/urllib.request.rst:781 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "override it if they intend to provide a catch-all for otherwise unhandled " @@ -1090,7 +1090,7 @@ msgid "" "other circumstances." msgstr "" -#: ../../library/urllib.request.rst:788 +#: ../../library/urllib.request.rst:786 msgid "" "*req* will be a :class:`Request` object, *fp* will be a file-like object " "with the HTTP error body, *code* will be the three-digit code of the error, " @@ -1098,49 +1098,49 @@ msgid "" "mapping object with the headers of the error." msgstr "" -#: ../../library/urllib.request.rst:793 +#: ../../library/urllib.request.rst:791 msgid "" "Return values and exceptions raised should be the same as those of :func:" "`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:800 +#: ../../library/urllib.request.rst:798 msgid "" "*nnn* should be a three-digit HTTP error code. This method is also not " "defined in :class:`BaseHandler`, but will be called, if it exists, on an " "instance of a subclass, when an HTTP error with code *nnn* occurs." msgstr "" -#: ../../library/urllib.request.rst:804 +#: ../../library/urllib.request.rst:802 msgid "Subclasses should override this method to handle specific HTTP errors." msgstr "" -#: ../../library/urllib.request.rst:806 +#: ../../library/urllib.request.rst:804 msgid "" "Arguments, return values and exceptions raised should be the same as for :" "meth:`~BaseHandler.http_error_default`." msgstr "" -#: ../../library/urllib.request.rst:814 +#: ../../library/urllib.request.rst:812 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to pre-process requests of the given protocol." msgstr "" -#: ../../library/urllib.request.rst:817 +#: ../../library/urllib.request.rst:815 msgid "" "This method, if defined, will be called by the parent :class:" "`OpenerDirector`. *req* will be a :class:`Request` object. The return value " "should be a :class:`Request` object." msgstr "" -#: ../../library/urllib.request.rst:826 +#: ../../library/urllib.request.rst:824 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to post-process responses of the given protocol." msgstr "" -#: ../../library/urllib.request.rst:829 +#: ../../library/urllib.request.rst:827 msgid "" "This method, if defined, will be called by the parent :class:" "`OpenerDirector`. *req* will be a :class:`Request` object. *response* will " @@ -1149,25 +1149,25 @@ msgid "" "return value of :func:`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:839 +#: ../../library/urllib.request.rst:837 msgid "HTTPRedirectHandler Objects" msgstr "HTTPRedirectHandler 物件" -#: ../../library/urllib.request.rst:843 +#: ../../library/urllib.request.rst:841 msgid "" "Some HTTP redirections require action from this module's client code. If " "this is the case, :exc:`~urllib.error.HTTPError` is raised. See :rfc:`2616` " "for details of the precise meanings of the various redirection codes." msgstr "" -#: ../../library/urllib.request.rst:847 +#: ../../library/urllib.request.rst:845 msgid "" "An :exc:`~urllib.error.HTTPError` exception raised as a security " "consideration if the HTTPRedirectHandler is presented with a redirected URL " "which is not an HTTP, HTTPS or FTP URL." msgstr "" -#: ../../library/urllib.request.rst:854 +#: ../../library/urllib.request.rst:852 msgid "" "Return a :class:`Request` or ``None`` in response to a redirect. This is " "called by the default implementations of the :meth:`!http_error_30\\*` " @@ -1178,7 +1178,7 @@ msgid "" "URL, or return ``None`` if you can't but another handler might." msgstr "" -#: ../../library/urllib.request.rst:864 +#: ../../library/urllib.request.rst:862 msgid "" "The default implementation of this method does not strictly follow :rfc:" "`2616`, which says that 301 and 302 responses to ``POST`` requests must not " @@ -1187,54 +1187,54 @@ msgid "" "POST to a ``GET``, and the default implementation reproduces this behavior." msgstr "" -#: ../../library/urllib.request.rst:873 +#: ../../library/urllib.request.rst:871 msgid "" "Redirect to the ``Location:`` or ``URI:`` URL. This method is called by the " "parent :class:`OpenerDirector` when getting an HTTP 'moved permanently' " "response." msgstr "" -#: ../../library/urllib.request.rst:879 +#: ../../library/urllib.request.rst:877 msgid "" "The same as :meth:`http_error_301`, but called for the 'found' response." msgstr "" -#: ../../library/urllib.request.rst:884 +#: ../../library/urllib.request.rst:882 msgid "" "The same as :meth:`http_error_301`, but called for the 'see other' response." msgstr "" -#: ../../library/urllib.request.rst:889 +#: ../../library/urllib.request.rst:887 msgid "" "The same as :meth:`http_error_301`, but called for the 'temporary redirect' " "response. It does not allow changing the request method from ``POST`` to " "``GET``." msgstr "" -#: ../../library/urllib.request.rst:896 +#: ../../library/urllib.request.rst:894 msgid "" "The same as :meth:`http_error_301`, but called for the 'permanent redirect' " "response. It does not allow changing the request method from ``POST`` to " "``GET``." msgstr "" -#: ../../library/urllib.request.rst:906 +#: ../../library/urllib.request.rst:904 msgid "HTTPCookieProcessor Objects" msgstr "HTTPCookieProcessor 物件" -#: ../../library/urllib.request.rst:908 +#: ../../library/urllib.request.rst:906 msgid ":class:`HTTPCookieProcessor` instances have one attribute:" msgstr "" -#: ../../library/urllib.request.rst:912 +#: ../../library/urllib.request.rst:910 msgid "The :class:`http.cookiejar.CookieJar` in which cookies are stored." msgstr "" -#: ../../library/urllib.request.rst:918 +#: ../../library/urllib.request.rst:916 msgid "ProxyHandler Objects" msgstr "ProxyHandler 物件" -#: ../../library/urllib.request.rst:924 +#: ../../library/urllib.request.rst:922 msgid "" "The :class:`ProxyHandler` will have a method :meth:`!_open` for " "every *protocol* which has a proxy in the *proxies* dictionary given in the " @@ -1243,17 +1243,17 @@ msgid "" "actually execute the protocol." msgstr "" -#: ../../library/urllib.request.rst:934 +#: ../../library/urllib.request.rst:932 msgid "HTTPPasswordMgr Objects" msgstr "HTTPPasswordMgr 物件" -#: ../../library/urllib.request.rst:936 +#: ../../library/urllib.request.rst:934 msgid "" "These methods are available on :class:`HTTPPasswordMgr` and :class:" "`HTTPPasswordMgrWithDefaultRealm` objects." msgstr "" -#: ../../library/urllib.request.rst:942 +#: ../../library/urllib.request.rst:940 msgid "" "*uri* can be either a single URI, or a sequence of URIs. *realm*, *user* and " "*passwd* must be strings. This causes ``(user, passwd)`` to be used as " @@ -1261,30 +1261,30 @@ msgid "" "of the given URIs is given." msgstr "" -#: ../../library/urllib.request.rst:950 +#: ../../library/urllib.request.rst:948 msgid "" "Get user/password for given realm and URI, if any. This method will return " "``(None, None)`` if there is no matching user/password." msgstr "" -#: ../../library/urllib.request.rst:953 +#: ../../library/urllib.request.rst:951 msgid "" "For :class:`HTTPPasswordMgrWithDefaultRealm` objects, the realm ``None`` " "will be searched if the given *realm* has no matching user/password." msgstr "" -#: ../../library/urllib.request.rst:960 +#: ../../library/urllib.request.rst:958 msgid "HTTPPasswordMgrWithPriorAuth Objects" msgstr "HTTPPasswordMgrWithPriorAuth 物件" -#: ../../library/urllib.request.rst:962 +#: ../../library/urllib.request.rst:960 msgid "" "This password manager extends :class:`HTTPPasswordMgrWithDefaultRealm` to " "support tracking URIs for which authentication credentials should always be " "sent." msgstr "" -#: ../../library/urllib.request.rst:969 +#: ../../library/urllib.request.rst:967 msgid "" "*realm*, *uri*, *user*, *passwd* are as for :meth:`HTTPPasswordMgr." "add_password`. *is_authenticated* sets the initial value of the " @@ -1292,25 +1292,25 @@ msgid "" "*is_authenticated* is specified as ``True``, *realm* is ignored." msgstr "" -#: ../../library/urllib.request.rst:977 +#: ../../library/urllib.request.rst:975 msgid "Same as for :class:`HTTPPasswordMgrWithDefaultRealm` objects" msgstr "" -#: ../../library/urllib.request.rst:983 +#: ../../library/urllib.request.rst:981 msgid "" "Update the ``is_authenticated`` flag for the given *uri* or list of URIs." msgstr "" -#: ../../library/urllib.request.rst:989 +#: ../../library/urllib.request.rst:987 msgid "" "Returns the current state of the ``is_authenticated`` flag for the given URI." msgstr "" -#: ../../library/urllib.request.rst:996 +#: ../../library/urllib.request.rst:994 msgid "AbstractBasicAuthHandler Objects" msgstr "AbstractBasicAuthHandler 物件" -#: ../../library/urllib.request.rst:1001 +#: ../../library/urllib.request.rst:999 msgid "" "Handle an authentication request by getting a user/password pair, and re-" "trying the request. *authreq* should be the name of the header where the " @@ -1319,7 +1319,7 @@ msgid "" "`Request` object, and *headers* should be the error headers." msgstr "" -#: ../../library/urllib.request.rst:1007 +#: ../../library/urllib.request.rst:1005 msgid "" "*host* is either an authority (e.g. ``\"python.org\"``) or a URL containing " "an authority component (e.g. ``\"http://python.org/\"``). In either case, " @@ -1327,24 +1327,24 @@ msgid "" "and ``\"python.org:80\"`` are fine, ``\"joe:password@python.org\"`` is not)." msgstr "" -#: ../../library/urllib.request.rst:1016 +#: ../../library/urllib.request.rst:1014 msgid "HTTPBasicAuthHandler Objects" msgstr "HTTPBasicAuthHandler 物件" -#: ../../library/urllib.request.rst:1021 ../../library/urllib.request.rst:1032 -#: ../../library/urllib.request.rst:1057 ../../library/urllib.request.rst:1068 +#: ../../library/urllib.request.rst:1019 ../../library/urllib.request.rst:1030 +#: ../../library/urllib.request.rst:1055 ../../library/urllib.request.rst:1066 msgid "Retry the request with authentication information, if available." msgstr "" -#: ../../library/urllib.request.rst:1027 +#: ../../library/urllib.request.rst:1025 msgid "ProxyBasicAuthHandler Objects" msgstr "ProxyBasicAuthHandler 物件" -#: ../../library/urllib.request.rst:1038 +#: ../../library/urllib.request.rst:1036 msgid "AbstractDigestAuthHandler Objects" msgstr "AbstractDigestAuthHandler 物件" -#: ../../library/urllib.request.rst:1043 +#: ../../library/urllib.request.rst:1041 msgid "" "*authreq* should be the name of the header where the information about the " "realm is included in the request, *host* should be the host to authenticate " @@ -1352,55 +1352,55 @@ msgid "" "should be the error headers." msgstr "" -#: ../../library/urllib.request.rst:1052 +#: ../../library/urllib.request.rst:1050 msgid "HTTPDigestAuthHandler Objects" msgstr "HTTPDigestAuthHandler 物件" -#: ../../library/urllib.request.rst:1063 +#: ../../library/urllib.request.rst:1061 msgid "ProxyDigestAuthHandler Objects" msgstr "ProxyDigestAuthHandler 物件" -#: ../../library/urllib.request.rst:1074 +#: ../../library/urllib.request.rst:1072 msgid "HTTPHandler Objects" msgstr "HTTPHandler 物件" -#: ../../library/urllib.request.rst:1079 +#: ../../library/urllib.request.rst:1077 msgid "" "Send an HTTP request, which can be either GET or POST, depending on ``req." "has_data()``." msgstr "" -#: ../../library/urllib.request.rst:1086 +#: ../../library/urllib.request.rst:1084 msgid "HTTPSHandler Objects" msgstr "HTTPSHandler 物件" -#: ../../library/urllib.request.rst:1091 +#: ../../library/urllib.request.rst:1089 msgid "" "Send an HTTPS request, which can be either GET or POST, depending on ``req." "has_data()``." msgstr "" -#: ../../library/urllib.request.rst:1098 +#: ../../library/urllib.request.rst:1096 msgid "FileHandler Objects" msgstr "FileHandler 物件" -#: ../../library/urllib.request.rst:1103 +#: ../../library/urllib.request.rst:1101 msgid "" "Open the file locally, if there is no host name, or the host name is " "``'localhost'``." msgstr "" -#: ../../library/urllib.request.rst:1106 +#: ../../library/urllib.request.rst:1104 msgid "" "This method is applicable only for local hostnames. When a remote hostname " "is given, an :exc:`~urllib.error.URLError` is raised." msgstr "" -#: ../../library/urllib.request.rst:1114 +#: ../../library/urllib.request.rst:1112 msgid "DataHandler Objects" msgstr "DataHandler 物件" -#: ../../library/urllib.request.rst:1118 +#: ../../library/urllib.request.rst:1116 msgid "" "Read a data URL. This kind of URL contains the content encoded in the URL " "itself. The data URL syntax is specified in :rfc:`2397`. This implementation " @@ -1410,51 +1410,51 @@ msgid "" "implementation will raise an :exc:`ValueError` in that case." msgstr "" -#: ../../library/urllib.request.rst:1129 +#: ../../library/urllib.request.rst:1127 msgid "FTPHandler Objects" msgstr "FTPHandler 物件" -#: ../../library/urllib.request.rst:1134 +#: ../../library/urllib.request.rst:1132 msgid "" "Open the FTP file indicated by *req*. The login is always done with empty " "username and password." msgstr "" -#: ../../library/urllib.request.rst:1141 +#: ../../library/urllib.request.rst:1139 msgid "CacheFTPHandler Objects" msgstr "CacheFTPHandler 物件" -#: ../../library/urllib.request.rst:1143 +#: ../../library/urllib.request.rst:1141 msgid "" ":class:`CacheFTPHandler` objects are :class:`FTPHandler` objects with the " "following additional methods:" msgstr "" -#: ../../library/urllib.request.rst:1149 +#: ../../library/urllib.request.rst:1147 msgid "Set timeout of connections to *t* seconds." msgstr "" -#: ../../library/urllib.request.rst:1154 +#: ../../library/urllib.request.rst:1152 msgid "Set maximum number of cached connections to *m*." msgstr "" -#: ../../library/urllib.request.rst:1160 +#: ../../library/urllib.request.rst:1158 msgid "UnknownHandler Objects" msgstr "UnknownHandler 物件" -#: ../../library/urllib.request.rst:1165 +#: ../../library/urllib.request.rst:1163 msgid "Raise a :exc:`~urllib.error.URLError` exception." msgstr "" -#: ../../library/urllib.request.rst:1171 +#: ../../library/urllib.request.rst:1169 msgid "HTTPErrorProcessor Objects" msgstr "HTTPErrorProcessor 物件" -#: ../../library/urllib.request.rst:1177 +#: ../../library/urllib.request.rst:1175 msgid "For 200 error codes, the response object is returned immediately." msgstr "" -#: ../../library/urllib.request.rst:1179 +#: ../../library/urllib.request.rst:1177 msgid "" "For non-200 error codes, this simply passes the job on to the :meth:`!" "http_error_\\` handler methods, via :meth:`OpenerDirector.error`. " @@ -1462,31 +1462,31 @@ msgid "" "error.HTTPError` if no other handler handles the error." msgstr "" -#: ../../library/urllib.request.rst:1187 +#: ../../library/urllib.request.rst:1185 msgid "Process HTTPS error responses." msgstr "" -#: ../../library/urllib.request.rst:1189 +#: ../../library/urllib.request.rst:1187 msgid "The behavior is same as :meth:`http_response`." msgstr "" -#: ../../library/urllib.request.rst:1195 +#: ../../library/urllib.request.rst:1193 msgid "Examples" msgstr "" -#: ../../library/urllib.request.rst:1197 +#: ../../library/urllib.request.rst:1195 msgid "" "In addition to the examples below, more examples are given in :ref:`urllib-" "howto`." msgstr "" -#: ../../library/urllib.request.rst:1200 +#: ../../library/urllib.request.rst:1198 msgid "" "This example gets the python.org main page and displays the first 300 bytes " "of it. ::" msgstr "" -#: ../../library/urllib.request.rst:1213 +#: ../../library/urllib.request.rst:1211 msgid "" "Note that urlopen returns a bytes object. This is because there is no way " "for urlopen to automatically determine the encoding of the byte stream it " @@ -1495,45 +1495,45 @@ msgid "" "appropriate encoding." msgstr "" -#: ../../library/urllib.request.rst:1219 +#: ../../library/urllib.request.rst:1217 msgid "" "The following W3C document, https://www.w3.org/International/O-charset\\ , " "lists the various ways in which an (X)HTML or an XML document could have " "specified its encoding information." msgstr "" -#: ../../library/urllib.request.rst:1223 +#: ../../library/urllib.request.rst:1221 msgid "" "As the python.org website uses *utf-8* encoding as specified in its meta " "tag, we will use the same for decoding the bytes object. ::" msgstr "" -#: ../../library/urllib.request.rst:1232 +#: ../../library/urllib.request.rst:1230 msgid "" "It is also possible to achieve the same result without using the :term:" "`context manager` approach. ::" msgstr "" -#: ../../library/urllib.request.rst:1241 +#: ../../library/urllib.request.rst:1239 msgid "" "In the following example, we are sending a data-stream to the stdin of a CGI " "and reading the data it returns to us. Note that this example will only work " "when the Python installation supports SSL. ::" msgstr "" -#: ../../library/urllib.request.rst:1253 +#: ../../library/urllib.request.rst:1251 msgid "The code for the sample CGI used in the above example is::" msgstr "" -#: ../../library/urllib.request.rst:1260 +#: ../../library/urllib.request.rst:1258 msgid "Here is an example of doing a ``PUT`` request using :class:`Request`::" msgstr "" -#: ../../library/urllib.request.rst:1270 +#: ../../library/urllib.request.rst:1268 msgid "Use of Basic HTTP Authentication::" msgstr "" -#: ../../library/urllib.request.rst:1284 +#: ../../library/urllib.request.rst:1282 msgid "" ":func:`build_opener` provides many handlers by default, including a :class:" "`ProxyHandler`. By default, :class:`ProxyHandler` uses the environment " @@ -1542,71 +1542,71 @@ msgid "" "read to obtain the HTTP proxy's URL." msgstr "" -#: ../../library/urllib.request.rst:1290 +#: ../../library/urllib.request.rst:1288 msgid "" "This example replaces the default :class:`ProxyHandler` with one that uses " "programmatically supplied proxy URLs, and adds proxy authorization support " "with :class:`ProxyBasicAuthHandler`. ::" msgstr "" -#: ../../library/urllib.request.rst:1302 +#: ../../library/urllib.request.rst:1300 msgid "Adding HTTP headers:" msgstr "" -#: ../../library/urllib.request.rst:1304 +#: ../../library/urllib.request.rst:1302 msgid "Use the *headers* argument to the :class:`Request` constructor, or::" msgstr "" -#: ../../library/urllib.request.rst:1313 +#: ../../library/urllib.request.rst:1311 msgid "" ":class:`OpenerDirector` automatically adds a :mailheader:`User-Agent` header " "to every :class:`Request`. To change this::" msgstr "" -#: ../../library/urllib.request.rst:1321 +#: ../../library/urllib.request.rst:1319 msgid "" "Also, remember that a few standard headers (:mailheader:`Content-Length`, :" "mailheader:`Content-Type` and :mailheader:`Host`) are added when the :class:" "`Request` is passed to :func:`urlopen` (or :meth:`OpenerDirector.open`)." msgstr "" -#: ../../library/urllib.request.rst:1328 +#: ../../library/urllib.request.rst:1326 msgid "" "Here is an example session that uses the ``GET`` method to retrieve a URL " "containing parameters::" msgstr "" -#: ../../library/urllib.request.rst:1339 +#: ../../library/urllib.request.rst:1337 msgid "" "The following example uses the ``POST`` method instead. Note that params " "output from urlencode is encoded to bytes before it is sent to urlopen as " "data::" msgstr "" -#: ../../library/urllib.request.rst:1350 +#: ../../library/urllib.request.rst:1348 msgid "" "The following example uses an explicitly specified HTTP proxy, overriding " "environment settings::" msgstr "" -#: ../../library/urllib.request.rst:1360 +#: ../../library/urllib.request.rst:1358 msgid "" "The following example uses no proxies at all, overriding environment " "settings::" msgstr "" -#: ../../library/urllib.request.rst:1370 +#: ../../library/urllib.request.rst:1368 msgid "Legacy interface" msgstr "" -#: ../../library/urllib.request.rst:1372 +#: ../../library/urllib.request.rst:1370 msgid "" "The following functions and classes are ported from the Python 2 module " "``urllib`` (as opposed to ``urllib2``). They might become deprecated at " "some point in the future." msgstr "" -#: ../../library/urllib.request.rst:1378 +#: ../../library/urllib.request.rst:1376 msgid "" "Copy a network object denoted by a URL to a local file. If the URL points to " "a local file, the object will not be copied unless filename is supplied. " @@ -1616,7 +1616,7 @@ msgid "" "a remote object). Exceptions are the same as for :func:`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:1385 +#: ../../library/urllib.request.rst:1383 msgid "" "The second argument, if present, specifies the file location to copy to (if " "absent, the location will be a tempfile with a generated name). The third " @@ -1628,11 +1628,11 @@ msgid "" "file size in response to a retrieval request." msgstr "" -#: ../../library/urllib.request.rst:1394 +#: ../../library/urllib.request.rst:1392 msgid "The following example illustrates the most common usage scenario::" msgstr "" -#: ../../library/urllib.request.rst:1401 +#: ../../library/urllib.request.rst:1399 msgid "" "If the *url* uses the :file:`http:` scheme identifier, the optional *data* " "argument may be given to specify a ``POST`` request (normally the request " @@ -1641,7 +1641,7 @@ msgid "" "parse.urlencode` function." msgstr "" -#: ../../library/urllib.request.rst:1407 +#: ../../library/urllib.request.rst:1405 msgid "" ":func:`urlretrieve` will raise :exc:`~urllib.error.ContentTooShortError` " "when it detects that the amount of data available was less than the " @@ -1649,40 +1649,40 @@ msgid "" "This can occur, for example, when the download is interrupted." msgstr "" -#: ../../library/urllib.request.rst:1412 +#: ../../library/urllib.request.rst:1410 msgid "" "The *Content-Length* is treated as a lower bound: if there's more data to " "read, urlretrieve reads more data, but if less data is available, it raises " "the exception." msgstr "" -#: ../../library/urllib.request.rst:1416 +#: ../../library/urllib.request.rst:1414 msgid "" "You can still retrieve the downloaded data in this case, it is stored in " "the :attr:`!content` attribute of the exception instance." msgstr "" -#: ../../library/urllib.request.rst:1419 +#: ../../library/urllib.request.rst:1417 msgid "" "If no *Content-Length* header was supplied, urlretrieve can not check the " "size of the data it has downloaded, and just returns it. In this case you " "just have to assume that the download was successful." msgstr "" -#: ../../library/urllib.request.rst:1425 +#: ../../library/urllib.request.rst:1423 msgid "" "Cleans up temporary files that may have been left behind by previous calls " "to :func:`urlretrieve`." msgstr "" -#: ../../library/urllib.request.rst:1432 +#: ../../library/urllib.request.rst:1430 msgid "" "Base class for opening and reading URLs. Unless you need to support opening " "objects using schemes other than :file:`http:`, :file:`ftp:`, or :file:`file:" "`, you probably want to use :class:`FancyURLopener`." msgstr "" -#: ../../library/urllib.request.rst:1436 +#: ../../library/urllib.request.rst:1434 msgid "" "By default, the :class:`URLopener` class sends a :mailheader:`User-Agent` " "header of ``urllib/VVV``, where *VVV* is the :mod:`urllib` version number. " @@ -1692,7 +1692,7 @@ msgid "" "subclass definition." msgstr "" -#: ../../library/urllib.request.rst:1442 +#: ../../library/urllib.request.rst:1440 msgid "" "The optional *proxies* parameter should be a dictionary mapping scheme names " "to proxy URLs, where an empty dictionary turns proxies off completely. Its " @@ -1700,7 +1700,7 @@ msgid "" "be used if present, as discussed in the definition of :func:`urlopen`, above." msgstr "" -#: ../../library/urllib.request.rst:1447 +#: ../../library/urllib.request.rst:1445 msgid "" "Additional keyword parameters, collected in *x509*, may be used for " "authentication of the client when using the :file:`https:` scheme. The " @@ -1708,13 +1708,13 @@ msgid "" "certificate; both are needed to support client authentication." msgstr "" -#: ../../library/urllib.request.rst:1452 +#: ../../library/urllib.request.rst:1450 msgid "" ":class:`URLopener` objects will raise an :exc:`OSError` exception if the " "server returns an error code." msgstr "" -#: ../../library/urllib.request.rst:1457 +#: ../../library/urllib.request.rst:1455 msgid "" "Open *fullurl* using the appropriate protocol. This method sets up cache " "and proxy information, then calls the appropriate open method with its input " @@ -1723,15 +1723,15 @@ msgid "" "`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:1463 +#: ../../library/urllib.request.rst:1461 msgid "This method always quotes *fullurl* using :func:`~urllib.parse.quote`." msgstr "" -#: ../../library/urllib.request.rst:1467 +#: ../../library/urllib.request.rst:1465 msgid "Overridable interface to open unknown URL types." msgstr "" -#: ../../library/urllib.request.rst:1472 +#: ../../library/urllib.request.rst:1470 msgid "" "Retrieves the contents of *url* and places it in *filename*. The return " "value is a tuple consisting of a local filename and either an :class:`email." @@ -1748,7 +1748,7 @@ msgid "" "*reporthook* is ignored for local URLs." msgstr "" -#: ../../library/urllib.request.rst:1485 +#: ../../library/urllib.request.rst:1483 msgid "" "If the *url* uses the :file:`http:` scheme identifier, the optional *data* " "argument may be given to specify a ``POST`` request (normally the request " @@ -1757,7 +1757,7 @@ msgid "" "urlencode` function." msgstr "" -#: ../../library/urllib.request.rst:1494 +#: ../../library/urllib.request.rst:1492 msgid "" "Variable that specifies the user agent of the opener object. To get :mod:" "`urllib` to tell servers that it is a particular user agent, set this in a " @@ -1765,7 +1765,7 @@ msgid "" "constructor." msgstr "" -#: ../../library/urllib.request.rst:1504 +#: ../../library/urllib.request.rst:1502 msgid "" ":class:`FancyURLopener` subclasses :class:`URLopener` providing default " "handling for the following HTTP response codes: 301, 302, 303, 307 and 401. " @@ -1776,14 +1776,14 @@ msgid "" "defaults to 10." msgstr "" -#: ../../library/urllib.request.rst:1511 +#: ../../library/urllib.request.rst:1509 msgid "" "For all other response codes, the method :meth:`~BaseHandler." "http_error_default` is called which you can override in subclasses to handle " "the error appropriately." msgstr "" -#: ../../library/urllib.request.rst:1516 +#: ../../library/urllib.request.rst:1514 msgid "" "According to the letter of :rfc:`2616`, 301 and 302 responses to POST " "requests must not be automatically redirected without confirmation by the " @@ -1792,13 +1792,13 @@ msgid "" "behaviour." msgstr "" -#: ../../library/urllib.request.rst:1521 +#: ../../library/urllib.request.rst:1519 msgid "" "The parameters to the constructor are the same as those for :class:" "`URLopener`." msgstr "" -#: ../../library/urllib.request.rst:1525 +#: ../../library/urllib.request.rst:1523 msgid "" "When performing basic authentication, a :class:`FancyURLopener` instance " "calls its :meth:`prompt_user_passwd` method. The default implementation " @@ -1807,59 +1807,59 @@ msgid "" "needed." msgstr "" -#: ../../library/urllib.request.rst:1530 +#: ../../library/urllib.request.rst:1528 msgid "" "The :class:`FancyURLopener` class offers one additional method that should " "be overloaded to provide the appropriate behavior:" msgstr "" -#: ../../library/urllib.request.rst:1535 +#: ../../library/urllib.request.rst:1533 msgid "" "Return information needed to authenticate the user at the given host in the " "specified security realm. The return value should be a tuple, ``(user, " "password)``, which can be used for basic authentication." msgstr "" -#: ../../library/urllib.request.rst:1539 +#: ../../library/urllib.request.rst:1537 msgid "" "The implementation prompts for this information on the terminal; an " "application should override this method to use an appropriate interaction " "model in the local environment." msgstr "" -#: ../../library/urllib.request.rst:1545 +#: ../../library/urllib.request.rst:1543 msgid ":mod:`urllib.request` Restrictions" msgstr "" -#: ../../library/urllib.request.rst:1551 +#: ../../library/urllib.request.rst:1549 msgid "" "Currently, only the following protocols are supported: HTTP (versions 0.9 " "and 1.0), FTP, local files, and data URLs." msgstr "" -#: ../../library/urllib.request.rst:1554 +#: ../../library/urllib.request.rst:1552 msgid "Added support for data URLs." msgstr "" -#: ../../library/urllib.request.rst:1556 +#: ../../library/urllib.request.rst:1554 msgid "" "The caching feature of :func:`urlretrieve` has been disabled until someone " "finds the time to hack proper processing of Expiration time headers." msgstr "" -#: ../../library/urllib.request.rst:1559 +#: ../../library/urllib.request.rst:1557 msgid "" "There should be a function to query whether a particular URL is in the cache." msgstr "" -#: ../../library/urllib.request.rst:1561 +#: ../../library/urllib.request.rst:1559 msgid "" "For backward compatibility, if a URL appears to point to a local file but " "the file can't be opened, the URL is re-interpreted using the FTP protocol. " "This can sometimes cause confusing error messages." msgstr "" -#: ../../library/urllib.request.rst:1565 +#: ../../library/urllib.request.rst:1563 msgid "" "The :func:`urlopen` and :func:`urlretrieve` functions can cause arbitrarily " "long delays while waiting for a network connection to be set up. This means " @@ -1867,7 +1867,7 @@ msgid "" "functions without using threads." msgstr "" -#: ../../library/urllib.request.rst:1574 +#: ../../library/urllib.request.rst:1572 msgid "" "The data returned by :func:`urlopen` or :func:`urlretrieve` is the raw data " "returned by the server. This may be binary data (such as an image), plain " @@ -1877,7 +1877,7 @@ msgid "" "module :mod:`html.parser` to parse it." msgstr "" -#: ../../library/urllib.request.rst:1583 +#: ../../library/urllib.request.rst:1581 msgid "" "The code handling the FTP protocol cannot differentiate between a file and a " "directory. This can lead to unexpected behavior when attempting to read a " @@ -1895,11 +1895,11 @@ msgid "" "meet your needs." msgstr "" -#: ../../library/urllib.request.rst:1600 +#: ../../library/urllib.request.rst:1598 msgid ":mod:`urllib.response` --- Response classes used by urllib" msgstr "" -#: ../../library/urllib.request.rst:1605 +#: ../../library/urllib.request.rst:1603 msgid "" "The :mod:`urllib.response` module defines functions and classes which define " "a minimal file-like interface, including ``read()`` and ``readline()``. " @@ -1908,46 +1908,46 @@ msgid "" "addinfourl` instance:" msgstr "" -#: ../../library/urllib.request.rst:1614 +#: ../../library/urllib.request.rst:1612 msgid "" "URL of the resource retrieved, commonly used to determine if a redirect was " "followed." msgstr "" -#: ../../library/urllib.request.rst:1618 +#: ../../library/urllib.request.rst:1616 msgid "" "Returns the headers of the response in the form of an :class:`~email.message." "EmailMessage` instance." msgstr "" -#: ../../library/urllib.request.rst:1624 +#: ../../library/urllib.request.rst:1622 msgid "Status code returned by server." msgstr "" -#: ../../library/urllib.request.rst:1628 +#: ../../library/urllib.request.rst:1626 msgid "Deprecated in favor of :attr:`~addinfourl.url`." msgstr "" -#: ../../library/urllib.request.rst:1633 +#: ../../library/urllib.request.rst:1631 msgid "Deprecated in favor of :attr:`~addinfourl.headers`." msgstr "" -#: ../../library/urllib.request.rst:1638 ../../library/urllib.request.rst:1643 +#: ../../library/urllib.request.rst:1636 ../../library/urllib.request.rst:1641 msgid "Deprecated in favor of :attr:`~addinfourl.status`." msgstr "" -#: ../../library/urllib.request.rst:1547 ../../library/urllib.request.rst:1570 +#: ../../library/urllib.request.rst:1545 ../../library/urllib.request.rst:1568 msgid "HTTP" msgstr "HTTP" -#: ../../library/urllib.request.rst:1547 ../../library/urllib.request.rst:1570 +#: ../../library/urllib.request.rst:1545 ../../library/urllib.request.rst:1568 msgid "protocol" msgstr "protocol(協定)" -#: ../../library/urllib.request.rst:1547 ../../library/urllib.request.rst:1581 +#: ../../library/urllib.request.rst:1545 ../../library/urllib.request.rst:1579 msgid "FTP" msgstr "FTP" -#: ../../library/urllib.request.rst:1570 +#: ../../library/urllib.request.rst:1568 msgid "HTML" msgstr "HTML" diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index 6847fa02e1..857c53f252 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-10 14:21+0000\n" +"POT-Creation-Date: 2024-03-07 17:26+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-" @@ -589,7 +589,7 @@ msgid "" "`414` for more information." msgstr "" -#: ../../reference/lexical_analysis.rst:526 +#: ../../reference/lexical_analysis.rst:525 msgid "" "A string literal with ``'f'`` or ``'F'`` in its prefix is a :dfn:`formatted " "string literal`; see :ref:`f-strings`. The ``'f'`` may be combined with " @@ -597,7 +597,7 @@ msgid "" "are possible, but formatted bytes literals are not." msgstr "" -#: ../../reference/lexical_analysis.rst:531 +#: ../../reference/lexical_analysis.rst:530 msgid "" "In triple-quoted literals, unescaped newlines and quotes are allowed (and " "are retained), except that three unescaped quotes in a row terminate the " @@ -605,246 +605,246 @@ msgid "" "either ``'`` or ``\"``.)" msgstr "" -#: ../../reference/lexical_analysis.rst:554 +#: ../../reference/lexical_analysis.rst:553 msgid "Escape sequences" msgstr "跳脫序列" -#: ../../reference/lexical_analysis.rst:556 +#: ../../reference/lexical_analysis.rst:555 msgid "" "Unless an ``'r'`` or ``'R'`` prefix is present, escape sequences in string " "and bytes literals are interpreted according to rules similar to those used " "by Standard C. The recognized escape sequences are:" msgstr "" -#: ../../reference/lexical_analysis.rst:561 -#: ../../reference/lexical_analysis.rst:594 +#: ../../reference/lexical_analysis.rst:560 +#: ../../reference/lexical_analysis.rst:593 msgid "Escape Sequence" msgstr "" -#: ../../reference/lexical_analysis.rst:561 -#: ../../reference/lexical_analysis.rst:594 +#: ../../reference/lexical_analysis.rst:560 +#: ../../reference/lexical_analysis.rst:593 msgid "Meaning" msgstr "" -#: ../../reference/lexical_analysis.rst:561 -#: ../../reference/lexical_analysis.rst:594 +#: ../../reference/lexical_analysis.rst:560 +#: ../../reference/lexical_analysis.rst:593 msgid "Notes" msgstr "註解" -#: ../../reference/lexical_analysis.rst:563 +#: ../../reference/lexical_analysis.rst:562 msgid "``\\``\\ " msgstr "``\\``\\ " -#: ../../reference/lexical_analysis.rst:563 +#: ../../reference/lexical_analysis.rst:562 msgid "Backslash and newline ignored" msgstr "" -#: ../../reference/lexical_analysis.rst:563 +#: ../../reference/lexical_analysis.rst:562 msgid "\\(1)" msgstr "\\(1)" -#: ../../reference/lexical_analysis.rst:565 +#: ../../reference/lexical_analysis.rst:564 msgid "``\\\\``" msgstr "``\\\\``" -#: ../../reference/lexical_analysis.rst:565 +#: ../../reference/lexical_analysis.rst:564 msgid "Backslash (``\\``)" msgstr "" -#: ../../reference/lexical_analysis.rst:567 +#: ../../reference/lexical_analysis.rst:566 msgid "``\\'``" msgstr "``\\'``" -#: ../../reference/lexical_analysis.rst:567 +#: ../../reference/lexical_analysis.rst:566 msgid "Single quote (``'``)" msgstr "單引號 (``'``)" -#: ../../reference/lexical_analysis.rst:569 +#: ../../reference/lexical_analysis.rst:568 msgid "``\\\"``" msgstr "``\\\"``" -#: ../../reference/lexical_analysis.rst:569 +#: ../../reference/lexical_analysis.rst:568 msgid "Double quote (``\"``)" msgstr "雙引號 (``\"``)" -#: ../../reference/lexical_analysis.rst:571 +#: ../../reference/lexical_analysis.rst:570 msgid "``\\a``" msgstr "``\\a``" -#: ../../reference/lexical_analysis.rst:571 +#: ../../reference/lexical_analysis.rst:570 msgid "ASCII Bell (BEL)" msgstr "" -#: ../../reference/lexical_analysis.rst:573 +#: ../../reference/lexical_analysis.rst:572 msgid "``\\b``" msgstr "``\\b``" -#: ../../reference/lexical_analysis.rst:573 +#: ../../reference/lexical_analysis.rst:572 msgid "ASCII Backspace (BS)" msgstr "" -#: ../../reference/lexical_analysis.rst:575 +#: ../../reference/lexical_analysis.rst:574 msgid "``\\f``" msgstr "``\\f``" -#: ../../reference/lexical_analysis.rst:575 +#: ../../reference/lexical_analysis.rst:574 msgid "ASCII Formfeed (FF)" msgstr "" -#: ../../reference/lexical_analysis.rst:577 +#: ../../reference/lexical_analysis.rst:576 msgid "``\\n``" msgstr "``\\n``" -#: ../../reference/lexical_analysis.rst:577 +#: ../../reference/lexical_analysis.rst:576 msgid "ASCII Linefeed (LF)" msgstr "" -#: ../../reference/lexical_analysis.rst:579 +#: ../../reference/lexical_analysis.rst:578 msgid "``\\r``" msgstr "``\\r``" -#: ../../reference/lexical_analysis.rst:579 +#: ../../reference/lexical_analysis.rst:578 msgid "ASCII Carriage Return (CR)" msgstr "" -#: ../../reference/lexical_analysis.rst:581 +#: ../../reference/lexical_analysis.rst:580 msgid "``\\t``" msgstr "``\\t``" -#: ../../reference/lexical_analysis.rst:581 +#: ../../reference/lexical_analysis.rst:580 msgid "ASCII Horizontal Tab (TAB)" msgstr "" -#: ../../reference/lexical_analysis.rst:583 +#: ../../reference/lexical_analysis.rst:582 msgid "``\\v``" msgstr "``\\v``" -#: ../../reference/lexical_analysis.rst:583 +#: ../../reference/lexical_analysis.rst:582 msgid "ASCII Vertical Tab (VT)" msgstr "" -#: ../../reference/lexical_analysis.rst:585 +#: ../../reference/lexical_analysis.rst:584 msgid ":samp:`\\\\\\\\{ooo}`" msgstr ":samp:`\\\\\\\\{ooo}`" -#: ../../reference/lexical_analysis.rst:585 +#: ../../reference/lexical_analysis.rst:584 msgid "Character with octal value *ooo*" msgstr "" -#: ../../reference/lexical_analysis.rst:585 +#: ../../reference/lexical_analysis.rst:584 msgid "(2,4)" msgstr "(2,4)" -#: ../../reference/lexical_analysis.rst:588 +#: ../../reference/lexical_analysis.rst:587 msgid ":samp:`\\\\x{hh}`" msgstr ":samp:`\\\\x{hh}`" -#: ../../reference/lexical_analysis.rst:588 +#: ../../reference/lexical_analysis.rst:587 msgid "Character with hex value *hh*" msgstr "" -#: ../../reference/lexical_analysis.rst:588 +#: ../../reference/lexical_analysis.rst:587 msgid "(3,4)" msgstr "(3,4)" -#: ../../reference/lexical_analysis.rst:591 +#: ../../reference/lexical_analysis.rst:590 msgid "Escape sequences only recognized in string literals are:" msgstr "" -#: ../../reference/lexical_analysis.rst:596 +#: ../../reference/lexical_analysis.rst:595 msgid ":samp:`\\\\N\\\\{{name}\\\\}`" msgstr ":samp:`\\\\N\\\\{{name}\\\\}`" -#: ../../reference/lexical_analysis.rst:596 +#: ../../reference/lexical_analysis.rst:595 msgid "Character named *name* in the Unicode database" msgstr "" -#: ../../reference/lexical_analysis.rst:596 +#: ../../reference/lexical_analysis.rst:595 msgid "\\(5)" msgstr "\\(5)" -#: ../../reference/lexical_analysis.rst:599 +#: ../../reference/lexical_analysis.rst:598 msgid ":samp:`\\\\u{xxxx}`" msgstr ":samp:`\\\\u{xxxx}`" -#: ../../reference/lexical_analysis.rst:599 +#: ../../reference/lexical_analysis.rst:598 msgid "Character with 16-bit hex value *xxxx*" msgstr "" -#: ../../reference/lexical_analysis.rst:599 +#: ../../reference/lexical_analysis.rst:598 msgid "\\(6)" msgstr "\\(6)" -#: ../../reference/lexical_analysis.rst:602 +#: ../../reference/lexical_analysis.rst:601 msgid ":samp:`\\\\U{xxxxxxxx}`" msgstr ":samp:`\\\\U{xxxxxxxx}`" -#: ../../reference/lexical_analysis.rst:602 +#: ../../reference/lexical_analysis.rst:601 msgid "Character with 32-bit hex value *xxxxxxxx*" msgstr "" -#: ../../reference/lexical_analysis.rst:602 +#: ../../reference/lexical_analysis.rst:601 msgid "\\(7)" msgstr "\\(7)" -#: ../../reference/lexical_analysis.rst:606 +#: ../../reference/lexical_analysis.rst:605 msgid "Notes:" msgstr "註解:" -#: ../../reference/lexical_analysis.rst:609 +#: ../../reference/lexical_analysis.rst:608 msgid "A backslash can be added at the end of a line to ignore the newline::" msgstr "" -#: ../../reference/lexical_analysis.rst:615 +#: ../../reference/lexical_analysis.rst:614 msgid "" "The same result can be achieved using :ref:`triple-quoted strings " "`, or parentheses and :ref:`string literal concatenation `." msgstr "" -#: ../../reference/lexical_analysis.rst:620 +#: ../../reference/lexical_analysis.rst:619 msgid "As in Standard C, up to three octal digits are accepted." msgstr "" -#: ../../reference/lexical_analysis.rst:622 +#: ../../reference/lexical_analysis.rst:621 msgid "" "Octal escapes with value larger than ``0o377`` produce a :exc:" "`DeprecationWarning`." msgstr "" -#: ../../reference/lexical_analysis.rst:626 +#: ../../reference/lexical_analysis.rst:625 msgid "" "Octal escapes with value larger than ``0o377`` produce a :exc:" "`SyntaxWarning`. In a future Python version they will be eventually a :exc:" "`SyntaxError`." msgstr "" -#: ../../reference/lexical_analysis.rst:632 +#: ../../reference/lexical_analysis.rst:631 msgid "Unlike in Standard C, exactly two hex digits are required." msgstr "" -#: ../../reference/lexical_analysis.rst:635 +#: ../../reference/lexical_analysis.rst:634 msgid "" "In a bytes literal, hexadecimal and octal escapes denote the byte with the " "given value. In a string literal, these escapes denote a Unicode character " "with the given value." msgstr "" -#: ../../reference/lexical_analysis.rst:640 +#: ../../reference/lexical_analysis.rst:639 msgid "Support for name aliases [#]_ has been added." msgstr "" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:643 msgid "Exactly four hex digits are required." msgstr "" -#: ../../reference/lexical_analysis.rst:647 +#: ../../reference/lexical_analysis.rst:646 msgid "" "Any Unicode character can be encoded this way. Exactly eight hex digits are " "required." msgstr "" -#: ../../reference/lexical_analysis.rst:653 +#: ../../reference/lexical_analysis.rst:652 msgid "" "Unlike Standard C, all unrecognized escape sequences are left in the string " "unchanged, i.e., *the backslash is left in the result*. (This behavior is " @@ -854,17 +854,17 @@ msgid "" "category of unrecognized escapes for bytes literals." msgstr "" -#: ../../reference/lexical_analysis.rst:660 +#: ../../reference/lexical_analysis.rst:659 msgid "Unrecognized escape sequences produce a :exc:`DeprecationWarning`." msgstr "" -#: ../../reference/lexical_analysis.rst:663 +#: ../../reference/lexical_analysis.rst:662 msgid "" "Unrecognized escape sequences produce a :exc:`SyntaxWarning`. In a future " "Python version they will be eventually a :exc:`SyntaxError`." msgstr "" -#: ../../reference/lexical_analysis.rst:667 +#: ../../reference/lexical_analysis.rst:666 msgid "" "Even in a raw literal, quotes can be escaped with a backslash, but the " "backslash remains in the result; for example, ``r\"\\\"\"`` is a valid " @@ -877,11 +877,11 @@ msgid "" "continuation." msgstr "" -#: ../../reference/lexical_analysis.rst:680 +#: ../../reference/lexical_analysis.rst:679 msgid "String literal concatenation" msgstr "" -#: ../../reference/lexical_analysis.rst:682 +#: ../../reference/lexical_analysis.rst:681 msgid "" "Multiple adjacent string or bytes literals (delimited by whitespace), " "possibly using different quoting conventions, are allowed, and their meaning " @@ -891,7 +891,7 @@ msgid "" "lines, or even to add comments to parts of strings, for example::" msgstr "" -#: ../../reference/lexical_analysis.rst:693 +#: ../../reference/lexical_analysis.rst:692 msgid "" "Note that this feature is defined at the syntactical level, but implemented " "at compile time. The '+' operator must be used to concatenate string " @@ -901,11 +901,11 @@ msgid "" "with plain string literals." msgstr "" -#: ../../reference/lexical_analysis.rst:716 +#: ../../reference/lexical_analysis.rst:715 msgid "f-strings" msgstr "f-string(f 字串)" -#: ../../reference/lexical_analysis.rst:720 +#: ../../reference/lexical_analysis.rst:719 msgid "" "A :dfn:`formatted string literal` or :dfn:`f-string` is a string literal " "that is prefixed with ``'f'`` or ``'F'``. These strings may contain " @@ -914,14 +914,14 @@ msgid "" "are really expressions evaluated at run time." msgstr "" -#: ../../reference/lexical_analysis.rst:726 +#: ../../reference/lexical_analysis.rst:725 msgid "" "Escape sequences are decoded like in ordinary string literals (except when a " "literal is also marked as a raw string). After decoding, the grammar for " "the contents of the string is:" msgstr "" -#: ../../reference/lexical_analysis.rst:740 +#: ../../reference/lexical_analysis.rst:739 msgid "" "The parts of the string outside curly braces are treated literally, except " "that any doubled curly braces ``'{{'`` or ``'}}'`` are replaced with the " @@ -934,7 +934,7 @@ msgid "" "replacement field ends with a closing curly bracket ``'}'``." msgstr "" -#: ../../reference/lexical_analysis.rst:750 +#: ../../reference/lexical_analysis.rst:749 msgid "" "Expressions in formatted string literals are treated like regular Python " "expressions surrounded by parentheses, with a few exceptions. An empty " @@ -948,20 +948,20 @@ msgid "" "replacement fields must be closed in a different line." msgstr "" -#: ../../reference/lexical_analysis.rst:767 +#: ../../reference/lexical_analysis.rst:766 msgid "" "Prior to Python 3.7, an :keyword:`await` expression and comprehensions " "containing an :keyword:`async for` clause were illegal in the expressions in " "formatted string literals due to a problem with the implementation." msgstr "" -#: ../../reference/lexical_analysis.rst:772 +#: ../../reference/lexical_analysis.rst:771 msgid "" "Prior to Python 3.12, comments were not allowed inside f-string replacement " "fields." msgstr "" -#: ../../reference/lexical_analysis.rst:776 +#: ../../reference/lexical_analysis.rst:775 msgid "" "When the equal sign ``'='`` is provided, the output will have the expression " "text, the ``'='`` and the evaluated value. Spaces after the opening brace " @@ -972,18 +972,18 @@ msgid "" "r'`` is declared." msgstr "" -#: ../../reference/lexical_analysis.rst:784 +#: ../../reference/lexical_analysis.rst:783 msgid "The equal sign ``'='``." msgstr "等號 ``'='``。" -#: ../../reference/lexical_analysis.rst:787 +#: ../../reference/lexical_analysis.rst:786 msgid "" "If a conversion is specified, the result of evaluating the expression is " "converted before formatting. Conversion ``'!s'`` calls :func:`str` on the " "result, ``'!r'`` calls :func:`repr`, and ``'!a'`` calls :func:`ascii`." msgstr "" -#: ../../reference/lexical_analysis.rst:791 +#: ../../reference/lexical_analysis.rst:790 msgid "" "The result is then formatted using the :func:`format` protocol. The format " "specifier is passed to the :meth:`~object.__format__` method of the " @@ -992,7 +992,7 @@ msgid "" "value of the whole string." msgstr "" -#: ../../reference/lexical_analysis.rst:797 +#: ../../reference/lexical_analysis.rst:796 msgid "" "Top-level format specifiers may include nested replacement fields. These " "nested fields may include their own conversion fields and :ref:`format " @@ -1001,117 +1001,117 @@ msgid "" "as that used by the :meth:`str.format` method." msgstr "" -#: ../../reference/lexical_analysis.rst:803 +#: ../../reference/lexical_analysis.rst:802 msgid "" "Formatted string literals may be concatenated, but replacement fields cannot " "be split across literals." msgstr "" -#: ../../reference/lexical_analysis.rst:806 +#: ../../reference/lexical_analysis.rst:805 msgid "Some examples of formatted string literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:838 +#: ../../reference/lexical_analysis.rst:837 msgid "" "Reusing the outer f-string quoting type inside a replacement field is " "permitted::" msgstr "" -#: ../../reference/lexical_analysis.rst:845 +#: ../../reference/lexical_analysis.rst:844 msgid "" "Prior to Python 3.12, reuse of the same quoting type of the outer f-string " "inside a replacement field was not possible." msgstr "" -#: ../../reference/lexical_analysis.rst:849 +#: ../../reference/lexical_analysis.rst:848 msgid "" "Backslashes are also allowed in replacement fields and are evaluated the " "same way as in any other context::" msgstr "" -#: ../../reference/lexical_analysis.rst:859 +#: ../../reference/lexical_analysis.rst:858 msgid "" "Prior to Python 3.12, backslashes were not permitted inside an f-string " "replacement field." msgstr "" -#: ../../reference/lexical_analysis.rst:863 +#: ../../reference/lexical_analysis.rst:862 msgid "" "Formatted string literals cannot be used as docstrings, even if they do not " "include expressions." msgstr "" -#: ../../reference/lexical_analysis.rst:874 +#: ../../reference/lexical_analysis.rst:873 msgid "" "See also :pep:`498` for the proposal that added formatted string literals, " "and :meth:`str.format`, which uses a related format string mechanism." msgstr "" -#: ../../reference/lexical_analysis.rst:881 +#: ../../reference/lexical_analysis.rst:880 msgid "Numeric literals" msgstr "" -#: ../../reference/lexical_analysis.rst:887 +#: ../../reference/lexical_analysis.rst:886 msgid "" "There are three types of numeric literals: integers, floating point numbers, " "and imaginary numbers. There are no complex literals (complex numbers can " "be formed by adding a real number and an imaginary number)." msgstr "" -#: ../../reference/lexical_analysis.rst:891 +#: ../../reference/lexical_analysis.rst:890 msgid "" "Note that numeric literals do not include a sign; a phrase like ``-1`` is " "actually an expression composed of the unary operator '``-``' and the " "literal ``1``." msgstr "" -#: ../../reference/lexical_analysis.rst:905 +#: ../../reference/lexical_analysis.rst:904 msgid "Integer literals" msgstr "" -#: ../../reference/lexical_analysis.rst:907 +#: ../../reference/lexical_analysis.rst:906 msgid "Integer literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:921 +#: ../../reference/lexical_analysis.rst:920 msgid "" "There is no limit for the length of integer literals apart from what can be " "stored in available memory." msgstr "" -#: ../../reference/lexical_analysis.rst:924 +#: ../../reference/lexical_analysis.rst:923 msgid "" "Underscores are ignored for determining the numeric value of the literal. " "They can be used to group digits for enhanced readability. One underscore " "can occur between digits, and after base specifiers like ``0x``." msgstr "" -#: ../../reference/lexical_analysis.rst:928 +#: ../../reference/lexical_analysis.rst:927 msgid "" "Note that leading zeros in a non-zero decimal number are not allowed. This " "is for disambiguation with C-style octal literals, which Python used before " "version 3.0." msgstr "" -#: ../../reference/lexical_analysis.rst:932 +#: ../../reference/lexical_analysis.rst:931 msgid "Some examples of integer literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:938 -#: ../../reference/lexical_analysis.rst:970 +#: ../../reference/lexical_analysis.rst:937 +#: ../../reference/lexical_analysis.rst:969 msgid "Underscores are now allowed for grouping purposes in literals." msgstr "" -#: ../../reference/lexical_analysis.rst:949 +#: ../../reference/lexical_analysis.rst:948 msgid "Floating point literals" msgstr "" -#: ../../reference/lexical_analysis.rst:951 +#: ../../reference/lexical_analysis.rst:950 msgid "" "Floating point literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:961 +#: ../../reference/lexical_analysis.rst:960 msgid "" "Note that the integer and exponent parts are always interpreted using radix " "10. For example, ``077e010`` is legal, and denotes the same number as " @@ -1120,19 +1120,19 @@ msgid "" "grouping." msgstr "" -#: ../../reference/lexical_analysis.rst:966 +#: ../../reference/lexical_analysis.rst:965 msgid "Some examples of floating point literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:979 +#: ../../reference/lexical_analysis.rst:978 msgid "Imaginary literals" msgstr "" -#: ../../reference/lexical_analysis.rst:981 +#: ../../reference/lexical_analysis.rst:980 msgid "Imaginary literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:986 +#: ../../reference/lexical_analysis.rst:985 msgid "" "An imaginary literal yields a complex number with a real part of 0.0. " "Complex numbers are represented as a pair of floating point numbers and have " @@ -1141,23 +1141,23 @@ msgid "" "Some examples of imaginary literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:998 +#: ../../reference/lexical_analysis.rst:997 msgid "Operators" msgstr "" -#: ../../reference/lexical_analysis.rst:1002 +#: ../../reference/lexical_analysis.rst:1001 msgid "The following tokens are operators:" msgstr "" -#: ../../reference/lexical_analysis.rst:1015 +#: ../../reference/lexical_analysis.rst:1014 msgid "Delimiters" msgstr "" -#: ../../reference/lexical_analysis.rst:1019 +#: ../../reference/lexical_analysis.rst:1018 msgid "The following tokens serve as delimiters in the grammar:" msgstr "" -#: ../../reference/lexical_analysis.rst:1028 +#: ../../reference/lexical_analysis.rst:1027 msgid "" "The period can also occur in floating-point and imaginary literals. A " "sequence of three periods has a special meaning as an ellipsis literal. The " @@ -1165,23 +1165,23 @@ msgid "" "as delimiters, but also perform an operation." msgstr "" -#: ../../reference/lexical_analysis.rst:1033 +#: ../../reference/lexical_analysis.rst:1032 msgid "" "The following printing ASCII characters have special meaning as part of " "other tokens or are otherwise significant to the lexical analyzer:" msgstr "" -#: ../../reference/lexical_analysis.rst:1040 +#: ../../reference/lexical_analysis.rst:1039 msgid "" "The following printing ASCII characters are not used in Python. Their " "occurrence outside string literals and comments is an unconditional error:" msgstr "" -#: ../../reference/lexical_analysis.rst:1049 +#: ../../reference/lexical_analysis.rst:1048 msgid "Footnotes" msgstr "註解" -#: ../../reference/lexical_analysis.rst:1050 +#: ../../reference/lexical_analysis.rst:1049 msgid "https://www.unicode.org/Public/15.0.0/ucd/NameAliases.txt" msgstr "https://www.unicode.org/Public/15.0.0/ucd/NameAliases.txt" @@ -1207,7 +1207,7 @@ msgstr "logical line(邏輯列)" #: ../../reference/lexical_analysis.rst:35 #: ../../reference/lexical_analysis.rst:115 -#: ../../reference/lexical_analysis.rst:535 +#: ../../reference/lexical_analysis.rst:534 msgid "physical line" msgstr "physical line(物理列)" @@ -1396,216 +1396,216 @@ msgstr "raw string literal(原始字串常數)" msgid "r\"" msgstr "r\"" -#: ../../reference/lexical_analysis.rst:522 +#: ../../reference/lexical_analysis.rst:521 msgid "f'" msgstr "f'" -#: ../../reference/lexical_analysis.rst:522 -#: ../../reference/lexical_analysis.rst:700 +#: ../../reference/lexical_analysis.rst:521 +#: ../../reference/lexical_analysis.rst:699 msgid "formatted string literal" msgstr "formatted string literal(格式化字串常數)" -#: ../../reference/lexical_analysis.rst:522 +#: ../../reference/lexical_analysis.rst:521 msgid "f\"" msgstr "f\"" -#: ../../reference/lexical_analysis.rst:535 +#: ../../reference/lexical_analysis.rst:534 msgid "escape sequence" msgstr "escape sequence(跳脫序列)" -#: ../../reference/lexical_analysis.rst:535 +#: ../../reference/lexical_analysis.rst:534 msgid "Standard C" msgstr "Standard C(標準 C)" -#: ../../reference/lexical_analysis.rst:535 +#: ../../reference/lexical_analysis.rst:534 msgid "C" msgstr "C" -#: ../../reference/lexical_analysis.rst:535 +#: ../../reference/lexical_analysis.rst:534 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../reference/lexical_analysis.rst:535 +#: ../../reference/lexical_analysis.rst:534 msgid "\\\\" msgstr "\\\\" -#: ../../reference/lexical_analysis.rst:535 +#: ../../reference/lexical_analysis.rst:534 msgid "\\a" msgstr "\\a" -#: ../../reference/lexical_analysis.rst:535 +#: ../../reference/lexical_analysis.rst:534 msgid "\\b" msgstr "\\b" -#: ../../reference/lexical_analysis.rst:535 +#: ../../reference/lexical_analysis.rst:534 msgid "\\f" msgstr "\\f" -#: ../../reference/lexical_analysis.rst:535 +#: ../../reference/lexical_analysis.rst:534 msgid "\\n" msgstr "\\n" -#: ../../reference/lexical_analysis.rst:535 +#: ../../reference/lexical_analysis.rst:534 msgid "\\r" msgstr "\\r" -#: ../../reference/lexical_analysis.rst:535 +#: ../../reference/lexical_analysis.rst:534 msgid "\\t" msgstr "\\t" -#: ../../reference/lexical_analysis.rst:535 +#: ../../reference/lexical_analysis.rst:534 msgid "\\v" msgstr "\\v" -#: ../../reference/lexical_analysis.rst:535 +#: ../../reference/lexical_analysis.rst:534 msgid "\\x" msgstr "\\x" -#: ../../reference/lexical_analysis.rst:535 +#: ../../reference/lexical_analysis.rst:534 msgid "\\N" msgstr "\\N" -#: ../../reference/lexical_analysis.rst:535 +#: ../../reference/lexical_analysis.rst:534 msgid "\\u" msgstr "\\u" -#: ../../reference/lexical_analysis.rst:535 +#: ../../reference/lexical_analysis.rst:534 msgid "\\U" msgstr "\\U" -#: ../../reference/lexical_analysis.rst:651 +#: ../../reference/lexical_analysis.rst:650 msgid "unrecognized escape sequence" msgstr "unrecognized escape sequence(無法辨識的跳脫序列)" -#: ../../reference/lexical_analysis.rst:700 +#: ../../reference/lexical_analysis.rst:699 msgid "interpolated string literal" msgstr "interpolated string literal(插值字串常數)" -#: ../../reference/lexical_analysis.rst:700 +#: ../../reference/lexical_analysis.rst:699 msgid "string" msgstr "string(字串)" -#: ../../reference/lexical_analysis.rst:700 +#: ../../reference/lexical_analysis.rst:699 msgid "formatted literal" msgstr "formatted literal(格式化常數)" -#: ../../reference/lexical_analysis.rst:700 +#: ../../reference/lexical_analysis.rst:699 msgid "interpolated literal" msgstr "interpolated literal(插值常數)" -#: ../../reference/lexical_analysis.rst:700 +#: ../../reference/lexical_analysis.rst:699 msgid "f-string" msgstr "f-string(f 字串)" -#: ../../reference/lexical_analysis.rst:700 +#: ../../reference/lexical_analysis.rst:699 msgid "fstring" msgstr "fstring(f 字串)" -#: ../../reference/lexical_analysis.rst:700 +#: ../../reference/lexical_analysis.rst:699 msgid "{} (curly brackets)" msgstr "{} (花括號)" -#: ../../reference/lexical_analysis.rst:700 +#: ../../reference/lexical_analysis.rst:699 msgid "in formatted string literal" msgstr "於格式化字串常數中" -#: ../../reference/lexical_analysis.rst:700 +#: ../../reference/lexical_analysis.rst:699 msgid "! (exclamation)" msgstr "! (驚嘆號)" -#: ../../reference/lexical_analysis.rst:700 +#: ../../reference/lexical_analysis.rst:699 msgid ": (colon)" msgstr ": (冒號)" -#: ../../reference/lexical_analysis.rst:700 +#: ../../reference/lexical_analysis.rst:699 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/lexical_analysis.rst:700 +#: ../../reference/lexical_analysis.rst:699 msgid "for help in debugging using string literals" msgstr "for help in debugging using string literals(使用字串常數進行除錯)" -#: ../../reference/lexical_analysis.rst:883 +#: ../../reference/lexical_analysis.rst:882 msgid "number" msgstr "number(數字)" -#: ../../reference/lexical_analysis.rst:883 +#: ../../reference/lexical_analysis.rst:882 msgid "numeric literal" msgstr "numeric literal(數值常數)" -#: ../../reference/lexical_analysis.rst:883 -#: ../../reference/lexical_analysis.rst:896 +#: ../../reference/lexical_analysis.rst:882 +#: ../../reference/lexical_analysis.rst:895 msgid "integer literal" msgstr "integer literal(整數常數)" -#: ../../reference/lexical_analysis.rst:883 +#: ../../reference/lexical_analysis.rst:882 msgid "floating point literal" msgstr "floating point literal(浮點數常數)" -#: ../../reference/lexical_analysis.rst:883 +#: ../../reference/lexical_analysis.rst:882 msgid "hexadecimal literal" msgstr "hexadecimal literal(十六進位常數)" -#: ../../reference/lexical_analysis.rst:883 +#: ../../reference/lexical_analysis.rst:882 msgid "octal literal" msgstr "octal literal(八進位常數)" -#: ../../reference/lexical_analysis.rst:883 +#: ../../reference/lexical_analysis.rst:882 msgid "binary literal" msgstr "binary literal(二進位常數)" -#: ../../reference/lexical_analysis.rst:883 +#: ../../reference/lexical_analysis.rst:882 msgid "decimal literal" msgstr "decimal literal(十進位常數)" -#: ../../reference/lexical_analysis.rst:883 +#: ../../reference/lexical_analysis.rst:882 msgid "imaginary literal" msgstr "imaginary literal(虛數常數)" -#: ../../reference/lexical_analysis.rst:883 +#: ../../reference/lexical_analysis.rst:882 msgid "complex literal" msgstr "complex literal(複數常數)" -#: ../../reference/lexical_analysis.rst:896 +#: ../../reference/lexical_analysis.rst:895 msgid "0b" msgstr "0b" -#: ../../reference/lexical_analysis.rst:896 +#: ../../reference/lexical_analysis.rst:895 msgid "0o" msgstr "0o" -#: ../../reference/lexical_analysis.rst:896 +#: ../../reference/lexical_analysis.rst:895 msgid "0x" msgstr "0x" -#: ../../reference/lexical_analysis.rst:896 -#: ../../reference/lexical_analysis.rst:942 +#: ../../reference/lexical_analysis.rst:895 +#: ../../reference/lexical_analysis.rst:941 msgid "_ (underscore)" msgstr "_ (底線)" -#: ../../reference/lexical_analysis.rst:896 -#: ../../reference/lexical_analysis.rst:942 -#: ../../reference/lexical_analysis.rst:974 +#: ../../reference/lexical_analysis.rst:895 +#: ../../reference/lexical_analysis.rst:941 +#: ../../reference/lexical_analysis.rst:973 msgid "in numeric literal" msgstr "於數值常數中" -#: ../../reference/lexical_analysis.rst:942 +#: ../../reference/lexical_analysis.rst:941 msgid ". (dot)" msgstr ". (點)" -#: ../../reference/lexical_analysis.rst:942 +#: ../../reference/lexical_analysis.rst:941 msgid "e" msgstr "e" -#: ../../reference/lexical_analysis.rst:974 +#: ../../reference/lexical_analysis.rst:973 msgid "j" msgstr "j" -#: ../../reference/lexical_analysis.rst:1000 +#: ../../reference/lexical_analysis.rst:999 msgid "operators" msgstr "operators(運算子)" -#: ../../reference/lexical_analysis.rst:1017 +#: ../../reference/lexical_analysis.rst:1016 msgid "delimiters" msgstr "delimiters(分隔符號)" diff --git a/reference/simple_stmts.po b/reference/simple_stmts.po index 1173c08ea3..3d9e200d9e 100644 --- a/reference/simple_stmts.po +++ b/reference/simple_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-15 00:03+0000\n" +"POT-Creation-Date: 2024-03-07 17:26+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-" @@ -628,11 +628,11 @@ msgstr "" #: ../../reference/simple_stmts.rst:667 msgid "" -"The :attr:`~BaseException.__suppress_context__` attribute to suppress " +"Added the :attr:`~BaseException.__suppress_context__` attribute to suppress " "automatic display of the exception context." msgstr "" -#: ../../reference/simple_stmts.rst:671 +#: ../../reference/simple_stmts.rst:670 msgid "" "If the traceback of the active exception is modified in an :keyword:`except` " "clause, a subsequent ``raise`` statement re-raises the exception with the " @@ -640,41 +640,41 @@ msgid "" "traceback it had when it was caught." msgstr "" -#: ../../reference/simple_stmts.rst:680 +#: ../../reference/simple_stmts.rst:679 msgid "The :keyword:`!break` statement" msgstr "" -#: ../../reference/simple_stmts.rst:691 +#: ../../reference/simple_stmts.rst:690 msgid "" ":keyword:`break` may only occur syntactically nested in a :keyword:`for` or :" "keyword:`while` loop, but not nested in a function or class definition " "within that loop." msgstr "" -#: ../../reference/simple_stmts.rst:698 +#: ../../reference/simple_stmts.rst:697 msgid "" "It terminates the nearest enclosing loop, skipping the optional :keyword:`!" "else` clause if the loop has one." msgstr "" -#: ../../reference/simple_stmts.rst:701 +#: ../../reference/simple_stmts.rst:700 msgid "" "If a :keyword:`for` loop is terminated by :keyword:`break`, the loop control " "target keeps its current value." msgstr "" -#: ../../reference/simple_stmts.rst:706 +#: ../../reference/simple_stmts.rst:705 msgid "" "When :keyword:`break` passes control out of a :keyword:`try` statement with " "a :keyword:`finally` clause, that :keyword:`!finally` clause is executed " "before really leaving the loop." msgstr "" -#: ../../reference/simple_stmts.rst:714 +#: ../../reference/simple_stmts.rst:713 msgid "The :keyword:`!continue` statement" msgstr "" -#: ../../reference/simple_stmts.rst:726 +#: ../../reference/simple_stmts.rst:725 msgid "" ":keyword:`continue` may only occur syntactically nested in a :keyword:`for` " "or :keyword:`while` loop, but not nested in a function or class definition " @@ -682,41 +682,41 @@ msgid "" "loop." msgstr "" -#: ../../reference/simple_stmts.rst:730 +#: ../../reference/simple_stmts.rst:729 msgid "" "When :keyword:`continue` passes control out of a :keyword:`try` statement " "with a :keyword:`finally` clause, that :keyword:`!finally` clause is " "executed before really starting the next loop cycle." msgstr "" -#: ../../reference/simple_stmts.rst:739 +#: ../../reference/simple_stmts.rst:738 msgid "The :keyword:`!import` statement" msgstr "" -#: ../../reference/simple_stmts.rst:760 +#: ../../reference/simple_stmts.rst:759 msgid "" "The basic import statement (no :keyword:`from` clause) is executed in two " "steps:" msgstr "" -#: ../../reference/simple_stmts.rst:763 +#: ../../reference/simple_stmts.rst:762 msgid "find a module, loading and initializing it if necessary" msgstr "" -#: ../../reference/simple_stmts.rst:764 +#: ../../reference/simple_stmts.rst:763 msgid "" "define a name or names in the local namespace for the scope where the :" "keyword:`import` statement occurs." msgstr "" -#: ../../reference/simple_stmts.rst:767 +#: ../../reference/simple_stmts.rst:766 msgid "" "When the statement contains multiple clauses (separated by commas) the two " "steps are carried out separately for each clause, just as though the clauses " "had been separated out into individual import statements." msgstr "" -#: ../../reference/simple_stmts.rst:772 +#: ../../reference/simple_stmts.rst:771 msgid "" "The details of the first step, finding and loading modules, are described in " "greater detail in the section on the :ref:`import system `, " @@ -727,26 +727,26 @@ msgid "" "module, which includes execution of the module's code." msgstr "" -#: ../../reference/simple_stmts.rst:780 +#: ../../reference/simple_stmts.rst:779 msgid "" "If the requested module is retrieved successfully, it will be made available " "in the local namespace in one of three ways:" msgstr "" -#: ../../reference/simple_stmts.rst:785 +#: ../../reference/simple_stmts.rst:784 msgid "" "If the module name is followed by :keyword:`!as`, then the name following :" "keyword:`!as` is bound directly to the imported module." msgstr "" -#: ../../reference/simple_stmts.rst:787 +#: ../../reference/simple_stmts.rst:786 msgid "" "If no other name is specified, and the module being imported is a top level " "module, the module's name is bound in the local namespace as a reference to " "the imported module" msgstr "" -#: ../../reference/simple_stmts.rst:790 +#: ../../reference/simple_stmts.rst:789 msgid "" "If the module being imported is *not* a top level module, then the name of " "the top level package that contains the module is bound in the local " @@ -754,56 +754,56 @@ msgid "" "be accessed using its full qualified name rather than directly" msgstr "" -#: ../../reference/simple_stmts.rst:800 +#: ../../reference/simple_stmts.rst:799 msgid "The :keyword:`from` form uses a slightly more complex process:" msgstr "" -#: ../../reference/simple_stmts.rst:802 +#: ../../reference/simple_stmts.rst:801 msgid "" "find the module specified in the :keyword:`from` clause, loading and " "initializing it if necessary;" msgstr "" -#: ../../reference/simple_stmts.rst:804 +#: ../../reference/simple_stmts.rst:803 msgid "for each of the identifiers specified in the :keyword:`import` clauses:" msgstr "" -#: ../../reference/simple_stmts.rst:806 +#: ../../reference/simple_stmts.rst:805 msgid "check if the imported module has an attribute by that name" msgstr "" -#: ../../reference/simple_stmts.rst:807 +#: ../../reference/simple_stmts.rst:806 msgid "" "if not, attempt to import a submodule with that name and then check the " "imported module again for that attribute" msgstr "" -#: ../../reference/simple_stmts.rst:809 +#: ../../reference/simple_stmts.rst:808 msgid "if the attribute is not found, :exc:`ImportError` is raised." msgstr "" -#: ../../reference/simple_stmts.rst:810 +#: ../../reference/simple_stmts.rst:809 msgid "" "otherwise, a reference to that value is stored in the local namespace, using " "the name in the :keyword:`!as` clause if it is present, otherwise using the " "attribute name" msgstr "" -#: ../../reference/simple_stmts.rst:814 +#: ../../reference/simple_stmts.rst:813 msgid "Examples::" msgstr "" "範例:\n" "\n" "::" -#: ../../reference/simple_stmts.rst:824 +#: ../../reference/simple_stmts.rst:823 msgid "" "If the list of identifiers is replaced by a star (``'*'``), all public names " "defined in the module are bound in the local namespace for the scope where " "the :keyword:`import` statement occurs." msgstr "" -#: ../../reference/simple_stmts.rst:830 +#: ../../reference/simple_stmts.rst:829 msgid "" "The *public names* defined by a module are determined by checking the " "module's namespace for a variable named ``__all__``; if defined, it must be " @@ -816,14 +816,14 @@ msgid "" "API (such as library modules which were imported and used within the module)." msgstr "" -#: ../../reference/simple_stmts.rst:840 +#: ../../reference/simple_stmts.rst:839 msgid "" "The wild card form of import --- ``from module import *`` --- is only " "allowed at the module level. Attempting to use it in class or function " "definitions will raise a :exc:`SyntaxError`." msgstr "" -#: ../../reference/simple_stmts.rst:847 +#: ../../reference/simple_stmts.rst:846 msgid "" "When specifying what module to import you do not have to specify the " "absolute name of the module. When a module or package is contained within " @@ -840,13 +840,13 @@ msgid "" "the :ref:`relativeimports` section." msgstr "" -#: ../../reference/simple_stmts.rst:861 +#: ../../reference/simple_stmts.rst:860 msgid "" ":func:`importlib.import_module` is provided to support applications that " "determine dynamically the modules to be loaded." msgstr "" -#: ../../reference/simple_stmts.rst:864 +#: ../../reference/simple_stmts.rst:863 msgid "" "Raises an :ref:`auditing event ` ``import`` with arguments " "``module``, ``filename``, ``sys.path``, ``sys.meta_path``, ``sys." @@ -855,18 +855,18 @@ msgstr "" "引發一個附帶引數 ``module``、``filename``、``sys.path``、``sys.meta_path``、" "``sys.path_hooks`` 的\\ :ref:`稽核事件 ` ``import``。" -#: ../../reference/simple_stmts.rst:869 +#: ../../reference/simple_stmts.rst:868 msgid "Future statements" msgstr "" -#: ../../reference/simple_stmts.rst:875 +#: ../../reference/simple_stmts.rst:874 msgid "" "A :dfn:`future statement` is a directive to the compiler that a particular " "module should be compiled using syntax or semantics that will be available " "in a specified future release of Python where the feature becomes standard." msgstr "" -#: ../../reference/simple_stmts.rst:879 +#: ../../reference/simple_stmts.rst:878 msgid "" "The future statement is intended to ease migration to future versions of " "Python that introduce incompatible changes to the language. It allows use " @@ -874,35 +874,35 @@ msgid "" "feature becomes standard." msgstr "" -#: ../../reference/simple_stmts.rst:891 +#: ../../reference/simple_stmts.rst:890 msgid "" "A future statement must appear near the top of the module. The only lines " "that can appear before a future statement are:" msgstr "" -#: ../../reference/simple_stmts.rst:894 +#: ../../reference/simple_stmts.rst:893 msgid "the module docstring (if any)," msgstr "" -#: ../../reference/simple_stmts.rst:895 +#: ../../reference/simple_stmts.rst:894 msgid "comments," msgstr "" -#: ../../reference/simple_stmts.rst:896 +#: ../../reference/simple_stmts.rst:895 msgid "blank lines, and" msgstr "" -#: ../../reference/simple_stmts.rst:897 +#: ../../reference/simple_stmts.rst:896 msgid "other future statements." msgstr "" -#: ../../reference/simple_stmts.rst:899 +#: ../../reference/simple_stmts.rst:898 msgid "" "The only feature that requires using the future statement is ``annotations`` " "(see :pep:`563`)." msgstr "" -#: ../../reference/simple_stmts.rst:902 +#: ../../reference/simple_stmts.rst:901 msgid "" "All historical features enabled by the future statement are still recognized " "by Python 3. The list includes ``absolute_import``, ``division``, " @@ -912,7 +912,7 @@ msgid "" "compatibility." msgstr "" -#: ../../reference/simple_stmts.rst:909 +#: ../../reference/simple_stmts.rst:908 msgid "" "A future statement is recognized and treated specially at compile time: " "Changes to the semantics of core constructs are often implemented by " @@ -922,37 +922,37 @@ msgid "" "cannot be pushed off until runtime." msgstr "" -#: ../../reference/simple_stmts.rst:916 +#: ../../reference/simple_stmts.rst:915 msgid "" "For any given release, the compiler knows which feature names have been " "defined, and raises a compile-time error if a future statement contains a " "feature not known to it." msgstr "" -#: ../../reference/simple_stmts.rst:920 +#: ../../reference/simple_stmts.rst:919 msgid "" "The direct runtime semantics are the same as for any import statement: there " "is a standard module :mod:`__future__`, described later, and it will be " "imported in the usual way at the time the future statement is executed." msgstr "" -#: ../../reference/simple_stmts.rst:924 +#: ../../reference/simple_stmts.rst:923 msgid "" "The interesting runtime semantics depend on the specific feature enabled by " "the future statement." msgstr "" -#: ../../reference/simple_stmts.rst:927 +#: ../../reference/simple_stmts.rst:926 msgid "Note that there is nothing special about the statement::" msgstr "" -#: ../../reference/simple_stmts.rst:931 +#: ../../reference/simple_stmts.rst:930 msgid "" "That is not a future statement; it's an ordinary import statement with no " "special semantics or syntax restrictions." msgstr "" -#: ../../reference/simple_stmts.rst:934 +#: ../../reference/simple_stmts.rst:933 msgid "" "Code compiled by calls to the built-in functions :func:`exec` and :func:" "`compile` that occur in a module :mod:`!M` containing a future statement " @@ -961,7 +961,7 @@ msgid "" "--- see the documentation of that function for details." msgstr "" -#: ../../reference/simple_stmts.rst:940 +#: ../../reference/simple_stmts.rst:939 msgid "" "A future statement typed at an interactive interpreter prompt will take " "effect for the rest of the interpreter session. If an interpreter is " @@ -970,19 +970,19 @@ msgid "" "interactive session started after the script is executed." msgstr "" -#: ../../reference/simple_stmts.rst:948 +#: ../../reference/simple_stmts.rst:947 msgid ":pep:`236` - Back to the __future__" msgstr "" -#: ../../reference/simple_stmts.rst:949 +#: ../../reference/simple_stmts.rst:948 msgid "The original proposal for the __future__ mechanism." msgstr "" -#: ../../reference/simple_stmts.rst:955 +#: ../../reference/simple_stmts.rst:954 msgid "The :keyword:`!global` statement" msgstr "" -#: ../../reference/simple_stmts.rst:965 +#: ../../reference/simple_stmts.rst:964 msgid "" "The :keyword:`global` statement is a declaration which holds for the entire " "current code block. It means that the listed identifiers are to be " @@ -991,13 +991,13 @@ msgid "" "globals without being declared global." msgstr "" -#: ../../reference/simple_stmts.rst:971 +#: ../../reference/simple_stmts.rst:970 msgid "" "Names listed in a :keyword:`global` statement must not be used in the same " "code block textually preceding that :keyword:`!global` statement." msgstr "" -#: ../../reference/simple_stmts.rst:974 +#: ../../reference/simple_stmts.rst:973 msgid "" "Names listed in a :keyword:`global` statement must not be defined as formal " "parameters, or as targets in :keyword:`with` statements or :keyword:`except` " @@ -1005,14 +1005,14 @@ msgid "" "function definition, :keyword:`import` statement, or variable annotation." msgstr "" -#: ../../reference/simple_stmts.rst:981 +#: ../../reference/simple_stmts.rst:980 msgid "" "The current implementation does not enforce some of these restrictions, but " "programs should not abuse this freedom, as future implementations may " "enforce them or silently change the meaning of the program." msgstr "" -#: ../../reference/simple_stmts.rst:990 +#: ../../reference/simple_stmts.rst:989 msgid "" "**Programmer's note:** :keyword:`global` is a directive to the parser. It " "applies only to code parsed at the same time as the :keyword:`!global` " @@ -1024,11 +1024,11 @@ msgid "" "func:`compile` functions." msgstr "" -#: ../../reference/simple_stmts.rst:1002 +#: ../../reference/simple_stmts.rst:1001 msgid "The :keyword:`!nonlocal` statement" msgstr "" -#: ../../reference/simple_stmts.rst:1010 +#: ../../reference/simple_stmts.rst:1009 msgid "" "The :keyword:`nonlocal` statement causes the listed identifiers to refer to " "previously bound variables in the nearest enclosing scope excluding globals. " @@ -1037,7 +1037,7 @@ msgid "" "variables outside of the local scope besides the global (module) scope." msgstr "" -#: ../../reference/simple_stmts.rst:1016 +#: ../../reference/simple_stmts.rst:1015 msgid "" "Names listed in a :keyword:`nonlocal` statement, unlike those listed in a :" "keyword:`global` statement, must refer to pre-existing bindings in an " @@ -1045,45 +1045,45 @@ msgid "" "be determined unambiguously)." msgstr "" -#: ../../reference/simple_stmts.rst:1021 +#: ../../reference/simple_stmts.rst:1020 msgid "" "Names listed in a :keyword:`nonlocal` statement must not collide with pre-" "existing bindings in the local scope." msgstr "" -#: ../../reference/simple_stmts.rst:1026 +#: ../../reference/simple_stmts.rst:1025 msgid ":pep:`3104` - Access to Names in Outer Scopes" msgstr "" -#: ../../reference/simple_stmts.rst:1027 +#: ../../reference/simple_stmts.rst:1026 msgid "The specification for the :keyword:`nonlocal` statement." msgstr "" -#: ../../reference/simple_stmts.rst:1032 +#: ../../reference/simple_stmts.rst:1031 msgid "The :keyword:`!type` statement" msgstr "" -#: ../../reference/simple_stmts.rst:1039 +#: ../../reference/simple_stmts.rst:1038 msgid "" "The :keyword:`!type` statement declares a type alias, which is an instance " "of :class:`typing.TypeAliasType`." msgstr "" -#: ../../reference/simple_stmts.rst:1042 +#: ../../reference/simple_stmts.rst:1041 msgid "For example, the following statement creates a type alias::" msgstr "" -#: ../../reference/simple_stmts.rst:1046 +#: ../../reference/simple_stmts.rst:1045 msgid "This code is roughly equivalent to::" msgstr "" -#: ../../reference/simple_stmts.rst:1052 +#: ../../reference/simple_stmts.rst:1051 msgid "" "``annotation-def`` indicates an :ref:`annotation scope `, " "which behaves mostly like a function, but with several small differences." msgstr "" -#: ../../reference/simple_stmts.rst:1055 +#: ../../reference/simple_stmts.rst:1054 msgid "" "The value of the type alias is evaluated in the annotation scope. It is not " "evaluated when the type alias is created, but only when the value is " @@ -1092,21 +1092,21 @@ msgid "" "not yet defined." msgstr "" -#: ../../reference/simple_stmts.rst:1061 +#: ../../reference/simple_stmts.rst:1060 msgid "" "Type aliases may be made generic by adding a :ref:`type parameter list ` after the name. See :ref:`generic-type-aliases` for more." msgstr "" -#: ../../reference/simple_stmts.rst:1064 +#: ../../reference/simple_stmts.rst:1063 msgid ":keyword:`!type` is a :ref:`soft keyword `." msgstr "" -#: ../../reference/simple_stmts.rst:1071 +#: ../../reference/simple_stmts.rst:1070 msgid ":pep:`695` - Type Parameter Syntax" msgstr "" -#: ../../reference/simple_stmts.rst:1071 +#: ../../reference/simple_stmts.rst:1070 msgid "" "Introduced the :keyword:`!type` statement and syntax for generic classes and " "functions." @@ -1122,10 +1122,10 @@ msgstr "" #: ../../reference/simple_stmts.rst:422 ../../reference/simple_stmts.rst:444 #: ../../reference/simple_stmts.rst:457 ../../reference/simple_stmts.rst:483 #: ../../reference/simple_stmts.rst:520 ../../reference/simple_stmts.rst:556 -#: ../../reference/simple_stmts.rst:682 ../../reference/simple_stmts.rst:716 -#: ../../reference/simple_stmts.rst:741 ../../reference/simple_stmts.rst:871 -#: ../../reference/simple_stmts.rst:957 ../../reference/simple_stmts.rst:1004 -#: ../../reference/simple_stmts.rst:1034 +#: ../../reference/simple_stmts.rst:681 ../../reference/simple_stmts.rst:715 +#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:870 +#: ../../reference/simple_stmts.rst:956 ../../reference/simple_stmts.rst:1003 +#: ../../reference/simple_stmts.rst:1033 msgid "statement" msgstr "statement(陳述式)" @@ -1139,7 +1139,7 @@ msgstr "" msgid "list" msgstr "list(串列)" -#: ../../reference/simple_stmts.rst:56 ../../reference/simple_stmts.rst:985 +#: ../../reference/simple_stmts.rst:56 ../../reference/simple_stmts.rst:984 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -1204,14 +1204,14 @@ msgstr "assignment statement(賦值陳述式)" msgid "assignment" msgstr "assignment(賦值)" -#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:741 -#: ../../reference/simple_stmts.rst:796 ../../reference/simple_stmts.rst:957 +#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:740 +#: ../../reference/simple_stmts.rst:795 ../../reference/simple_stmts.rst:956 msgid "binding" msgstr "binding(繫結)" #: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:457 -#: ../../reference/simple_stmts.rst:741 ../../reference/simple_stmts.rst:796 -#: ../../reference/simple_stmts.rst:957 +#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:795 +#: ../../reference/simple_stmts.rst:956 msgid "name" msgstr "name(名稱)" @@ -1229,13 +1229,13 @@ msgid "attribute" msgstr "attribute(屬性)" #: ../../reference/simple_stmts.rst:105 ../../reference/simple_stmts.rst:116 -#: ../../reference/simple_stmts.rst:444 ../../reference/simple_stmts.rst:695 +#: ../../reference/simple_stmts.rst:444 ../../reference/simple_stmts.rst:694 msgid "target" msgstr "target" #: ../../reference/simple_stmts.rst:116 ../../reference/simple_stmts.rst:379 -#: ../../reference/simple_stmts.rst:741 ../../reference/simple_stmts.rst:957 -#: ../../reference/simple_stmts.rst:1004 +#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:956 +#: ../../reference/simple_stmts.rst:1003 msgid ", (comma)" msgstr ", (逗號)" @@ -1243,7 +1243,7 @@ msgstr ", (逗號)" msgid "in target list" msgstr "於目標列表中" -#: ../../reference/simple_stmts.rst:116 ../../reference/simple_stmts.rst:822 +#: ../../reference/simple_stmts.rst:116 ../../reference/simple_stmts.rst:821 msgid "* (asterisk)" msgstr "* (星號)" @@ -1381,7 +1381,7 @@ msgstr "__debug__" #: ../../reference/simple_stmts.rst:400 ../../reference/simple_stmts.rst:520 #: ../../reference/simple_stmts.rst:556 ../../reference/simple_stmts.rst:588 -#: ../../reference/simple_stmts.rst:741 +#: ../../reference/simple_stmts.rst:740 msgid "exception" msgstr "exception(例外)" @@ -1409,7 +1409,7 @@ msgstr "del" msgid "deletion" msgstr "deletion(刪除)" -#: ../../reference/simple_stmts.rst:457 ../../reference/simple_stmts.rst:957 +#: ../../reference/simple_stmts.rst:457 ../../reference/simple_stmts.rst:956 msgid "global" msgstr "global" @@ -1433,14 +1433,14 @@ msgstr "definition(定義)" msgid "class" msgstr "class(類別)" -#: ../../reference/simple_stmts.rst:499 ../../reference/simple_stmts.rst:695 -#: ../../reference/simple_stmts.rst:704 ../../reference/simple_stmts.rst:716 -#: ../../reference/simple_stmts.rst:741 +#: ../../reference/simple_stmts.rst:499 ../../reference/simple_stmts.rst:694 +#: ../../reference/simple_stmts.rst:703 ../../reference/simple_stmts.rst:715 +#: ../../reference/simple_stmts.rst:740 msgid "keyword" msgstr "keyword(關鍵字)" -#: ../../reference/simple_stmts.rst:499 ../../reference/simple_stmts.rst:704 -#: ../../reference/simple_stmts.rst:716 +#: ../../reference/simple_stmts.rst:499 ../../reference/simple_stmts.rst:703 +#: ../../reference/simple_stmts.rst:715 msgid "finally" msgstr "finally" @@ -1488,103 +1488,103 @@ msgstr "__cause__(例外屬性)" msgid "__context__ (exception attribute)" msgstr "__context__(例外屬性)" -#: ../../reference/simple_stmts.rst:682 +#: ../../reference/simple_stmts.rst:681 msgid "break" msgstr "break" -#: ../../reference/simple_stmts.rst:682 ../../reference/simple_stmts.rst:716 +#: ../../reference/simple_stmts.rst:681 ../../reference/simple_stmts.rst:715 msgid "for" msgstr "for" -#: ../../reference/simple_stmts.rst:682 ../../reference/simple_stmts.rst:716 +#: ../../reference/simple_stmts.rst:681 ../../reference/simple_stmts.rst:715 msgid "while" msgstr "while" -#: ../../reference/simple_stmts.rst:682 ../../reference/simple_stmts.rst:716 +#: ../../reference/simple_stmts.rst:681 ../../reference/simple_stmts.rst:715 msgid "loop" msgstr "loop(迴圈)" -#: ../../reference/simple_stmts.rst:695 +#: ../../reference/simple_stmts.rst:694 msgid "else" msgstr "else" -#: ../../reference/simple_stmts.rst:695 +#: ../../reference/simple_stmts.rst:694 msgid "loop control" msgstr "loop control(迴圈控制)" -#: ../../reference/simple_stmts.rst:716 +#: ../../reference/simple_stmts.rst:715 msgid "continue" msgstr "continue" -#: ../../reference/simple_stmts.rst:741 ../../reference/simple_stmts.rst:844 +#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:843 msgid "import" msgstr "import(引入)" -#: ../../reference/simple_stmts.rst:741 +#: ../../reference/simple_stmts.rst:740 msgid "module" msgstr "module(模組)" -#: ../../reference/simple_stmts.rst:741 +#: ../../reference/simple_stmts.rst:740 msgid "importing" msgstr "importing(引入)" -#: ../../reference/simple_stmts.rst:741 ../../reference/simple_stmts.rst:796 +#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:795 msgid "from" msgstr "from" -#: ../../reference/simple_stmts.rst:741 ../../reference/simple_stmts.rst:783 +#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:782 msgid "as" msgstr "as" -#: ../../reference/simple_stmts.rst:741 +#: ../../reference/simple_stmts.rst:740 msgid "ImportError" msgstr "ImportError" -#: ../../reference/simple_stmts.rst:741 ../../reference/simple_stmts.rst:783 -#: ../../reference/simple_stmts.rst:796 ../../reference/simple_stmts.rst:822 +#: ../../reference/simple_stmts.rst:740 ../../reference/simple_stmts.rst:782 +#: ../../reference/simple_stmts.rst:795 ../../reference/simple_stmts.rst:821 msgid "import statement" msgstr "import statement(引入陳述式)" -#: ../../reference/simple_stmts.rst:828 +#: ../../reference/simple_stmts.rst:827 msgid "__all__ (optional module attribute)" msgstr "__all__(可選模組屬性)" -#: ../../reference/simple_stmts.rst:844 +#: ../../reference/simple_stmts.rst:843 msgid "relative" msgstr "relative(相對)" -#: ../../reference/simple_stmts.rst:871 +#: ../../reference/simple_stmts.rst:870 msgid "future" msgstr "future" -#: ../../reference/simple_stmts.rst:871 +#: ../../reference/simple_stmts.rst:870 msgid "__future__" msgstr "__future__" -#: ../../reference/simple_stmts.rst:871 +#: ../../reference/simple_stmts.rst:870 msgid "future statement" msgstr "future statement(future 陳述式)" -#: ../../reference/simple_stmts.rst:957 ../../reference/simple_stmts.rst:1004 +#: ../../reference/simple_stmts.rst:956 ../../reference/simple_stmts.rst:1003 msgid "identifier list" msgstr "identifier list(識別符號清單)" -#: ../../reference/simple_stmts.rst:985 +#: ../../reference/simple_stmts.rst:984 msgid "exec" msgstr "exec" -#: ../../reference/simple_stmts.rst:985 +#: ../../reference/simple_stmts.rst:984 msgid "eval" msgstr "eval" -#: ../../reference/simple_stmts.rst:985 +#: ../../reference/simple_stmts.rst:984 msgid "compile" msgstr "compile(編譯)" -#: ../../reference/simple_stmts.rst:1004 +#: ../../reference/simple_stmts.rst:1003 msgid "nonlocal" msgstr "nonlocal" -#: ../../reference/simple_stmts.rst:1034 +#: ../../reference/simple_stmts.rst:1033 msgid "type" msgstr "" diff --git a/using/cmdline.po b/using/cmdline.po index c6e6dc4569..24b81d907b 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-11 00:04+0000\n" +"POT-Creation-Date: 2024-03-07 17:26+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-" @@ -493,7 +493,7 @@ msgid "" "secret." msgstr "" -#: ../../using/cmdline.rst:378 +#: ../../using/cmdline.rst:380 msgid "The option is no longer ignored." msgstr "" @@ -503,8 +503,8 @@ msgid "" "`sys.path`." msgstr "" -#: ../../using/cmdline.rst:391 ../../using/cmdline.rst:805 -#: ../../using/cmdline.rst:817 +#: ../../using/cmdline.rst:391 ../../using/cmdline.rst:799 +#: ../../using/cmdline.rst:811 msgid ":pep:`370` -- Per user site-packages directory" msgstr "" @@ -554,7 +554,7 @@ msgid "" "messages to :data:`sys.stderr`." msgstr "" -#: ../../using/cmdline.rst:433 ../../using/cmdline.rst:833 +#: ../../using/cmdline.rst:433 ../../using/cmdline.rst:827 msgid "" "The simplest settings apply a particular action unconditionally to all " "warnings emitted by a process (even those that are otherwise ignored by " @@ -627,7 +627,7 @@ msgid "" "can be used to use a regular expression on the warning message." msgstr "" -#: ../../using/cmdline.rst:483 ../../using/cmdline.rst:844 +#: ../../using/cmdline.rst:483 ../../using/cmdline.rst:838 msgid "" "See :ref:`warning-filter` and :ref:`describing-warning-filters` for more " "details." @@ -747,76 +747,74 @@ msgid "" "data:`sys._xoptions` dictionary." msgstr "" -#: ../../using/cmdline.rst:553 -msgid "The :option:`-X` option was added." -msgstr "新增 :option:`-X` 選項。" - -#: ../../using/cmdline.rst:556 -msgid "The ``-X faulthandler`` option." +#: ../../using/cmdline.rst:555 +#, fuzzy +msgid "Added the ``-X faulthandler`` option." msgstr "``-X faulthandler`` 選項。" -#: ../../using/cmdline.rst:559 -msgid "The ``-X showrefcount`` and ``-X tracemalloc`` options." +#: ../../using/cmdline.rst:558 +#, fuzzy +msgid "Added the ``-X showrefcount`` and ``-X tracemalloc`` options." msgstr "``-X showrefcount`` 和 ``-X tracemalloc`` 選項。" -#: ../../using/cmdline.rst:562 -msgid "The ``-X showalloccount`` option." +#: ../../using/cmdline.rst:561 +#, fuzzy +msgid "Added the ``-X showalloccount`` option." msgstr "``-X showalloccount`` 選項。" -#: ../../using/cmdline.rst:565 -msgid "The ``-X importtime``, ``-X dev`` and ``-X utf8`` options." +#: ../../using/cmdline.rst:564 +#, fuzzy +msgid "Added the ``-X importtime``, ``-X dev`` and ``-X utf8`` options." msgstr "``-X importtime``、``-X dev`` 和 ``-X utf8`` 選項。" -#: ../../using/cmdline.rst:568 +#: ../../using/cmdline.rst:567 msgid "" -"The ``-X pycache_prefix`` option. The ``-X dev`` option now logs ``close()`` " -"exceptions in :class:`io.IOBase` destructor." +"Added the ``-X pycache_prefix`` option. The ``-X dev`` option now logs " +"``close()`` exceptions in :class:`io.IOBase` destructor." msgstr "" -#: ../../using/cmdline.rst:572 +#: ../../using/cmdline.rst:571 msgid "" "Using ``-X dev`` option, check *encoding* and *errors* arguments on string " "encoding and decoding operations." msgstr "" -#: ../../using/cmdline.rst:576 +#: ../../using/cmdline.rst:575 msgid "The ``-X showalloccount`` option has been removed." msgstr "``-X showalloccount`` 選項已被移除。" -#: ../../using/cmdline.rst:578 +#: ../../using/cmdline.rst:577 +#, fuzzy msgid "" -"The ``-X warn_default_encoding`` option. Removed the ``-X oldparser`` option." +"Added the ``-X warn_default_encoding`` option. Removed the ``-X oldparser`` " +"option." msgstr "``-X warn_default_encoding`` 選項。``-X oldparser`` 選項已被移除。" -#: ../../using/cmdline.rst:582 -msgid "The ``-X no_debug_ranges`` option." -msgstr "``-X no_debug_ranges`` 選項。" +#: ../../using/cmdline.rst:581 +#, fuzzy +msgid "" +"Added the ``-X no_debug_ranges``, ``-X frozen_modules`` and ``-X " +"int_max_str_digits`` options." +msgstr "``-X importtime``、``-X dev`` 和 ``-X utf8`` 選項。" #: ../../using/cmdline.rst:585 -msgid "The ``-X frozen_modules`` option." -msgstr "``-X frozen_modules`` 選項。" - -#: ../../using/cmdline.rst:588 -msgid "The ``-X int_max_str_digits`` option." -msgstr "``-X int_max_str_digits`` 選項。" - -#: ../../using/cmdline.rst:591 -msgid "The ``-X perf`` option." +#, fuzzy +msgid "Added the ``-X perf`` option." msgstr "``-X perf`` 選項。" -#: ../../using/cmdline.rst:596 +#: ../../using/cmdline.rst:590 msgid "Options you shouldn't use" msgstr "你不該使用的選項" -#: ../../using/cmdline.rst:600 +#: ../../using/cmdline.rst:594 msgid "Reserved for use by Jython_." msgstr "" -#: ../../using/cmdline.rst:608 +#: ../../using/cmdline.rst:602 msgid "Environment variables" msgstr "環境變數" -#: ../../using/cmdline.rst:610 +#: ../../using/cmdline.rst:604 msgid "" "These environment variables influence Python's behavior, they are processed " "before the command-line switches other than -E or -I. It is customary that " @@ -824,7 +822,7 @@ msgid "" "conflict." msgstr "" -#: ../../using/cmdline.rst:617 +#: ../../using/cmdline.rst:611 msgid "" "Change the location of the standard Python libraries. By default, the " "libraries are searched in :file:`{prefix}/lib/python{version}` and :file:" @@ -833,14 +831,14 @@ msgid "" "file:`/usr/local`." msgstr "" -#: ../../using/cmdline.rst:623 +#: ../../using/cmdline.rst:617 msgid "" "When :envvar:`PYTHONHOME` is set to a single directory, its value replaces " "both :file:`{prefix}` and :file:`{exec_prefix}`. To specify different " "values for these, set :envvar:`PYTHONHOME` to :file:`{prefix}:{exec_prefix}`." msgstr "" -#: ../../using/cmdline.rst:630 +#: ../../using/cmdline.rst:624 msgid "" "Augment the default search path for module files. The format is the same as " "the shell's :envvar:`PATH`: one or more directory pathnames separated by :" @@ -848,21 +846,21 @@ msgid "" "existent directories are silently ignored." msgstr "" -#: ../../using/cmdline.rst:635 +#: ../../using/cmdline.rst:629 msgid "" "In addition to normal directories, individual :envvar:`PYTHONPATH` entries " "may refer to zipfiles containing pure Python modules (in either source or " "compiled form). Extension modules cannot be imported from zipfiles." msgstr "" -#: ../../using/cmdline.rst:639 +#: ../../using/cmdline.rst:633 msgid "" "The default search path is installation dependent, but generally begins " "with :file:`{prefix}/lib/python{version}` (see :envvar:`PYTHONHOME` above). " "It is *always* appended to :envvar:`PYTHONPATH`." msgstr "" -#: ../../using/cmdline.rst:643 +#: ../../using/cmdline.rst:637 msgid "" "An additional directory will be inserted in the search path in front of :" "envvar:`PYTHONPATH` as described above under :ref:`using-on-interface-" @@ -870,19 +868,19 @@ msgid "" "the variable :data:`sys.path`." msgstr "" -#: ../../using/cmdline.rst:651 +#: ../../using/cmdline.rst:645 msgid "" "If this is set to a non-empty string, don't prepend a potentially unsafe " "path to :data:`sys.path`: see the :option:`-P` option for details." msgstr "" -#: ../../using/cmdline.rst:659 +#: ../../using/cmdline.rst:653 msgid "" "If this is set to a non-empty string, it overrides the :data:`sys." "platlibdir` value." msgstr "" -#: ../../using/cmdline.rst:667 +#: ../../using/cmdline.rst:661 msgid "" "If this is the name of a readable file, the Python commands in that file are " "executed before the first prompt is displayed in interactive mode. The file " @@ -893,7 +891,7 @@ msgid "" "file." msgstr "" -#: ../../using/cmdline.rst:674 +#: ../../using/cmdline.rst:668 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_startup`` with " "argument ``filename``." @@ -901,7 +899,7 @@ msgstr "" "引發一個附帶引數 ``filename`` 的\\ :ref:`稽核事件 ` ``cpython." "run_startup``。" -#: ../../using/cmdline.rst:676 +#: ../../using/cmdline.rst:670 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_startup`` with the " "filename as the argument when called on startup." @@ -909,14 +907,14 @@ msgstr "" "引發一個附帶呼叫啟動時的檔案名稱為引數的\\ :ref:`稽核事件 ` " "``cpython.run_startup``。" -#: ../../using/cmdline.rst:682 +#: ../../using/cmdline.rst:676 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-O` option. If set to an integer, it is equivalent to specifying :" "option:`-O` multiple times." msgstr "" -#: ../../using/cmdline.rst:689 +#: ../../using/cmdline.rst:683 msgid "" "If this is set, it names a callable using dotted-path notation. The module " "containing the callable will be imported and then the callable will be run " @@ -927,58 +925,58 @@ msgid "" "breakpointhook` to do nothing but return immediately." msgstr "" -#: ../../using/cmdline.rst:701 +#: ../../using/cmdline.rst:695 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-d` option. If set to an integer, it is equivalent to specifying :" "option:`-d` multiple times." msgstr "" -#: ../../using/cmdline.rst:705 +#: ../../using/cmdline.rst:699 msgid "" "This environment variable requires a :ref:`debug build of Python `, otherwise it's ignored." msgstr "" -#: ../../using/cmdline.rst:711 +#: ../../using/cmdline.rst:705 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-i` option." msgstr "" -#: ../../using/cmdline.rst:714 +#: ../../using/cmdline.rst:708 msgid "" "This variable can also be modified by Python code using :data:`os.environ` " "to force inspect mode on program termination." msgstr "" -#: ../../using/cmdline.rst:720 +#: ../../using/cmdline.rst:714 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-u` option." msgstr "" -#: ../../using/cmdline.rst:726 +#: ../../using/cmdline.rst:720 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-v` option. If set to an integer, it is equivalent to specifying :" "option:`-v` multiple times." msgstr "" -#: ../../using/cmdline.rst:733 +#: ../../using/cmdline.rst:727 msgid "" "If this is set, Python ignores case in :keyword:`import` statements. This " "only works on Windows and macOS." msgstr "" -#: ../../using/cmdline.rst:739 +#: ../../using/cmdline.rst:733 msgid "" "If this is set to a non-empty string, Python won't try to write ``.pyc`` " "files on the import of source modules. This is equivalent to specifying " "the :option:`-B` option." msgstr "" -#: ../../using/cmdline.rst:746 +#: ../../using/cmdline.rst:740 msgid "" "If this is set, Python will write ``.pyc`` files in a mirror directory tree " "at this path, instead of in ``__pycache__`` directories within the source " @@ -986,40 +984,40 @@ msgid "" "``pycache_prefix=PATH`` option." msgstr "" -#: ../../using/cmdline.rst:756 +#: ../../using/cmdline.rst:750 msgid "" "If this variable is not set or set to ``random``, a random value is used to " "seed the hashes of str and bytes objects." msgstr "" -#: ../../using/cmdline.rst:759 +#: ../../using/cmdline.rst:753 msgid "" "If :envvar:`PYTHONHASHSEED` is set to an integer value, it is used as a " "fixed seed for generating the hash() of the types covered by the hash " "randomization." msgstr "" -#: ../../using/cmdline.rst:763 +#: ../../using/cmdline.rst:757 msgid "" "Its purpose is to allow repeatable hashing, such as for selftests for the " "interpreter itself, or to allow a cluster of python processes to share hash " "values." msgstr "" -#: ../../using/cmdline.rst:767 +#: ../../using/cmdline.rst:761 msgid "" "The integer must be a decimal number in the range [0,4294967295]. " "Specifying the value 0 will disable hash randomization." msgstr "" -#: ../../using/cmdline.rst:774 +#: ../../using/cmdline.rst:768 msgid "" "If this variable is set to an integer, it is used to configure the " "interpreter's global :ref:`integer string conversion length limitation " "`." msgstr "" -#: ../../using/cmdline.rst:782 +#: ../../using/cmdline.rst:776 msgid "" "If this is set before running the interpreter, it overrides the encoding " "used for stdin/stdout/stderr, in the syntax ``encodingname:errorhandler``. " @@ -1027,17 +1025,17 @@ msgid "" "have the same meaning as in :func:`str.encode`." msgstr "" -#: ../../using/cmdline.rst:787 +#: ../../using/cmdline.rst:781 msgid "" "For stderr, the ``:errorhandler`` part is ignored; the handler will always " "be ``'backslashreplace'``." msgstr "" -#: ../../using/cmdline.rst:790 +#: ../../using/cmdline.rst:784 msgid "The ``encodingname`` part is now optional." msgstr "" -#: ../../using/cmdline.rst:793 +#: ../../using/cmdline.rst:787 msgid "" "On Windows, the encoding specified by this variable is ignored for " "interactive console buffers unless :envvar:`PYTHONLEGACYWINDOWSSTDIO` is " @@ -1045,13 +1043,13 @@ msgid "" "not affected." msgstr "" -#: ../../using/cmdline.rst:800 +#: ../../using/cmdline.rst:794 msgid "" "If this is set, Python won't add the :data:`user site-packages directory " "` to :data:`sys.path`." msgstr "" -#: ../../using/cmdline.rst:810 +#: ../../using/cmdline.rst:804 msgid "" "Defines the :data:`user base directory `, which is used to " "compute the path of the :data:`user site-packages directory ` of the :mod:`asyncio` module." msgstr "" -#: ../../using/cmdline.rst:892 +#: ../../using/cmdline.rst:886 msgid "Set the Python memory allocators and/or install debug hooks." msgstr "" -#: ../../using/cmdline.rst:894 +#: ../../using/cmdline.rst:888 msgid "Set the family of memory allocators used by Python:" msgstr "" -#: ../../using/cmdline.rst:896 +#: ../../using/cmdline.rst:890 msgid "" "``default``: use the :ref:`default memory allocators `." msgstr "" -#: ../../using/cmdline.rst:898 +#: ../../using/cmdline.rst:892 msgid "" "``malloc``: use the :c:func:`malloc` function of the C library for all " "domains (:c:macro:`PYMEM_DOMAIN_RAW`, :c:macro:`PYMEM_DOMAIN_MEM`, :c:macro:" "`PYMEM_DOMAIN_OBJ`)." msgstr "" -#: ../../using/cmdline.rst:901 +#: ../../using/cmdline.rst:895 msgid "" "``pymalloc``: use the :ref:`pymalloc allocator ` for :c:macro:" "`PYMEM_DOMAIN_MEM` and :c:macro:`PYMEM_DOMAIN_OBJ` domains and use the :c:" "func:`malloc` function for the :c:macro:`PYMEM_DOMAIN_RAW` domain." msgstr "" -#: ../../using/cmdline.rst:905 +#: ../../using/cmdline.rst:899 msgid "Install :ref:`debug hooks `:" msgstr "" -#: ../../using/cmdline.rst:907 +#: ../../using/cmdline.rst:901 msgid "" "``debug``: install debug hooks on top of the :ref:`default memory allocators " "`." msgstr "" -#: ../../using/cmdline.rst:909 +#: ../../using/cmdline.rst:903 msgid "``malloc_debug``: same as ``malloc`` but also install debug hooks." msgstr "" -#: ../../using/cmdline.rst:910 +#: ../../using/cmdline.rst:904 msgid "``pymalloc_debug``: same as ``pymalloc`` but also install debug hooks." msgstr "" -#: ../../using/cmdline.rst:912 +#: ../../using/cmdline.rst:908 msgid "Added the ``\"default\"`` allocator." msgstr "" -#: ../../using/cmdline.rst:920 +#: ../../using/cmdline.rst:914 msgid "" "If set to a non-empty string, Python will print statistics of the :ref:" "`pymalloc memory allocator ` every time a new pymalloc object " "arena is created, and on shutdown." msgstr "" -#: ../../using/cmdline.rst:924 +#: ../../using/cmdline.rst:918 msgid "" "This variable is ignored if the :envvar:`PYTHONMALLOC` environment variable " "is used to force the :c:func:`malloc` allocator of the C library, or if " "Python is configured without ``pymalloc`` support." msgstr "" -#: ../../using/cmdline.rst:928 +#: ../../using/cmdline.rst:922 msgid "" "This variable can now also be used on Python compiled in release mode. It " "now has no effect if set to an empty string." msgstr "" -#: ../../using/cmdline.rst:935 +#: ../../using/cmdline.rst:929 msgid "" "If set to a non-empty string, the default :term:`filesystem encoding and " "error handler` mode will revert to their pre-3.6 values of 'mbcs' and " @@ -1182,41 +1180,41 @@ msgid "" "'surrogatepass' are used." msgstr "" -#: ../../using/cmdline.rst:940 +#: ../../using/cmdline.rst:934 msgid "" "This may also be enabled at runtime with :func:`sys." "_enablelegacywindowsfsencoding()`." msgstr "" -#: ../../using/cmdline.rst:943 ../../using/cmdline.rst:957 +#: ../../using/cmdline.rst:937 ../../using/cmdline.rst:951 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../using/cmdline.rst:945 +#: ../../using/cmdline.rst:939 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`。" -#: ../../using/cmdline.rst:950 +#: ../../using/cmdline.rst:944 msgid "" "If set to a non-empty string, does not use the new console reader and " "writer. This means that Unicode characters will be encoded according to the " "active console code page, rather than using utf-8." msgstr "" -#: ../../using/cmdline.rst:954 +#: ../../using/cmdline.rst:948 msgid "" "This variable is ignored if the standard streams are redirected (to files or " "pipes) rather than referring to console buffers." msgstr "" -#: ../../using/cmdline.rst:964 +#: ../../using/cmdline.rst:958 msgid "" "If set to the value ``0``, causes the main Python command line application " "to skip coercing the legacy ASCII-based C and POSIX locales to a more " "capable UTF-8 based alternative." msgstr "" -#: ../../using/cmdline.rst:968 +#: ../../using/cmdline.rst:962 msgid "" "If this variable is *not* set (or is set to a value other than ``0``), the " "``LC_ALL`` locale override environment variable is also not set, and the " @@ -1227,19 +1225,19 @@ msgid "" "runtime:" msgstr "" -#: ../../using/cmdline.rst:976 +#: ../../using/cmdline.rst:970 msgid "``C.UTF-8``" msgstr "``C.UTF-8``" -#: ../../using/cmdline.rst:977 +#: ../../using/cmdline.rst:971 msgid "``C.utf8``" msgstr "``C.utf8``" -#: ../../using/cmdline.rst:978 +#: ../../using/cmdline.rst:972 msgid "``UTF-8``" msgstr "``UTF-8``" -#: ../../using/cmdline.rst:980 +#: ../../using/cmdline.rst:974 msgid "" "If setting one of these locale categories succeeds, then the ``LC_CTYPE`` " "environment variable will also be set accordingly in the current process " @@ -1252,7 +1250,7 @@ msgid "" "(such as Python's own :func:`locale.getdefaultlocale`)." msgstr "" -#: ../../using/cmdline.rst:990 +#: ../../using/cmdline.rst:984 msgid "" "Configuring one of these locales (either explicitly or via the above " "implicit locale coercion) automatically enables the ``surrogateescape`` :ref:" @@ -1262,7 +1260,7 @@ msgid "" "envvar:`PYTHONIOENCODING` as usual." msgstr "" -#: ../../using/cmdline.rst:997 +#: ../../using/cmdline.rst:991 msgid "" "For debugging purposes, setting ``PYTHONCOERCECLOCALE=warn`` will cause " "Python to emit warning messages on ``stderr`` if either the locale coercion " @@ -1270,7 +1268,7 @@ msgid "" "active when the Python runtime is initialized." msgstr "" -#: ../../using/cmdline.rst:1002 +#: ../../using/cmdline.rst:996 msgid "" "Also note that even when locale coercion is disabled, or when it fails to " "find a suitable target locale, :envvar:`PYTHONUTF8` will still activate by " @@ -1279,15 +1277,15 @@ msgid "" "system interfaces." msgstr "" -#: ../../using/cmdline.rst:1008 +#: ../../using/cmdline.rst:1002 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../using/cmdline.rst:1010 +#: ../../using/cmdline.rst:1004 msgid "See :pep:`538` for more details." msgstr "更多細節請見 :pep:`538`。" -#: ../../using/cmdline.rst:1016 +#: ../../using/cmdline.rst:1010 msgid "" "If this environment variable is set to a non-empty string, enable :ref:" "`Python Development Mode `, introducing additional runtime checks " @@ -1295,31 +1293,31 @@ msgid "" "setting the :option:`-X` ``dev`` option." msgstr "" -#: ../../using/cmdline.rst:1025 +#: ../../using/cmdline.rst:1019 msgid "If set to ``1``, enable the :ref:`Python UTF-8 Mode `." msgstr "如果設為 ``1``,則啟用 :ref:`Python UTF-8 Mode `。" -#: ../../using/cmdline.rst:1027 +#: ../../using/cmdline.rst:1021 msgid "If set to ``0``, disable the :ref:`Python UTF-8 Mode `." msgstr "如果設為 ``0``,則停用 :ref:`Python UTF-8 Mode `。" -#: ../../using/cmdline.rst:1029 +#: ../../using/cmdline.rst:1023 msgid "" "Setting any other non-empty string causes an error during interpreter " "initialisation." msgstr "" -#: ../../using/cmdline.rst:1036 +#: ../../using/cmdline.rst:1030 msgid "" "If this environment variable is set to a non-empty string, issue a :class:" "`EncodingWarning` when the locale-specific default encoding is used." msgstr "" -#: ../../using/cmdline.rst:1039 +#: ../../using/cmdline.rst:1033 msgid "See :ref:`io-encoding-warning` for details." msgstr "細節請見 :ref:`io-encoding-warning`。" -#: ../../using/cmdline.rst:1045 +#: ../../using/cmdline.rst:1039 msgid "" "If this variable is set, it disables the inclusion of the tables mapping " "extra location information (end line, start column offset and end column " @@ -1328,39 +1326,51 @@ msgid "" "visual location indicators when the interpreter displays tracebacks." msgstr "" -#: ../../using/cmdline.rst:1055 +#: ../../using/cmdline.rst:1049 msgid "" "If this variable is set to a nonzero value, it enables support for the Linux " "``perf`` profiler so Python calls can be detected by it." msgstr "" -#: ../../using/cmdline.rst:1058 +#: ../../using/cmdline.rst:1052 msgid "If set to ``0``, disable Linux ``perf`` profiler support." msgstr "" -#: ../../using/cmdline.rst:1060 +#: ../../using/cmdline.rst:1054 msgid "" "See also the :option:`-X perf <-X>` command-line option and :ref:" "`perf_profiling`." msgstr "" -#: ../../using/cmdline.rst:1067 +#: ../../using/cmdline.rst:1061 msgid "Debug-mode variables" msgstr "除錯模式變數" -#: ../../using/cmdline.rst:1071 +#: ../../using/cmdline.rst:1065 msgid "" "If set, Python will dump objects and reference counts still alive after " "shutting down the interpreter." msgstr "" -#: ../../using/cmdline.rst:1074 ../../using/cmdline.rst:1081 +#: ../../using/cmdline.rst:1068 ../../using/cmdline.rst:1075 msgid "" "Need Python configured with the :option:`--with-trace-refs` build option." msgstr "" -#: ../../using/cmdline.rst:1078 +#: ../../using/cmdline.rst:1072 msgid "" "If set, Python will dump objects and reference counts still alive after " "shutting down the interpreter into a file called *FILENAME*." msgstr "" + +#~ msgid "The :option:`-X` option was added." +#~ msgstr "新增 :option:`-X` 選項。" + +#~ msgid "The ``-X no_debug_ranges`` option." +#~ msgstr "``-X no_debug_ranges`` 選項。" + +#~ msgid "The ``-X frozen_modules`` option." +#~ msgstr "``-X frozen_modules`` 選項。" + +#~ msgid "The ``-X int_max_str_digits`` option." +#~ msgstr "``-X int_max_str_digits`` 選項。" From e2865ef86d79ae48023e89b6d8f2627c42c9024b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 10 Mar 2024 00:05:29 +0000 Subject: [PATCH 32/33] sync with cpython 0d5455fc --- library/enum.po | 228 +++++++++++++++++++++++--------------------- library/resource.po | 170 ++++++++++++++++----------------- 2 files changed, 203 insertions(+), 195 deletions(-) diff --git a/library/enum.po b/library/enum.po index c51df46328..6ebd4778b2 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-29 00:03+0000\n" +"POT-Creation-Date: 2024-03-10 00:03+0000\n" "PO-Revision-Date: 2023-09-11 14:08+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -473,11 +473,16 @@ msgstr "用來定義 ``Enum`` 成員的名稱: ::" msgid "The value given to the ``Enum`` member::" msgstr "``Enum`` 成員給定的值: ::" -#: ../../library/enum.rst:272 +#: ../../library/enum.rst:272 ../../library/enum.rst:292 +#, fuzzy +msgid "Value of the member, can be set in :meth:`~object.__new__`." +msgstr "``_value_`` -- 成員的值;可以在 ``__new__`` 設定或修改" + +#: ../../library/enum.rst:274 msgid "Enum member values" msgstr "列舉成員的值" -#: ../../library/enum.rst:274 +#: ../../library/enum.rst:276 msgid "" "Member values can be anything: :class:`int`, :class:`str`, etc. If the " "exact value is unimportant you may use :class:`auto` instances and an " @@ -488,16 +493,19 @@ msgstr "" "class:`auto`。" #: ../../library/enum.rst:281 +msgid "" +"While mutable/unhashable values, such as :class:`dict`, :class:`list` or a " +"mutable :class:`~dataclasses.dataclass`, can be used, they will have a " +"quadratic performance impact during creation relative to the total number of " +"mutable/unhashable values in the enum." +msgstr "" + +#: ../../library/enum.rst:288 #, fuzzy msgid "Name of the member." msgstr "``_name_`` -- 成員名稱" -#: ../../library/enum.rst:285 -#, fuzzy -msgid "Value of the member, can be set in :meth:`~object.__new__`." -msgstr "``_value_`` -- 成員的值;可以在 ``__new__`` 設定或修改" - -#: ../../library/enum.rst:289 +#: ../../library/enum.rst:296 #, fuzzy msgid "" "No longer used, kept for backward compatibility. (class attribute, removed " @@ -506,13 +514,13 @@ msgstr "" "``_order_`` -- 在 Python 2/3 的程式裡用來確保成員順序是一致的(類別屬性,在類" "別建立時移除)" -#: ../../library/enum.rst:294 +#: ../../library/enum.rst:301 msgid "" "``_ignore_`` is only used during creation and is removed from the " "enumeration once creation is complete." msgstr "``_ignore_`` 只有在建立的時候用到,在列舉建立完成後會被移除。" -#: ../../library/enum.rst:297 +#: ../../library/enum.rst:304 msgid "" "``_ignore_`` is a list of names that will not become members, and whose " "names will also be removed from the completed enumeration. See :ref:" @@ -521,7 +529,7 @@ msgstr "" "``_ignore_`` 是一個不會變成成員的名稱串列,在列舉建立完成後其名稱會被移除。範" "例請參考 :ref:`TimePeriod `。" -#: ../../library/enum.rst:303 +#: ../../library/enum.rst:310 msgid "" "Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any " "public methods defined on *self.__class__*::" @@ -533,11 +541,11 @@ msgstr "" msgid "name" msgstr "name" -#: ../../library/enum.rst:324 +#: ../../library/enum.rst:331 msgid "The name of the member being defined (e.g. 'RED')." msgstr "定義的成員名稱(例如 'RED')。" -#: ../../library/enum.rst:325 +#: ../../library/enum.rst:332 msgid "The start value for the Enum; the default is 1." msgstr "列舉的開始值,預設為 1。" @@ -545,7 +553,7 @@ msgstr "列舉的開始值,預設為 1。" msgid "count" msgstr "count" -#: ../../library/enum.rst:326 +#: ../../library/enum.rst:333 msgid "The number of members currently defined, not including this one." msgstr "已定義的成員數量,不包含目前這一個。" @@ -553,35 +561,35 @@ msgstr "已定義的成員數量,不包含目前這一個。" msgid "last_values" msgstr "last_values" -#: ../../library/enum.rst:327 +#: ../../library/enum.rst:334 msgid "A list of the previous values." msgstr "一個之前值的串列。" -#: ../../library/enum.rst:329 +#: ../../library/enum.rst:336 msgid "" "A *staticmethod* that is used to determine the next value returned by :class:" "`auto`::" msgstr "一個 *staticmethod*,用來決定 :class:`auto` 下一個要回傳的值的: ::" -#: ../../library/enum.rst:345 +#: ../../library/enum.rst:352 msgid "" "By default, does nothing. If multiple values are given in the member " "assignment, those values become separate arguments to ``__init__``; e.g." msgstr "" -#: ../../library/enum.rst:352 +#: ../../library/enum.rst:359 msgid "" "``Weekday.__init__()`` would be called as ``Weekday.__init__(self, 1, " "'Mon')``" msgstr "" -#: ../../library/enum.rst:356 +#: ../../library/enum.rst:363 msgid "" "A *classmethod* that is used to further configure subsequent subclasses. By " "default, does nothing." msgstr "一個 *classmethod*,用來進一步設定後續的子類別,預設不做任何事。" -#: ../../library/enum.rst:361 +#: ../../library/enum.rst:368 msgid "" "A *classmethod* for looking up values not found in *cls*. By default it " "does nothing, but can be overridden to implement custom search behavior::" @@ -589,28 +597,28 @@ msgstr "" "一個 *classmethod*,用來查詢在 *cls* 裡找不到的值。預設不做任何事,但可以被覆" "寫以實作客製化的搜尋行為: ::" -#: ../../library/enum.rst:383 +#: ../../library/enum.rst:390 msgid "" "By default, doesn't exist. If specified, either in the enum class " "definition or in a mixin class (such as ``int``), all values given in the " "member assignment will be passed; e.g." msgstr "" -#: ../../library/enum.rst:391 +#: ../../library/enum.rst:398 msgid "" "results in the call ``int('1a', 16)`` and a value of ``17`` for the member." msgstr "" -#: ../../library/enum.rst:393 +#: ../../library/enum.rst:400 msgid "" "..note:: When writing a custom ``__new__``, do not use ``super().__new__`` --" msgstr "" -#: ../../library/enum.rst:394 +#: ../../library/enum.rst:401 msgid "call the appropriate ``__new__`` instead." msgstr "" -#: ../../library/enum.rst:398 +#: ../../library/enum.rst:405 msgid "" "Returns the string used for *repr()* calls. By default, returns the *Enum* " "name, member name, and value, but can be overridden::" @@ -618,7 +626,7 @@ msgstr "" "回傳呼叫 *repr()* 時使用的字串。預設回傳 *Enum* 名稱、成員名稱及值,但可以被" "覆寫: ::" -#: ../../library/enum.rst:414 +#: ../../library/enum.rst:421 msgid "" "Returns the string used for *str()* calls. By default, returns the *Enum* " "name and member name, but can be overridden::" @@ -626,7 +634,7 @@ msgstr "" "回傳呼叫 *str()* 時使用的字串。預設回傳 *Enum* 名稱及成員名稱,但可以被覆" "寫: ::" -#: ../../library/enum.rst:429 +#: ../../library/enum.rst:436 msgid "" "Returns the string used for *format()* and *f-string* calls. By default, " "returns :meth:`__str__` return value, but can be overridden::" @@ -634,17 +642,17 @@ msgstr "" "回傳呼叫 *format()* 及 *f-string* 時使用的字串。預設回傳 :meth:`__str__` 的回" "傳值,但可以被覆寫: ::" -#: ../../library/enum.rst:444 +#: ../../library/enum.rst:451 msgid "" "Using :class:`auto` with :class:`Enum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`Enum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:447 +#: ../../library/enum.rst:454 msgid "Added :ref:`enum-dataclass-support`" msgstr "新增 :ref:`enum-dataclass-support`" -#: ../../library/enum.rst:452 +#: ../../library/enum.rst:459 msgid "" "*IntEnum* is the same as *Enum*, but its members are also integers and can " "be used anywhere that an integer can be used. If any integer operation is " @@ -654,13 +662,13 @@ msgstr "" "*IntEnum* 和 *Enum* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" "方。如果 *IntEnum* 成員經過任何整數運算,其結果會失去列舉狀態。" -#: ../../library/enum.rst:473 +#: ../../library/enum.rst:480 msgid "" "Using :class:`auto` with :class:`IntEnum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`IntEnum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:476 +#: ../../library/enum.rst:483 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` was " @@ -670,7 +678,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:483 +#: ../../library/enum.rst:490 msgid "" "*StrEnum* is the same as *Enum*, but its members are also strings and can be " "used in most of the same places that a string can be used. The result of " @@ -680,7 +688,7 @@ msgstr "" "*StrEnum* 和 *Enum* 一樣,但其成員同時也是字串而可以被用在幾乎所有使用字串的" "地方。*StrEnum* 成員經過任何字串操作的結果會不再是列舉的一部份。" -#: ../../library/enum.rst:489 +#: ../../library/enum.rst:496 msgid "" "There are places in the stdlib that check for an exact :class:`str` instead " "of a :class:`str` subclass (i.e. ``type(unknown) == str`` instead of " @@ -691,13 +699,13 @@ msgstr "" "是 ``type(unknown) == str`` 而不是 ``isinstance(unknown, str)``),在這些地方" "你需要使用 ``str(StrEnum.member)``。" -#: ../../library/enum.rst:496 +#: ../../library/enum.rst:503 msgid "" "Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " "name as the value." msgstr ":class:`StrEnum` 使用 :class:`auto` 會產生小寫的成員名稱當作值。" -#: ../../library/enum.rst:501 +#: ../../library/enum.rst:508 msgid "" ":meth:`~object.__str__` is :meth:`!str.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` is " @@ -707,7 +715,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!str.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 也會是 :meth:`!str.__format__`。" -#: ../../library/enum.rst:509 +#: ../../library/enum.rst:516 #, fuzzy msgid "" "``Flag`` is the same as :class:`Enum`, but its members support the bitwise " @@ -717,39 +725,39 @@ msgstr "" "*Flag* 成員支援位元操作 ``&`` (*AND*)、``|`` (*OR*)、``^`` (*XOR*) 及 ``~`` " "(*INVERT*);這些操作的結果會是列舉成員。" -#: ../../library/enum.rst:515 +#: ../../library/enum.rst:522 msgid "Returns *True* if value is in self::" msgstr "如果 value 在 self 裡則回傳 *True*: ::" -#: ../../library/enum.rst:536 +#: ../../library/enum.rst:543 msgid "Returns all contained non-alias members::" msgstr "回傳所有包含的非別名成員: ::" -#: ../../library/enum.rst:547 +#: ../../library/enum.rst:554 msgid "Returns number of members in flag::" msgstr "回傳旗標裡的成員數量: ::" -#: ../../library/enum.rst:556 +#: ../../library/enum.rst:563 msgid "Returns *True* if any members in flag, *False* otherwise::" msgstr "如果成員在旗標裡則回傳 *True*,否則回傳 *False*: ::" -#: ../../library/enum.rst:568 +#: ../../library/enum.rst:575 msgid "Returns current flag binary or'ed with other::" msgstr "回傳和 other 做 OR 過後的二進位旗標: ::" -#: ../../library/enum.rst:575 +#: ../../library/enum.rst:582 msgid "Returns current flag binary and'ed with other::" msgstr "回傳和 other 做 AND 過後的二進位旗標: ::" -#: ../../library/enum.rst:584 +#: ../../library/enum.rst:591 msgid "Returns current flag binary xor'ed with other::" msgstr "回傳和 other 做 XOR 過後的二進位旗標: ::" -#: ../../library/enum.rst:593 +#: ../../library/enum.rst:600 msgid "Returns all the flags in *type(self)* that are not in self::" msgstr "回傳所有在 *type(self)* 但不在 self 裡的旗標: ::" -#: ../../library/enum.rst:604 +#: ../../library/enum.rst:611 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." @@ -757,17 +765,17 @@ msgstr "" "用來格式化任何剩下未命名數值的函式。預設是值的 repr,常見選擇是 :func:`hex` " "和 :func:`oct`。" -#: ../../library/enum.rst:609 +#: ../../library/enum.rst:616 msgid "" "Using :class:`auto` with :class:`Flag` results in integers that are powers " "of two, starting with ``1``." msgstr ":class:`Flag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:612 +#: ../../library/enum.rst:619 msgid "The *repr()* of zero-valued flags has changed. It is now::" msgstr "值為 0 的旗標的 *repr()* 已改變。現在是: ::" -#: ../../library/enum.rst:620 +#: ../../library/enum.rst:627 msgid "" "*IntFlag* is the same as *Flag*, but its members are also integers and can " "be used anywhere that an integer can be used." @@ -775,38 +783,38 @@ msgstr "" "*IntFlag* 和 *Flag* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" "方。" -#: ../../library/enum.rst:634 +#: ../../library/enum.rst:641 msgid "" "If any integer operation is performed with an *IntFlag* member, the result " "is not an *IntFlag*::" msgstr "如果 *IntFlag* 成員經過任何整數運算,其結果不是 *IntFlag*: ::" -#: ../../library/enum.rst:640 +#: ../../library/enum.rst:647 msgid "If a *Flag* operation is performed with an *IntFlag* member and:" msgstr "如果 *IntFlag* 成員經過 *Flag* 操作且:" -#: ../../library/enum.rst:642 +#: ../../library/enum.rst:649 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" msgstr "結果是合法的 *IntFlag*:回傳 *IntFlag*" -#: ../../library/enum.rst:643 +#: ../../library/enum.rst:650 msgid "" "the result is not a valid *IntFlag*: the result depends on the " "*FlagBoundary* setting" msgstr "結果不是合法的 *IntFlag*:結果會根據 *FlagBoundary* 的設定" -#: ../../library/enum.rst:645 +#: ../../library/enum.rst:652 msgid "The *repr()* of unnamed zero-valued flags has changed. It is now:" msgstr "未命名且值為 0 的旗標的 *repr()* 已改變。現在是: ::" -#: ../../library/enum.rst:652 +#: ../../library/enum.rst:659 msgid "" "Using :class:`auto` with :class:`IntFlag` results in integers that are " "powers of two, starting with ``1``." msgstr "" ":class:`IntFlag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:657 +#: ../../library/enum.rst:664 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` " @@ -816,7 +824,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:661 +#: ../../library/enum.rst:668 msgid "" "Inversion of an :class:`!IntFlag` now returns a positive value that is the " "union of all flags not in the given flag, rather than a negative value. This " @@ -825,7 +833,7 @@ msgstr "" ":class:`!IntFlag` 的反轉 (inversion) 現在會回傳正值,該值是不在給定旗標的所有" "旗標聯集,而不是一個負值。這符合現有 :class:`Flag` 的行為。" -#: ../../library/enum.rst:667 +#: ../../library/enum.rst:674 msgid "" ":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" @@ -833,15 +841,15 @@ msgstr "" ":class:`!ReprEnum` 使用 :class:`Enum` 的 :meth:`repr() `,但使" "用混合資料類型的 :class:`str() `:" -#: ../../library/enum.rst:670 +#: ../../library/enum.rst:677 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" msgstr "對 :class:`IntEnum` 和 :class:`IntFlag` 是 :meth:`!int.__str__`" -#: ../../library/enum.rst:671 +#: ../../library/enum.rst:678 msgid ":meth:`!str.__str__` for :class:`StrEnum`" msgstr "對 :class:`StrEnum` 是 :meth:`!str.__str__`" -#: ../../library/enum.rst:673 +#: ../../library/enum.rst:680 msgid "" "Inherit from :class:`!ReprEnum` to keep the :class:`str() ` / :func:" "`format` of the mixed-in data type instead of using the :class:`Enum`-" @@ -850,7 +858,7 @@ msgstr "" "繼承 :class:`!ReprEnum` 來保留混合資料類型的 :class:`str() ` / :func:" "`format`,而不是使用 :class:`Enum` 預設的 :meth:`str() `。" -#: ../../library/enum.rst:682 +#: ../../library/enum.rst:689 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." @@ -858,17 +866,17 @@ msgstr "" "*EnumCheck* 包含 :func:`verify` 裝飾器使用的選項,以確保多樣的限制,不符合限" "制會產生 :exc:`ValueError`。" -#: ../../library/enum.rst:687 +#: ../../library/enum.rst:694 msgid "Ensure that each value has only one name::" msgstr "確保每個值只有一個名稱: ::" -#: ../../library/enum.rst:703 +#: ../../library/enum.rst:710 msgid "" "Ensure that there are no missing values between the lowest-valued member and " "the highest-valued member::" msgstr "確保在最小值成員跟最大值成員間沒有缺少值: ::" -#: ../../library/enum.rst:718 +#: ../../library/enum.rst:725 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`::" @@ -876,35 +884,35 @@ msgstr "" "確保任何旗標群組 / 遮罩只包含命名旗標 -- 當值是用指定而不是透過 :func:`auto` " "產生時是很實用的: ::" -#: ../../library/enum.rst:735 +#: ../../library/enum.rst:742 msgid "" "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." msgstr "CONTINUOUS 和 NAMED_FLAGS 是設計用來運作在整數值的成員上。" -#: ../../library/enum.rst:741 +#: ../../library/enum.rst:748 msgid "" "*FlagBoundary* controls how out-of-range values are handled in *Flag* and " "its subclasses." msgstr "*FlagBoundary* 控制在 *Flag* 及其子類別中如何處理範圍外的值。" -#: ../../library/enum.rst:746 +#: ../../library/enum.rst:753 msgid "" "Out-of-range values cause a :exc:`ValueError` to be raised. This is the " "default for :class:`Flag`::" msgstr "範圍外的值會引發 :exc:`ValueError`。這是 :class:`Flag` 的預設行為: ::" -#: ../../library/enum.rst:764 +#: ../../library/enum.rst:771 msgid "" "Out-of-range values have invalid values removed, leaving a valid *Flag* " "value::" msgstr "範圍外的值會移除非法值,留下合法的 *Flag* 值: ::" -#: ../../library/enum.rst:778 +#: ../../library/enum.rst:785 msgid "" "Out-of-range values lose their *Flag* membership and revert to :class:`int`." msgstr "範圍外的值會失去它們的 *Flag* 成員資格且恢復成 :class:`int`。" -#: ../../library/enum.rst:791 +#: ../../library/enum.rst:798 msgid "" "Out-of-range values are kept, and the *Flag* membership is kept. This is the " "default for :class:`IntFlag`::" @@ -912,11 +920,11 @@ msgstr "" "範圍外的值會被保留,*Flag* 成員資格也會被保留。這是 :class:`IntFlag` 的預設行" "為: ::" -#: ../../library/enum.rst:808 +#: ../../library/enum.rst:815 msgid "Supported ``__dunder__`` names" msgstr "支援 ``__dunder__`` 名稱" -#: ../../library/enum.rst:810 +#: ../../library/enum.rst:817 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." @@ -924,7 +932,7 @@ msgstr "" ":attr:`~EnumType.__members__` 是一個唯讀有序的\\ ``成員名稱``:``成員``\\ 項" "目的對映。只有在類別上可用。" -#: ../../library/enum.rst:813 +#: ../../library/enum.rst:820 msgid "" ":meth:`~object.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`!_value_` " @@ -934,28 +942,28 @@ msgstr "" "的 :attr:`!_value_` 也是一個很好的主意。一旦所有成員都建立之後就不會再被用" "到。" -#: ../../library/enum.rst:819 +#: ../../library/enum.rst:826 msgid "Supported ``_sunder_`` names" msgstr "支援 ``_sunder_`` 名稱" -#: ../../library/enum.rst:821 +#: ../../library/enum.rst:828 #, fuzzy msgid ":attr:`~Enum._name_` -- name of the member" msgstr "``_name_`` -- 成員名稱" -#: ../../library/enum.rst:822 +#: ../../library/enum.rst:829 #, fuzzy msgid ":attr:`~Enum._value_` -- value of the member; can be set in ``__new__``" msgstr "``_value_`` -- 成員的值;可以在 ``__new__`` 設定或修改" -#: ../../library/enum.rst:823 +#: ../../library/enum.rst:830 #, fuzzy msgid "" ":meth:`~Enum._missing_` -- a lookup function used when a value is not found; " "may be overridden" msgstr "``_missing_`` -- 當值沒有被找到時會使用的查詢函式;可以被覆寫" -#: ../../library/enum.rst:825 +#: ../../library/enum.rst:832 #, fuzzy msgid "" ":attr:`~Enum._ignore_` -- a list of names, either as a :class:`list` or a :" @@ -965,7 +973,7 @@ msgstr "" "``_ignore_`` -- 可以是 :class:`list` 或 :class:`str` 的名稱串列,它不會被轉換" "成成員,且在最後的類別上會被移除" -#: ../../library/enum.rst:828 +#: ../../library/enum.rst:835 #, fuzzy msgid "" ":attr:`~Enum._order_` -- no longer used, kept for backward compatibility " @@ -974,21 +982,21 @@ msgstr "" "``_order_`` -- 在 Python 2/3 的程式裡用來確保成員順序是一致的(類別屬性,在類" "別建立時移除)" -#: ../../library/enum.rst:830 +#: ../../library/enum.rst:837 #, fuzzy msgid "" ":meth:`~Enum._generate_next_value_` -- used to get an appropriate value for " "an enum member; may be overridden" msgstr "``_generate_next_value_`` -- 用來為列舉成員取得合適的值;可以被覆寫" -#: ../../library/enum.rst:835 +#: ../../library/enum.rst:842 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" "對標準的 :class:`Enum` 類別來說,下一個被選擇的值是最後一個看見的值加一。" -#: ../../library/enum.rst:838 +#: ../../library/enum.rst:845 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." @@ -996,19 +1004,19 @@ msgstr "" "對 :class:`Flag` 類別來說,下一個被選擇的值是下一個最大的 2 的次方,不管最後" "一個看見的值是什麼。" -#: ../../library/enum.rst:841 +#: ../../library/enum.rst:848 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``\\ 、\\ ``_order_``\\ 、\\ ``_generate_next_value_``" -#: ../../library/enum.rst:842 +#: ../../library/enum.rst:849 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:847 +#: ../../library/enum.rst:854 msgid "Utilities and Decorators" msgstr "通用項目與裝飾器" -#: ../../library/enum.rst:851 +#: ../../library/enum.rst:858 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an *Enum*'s :meth:`~Enum._generate_next_value_` to get an appropriate " @@ -1024,16 +1032,16 @@ msgstr "" "2 的次方的數字;對 *StrEnum* 來說,是成員名稱的小寫版本。如果混用 *auto()* 和" "手動指定值的話要特別注意。" -#: ../../library/enum.rst:859 +#: ../../library/enum.rst:866 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "*auto* 實例只有在最上層的賦值時才會被解析:" -#: ../../library/enum.rst:861 +#: ../../library/enum.rst:868 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "``FIRST = auto()`` 可以運作(auto() 會被取代成 ``1``)" -#: ../../library/enum.rst:862 +#: ../../library/enum.rst:869 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is used to create the ``SECOND`` enum member;" @@ -1041,7 +1049,7 @@ msgstr "" "``SECOND = auto(), -2`` 可以運作(auto 會被取代成 ``2``, 因此 ``2, -2`` 會被" "用來建立列舉成員 ``SECOND``;" -#: ../../library/enum.rst:864 +#: ../../library/enum.rst:871 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" @@ -1049,19 +1057,19 @@ msgstr "" "``THREE = [auto(), -3]`` *無法*\\ 運作(\\ ``, -3`` 會被用來建立列" "舉成員 ``THREE``)" -#: ../../library/enum.rst:869 +#: ../../library/enum.rst:876 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "在之前的版本中,``auto()`` 必須是賦值行裡的唯一內容才能運作正確。" -#: ../../library/enum.rst:872 +#: ../../library/enum.rst:879 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "可以覆寫 ``_generate_next_value_`` 來客製 *auto* 使用的值。" -#: ../../library/enum.rst:875 +#: ../../library/enum.rst:882 msgid "" "in 3.13 the default ``_generate_next_value_`` will always return the highest " "member value incremented by 1, and will fail if any member is an " @@ -1070,7 +1078,7 @@ msgstr "" "在 3.13 預設 ``_generate_next_value_`` 總是回傳最大的成員值加一,如果任何成員" "是不相容的類型就會失敗。" -#: ../../library/enum.rst:881 +#: ../../library/enum.rst:888 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " @@ -1079,7 +1087,7 @@ msgstr "" "和內建的 *property* 相似的裝飾器,但只專門針對列舉。它允許成員屬性和成員本身" "有相同名稱。" -#: ../../library/enum.rst:885 +#: ../../library/enum.rst:892 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -1089,7 +1097,7 @@ msgstr "" "*屬性*\\ 和成員必須定義在分開的類別裡;例如 *value* 和 *name* 屬性定義在 " "*Enum* 類別而 *Enum* 子類別可以定義成員名稱為 ``value`` 和 ``name``。" -#: ../../library/enum.rst:894 +#: ../../library/enum.rst:901 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " @@ -1099,7 +1107,7 @@ msgstr "" "__members__`,蒐集任何它找到的別名;如果有找到任何別名則引發 :exc:" "`ValueError` 並附上細節: ::" -#: ../../library/enum.rst:912 +#: ../../library/enum.rst:919 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " @@ -1108,15 +1116,15 @@ msgstr "" "專門針對列舉的 :keyword:`class` 裝飾器。使用 :class:`EnumCheck` 裡的成員來指" "定在裝飾的列舉上應該檢查什麼限制。" -#: ../../library/enum.rst:920 +#: ../../library/enum.rst:927 msgid "A decorator for use in enums: its target will become a member." msgstr "列舉所使用的裝飾器:其目標會變成成員。" -#: ../../library/enum.rst:926 +#: ../../library/enum.rst:933 msgid "A decorator for use in enums: its target will not become a member." msgstr "列舉所使用的裝飾器:其目標不會變成成員。" -#: ../../library/enum.rst:932 +#: ../../library/enum.rst:939 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -1127,19 +1135,19 @@ msgstr "" "組而不是其類別。應該只有當列舉成員被匯出到模組的全域命名空間才使用(範例請參" "考 :class:`re.RegexFlag`)。" -#: ../../library/enum.rst:942 +#: ../../library/enum.rst:949 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "回傳在旗標\\ *值*\\ 中包含的所有 2 的次方的整數串列。" -#: ../../library/enum.rst:949 +#: ../../library/enum.rst:956 msgid "Notes" msgstr "備註" -#: ../../library/enum.rst:951 +#: ../../library/enum.rst:958 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr ":class:`IntEnum`、:class:`StrEnum` 及 :class:`IntFlag`" -#: ../../library/enum.rst:953 +#: ../../library/enum.rst:960 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" @@ -1147,17 +1155,17 @@ msgstr "" "這三種列舉類型是設計來直接取代現有以整數及字串為基底的值;因此它們有額外的限" "制:" -#: ../../library/enum.rst:956 +#: ../../library/enum.rst:963 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "``__str__`` 使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:958 +#: ../../library/enum.rst:965 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "``__format__`` 因為使用 ``__str__``,也會使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:961 +#: ../../library/enum.rst:968 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" @@ -1165,7 +1173,7 @@ msgstr "" "如果你不需要或不想要這些限制,你可以透過混合 ``int`` 或 ``str`` 類型來建立自" "己的基礎類別: ::" -#: ../../library/enum.rst:968 +#: ../../library/enum.rst:975 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "或者你也可以在你的列舉重新給定合適的 :meth:`str`: ::" diff --git a/library/resource.po b/library/resource.po index 5ac576a837..e22defa6bf 100644 --- a/library/resource.po +++ b/library/resource.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 13:14+0000\n" +"POT-Creation-Date: 2024-03-10 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -227,59 +227,63 @@ msgstr "" msgid "The largest area of mapped memory which the process may occupy." msgstr "" -#: ../../library/resource.rst:183 +#: ../../library/resource.rst:180 ../../library/resource.rst:268 +msgid ":ref:`Availability `: FreeBSD >= 11." +msgstr ":ref:`適用 `:FreeBSD 11 以上。" + +#: ../../library/resource.rst:185 msgid "" "The maximum area (in bytes) of address space which may be taken by the " "process." msgstr "" -#: ../../library/resource.rst:188 +#: ../../library/resource.rst:190 msgid "The number of bytes that can be allocated for POSIX message queues." msgstr "" -#: ../../library/resource.rst:190 ../../library/resource.rst:227 +#: ../../library/resource.rst:192 ../../library/resource.rst:229 msgid ":ref:`Availability `: Linux >= 2.6.8." msgstr ":ref:`適用 `:Linux 2.6.8 以上。" -#: ../../library/resource.rst:197 +#: ../../library/resource.rst:199 msgid "The ceiling for the process's nice level (calculated as 20 - rlim_cur)." msgstr "" -#: ../../library/resource.rst:199 ../../library/resource.rst:208 +#: ../../library/resource.rst:201 ../../library/resource.rst:210 msgid ":ref:`Availability `: Linux >= 2.6.12." msgstr ":ref:`適用 `:Linux 2.6.12 以上。" -#: ../../library/resource.rst:206 +#: ../../library/resource.rst:208 msgid "The ceiling of the real-time priority." msgstr "" -#: ../../library/resource.rst:215 +#: ../../library/resource.rst:217 msgid "" "The time limit (in microseconds) on CPU time that a process can spend under " "real-time scheduling without making a blocking syscall." msgstr "" -#: ../../library/resource.rst:218 +#: ../../library/resource.rst:220 msgid ":ref:`Availability `: Linux >= 2.6.25." msgstr ":ref:`適用 `:Linux 2.6.25 以上。" -#: ../../library/resource.rst:225 +#: ../../library/resource.rst:227 msgid "The number of signals which the process may queue." msgstr "" -#: ../../library/resource.rst:233 +#: ../../library/resource.rst:235 msgid "" "The maximum size (in bytes) of socket buffer usage for this user. This " "limits the amount of network memory, and hence the amount of mbufs, that " "this user may hold at any time." msgstr "" -#: ../../library/resource.rst:237 ../../library/resource.rst:250 -#: ../../library/resource.rst:258 +#: ../../library/resource.rst:239 ../../library/resource.rst:252 +#: ../../library/resource.rst:260 msgid ":ref:`Availability `: FreeBSD." msgstr ":ref:`適用 `:FreeBSD。" -#: ../../library/resource.rst:243 +#: ../../library/resource.rst:245 msgid "" "The maximum size (in bytes) of the swap space that may be reserved or used " "by all of this user id's processes. This limit is enforced only if bit 1 of " @@ -288,27 +292,23 @@ msgid "" "this sysctl." msgstr "" -#: ../../library/resource.rst:256 +#: ../../library/resource.rst:258 msgid "The maximum number of pseudo-terminals created by this user id." msgstr "" -#: ../../library/resource.rst:264 +#: ../../library/resource.rst:266 msgid "The maximum number of kqueues this user id is allowed to create." msgstr "" -#: ../../library/resource.rst:266 -msgid ":ref:`Availability `: FreeBSD >= 11." -msgstr ":ref:`適用 `:FreeBSD 11 以上。" - -#: ../../library/resource.rst:271 +#: ../../library/resource.rst:273 msgid "Resource Usage" msgstr "" -#: ../../library/resource.rst:273 +#: ../../library/resource.rst:275 msgid "These functions are used to retrieve resource usage information:" msgstr "" -#: ../../library/resource.rst:278 +#: ../../library/resource.rst:280 msgid "" "This function returns an object that describes the resources consumed by " "either the current process or its children, as specified by the *who* " @@ -316,14 +316,14 @@ msgid "" "`!RUSAGE_\\*` constants described below." msgstr "" -#: ../../library/resource.rst:283 +#: ../../library/resource.rst:285 msgid "A simple example::" msgstr "" "一個簡單範例:\n" "\n" "::" -#: ../../library/resource.rst:297 +#: ../../library/resource.rst:299 msgid "" "The fields of the return value each describe how a particular system " "resource has been used, e.g. amount of time spent running is user mode or " @@ -332,13 +332,13 @@ msgid "" "is using." msgstr "" -#: ../../library/resource.rst:302 +#: ../../library/resource.rst:304 msgid "" "For backward compatibility, the return value is also accessible as a tuple " "of 16 elements." msgstr "" -#: ../../library/resource.rst:305 +#: ../../library/resource.rst:307 msgid "" "The fields :attr:`ru_utime` and :attr:`ru_stime` of the return value are " "floating point values representing the amount of time spent executing in " @@ -348,249 +348,249 @@ msgid "" "summary is presented here:" msgstr "" -#: ../../library/resource.rst:312 +#: ../../library/resource.rst:314 msgid "Index" msgstr "" -#: ../../library/resource.rst:312 +#: ../../library/resource.rst:314 msgid "Field" msgstr "" -#: ../../library/resource.rst:312 +#: ../../library/resource.rst:314 msgid "Resource" msgstr "" -#: ../../library/resource.rst:314 +#: ../../library/resource.rst:316 msgid "``0``" msgstr "``0``" -#: ../../library/resource.rst:314 +#: ../../library/resource.rst:316 msgid ":attr:`ru_utime`" msgstr ":attr:`ru_utime`" -#: ../../library/resource.rst:314 +#: ../../library/resource.rst:316 msgid "time in user mode (float seconds)" msgstr "" -#: ../../library/resource.rst:316 +#: ../../library/resource.rst:318 msgid "``1``" msgstr "``1``" -#: ../../library/resource.rst:316 +#: ../../library/resource.rst:318 msgid ":attr:`ru_stime`" msgstr ":attr:`ru_stime`" -#: ../../library/resource.rst:316 +#: ../../library/resource.rst:318 msgid "time in system mode (float seconds)" msgstr "" -#: ../../library/resource.rst:318 +#: ../../library/resource.rst:320 msgid "``2``" msgstr "``2``" -#: ../../library/resource.rst:318 +#: ../../library/resource.rst:320 msgid ":attr:`ru_maxrss`" msgstr ":attr:`ru_maxrss`" -#: ../../library/resource.rst:318 +#: ../../library/resource.rst:320 msgid "maximum resident set size" msgstr "" -#: ../../library/resource.rst:320 +#: ../../library/resource.rst:322 msgid "``3``" msgstr "``3``" -#: ../../library/resource.rst:320 +#: ../../library/resource.rst:322 msgid ":attr:`ru_ixrss`" msgstr ":attr:`ru_ixrss`" -#: ../../library/resource.rst:320 +#: ../../library/resource.rst:322 msgid "shared memory size" msgstr "" -#: ../../library/resource.rst:322 +#: ../../library/resource.rst:324 msgid "``4``" msgstr "``4``" -#: ../../library/resource.rst:322 +#: ../../library/resource.rst:324 msgid ":attr:`ru_idrss`" msgstr ":attr:`ru_idrss`" -#: ../../library/resource.rst:322 +#: ../../library/resource.rst:324 msgid "unshared memory size" msgstr "" -#: ../../library/resource.rst:324 +#: ../../library/resource.rst:326 msgid "``5``" msgstr "``5``" -#: ../../library/resource.rst:324 +#: ../../library/resource.rst:326 msgid ":attr:`ru_isrss`" msgstr ":attr:`ru_isrss`" -#: ../../library/resource.rst:324 +#: ../../library/resource.rst:326 msgid "unshared stack size" msgstr "" -#: ../../library/resource.rst:326 +#: ../../library/resource.rst:328 msgid "``6``" msgstr "``6``" -#: ../../library/resource.rst:326 +#: ../../library/resource.rst:328 msgid ":attr:`ru_minflt`" msgstr ":attr:`ru_minflt`" -#: ../../library/resource.rst:326 +#: ../../library/resource.rst:328 msgid "page faults not requiring I/O" msgstr "" -#: ../../library/resource.rst:328 +#: ../../library/resource.rst:330 msgid "``7``" msgstr "``7``" -#: ../../library/resource.rst:328 +#: ../../library/resource.rst:330 msgid ":attr:`ru_majflt`" msgstr ":attr:`ru_majflt`" -#: ../../library/resource.rst:328 +#: ../../library/resource.rst:330 msgid "page faults requiring I/O" msgstr "" -#: ../../library/resource.rst:330 +#: ../../library/resource.rst:332 msgid "``8``" msgstr "``8``" -#: ../../library/resource.rst:330 +#: ../../library/resource.rst:332 msgid ":attr:`ru_nswap`" msgstr ":attr:`ru_nswap`" -#: ../../library/resource.rst:330 +#: ../../library/resource.rst:332 msgid "number of swap outs" msgstr "" -#: ../../library/resource.rst:332 +#: ../../library/resource.rst:334 msgid "``9``" msgstr "``9``" -#: ../../library/resource.rst:332 +#: ../../library/resource.rst:334 msgid ":attr:`ru_inblock`" msgstr ":attr:`ru_inblock`" -#: ../../library/resource.rst:332 +#: ../../library/resource.rst:334 msgid "block input operations" msgstr "" -#: ../../library/resource.rst:334 +#: ../../library/resource.rst:336 msgid "``10``" msgstr "``10``" -#: ../../library/resource.rst:334 +#: ../../library/resource.rst:336 msgid ":attr:`ru_oublock`" msgstr ":attr:`ru_oublock`" -#: ../../library/resource.rst:334 +#: ../../library/resource.rst:336 msgid "block output operations" msgstr "" -#: ../../library/resource.rst:336 +#: ../../library/resource.rst:338 msgid "``11``" msgstr "``11``" -#: ../../library/resource.rst:336 +#: ../../library/resource.rst:338 msgid ":attr:`ru_msgsnd`" msgstr ":attr:`ru_msgsnd`" -#: ../../library/resource.rst:336 +#: ../../library/resource.rst:338 msgid "messages sent" msgstr "" -#: ../../library/resource.rst:338 +#: ../../library/resource.rst:340 msgid "``12``" msgstr "``12``" -#: ../../library/resource.rst:338 +#: ../../library/resource.rst:340 msgid ":attr:`ru_msgrcv`" msgstr ":attr:`ru_msgrcv`" -#: ../../library/resource.rst:338 +#: ../../library/resource.rst:340 msgid "messages received" msgstr "" -#: ../../library/resource.rst:340 +#: ../../library/resource.rst:342 msgid "``13``" msgstr "``13``" -#: ../../library/resource.rst:340 +#: ../../library/resource.rst:342 msgid ":attr:`ru_nsignals`" msgstr ":attr:`ru_nsignals`" -#: ../../library/resource.rst:340 +#: ../../library/resource.rst:342 msgid "signals received" msgstr "" -#: ../../library/resource.rst:342 +#: ../../library/resource.rst:344 msgid "``14``" msgstr "``14``" -#: ../../library/resource.rst:342 +#: ../../library/resource.rst:344 msgid ":attr:`ru_nvcsw`" msgstr ":attr:`ru_nvcsw`" -#: ../../library/resource.rst:342 +#: ../../library/resource.rst:344 msgid "voluntary context switches" msgstr "" -#: ../../library/resource.rst:344 +#: ../../library/resource.rst:346 msgid "``15``" msgstr "``15``" -#: ../../library/resource.rst:344 +#: ../../library/resource.rst:346 msgid ":attr:`ru_nivcsw`" msgstr ":attr:`ru_nivcsw`" -#: ../../library/resource.rst:344 +#: ../../library/resource.rst:346 msgid "involuntary context switches" msgstr "" -#: ../../library/resource.rst:347 +#: ../../library/resource.rst:349 msgid "" "This function will raise a :exc:`ValueError` if an invalid *who* parameter " "is specified. It may also raise :exc:`error` exception in unusual " "circumstances." msgstr "" -#: ../../library/resource.rst:353 +#: ../../library/resource.rst:355 msgid "" "Returns the number of bytes in a system page. (This need not be the same as " "the hardware page size.)" msgstr "" -#: ../../library/resource.rst:356 +#: ../../library/resource.rst:358 msgid "" "The following :const:`!RUSAGE_\\*` symbols are passed to the :func:" "`getrusage` function to specify which processes information should be " "provided for." msgstr "" -#: ../../library/resource.rst:362 +#: ../../library/resource.rst:364 msgid "" "Pass to :func:`getrusage` to request resources consumed by the calling " "process, which is the sum of resources used by all threads in the process." msgstr "" -#: ../../library/resource.rst:368 +#: ../../library/resource.rst:370 msgid "" "Pass to :func:`getrusage` to request resources consumed by child processes " "of the calling process which have been terminated and waited for." msgstr "" -#: ../../library/resource.rst:374 +#: ../../library/resource.rst:376 msgid "" "Pass to :func:`getrusage` to request resources consumed by both the current " "process and child processes. May not be available on all systems." msgstr "" -#: ../../library/resource.rst:380 +#: ../../library/resource.rst:382 msgid "" "Pass to :func:`getrusage` to request resources consumed by the current " "thread. May not be available on all systems." From f00693bbae375202fe670fb67fd860141e7fd694 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Sun, 10 Mar 2024 15:47:23 +0800 Subject: [PATCH 33/33] fix: resolve fuzzy entries --- c-api/buffer.po | 3 +- c-api/code.po | 15 +- c-api/exceptions.po | 218 +++++-------- c-api/file.po | 5 +- c-api/init.po | 36 +-- c-api/intro.po | 86 ++--- c-api/long.po | 15 +- c-api/memory.po | 24 +- c-api/structures.po | 86 ++--- c-api/sys.po | 15 +- c-api/veryhigh.po | 3 +- extending/extending.po | 9 +- extending/newtypes.po | 30 +- library/colorsys.po | 5 +- library/constants.po | 28 +- library/enum.po | 52 ++- library/ftplib.po | 3 +- library/functions.po | 3 +- library/logging.po | 697 +++++++++++++++++++---------------------- library/re.po | 2 +- library/threading.po | 3 +- using/cmdline.po | 22 +- using/mac.po | 39 ++- 23 files changed, 554 insertions(+), 845 deletions(-) diff --git a/c-api/buffer.po b/c-api/buffer.po index 8b7baf4704..ee9c312b61 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -710,9 +710,8 @@ msgid "buffer object" msgstr "buffer object(緩衝物件)" #: ../../c-api/buffer.rst:32 -#, fuzzy msgid "PyBufferProcs (C type)" -msgstr "PyBufferProcs" +msgstr "PyBufferProcs(C 型別)" #: ../../c-api/buffer.rst:294 msgid "contiguous" diff --git a/c-api/code.po b/c-api/code.po index ed91b49baf..2b5d9b094f 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -338,26 +338,21 @@ msgid "code object" msgstr "code object(程式碼物件)" #: ../../c-api/code.rst:56 -#, fuzzy msgid "PyCode_New (C function)" -msgstr "PyCode_New" +msgstr "PyCode_New(C 函式)" #: ../../c-api/code.rst:69 -#, fuzzy msgid "PyCode_NewWithPosOnlyArgs (C function)" -msgstr "PyCode_NewWithPosOnlyArgs" +msgstr "PyCode_NewWithPosOnlyArgs(C 函式)" #: ../../c-api/code.rst:228 -#, fuzzy msgid "_PyEval_RequestCodeExtraIndex (C function)" -msgstr "_PyEval_RequestCodeExtraIndex" +msgstr "_PyEval_RequestCodeExtraIndex(C 函式)" #: ../../c-api/code.rst:246 -#, fuzzy msgid "_PyCode_GetExtra (C function)" -msgstr "_PyCode_GetExtra" +msgstr "_PyCode_GetExtra(C 函式)" #: ../../c-api/code.rst:261 -#, fuzzy msgid "_PyCode_SetExtra (C function)" -msgstr "_PyCode_SetExtra" +msgstr "_PyCode_SetExtra(C 函式)" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index c8be8bb09f..d0e0484023 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -1473,19 +1473,16 @@ msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:" msgstr "" #: ../../c-api/exceptions.rst:1148 -#, fuzzy msgid ":c:data:`!PyExc_EnvironmentError`" -msgstr ":c:data:`PyExc_EnvironmentError`" +msgstr ":c:data:`!PyExc_EnvironmentError`" #: ../../c-api/exceptions.rst:1150 -#, fuzzy msgid ":c:data:`!PyExc_IOError`" -msgstr ":c:data:`PyExc_IOError`" +msgstr ":c:data:`!PyExc_IOError`" #: ../../c-api/exceptions.rst:1152 -#, fuzzy msgid ":c:data:`!PyExc_WindowsError`" -msgstr ":c:data:`PyExc_WindowsError`" +msgstr ":c:data:`!PyExc_WindowsError`" #: ../../c-api/exceptions.rst:1152 msgid "[2]_" @@ -1622,9 +1619,8 @@ msgid "This is a base class for other standard warning categories." msgstr "" #: ../../c-api/exceptions.rst:170 -#, fuzzy msgid "strerror (C function)" -msgstr "strerror()" +msgstr "strerror(C 函式)" #: ../../c-api/exceptions.rst:623 ../../c-api/exceptions.rst:654 #: ../../c-api/exceptions.rst:669 @@ -1638,7 +1634,7 @@ msgstr "signal(訊號)" #: ../../c-api/exceptions.rst:623 ../../c-api/exceptions.rst:654 msgid "SIGINT (C macro)" -msgstr "" +msgstr "SIGINT(C 巨集)" #: ../../c-api/exceptions.rst:623 ../../c-api/exceptions.rst:654 #: ../../c-api/exceptions.rst:669 @@ -1646,339 +1642,269 @@ msgid "KeyboardInterrupt (built-in exception)" msgstr "KeyboardInterrupt(內建例外)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_BaseException (C var)" -msgstr "PyExc_BaseException" +msgstr "PyExc_BaseException(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_Exception (C var)" -msgstr "PyExc_Exception" +msgstr "PyExc_Exception(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_ArithmeticError (C var)" -msgstr "PyExc_ArithmeticError" +msgstr "PyExc_ArithmeticError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_AssertionError (C var)" -msgstr "PyExc_AssertionError" +msgstr "PyExc_AssertionError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_AttributeError (C var)" -msgstr "PyExc_AttributeError" +msgstr "PyExc_AttributeError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_BlockingIOError (C var)" -msgstr "PyExc_BlockingIOError" +msgstr "PyExc_BlockingIOError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_BrokenPipeError (C var)" -msgstr "PyExc_BrokenPipeError" +msgstr "PyExc_BrokenPipeError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_BufferError (C var)" -msgstr "PyExc_BufferError" +msgstr "PyExc_BufferError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_ChildProcessError (C var)" -msgstr "PyExc_ChildProcessError" +msgstr "PyExc_ChildProcessError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_ConnectionAbortedError (C var)" -msgstr "PyExc_ConnectionAbortedError" +msgstr "PyExc_ConnectionAbortedError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_ConnectionError (C var)" -msgstr "PyExc_ConnectionError" +msgstr "PyExc_ConnectionError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_ConnectionRefusedError (C var)" -msgstr "PyExc_ConnectionRefusedError" +msgstr "PyExc_ConnectionRefusedError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_ConnectionResetError (C var)" -msgstr "PyExc_ConnectionResetError" +msgstr "PyExc_ConnectionResetError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_EOFError (C var)" -msgstr "PyExc_EOFError" +msgstr "PyExc_EOFError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_FileExistsError (C var)" -msgstr "PyExc_FileExistsError" +msgstr "PyExc_FileExistsError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_FileNotFoundError (C var)" -msgstr "PyExc_FileNotFoundError" +msgstr "PyExc_FileNotFoundError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_FloatingPointError (C var)" -msgstr "PyExc_FloatingPointError" +msgstr "PyExc_FloatingPointError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_GeneratorExit (C var)" -msgstr "PyExc_GeneratorExit" +msgstr "PyExc_GeneratorExit(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_ImportError (C var)" -msgstr "PyExc_ImportError" +msgstr "PyExc_ImportError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_IndentationError (C var)" -msgstr "PyExc_IndentationError" +msgstr "PyExc_IndentationError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_IndexError (C var)" -msgstr "PyExc_IndexError" +msgstr "PyExc_IndexError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_InterruptedError (C var)" -msgstr "PyExc_InterruptedError" +msgstr "PyExc_InterruptedError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_IsADirectoryError (C var)" -msgstr "PyExc_IsADirectoryError" +msgstr "PyExc_IsADirectoryError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_KeyError (C var)" -msgstr "PyExc_KeyError" +msgstr "PyExc_KeyError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_KeyboardInterrupt (C var)" -msgstr "PyExc_KeyboardInterrupt" +msgstr "PyExc_KeyboardInterrupt(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_LookupError (C var)" -msgstr "PyExc_LookupError" +msgstr "PyExc_LookupError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_MemoryError (C var)" -msgstr "PyExc_MemoryError" +msgstr "PyExc_MemoryError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_ModuleNotFoundError (C var)" -msgstr "PyExc_ModuleNotFoundError" +msgstr "PyExc_ModuleNotFoundError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_NameError (C var)" -msgstr "PyExc_NameError" +msgstr "PyExc_NameError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_NotADirectoryError (C var)" -msgstr "PyExc_NotADirectoryError" +msgstr "PyExc_NotADirectoryError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_NotImplementedError (C var)" -msgstr "PyExc_NotImplementedError" +msgstr "PyExc_NotImplementedError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_OSError (C var)" -msgstr "PyExc_OSError" +msgstr "PyExc_OSError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_OverflowError (C var)" -msgstr "PyExc_OverflowError" +msgstr "PyExc_OverflowError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_PermissionError (C var)" -msgstr "PyExc_PermissionError" +msgstr "PyExc_PermissionError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_ProcessLookupError (C var)" -msgstr "PyExc_ProcessLookupError" +msgstr "PyExc_ProcessLookupError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_RecursionError (C var)" -msgstr "PyExc_RecursionError" +msgstr "PyExc_RecursionError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_ReferenceError (C var)" -msgstr "PyExc_ReferenceError" +msgstr "PyExc_ReferenceError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_RuntimeError (C var)" -msgstr "PyExc_RuntimeError" +msgstr "PyExc_RuntimeError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_StopAsyncIteration (C var)" -msgstr "PyExc_StopAsyncIteration" +msgstr "PyExc_StopAsyncIteration(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_StopIteration (C var)" -msgstr "PyExc_StopIteration" +msgstr "PyExc_StopIteration(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_SyntaxError (C var)" -msgstr "PyExc_SyntaxError" +msgstr "PyExc_SyntaxError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_SystemError (C var)" -msgstr "PyExc_SystemError" +msgstr "PyExc_SystemError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_SystemExit (C var)" -msgstr "PyExc_SystemExit" +msgstr "PyExc_SystemExit(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_TabError (C var)" -msgstr "PyExc_TabError" +msgstr "PyExc_TabError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_TimeoutError (C var)" -msgstr "PyExc_TimeoutError" +msgstr "PyExc_TimeoutError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_TypeError (C var)" -msgstr "PyExc_TypeError" +msgstr "PyExc_TypeError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_UnboundLocalError (C var)" -msgstr "PyExc_UnboundLocalError" +msgstr "PyExc_UnboundLocalError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_UnicodeDecodeError (C var)" -msgstr "PyExc_UnicodeDecodeError" +msgstr "PyExc_UnicodeDecodeError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_UnicodeEncodeError (C var)" -msgstr "PyExc_UnicodeEncodeError" +msgstr "PyExc_UnicodeEncodeError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_UnicodeError (C var)" -msgstr "PyExc_UnicodeError" +msgstr "PyExc_UnicodeError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_UnicodeTranslateError (C var)" -msgstr "PyExc_UnicodeTranslateError" +msgstr "PyExc_UnicodeTranslateError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_ValueError (C var)" -msgstr "PyExc_ValueError" +msgstr "PyExc_ValueError(C 變數)" #: ../../c-api/exceptions.rst:957 -#, fuzzy msgid "PyExc_ZeroDivisionError (C var)" -msgstr "PyExc_ZeroDivisionError" +msgstr "PyExc_ZeroDivisionError(C 變數)" #: ../../c-api/exceptions.rst:1140 -#, fuzzy msgid "PyExc_EnvironmentError (C var)" -msgstr "PyExc_EnvironmentError" +msgstr "PyExc_EnvironmentError(C 變數)" #: ../../c-api/exceptions.rst:1140 -#, fuzzy msgid "PyExc_IOError (C var)" -msgstr "PyExc_IOError" +msgstr "PyExc_IOError(C 變數)" #: ../../c-api/exceptions.rst:1140 -#, fuzzy msgid "PyExc_WindowsError (C var)" -msgstr "PyExc_WindowsError" +msgstr "PyExc_WindowsError(C 變數)" #: ../../c-api/exceptions.rst:1177 -#, fuzzy msgid "PyExc_Warning (C var)" -msgstr "PyExc_Warning" +msgstr "PyExc_Warning(C 變數)" #: ../../c-api/exceptions.rst:1177 -#, fuzzy msgid "PyExc_BytesWarning (C var)" -msgstr "PyExc_BytesWarning" +msgstr "PyExc_BytesWarning(C 變數)" #: ../../c-api/exceptions.rst:1177 -#, fuzzy msgid "PyExc_DeprecationWarning (C var)" -msgstr "PyExc_DeprecationWarning" +msgstr "PyExc_DeprecationWarning(C 變數)" #: ../../c-api/exceptions.rst:1177 -#, fuzzy msgid "PyExc_FutureWarning (C var)" -msgstr "PyExc_FutureWarning" +msgstr "PyExc_FutureWarning(C 變數)" #: ../../c-api/exceptions.rst:1177 -#, fuzzy msgid "PyExc_ImportWarning (C var)" -msgstr "PyExc_ImportWarning" +msgstr "PyExc_ImportWarning(C 變數)" #: ../../c-api/exceptions.rst:1177 -#, fuzzy msgid "PyExc_PendingDeprecationWarning (C var)" -msgstr "PyExc_PendingDeprecationWarning" +msgstr "PyExc_PendingDeprecationWarning(C 變數)" #: ../../c-api/exceptions.rst:1177 -#, fuzzy msgid "PyExc_ResourceWarning (C var)" -msgstr "PyExc_ResourceWarning" +msgstr "PyExc_ResourceWarning(C 變數)" #: ../../c-api/exceptions.rst:1177 -#, fuzzy msgid "PyExc_RuntimeWarning (C var)" -msgstr "PyExc_RuntimeWarning" +msgstr "PyExc_RuntimeWarning(C 變數)" #: ../../c-api/exceptions.rst:1177 -#, fuzzy msgid "PyExc_SyntaxWarning (C var)" -msgstr "PyExc_SyntaxWarning" +msgstr "PyExc_SyntaxWarning(C 變數)" #: ../../c-api/exceptions.rst:1177 -#, fuzzy msgid "PyExc_UnicodeWarning (C var)" -msgstr "PyExc_UnicodeWarning" +msgstr "PyExc_UnicodeWarning(C 變數)" #: ../../c-api/exceptions.rst:1177 -#, fuzzy msgid "PyExc_UserWarning (C var)" -msgstr "PyExc_UserWarning" - -#~ msgid "SIGINT" -#~ msgstr "SIGINT" +msgstr "PyExc_UserWarning(C 變數)" diff --git a/c-api/file.po b/c-api/file.po index 6cebb19e90..cd700213b2 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -162,7 +162,7 @@ msgid "" "arguments." msgstr "" "不帶引數地引發一個\\ :ref:`稽核事件 (auditing event) ` " -"``setopencodehook``\\ 。" +"``setopencodehook``。" #: ../../c-api/file.rst:100 msgid "" @@ -196,6 +196,5 @@ msgid "EOFError (built-in exception)" msgstr "EOFError(內建例外)" #: ../../c-api/file.rst:98 -#, fuzzy msgid "Py_PRINT_RAW (C macro)" -msgstr "Py_PRINT_RAW" +msgstr "Py_PRINT_RAW(C 巨集)" diff --git a/c-api/init.po b/c-api/init.po index d8ab0e4714..f408a55892 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -2548,19 +2548,16 @@ msgid "path" msgstr "path(路徑)" #: ../../c-api/init.rst:334 -#, fuzzy msgid "PySys_SetArgv (C function)" -msgstr "PySys_SetArgv()" +msgstr "PySys_SetArgv(C 函式)" #: ../../c-api/init.rst:334 -#, fuzzy msgid "PySys_SetArgvEx (C function)" -msgstr "PySys_SetArgvEx()" +msgstr "PySys_SetArgvEx(C 函式)" #: ../../c-api/init.rst:334 ../../c-api/init.rst:1647 ../../c-api/init.rst:1700 -#, fuzzy msgid "Py_FinalizeEx (C function)" -msgstr "Py_FinalizeEx()" +msgstr "Py_FinalizeEx(C 函式)" #: ../../c-api/init.rst:430 ../../c-api/init.rst:467 msgid "Py_Initialize()" @@ -2627,34 +2624,28 @@ msgid "lock, interpreter" msgstr "lock, interpreter(鎖、直譯器)" #: ../../c-api/init.rst:852 -#, fuzzy msgid "setswitchinterval (in module sys)" -msgstr "setswitchinterval() (sys 模組中)" +msgstr "setswitchinterval (sys 模組中)" #: ../../c-api/init.rst:861 -#, fuzzy msgid "PyThreadState (C type)" -msgstr "PyThreadState" +msgstr "PyThreadState(C 型別)" #: ../../c-api/init.rst:887 -#, fuzzy msgid "Py_BEGIN_ALLOW_THREADS (C macro)" -msgstr "Py_BEGIN_ALLOW_THREADS" +msgstr "Py_BEGIN_ALLOW_THREADS(C 巨集)" #: ../../c-api/init.rst:887 -#, fuzzy msgid "Py_END_ALLOW_THREADS (C macro)" -msgstr "Py_END_ALLOW_THREADS" +msgstr "Py_END_ALLOW_THREADS(C 巨集)" #: ../../c-api/init.rst:903 -#, fuzzy msgid "PyEval_RestoreThread (C function)" -msgstr "PyEval_RestoreThread()" +msgstr "PyEval_RestoreThread(C 函式)" #: ../../c-api/init.rst:903 -#, fuzzy msgid "PyEval_SaveThread (C function)" -msgstr "PyEval_SaveThread()" +msgstr "PyEval_SaveThread(C 函式)" #: ../../c-api/init.rst:1034 msgid "PyEval_AcquireThread()" @@ -2689,14 +2680,9 @@ msgid "stdin (in module sys)" msgstr "stdin(sys 模組中)" #: ../../c-api/init.rst:1647 -#, fuzzy msgid "Py_Initialize (C function)" -msgstr "Py_Initialize()" +msgstr "Py_Initialize(C 函式)" #: ../../c-api/init.rst:1677 -#, fuzzy msgid "close (in module os)" -msgstr "close()(sys 模組中)" - -#~ msgid "Py_AddPendingCall()" -#~ msgstr "Py_AddPendingCall()" +msgstr "close(os 模組中)" diff --git a/c-api/intro.po b/c-api/intro.po index df40c84a89..0463eb9446 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -245,21 +245,17 @@ msgstr "" "大小增加)。在成本/收益分析方面,編譯器通常比開發人員更聰明。" #: ../../c-api/intro.rst:151 -#, fuzzy msgid "" "If Python is :ref:`built in debug mode ` (if the :c:macro:" "`Py_DEBUG` macro is defined), the :c:macro:`Py_ALWAYS_INLINE` macro does " "nothing." msgstr "" -"如果 Python 是\\ :ref:`在除錯模式下建置 `\\ (如果 ``Py_DEBUG`` " -"巨集有被定義),:c:macro:`Py_ALWAYS_INLINE` 巨集就什麼都不會做。" +"如果 Python 是\\ :ref:`在除錯模式下建置 `\\ (如果 :c:macro:" +"`Py_DEBUG` 巨集有被定義),:c:macro:`Py_ALWAYS_INLINE` 巨集就什麼都不會做。" #: ../../c-api/intro.rst:154 msgid "It must be specified before the function return type. Usage::" -msgstr "" -"它必須在函式回傳型別之前被指定。用法:\n" -"\n" -"::" +msgstr "它必須在函式回傳型別之前被指定。用法: ::" #: ../../c-api/intro.rst:162 msgid "" @@ -278,10 +274,7 @@ msgstr "將其用於已棄用的聲明。巨集必須放在符號名稱之前。 #: ../../c-api/intro.rst:170 ../../c-api/intro.rst:256 #: ../../c-api/intro.rst:274 msgid "Example::" -msgstr "" -"範例:\n" -"\n" -"::" +msgstr "範例: ::" #: ../../c-api/intro.rst:174 msgid "MSVC support was added." @@ -318,10 +311,7 @@ msgstr "" #: ../../c-api/intro.rst:206 msgid "Usage::" -msgstr "" -"用法:\n" -"\n" -"::" +msgstr "用法: ::" #: ../../c-api/intro.rst:214 msgid "" @@ -1042,7 +1032,6 @@ msgstr "" "低階分析的建置。本節的其餘部分將僅描述最常用的建置。" #: ../../c-api/intro.rst:817 -#, fuzzy msgid "" "Compiling the interpreter with the :c:macro:`!Py_DEBUG` macro defined " "produces what is generally meant by :ref:`a debug build of Python `。 :c:macro:`Py_DEBUG` 在 Unix 建置中要透過在 :file:`./" +"使用定義的 :c:macro:`!Py_DEBUG` 巨集編譯直譯器會生成 :ref:`Python 的除錯建置 " +"`。 :c:macro:`!Py_DEBUG` 在 Unix 建置中要透過在 :file:`./" "configure` 命令中加入 :option:`--with-pydebug` 來啟用。非 Python 限定的 :c:" -"macro:`_DEBUG` 巨集的存在也暗示了這一點。當 :c:macro:`Py_DEBUG` 在 Unix 建置" -"中啟用時,編譯器最佳化會被禁用。" +"macro:`!_DEBUG` 巨集的存在也暗示了這一點。當 :c:macro:`!Py_DEBUG` 在 Unix 建" +"置中啟用時,編譯器最佳化會被禁用。" #: ../../c-api/intro.rst:825 msgid "" @@ -1098,38 +1087,32 @@ msgid "type" msgstr "type(型別)" #: ../../c-api/intro.rst:327 -#, fuzzy msgid "Py_INCREF (C function)" -msgstr "Py_INCREF()" +msgstr "Py_INCREF(C 函式)" #: ../../c-api/intro.rst:327 -#, fuzzy msgid "Py_DECREF (C function)" -msgstr "Py_DECREF()" +msgstr "Py_DECREF(C 函式)" #: ../../c-api/intro.rst:403 -#, fuzzy msgid "PyList_SetItem (C function)" -msgstr "PyList_SetItem()" +msgstr "PyList_SetItem(C 函式)" #: ../../c-api/intro.rst:403 -#, fuzzy msgid "PyTuple_SetItem (C function)" -msgstr "PyTuple_SetItem()" +msgstr "PyTuple_SetItem(C 函式)" #: ../../c-api/intro.rst:474 msgid "set_all()" msgstr "set_all()" #: ../../c-api/intro.rst:493 -#, fuzzy msgid "PyList_GetItem (C function)" -msgstr "PyList_GetItem()" +msgstr "PyList_GetItem(C 函式)" #: ../../c-api/intro.rst:493 -#, fuzzy msgid "PySequence_GetItem (C function)" -msgstr "PySequence_GetItem()" +msgstr "PySequence_GetItem(C 函式)" #: ../../c-api/intro.rst:523 msgid "sum_list()" @@ -1140,43 +1123,36 @@ msgid "sum_sequence()" msgstr "sum_sequence()" #: ../../c-api/intro.rst:590 -#, fuzzy msgid "PyErr_Occurred (C function)" -msgstr "PyErr_Occurred()" +msgstr "PyErr_Occurred(C 函式)" #: ../../c-api/intro.rst:603 -#, fuzzy msgid "PyErr_SetString (C function)" -msgstr "PyErr_SetString()" +msgstr "PyErr_SetString(C 函式)" #: ../../c-api/intro.rst:603 ../../c-api/intro.rst:711 -#, fuzzy msgid "PyErr_Clear (C function)" -msgstr "PyErr_Clear()" +msgstr "PyErr_Clear(C 函式)" #: ../../c-api/intro.rst:627 -#, fuzzy msgid "exc_info (in module sys)" -msgstr "exc_info() (sys 模組中)" +msgstr "exc_info (sys 模組中)" #: ../../c-api/intro.rst:662 ../../c-api/intro.rst:709 msgid "incr_item()" msgstr "incr_item()" #: ../../c-api/intro.rst:711 -#, fuzzy msgid "PyErr_ExceptionMatches (C function)" -msgstr "PyErr_ExceptionMatches()" +msgstr "PyErr_ExceptionMatches(C 函式)" #: ../../c-api/intro.rst:711 -#, fuzzy msgid "Py_XDECREF (C function)" -msgstr "Py_XDECREF()" +msgstr "Py_XDECREF(C 函式)" #: ../../c-api/intro.rst:737 -#, fuzzy msgid "Py_Initialize (C function)" -msgstr "Py_Initialize()" +msgstr "Py_Initialize(C 函式)" #: ../../c-api/intro.rst:737 msgid "module" @@ -1207,31 +1183,25 @@ msgid "path (in module sys)" msgstr "path(sys 模組中)" #: ../../c-api/intro.rst:772 -#, fuzzy msgid "Py_SetProgramName (C function)" -msgstr "Py_SetProgramName()" +msgstr "Py_SetProgramName(C 函式)" #: ../../c-api/intro.rst:772 -#, fuzzy msgid "Py_GetPath (C function)" -msgstr "Py_GetPath()" +msgstr "Py_GetPath(C 函式)" #: ../../c-api/intro.rst:772 -#, fuzzy msgid "Py_GetPrefix (C function)" -msgstr "Py_GetPrefix()" +msgstr "Py_GetPrefix(C 函式)" #: ../../c-api/intro.rst:772 -#, fuzzy msgid "Py_GetExecPrefix (C function)" -msgstr "Py_GetExecPrefix()" +msgstr "Py_GetExecPrefix(C 函式)" #: ../../c-api/intro.rst:772 -#, fuzzy msgid "Py_GetProgramFullPath (C function)" -msgstr "Py_GetProgramFullPath()" +msgstr "Py_GetProgramFullPath(C 函式)" #: ../../c-api/intro.rst:787 -#, fuzzy msgid "Py_IsInitialized (C function)" -msgstr "Py_IsInitialized()" +msgstr "Py_IsInitialized(C 函式)" diff --git a/c-api/long.po b/c-api/long.po index 61d3cbc925..7d1f613e4b 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -381,9 +380,8 @@ msgid "integer" msgstr "integer(整数)" #: ../../c-api/long.rst:119 -#, fuzzy msgid "LONG_MAX (C macro)" -msgstr "LONG_MAX" +msgstr "LONG_MAX(C 巨集)" #: ../../c-api/long.rst:119 ../../c-api/long.rst:161 ../../c-api/long.rst:204 #: ../../c-api/long.rst:219 ../../c-api/long.rst:235 ../../c-api/long.rst:251 @@ -391,16 +389,13 @@ msgid "OverflowError (built-in exception)" msgstr "OverflowError(内建例外)" #: ../../c-api/long.rst:204 -#, fuzzy msgid "PY_SSIZE_T_MAX (C macro)" -msgstr "PY_SSIZE_T_MAX" +msgstr "PY_SSIZE_T_MAX(C 巨集)" #: ../../c-api/long.rst:219 -#, fuzzy msgid "ULONG_MAX (C macro)" -msgstr "ULONG_MAX" +msgstr "ULONG_MAX(C 巨集)" #: ../../c-api/long.rst:235 -#, fuzzy msgid "SIZE_MAX (C macro)" -msgstr "SIZE_MAX" +msgstr "SIZE_MAX(C 巨集)" diff --git a/c-api/memory.po b/c-api/memory.po index 881779e18d..379ce9be8c 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -559,11 +559,11 @@ msgstr "" #: ../../c-api/memory.rst:411 ../../c-api/memory.rst:658 msgid "Field" -msgstr "" +msgstr "欄位" #: ../../c-api/memory.rst:411 ../../c-api/memory.rst:658 msgid "Meaning" -msgstr "" +msgstr "意義" #: ../../c-api/memory.rst:413 ../../c-api/memory.rst:660 msgid "``void *ctx``" @@ -777,7 +777,7 @@ msgstr "" #: ../../c-api/memory.rst:540 msgid "Runtime checks:" -msgstr "" +msgstr "Runtime 檢查:" #: ../../c-api/memory.rst:542 msgid "" @@ -1075,26 +1075,16 @@ msgstr "" #: ../../c-api/memory.rst:43 msgid "malloc (C function)" -msgstr "" +msgstr "malloc(C 函式)" #: ../../c-api/memory.rst:43 msgid "calloc (C function)" -msgstr "" +msgstr "calloc(C 函式)" #: ../../c-api/memory.rst:43 -#, fuzzy msgid "realloc (C function)" -msgstr "realloc()" +msgstr "realloc(C 函式)" #: ../../c-api/memory.rst:43 msgid "free (C function)" -msgstr "" - -#~ msgid "malloc()" -#~ msgstr "malloc()" - -#~ msgid "calloc()" -#~ msgstr "calloc()" - -#~ msgid "free()" -#~ msgstr "free()" +msgstr "free(C 函式)" diff --git a/c-api/structures.po b/c-api/structures.po index 6084fc5f31..dd50ff5bfe 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -852,135 +852,93 @@ msgid "staticmethod" msgstr "staticmethod" #: ../../c-api/structures.rst:563 -#, fuzzy msgid "READ_RESTRICTED (C macro)" -msgstr "READ_RESTRICTED" +msgstr "READ_RESTRICTED(C 巨集)" #: ../../c-api/structures.rst:563 -#, fuzzy msgid "WRITE_RESTRICTED (C macro)" -msgstr "WRITE_RESTRICTED" +msgstr "WRITE_RESTRICTED(C 巨集)" #: ../../c-api/structures.rst:563 -#, fuzzy msgid "RESTRICTED (C macro)" -msgstr "RESTRICTED" +msgstr "RESTRICTED(C 巨集)" #: ../../c-api/structures.rst:576 -#, fuzzy msgid "READONLY (C macro)" -msgstr "READONLY" +msgstr "READONLY(C 巨集)" #: ../../c-api/structures.rst:639 msgid "T_BYTE (C macro)" -msgstr "" +msgstr "T_BYTE(C 巨集)" #: ../../c-api/structures.rst:639 msgid "T_SHORT (C macro)" -msgstr "" +msgstr "T_SHORT(C 巨集)" #: ../../c-api/structures.rst:639 msgid "T_INT (C macro)" -msgstr "" +msgstr "T_INT(C 巨集)" #: ../../c-api/structures.rst:639 msgid "T_LONG (C macro)" -msgstr "" +msgstr "T_LONG(C 巨集)" #: ../../c-api/structures.rst:639 -#, fuzzy msgid "T_LONGLONG (C macro)" -msgstr "T_LONGLONG" +msgstr "T_LONGLONG(C 巨集)" #: ../../c-api/structures.rst:639 msgid "T_UBYTE (C macro)" -msgstr "" +msgstr "T_UBYTE(C 巨集)" #: ../../c-api/structures.rst:639 -#, fuzzy msgid "T_USHORT (C macro)" -msgstr "T_USHORT" +msgstr "T_USHORT(C 巨集)" #: ../../c-api/structures.rst:639 msgid "T_UINT (C macro)" -msgstr "" +msgstr "T_UINT(C 巨集)" #: ../../c-api/structures.rst:639 msgid "T_ULONG (C macro)" -msgstr "" +msgstr "T_ULONG(C 巨集)" #: ../../c-api/structures.rst:639 -#, fuzzy msgid "T_ULONGULONG (C macro)" -msgstr "T_ULONGULONG" +msgstr "T_ULONGULONG(C 巨集)" #: ../../c-api/structures.rst:639 -#, fuzzy msgid "T_PYSSIZET (C macro)" -msgstr "T_PYSSIZET" +msgstr "T_PYSSIZET(C 巨集)" #: ../../c-api/structures.rst:639 msgid "T_FLOAT (C macro)" -msgstr "" +msgstr "T_FLOAT(C 巨集)" #: ../../c-api/structures.rst:639 -#, fuzzy msgid "T_DOUBLE (C macro)" -msgstr "T_DOUBLE" +msgstr "T_DOUBLE(C 巨集)" #: ../../c-api/structures.rst:639 msgid "T_BOOL (C macro)" -msgstr "" +msgstr "T_BOOL(C 巨集)" #: ../../c-api/structures.rst:639 msgid "T_CHAR (C macro)" -msgstr "" +msgstr "T_CHAR(C 巨集)" #: ../../c-api/structures.rst:639 -#, fuzzy msgid "T_STRING (C macro)" -msgstr "T_STRING" +msgstr "T_STRING(C 巨集)" #: ../../c-api/structures.rst:639 -#, fuzzy msgid "T_STRING_INPLACE (C macro)" -msgstr "T_STRING_INPLACE" +msgstr "T_STRING_INPLACE(C 巨集)" #: ../../c-api/structures.rst:639 -#, fuzzy msgid "T_OBJECT_EX (C macro)" -msgstr "T_OBJECT_EX" +msgstr "T_OBJECT_EX(C 巨集)" #: ../../c-api/structures.rst:639 msgid "structmember.h" msgstr "structmember.h" - -#~ msgid "T_BYTE" -#~ msgstr "T_BYTE" - -#~ msgid "T_SHORT" -#~ msgstr "T_SHORT" - -#~ msgid "T_INT" -#~ msgstr "T_INT" - -#~ msgid "T_LONG" -#~ msgstr "T_LONG" - -#~ msgid "T_UBYTE" -#~ msgstr "T_UBYTE" - -#~ msgid "T_UINT" -#~ msgstr "T_UINT" - -#~ msgid "T_ULONG" -#~ msgstr "T_ULONG" - -#~ msgid "T_FLOAT" -#~ msgstr "T_FLOAT" - -#~ msgid "T_BOOL" -#~ msgstr "T_BOOL" - -#~ msgid "T_CHAR" -#~ msgstr "T_CHAR" diff --git a/c-api/sys.po b/c-api/sys.po index 66cea5506b..037e2554b0 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -527,27 +527,20 @@ msgstr "" #: ../../c-api/sys.rst:101 msgid "USE_STACKCHECK (C macro)" -msgstr "" +msgstr "USE_STACKCHECK(C 巨集)" #: ../../c-api/sys.rst:422 msgid "abort (C function)" -msgstr "" +msgstr "abort(C 函式)" #: ../../c-api/sys.rst:441 ../../c-api/sys.rst:455 -#, fuzzy msgid "Py_FinalizeEx (C function)" -msgstr "Py_FinalizeEx()" +msgstr "Py_FinalizeEx(C 函式)" #: ../../c-api/sys.rst:441 msgid "exit (C function)" -msgstr "" +msgstr "exit(C 函式)" #: ../../c-api/sys.rst:455 msgid "cleanup functions" msgstr "cleanup functions(清理函式)" - -#~ msgid "abort()" -#~ msgstr "abort()" - -#~ msgid "exit()" -#~ msgstr "exit()" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index c55d84f47e..10005e654d 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -422,6 +422,5 @@ msgstr "" #: ../../c-api/veryhigh.rst:325 ../../c-api/veryhigh.rst:333 #: ../../c-api/veryhigh.rst:342 -#, fuzzy msgid "Py_CompileString (C function)" -msgstr "Py_CompileString()" +msgstr "Py_CompileString(C 函式)" diff --git a/extending/extending.po b/extending/extending.po index 55cde47b9f..6245e652d9 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -1298,19 +1298,16 @@ msgid "" msgstr "" #: ../../extending/extending.rst:539 -#, fuzzy msgid "PyObject_CallObject (C function)" -msgstr "PyObject_CallObject()" +msgstr "PyObject_CallObject(C 函式)" #: ../../extending/extending.rst:630 -#, fuzzy msgid "PyArg_ParseTuple (C function)" -msgstr "PyArg_ParseTuple()" +msgstr "PyArg_ParseTuple(C 函式)" #: ../../extending/extending.rst:722 -#, fuzzy msgid "PyArg_ParseTupleAndKeywords (C function)" -msgstr "PyArg_ParseTupleAndKeywords()" +msgstr "PyArg_ParseTupleAndKeywords(C 函式)" #: ../../extending/extending.rst:743 msgid "Philbrick, Geoff" diff --git a/extending/newtypes.po b/extending/newtypes.po index 1af0b0002c..3743c97676 100644 --- a/extending/newtypes.po +++ b/extending/newtypes.po @@ -605,14 +605,12 @@ msgid "finalization, of objects" msgstr "" #: ../../extending/newtypes.rst:91 -#, fuzzy msgid "PyErr_Fetch (C function)" -msgstr "PyErr_Fetch()" +msgstr "PyErr_Fetch(C 函式)" #: ../../extending/newtypes.rst:91 -#, fuzzy msgid "PyErr_Restore (C function)" -msgstr "PyErr_Restore()" +msgstr "PyErr_Restore(C 函式)" #: ../../extending/newtypes.rst:150 msgid "string" @@ -629,27 +627,3 @@ msgstr "built-in function(內建函式)" #: ../../extending/newtypes.rst:150 msgid "repr" msgstr "repr" - -#~ msgid "Constant" -#~ msgstr "常數" - -#~ msgid ":const:`READONLY`" -#~ msgstr ":const:`READONLY`" - -#~ msgid ":const:`PY_AUDIT_READ`" -#~ msgstr ":const:`PY_AUDIT_READ`" - -#~ msgid "READONLY" -#~ msgstr "READONLY" - -#~ msgid "READ_RESTRICTED" -#~ msgstr "READ_RESTRICTED" - -#~ msgid "WRITE_RESTRICTED" -#~ msgstr "WRITE_RESTRICTED" - -#~ msgid "RESTRICTED" -#~ msgstr "RESTRICTED" - -#~ msgid "PY_AUDIT_READ" -#~ msgstr "PY_AUDIT_READ" diff --git a/library/colorsys.po b/library/colorsys.po index a36f25e9d0..c658e25a5c 100644 --- a/library/colorsys.po +++ b/library/colorsys.po @@ -83,7 +83,4 @@ msgstr "將顏色自 HSV 座標轉換至 RGB 座標。" #: ../../library/colorsys.rst:59 msgid "Example::" -msgstr "" -"範例:\n" -"\n" -"::" +msgstr "範例: ::" diff --git a/library/constants.po b/library/constants.po index 6ede1691c9..95f3ea1ec2 100644 --- a/library/constants.po +++ b/library/constants.po @@ -58,7 +58,6 @@ msgstr "" "實例。" #: ../../library/constants.rst:30 -#, fuzzy msgid "" "A special value which should be returned by the binary special methods (e." "g. :meth:`~object.__eq__`, :meth:`~object.__lt__`, :meth:`~object.__add__`, :" @@ -73,11 +72,10 @@ msgstr "" "`~object.__lt__`、:meth:`~object.__add__`、:meth:`~object.__rsub__` 等)所回" "傳的特殊值,代表著該運算沒有針對其他型別的實作。同理也可以被原地二元特殊方法 " "(in-place binary special methods) (如::meth:`~object.__imul__`、:meth:" -"`~object.__iand__` 等)回傳。它不應該被作為 boolean(布林)來解讀。" -"``NotImplemented`` 是型別 :data:`types.NotImplementedType` 的唯一實例。" +"`~object.__iand__` 等)回傳。它不應該被作為 boolean(布林)來解讀。:data:`!" +"NotImplemented` 是型別 :data:`types.NotImplementedType` 的唯一實例。" #: ../../library/constants.rst:40 -#, fuzzy msgid "" "When a binary (or in-place) method returns :data:`!NotImplemented` the " "interpreter will try the reflected operation on the other type (or some " @@ -87,37 +85,35 @@ msgid "" "error message or the :data:`!NotImplemented` value being returned to Python " "code." msgstr "" -"當一個二元 (binary) 或原地 (in-place) 方法回傳 ``NotImplemented``,直譯器會嘗" -"試反映該操作到其他型別(或是其他後援 (fallback),取決於是哪種運算子)。如果所" -"有的常識都回傳 ``NotImplemented``,直譯器會拋出適當的例外。不正確的回傳 " -"``NotImplemented`` 會造成誤導的錯誤訊息或是 ``NotImplemented`` 值被傳回到 " -"Python 程式碼中。" +"當一個二元 (binary) 或原地 (in-place) 方法回傳 :data:`!NotImplemented`,直譯" +"器會嘗試反映該操作到其他型別(或是其他後援 (fallback),取決於是哪種運算子)。" +"如果所有的常識都回傳 :data:`!NotImplemented`,直譯器會拋出適當的例外。不正確" +"的回傳 :data:`!NotImplemented` 會造成誤導的錯誤訊息或是 :data:`!" +"NotImplemented` 值被傳回到 Python 程式碼中。" #: ../../library/constants.rst:47 msgid "See :ref:`implementing-the-arithmetic-operations` for examples." msgstr "請參見 :ref:`implementing-the-arithmetic-operations` 以找到更多範例。" #: ../../library/constants.rst:51 -#, fuzzy msgid "" "``NotImplementedError`` and :data:`!NotImplemented` are not interchangeable, " "even though they have similar names and purposes. See :exc:" "`NotImplementedError` for details on when to use it." msgstr "" -"``NotImplementedError`` 與 ``NotImplemented`` 並不一樣且不可互換。即使它們有" -"相似的名稱與用途。欲知更多如何使用它們的細節,請參見 :exc:" +"``NotImplementedError`` 與 :data:`!NotImplemented` 並不一樣且不可互換。即使它" +"們有相似的名稱與用途。欲知更多如何使用它們的細節,請參見 :exc:" "`NotImplementedError`。" #: ../../library/constants.rst:55 -#, fuzzy msgid "" "Evaluating :data:`!NotImplemented` in a boolean context is deprecated. While " "it currently evaluates as true, it will emit a :exc:`DeprecationWarning`. It " "will raise a :exc:`TypeError` in a future version of Python." msgstr "" -"在 boolean(布林)上下文中解讀 ``NotImplemented`` 已經被棄用。雖然目前會被解" -"讀成 true,但會發出一個 :exc:`DeprecationWarning`。在未來版本的 Python 將會拋" -"出 :exc:`TypeError`。" +"在 boolean(布林)上下文中解讀 :data:`!NotImplemented` 已經被棄用。雖然目前會" +"被解讀成 true,但會發出一個 :exc:`DeprecationWarning`。在未來版本的 Python 將" +"會拋出 :exc:`TypeError`。" #: ../../library/constants.rst:64 msgid "" diff --git a/library/enum.po b/library/enum.po index 6ebd4778b2..6c4138c8f6 100644 --- a/library/enum.po +++ b/library/enum.po @@ -450,7 +450,7 @@ msgstr "回傳 *cls* 的成員數量: ::" #: ../../library/enum.rst:240 msgid "Returns a mapping of every enum name to its member, including aliases" -msgstr "" +msgstr "回傳每個列舉名稱到其成員的對映,包括別名" #: ../../library/enum.rst:244 msgid "Returns each member in *cls* in reverse definition order::" @@ -474,9 +474,8 @@ msgid "The value given to the ``Enum`` member::" msgstr "``Enum`` 成員給定的值: ::" #: ../../library/enum.rst:272 ../../library/enum.rst:292 -#, fuzzy msgid "Value of the member, can be set in :meth:`~object.__new__`." -msgstr "``_value_`` -- 成員的值;可以在 ``__new__`` 設定或修改" +msgstr "成員的值,可以在 :meth:`~object.__new__` 設定。" #: ../../library/enum.rst:274 msgid "Enum member values" @@ -501,18 +500,14 @@ msgid "" msgstr "" #: ../../library/enum.rst:288 -#, fuzzy msgid "Name of the member." -msgstr "``_name_`` -- 成員名稱" +msgstr "成員名稱。" #: ../../library/enum.rst:296 -#, fuzzy msgid "" "No longer used, kept for backward compatibility. (class attribute, removed " "during class creation)." -msgstr "" -"``_order_`` -- 在 Python 2/3 的程式裡用來確保成員順序是一致的(類別屬性,在類" -"別建立時移除)" +msgstr "已不再使用,只為了向後相容而保留(類別屬性,在類別建立時移除)" #: ../../library/enum.rst:301 msgid "" @@ -576,12 +571,14 @@ msgid "" "By default, does nothing. If multiple values are given in the member " "assignment, those values become separate arguments to ``__init__``; e.g." msgstr "" +"預設情況下,不執行任何操作。如果在成員賦值中給出多個值,這些值將成為與 " +"``__init__`` 分別的引數;例如" #: ../../library/enum.rst:359 msgid "" "``Weekday.__init__()`` would be called as ``Weekday.__init__(self, 1, " "'Mon')``" -msgstr "" +msgstr "``Weekday.__init__()`` 將被稱為 ``Weekday.__init__(self, 1, 'Mon')``" #: ../../library/enum.rst:363 msgid "" @@ -603,6 +600,8 @@ msgid "" "definition or in a mixin class (such as ``int``), all values given in the " "member assignment will be passed; e.g." msgstr "" +"預設情況下不存在。如果有指定,無論是在列舉類別定義中還是在 mixin 類別中(例" +"如 ``int``\\ ),都將傳遞成員賦值中給出的所有值;例如" #: ../../library/enum.rst:398 msgid "" @@ -612,11 +611,11 @@ msgstr "" #: ../../library/enum.rst:400 msgid "" "..note:: When writing a custom ``__new__``, do not use ``super().__new__`` --" -msgstr "" +msgstr "..note:: 當寫自訂的 ``__new__`` 時,不要使用 ``super().__new__`` --" #: ../../library/enum.rst:401 msgid "call the appropriate ``__new__`` instead." -msgstr "" +msgstr "而是呼叫適當的 ``__new__`` 。" #: ../../library/enum.rst:405 msgid "" @@ -716,14 +715,13 @@ msgstr "" "meth:`~object.__format__` 也會是 :meth:`!str.__format__`。" #: ../../library/enum.rst:516 -#, fuzzy msgid "" "``Flag`` is the same as :class:`Enum`, but its members support the bitwise " "operators ``&`` (*AND*), ``|`` (*OR*), ``^`` (*XOR*), and ``~`` (*INVERT*); " "the results of those operators are members of the enumeration." msgstr "" -"*Flag* 成員支援位元操作 ``&`` (*AND*)、``|`` (*OR*)、``^`` (*XOR*) 及 ``~`` " -"(*INVERT*);這些操作的結果會是列舉成員。" +"``Flag`` 與 :class:`Enum` 相同,但其成員支援位元運算子 ``&`` (*AND*)、``|`` " +"(*OR*)、``^`` (*XOR*) 和 ``~`` (*INVERT*);這些運算子的結果是列舉的成員。" #: ../../library/enum.rst:522 msgid "Returns *True* if value is in self::" @@ -947,47 +945,43 @@ msgid "Supported ``_sunder_`` names" msgstr "支援 ``_sunder_`` 名稱" #: ../../library/enum.rst:828 -#, fuzzy msgid ":attr:`~Enum._name_` -- name of the member" -msgstr "``_name_`` -- 成員名稱" +msgstr ":attr:`~Enum._name_` -- 成員名稱" #: ../../library/enum.rst:829 -#, fuzzy msgid ":attr:`~Enum._value_` -- value of the member; can be set in ``__new__``" -msgstr "``_value_`` -- 成員的值;可以在 ``__new__`` 設定或修改" +msgstr ":attr:`~Enum._value_` -- 成員的值;可以在 ``__new__`` 設定" #: ../../library/enum.rst:830 -#, fuzzy msgid "" ":meth:`~Enum._missing_` -- a lookup function used when a value is not found; " "may be overridden" -msgstr "``_missing_`` -- 當值沒有被找到時會使用的查詢函式;可以被覆寫" +msgstr "" +":meth:`~Enum._missing_` -- 當值沒有被找到時會使用的查詢函式;可以被覆寫" #: ../../library/enum.rst:832 -#, fuzzy msgid "" ":attr:`~Enum._ignore_` -- a list of names, either as a :class:`list` or a :" "class:`str`, that will not be transformed into members, and will be removed " "from the final class" msgstr "" -"``_ignore_`` -- 可以是 :class:`list` 或 :class:`str` 的名稱串列,它不會被轉換" -"成成員,且在最後的類別上會被移除" +":attr:`~Enum._ignore_` -- 一個名稱的串列,可以是 :class:`list` 或 :class:" +"`str`,它不會被轉換成成員,且在最後的類別上會被移除" #: ../../library/enum.rst:835 -#, fuzzy msgid "" ":attr:`~Enum._order_` -- no longer used, kept for backward compatibility " "(class attribute, removed during class creation)" msgstr "" -"``_order_`` -- 在 Python 2/3 的程式裡用來確保成員順序是一致的(類別屬性,在類" -"別建立時移除)" +":attr:`~Enum._order_` -- 不再被使用,僅為了向後相容而保留(類別屬性,在類別建" +"立時移除)" #: ../../library/enum.rst:837 -#, fuzzy msgid "" ":meth:`~Enum._generate_next_value_` -- used to get an appropriate value for " "an enum member; may be overridden" -msgstr "``_generate_next_value_`` -- 用來為列舉成員取得合適的值;可以被覆寫" +msgstr "" +":meth:`~Enum._generate_next_value_` -- 用來為列舉成員取得合適的值;可以被覆寫" #: ../../library/enum.rst:842 msgid "" diff --git a/library/ftplib.po b/library/ftplib.po index 2c8c8f845a..d80ef8619d 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -266,14 +266,13 @@ msgstr "" "sendcmd``。" #: ../../library/ftplib.rst:234 -#, fuzzy msgid "" "Send a simple command string to the server and handle the response. Return " "the response string if the response code corresponds to success (codes in " "the range 200--299). Raise :exc:`error_reply` otherwise." msgstr "" "向伺服器發送一個簡單的命令字串並處理回應。如果收到代表成功的回應狀態碼(範圍" -"為 200--299 的狀態碼),則不回傳任何內容,否則引發 :exc:`error_reply`。" +"為 200--299 的狀態碼),則回傳回應字串,否則引發 :exc:`error_reply`。" #: ../../library/ftplib.rst:243 msgid "Retrieve a file in binary transfer mode." diff --git a/library/functions.po b/library/functions.po index 8a12e84e70..53bb015ee4 100644 --- a/library/functions.po +++ b/library/functions.po @@ -1870,9 +1870,8 @@ msgstr "" "iterable, key=keyfunc)`` 一致。" #: ../../library/functions.rst:1076 ../../library/functions.rst:1114 -#, fuzzy msgid "Added the *default* keyword-only parameter." -msgstr "*default* 僅限關鍵字引數。" +msgstr "新增 *default* 僅限關鍵字參數。" #: ../../library/functions.rst:1079 ../../library/functions.rst:1117 msgid "The *key* can be ``None``." diff --git a/library/logging.po b/library/logging.po index 9df5536053..7f58f336e4 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-02 00:03+0000\n" +"POT-Creation-Date: 2024-02-02 00:03+0000\n" "PO-Revision-Date: 2023-08-20 16:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -129,36 +129,6 @@ msgstr "" #: ../../library/logging.rst:82 msgid "" -"This is the logger's name, and is the value that was passed to :func:" -"`getLogger` to obtain the logger." -msgstr "" - -#: ../../library/logging.rst:85 ../../library/logging.rst:145 -msgid "This attribute should be treated as read-only." -msgstr "" - -#: ../../library/logging.rst:89 -msgid "The threshold of this logger, as set by the :meth:`setLevel` method." -msgstr "" - -#: ../../library/logging.rst:91 -msgid "" -"Do not set this attribute directly - always use :meth:`setLevel`, which has " -"checks for the level passed to it." -msgstr "" - -#: ../../library/logging.rst:96 -msgid "" -"The parent logger of this logger. It may change based on later instantiation " -"of loggers which are higher up in the namespace hierarchy." -msgstr "" - -#: ../../library/logging.rst:99 -msgid "This value should be treated as read-only." -msgstr "" - -#: ../../library/logging.rst:103 -msgid "" "If this attribute evaluates to true, events logged to this logger will be " "passed to the handlers of higher level (ancestor) loggers, in addition to " "any handlers attached to this logger. Messages are passed directly to the " @@ -166,13 +136,13 @@ msgid "" "loggers in question are considered." msgstr "" -#: ../../library/logging.rst:109 +#: ../../library/logging.rst:88 msgid "" "If this evaluates to false, logging messages are not passed to the handlers " "of ancestor loggers." msgstr "" -#: ../../library/logging.rst:112 +#: ../../library/logging.rst:91 msgid "" "Spelling it out with an example: If the propagate attribute of the logger " "named ``A.B.C`` evaluates to true, any event logged to ``A.B.C`` via a " @@ -185,11 +155,11 @@ msgid "" "handle, and propagation stops at that point." msgstr "" -#: ../../library/logging.rst:121 +#: ../../library/logging.rst:100 msgid "The constructor sets this attribute to ``True``." msgstr "" -#: ../../library/logging.rst:123 +#: ../../library/logging.rst:102 msgid "" "If you attach a handler to a logger *and* one or more of its ancestors, it " "may emit the same record multiple times. In general, you should not need to " @@ -201,24 +171,7 @@ msgid "" "rest." msgstr "" -#: ../../library/logging.rst:134 -msgid "The list of handlers directly attached to this logger instance." -msgstr "" - -#: ../../library/logging.rst:136 -msgid "" -"This attribute should be treated as read-only; it is normally changed via " -"the :meth:`addHandler` and :meth:`removeHandler` methods, which use locks to " -"ensure thread-safe operation." -msgstr "" - -#: ../../library/logging.rst:142 -msgid "" -"This attribute disables handling of any events. It is set to ``False`` in " -"the initializer, and only changed by logging configuration code." -msgstr "" - -#: ../../library/logging.rst:149 +#: ../../library/logging.rst:113 msgid "" "Sets the threshold for this logger to *level*. Logging messages which are " "less severe than *level* will be ignored; logging messages which have " @@ -227,7 +180,7 @@ msgid "" "severity level than *level*." msgstr "" -#: ../../library/logging.rst:154 +#: ../../library/logging.rst:118 msgid "" "When a logger is created, the level is set to :const:`NOTSET` (which causes " "all messages to be processed when the logger is the root logger, or " @@ -235,32 +188,32 @@ msgid "" "the root logger is created with level :const:`WARNING`." msgstr "" -#: ../../library/logging.rst:159 +#: ../../library/logging.rst:123 msgid "" "The term 'delegation to the parent' means that if a logger has a level of " "NOTSET, its chain of ancestor loggers is traversed until either an ancestor " "with a level other than NOTSET is found, or the root is reached." msgstr "" -#: ../../library/logging.rst:163 +#: ../../library/logging.rst:127 msgid "" "If an ancestor is found with a level other than NOTSET, then that ancestor's " "level is treated as the effective level of the logger where the ancestor " "search began, and is used to determine how a logging event is handled." msgstr "" -#: ../../library/logging.rst:167 +#: ../../library/logging.rst:131 msgid "" "If the root is reached, and it has a level of NOTSET, then all messages will " "be processed. Otherwise, the root's level will be used as the effective " "level." msgstr "" -#: ../../library/logging.rst:170 ../../library/logging.rst:513 +#: ../../library/logging.rst:134 ../../library/logging.rst:477 msgid "See :ref:`levels` for a list of levels." msgstr "層級清單請見 :ref:`levels`\\ 。" -#: ../../library/logging.rst:172 +#: ../../library/logging.rst:136 msgid "" "The *level* parameter now accepts a string representation of the level such " "as 'INFO' as an alternative to the integer constants such as :const:`INFO`. " @@ -269,7 +222,7 @@ msgid "" "expect to be passed integers." msgstr "" -#: ../../library/logging.rst:182 +#: ../../library/logging.rst:146 msgid "" "Indicates if a message of severity *level* would be processed by this " "logger. This method checks first the module-level level set by ``logging." @@ -277,7 +230,7 @@ msgid "" "meth:`getEffectiveLevel`." msgstr "" -#: ../../library/logging.rst:190 +#: ../../library/logging.rst:154 msgid "" "Indicates the effective level for this logger. If a value other than :const:" "`NOTSET` has been set using :meth:`setLevel`, it is returned. Otherwise, the " @@ -286,7 +239,7 @@ msgid "" "integer, typically one of :const:`logging.DEBUG`, :const:`logging.INFO` etc." msgstr "" -#: ../../library/logging.rst:200 +#: ../../library/logging.rst:164 msgid "" "Returns a logger which is a descendant to this logger, as determined by the " "suffix. Thus, ``logging.getLogger('abc').getChild('def.ghi')`` would return " @@ -295,7 +248,7 @@ msgid "" "named using e.g. ``__name__`` rather than a literal string." msgstr "" -#: ../../library/logging.rst:211 +#: ../../library/logging.rst:175 msgid "" "Returns a set of loggers which are immediate children of this logger. So for " "example ``logging.getLogger().getChildren()`` might return a set containing " @@ -305,7 +258,7 @@ msgid "" "include one named ``foo.bar.baz``." msgstr "" -#: ../../library/logging.rst:223 +#: ../../library/logging.rst:187 msgid "" "Logs a message with level :const:`DEBUG` on this logger. The *msg* is the " "message format string, and the *args* are the arguments which are merged " @@ -315,13 +268,13 @@ msgid "" "are supplied." msgstr "" -#: ../../library/logging.rst:229 +#: ../../library/logging.rst:193 msgid "" "There are four keyword arguments in *kwargs* which are inspected: " "*exc_info*, *stack_info*, *stacklevel* and *extra*." msgstr "" -#: ../../library/logging.rst:232 +#: ../../library/logging.rst:196 msgid "" "If *exc_info* does not evaluate as false, it causes exception information to " "be added to the logging message. If an exception tuple (in the format " @@ -330,7 +283,7 @@ msgid "" "information." msgstr "" -#: ../../library/logging.rst:237 ../../library/logging.rst:1152 +#: ../../library/logging.rst:201 ../../library/logging.rst:1116 msgid "" "The second optional keyword argument is *stack_info*, which defaults to " "``False``. If true, stack information is added to the logging message, " @@ -342,20 +295,20 @@ msgid "" "handlers." msgstr "" -#: ../../library/logging.rst:246 ../../library/logging.rst:1161 +#: ../../library/logging.rst:210 ../../library/logging.rst:1125 msgid "" "You can specify *stack_info* independently of *exc_info*, e.g. to just show " "how you got to a certain point in your code, even when no exceptions were " "raised. The stack frames are printed following a header line which says:" msgstr "" -#: ../../library/logging.rst:254 ../../library/logging.rst:1169 +#: ../../library/logging.rst:218 ../../library/logging.rst:1133 msgid "" "This mimics the ``Traceback (most recent call last):`` which is used when " "displaying exception frames." msgstr "" -#: ../../library/logging.rst:257 +#: ../../library/logging.rst:221 msgid "" "The third optional keyword argument is *stacklevel*, which defaults to " "``1``. If greater than 1, the corresponding number of stack frames are " @@ -367,7 +320,7 @@ msgid "" "module." msgstr "" -#: ../../library/logging.rst:265 +#: ../../library/logging.rst:229 msgid "" "The fourth keyword argument is *extra* which can be used to pass a " "dictionary which is used to populate the __dict__ of the :class:`LogRecord` " @@ -376,18 +329,18 @@ msgid "" "incorporated into logged messages. For example::" msgstr "" -#: ../../library/logging.rst:277 +#: ../../library/logging.rst:241 msgid "would print something like" msgstr "" -#: ../../library/logging.rst:283 +#: ../../library/logging.rst:247 msgid "" "The keys in the dictionary passed in *extra* should not clash with the keys " "used by the logging system. (See the section on :ref:`logrecord-attributes` " "for more information on which keys are used by the logging system.)" msgstr "" -#: ../../library/logging.rst:287 +#: ../../library/logging.rst:251 msgid "" "If you choose to use these attributes in logged messages, you need to " "exercise some care. In the above example, for instance, the :class:" @@ -398,7 +351,7 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:294 ../../library/logging.rst:1200 +#: ../../library/logging.rst:258 ../../library/logging.rst:1164 msgid "" "While this might be annoying, this feature is intended for use in " "specialized circumstances, such as multi-threaded servers where the same " @@ -409,78 +362,78 @@ msgid "" "particular :class:`Handler`\\ s." msgstr "" -#: ../../library/logging.rst:301 +#: ../../library/logging.rst:265 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`." msgstr "" -#: ../../library/logging.rst:305 ../../library/logging.rst:1211 +#: ../../library/logging.rst:269 ../../library/logging.rst:1175 msgid "The *stack_info* parameter was added." msgstr "新增 *stack_info* 參數。" -#: ../../library/logging.rst:308 +#: ../../library/logging.rst:272 msgid "The *exc_info* parameter can now accept exception instances." msgstr "" -#: ../../library/logging.rst:311 +#: ../../library/logging.rst:275 msgid "The *stacklevel* parameter was added." msgstr "新增 *stacklevel* 參數。" -#: ../../library/logging.rst:317 +#: ../../library/logging.rst:281 msgid "" "Logs a message with level :const:`INFO` on this logger. The arguments are " "interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:323 +#: ../../library/logging.rst:287 msgid "" "Logs a message with level :const:`WARNING` on this logger. The arguments are " "interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:326 +#: ../../library/logging.rst:290 msgid "" "There is an obsolete method ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:332 +#: ../../library/logging.rst:296 msgid "" "Logs a message with level :const:`ERROR` on this logger. The arguments are " "interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:338 +#: ../../library/logging.rst:302 msgid "" "Logs a message with level :const:`CRITICAL` on this logger. The arguments " "are interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:344 +#: ../../library/logging.rst:308 msgid "" "Logs a message with integer level *level* on this logger. The other " "arguments are interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:350 +#: ../../library/logging.rst:314 msgid "" "Logs a message with level :const:`ERROR` on this logger. The arguments are " "interpreted as for :meth:`debug`. Exception info is added to the logging " "message. This method should only be called from an exception handler." msgstr "" -#: ../../library/logging.rst:357 +#: ../../library/logging.rst:321 msgid "Adds the specified filter *filter* to this logger." msgstr "在該 logger 內增加指定的 filter *filter*。" -#: ../../library/logging.rst:362 +#: ../../library/logging.rst:326 msgid "Removes the specified filter *filter* from this logger." msgstr "在該 logger 內移除指定的 filter *filter*。" -#: ../../library/logging.rst:367 +#: ../../library/logging.rst:331 msgid "" "Apply this logger's filters to the record and return ``True`` if the record " "is to be processed. The filters are consulted in turn, until one of them " @@ -489,22 +442,22 @@ msgid "" "processing of the record occurs." msgstr "" -#: ../../library/logging.rst:376 +#: ../../library/logging.rst:340 msgid "Adds the specified handler *hdlr* to this logger." msgstr "" -#: ../../library/logging.rst:381 +#: ../../library/logging.rst:345 msgid "Removes the specified handler *hdlr* from this logger." msgstr "" -#: ../../library/logging.rst:386 +#: ../../library/logging.rst:350 msgid "" "Finds the caller's source filename and line number. Returns the filename, " "line number, function name and stack information as a 4-element tuple. The " "stack information is returned as ``None`` unless *stack_info* is ``True``." msgstr "" -#: ../../library/logging.rst:390 +#: ../../library/logging.rst:354 msgid "" "The *stacklevel* parameter is passed from code calling the :meth:`debug` and " "other APIs. If greater than 1, the excess is used to skip stack frames " @@ -514,7 +467,7 @@ msgid "" "calls it." msgstr "" -#: ../../library/logging.rst:400 +#: ../../library/logging.rst:364 msgid "" "Handles a record by passing it to all handlers associated with this logger " "and its ancestors (until a false value of *propagate* is found). This method " @@ -523,13 +476,13 @@ msgid "" "filter`." msgstr "" -#: ../../library/logging.rst:408 +#: ../../library/logging.rst:372 msgid "" "This is a factory method which can be overridden in subclasses to create " "specialized :class:`LogRecord` instances." msgstr "" -#: ../../library/logging.rst:413 +#: ../../library/logging.rst:377 msgid "" "Checks to see if this logger has any handlers configured. This is done by " "looking for handlers in this logger and its parents in the logger hierarchy. " @@ -539,15 +492,15 @@ msgid "" "the existence of handlers." msgstr "" -#: ../../library/logging.rst:422 +#: ../../library/logging.rst:386 msgid "Loggers can now be pickled and unpickled." msgstr "" -#: ../../library/logging.rst:428 +#: ../../library/logging.rst:392 msgid "Logging Levels" msgstr "" -#: ../../library/logging.rst:430 +#: ../../library/logging.rst:394 msgid "" "The numeric values of logging levels are given in the following table. These " "are primarily of interest if you want to define your own levels, and need " @@ -556,83 +509,83 @@ msgid "" "value; the predefined name is lost." msgstr "" -#: ../../library/logging.rst:437 +#: ../../library/logging.rst:401 msgid "Level" msgstr "" -#: ../../library/logging.rst:437 +#: ../../library/logging.rst:401 msgid "Numeric value" msgstr "" -#: ../../library/logging.rst:437 +#: ../../library/logging.rst:401 msgid "What it means / When to use it" msgstr "" -#: ../../library/logging.rst:439 +#: ../../library/logging.rst:403 msgid "0" msgstr "0" -#: ../../library/logging.rst:439 +#: ../../library/logging.rst:403 msgid "" "When set on a logger, indicates that ancestor loggers are to be consulted to " "determine the effective level. If that still resolves to :const:`!NOTSET`, " "then all events are logged. When set on a handler, all events are handled." msgstr "" -#: ../../library/logging.rst:447 +#: ../../library/logging.rst:411 msgid "10" msgstr "10" -#: ../../library/logging.rst:447 +#: ../../library/logging.rst:411 msgid "" "Detailed information, typically only of interest to a developer trying to " "diagnose a problem." msgstr "" -#: ../../library/logging.rst:451 +#: ../../library/logging.rst:415 msgid "20" msgstr "20" -#: ../../library/logging.rst:451 +#: ../../library/logging.rst:415 msgid "Confirmation that things are working as expected." msgstr "" -#: ../../library/logging.rst:454 +#: ../../library/logging.rst:418 msgid "30" msgstr "30" -#: ../../library/logging.rst:454 +#: ../../library/logging.rst:418 msgid "" "An indication that something unexpected happened, or that a problem might " "occur in the near future (e.g. 'disk space low'). The software is still " "working as expected." msgstr "" -#: ../../library/logging.rst:461 +#: ../../library/logging.rst:425 msgid "40" msgstr "40" -#: ../../library/logging.rst:461 +#: ../../library/logging.rst:425 msgid "" "Due to a more serious problem, the software has not been able to perform " "some function." msgstr "" -#: ../../library/logging.rst:465 +#: ../../library/logging.rst:429 msgid "50" msgstr "50" -#: ../../library/logging.rst:465 +#: ../../library/logging.rst:429 msgid "" "A serious error, indicating that the program itself may be unable to " "continue running." msgstr "" -#: ../../library/logging.rst:474 +#: ../../library/logging.rst:438 msgid "Handler Objects" msgstr "" -#: ../../library/logging.rst:476 +#: ../../library/logging.rst:440 msgid "" "Handlers have the following attributes and methods. Note that :class:" "`Handler` is never instantiated directly; this class acts as a base for more " @@ -640,53 +593,53 @@ msgid "" "to call :meth:`Handler.__init__`." msgstr "" -#: ../../library/logging.rst:485 +#: ../../library/logging.rst:449 msgid "" "Initializes the :class:`Handler` instance by setting its level, setting the " "list of filters to the empty list and creating a lock (using :meth:" "`createLock`) for serializing access to an I/O mechanism." msgstr "" -#: ../../library/logging.rst:492 +#: ../../library/logging.rst:456 msgid "" "Initializes a thread lock which can be used to serialize access to " "underlying I/O functionality which may not be threadsafe." msgstr "" -#: ../../library/logging.rst:498 +#: ../../library/logging.rst:462 msgid "Acquires the thread lock created with :meth:`createLock`." msgstr "" -#: ../../library/logging.rst:503 +#: ../../library/logging.rst:467 msgid "Releases the thread lock acquired with :meth:`acquire`." msgstr "" -#: ../../library/logging.rst:508 +#: ../../library/logging.rst:472 msgid "" "Sets the threshold for this handler to *level*. Logging messages which are " "less severe than *level* will be ignored. When a handler is created, the " "level is set to :const:`NOTSET` (which causes all messages to be processed)." msgstr "" -#: ../../library/logging.rst:515 +#: ../../library/logging.rst:479 msgid "" "The *level* parameter now accepts a string representation of the level such " "as 'INFO' as an alternative to the integer constants such as :const:`INFO`." msgstr "" -#: ../../library/logging.rst:523 +#: ../../library/logging.rst:487 msgid "Sets the :class:`Formatter` for this handler to *fmt*." msgstr "" -#: ../../library/logging.rst:528 +#: ../../library/logging.rst:492 msgid "Adds the specified filter *filter* to this handler." msgstr "" -#: ../../library/logging.rst:533 +#: ../../library/logging.rst:497 msgid "Removes the specified filter *filter* from this handler." msgstr "" -#: ../../library/logging.rst:538 +#: ../../library/logging.rst:502 msgid "" "Apply this handler's filters to the record and return ``True`` if the record " "is to be processed. The filters are consulted in turn, until one of them " @@ -695,13 +648,13 @@ msgid "" "record." msgstr "" -#: ../../library/logging.rst:547 +#: ../../library/logging.rst:511 msgid "" "Ensure all logging output has been flushed. This version does nothing and is " "intended to be implemented by subclasses." msgstr "" -#: ../../library/logging.rst:553 +#: ../../library/logging.rst:517 msgid "" "Tidy up any resources used by the handler. This version does no output but " "removes the handler from an internal list of handlers which is closed when :" @@ -709,14 +662,14 @@ msgid "" "from overridden :meth:`close` methods." msgstr "" -#: ../../library/logging.rst:561 +#: ../../library/logging.rst:525 msgid "" "Conditionally emits the specified logging record, depending on filters which " "may have been added to the handler. Wraps the actual emission of the record " "with acquisition/release of the I/O thread lock." msgstr "" -#: ../../library/logging.rst:568 +#: ../../library/logging.rst:532 msgid "" "This method should be called from handlers when an exception is encountered " "during an :meth:`emit` call. If the module-level attribute :data:" @@ -729,20 +682,20 @@ msgid "" "is more useful during development)." msgstr "" -#: ../../library/logging.rst:581 +#: ../../library/logging.rst:545 msgid "" "Do formatting for a record - if a formatter is set, use it. Otherwise, use " "the default formatter for the module." msgstr "" -#: ../../library/logging.rst:587 +#: ../../library/logging.rst:551 msgid "" "Do whatever it takes to actually log the specified logging record. This " "version is intended to be implemented by subclasses and so raises a :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/logging.rst:591 +#: ../../library/logging.rst:555 msgid "" "This method is called after a handler-level lock is acquired, which is " "released after this method returns. When you override this method, note that " @@ -751,13 +704,13 @@ msgid "" "Specifically:" msgstr "" -#: ../../library/logging.rst:597 +#: ../../library/logging.rst:561 msgid "" "Logging configuration APIs acquire the module-level lock, and then " "individual handler-level locks as those handlers are configured." msgstr "" -#: ../../library/logging.rst:600 +#: ../../library/logging.rst:564 msgid "" "Many logging APIs lock the module-level lock. If such an API is called from " "this method, it could cause a deadlock if a configuration call is made on " @@ -767,16 +720,16 @@ msgid "" "method, the handler-level lock has already been acquired)." msgstr "" -#: ../../library/logging.rst:607 +#: ../../library/logging.rst:571 msgid "" "For a list of handlers included as standard, see :mod:`logging.handlers`." msgstr "" -#: ../../library/logging.rst:612 +#: ../../library/logging.rst:576 msgid "Formatter Objects" msgstr "" -#: ../../library/logging.rst:618 +#: ../../library/logging.rst:582 msgid "" "Responsible for converting a :class:`LogRecord` to an output string to be " "interpreted by a human or external system." @@ -786,7 +739,7 @@ msgstr "" msgid "Parameters" msgstr "" -#: ../../library/logging.rst:621 +#: ../../library/logging.rst:585 msgid "" "A format string in the given *style* for the logged output as a whole. The " "possible mapping keys are drawn from the :class:`LogRecord` object's :ref:" @@ -794,14 +747,14 @@ msgid "" "is just the logged message." msgstr "" -#: ../../library/logging.rst:629 +#: ../../library/logging.rst:593 msgid "" "A format string in the given *style* for the date/time portion of the logged " "output. If not specified, the default described in :meth:`formatTime` is " "used." msgstr "" -#: ../../library/logging.rst:634 +#: ../../library/logging.rst:598 msgid "" "Can be one of ``'%'``, ``'{'`` or ``'$'`` and determines how the format " "string will be merged with its data: using one of :ref:`old-string-" @@ -812,32 +765,32 @@ msgid "" "use ``{``- and ``$``-formatting for log messages." msgstr "" -#: ../../library/logging.rst:644 +#: ../../library/logging.rst:608 msgid "" "If ``True`` (the default), incorrect or mismatched *fmt* and *style* will " "raise a :exc:`ValueError`; for example, ``logging.Formatter('%(asctime)s - " "%(message)s', style='{')``." msgstr "" -#: ../../library/logging.rst:649 +#: ../../library/logging.rst:613 msgid "" "A dictionary with default values to use in custom fields. For example, " "``logging.Formatter('%(ip)s %(message)s', defaults={\"ip\": None})``" msgstr "" -#: ../../library/logging.rst:654 +#: ../../library/logging.rst:618 msgid "Added the *style* parameter." msgstr "新增 *style* 參數。" -#: ../../library/logging.rst:657 +#: ../../library/logging.rst:621 msgid "Added the *validate* parameter." msgstr "新增 *validate* 參數。" -#: ../../library/logging.rst:660 +#: ../../library/logging.rst:624 msgid "Added the *defaults* parameter." msgstr "新增 *defaults* 參數。" -#: ../../library/logging.rst:666 +#: ../../library/logging.rst:630 msgid "" "The record's attribute dictionary is used as the operand to a string " "formatting operation. Returns the resulting string. Before formatting the " @@ -856,13 +809,13 @@ msgid "" "recalculates it afresh." msgstr "" -#: ../../library/logging.rst:682 +#: ../../library/logging.rst:646 msgid "" "If stack information is available, it's appended after the exception " "information, using :meth:`formatStack` to transform it if necessary." msgstr "" -#: ../../library/logging.rst:688 +#: ../../library/logging.rst:652 msgid "" "This method should be called from :meth:`format` by a formatter which wants " "to make use of a formatted time. This method can be overridden in formatters " @@ -875,7 +828,7 @@ msgid "" "resulting string is returned." msgstr "" -#: ../../library/logging.rst:698 +#: ../../library/logging.rst:662 msgid "" "This function uses a user-configurable function to convert the creation time " "to a tuple. By default, :func:`time.localtime` is used; to change this for a " @@ -885,7 +838,7 @@ msgid "" "be shown in GMT, set the ``converter`` attribute in the ``Formatter`` class." msgstr "" -#: ../../library/logging.rst:706 +#: ../../library/logging.rst:670 msgid "" "Previously, the default format was hard-coded as in this example: " "``2010-09-06 22:38:15,292`` where the part before the comma is handled by a " @@ -900,11 +853,11 @@ msgid "" "the millisecond value)." msgstr "" -#: ../../library/logging.rst:719 +#: ../../library/logging.rst:683 msgid "The ``default_msec_format`` can be ``None``." msgstr "" -#: ../../library/logging.rst:724 +#: ../../library/logging.rst:688 msgid "" "Formats the specified exception information (a standard exception tuple as " "returned by :func:`sys.exc_info`) as a string. This default implementation " @@ -912,14 +865,14 @@ msgid "" "returned." msgstr "" -#: ../../library/logging.rst:731 +#: ../../library/logging.rst:695 msgid "" "Formats the specified stack information (a string as returned by :func:" "`traceback.print_stack`, but with the last newline removed) as a string. " "This default implementation just returns the input value." msgstr "" -#: ../../library/logging.rst:737 +#: ../../library/logging.rst:701 msgid "" "A base formatter class suitable for subclassing when you want to format a " "number of records. You can pass a :class:`Formatter` instance which you want " @@ -928,7 +881,7 @@ msgid "" "used as the line formatter." msgstr "" -#: ../../library/logging.rst:745 +#: ../../library/logging.rst:709 msgid "" "Return a header for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " @@ -936,14 +889,14 @@ msgid "" "separator line." msgstr "" -#: ../../library/logging.rst:752 +#: ../../library/logging.rst:716 msgid "" "Return a footer for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " "specific behaviour, e.g. to show the count of records or a separator line." msgstr "" -#: ../../library/logging.rst:759 +#: ../../library/logging.rst:723 msgid "" "Return formatted text for a list of *records*. The base implementation just " "returns the empty string if there are no records; otherwise, it returns the " @@ -951,11 +904,11 @@ msgid "" "and the footer." msgstr "" -#: ../../library/logging.rst:767 +#: ../../library/logging.rst:731 msgid "Filter Objects" msgstr "" -#: ../../library/logging.rst:769 +#: ../../library/logging.rst:733 msgid "" "``Filters`` can be used by ``Handlers`` and ``Loggers`` for more " "sophisticated filtering than is provided by levels. The base filter class " @@ -965,7 +918,7 @@ msgid "" "If initialized with the empty string, all events are passed." msgstr "" -#: ../../library/logging.rst:779 +#: ../../library/logging.rst:743 msgid "" "Returns an instance of the :class:`Filter` class. If *name* is specified, it " "names a logger which, together with its children, will have its events " @@ -973,7 +926,7 @@ msgid "" "event." msgstr "" -#: ../../library/logging.rst:786 +#: ../../library/logging.rst:750 msgid "" "Is the specified record to be logged? Returns false for no, true for yes. " "Filters can either modify log records in-place or return a completely " @@ -981,7 +934,7 @@ msgid "" "future processing of the event." msgstr "" -#: ../../library/logging.rst:791 +#: ../../library/logging.rst:755 msgid "" "Note that filters attached to handlers are consulted before an event is " "emitted by the handler, whereas filters attached to loggers are consulted " @@ -991,13 +944,13 @@ msgid "" "setting, unless the filter has also been applied to those descendant loggers." msgstr "" -#: ../../library/logging.rst:798 +#: ../../library/logging.rst:762 msgid "" "You don't actually need to subclass ``Filter``: you can pass any instance " "which has a ``filter`` method with the same semantics." msgstr "" -#: ../../library/logging.rst:801 +#: ../../library/logging.rst:765 msgid "" "You don't need to create specialized ``Filter`` classes, or use other " "classes with a ``filter`` method: you can use a function (or other callable) " @@ -1008,7 +961,7 @@ msgid "" "value should conform to that returned by :meth:`~Filter.filter`." msgstr "" -#: ../../library/logging.rst:811 +#: ../../library/logging.rst:775 msgid "" "You can now return a :class:`LogRecord` instance from filters to replace the " "log record rather than modifying it in place. This allows filters attached " @@ -1016,7 +969,7 @@ msgid "" "having side effects on other handlers." msgstr "" -#: ../../library/logging.rst:817 +#: ../../library/logging.rst:781 msgid "" "Although filters are used primarily to filter records based on more " "sophisticated criteria than levels, they get to see every record which is " @@ -1028,11 +981,11 @@ msgid "" "contextual information into logs (see :ref:`filters-contextual`)." msgstr "" -#: ../../library/logging.rst:830 +#: ../../library/logging.rst:794 msgid "LogRecord Objects" msgstr "LogRecord 物件" -#: ../../library/logging.rst:832 +#: ../../library/logging.rst:796 msgid "" ":class:`LogRecord` instances are created automatically by the :class:" "`Logger` every time something is logged, and can be created manually via :" @@ -1040,17 +993,17 @@ msgid "" "wire)." msgstr "" -#: ../../library/logging.rst:840 +#: ../../library/logging.rst:804 msgid "Contains all the information pertinent to the event being logged." msgstr "" -#: ../../library/logging.rst:842 +#: ../../library/logging.rst:806 msgid "" "The primary information is passed in *msg* and *args*, which are combined " "using ``msg % args`` to create the :attr:`!message` attribute of the record." msgstr "" -#: ../../library/logging.rst:846 +#: ../../library/logging.rst:810 msgid "" "The name of the logger used to log the event represented by this :class:`!" "LogRecord`. Note that the logger name in the :class:`!LogRecord` will always " @@ -1058,7 +1011,7 @@ msgid "" "different (ancestor) logger." msgstr "" -#: ../../library/logging.rst:854 +#: ../../library/logging.rst:818 msgid "" "The :ref:`numeric level ` of the logging event (such as ``10`` for " "``DEBUG``, ``20`` for ``INFO``, etc). Note that this is converted to *two* " @@ -1066,46 +1019,46 @@ msgid "" "attr:`!levelname` for the corresponding level name." msgstr "" -#: ../../library/logging.rst:861 +#: ../../library/logging.rst:825 msgid "" "The full string path of the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:865 +#: ../../library/logging.rst:829 msgid "The line number in the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:869 +#: ../../library/logging.rst:833 msgid "" "The event description message, which can be a %-format string with " "placeholders for variable data, or an arbitrary object (see :ref:`arbitrary-" "object-messages`)." msgstr "" -#: ../../library/logging.rst:874 +#: ../../library/logging.rst:838 msgid "" "Variable data to merge into the *msg* argument to obtain the event " "description." msgstr "" -#: ../../library/logging.rst:878 +#: ../../library/logging.rst:842 msgid "" "An exception tuple with the current exception information, as returned by :" "func:`sys.exc_info`, or ``None`` if no exception information is available." msgstr "" -#: ../../library/logging.rst:883 +#: ../../library/logging.rst:847 msgid "" "The name of the function or method from which the logging call was invoked." msgstr "" -#: ../../library/logging.rst:887 +#: ../../library/logging.rst:851 msgid "" "A text string representing stack information from the base of the stack in " "the current thread, up to the logging call." msgstr "" -#: ../../library/logging.rst:894 +#: ../../library/logging.rst:858 msgid "" "Returns the message for this :class:`LogRecord` instance after merging any " "user-supplied arguments with the message. If the user-supplied message " @@ -1114,7 +1067,7 @@ msgid "" "whose ``__str__`` method can return the actual format string to be used." msgstr "" -#: ../../library/logging.rst:901 +#: ../../library/logging.rst:865 msgid "" "The creation of a :class:`LogRecord` has been made more configurable by " "providing a factory which is used to create the record. The factory can be " @@ -1122,24 +1075,24 @@ msgid "" "this for the factory's signature)." msgstr "" -#: ../../library/logging.rst:907 +#: ../../library/logging.rst:871 msgid "" "This functionality can be used to inject your own values into a :class:" "`LogRecord` at creation time. You can use the following pattern::" msgstr "" -#: ../../library/logging.rst:919 +#: ../../library/logging.rst:883 msgid "" "With this pattern, multiple factories could be chained, and as long as they " "don't overwrite each other's attributes or unintentionally overwrite the " "standard attributes listed above, there should be no surprises." msgstr "" -#: ../../library/logging.rst:928 +#: ../../library/logging.rst:892 msgid "LogRecord attributes" msgstr "" -#: ../../library/logging.rst:930 +#: ../../library/logging.rst:894 msgid "" "The LogRecord has a number of attributes, most of which are derived from the " "parameters to the constructor. (Note that the names do not always correspond " @@ -1150,7 +1103,7 @@ msgid "" "style format string." msgstr "" -#: ../../library/logging.rst:938 +#: ../../library/logging.rst:902 msgid "" "If you are using {}-formatting (:func:`str.format`), you can use ``{attrname}" "`` as the placeholder in the format string. If you are using $-formatting (:" @@ -1158,7 +1111,7 @@ msgid "" "course, replace ``attrname`` with the actual attribute name you want to use." msgstr "" -#: ../../library/logging.rst:944 +#: ../../library/logging.rst:908 msgid "" "In the case of {}-formatting, you can specify formatting flags by placing " "them after the attribute name, separated from it with a colon. For example: " @@ -1167,324 +1120,324 @@ msgid "" "on the options available to you." msgstr "" -#: ../../library/logging.rst:951 +#: ../../library/logging.rst:915 msgid "Attribute name" msgstr "" -#: ../../library/logging.rst:951 ../../library/logging.rst:1369 +#: ../../library/logging.rst:915 ../../library/logging.rst:1333 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:951 ../../library/logging.rst:1369 +#: ../../library/logging.rst:915 ../../library/logging.rst:1333 msgid "Description" msgstr "描述" -#: ../../library/logging.rst:0 ../../library/logging.rst:953 +#: ../../library/logging.rst:0 ../../library/logging.rst:917 msgid "args" msgstr "" -#: ../../library/logging.rst:953 ../../library/logging.rst:967 -#: ../../library/logging.rst:995 ../../library/logging.rst:1013 +#: ../../library/logging.rst:917 ../../library/logging.rst:931 +#: ../../library/logging.rst:959 ../../library/logging.rst:977 msgid "You shouldn't need to format this yourself." msgstr "" -#: ../../library/logging.rst:953 +#: ../../library/logging.rst:917 msgid "" "The tuple of arguments merged into ``msg`` to produce ``message``, or a dict " "whose values are used for the merge (when there is only one argument, and it " "is a dictionary)." msgstr "" -#: ../../library/logging.rst:958 +#: ../../library/logging.rst:922 msgid "asctime" msgstr "" -#: ../../library/logging.rst:958 +#: ../../library/logging.rst:922 msgid "``%(asctime)s``" msgstr "``%(asctime)s``" -#: ../../library/logging.rst:958 +#: ../../library/logging.rst:922 msgid "" "Human-readable time when the :class:`LogRecord` was created. By default " "this is of the form '2003-07-08 16:49:45,896' (the numbers after the comma " "are millisecond portion of the time)." msgstr "" -#: ../../library/logging.rst:964 +#: ../../library/logging.rst:928 msgid "created" msgstr "" -#: ../../library/logging.rst:964 +#: ../../library/logging.rst:928 msgid "``%(created)f``" msgstr "``%(created)f``" -#: ../../library/logging.rst:964 +#: ../../library/logging.rst:928 msgid "" "Time when the :class:`LogRecord` was created (as returned by :func:`time." "time`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:967 +#: ../../library/logging.rst:0 ../../library/logging.rst:931 msgid "exc_info" msgstr "exc_info" -#: ../../library/logging.rst:967 +#: ../../library/logging.rst:931 msgid "" "Exception tuple (à la ``sys.exc_info``) or, if no exception has occurred, " "``None``." msgstr "" -#: ../../library/logging.rst:970 +#: ../../library/logging.rst:934 msgid "filename" msgstr "" -#: ../../library/logging.rst:970 +#: ../../library/logging.rst:934 msgid "``%(filename)s``" msgstr "``%(filename)s``" -#: ../../library/logging.rst:970 +#: ../../library/logging.rst:934 msgid "Filename portion of ``pathname``." msgstr "" -#: ../../library/logging.rst:972 +#: ../../library/logging.rst:936 msgid "funcName" msgstr "" -#: ../../library/logging.rst:972 +#: ../../library/logging.rst:936 msgid "``%(funcName)s``" msgstr "``%(funcName)s``" -#: ../../library/logging.rst:972 +#: ../../library/logging.rst:936 msgid "Name of function containing the logging call." msgstr "" -#: ../../library/logging.rst:974 +#: ../../library/logging.rst:938 msgid "levelname" msgstr "" -#: ../../library/logging.rst:974 +#: ../../library/logging.rst:938 msgid "``%(levelname)s``" msgstr "``%(levelname)s``" -#: ../../library/logging.rst:974 +#: ../../library/logging.rst:938 msgid "" "Text logging level for the message (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, " "``'ERROR'``, ``'CRITICAL'``)." msgstr "" -#: ../../library/logging.rst:978 +#: ../../library/logging.rst:942 msgid "levelno" msgstr "" -#: ../../library/logging.rst:978 +#: ../../library/logging.rst:942 msgid "``%(levelno)s``" msgstr "``%(levelno)s``" -#: ../../library/logging.rst:978 +#: ../../library/logging.rst:942 msgid "" "Numeric logging level for the message (:const:`DEBUG`, :const:`INFO`, :const:" "`WARNING`, :const:`ERROR`, :const:`CRITICAL`)." msgstr "" -#: ../../library/logging.rst:983 +#: ../../library/logging.rst:947 msgid "lineno" msgstr "" -#: ../../library/logging.rst:983 +#: ../../library/logging.rst:947 msgid "``%(lineno)d``" msgstr "``%(lineno)d``" -#: ../../library/logging.rst:983 +#: ../../library/logging.rst:947 msgid "Source line number where the logging call was issued (if available)." msgstr "" -#: ../../library/logging.rst:986 +#: ../../library/logging.rst:950 msgid "message" msgstr "" -#: ../../library/logging.rst:986 +#: ../../library/logging.rst:950 msgid "``%(message)s``" msgstr "``%(message)s``" -#: ../../library/logging.rst:986 +#: ../../library/logging.rst:950 msgid "" "The logged message, computed as ``msg % args``. This is set when :meth:" "`Formatter.format` is invoked." msgstr "" -#: ../../library/logging.rst:990 +#: ../../library/logging.rst:954 msgid "module" msgstr "模組" -#: ../../library/logging.rst:990 +#: ../../library/logging.rst:954 msgid "``%(module)s``" msgstr "``%(module)s``" -#: ../../library/logging.rst:990 +#: ../../library/logging.rst:954 msgid "Module (name portion of ``filename``)." msgstr "" -#: ../../library/logging.rst:992 +#: ../../library/logging.rst:956 msgid "msecs" msgstr "" -#: ../../library/logging.rst:992 +#: ../../library/logging.rst:956 msgid "``%(msecs)d``" msgstr "``%(msecs)d``" -#: ../../library/logging.rst:992 +#: ../../library/logging.rst:956 msgid "" "Millisecond portion of the time when the :class:`LogRecord` was created." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:995 +#: ../../library/logging.rst:0 ../../library/logging.rst:959 msgid "msg" msgstr "" -#: ../../library/logging.rst:995 +#: ../../library/logging.rst:959 msgid "" "The format string passed in the original logging call. Merged with ``args`` " "to produce ``message``, or an arbitrary object (see :ref:`arbitrary-object-" "messages`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:1000 +#: ../../library/logging.rst:0 ../../library/logging.rst:964 msgid "name" msgstr "" -#: ../../library/logging.rst:1000 +#: ../../library/logging.rst:964 msgid "``%(name)s``" msgstr "``%(name)s``" -#: ../../library/logging.rst:1000 +#: ../../library/logging.rst:964 msgid "Name of the logger used to log the call." msgstr "" -#: ../../library/logging.rst:1002 +#: ../../library/logging.rst:966 msgid "pathname" msgstr "" -#: ../../library/logging.rst:1002 +#: ../../library/logging.rst:966 msgid "``%(pathname)s``" msgstr "``%(pathname)s``" -#: ../../library/logging.rst:1002 +#: ../../library/logging.rst:966 msgid "" "Full pathname of the source file where the logging call was issued (if " "available)." msgstr "" -#: ../../library/logging.rst:1005 +#: ../../library/logging.rst:969 msgid "process" msgstr "" -#: ../../library/logging.rst:1005 +#: ../../library/logging.rst:969 msgid "``%(process)d``" msgstr "``%(process)d``" -#: ../../library/logging.rst:1005 +#: ../../library/logging.rst:969 msgid "Process ID (if available)." msgstr "" -#: ../../library/logging.rst:1007 +#: ../../library/logging.rst:971 msgid "processName" msgstr "" -#: ../../library/logging.rst:1007 +#: ../../library/logging.rst:971 msgid "``%(processName)s``" msgstr "``%(processName)s``" -#: ../../library/logging.rst:1007 +#: ../../library/logging.rst:971 msgid "Process name (if available)." msgstr "" -#: ../../library/logging.rst:1009 +#: ../../library/logging.rst:973 msgid "relativeCreated" msgstr "" -#: ../../library/logging.rst:1009 +#: ../../library/logging.rst:973 msgid "``%(relativeCreated)d``" msgstr "``%(relativeCreated)d``" -#: ../../library/logging.rst:1009 +#: ../../library/logging.rst:973 msgid "" "Time in milliseconds when the LogRecord was created, relative to the time " "the logging module was loaded." msgstr "" -#: ../../library/logging.rst:1013 +#: ../../library/logging.rst:977 msgid "stack_info" msgstr "stack_info" -#: ../../library/logging.rst:1013 +#: ../../library/logging.rst:977 msgid "" "Stack frame information (where available) from the bottom of the stack in " "the current thread, up to and including the stack frame of the logging call " "which resulted in the creation of this record." msgstr "" -#: ../../library/logging.rst:1019 +#: ../../library/logging.rst:983 msgid "thread" msgstr "" -#: ../../library/logging.rst:1019 +#: ../../library/logging.rst:983 msgid "``%(thread)d``" msgstr "``%(thread)d``" -#: ../../library/logging.rst:1019 +#: ../../library/logging.rst:983 msgid "Thread ID (if available)." msgstr "" -#: ../../library/logging.rst:1021 +#: ../../library/logging.rst:985 msgid "threadName" msgstr "" -#: ../../library/logging.rst:1021 +#: ../../library/logging.rst:985 msgid "``%(threadName)s``" msgstr "``%(threadName)s``" -#: ../../library/logging.rst:1021 +#: ../../library/logging.rst:985 msgid "Thread name (if available)." msgstr "" -#: ../../library/logging.rst:1023 +#: ../../library/logging.rst:987 msgid "taskName" msgstr "taskName" -#: ../../library/logging.rst:1023 +#: ../../library/logging.rst:987 msgid "``%(taskName)s``" msgstr "``%(taskName)s``" -#: ../../library/logging.rst:1023 +#: ../../library/logging.rst:987 msgid ":class:`asyncio.Task` name (if available)." msgstr "" -#: ../../library/logging.rst:1026 +#: ../../library/logging.rst:990 msgid "*processName* was added." msgstr "新增 *processName*。" -#: ../../library/logging.rst:1029 +#: ../../library/logging.rst:993 msgid "*taskName* was added." msgstr "新增 *taskName*。" -#: ../../library/logging.rst:1035 +#: ../../library/logging.rst:999 msgid "LoggerAdapter Objects" msgstr "LoggerAdapter 物件" -#: ../../library/logging.rst:1037 +#: ../../library/logging.rst:1001 msgid "" ":class:`LoggerAdapter` instances are used to conveniently pass contextual " "information into logging calls. For a usage example, see the section on :ref:" "`adding contextual information to your logging output `." msgstr "" -#: ../../library/logging.rst:1043 +#: ../../library/logging.rst:1007 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " "underlying :class:`Logger` instance and a dict-like object." msgstr "" -#: ../../library/logging.rst:1048 +#: ../../library/logging.rst:1012 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1493,15 +1446,15 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:1056 +#: ../../library/logging.rst:1020 msgid "Delegates to the underlying :attr:`!manager`` on *logger*." msgstr "" -#: ../../library/logging.rst:1060 +#: ../../library/logging.rst:1024 msgid "Delegates to the underlying :meth:`!_log`` method on *logger*." msgstr "" -#: ../../library/logging.rst:1062 +#: ../../library/logging.rst:1026 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1513,24 +1466,24 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:1073 +#: ../../library/logging.rst:1037 msgid "" "The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`, :meth:" "`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added to :" "class:`LoggerAdapter`. These methods delegate to the underlying logger." msgstr "" -#: ../../library/logging.rst:1079 +#: ../../library/logging.rst:1043 msgid "" "Attribute :attr:`!manager` and method :meth:`!_log` were added, which " "delegate to the underlying logger and allow adapters to be nested." msgstr "" -#: ../../library/logging.rst:1084 +#: ../../library/logging.rst:1048 msgid "Thread Safety" msgstr "" -#: ../../library/logging.rst:1086 +#: ../../library/logging.rst:1050 msgid "" "The logging module is intended to be thread-safe without any special work " "needing to be done by its clients. It achieves this though using threading " @@ -1539,7 +1492,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:1091 +#: ../../library/logging.rst:1055 msgid "" "If you are implementing asynchronous signal handlers using the :mod:`signal` " "module, you may not be able to use logging from within such handlers. This " @@ -1547,17 +1500,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:1098 +#: ../../library/logging.rst:1062 msgid "Module-Level Functions" msgstr "" -#: ../../library/logging.rst:1100 +#: ../../library/logging.rst:1064 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:1106 +#: ../../library/logging.rst:1070 msgid "" "Return a logger with the specified name or, if name is ``None``, return a " "logger which is the root logger of the hierarchy. If specified, the name is " @@ -1566,14 +1519,14 @@ msgid "" "logging." msgstr "" -#: ../../library/logging.rst:1111 +#: ../../library/logging.rst:1075 msgid "" "All calls to this function with a given name return the same logger " "instance. This means that logger instances never need to be passed between " "different parts of an application." msgstr "" -#: ../../library/logging.rst:1118 +#: ../../library/logging.rst:1082 msgid "" "Return either the standard :class:`Logger` class, or the last class passed " "to :func:`setLoggerClass`. This function may be called from within a new " @@ -1582,24 +1535,24 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:1129 +#: ../../library/logging.rst:1093 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1131 +#: ../../library/logging.rst:1095 msgid "" "This function has been provided, along with :func:`setLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1136 +#: ../../library/logging.rst:1100 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:1141 +#: ../../library/logging.rst:1105 msgid "" "Logs a message with level :const:`DEBUG` on the root logger. The *msg* is " "the message format string, and the *args* are the arguments which are merged " @@ -1608,7 +1561,7 @@ msgid "" "argument.)" msgstr "" -#: ../../library/logging.rst:1146 +#: ../../library/logging.rst:1110 msgid "" "There are three keyword arguments in *kwargs* which are inspected: " "*exc_info* which, if it does not evaluate as false, causes exception " @@ -1618,7 +1571,7 @@ msgid "" "exception information." msgstr "" -#: ../../library/logging.rst:1172 +#: ../../library/logging.rst:1136 msgid "" "The third optional keyword argument is *extra* which can be used to pass a " "dictionary which is used to populate the __dict__ of the LogRecord created " @@ -1627,18 +1580,18 @@ msgid "" "logged messages. For example::" msgstr "" -#: ../../library/logging.rst:1183 +#: ../../library/logging.rst:1147 msgid "would print something like:" msgstr "" -#: ../../library/logging.rst:1189 +#: ../../library/logging.rst:1153 msgid "" "The keys in the dictionary passed in *extra* should not clash with the keys " "used by the logging system. (See the :class:`Formatter` documentation for " "more information on which keys are used by the logging system.)" msgstr "" -#: ../../library/logging.rst:1193 +#: ../../library/logging.rst:1157 msgid "" "If you choose to use these attributes in logged messages, you need to " "exercise some care. In the above example, for instance, the :class:" @@ -1649,58 +1602,58 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:1207 +#: ../../library/logging.rst:1171 msgid "" "This function (as well as :func:`info`, :func:`warning`, :func:`error` and :" "func:`critical`) will call :func:`basicConfig` if the root logger doesn't " "have any handler attached." msgstr "" -#: ../../library/logging.rst:1216 +#: ../../library/logging.rst:1180 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1222 +#: ../../library/logging.rst:1186 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1225 +#: ../../library/logging.rst:1189 msgid "" "There is an obsolete function ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:1232 +#: ../../library/logging.rst:1196 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1238 +#: ../../library/logging.rst:1202 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1244 +#: ../../library/logging.rst:1208 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`. Exception info is added to the logging " "message. This function should only be called from an exception handler." msgstr "" -#: ../../library/logging.rst:1250 +#: ../../library/logging.rst:1214 msgid "" "Logs a message with level *level* on the root logger. The other arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1255 +#: ../../library/logging.rst:1219 msgid "" "Provides an overriding level *level* for all loggers which takes precedence " "over the logger's own level. When the need arises to temporarily throttle " @@ -1714,7 +1667,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1266 +#: ../../library/logging.rst:1230 msgid "" "Note that if you have defined any custom logging level higher than " "``CRITICAL`` (this is not recommended), you won't be able to rely on the " @@ -1722,13 +1675,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1271 +#: ../../library/logging.rst:1235 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1277 +#: ../../library/logging.rst:1241 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1738,24 +1691,24 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1284 +#: ../../library/logging.rst:1248 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1289 +#: ../../library/logging.rst:1253 msgid "" "Returns a mapping from level names to their corresponding logging levels. " "For example, the string \"CRITICAL\" maps to :const:`CRITICAL`. The returned " "mapping is copied from an internal mapping on each call to this function." msgstr "" -#: ../../library/logging.rst:1297 +#: ../../library/logging.rst:1261 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1299 +#: ../../library/logging.rst:1263 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1765,20 +1718,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1306 +#: ../../library/logging.rst:1270 msgid "" "The *level* parameter also accepts a string representation of the level such " "as 'INFO'. In such cases, this functions returns the corresponding numeric " "value of the level." msgstr "" -#: ../../library/logging.rst:1310 +#: ../../library/logging.rst:1274 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1313 +#: ../../library/logging.rst:1277 msgid "" "Levels are internally integers (as they need to be compared in the logging " "logic). This function is used to convert between an integer level and the " @@ -1787,7 +1740,7 @@ msgid "" "vice versa." msgstr "" -#: ../../library/logging.rst:1319 +#: ../../library/logging.rst:1283 msgid "" "In Python versions earlier than 3.4, this function could also be passed a " "text level, and would return the corresponding numeric value of the level. " @@ -1795,17 +1748,17 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1327 +#: ../../library/logging.rst:1291 msgid "" "Returns a handler with the specified *name*, or ``None`` if there is no " "handler with that name." msgstr "" -#: ../../library/logging.rst:1334 +#: ../../library/logging.rst:1298 msgid "Returns an immutable set of all known handler names." msgstr "" -#: ../../library/logging.rst:1340 +#: ../../library/logging.rst:1304 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1813,7 +1766,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1348 +#: ../../library/logging.rst:1312 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1822,13 +1775,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1354 +#: ../../library/logging.rst:1318 msgid "" "This function does nothing if the root logger already has handlers " "configured, unless the keyword argument *force* is set to ``True``." msgstr "" -#: ../../library/logging.rst:1357 +#: ../../library/logging.rst:1321 msgid "" "This function should be called from the main thread before other threads are " "started. In versions of Python prior to 2.7.1 and 3.2, if this function is " @@ -1837,54 +1790,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1364 +#: ../../library/logging.rst:1328 msgid "The following keyword arguments are supported." msgstr "" -#: ../../library/logging.rst:1371 +#: ../../library/logging.rst:1335 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1371 +#: ../../library/logging.rst:1335 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1375 +#: ../../library/logging.rst:1339 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1375 +#: ../../library/logging.rst:1339 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1379 +#: ../../library/logging.rst:1343 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1379 +#: ../../library/logging.rst:1343 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1384 +#: ../../library/logging.rst:1348 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1384 +#: ../../library/logging.rst:1348 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1387 +#: ../../library/logging.rst:1351 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1387 +#: ../../library/logging.rst:1351 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1398 +#: ../../library/logging.rst:1362 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1398 +#: ../../library/logging.rst:1362 msgid "" "Use the specified stream to initialize the :class:`StreamHandler`. Note that " "this argument is incompatible with *filename* - if both are present, a " "``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1404 +#: ../../library/logging.rst:1368 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1404 +#: ../../library/logging.rst:1368 msgid "" "If specified, this should be an iterable of already created handlers to add " "to the root logger. Any handlers which don't already have a formatter set " @@ -1924,33 +1877,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1413 +#: ../../library/logging.rst:1377 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1413 +#: ../../library/logging.rst:1377 msgid "" "If this keyword argument is specified as true, any existing handlers " "attached to the root logger are removed and closed, before carrying out the " "configuration as specified by the other arguments." msgstr "" -#: ../../library/logging.rst:1419 +#: ../../library/logging.rst:1383 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1419 +#: ../../library/logging.rst:1383 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " "the output file." msgstr "" -#: ../../library/logging.rst:1424 +#: ../../library/logging.rst:1388 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1424 +#: ../../library/logging.rst:1388 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " @@ -1959,39 +1912,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1435 +#: ../../library/logging.rst:1399 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1438 +#: ../../library/logging.rst:1402 msgid "" "The *handlers* argument was added. Additional checks were added to catch " "situations where incompatible arguments are specified (e.g. *handlers* " "together with *stream* or *filename*, or *stream* together with *filename*)." msgstr "" -#: ../../library/logging.rst:1444 +#: ../../library/logging.rst:1408 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1447 +#: ../../library/logging.rst:1411 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1452 +#: ../../library/logging.rst:1416 msgid "" "Informs the logging system to perform an orderly shutdown by flushing and " "closing all handlers. This should be called at application exit and no " "further use of the logging system should be made after this call." msgstr "" -#: ../../library/logging.rst:1456 +#: ../../library/logging.rst:1420 msgid "" "When the logging module is imported, it registers this function as an exit " "handler (see :mod:`atexit`), so normally there's no need to do that manually." msgstr "" -#: ../../library/logging.rst:1463 +#: ../../library/logging.rst:1427 msgid "" "Tells the logging system to use the class *klass* when instantiating a " "logger. The class should define :meth:`!__init__` such that only a name " @@ -2003,32 +1956,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1474 +#: ../../library/logging.rst:1438 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1476 +#: ../../library/logging.rst:1440 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1478 +#: ../../library/logging.rst:1442 msgid "" "This function has been provided, along with :func:`getLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1483 +#: ../../library/logging.rst:1447 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1485 +#: ../../library/logging.rst:1449 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1487 +#: ../../library/logging.rst:1451 msgid "The logger name." msgstr "" @@ -2036,7 +1989,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1488 +#: ../../library/logging.rst:1452 msgid "The logging level (numeric)." msgstr "" @@ -2044,7 +1997,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1489 +#: ../../library/logging.rst:1453 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -2052,19 +2005,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1490 +#: ../../library/logging.rst:1454 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1491 +#: ../../library/logging.rst:1455 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1492 +#: ../../library/logging.rst:1456 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1493 +#: ../../library/logging.rst:1457 msgid "An exception tuple, or ``None``." msgstr "" @@ -2072,7 +2025,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1494 +#: ../../library/logging.rst:1458 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -2080,7 +2033,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1496 +#: ../../library/logging.rst:1460 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -2090,15 +2043,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1498 +#: ../../library/logging.rst:1462 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1502 +#: ../../library/logging.rst:1466 msgid "Module-Level Attributes" msgstr "" -#: ../../library/logging.rst:1506 +#: ../../library/logging.rst:1470 msgid "" "A \"handler of last resort\" is available through this attribute. This is a :" "class:`StreamHandler` writing to ``sys.stderr`` with a level of ``WARNING``, " @@ -2109,15 +2062,15 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1518 +#: ../../library/logging.rst:1482 msgid "Used to see if exceptions during handling should be propagated." msgstr "" -#: ../../library/logging.rst:1520 +#: ../../library/logging.rst:1484 msgid "Default: ``True``." msgstr "" -#: ../../library/logging.rst:1522 +#: ../../library/logging.rst:1486 msgid "" "If :data:`raiseExceptions` is ``False``, exceptions get silently ignored. " "This is what is mostly wanted for a logging system - most users will not " @@ -2125,22 +2078,22 @@ msgid "" "application errors." msgstr "" -#: ../../library/logging.rst:1529 +#: ../../library/logging.rst:1493 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1531 +#: ../../library/logging.rst:1495 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1536 +#: ../../library/logging.rst:1500 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1539 +#: ../../library/logging.rst:1503 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -2149,46 +2102,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1544 +#: ../../library/logging.rst:1508 msgid "" "If *capture* is ``False``, the redirection of warnings to the logging system " "will stop, and warnings will be redirected to their original destinations (i." "e. those in effect before ``captureWarnings(True)`` was called)." msgstr "" -#: ../../library/logging.rst:1552 +#: ../../library/logging.rst:1516 msgid "Module :mod:`logging.config`" msgstr "" -#: ../../library/logging.rst:1552 +#: ../../library/logging.rst:1516 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1555 +#: ../../library/logging.rst:1519 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.rst:1555 +#: ../../library/logging.rst:1519 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1559 +#: ../../library/logging.rst:1523 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1558 +#: ../../library/logging.rst:1522 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1564 +#: ../../library/logging.rst:1528 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1562 +#: ../../library/logging.rst:1526 msgid "" "This is the original source for the :mod:`logging` package. The version of " "the package available from this site is suitable for use with Python 1.5.2, " diff --git a/library/re.po b/library/re.po index ea8ccaf417..c7ab596f76 100644 --- a/library/re.po +++ b/library/re.po @@ -2307,7 +2307,7 @@ msgstr "\\g" #: ../../library/re.rst:1595 msgid "scanf (C function)" -msgstr "" +msgstr "scanf(C 函式)" #~ msgid "scanf()" #~ msgstr "scanf()" diff --git a/library/threading.po b/library/threading.po index eda693cb00..bfaa5655b8 100644 --- a/library/threading.po +++ b/library/threading.po @@ -485,9 +485,8 @@ msgid "" msgstr "" #: ../../library/threading.rst:363 -#, fuzzy msgid "Added the *daemon* parameter." -msgstr "新增 *daemon* 引數。" +msgstr "新增 *daemon* 參數。" #: ../../library/threading.rst:366 msgid "Use the *target* name if *name* argument is omitted." diff --git a/using/cmdline.po b/using/cmdline.po index 24b81d907b..0fb740ca3d 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -748,24 +748,20 @@ msgid "" msgstr "" #: ../../using/cmdline.rst:555 -#, fuzzy msgid "Added the ``-X faulthandler`` option." -msgstr "``-X faulthandler`` 選項。" +msgstr "新增 ``-X faulthandler`` 選項。" #: ../../using/cmdline.rst:558 -#, fuzzy msgid "Added the ``-X showrefcount`` and ``-X tracemalloc`` options." -msgstr "``-X showrefcount`` 和 ``-X tracemalloc`` 選項。" +msgstr "新增 ``-X showrefcount`` 和 ``-X tracemalloc`` 選項。" #: ../../using/cmdline.rst:561 -#, fuzzy msgid "Added the ``-X showalloccount`` option." -msgstr "``-X showalloccount`` 選項。" +msgstr "新增 ``-X showalloccount`` 選項。" #: ../../using/cmdline.rst:564 -#, fuzzy msgid "Added the ``-X importtime``, ``-X dev`` and ``-X utf8`` options." -msgstr "``-X importtime``、``-X dev`` 和 ``-X utf8`` 選項。" +msgstr "新增 ``-X importtime``、``-X dev`` 和 ``-X utf8`` 選項。" #: ../../using/cmdline.rst:567 msgid "" @@ -784,23 +780,21 @@ msgid "The ``-X showalloccount`` option has been removed." msgstr "``-X showalloccount`` 選項已被移除。" #: ../../using/cmdline.rst:577 -#, fuzzy msgid "" "Added the ``-X warn_default_encoding`` option. Removed the ``-X oldparser`` " "option." -msgstr "``-X warn_default_encoding`` 選項。``-X oldparser`` 選項已被移除。" +msgstr "" +"新增 ``-X warn_default_encoding`` 選項。``-X oldparser`` 選項已被移除。" #: ../../using/cmdline.rst:581 -#, fuzzy msgid "" "Added the ``-X no_debug_ranges``, ``-X frozen_modules`` and ``-X " "int_max_str_digits`` options." -msgstr "``-X importtime``、``-X dev`` 和 ``-X utf8`` 選項。" +msgstr "新增 ``-X importtime``、``-X dev`` 和 ``-X utf8`` 選項。" #: ../../using/cmdline.rst:585 -#, fuzzy msgid "Added the ``-X perf`` option." -msgstr "``-X perf`` 選項。" +msgstr "新增 ``-X perf`` 選項。" #: ../../using/cmdline.rst:590 msgid "Options you shouldn't use" diff --git a/using/mac.po b/using/mac.po index 33f738ff3a..ddf3696d9f 100644 --- a/using/mac.po +++ b/using/mac.po @@ -35,22 +35,20 @@ msgid "Bob Savage " msgstr "Bob Savage " #: ../../using/mac.rst:11 -#, fuzzy msgid "" "Python on a Mac running macOS is in principle very similar to Python on any " "other Unix platform, but there are a number of additional features such as " "the integrated development environment (IDE) and the Package Manager that " "are worth pointing out." msgstr "" -"Python 在 Mac 的 macOS 上執行和在其他 Unix 平台上執行的原理非常相似,\\ 但值" -"得一提的是在 macOS 上有其他額外的功能,例如 IDE 與套件管理。" +"Python 在 Mac 的 macOS 上執行和在其他 Unix 平台上執行的原理非常相似,但值得一" +"提的是在 macOS 上有其他額外的功能,例如整合開發環境 (IDE) 與套件管理。" #: ../../using/mac.rst:21 msgid "Getting and Installing Python" msgstr "取得和安裝 Python" #: ../../using/mac.rst:23 -#, fuzzy msgid "" "macOS used to come with Python 2.7 pre-installed between versions 10.8 and " "`12.3 `_\\ 之間預" -"設安裝 Python 2.7。你也可以到 Python 網站 (https://www.python.org) 安裝最新" -"的 Python 3 版本。你可以找到建立在\"通用二進位 (universal binary)\" 上的 " -"Python 建置版本,它能夠原生地運行在 Mac 新的 Intel CPU 與過去的 PPC CPU 上。" +"設安裝 Python 2.7。你也可以到 `Python 網站 `__\\ 安裝最新的 Python 3 版本。你可以找到建立在\"通用二進位 " +"(universal2 binary)\" 上的 Python 建置版本,它能夠原生地運行在 Mac 新的 " +"Apple Silicon CPU 與過去的 Intel CPU 上。" #: ../../using/mac.rst:30 msgid "What you get after installing is a number of things:" @@ -94,7 +93,6 @@ msgstr "" "在 :file:`/usr/local/bin/` 中。" #: ../../using/mac.rst:44 -#, fuzzy msgid "" "On macOS 10.8-12.3, the Apple-provided build of Python is installed in :file:" "`/System/Library/Frameworks/Python.framework` and :file:`/usr/bin/python`, " @@ -105,11 +103,12 @@ msgid "" "will be important that your paths and usages are consistent with what you " "want to do." msgstr "" -"Apple 提供的 Python 建置版本分別安裝在 :file:`/System/Library/Frameworks/" -"Python.framework` 和 :file:`/usr/bin/python` 中。你不應該去修改或刪除這些內" -"容,因為它們由 Apple 控制並且被 Apple 或第三方軟體使用。請記住,如果你選擇從 " -"python.org 安裝較新的 Python 版本,那麼你的計算機上將安裝兩個不同但都可運作" -"的 Python,因此你的路徑和用法與你想要執行的操作一致非常重要。" +"在 macOS 10.8-12.3,Apple 提供的 Python 建置版本分別安裝在 :file:`/System/" +"Library/Frameworks/Python.framework` 和 :file:`/usr/bin/python` 中。你不應該" +"去修改或刪除這些內容,因為它們由 Apple 控制並且被 Apple 或第三方軟體使用。請" +"記住,如果你選擇從 python.org 安裝較新的 Python 版本,那麼你的計算機上將安裝" +"兩個不同但都可運作的 Python,因此你的路徑和用法與你想要執行的操作一致非常重" +"要。" #: ../../using/mac.rst:52 msgid "" @@ -133,17 +132,15 @@ msgid "How to run a Python script" msgstr "如何執行 Python 腳本" #: ../../using/mac.rst:63 -#, fuzzy msgid "" "Your best way to get started with Python on macOS is through the IDLE " "integrated development environment; see section :ref:`ide` and use the Help " "menu when the IDE is running." msgstr "" -"在 macOS 上開始使用 Python 的最佳方法是透過 IDLE 整合開發環境,參見\\ :ref:" +"在 macOS 上開始使用 Python 的最佳方法是透過 IDLE 整合開發環境;參見 :ref:" "`ide` 部分,並在 IDE 執行時使用幫助選單。" #: ../../using/mac.rst:67 -#, fuzzy msgid "" "If you want to run Python scripts from the Terminal window command line or " "from the Finder you first need an editor to create your script. macOS comes " @@ -156,11 +153,11 @@ msgid "" msgstr "" "如果要從終端機視窗命令列或 Finder 執行 Python 腳本,首先需要一個編輯器來建立" "腳本。macOS 附帶了許多標準的 Unix 命令列編輯器,如 :program:`vim` 和 :" -"program:`emacs`。如果你想要一個更 Mac 化的編輯器,那麼來自 Bare Bones " -"Software 的 :program:`BBEdit` 或 :program:`TextWrangler` (參見 http://www." -"barebones.com/products/bbedit/index.html)是不錯的選擇,:program:`TextMate` " -"(參見 https://macromates.com/)也是個選擇。其他編輯器包括 :program:`Gvim` " -"(https://macvim.org/macvim/) 和 :program:`Aquamacs` (https://aquamacs.org/)。" +"program:`nano`。如果你想要一個更 Mac 化的編輯器,那麼來自 Bare Bones " +"Software 的 :program:`BBEdit`\\ (參見 http://www.barebones.com/products/" +"bbedit/index.html) 是不錯的選擇,:program:`TextMate` (參見 https://" +"macromates.com/)也是個選擇。其他編輯器包括 :program:`MacVim` (https://" +"macvim.org) 和 :program:`Aquamacs` (https://aquamacs.org/)。" #: ../../using/mac.rst:77 msgid ""