diff --git a/c-api/bytearray.po b/c-api/bytearray.po index 15d1dc4bfb..3c910625df 100644 --- a/c-api/bytearray.po +++ b/c-api/bytearray.po @@ -33,8 +33,8 @@ msgid "" "This instance of :c:type:`PyTypeObject` represents the Python bytearray " "type; it is the same object as :class:`bytearray` in the Python layer." msgstr "" -"這個 :c:type:`PyTypeObject` 的實例代表了 Python 的位元組陣列型別;在 Python 層" -"中的 :class:`bytearray` 為同一個物件。" +"這個 :c:type:`PyTypeObject` 的實例代表了 Python 的位元組陣列型別;在 Python " +"層中的 :class:`bytearray` 為同一個物件。" #: ../../c-api/bytearray.rst:23 msgid "Type check macros" @@ -45,16 +45,16 @@ msgid "" "Return true if the object *o* is a bytearray object or an instance of a " "subtype of the bytearray type. This function always succeeds." msgstr "" -"如果物件 *o* 是一個位元組陣列物件,或者是位元組陣列型別的子型別的實例,則回傳真" -"值。此函式總是會成功執行。" +"如果物件 *o* 是一個位元組陣列物件,或者是位元組陣列型別的子型別的實例,則回傳" +"真值。此函式總是會成功執行。" #: ../../c-api/bytearray.rst:33 msgid "" "Return true if the object *o* is a bytearray object, but not an instance of " "a subtype of the bytearray type. This function always succeeds." msgstr "" -"如果物件 *o* 是一個位元組陣列物件,但不是位元組陣列型別的子型別的實例,則回傳真" -"值。此函式總是會成功執行。" +"如果物件 *o* 是一個位元組陣列物件,但不是位元組陣列型別的子型別的實例,則回傳" +"真值。此函式總是會成功執行。" #: ../../c-api/bytearray.rst:38 msgid "Direct API functions" @@ -73,7 +73,8 @@ msgid "" "Create a new bytearray object from *string* and its length, *len*. On " "failure, ``NULL`` is returned." msgstr "" -"從 *string* 及其長度 *len* 建立一個新的位元組陣列物件。若失敗則回傳 ``NULL``。" +"從 *string* 及其長度 *len* 建立一個新的位元組陣列物件。若失敗則回傳 " +"``NULL``。" #: ../../c-api/bytearray.rst:54 msgid "" diff --git a/c-api/complex.po b/c-api/complex.po index 464482f05a..a5e17cbf91 100644 --- a/c-api/complex.po +++ b/c-api/complex.po @@ -43,9 +43,9 @@ msgid "" "return them as results do so *by value* rather than dereferencing them " "through pointers. This is consistent throughout the API." msgstr "" -"請注意,接受這些結構作為參數並將它們作為結果回傳的函式是\\ *按值 (by " -"value)* 執行的,而不是透過指標取消參照 (dereference) 它們。這在整個 API 中" -"都是一致的。" +"請注意,接受這些結構作為參數並將它們作為結果回傳的函式是\\ *按值 (by value)* " +"執行的,而不是透過指標取消參照 (dereference) 它們。這在整個 API 中都是一致" +"的。" #: ../../c-api/complex.rst:26 msgid "" @@ -73,7 +73,8 @@ msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳兩個複數間的 msgid "" "Return the negation of the complex number *num*, using the C :c:type:" "`Py_complex` representation." -msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳複數 *num* 的相反數 (negation)。" +msgstr "" +"以 C 的 :c:type:`Py_complex` 表示形式來回傳複數 *num* 的相反數 (negation)。" #: ../../c-api/complex.rst:57 msgid "" diff --git a/c-api/datetime.po b/c-api/datetime.po index 86b591964a..e2a60a36b5 100644 --- a/c-api/datetime.po +++ b/c-api/datetime.po @@ -39,8 +39,8 @@ msgstr "" ":mod:`datetime` 模組提供各種日期和時間物件。在使用任何這些函式之前,必須將標" "頭檔 :file:`datetime.h` 引入於原始碼中(請注意,:file:`Python.h` 並無引入該標" "頭檔),且巨集 :c:macro:`!PyDateTime_IMPORT` 必須被調用,而這通常作為模組初始" -"化函式的一部分。該巨集將指向 C 結構的指標放入靜態變數 :c:data:" -"`!PyDateTimeAPI` 中,該變數會被以下巨集使用。" +"化函式的一部分。該巨集將指向 C 結構的指標放入靜態變數 :c:data:`!" +"PyDateTimeAPI` 中,該變數會被以下巨集使用。" #: ../../c-api/datetime.rst:18 msgid "This subtype of :c:type:`PyObject` represents a Python date object." @@ -112,9 +112,9 @@ msgid "" "of :c:data:`!PyDateTime_DateType`. *ob* must not be ``NULL``. This " "function always succeeds." msgstr "" -"如果 *ob* 的型別為 :c:data:`PyDateTime_DateType` 或 :c:data:" -"`!PyDateTime_DateType` 的子型別,則回傳 true。 *ob* 不得為 ``NULL``。這個函式" -"一定會執行成功。" +"如果 *ob* 的型別為 :c:data:`PyDateTime_DateType` 或 :c:data:`!" +"PyDateTime_DateType` 的子型別,則回傳 true。 *ob* 不得為 ``NULL``。這個函式一" +"定會執行成功。" #: ../../c-api/datetime.rst:80 msgid "" @@ -130,8 +130,8 @@ msgid "" "subtype of :c:data:`!PyDateTime_DateTimeType`. *ob* must not be ``NULL``. " "This function always succeeds." msgstr "" -"如果 *ob* 的型別為 :c:data:`PyDateTime_DateTimeType` 或 :c:data:" -"`!PyDateTime_DateTimeType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函" +"如果 *ob* 的型別為 :c:data:`PyDateTime_DateTimeType` 或 :c:data:`!" +"PyDateTime_DateTimeType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函" "式一定會執行成功。" #: ../../c-api/datetime.rst:93 @@ -148,8 +148,8 @@ msgid "" "of :c:data:`!PyDateTime_TimeType`. *ob* must not be ``NULL``. This " "function always succeeds." msgstr "" -"如果 *ob* 的型別為 :c:data:`PyDateTime_TimeType` 或 :c:data:" -"`!PyDateTime_TimeType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式一" +"如果 *ob* 的型別為 :c:data:`PyDateTime_TimeType` 或 :c:data:`!" +"PyDateTime_TimeType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式一" "定會執行成功。" #: ../../c-api/datetime.rst:106 @@ -166,9 +166,9 @@ msgid "" "of :c:data:`!PyDateTime_DeltaType`. *ob* must not be ``NULL``. This " "function always succeeds." msgstr "" -"如果 *ob* 的型別為 :c:data:`PyDateTime_DeltaType` 或 :c:data:" -"`!PyDateTime_DeltaType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式" -"一定會執行成功。" +"如果 *ob* 的型別為 :c:data:`PyDateTime_DeltaType` 或 :c:data:`!" +"PyDateTime_DeltaType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式一" +"定會執行成功。" #: ../../c-api/datetime.rst:119 msgid "" @@ -184,8 +184,8 @@ msgid "" "of :c:data:`!PyDateTime_TZInfoType`. *ob* must not be ``NULL``. This " "function always succeeds." msgstr "" -"如果 *ob* 的型別為 :c:data:`PyDateTime_TZInfoType` 或 :c:data:" -"`!PyDateTime_TZInfoType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式" +"如果 *ob* 的型別為 :c:data:`PyDateTime_TZInfoType` 或 :c:data:`!" +"PyDateTime_TZInfoType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式" "一定會執行成功。" #: ../../c-api/datetime.rst:132 diff --git a/c-api/frame.po b/c-api/frame.po index e9f7f62f6f..c7c3384f27 100644 --- a/c-api/frame.po +++ b/c-api/frame.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-12-06 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -19,15 +19,15 @@ msgstr "" #: ../../c-api/frame.rst:4 msgid "Frame Objects" -msgstr "" +msgstr "Frame 物件" #: ../../c-api/frame.rst:8 msgid "The C structure of the objects used to describe frame objects." -msgstr "" +msgstr "用來描述 frame 物件的 C 結構。" #: ../../c-api/frame.rst:10 msgid "There are no public members in this structure." -msgstr "" +msgstr "在這個結構中沒有公開的成員。" #: ../../c-api/frame.rst:12 msgid "" @@ -76,12 +76,12 @@ msgid "" msgstr "" #: ../../c-api/frame.rst:53 -msgid "Get the *frame*'s ``f_builtins`` attribute." -msgstr "" +msgid "Get the *frame*'s :attr:`~frame.f_builtins` attribute." +msgstr "取得 *frame* 的 :attr:`~frame.f_builtins` 屬性。" #: ../../c-api/frame.rst:55 ../../c-api/frame.rst:86 msgid "Return a :term:`strong reference`. The result cannot be ``NULL``." -msgstr "" +msgstr "回傳 :term:`strong reference`。結果不能為 ``NULL``。" #: ../../c-api/frame.rst:62 msgid "Get the *frame* code." @@ -89,7 +89,7 @@ msgstr "" #: ../../c-api/frame.rst:64 ../../c-api/frame.rst:125 msgid "Return a :term:`strong reference`." -msgstr "" +msgstr "回傳 :term:`strong reference`。" #: ../../c-api/frame.rst:66 msgid "The result (frame code) cannot be ``NULL``." @@ -104,40 +104,40 @@ msgstr "" #: ../../c-api/frame.rst:77 msgid "Return a :term:`strong reference`, or ``NULL``." -msgstr "" +msgstr "回傳 :term:`strong reference` 或 ``NULL``。" #: ../../c-api/frame.rst:84 -msgid "Get the *frame*'s ``f_globals`` attribute." -msgstr "" +msgid "Get the *frame*'s :attr:`~frame.f_globals` attribute." +msgstr "取得 *frame* 的 :attr:`~frame.f_globals` 屬性。" #: ../../c-api/frame.rst:93 -msgid "Get the *frame*'s ``f_lasti`` attribute." -msgstr "" +msgid "Get the *frame*'s :attr:`~frame.f_lasti` attribute." +msgstr "取得 *frame* 的 :attr:`~frame.f_lasti` 屬性。" #: ../../c-api/frame.rst:95 msgid "Returns -1 if ``frame.f_lasti`` is ``None``." -msgstr "" +msgstr "如果 ``frame.f_lasti`` 是 ``None`` 則回傳 -1。" #: ../../c-api/frame.rst:102 msgid "Get the variable *name* of *frame*." -msgstr "" +msgstr "取得 *frame* 的變數 *name*。" #: ../../c-api/frame.rst:104 msgid "Return a :term:`strong reference` to the variable value on success." -msgstr "" +msgstr "在成功時回傳變數值的 :term:`strong reference`。" #: ../../c-api/frame.rst:105 msgid "" "Raise :exc:`NameError` and return ``NULL`` if the variable does not exist." -msgstr "" +msgstr "如果變數不存在,則引發 :exc:`NameError` 並回傳 ``NULL``。" #: ../../c-api/frame.rst:106 msgid "Raise an exception and return ``NULL`` on error." -msgstr "" +msgstr "在錯誤時引發例外並回傳 ``NULL``。" #: ../../c-api/frame.rst:108 msgid "*name* type must be a :class:`str`." -msgstr "" +msgstr "*name* 的型別必須是 :class:`str`。" #: ../../c-api/frame.rst:115 msgid "" @@ -146,7 +146,7 @@ msgid "" msgstr "" #: ../../c-api/frame.rst:123 -msgid "Get the *frame*'s ``f_locals`` attribute (:class:`dict`)." +msgid "Get the *frame*'s :attr:`~frame.f_locals` attribute (:class:`dict`)." msgstr "" #: ../../c-api/frame.rst:132 diff --git a/c-api/init.po b/c-api/init.po index 0247553cf1..248a092daf 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-08-01 00:03+0000\n" +"POT-Creation-Date: 2023-12-06 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-" @@ -299,6 +299,8 @@ msgid "" "Ignore all :envvar:`!PYTHON*` environment variables, e.g. :envvar:" "`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." msgstr "" +"忽略所有可能被設定的 :envvar:`!PYTHON*` 環境變數,例如 :envvar:`PYTHONPATH` " +"與 :envvar:`PYTHONHOME`。" #: ../../c-api/init.rst:163 msgid "Set by the :option:`-E` and :option:`-I` options." @@ -376,7 +378,7 @@ msgstr "" #: ../../c-api/init.rst:220 msgid "See :pep:`529` for more details." -msgstr "更多詳情請見 :pep:`529`\\ 。" +msgstr "更多詳情請見 :pep:`529`。" #: ../../c-api/init.rst:222 ../../c-api/init.rst:240 msgid ":ref:`Availability `: Windows." @@ -403,7 +405,7 @@ msgstr "" #: ../../c-api/init.rst:238 msgid "See :pep:`528` for more details." -msgstr "更多詳情請見 :pep:`528`\\ 。" +msgstr "更多詳情請見 :pep:`528`。" #: ../../c-api/init.rst:246 msgid "" @@ -698,12 +700,12 @@ msgstr "" msgid "" "This function should not be called before :c:func:`Py_Initialize`, otherwise " "it returns ``NULL``." -msgstr "" +msgstr "此函式不應該在 :c:func:`Py_Initialize` 之前呼叫,否則會回傳 ``NULL``。" #: ../../c-api/init.rst:504 ../../c-api/init.rst:523 ../../c-api/init.rst:564 #: ../../c-api/init.rst:583 ../../c-api/init.rst:609 ../../c-api/init.rst:830 msgid "It now returns ``NULL`` if called before :c:func:`Py_Initialize`." -msgstr "" +msgstr "如果在 :c:func:`Py_Initialize` 之前呼叫,現在會回傳 ``NULL``。" #: ../../c-api/init.rst:510 msgid "" @@ -2197,43 +2199,43 @@ msgstr "" msgid "" "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " "function (but not a profiling function) when a line-number event is being " -"reported. It may be disabled for a frame by setting :attr:`f_trace_lines` to " -"*0* on that frame." +"reported. It may be disabled for a frame by setting :attr:`~frame." +"f_trace_lines` to *0* on that frame." msgstr "" -#: ../../c-api/init.rst:1917 +#: ../../c-api/init.rst:1918 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:1923 +#: ../../c-api/init.rst:1924 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:1929 +#: ../../c-api/init.rst:1930 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:1935 +#: ../../c-api/init.rst:1936 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:1941 +#: ../../c-api/init.rst:1942 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " "not profiling functions) when a new opcode is about to be executed. This " "event is not emitted by default: it must be explicitly requested by setting :" -"attr:`f_trace_opcodes` to *1* on the frame." +"attr:`~frame.f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:1949 +#: ../../c-api/init.rst:1950 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``. " @@ -2243,29 +2245,29 @@ msgid "" "`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:1956 +#: ../../c-api/init.rst:1957 msgid "See also the :func:`sys.setprofile` function." msgstr "" -#: ../../c-api/init.rst:1958 ../../c-api/init.rst:1965 -#: ../../c-api/init.rst:1984 ../../c-api/init.rst:1991 +#: ../../c-api/init.rst:1959 ../../c-api/init.rst:1966 +#: ../../c-api/init.rst:1985 ../../c-api/init.rst:1992 msgid "The caller must hold the :term:`GIL`." msgstr "呼叫者必須持有 :term:`GIL`。" -#: ../../c-api/init.rst:1962 +#: ../../c-api/init.rst:1963 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:1967 +#: ../../c-api/init.rst:1968 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:1975 +#: ../../c-api/init.rst:1976 msgid "" "Set the tracing function to *func*. This is similar to :c:func:" "`PyEval_SetProfile`, except the tracing function does receive line-number " @@ -2276,65 +2278,65 @@ msgid "" "*what* parameter." msgstr "" -#: ../../c-api/init.rst:1982 +#: ../../c-api/init.rst:1983 msgid "See also the :func:`sys.settrace` function." msgstr "也請見 :func:`sys.settrace` 函式。" -#: ../../c-api/init.rst:1988 +#: ../../c-api/init.rst:1989 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:1993 +#: ../../c-api/init.rst:1994 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:2002 +#: ../../c-api/init.rst:2003 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:2007 +#: ../../c-api/init.rst:2008 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:2012 +#: ../../c-api/init.rst:2013 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:2017 +#: ../../c-api/init.rst:2018 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:2022 +#: ../../c-api/init.rst:2023 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:2028 +#: ../../c-api/init.rst:2029 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:2034 +#: ../../c-api/init.rst:2035 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:2041 +#: ../../c-api/init.rst:2042 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:2045 +#: ../../c-api/init.rst:2046 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2344,19 +2346,19 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:2052 +#: ../../c-api/init.rst:2053 msgid "" "The GIL does *not* need to be held when calling these functions; they supply " "their own locking." msgstr "" -#: ../../c-api/init.rst:2055 +#: ../../c-api/init.rst:2056 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:2059 +#: ../../c-api/init.rst:2060 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 " @@ -2364,22 +2366,22 @@ msgid "" "don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:2067 +#: ../../c-api/init.rst:2068 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:2069 +#: ../../c-api/init.rst:2070 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:2075 +#: ../../c-api/init.rst:2076 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:2080 +#: ../../c-api/init.rst:2081 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 " @@ -2387,52 +2389,52 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:2085 +#: ../../c-api/init.rst:2086 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:2091 +#: ../../c-api/init.rst:2092 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:2096 +#: ../../c-api/init.rst:2097 msgid "Dynamic Allocation" msgstr "" -#: ../../c-api/init.rst:2098 +#: ../../c-api/init.rst:2099 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:2105 +#: ../../c-api/init.rst:2106 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:2112 +#: ../../c-api/init.rst:2113 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:2118 +#: ../../c-api/init.rst:2119 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:2123 +#: ../../c-api/init.rst:2124 msgid "Methods" msgstr "方法" -#: ../../c-api/init.rst:2125 +#: ../../c-api/init.rst:2126 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 " @@ -2440,13 +2442,13 @@ msgid "" "func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2133 +#: ../../c-api/init.rst:2134 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:2139 +#: ../../c-api/init.rst:2140 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 " @@ -2455,7 +2457,7 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: ../../c-api/init.rst:2148 +#: ../../c-api/init.rst:2149 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 " @@ -2464,31 +2466,31 @@ msgid "" "key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:2157 +#: ../../c-api/init.rst:2158 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:2164 +#: ../../c-api/init.rst:2165 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:2172 +#: ../../c-api/init.rst:2173 msgid "Thread Local Storage (TLS) API" msgstr "" -#: ../../c-api/init.rst:2174 +#: ../../c-api/init.rst:2175 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: ../../c-api/init.rst:2179 +#: ../../c-api/init.rst:2180 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 " @@ -2497,7 +2499,7 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2184 +#: ../../c-api/init.rst:2185 msgid "" "Due to the compatibility problem noted above, this version of the API should " "not be used in new code." diff --git a/c-api/set.po b/c-api/set.po index 828de9f04b..0a6f16c6ba 100644 --- a/c-api/set.po +++ b/c-api/set.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-17 00:03+0000\n" +"POT-Creation-Date: 2023-11-27 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-" @@ -20,7 +20,7 @@ msgstr "" #: ../../c-api/set.rst:6 msgid "Set Objects" -msgstr "" +msgstr "集合物件" #: ../../c-api/set.rst:15 msgid "" @@ -168,9 +168,9 @@ msgid "" "Return ``1`` if found and removed, ``0`` if not found (no action taken), and " "``-1`` if an error is encountered. Does not raise :exc:`KeyError` for " "missing keys. Raise a :exc:`TypeError` if the *key* is unhashable. Unlike " -"the Python :meth:`~set.discard` method, this function does not automatically " -"convert unhashable sets into temporary frozensets. Raise :exc:`SystemError` " -"if *set* is not an instance of :class:`set` or its subtype." +"the Python :meth:`~frozenset.discard` method, this function does not " +"automatically convert unhashable sets into temporary frozensets. Raise :exc:" +"`SystemError` if *set* is not an instance of :class:`set` or its subtype." msgstr "" #: ../../c-api/set.rst:158 diff --git a/c-api/structures.po b/c-api/structures.po index d4029f1aec..bf679e8d99 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: 2023-10-14 00:03+0000\n" +"POT-Creation-Date: 2023-12-05 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-" @@ -706,7 +706,7 @@ msgstr ":py:class:`object` (D)" #: ../../c-api/structures.rst:593 msgid "" "(*): Zero-terminated, UTF8-encoded C string. With :c:macro:`!Py_T_STRING` " -"the C representation is a pointer; with :c:macro:`!Py_T_STRING_INLINE` the " +"the C representation is a pointer; with :c:macro:`!Py_T_STRING_INPLACE` the " "string is stored directly in the structure." msgstr "" diff --git a/c-api/unicode.po b/c-api/unicode.po index 313c860031..c3812da4df 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-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-12-06 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-" @@ -100,14 +100,14 @@ msgstr "" #: ../../c-api/unicode.rst:78 msgid "" -"Return true if the object *o* is a Unicode object or an instance of a " +"Return true if the object *obj* is a Unicode object or an instance of a " "Unicode subtype. This function always succeeds." msgstr "" #: ../../c-api/unicode.rst:84 msgid "" -"Return true if the object *o* is a Unicode object, but not an instance of a " -"subtype. This function always succeeds." +"Return true if the object *obj* is a Unicode object, but not an instance of " +"a subtype. This function always succeeds." msgstr "" #: ../../c-api/unicode.rst:90 @@ -120,8 +120,8 @@ msgstr "" #: ../../c-api/unicode.rst:100 msgid "" -"Return the length of the Unicode string, in code points. *o* has to be a " -"Unicode object in the \"canonical\" representation (not checked)." +"Return the length of the Unicode string, in code points. *unicode* has to " +"be a Unicode object in the \"canonical\" representation (not checked)." msgstr "" #: ../../c-api/unicode.rst:110 @@ -143,14 +143,15 @@ msgstr "``PyUnicode_WCHAR_KIND`` 已被移除。" #: ../../c-api/unicode.rst:132 msgid "" "Return one of the PyUnicode kind constants (see above) that indicate how " -"many bytes per character this Unicode object uses to store its data. *o* " -"has to be a Unicode object in the \"canonical\" representation (not checked)." +"many bytes per character this Unicode object uses to store its data. " +"*unicode* has to be a Unicode object in the \"canonical\" representation " +"(not checked)." msgstr "" #: ../../c-api/unicode.rst:141 msgid "" -"Return a void pointer to the raw Unicode buffer. *o* has to be a Unicode " -"object in the \"canonical\" representation (not checked)." +"Return a void pointer to the raw Unicode buffer. *unicode* has to be a " +"Unicode object in the \"canonical\" representation (not checked)." msgstr "" #: ../../c-api/unicode.rst:150 @@ -171,7 +172,7 @@ msgstr "" #: ../../c-api/unicode.rst:171 msgid "" -"Read a character from a Unicode object *o*, which must be in the " +"Read a character from a Unicode object *unicode*, which must be in the " "\"canonical\" representation. This is less efficient than :c:func:" "`PyUnicode_READ` if you do multiple consecutive reads." msgstr "" @@ -179,8 +180,8 @@ msgstr "" #: ../../c-api/unicode.rst:180 msgid "" "Return the maximum code point that is suitable for creating another string " -"based on *o*, which must be in the \"canonical\" representation. This is " -"always an approximation but more efficient than iterating over the string." +"based on *unicode*, which must be in the \"canonical\" representation. This " +"is always an approximation but more efficient than iterating over the string." msgstr "" #: ../../c-api/unicode.rst:189 @@ -368,7 +369,7 @@ msgstr "" #: ../../c-api/unicode.rst:370 msgid "" -"Create a Unicode object from the char buffer *u*. The bytes will be " +"Create a Unicode object from the char buffer *str*. The bytes will be " "interpreted as being UTF-8 encoded. The buffer is copied into the new " "object. The return value might be a shared object, i.e. modification of the " "data is not allowed." @@ -383,16 +384,17 @@ msgid "*size* < 0," msgstr "" #: ../../c-api/unicode.rst:379 -msgid "*u* is ``NULL`` and *size* > 0" +msgid "*str* is ``NULL`` and *size* > 0" msgstr "" #: ../../c-api/unicode.rst:381 -msgid "*u* == ``NULL`` with *size* > 0 is not allowed anymore." +msgid "*str* == ``NULL`` with *size* > 0 is not allowed anymore." msgstr "" #: ../../c-api/unicode.rst:387 msgid "" -"Create a Unicode object from a UTF-8 encoded null-terminated char buffer *u*." +"Create a Unicode object from a UTF-8 encoded null-terminated char buffer " +"*str*." msgstr "" #: ../../c-api/unicode.rst:393 @@ -842,22 +844,22 @@ msgstr "" #: ../../c-api/unicode.rst:659 msgid "" -"Return a substring of *str*, from character index *start* (included) to " +"Return a substring of *unicode*, from character index *start* (included) to " "character index *end* (excluded). Negative indices are not supported." msgstr "" #: ../../c-api/unicode.rst:668 msgid "" -"Copy the string *u* into a UCS4 buffer, including a null character, if " +"Copy the string *unicode* into a UCS4 buffer, including a null character, if " "*copy_null* is set. Returns ``NULL`` and sets an exception on error (in " "particular, a :exc:`SystemError` if *buflen* is smaller than the length of " -"*u*). *buffer* is returned on success." +"*unicode*). *buffer* is returned on success." msgstr "" #: ../../c-api/unicode.rst:678 msgid "" -"Copy the string *u* into a new UCS4 buffer that is allocated using :c:func:" -"`PyMem_Malloc`. If this fails, ``NULL`` is returned with a :exc:" +"Copy the string *unicode* into a new UCS4 buffer that is allocated using :c:" +"func:`PyMem_Malloc`. If this fails, ``NULL`` is returned with a :exc:" "`MemoryError` set. The returned buffer always has an extra null code point " "appended." msgstr "" @@ -1034,15 +1036,16 @@ msgstr "" #: ../../c-api/unicode.rst:853 msgid "" -"Create a Unicode object from the :c:type:`wchar_t` buffer *w* of the given " -"*size*. Passing ``-1`` as the *size* indicates that the function must itself " -"compute the length, using wcslen. Return ``NULL`` on failure." +"Create a Unicode object from the :c:type:`wchar_t` buffer *wstr* of the " +"given *size*. Passing ``-1`` as the *size* indicates that the function must " +"itself compute the length, using :c:func:`!wcslen`. Return ``NULL`` on " +"failure." msgstr "" #: ../../c-api/unicode.rst:861 msgid "" -"Copy the Unicode object contents into the :c:type:`wchar_t` buffer *w*. At " -"most *size* :c:type:`wchar_t` characters are copied (excluding a possibly " +"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 " @@ -1124,11 +1127,11 @@ msgstr "" #: ../../c-api/unicode.rst:928 msgid "" -"Create a Unicode object by decoding *size* bytes of the encoded string *s*. " -"*encoding* and *errors* have the same meaning as the parameters of the same " -"name in the :func:`str` built-in function. The codec to be used is looked " -"up using the Python codec registry. Return ``NULL`` if an exception was " -"raised by the codec." +"Create a Unicode object by decoding *size* bytes of the encoded string " +"*str*. *encoding* and *errors* have the same meaning as the parameters of " +"the same name in the :func:`str` built-in function. The codec to be used is " +"looked up using the Python codec registry. Return ``NULL`` if an exception " +"was raised by the codec." msgstr "" #: ../../c-api/unicode.rst:938 @@ -1151,7 +1154,7 @@ msgstr "" #: ../../c-api/unicode.rst:953 msgid "" "Create a Unicode object by decoding *size* bytes of the UTF-8 encoded string " -"*s*. Return ``NULL`` if an exception was raised by the codec." +"*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" #: ../../c-api/unicode.rst:960 @@ -1322,7 +1325,7 @@ msgstr "" #: ../../c-api/unicode.rst:1117 msgid "" "Create a Unicode object by decoding *size* bytes of the UTF-7 encoded string " -"*s*. Return ``NULL`` if an exception was raised by the codec." +"*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" #: ../../c-api/unicode.rst:1124 @@ -1344,7 +1347,8 @@ msgstr "" #: ../../c-api/unicode.rst:1139 msgid "" "Create a Unicode object by decoding *size* bytes of the Unicode-Escape " -"encoded string *s*. Return ``NULL`` if an exception was raised by the codec." +"encoded string *str*. Return ``NULL`` if an exception was raised by the " +"codec." msgstr "" #: ../../c-api/unicode.rst:1145 @@ -1365,7 +1369,8 @@ msgstr "" #: ../../c-api/unicode.rst:1159 msgid "" "Create a Unicode object by decoding *size* bytes of the Raw-Unicode-Escape " -"encoded string *s*. Return ``NULL`` if an exception was raised by the codec." +"encoded string *str*. Return ``NULL`` if an exception was raised by the " +"codec." msgstr "" #: ../../c-api/unicode.rst:1165 @@ -1388,7 +1393,7 @@ msgstr "" #: ../../c-api/unicode.rst:1179 msgid "" "Create a Unicode object by decoding *size* bytes of the Latin-1 encoded " -"string *s*. Return ``NULL`` if an exception was raised by the codec." +"string *str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" #: ../../c-api/unicode.rst:1185 @@ -1411,7 +1416,7 @@ msgstr "" #: ../../c-api/unicode.rst:1199 msgid "" "Create a Unicode object by decoding *size* bytes of the ASCII encoded string " -"*s*. Return ``NULL`` if an exception was raised by the codec." +"*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" #: ../../c-api/unicode.rst:1205 @@ -1441,7 +1446,7 @@ msgstr "" #: ../../c-api/unicode.rst:1224 msgid "" -"Create a Unicode object by decoding *size* bytes of the encoded string *s* " +"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 "" @@ -1516,7 +1521,7 @@ msgstr "" #: ../../c-api/unicode.rst:1278 msgid "" "Create a Unicode object by decoding *size* bytes of the MBCS encoded string " -"*s*. Return ``NULL`` if an exception was raised by the codec." +"*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" #: ../../c-api/unicode.rst:1285 @@ -1576,7 +1581,7 @@ msgstr "" #: ../../c-api/unicode.rst:1338 msgid "" "Split a Unicode string at line breaks, returning a list of Unicode strings. " -"CRLF is considered to be one line break. If *keepend* is ``0``, the line " +"CRLF is considered to be one line break. If *keepends* is ``0``, the Line " "break characters are not included in the resulting strings." msgstr "" @@ -1588,44 +1593,46 @@ msgstr "" #: ../../c-api/unicode.rst:1352 msgid "" -"Return ``1`` if *substr* matches ``str[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." +"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 msgid "" -"Return the first position of *substr* in ``str[start:end]`` using the given " -"*direction* (*direction* == ``1`` means to do a forward search, *direction* " -"== ``-1`` a backward search). The return value is the index of the first " -"match; a value of ``-1`` indicates that no match was found, and ``-2`` " -"indicates that an error occurred and an exception has been set." +"Return the first position of *substr* in ``unicode[start:end]`` using the " +"given *direction* (*direction* == ``1`` means to do a forward search, " +"*direction* == ``-1`` a backward search). The return value is the index of " +"the first match; a value of ``-1`` indicates that no match was found, and " +"``-2`` indicates that an error occurred and an exception has been set." msgstr "" #: ../../c-api/unicode.rst:1370 msgid "" -"Return the first position of the character *ch* in ``str[start:end]`` using " -"the given *direction* (*direction* == ``1`` means to do a forward search, " -"*direction* == ``-1`` a backward search). The return value is the index of " -"the first match; a value of ``-1`` indicates that no match was found, and " -"``-2`` indicates that an error occurred and an exception has been set." +"Return the first position of the character *ch* in ``unicode[start:end]`` " +"using the given *direction* (*direction* == ``1`` means to do a forward " +"search, *direction* == ``-1`` a backward search). The return value is the " +"index of the first match; a value of ``-1`` indicates that no match was " +"found, and ``-2`` indicates that an error occurred and an exception has been " +"set." msgstr "" #: ../../c-api/unicode.rst:1378 -msgid "*start* and *end* are now adjusted to behave like ``str[start:end]``." +msgid "" +"*start* and *end* are now adjusted to behave like ``unicode[start:end]``." msgstr "" #: ../../c-api/unicode.rst:1385 msgid "" -"Return the number of non-overlapping occurrences of *substr* in ``str[start:" -"end]``. Return ``-1`` if an error occurred." +"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 msgid "" -"Replace at most *maxcount* occurrences of *substr* in *str* with *replstr* " -"and return the resulting Unicode object. *maxcount* == ``-1`` means replace " -"all occurrences." +"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 @@ -1642,7 +1649,7 @@ msgstr "" #: ../../c-api/unicode.rst:1408 msgid "" -"Compare a Unicode object, *uni*, with *string* and return ``-1``, ``0``, " +"Compare a Unicode object, *unicode*, with *string* and return ``-1``, ``0``, " "``1`` for less than, equal, and greater than, respectively. It is best to " "pass only ASCII-encoded strings, but the function interprets the input " "string as ISO-8859-1 if it contains non-ASCII characters." @@ -1682,27 +1689,28 @@ msgstr "" #: ../../c-api/unicode.rst:1436 msgid "" -"Check whether *element* is contained in *container* and return true or false " +"Check whether *substr* is contained in *unicode* and return true or false " "accordingly." msgstr "" #: ../../c-api/unicode.rst:1439 msgid "" -"*element* has to coerce to a one element Unicode string. ``-1`` is returned " +"*substr* has to coerce to a one element Unicode string. ``-1`` is returned " "if there was an error." msgstr "" #: ../../c-api/unicode.rst:1445 msgid "" -"Intern the argument *\\*string* in place. The argument must be the address " -"of a pointer variable pointing to a Python Unicode string object. If there " -"is an existing interned string that is the same as *\\*string*, it sets " -"*\\*string* to it (releasing the reference to the old string object and " -"creating a new :term:`strong reference` to the interned string object), " -"otherwise it leaves *\\*string* alone and interns it (creating a new :term:" -"`strong reference`). (Clarification: even though there is a lot of talk " -"about references, think of this function as reference-neutral; you own the " -"object after the call if and only if you owned it before the call.)" +"Intern the argument :c:expr:`*p_unicode` in place. The argument must be the " +"address of a pointer variable pointing to a Python Unicode string object. " +"If there is an existing interned string that is the same as :c:expr:" +"`*p_unicode`, it sets :c:expr:`*p_unicode` to it (releasing the reference to " +"the old string object and creating a new :term:`strong reference` to the " +"interned string object), otherwise it leaves :c:expr:`*p_unicode` alone and " +"interns it (creating a new :term:`strong reference`). (Clarification: even " +"though there is a lot of talk about references, think of this function as " +"reference-neutral; you own the object after the call if and only if you " +"owned it before the call.)" msgstr "" #: ../../c-api/unicode.rst:1458 diff --git a/extending/newtypes.po b/extending/newtypes.po index 2ca6d500b7..453468b4ca 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-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-11-27 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-" @@ -301,7 +301,7 @@ msgid "" "defined this way can have an associated doc string simply by providing the " "text in the table. An application can use the introspection API to retrieve " "the descriptor from the class object, and get the doc string using its :attr:" -"`__doc__` attribute." +"`!__doc__` attribute." msgstr "" #: ../../extending/newtypes.rst:301 @@ -422,7 +422,7 @@ msgstr "" #: ../../extending/newtypes.rst:451 msgid "" -":c:type:`Py_hash_t` is a signed integer type with a platform-varying width. " +":c:type:`!Py_hash_t` is a signed integer type with a platform-varying width. " "Returning ``-1`` from :c:member:`~PyTypeObject.tp_hash` indicates an error, " "which is why you should be careful to avoid returning it when hash " "computation is successful, as seen above." diff --git a/faq/programming.po b/faq/programming.po index f569f5483c..99c2a93585 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -800,9 +800,8 @@ msgid "" "changed from ``[]`` to ``[10]``. Since both the variables refer to the same " "object, using either name accesses the modified value ``[10]``." msgstr "" -"在呼叫 :meth:`!append` 之後,可變物件的內容從 ``[]`` 變成了 ``[10]``。由" -"於這兩個變數都引用同一個物件,因此使用任一名稱都可以存取修改後的值 " -"``[10]`` 。" +"在呼叫 :meth:`!append` 之後,可變物件的內容從 ``[]`` 變成了 ``[10]``。由於這" +"兩個變數都引用同一個物件,因此使用任一名稱都可以存取修改後的值 ``[10]`` 。" #: ../../faq/programming.rst:461 #, fuzzy @@ -2228,8 +2227,8 @@ msgstr "" "要了解為什麼會發生這種情況,你需要知道 (a) 如果一個物件實作了一個 :meth:" "`~object.__iadd__` 魔術方法,它會在執行 ``+=`` 增廣賦值時被呼叫,並且它的回傳" "value 是賦值陳述式中使用的值; (b) 對於list,:meth:`!__iadd__` 相當於在list上" -"呼叫 :meth:`!extend` 並回傳list。這就是為什麼我們說對於list,``+=`` 是 :" -"meth:`!list.extend` 的「簡寫」:\n" +"呼叫 :meth:`!extend` 並回傳list。這就是為什麼我們說對於list,``+=`` 是 :meth:" +"`!list.extend` 的「簡寫」:\n" "\n" "::" diff --git a/glossary.po b/glossary.po index a1aa90ab1e..0b844c07ab 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-20 00:03+0000\n" +"POT-Creation-Date: 2023-11-09 00:04+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -164,9 +164,7 @@ msgstr "" ":dfn:`關鍵字引數 (keyword argument)`\\ :在函式呼叫中,以識別字(identifier," "例如 ``name=``\\ )開頭的引數,或是以 ``**`` 後面 dictionary(字典)內的值被" "傳遞的引數。例如,``3`` 和 ``5`` 都是以下 :func:`complex` 呼叫中的關鍵字引" -"數:\n" -"\n" -"::" +"數: ::" #: ../../glossary.rst:75 msgid "" @@ -177,9 +175,7 @@ msgid "" msgstr "" ":dfn:`位置引數 (positional argument)`\\ :不是關鍵字引數的引數。位置引數可在" "一個引數列表的起始處出現,和(或)作為 ``*`` 之後的 :term:`iterable`\\ (可疊" -"代物件)中的元素被傳遞。例如,``3`` 和 ``5`` 都是以下呼叫中的位置引數:\n" -"\n" -"::" +"代物件)中的元素被傳遞。例如,``3`` 和 ``5`` 都是以下呼叫中的位置引數: ::" #: ../../glossary.rst:84 msgid "" @@ -494,9 +490,7 @@ msgid "" "(see :term:`argument`), with the following syntax::" msgstr "" "一個 callable 是可以被呼叫的物件,呼叫時可能以下列形式帶有一組引數(請見 :" -"term:`argument`):\n" -"\n" -"::" +"term:`argument`): ::" #: ../../glossary.rst:220 msgid "" @@ -683,10 +677,7 @@ msgstr "" msgid "" "The decorator syntax is merely syntactic sugar, the following two function " "definitions are semantically equivalent::" -msgstr "" -"裝飾器語法只是語法糖。以下兩個函式定義在語義上是等效的:\n" -"\n" -"::" +msgstr "裝飾器語法只是語法糖。以下兩個函式定義在語義上是等效的: ::" #: ../../glossary.rst:311 msgid "" @@ -1040,9 +1031,7 @@ msgid "" "and is also expected to have an :class:`int` return value::" msgstr "" "函式註釋通常被使用於\\ :term:`型別提示 `\\ :例如,這個函式預期會" -"得到兩個 :class:`int` 引數,並會有一個 :class:`int` 回傳值:\n" -"\n" -"::" +"得到兩個 :class:`int` 引數,並會有一個 :class:`int` 回傳值: ::" #: ../../glossary.rst:464 msgid "Function annotation syntax is explained in section :ref:`function`." @@ -1075,9 +1064,7 @@ msgstr "" "示編譯器使用那些在 Python 未來的發布版本中將成為標準的語法或語義,來編譯當前" "的模組。而 :mod:`__future__` 模組則記錄了 *feature(功能)*\\ 可能的值。透過 " "import 此模組並對其變數求值,你可以看見一個新的功能是何時首次被新增到此語言" -"中,以及它何時將會(或已經)成為預設的功能:\n" -"\n" -"::" +"中,以及它何時將會(或已經)成為預設的功能: ::" #: ../../glossary.rst:483 msgid "garbage collection" @@ -1151,9 +1138,7 @@ msgid "" msgstr "" "一個會回傳疊代器的運算式。它看起來像一個正常的運算式,後面接著一個 :keyword:" "`!for` 子句,該子句定義了迴圈變數、範圍以及一個選擇性的 :keyword:`!if` 子句。" -"該組合運算式會為外層函式產生多個值:\n" -"\n" -"::" +"該組合運算式會為外層函式產生多個值: ::" #: ../../glossary.rst:521 msgid "generic function" @@ -1869,9 +1854,7 @@ msgid "" "float_info`::" msgstr "" "有些內建型別是 named tuple,包括由 :func:`time.localtime` 和 :func:`os.stat` " -"回傳的值。另一個例子是 :data:`sys.float_info`:\n" -"\n" -"::" +"回傳的值。另一個例子是 :data:`sys.float_info`: ::" #: ../../glossary.rst:836 msgid "" @@ -2022,9 +2005,7 @@ msgid "" msgstr "" ":dfn:`positional-or-keyword`\\ (位置或關鍵字):指明一個可以\\ :term:`按照位" "置 `\\ 或是作為\\ :term:`關鍵字引數 `\\ 被傳遞的引數。這" -"是參數的預設類型,例如以下的 *foo* 和 *bar*:\n" -"\n" -"::" +"是參數的預設類型,例如以下的 *foo* 和 *bar*: ::" #: ../../glossary.rst:905 msgid "" @@ -2035,9 +2016,7 @@ msgid "" msgstr "" ":dfn:`positional-only`\\ (僅限位置):指明一個只能按照位置被提供的引數。在函" "式定義的參數列表中包含一個 ``/`` 字元,就可以在該字元前面定義僅限位置參數,例" -"如以下的 *posonly1* 和 *posonly2*:\n" -"\n" -"::" +"如以下的 *posonly1* 和 *posonly2*: ::" #: ../../glossary.rst:914 msgid "" @@ -2050,9 +2029,7 @@ msgstr "" ":dfn:`keyword-only`\\ (僅限關鍵字):指明一個只能以關鍵字被提供的引數。在函" "式定義的參數列表中,包含一個任意數量位置參數 (var-positional parameter) 或是" "單純的 ``*`` 字元,就可以在其後方定義僅限關鍵字參數,例如以下的 *kw_only1* " -"和 *kw_only2*:\n" -"\n" -"::" +"和 *kw_only2*: ::" #: ../../glossary.rst:922 msgid "" @@ -2064,9 +2041,7 @@ msgid "" msgstr "" ":dfn:`var-positional`\\ (任意數量位置):指明一串能以任意序列被提供的位置引" "數(在已被其他參數接受的任何位置引數之外)。這類參數是透過在其參數名稱字首加" -"上 ``*`` 來定義的,例如以下的 *args*:\n" -"\n" -"::" +"上 ``*`` 來定義的,例如以下的 *args*: ::" #: ../../glossary.rst:930 msgid "" @@ -2301,16 +2276,11 @@ msgstr "" "一個想法或一段程式碼,它應用了 Python 語言最常見的慣用語,而不是使用其他語言" "常見的概念來實作程式碼。例如,Python 中常見的一種習慣用法,是使用一個 :" "keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並沒有" -"這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替:\n" -"\n" -"::" +"這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替: ::" #: ../../glossary.rst:1034 msgid "As opposed to the cleaner, Pythonic method::" -msgstr "" -"相較之下,以下方法更簡潔、更具有 Python 風格:\n" -"\n" -"::" +msgstr "相較之下,以下方法更簡潔、更具有 Python 風格: ::" #: ../../glossary.rst:1038 msgid "qualified name" @@ -2325,9 +2295,7 @@ msgid "" msgstr "" "一個「點分隔名稱」,它顯示從一個模組的全域作用域到該模組中定義的 class、函式" "或 method 的「路徑」,如 :pep:`3155` 中的定義。對於頂層的函式和 class 而言," -"限定名稱與其物件名稱相同:\n" -"\n" -"::" +"限定名稱與其物件名稱相同: ::" #: ../../glossary.rst:1057 msgid "" @@ -2336,9 +2304,7 @@ msgid "" "text``::" msgstr "" "當用於引用模組時,\\ *完全限定名稱 (fully qualified name)* 是表示該模組的完整" -"點分隔路徑,包括任何的父套件,例如 ``email.mime.text``:\n" -"\n" -"::" +"點分隔路徑,包括任何的父套件,例如 ``email.mime.text``: ::" #: ../../glossary.rst:1064 msgid "reference count" @@ -2503,10 +2469,24 @@ msgstr "" "`while` 或 :keyword:`for`\\ )的多種結構之一。" #: ../../glossary.rst:1134 +msgid "static type checker" +msgstr "static type checker(靜態型別檢查器)" + +#: ../../glossary.rst:1136 +msgid "" +"An external tool that reads Python code and analyzes it, looking for issues " +"such as incorrect types. See also :term:`type hints ` and the :" +"mod:`typing` module." +msgstr "" +"會讀取 Python 程式碼並分析的外部工具,能夠找出錯誤,像是使用了不正確的型別。" +"另請參閱\\ :term:`型別提示 (type hints) ` 以及 :mod:`typing` 模" +"組。" + +#: ../../glossary.rst:1139 msgid "strong reference" msgstr "strong reference(強參照)" -#: ../../glossary.rst:1136 +#: ../../glossary.rst:1141 msgid "" "In Python's C API, a strong reference is a reference to an object which is " "owned by the code holding the reference. The strong reference is taken by " @@ -2517,7 +2497,7 @@ msgstr "" "有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透過 :c:" "func:`Py_DECREF` 釋放強參照。" -#: ../../glossary.rst:1142 +#: ../../glossary.rst:1147 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " @@ -2527,15 +2507,15 @@ msgstr "" ":c:func:`Py_NewRef` 函式可用於建立一個對物件的強參照。通常,在退出強參照的作" "用域之前,必須在該強參照上呼叫 :c:func:`Py_DECREF` 函式,以避免洩漏一個參照。" -#: ../../glossary.rst:1147 +#: ../../glossary.rst:1152 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ (借用參照)。" -#: ../../glossary.rst:1148 +#: ../../glossary.rst:1153 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1150 +#: ../../glossary.rst:1155 msgid "" "A string in Python is a sequence of Unicode code points (in range " "``U+0000``--``U+10FFFF``). To store or transfer a string, it needs to be " @@ -2544,7 +2524,7 @@ msgstr "" "Python 中的字串是一個 Unicode 碼點 (code point) 的序列(範圍在 ``U+0000`` -- " "``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一個位元組序列。" -#: ../../glossary.rst:1154 +#: ../../glossary.rst:1159 msgid "" "Serializing a string into a sequence of bytes is known as \"encoding\", and " "recreating the string from the sequence of bytes is known as \"decoding\"." @@ -2552,7 +2532,7 @@ msgstr "" "將一個字串序列化為位元組序列,稱為「編碼」,而從位元組序列重新建立該字串則稱" "為「解碼 (decoding)」。" -#: ../../glossary.rst:1157 +#: ../../glossary.rst:1162 msgid "" "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." @@ -2560,11 +2540,11 @@ msgstr "" "有多種不同的文字序列化編解碼器 (:ref:`codecs `),它們被統" "稱為「文字編碼」。" -#: ../../glossary.rst:1160 +#: ../../glossary.rst:1165 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1162 +#: ../../glossary.rst:1167 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " "text file actually accesses a byte-oriented datastream and handles the :term:" @@ -2578,7 +2558,7 @@ msgstr "" "有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、\\ :data:`sys.stdin`、:data:" "`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1169 +#: ../../glossary.rst:1174 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects `." @@ -2586,11 +2566,11 @@ msgstr "" "另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入\\ :" "term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" -#: ../../glossary.rst:1171 +#: ../../glossary.rst:1176 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1173 +#: ../../glossary.rst:1178 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -2605,11 +2585,11 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1180 +#: ../../glossary.rst:1185 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1182 +#: ../../glossary.rst:1187 msgid "" "The type of a Python object determines what kind of object it is; every " "object has a type. An object's type is accessible as its :attr:`~instance." @@ -2619,39 +2599,34 @@ msgstr "" "件的型別可以用它的 :attr:`~instance.__class__` 屬性來存取,或以 " "``type(obj)`` 來檢索。" -#: ../../glossary.rst:1186 +#: ../../glossary.rst:1191 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1188 +#: ../../glossary.rst:1193 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1190 +#: ../../glossary.rst:1195 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" msgstr "" -"型別別名對於簡化\\ :term:`型別提示 (type hint) ` 很有用。例如:\n" -"\n" -"::" +"型別別名對於簡化\\ :term:`型別提示 (type hint) ` 很有用。例如: ::" -#: ../../glossary.rst:1197 +#: ../../glossary.rst:1202 msgid "could be made more readable like this::" -msgstr "" -"可以寫成這樣,更具有可讀性:\n" -"\n" -"::" +msgstr "可以寫成這樣,更具有可讀性: ::" -#: ../../glossary.rst:1204 ../../glossary.rst:1218 +#: ../../glossary.rst:1209 ../../glossary.rst:1223 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`,有此功能的描述。" -#: ../../glossary.rst:1205 +#: ../../glossary.rst:1210 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1207 +#: ../../glossary.rst:1212 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -2659,16 +2634,17 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1210 +#: ../../glossary.rst:1215 msgid "" "Type hints are optional and are not enforced by Python but they are useful " -"to static type analysis tools, and aid IDEs with code completion and " -"refactoring." +"to :term:`static type checkers `. They can also aid " +"IDEs with code completion and refactoring." msgstr "" -"型別提示是選擇性的,而不是被 Python 強制的,但它們對靜態型別分析工具很有用," -"並能協助 IDE 完成程式碼的補全 (completion) 和重構 (refactoring)。" +"型別提示是選擇性的,而不是被 Python 強制的,但它們對\\ :term:`靜態型別檢查器 " +"(static type checkers) `\\ 很有用,並能協助 IDE 完成程式" +"碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1214 +#: ../../glossary.rst:1219 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." @@ -2676,11 +2652,11 @@ msgstr "" "全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" "`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1219 +#: ../../glossary.rst:1224 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1221 +#: ../../glossary.rst:1226 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " @@ -2693,37 +2669,32 @@ msgstr "" "``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用於 :func:`bytes." "splitlines` 的附加用途。" -#: ../../glossary.rst:1226 +#: ../../glossary.rst:1231 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1228 +#: ../../glossary.rst:1233 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1230 +#: ../../glossary.rst:1235 msgid "" "When annotating a variable or a class attribute, assignment is optional::" -msgstr "" -"註釋變數或 class 屬性時,賦值是選擇性的:\n" -"\n" -"::" +msgstr "註釋變數或 class 屬性時,賦值是選擇性的: ::" -#: ../../glossary.rst:1235 +#: ../../glossary.rst:1240 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" msgstr "" "變數註釋通常用於\\ :term:`型別提示 (type hint) `:例如,這個變數預" -"期會取得 :class:`int`\\ (整數)值:\n" -"\n" -"::" +"期會取得 :class:`int`\\ (整數)值: ::" -#: ../../glossary.rst:1241 +#: ../../glossary.rst:1246 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1243 +#: ../../glossary.rst:1248 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " @@ -2732,11 +2703,11 @@ msgstr "" "請參閱 :term:`function annotation`\\ (函式註釋)、:pep:`484` 和 :pep:`526`," "皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:1247 +#: ../../glossary.rst:1252 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1249 +#: ../../glossary.rst:1254 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -2747,15 +2718,15 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1254 +#: ../../glossary.rst:1259 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`。" -#: ../../glossary.rst:1255 +#: ../../glossary.rst:1260 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1257 +#: ../../glossary.rst:1262 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." @@ -2763,11 +2734,11 @@ msgstr "" "一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" "`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1259 +#: ../../glossary.rst:1264 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1261 +#: ../../glossary.rst:1266 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " diff --git a/howto/descriptor.po b/howto/descriptor.po index d78cea245b..586280636e 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-05 00:03+0000\n" +"POT-Creation-Date: 2023-11-26 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-" @@ -421,16 +421,16 @@ msgid "Descriptor protocol" msgstr "" #: ../../howto/descriptor.rst:524 -msgid "``descr.__get__(self, obj, type=None) -> value``" -msgstr "``descr.__get__(self, obj, type=None) -> value``" +msgid "``descr.__get__(self, obj, type=None)``" +msgstr "``descr.__get__(self, obj, type=None)``" #: ../../howto/descriptor.rst:526 -msgid "``descr.__set__(self, obj, value) -> None``" -msgstr "``descr.__set__(self, obj, value) -> None``" +msgid "``descr.__set__(self, obj, value)``" +msgstr "``descr.__set__(self, obj, value)``" #: ../../howto/descriptor.rst:528 -msgid "``descr.__delete__(self, obj) -> None``" -msgstr "``descr.__delete__(self, obj) -> None``" +msgid "``descr.__delete__(self, obj)``" +msgstr "``descr.__delete__(self, obj)``" #: ../../howto/descriptor.rst:530 msgid "" @@ -593,7 +593,7 @@ msgstr "" #: ../../howto/descriptor.rst:809 msgid "The important points to remember are:" -msgstr "" +msgstr "要記住的重點是:" #: ../../howto/descriptor.rst:811 msgid "Descriptors are invoked by the :meth:`__getattribute__` method." @@ -723,14 +723,14 @@ msgid "" "protocol, here is a pure Python equivalent:" msgstr "" -#: ../../howto/descriptor.rst:1095 +#: ../../howto/descriptor.rst:1132 msgid "" "The :func:`property` builtin helps whenever a user interface has granted " "attribute access and then subsequent changes require the intervention of a " "method." msgstr "" -#: ../../howto/descriptor.rst:1099 +#: ../../howto/descriptor.rst:1136 msgid "" "For instance, a spreadsheet class may grant access to a cell value through " "``Cell('b10').value``. Subsequent improvements to the program require the " @@ -740,23 +740,23 @@ msgid "" "descriptor:" msgstr "" -#: ../../howto/descriptor.rst:1116 +#: ../../howto/descriptor.rst:1153 msgid "" "Either the built-in :func:`property` or our :func:`Property` equivalent " "would work in this example." msgstr "" -#: ../../howto/descriptor.rst:1121 +#: ../../howto/descriptor.rst:1158 msgid "Functions and methods" msgstr "" -#: ../../howto/descriptor.rst:1123 +#: ../../howto/descriptor.rst:1160 msgid "" "Python's object oriented features are built upon a function based " "environment. Using non-data descriptors, the two are merged seamlessly." msgstr "" -#: ../../howto/descriptor.rst:1126 +#: ../../howto/descriptor.rst:1163 msgid "" "Functions stored in class dictionaries get turned into methods when invoked. " "Methods only differ from regular functions in that the object instance is " @@ -764,13 +764,13 @@ msgid "" "*self* but could be called *this* or any other variable name." msgstr "" -#: ../../howto/descriptor.rst:1131 +#: ../../howto/descriptor.rst:1168 msgid "" "Methods can be created manually with :class:`types.MethodType` which is " "roughly equivalent to:" msgstr "" -#: ../../howto/descriptor.rst:1148 +#: ../../howto/descriptor.rst:1185 msgid "" "To support automatic creation of methods, functions include the :meth:" "`__get__` method for binding methods during attribute access. This means " @@ -778,58 +778,58 @@ msgid "" "dotted lookup from an instance. Here's how it works:" msgstr "" -#: ../../howto/descriptor.rst:1164 +#: ../../howto/descriptor.rst:1201 msgid "" "Running the following class in the interpreter shows how the function " "descriptor works in practice:" msgstr "" -#: ../../howto/descriptor.rst:1173 +#: ../../howto/descriptor.rst:1210 msgid "" "The function has a :term:`qualified name` attribute to support introspection:" msgstr "" -#: ../../howto/descriptor.rst:1180 +#: ../../howto/descriptor.rst:1217 msgid "" "Accessing the function through the class dictionary does not invoke :meth:" "`__get__`. Instead, it just returns the underlying function object::" msgstr "" -#: ../../howto/descriptor.rst:1186 +#: ../../howto/descriptor.rst:1223 msgid "" "Dotted access from a class calls :meth:`__get__` which just returns the " "underlying function unchanged::" msgstr "" -#: ../../howto/descriptor.rst:1192 +#: ../../howto/descriptor.rst:1229 msgid "" "The interesting behavior occurs during dotted access from an instance. The " "dotted lookup calls :meth:`__get__` which returns a bound method object::" msgstr "" -#: ../../howto/descriptor.rst:1199 +#: ../../howto/descriptor.rst:1236 msgid "" "Internally, the bound method stores the underlying function and the bound " "instance::" msgstr "" -#: ../../howto/descriptor.rst:1208 +#: ../../howto/descriptor.rst:1245 msgid "" "If you have ever wondered where *self* comes from in regular methods or " "where *cls* comes from in class methods, this is it!" msgstr "" -#: ../../howto/descriptor.rst:1213 +#: ../../howto/descriptor.rst:1250 msgid "Kinds of methods" msgstr "" -#: ../../howto/descriptor.rst:1215 +#: ../../howto/descriptor.rst:1252 msgid "" "Non-data descriptors provide a simple mechanism for variations on the usual " "patterns of binding functions into methods." msgstr "" -#: ../../howto/descriptor.rst:1218 +#: ../../howto/descriptor.rst:1255 msgid "" "To recap, functions have a :meth:`__get__` method so that they can be " "converted to a method when accessed as attributes. The non-data descriptor " @@ -837,55 +837,55 @@ msgid "" "f(*args)`` becomes ``f(*args)``." msgstr "" -#: ../../howto/descriptor.rst:1223 +#: ../../howto/descriptor.rst:1260 msgid "This chart summarizes the binding and its two most useful variants:" msgstr "" -#: ../../howto/descriptor.rst:1226 +#: ../../howto/descriptor.rst:1263 msgid "Transformation" msgstr "" -#: ../../howto/descriptor.rst:1226 +#: ../../howto/descriptor.rst:1263 msgid "Called from an object" msgstr "" -#: ../../howto/descriptor.rst:1226 +#: ../../howto/descriptor.rst:1263 msgid "Called from a class" msgstr "" -#: ../../howto/descriptor.rst:1229 +#: ../../howto/descriptor.rst:1266 msgid "function" msgstr "函式" -#: ../../howto/descriptor.rst:1229 +#: ../../howto/descriptor.rst:1266 msgid "f(obj, \\*args)" msgstr "f(obj, \\*args)" -#: ../../howto/descriptor.rst:1229 ../../howto/descriptor.rst:1231 +#: ../../howto/descriptor.rst:1266 ../../howto/descriptor.rst:1268 msgid "f(\\*args)" msgstr "f(\\*args)" -#: ../../howto/descriptor.rst:1231 +#: ../../howto/descriptor.rst:1268 msgid "staticmethod" msgstr "staticmethod" -#: ../../howto/descriptor.rst:1233 +#: ../../howto/descriptor.rst:1270 msgid "classmethod" msgstr "classmethod" -#: ../../howto/descriptor.rst:1233 +#: ../../howto/descriptor.rst:1270 msgid "f(type(obj), \\*args)" msgstr "f(type(obj), \\*args)" -#: ../../howto/descriptor.rst:1233 +#: ../../howto/descriptor.rst:1270 msgid "f(cls, \\*args)" msgstr "f(cls, \\*args)" -#: ../../howto/descriptor.rst:1238 +#: ../../howto/descriptor.rst:1275 msgid "Static methods" msgstr "" -#: ../../howto/descriptor.rst:1240 +#: ../../howto/descriptor.rst:1277 msgid "" "Static methods return the underlying function without changes. Calling " "either ``c.f`` or ``C.f`` is the equivalent of a direct lookup into ``object." @@ -894,13 +894,13 @@ msgid "" "a class." msgstr "" -#: ../../howto/descriptor.rst:1246 +#: ../../howto/descriptor.rst:1283 msgid "" "Good candidates for static methods are methods that do not reference the " "``self`` variable." msgstr "" -#: ../../howto/descriptor.rst:1249 +#: ../../howto/descriptor.rst:1286 msgid "" "For instance, a statistics package may include a container class for " "experimental data. The class provides normal methods for computing the " @@ -912,19 +912,19 @@ msgid "" "``s.erf(1.5) --> .9332`` or ``Sample.erf(1.5) --> .9332``." msgstr "" -#: ../../howto/descriptor.rst:1258 +#: ../../howto/descriptor.rst:1295 msgid "" "Since static methods return the underlying function with no changes, the " "example calls are unexciting:" msgstr "" -#: ../../howto/descriptor.rst:1275 +#: ../../howto/descriptor.rst:1312 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`staticmethod` would look like this:" msgstr "" -#: ../../howto/descriptor.rst:1295 +#: ../../howto/descriptor.rst:1332 msgid "" "The :func:`functools.update_wrapper` call adds a ``__wrapped__`` attribute " "that refers to the underlying function. Also it carries forward the " @@ -932,18 +932,18 @@ msgid "" "``__name__``, ``__qualname__``, ``__doc__``, and ``__annotations__``." msgstr "" -#: ../../howto/descriptor.rst:1363 +#: ../../howto/descriptor.rst:1400 msgid "Class methods" msgstr "" -#: ../../howto/descriptor.rst:1365 +#: ../../howto/descriptor.rst:1402 msgid "" "Unlike static methods, class methods prepend the class reference to the " "argument list before calling the function. This format is the same for " "whether the caller is an object or a class:" msgstr "" -#: ../../howto/descriptor.rst:1383 +#: ../../howto/descriptor.rst:1420 msgid "" "This behavior is useful whenever the method only needs to have a class " "reference and does not rely on data stored in a specific instance. One use " @@ -952,17 +952,17 @@ msgid "" "of keys. The pure Python equivalent is:" msgstr "" -#: ../../howto/descriptor.rst:1400 +#: ../../howto/descriptor.rst:1437 msgid "Now a new dictionary of unique keys can be constructed like this:" msgstr "" -#: ../../howto/descriptor.rst:1410 +#: ../../howto/descriptor.rst:1447 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`classmethod` would look like this:" msgstr "" -#: ../../howto/descriptor.rst:1488 +#: ../../howto/descriptor.rst:1525 msgid "" "The code path for ``hasattr(type(self.f), '__get__')`` was added in Python " "3.9 and makes it possible for :func:`classmethod` to support chained " @@ -970,7 +970,7 @@ msgid "" "together. In Python 3.11, this functionality was deprecated." msgstr "" -#: ../../howto/descriptor.rst:1506 +#: ../../howto/descriptor.rst:1543 msgid "" "The :func:`functools.update_wrapper` call in ``ClassMethod`` adds a " "``__wrapped__`` attribute that refers to the underlying function. Also it " @@ -979,30 +979,30 @@ msgid "" "``__annotations__``." msgstr "" -#: ../../howto/descriptor.rst:1514 +#: ../../howto/descriptor.rst:1551 msgid "Member objects and __slots__" msgstr "" -#: ../../howto/descriptor.rst:1516 +#: ../../howto/descriptor.rst:1553 msgid "" "When a class defines ``__slots__``, it replaces instance dictionaries with a " "fixed-length array of slot values. From a user point of view that has " "several effects:" msgstr "" -#: ../../howto/descriptor.rst:1520 +#: ../../howto/descriptor.rst:1557 msgid "" "1. Provides immediate detection of bugs due to misspelled attribute " "assignments. Only attribute names specified in ``__slots__`` are allowed:" msgstr "" -#: ../../howto/descriptor.rst:1536 +#: ../../howto/descriptor.rst:1573 msgid "" "2. Helps create immutable objects where descriptors manage access to private " "attributes stored in ``__slots__``:" msgstr "" -#: ../../howto/descriptor.rst:1571 +#: ../../howto/descriptor.rst:1608 msgid "" "3. Saves memory. On a 64-bit Linux build, an instance with two attributes " "takes 48 bytes with ``__slots__`` and 152 bytes without. This `flyweight " @@ -1010,19 +1010,19 @@ msgid "" "only matters when a large number of instances are going to be created." msgstr "" -#: ../../howto/descriptor.rst:1576 +#: ../../howto/descriptor.rst:1613 msgid "" "4. Improves speed. Reading instance variables is 35% faster with " "``__slots__`` (as measured with Python 3.10 on an Apple M1 processor)." msgstr "" -#: ../../howto/descriptor.rst:1579 +#: ../../howto/descriptor.rst:1616 msgid "" "5. Blocks tools like :func:`functools.cached_property` which require an " "instance dictionary to function correctly:" msgstr "" -#: ../../howto/descriptor.rst:1601 +#: ../../howto/descriptor.rst:1638 msgid "" "It is not possible to create an exact drop-in pure Python version of " "``__slots__`` because it requires direct access to C structures and control " @@ -1032,36 +1032,36 @@ msgid "" "managed by member descriptors:" msgstr "" -#: ../../howto/descriptor.rst:1646 +#: ../../howto/descriptor.rst:1683 msgid "" "The :meth:`type.__new__` method takes care of adding member objects to class " "variables:" msgstr "" -#: ../../howto/descriptor.rst:1662 +#: ../../howto/descriptor.rst:1699 msgid "" "The :meth:`object.__new__` method takes care of creating instances that have " "slots instead of an instance dictionary. Here is a rough simulation in pure " "Python:" msgstr "" -#: ../../howto/descriptor.rst:1697 +#: ../../howto/descriptor.rst:1734 msgid "" "To use the simulation in a real class, just inherit from :class:`Object` and " "set the :term:`metaclass` to :class:`Type`:" msgstr "" -#: ../../howto/descriptor.rst:1711 +#: ../../howto/descriptor.rst:1748 msgid "" "At this point, the metaclass has loaded member objects for *x* and *y*::" msgstr "" -#: ../../howto/descriptor.rst:1732 +#: ../../howto/descriptor.rst:1769 msgid "" "When instances are created, they have a ``slot_values`` list where the " "attributes are stored:" msgstr "" -#: ../../howto/descriptor.rst:1744 +#: ../../howto/descriptor.rst:1781 msgid "Misspelled or unassigned attributes will raise an exception:" msgstr "" diff --git a/howto/enum.po b/howto/enum.po index 18448fd07a..5845866da3 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,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: 2023-11-30 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -483,22 +483,14 @@ msgstr "" msgid "The complete signature is::" msgstr "" -#: ../../howto/enum.rst:0 -msgid "value" -msgstr "" - #: ../../howto/enum.rst:610 -msgid "What the new enum class will record as its name." -msgstr "" - -#: ../../howto/enum.rst:0 -msgid "names" +msgid "*value*: What the new enum class will record as its name." msgstr "" #: ../../howto/enum.rst:612 msgid "" -"The enum members. This can be a whitespace- or comma-separated string " -"(values will start at 1 unless otherwise specified)::" +"*names*: The enum members. This can be a whitespace- or comma-separated " +"string (values will start at 1 unless otherwise specified)::" msgstr "" #: ../../howto/enum.rst:617 @@ -513,36 +505,20 @@ msgstr "" msgid "or a mapping::" msgstr "" -#: ../../howto/enum.rst:0 -msgid "module" -msgstr "" - #: ../../howto/enum.rst:629 -msgid "name of module where new enum class can be found." -msgstr "" - -#: ../../howto/enum.rst:0 -msgid "qualname" +msgid "*module*: name of module where new enum class can be found." msgstr "" #: ../../howto/enum.rst:631 -msgid "where in module new enum class can be found." -msgstr "" - -#: ../../howto/enum.rst:0 -msgid "type" +msgid "*qualname*: where in module new enum class can be found." msgstr "" #: ../../howto/enum.rst:633 -msgid "type to mix in to new enum class." -msgstr "" - -#: ../../howto/enum.rst:0 -msgid "start" +msgid "*type*: type to mix in to new enum class." msgstr "" #: ../../howto/enum.rst:635 -msgid "number to start counting at if only names are passed in." +msgid "*start*: number to start counting at if only names are passed in." msgstr "" #: ../../howto/enum.rst:637 @@ -1261,36 +1237,36 @@ msgid "" "alias::" msgstr "" -#: ../../howto/enum.rst:1446 +#: ../../howto/enum.rst:1445 msgid "" "This is a useful example for subclassing Enum to add or change other " "behaviors as well as disallowing aliases. If the only desired change is " "disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -#: ../../howto/enum.rst:1452 +#: ../../howto/enum.rst:1451 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1454 +#: ../../howto/enum.rst:1453 msgid "" "If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum " "member will be passed to those methods::" msgstr "" -#: ../../howto/enum.rst:1483 +#: ../../howto/enum.rst:1482 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1485 +#: ../../howto/enum.rst:1484 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1504 +#: ../../howto/enum.rst:1503 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1506 +#: ../../howto/enum.rst:1505 msgid "" "While most enum needs can be met by customizing :class:`Enum` subclasses, " "either with class decorators or custom functions, :class:`EnumType` can be " diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po index 4ed313d54e..c1cb4116ae 100644 --- a/howto/isolating-extensions.po +++ b/howto/isolating-extensions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-22 00:03+0000\n" +"POT-Creation-Date: 2023-11-17 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -444,54 +444,163 @@ msgstr "" #: ../../howto/isolating-extensions.rst:342 msgid "" -"Please refer to the :ref:`the documentation ` of :c:macro:" -"`Py_TPFLAGS_HAVE_GC` and :c:member:`~PyTypeObject.tp_traverse` for " -"additional considerations." +"Please refer to the the documentation of :c:macro:`Py_TPFLAGS_HAVE_GC` and :" +"c:member:`~PyTypeObject.tp_traverse` for additional considerations." msgstr "" #: ../../howto/isolating-extensions.rst:346 msgid "" -"If your traverse function delegates to the ``tp_traverse`` of its base class " -"(or another type), ensure that ``Py_TYPE(self)`` is visited only once. Note " -"that only heap type are expected to visit the type in ``tp_traverse``." +"The API for defining heap types grew organically, leaving it somewhat " +"awkward to use in its current state. The following sections will guide you " +"through common issues." msgstr "" -#: ../../howto/isolating-extensions.rst:350 -msgid "For example, if your traverse function includes::" +#: ../../howto/isolating-extensions.rst:352 +msgid "``tp_traverse`` in Python 3.8 and lower" msgstr "" #: ../../howto/isolating-extensions.rst:354 +msgid "" +"The requirement to visit the type from ``tp_traverse`` was added in Python " +"3.9. If you support Python 3.8 and lower, the traverse function must *not* " +"visit the type, so it must be more complicated::" +msgstr "" + +#: ../../howto/isolating-extensions.rst:366 +msgid "" +"Unfortunately, :c:data:`Py_Version` was only added in Python 3.11. As a " +"replacement, use:" +msgstr "" + +#: ../../howto/isolating-extensions.rst:369 +msgid ":c:macro:`PY_VERSION_HEX`, if not using the stable ABI, or" +msgstr "" + +#: ../../howto/isolating-extensions.rst:370 +msgid "" +":py:data:`sys.version_info` (via :c:func:`PySys_GetObject` and :c:func:" +"`PyArg_ParseTuple`)." +msgstr "" + +#: ../../howto/isolating-extensions.rst:375 +msgid "Delegating ``tp_traverse``" +msgstr "" + +#: ../../howto/isolating-extensions.rst:377 +msgid "" +"If your traverse function delegates to the :c:member:`~PyTypeObject." +"tp_traverse` of its base class (or another type), ensure that " +"``Py_TYPE(self)`` is visited only once. Note that only heap type are " +"expected to visit the type in ``tp_traverse``." +msgstr "" + +#: ../../howto/isolating-extensions.rst:382 +msgid "For example, if your traverse function includes::" +msgstr "" + +#: ../../howto/isolating-extensions.rst:386 msgid "...and ``base`` may be a static type, then it should also include::" msgstr "" -#: ../../howto/isolating-extensions.rst:362 +#: ../../howto/isolating-extensions.rst:396 +msgid "" +"It is not necessary to handle the type's reference count in :c:member:" +"`~PyTypeObject.tp_new` and :c:member:`~PyTypeObject.tp_clear`." +msgstr "" + +#: ../../howto/isolating-extensions.rst:401 +msgid "Defining ``tp_dealloc``" +msgstr "" + +#: ../../howto/isolating-extensions.rst:403 +msgid "" +"If your type has a custom :c:member:`~PyTypeObject.tp_dealloc` function, it " +"needs to:" +msgstr "" + +#: ../../howto/isolating-extensions.rst:406 +msgid "" +"call :c:func:`PyObject_GC_UnTrack` before any fields are invalidated, and" +msgstr "" + +#: ../../howto/isolating-extensions.rst:407 +msgid "decrement the reference count of the type." +msgstr "" + +#: ../../howto/isolating-extensions.rst:409 +msgid "" +"To keep the type valid while ``tp_free`` is called, the type's refcount " +"needs to be decremented *after* the instance is deallocated. For example::" +msgstr "" + +#: ../../howto/isolating-extensions.rst:421 +msgid "" +"The default ``tp_dealloc`` function does this, so if your type does *not* " +"override ``tp_dealloc`` you don't need to add it." +msgstr "" + +#: ../../howto/isolating-extensions.rst:427 +msgid "Not overriding ``tp_free``" +msgstr "" + +#: ../../howto/isolating-extensions.rst:429 +msgid "" +"The :c:member:`~PyTypeObject.tp_free` slot of a heap type must be set to :c:" +"func:`PyObject_GC_Del`. This is the default; do not override it." +msgstr "" + +#: ../../howto/isolating-extensions.rst:435 +msgid "Avoiding ``PyObject_New``" +msgstr "" + +#: ../../howto/isolating-extensions.rst:437 +msgid "GC-tracked objects need to be allocated using GC-aware functions." +msgstr "" + +#: ../../howto/isolating-extensions.rst:439 +msgid "If you use use :c:func:`PyObject_New` or :c:func:`PyObject_NewVar`:" +msgstr "" + +#: ../../howto/isolating-extensions.rst:441 +msgid "" +"Get and call type's :c:member:`~PyTypeObject.tp_alloc` slot, if possible. " +"That is, replace ``TYPE *o = PyObject_New(TYPE, typeobj)`` with::" +msgstr "" + +#: ../../howto/isolating-extensions.rst:446 +msgid "" +"Replace ``o = PyObject_NewVar(TYPE, typeobj, size)`` with the same, but use " +"size instead of the 0." +msgstr "" + +#: ../../howto/isolating-extensions.rst:449 msgid "" -"It is not necessary to handle the type's reference count in ``tp_new`` and " -"``tp_clear``." +"If the above is not possible (e.g. inside a custom ``tp_alloc``), call :c:" +"func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar`::" msgstr "" -#: ../../howto/isolating-extensions.rst:367 +#: ../../howto/isolating-extensions.rst:458 msgid "Module State Access from Classes" msgstr "" -#: ../../howto/isolating-extensions.rst:369 +#: ../../howto/isolating-extensions.rst:460 msgid "" "If you have a type object defined with :c:func:`PyType_FromModuleAndSpec`, " "you can call :c:func:`PyType_GetModule` to get the associated module, and " "then :c:func:`PyModule_GetState` to get the module's state." msgstr "" -#: ../../howto/isolating-extensions.rst:373 +#: ../../howto/isolating-extensions.rst:464 msgid "" "To save a some tedious error-handling boilerplate code, you can combine " "these two steps with :c:func:`PyType_GetModuleState`, resulting in::" msgstr "" -#: ../../howto/isolating-extensions.rst:383 +#: ../../howto/isolating-extensions.rst:474 msgid "Module State Access from Regular Methods" msgstr "" -#: ../../howto/isolating-extensions.rst:385 +#: ../../howto/isolating-extensions.rst:476 msgid "" "Accessing the module-level state from methods of a class is somewhat more " "complicated, but is possible thanks to API introduced in Python 3.9. To get " @@ -499,27 +608,27 @@ msgid "" "module state from it." msgstr "" -#: ../../howto/isolating-extensions.rst:390 +#: ../../howto/isolating-extensions.rst:481 msgid "" "The largest roadblock is getting *the class a method was defined in*, or " "that method's \"defining class\" for short. The defining class can have a " "reference to the module it is part of." msgstr "" -#: ../../howto/isolating-extensions.rst:394 +#: ../../howto/isolating-extensions.rst:485 msgid "" "Do not confuse the defining class with :c:expr:`Py_TYPE(self)`. If the " "method is called on a *subclass* of your type, ``Py_TYPE(self)`` will refer " "to that subclass, which may be defined in different module than yours." msgstr "" -#: ../../howto/isolating-extensions.rst:399 +#: ../../howto/isolating-extensions.rst:490 msgid "" "The following Python code can illustrate the concept. ``Base." "get_defining_class`` returns ``Base`` even if ``type(self) == Sub``:" msgstr "" -#: ../../howto/isolating-extensions.rst:415 +#: ../../howto/isolating-extensions.rst:506 msgid "" "For a method to get its \"defining class\", it must use the :ref:" "`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `__." msgstr "" -#: ../../howto/isolating-extensions.rst:526 +#: ../../howto/isolating-extensions.rst:617 msgid "Per-Class Scope" msgstr "" -#: ../../howto/isolating-extensions.rst:528 +#: ../../howto/isolating-extensions.rst:619 msgid "" "It is currently (as of Python 3.11) not possible to attach state to " "individual *types* without relying on CPython implementation details (which " @@ -624,11 +733,11 @@ msgid "" "per-class scope)." msgstr "" -#: ../../howto/isolating-extensions.rst:535 +#: ../../howto/isolating-extensions.rst:626 msgid "Lossless Conversion to Heap Types" msgstr "" -#: ../../howto/isolating-extensions.rst:537 +#: ../../howto/isolating-extensions.rst:628 msgid "" "The heap type API was not designed for \"lossless\" conversion from static " "types; that is, creating a type that works exactly like a given static type." diff --git a/howto/perf_profiling.po b/howto/perf_profiling.po index 4964959d41..75a9a97b75 100644 --- a/howto/perf_profiling.po +++ b/howto/perf_profiling.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: 2023-11-16 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -79,7 +79,7 @@ msgstr "" #: ../../howto/perf_profiling.rst:100 msgid "" "As you can see, the Python functions are not shown in the output, only " -"``_Py_Eval_EvalFrameDefault`` (the function that evaluates the Python " +"``_PyEval_EvalFrameDefault`` (the function that evaluates the Python " "bytecode) shows up. Unfortunately that's not very useful because all Python " "functions use the same C function to evaluate bytecode so we cannot know " "which Python function corresponds to which bytecode-evaluating function." diff --git a/howto/pyporting.po b/howto/pyporting.po index d20f916a8f..2f4c8ed9a7 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-08-25 00:03+0000\n" +"POT-Creation-Date: 2023-11-09 00:04+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-" @@ -110,58 +110,59 @@ msgstr "" #: ../../howto/pyporting.rst:42 msgid "" -"Consider using optional 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``)." +"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:48 +#: ../../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:54 +#: ../../howto/pyporting.rst:55 msgid "Details" msgstr "詳細的" -#: ../../howto/pyporting.rst:56 +#: ../../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:60 +#: ../../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:65 +#: ../../howto/pyporting.rst:66 msgid "Different versions of Python 2" msgstr "" -#: ../../howto/pyporting.rst:67 +#: ../../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:70 +#: ../../howto/pyporting.rst:71 msgid "" "Some of the tools mentioned in this guide will not work with Python 2.6." msgstr "" -#: ../../howto/pyporting.rst:72 +#: ../../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:76 +#: ../../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 " @@ -169,12 +170,12 @@ msgid "" "built-in one." msgstr "" -#: ../../howto/pyporting.rst:83 +#: ../../howto/pyporting.rst:84 msgid "" "Make sure you specify the proper version support in your ``setup.py`` file" msgstr "" -#: ../../howto/pyporting.rst:85 +#: ../../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 " @@ -184,11 +185,11 @@ msgid "" "Python :: 2.7``." msgstr "" -#: ../../howto/pyporting.rst:94 +#: ../../howto/pyporting.rst:95 msgid "Have good test coverage" msgstr "有好的測試覆蓋率" -#: ../../howto/pyporting.rst:96 +#: ../../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 " @@ -200,11 +201,11 @@ msgid "" "test coverage then coverage.py_ is recommended." msgstr "" -#: ../../howto/pyporting.rst:107 +#: ../../howto/pyporting.rst:108 msgid "Be aware of the differences between Python 2 and 3" msgstr "注意 Python 2 & 3 的差異" -#: ../../howto/pyporting.rst:109 +#: ../../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 " @@ -212,34 +213,34 @@ msgid "" "changes Python 3 makes in terms of Python 2." msgstr "" -#: ../../howto/pyporting.rst:114 +#: ../../howto/pyporting.rst:115 msgid "" "Some resources for understanding the differences and their implications for " "you code:" msgstr "" -#: ../../howto/pyporting.rst:117 +#: ../../howto/pyporting.rst:118 msgid "" "the :ref:`\"What's New\" ` doc for each release of Python 3" msgstr "" -#: ../../howto/pyporting.rst:118 +#: ../../howto/pyporting.rst:119 msgid "the `Porting to Python 3`_ book (which is free online)" msgstr "" -#: ../../howto/pyporting.rst:119 +#: ../../howto/pyporting.rst:120 msgid "the handy `cheat sheet`_ from the Python-Future project." msgstr "" -#: ../../howto/pyporting.rst:123 +#: ../../howto/pyporting.rst:124 msgid "Update your code" msgstr "更新你的程式碼" -#: ../../howto/pyporting.rst:125 +#: ../../howto/pyporting.rst:126 msgid "There are tools available that can port your code automatically." msgstr "" -#: ../../howto/pyporting.rst:127 +#: ../../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 " @@ -247,13 +248,13 @@ msgid "" "approach for most cases." msgstr "" -#: ../../howto/pyporting.rst:132 +#: ../../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:135 +#: ../../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 " @@ -262,22 +263,22 @@ msgid "" "tests which fail is a translation failure." msgstr "" -#: ../../howto/pyporting.rst:141 +#: ../../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:145 +#: ../../howto/pyporting.rst:146 msgid "Key issues to be aware of and check for:" msgstr "" -#: ../../howto/pyporting.rst:148 +#: ../../howto/pyporting.rst:149 msgid "Division" msgstr "" -#: ../../howto/pyporting.rst:150 +#: ../../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 " @@ -288,17 +289,17 @@ msgid "" "this then you will need to go through your code and do two things:" msgstr "" -#: ../../howto/pyporting.rst:158 +#: ../../howto/pyporting.rst:159 msgid "Add ``from __future__ import division`` to your files" msgstr "" -#: ../../howto/pyporting.rst:159 +#: ../../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:162 +#: ../../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__`` " @@ -306,11 +307,11 @@ msgid "" "`` to signify some operation but not ``//`` for the same thing or at all)." msgstr "" -#: ../../howto/pyporting.rst:169 +#: ../../howto/pyporting.rst:170 msgid "Text versus binary data" msgstr "" -#: ../../howto/pyporting.rst:171 +#: ../../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 " @@ -322,7 +323,7 @@ msgid "" "``unicode`` when they claimed text data support." msgstr "" -#: ../../howto/pyporting.rst:180 +#: ../../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, " @@ -331,7 +332,7 @@ msgid "" "compared to binary data, which is why this cannot be entirely automated." msgstr "" -#: ../../howto/pyporting.rst:186 +#: ../../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 " @@ -346,7 +347,7 @@ msgid "" "Python 3)." msgstr "" -#: ../../howto/pyporting.rst:197 +#: ../../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 " @@ -356,39 +357,39 @@ msgid "" "``__mod__`` method was added to the bytes type." msgstr "" -#: ../../howto/pyporting.rst:205 +#: ../../howto/pyporting.rst:206 msgid "**Text data**" msgstr "" -#: ../../howto/pyporting.rst:205 +#: ../../howto/pyporting.rst:206 msgid "**Binary data**" msgstr "" -#: ../../howto/pyporting.rst:207 +#: ../../howto/pyporting.rst:208 msgid "\\" msgstr "\\" -#: ../../howto/pyporting.rst:207 +#: ../../howto/pyporting.rst:208 msgid "decode" msgstr "" -#: ../../howto/pyporting.rst:209 +#: ../../howto/pyporting.rst:210 msgid "encode" msgstr "" -#: ../../howto/pyporting.rst:211 +#: ../../howto/pyporting.rst:212 msgid "format" msgstr "" -#: ../../howto/pyporting.rst:213 +#: ../../howto/pyporting.rst:214 msgid "isdecimal" msgstr "isdecimal" -#: ../../howto/pyporting.rst:215 +#: ../../howto/pyporting.rst:216 msgid "isnumeric" msgstr "isnumeric" -#: ../../howto/pyporting.rst:218 +#: ../../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 " @@ -398,7 +399,7 @@ msgid "" "eliminates having to keep track of what type of data you are working with." msgstr "" -#: ../../howto/pyporting.rst:225 +#: ../../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 " @@ -408,7 +409,7 @@ msgid "" "effective as adding a ``b`` or ``u`` prefix to all literals explicitly)" msgstr "" -#: ../../howto/pyporting.rst:232 +#: ../../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., " @@ -425,7 +426,7 @@ msgid "" "2.5." msgstr "" -#: ../../howto/pyporting.rst:245 +#: ../../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`` " @@ -438,7 +439,7 @@ msgid "" "representation of the bytes object: ``str(b'3') == \"b'3'\"``." msgstr "" -#: ../../howto/pyporting.rst:255 +#: ../../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'`` " @@ -450,48 +451,48 @@ msgid "" "indexbytes(b'123', 1)``." msgstr "" -#: ../../howto/pyporting.rst:264 +#: ../../howto/pyporting.rst:265 msgid "To summarize:" msgstr "" -#: ../../howto/pyporting.rst:266 +#: ../../howto/pyporting.rst:267 msgid "Decide which of your APIs take text and which take binary data" msgstr "" -#: ../../howto/pyporting.rst:267 +#: ../../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:270 +#: ../../howto/pyporting.rst:271 msgid "" "Mark all binary literals with a ``b`` prefix, textual literals with a ``u`` " "prefix" msgstr "" -#: ../../howto/pyporting.rst:272 +#: ../../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:274 +#: ../../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:276 +#: ../../howto/pyporting.rst:277 msgid "Be careful when indexing into binary data" msgstr "" -#: ../../howto/pyporting.rst:280 +#: ../../howto/pyporting.rst:281 msgid "Use feature detection instead of version detection" msgstr "" -#: ../../howto/pyporting.rst:282 +#: ../../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 " @@ -501,7 +502,7 @@ msgid "" "let's look at an example." msgstr "" -#: ../../howto/pyporting.rst:289 +#: ../../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 " @@ -509,7 +510,7 @@ msgid "" "access e.g. the :mod:`importlib.abc` module by doing the following::" msgstr "" -#: ../../howto/pyporting.rst:301 +#: ../../howto/pyporting.rst:302 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 " @@ -517,18 +518,18 @@ msgid "" "than Python 2::" msgstr "" -#: ../../howto/pyporting.rst:313 +#: ../../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::" msgstr "" -#: ../../howto/pyporting.rst:324 +#: ../../howto/pyporting.rst:325 msgid "Prevent compatibility regressions" msgstr "" -#: ../../howto/pyporting.rst:326 +#: ../../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 " @@ -536,13 +537,13 @@ msgid "" "you from actually running under Python 3 at the moment." msgstr "" -#: ../../howto/pyporting.rst:331 +#: ../../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::" msgstr "" -#: ../../howto/pyporting.rst:338 +#: ../../howto/pyporting.rst:339 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 " @@ -550,7 +551,7 @@ msgid "" "accidentally miss a warning." msgstr "" -#: ../../howto/pyporting.rst:343 +#: ../../howto/pyporting.rst:344 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 " @@ -560,11 +561,11 @@ msgid "" "Pylint's minimum Python version support." msgstr "" -#: ../../howto/pyporting.rst:352 +#: ../../howto/pyporting.rst:353 msgid "Check which dependencies block your transition" msgstr "" -#: ../../howto/pyporting.rst:354 +#: ../../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 " @@ -574,7 +575,7 @@ msgid "" "caniusepython3.com." msgstr "" -#: ../../howto/pyporting.rst:361 +#: ../../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 " @@ -583,11 +584,11 @@ msgid "" "start running on Python 3." msgstr "" -#: ../../howto/pyporting.rst:368 +#: ../../howto/pyporting.rst:369 msgid "Update your ``setup.py`` file to denote Python 3 compatibility" msgstr "" -#: ../../howto/pyporting.rst:370 +#: ../../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 " @@ -596,11 +597,11 @@ msgid "" "classifiers for each major/minor version of Python you now support." msgstr "" -#: ../../howto/pyporting.rst:378 +#: ../../howto/pyporting.rst:379 msgid "Use continuous integration to stay compatible" msgstr "" -#: ../../howto/pyporting.rst:380 +#: ../../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 " @@ -609,7 +610,7 @@ msgid "" "accidentally break Python 2 or 3 support." msgstr "" -#: ../../howto/pyporting.rst:386 +#: ../../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 " @@ -621,19 +622,19 @@ msgid "" "down." msgstr "" -#: ../../howto/pyporting.rst:396 +#: ../../howto/pyporting.rst:397 msgid "Consider using optional static type checking" msgstr "" -#: ../../howto/pyporting.rst:398 +#: ../../howto/pyporting.rst:399 msgid "" -"Another way to help port your code is to use a 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." +"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 "" diff --git a/howto/sockets.po b/howto/sockets.po index 8d49421e8c..6b44616a44 100644 --- a/howto/sockets.po +++ b/howto/sockets.po @@ -64,13 +64,13 @@ msgid "" "blocking sockets. But I'll start by talking about blocking sockets. You'll " "need to know how they work before dealing with non-blocking sockets." msgstr "" -"我只會討論關於 INET(例如:IPv4)的 sockets,但它們涵蓋了幾乎 99% 的 " -"sockets 使用場景。而我也將僅討論關於 STREAM(比如:TCP)類型的 sockets - 除" -"非你真的知道你在做什麼(在這種情況下,這份指南可能不適合你),使用 STREAM " -"類型的 socket 會獲得比其他 sockets 類型更好的表現和性能。我將會嘗試解釋 " -"socket 是什麼,以及如何使用阻塞 (blocking) 和非阻塞 (non-blocking) sockets 的" -"一些建議。但首先我會先談論阻塞 sockets。在處理非阻塞 sockets 之前,你需要了解" -"它們的工作原理。" +"我只會討論關於 INET(例如:IPv4)的 sockets,但它們涵蓋了幾乎 99% 的 sockets " +"使用場景。而我也將僅討論關於 STREAM(比如:TCP)類型的 sockets - 除非你真的知" +"道你在做什麼(在這種情況下,這份指南可能不適合你),使用 STREAM 類型的 " +"socket 會獲得比其他 sockets 類型更好的表現和性能。我將會嘗試解釋 socket 是什" +"麼,以及如何使用阻塞 (blocking) 和非阻塞 (non-blocking) sockets 的一些建議。" +"但首先我會先談論阻塞 sockets。在處理非阻塞 sockets 之前,你需要了解它們的工作" +"原理。" #: ../../howto/sockets.rst:31 msgid "" @@ -82,12 +82,12 @@ msgid "" "sockets exclusively; the web server it's talking to uses both \"server\" " "sockets and \"client\" sockets." msgstr "" -"要理解這些東西的困難點之一在於 \"scoket\" 可以代表多種具有些微差異的東西,這主要" -"取決於上下文。所以首先,讓我們先區分「用戶端 (client)」socket 和「伺服器端" -" (server)」socket 的差別,「用戶端」socket 表示通訊的一端,「伺服器端」" -"socket 更像是一個電話總機接線員。用戶端應用程式(例如:你的瀏覽器)只能使" -"用「用戶端」socket; 它所連接的網路伺服器則同時使用「伺服器端」socket 和 " -"「用戶端」socket 來進行通訊。" +"要理解這些東西的困難點之一在於 \"scoket\" 可以代表多種具有些微差異的東西,這" +"主要取決於上下文。所以首先,讓我們先區分「用戶端 (client)」socket 和「伺服器" +"端 (server)」socket 的差別,「用戶端」socket 表示通訊的一端,「伺服器端」" +"socket 更像是一個電話總機接線員。用戶端應用程式(例如:你的瀏覽器)只能使用" +"「用戶端」socket; 它所連接的網路伺服器則同時使用「伺服器端」socket 和 「用戶" +"端」socket 來進行通訊。" #: ../../howto/sockets.rst:40 msgid "History" @@ -111,8 +111,8 @@ msgid "" "of sockets with INET makes talking to arbitrary machines around the world " "unbelievably easy (at least compared to other schemes)." msgstr "" -"Sockets 作為 Unix 的 BSD 分支的一部分在 Berkeley 被發明出來。它們隨著網際網路的普" -"及而迅速蔓延開來。這是有很好的理由 — sockets 和 INET 的結合讓世界各地任何" +"Sockets 作為 Unix 的 BSD 分支的一部分在 Berkeley 被發明出來。它們隨著網際網路" +"的普及而迅速蔓延開來。這是有很好的理由 — sockets 和 INET 的結合讓世界各地任何" "的機器之間的通訊變得非常簡單(至少與其它方案相比是如此)。" #: ../../howto/sockets.rst:54 @@ -136,16 +136,16 @@ msgid "" "used for one exchange (or a small set of sequential exchanges)." msgstr "" "當 ``connect`` 完成時,這個 socket ``s`` 可以用來發送請求來取得頁面的文本。同" -"一個 socket 也會讀取回傳值,然後再被銷毀。是的,會被銷毀。用戶端 socket 通常只" -"用來做一次交換(或是一小組連續交換)。" +"一個 socket 也會讀取回傳值,然後再被銷毀。是的,會被銷毀。用戶端 socket 通常" +"只用來做一次交換(或是一小組連續交換)。" #: ../../howto/sockets.rst:70 msgid "" "What happens in the web server is a bit more complex. First, the web server " "creates a \"server socket\"::" msgstr "" -"網路伺服器 (web server) 的運作就稍微複雜一點。首先,網路伺服器會建立一個「伺服器端 " -"socket」:\n" +"網路伺服器 (web server) 的運作就稍微複雜一點。首先,網路伺服器會建立一個「伺" +"服器端 socket」:\n" "\n" "::" @@ -158,10 +158,10 @@ msgid "" "machine. ``s.bind(('', 80))`` specifies that the socket is reachable by any " "address the machine happens to have." msgstr "" -"有幾件事需要注意:我們使用了 ``socket.gethostname()``,這樣 socket 才能對外" -"部網路可見。如果我們使用了 ``s.bind(('localhost', 80))`` 或 ``s." -"bind(('127.0.0.1', 80))``,我們會得到一個「伺服器端」socket,但是只能在同一" -"台機器內可見。``s.bind(('', 80))`` 指定 socket 可以透過機器的任何地址存取。" +"有幾件事需要注意:我們使用了 ``socket.gethostname()``,這樣 socket 才能對外部" +"網路可見。如果我們使用了 ``s.bind(('localhost', 80))`` 或 ``s." +"bind(('127.0.0.1', 80))``,我們會得到一個「伺服器端」socket,但是只能在同一台" +"機器內可見。``s.bind(('', 80))`` 指定 socket 可以透過機器的任何地址存取。" #: ../../howto/sockets.rst:87 msgid "" @@ -169,8 +169,8 @@ msgid "" "known\" services (HTTP, SNMP etc). If you're playing around, use a nice high " "number (4 digits)." msgstr "" -"第二個要注意的是:數字小的連接埠 (port) 通常保留給「廣為人知的」服務(HTTP、SNMP" -"等)。如果你只是想執行程式,可以使用一個數字較大的連接埠(4 位數字)。" +"第二個要注意的是:數字小的連接埠 (port) 通常保留給「廣為人知的」服務(HTTP、" +"SNMP等)。如果你只是想執行程式,可以使用一個數字較大的連接埠(4 位數字)。" #: ../../howto/sockets.rst:91 msgid "" @@ -180,8 +180,8 @@ msgid "" "should be plenty." msgstr "" "最後,``listen`` 引數告訴 socket 函式庫 (library),我們希望在佇列 (queue) 中" -"累積達 5 個(正常的最大值)連線請求後再拒絕外部連線。如果其餘的程式碼編寫" -"正確,這應該足夠了。" +"累積達 5 個(正常的最大值)連線請求後再拒絕外部連線。如果其餘的程式碼編寫正" +"確,這應該足夠了。" #: ../../howto/sockets.rst:95 msgid "" @@ -209,15 +209,15 @@ msgid "" "allocated port which will be recycled when the conversation ends." msgstr "" "事實上,有三種方法可以讓這個迴圈運作 - 分配一個執行緒 (thread) 來處理 " -"``clientsocket`` 、建立一個新行程 (process) 來處理 ``clientsocket``,或者將" -"這個程式重新改寫成使用非阻塞 socket,並使用 ``select`` 在我們的「伺服器端」" +"``clientsocket`` 、建立一個新行程 (process) 來處理 ``clientsocket``,或者將這" +"個程式重新改寫成使用非阻塞 socket,並使用 ``select`` 在我們的「伺服器端」" "socket 和任何有效的 ``clientsocket`` 之間進行多工處理。稍後將會更詳細的介紹。" -"現在最重要的是理解:這就是「伺服器端」socket 做的\\ *所有* \\事情。它不會發送任何" -"資料、也不接收任何資料,它只會建立「伺服器端」socket。每個 ``clientsocket`` " -"都是為了回應某些\\ *其他* \\ ``connect()`` 到我們綁定的主機上的「用戶端」socket。" -"一但 ``clientsocket`` 建立完成,就會繼續監聽更多的連線請求。兩個「用戶端」可" -"以隨意的通訊 - 它們使用的是一些動態分配的連接埠,會在通訊結束的時候被回收並重新" -"利用。" +"現在最重要的是理解:這就是「伺服器端」socket 做的\\ *所有* \\事情。它不會發送" +"任何資料、也不接收任何資料,它只會建立「伺服器端」socket。每個 " +"``clientsocket`` 都是為了回應某些\\ *其他* \\ ``connect()`` 到我們綁定的主機" +"上的「用戶端」socket。一但 ``clientsocket`` 建立完成,就會繼續監聽更多的連線" +"請求。兩個「用戶端」可以隨意的通訊 - 它們使用的是一些動態分配的連接埠,會在通" +"訊結束的時候被回收並重新利用。" #: ../../howto/sockets.rst:121 msgid "IPC" @@ -233,8 +233,8 @@ msgid "" msgstr "" "如果你需要在一台機器上的兩個行程間進行快速的行程間通訊 (IPC),你應該考慮使用" "管道 (pipes) 或共享記憶體 (shared memory)。如果你確定要使用 AF_INET sockets," -"請將「伺服器端」socket 綁定到 ``'localhost'``。在大多數平台上,這樣將會繞過幾個" -"網路程式碼層,並且速度會更快一些。" +"請將「伺服器端」socket 綁定到 ``'localhost'``。在大多數平台上,這樣將會繞過幾" +"個網路程式碼層,並且速度會更快一些。" #: ../../howto/sockets.rst:129 msgid "" @@ -257,9 +257,10 @@ msgid "" "rule of sockets." msgstr "" "首先需要注意,網頁瀏覽器的「用戶端」socket 和網路伺服器的「用戶端」socket 是" -"非常類似的。也就是說,這是一個「點對點 (peer to peer)」的通訊方式,或者也可以說\\ *作為設計" -"者,你必須決定通訊的規則*。通常情況下,``connect`` 的 socket 會通過發送一個" -"請求或者信號來開始一次通訊。但這屬於設計決策,而不是 socket 的規則。" +"非常類似的。也就是說,這是一個「點對點 (peer to peer)」的通訊方式,或者也可以" +"說\\ *作為設計者,你必須決定通訊的規則*。通常情況下,``connect`` 的 socket 會" +"通過發送一個請求或者信號來開始一次通訊。但這屬於設計決策,而不是 socket 的規" +"則。" #: ../../howto/sockets.rst:143 msgid "" @@ -292,8 +293,8 @@ msgstr "" "現在我們來到 sockets 的主要障礙 - ``send`` 和 ``recv`` 操作的是網路緩衝區。他" "們不一定會處理你提供給它們的所有位元組(或者是你期望它處理的位元組),因為它" "們主要的重點是處理網路緩衝區。一般來說,它們會在關聯的網路衝區已滿 " -"(``send``) 或已清空 (``recv``) 時回傳,然後告訴你它們處理了多少位元組。*你" -"* \\的責任是一直呼叫它們直到你所有的訊息處理完成。" +"(``send``) 或已清空 (``recv``) 時回傳,然後告訴你它們處理了多少位元組。*你* " +"\\的責任是一直呼叫它們直到你所有的訊息處理完成。" #: ../../howto/sockets.rst:160 msgid "" @@ -313,8 +314,8 @@ msgid "" "that a client can detect the end of the reply by receiving 0 bytes." msgstr "" "像 HTTP 這樣的協議只使用一個 socket 進行一次傳輸,用戶端發送一個請求,然後讀" -"取一個回覆。就這樣,然後這個 socket 就會被銷毀。這表示者用戶端可以通過接收「零" -"位元組」來檢測回覆的結束。" +"取一個回覆。就這樣,然後這個 socket 就會被銷毀。這表示者用戶端可以通過接收" +"「零位元組」來檢測回覆的結束。" #: ../../howto/sockets.rst:169 msgid "" @@ -372,9 +373,9 @@ msgid "" msgstr "" "最簡單的改進方法是將訊息的第一個字元表示訊息的類型,並根據訊息的類型來決定訊" "息的長度。現在你需要使用兩次 ``recv`` - 第一次用於接收(至少)第一個字元來得" -"知長度,第二次用於在迴圈中接收剩下的訊息。如果你決定使用分隔符號的方式,你將會" -"以某個任意的區塊大小進行接收(4096 或 8192 通常是網路緩衝區大小的良好選擇)," -"並在收到的內容中掃描分隔符號。" +"知長度,第二次用於在迴圈中接收剩下的訊息。如果你決定使用分隔符號的方式,你將" +"會以某個任意的區塊大小進行接收(4096 或 8192 通常是網路緩衝區大小的良好選" +"擇),並在收到的內容中掃描分隔符號。" #: ../../howto/sockets.rst:231 msgid "" @@ -385,8 +386,8 @@ msgid "" "until it's needed." msgstr "" "需要注意的一個複雜情況是,如果你的通訊協議允許連續發送多個訊息(沒有任何回" -"應),並且你傳遞給 ``recv`` 函式一個任意的區塊大小,最後有可能讀取到下一" -"條訊息的開頭。你需要將其放在一旁並保留下來,直到需要使用的時候。" +"應),並且你傳遞給 ``recv`` 函式一個任意的區塊大小,最後有可能讀取到下一條訊" +"息的開頭。你需要將其放在一旁並保留下來,直到需要使用的時候。" #: ../../howto/sockets.rst:237 msgid "" @@ -432,24 +433,25 @@ msgid "" msgstr "" "使用 socket 傳輸二進位資料完全是可行的。最主要的問題在於不同機器使用不同的二" "進位資料格式。例如,`網路二進位順序 `_ 採用的是「大端序 big-endian」," -"所以一個值為 ``1`` 的 16 位元整數會表示成兩個 16 進位的位元組 ``00 01``。然而" -"大多數常見的處理器 (x86/AMD64,ARM,RISC-V) 採用的是「小端序 little-" -"endian」,所以相同的 ``1`` 會被表示成 ``01 00``。" -"(譯者注:將一個多位數的低位放在較小的位址處,高位放在較大的位址處,則稱小端序;反之則稱大端序。)" +"Endianness#Networking>`_ 採用的是「大端序 big-endian」,所以一個值為 ``1`` " +"的 16 位元整數會表示成兩個 16 進位的位元組 ``00 01``。然而大多數常見的處理器 " +"(x86/AMD64,ARM,RISC-V) 採用的是「小端序 little-endian」,所以相同的 ``1`` " +"會被表示成 ``01 00``。(譯者注:將一個多位數的低位放在較小的位址處,高位放在" +"較大的位址處,則稱小端序;反之則稱大端序。)" #: ../../howto/sockets.rst:262 msgid "" "Socket libraries have calls for converting 16 and 32 bit integers - ``ntohl, " -"htonl, ntohs, htons`` where \"n\" means *network* and \"h\" means *host*, \"s" -"\" means *short* and \"l\" means *long*. Where network order is host order, " -"these do nothing, but where the machine is byte-reversed, these swap the " -"bytes around appropriately." +"htonl, ntohs, htons`` where \"n\" means *network* and \"h\" means *host*, " +"\"s\" means *short* and \"l\" means *long*. Where network order is host " +"order, these do nothing, but where the machine is byte-reversed, these swap " +"the bytes around appropriately." msgstr "" "Socket 函式庫提供了用於轉換 16 位元和 32 位元整數的函式 - ``ntohl, htonl, " "ntohs, htons``,其中 \"n\" 表示 *network*,\"h\" 表示 *host*,\"s\" 表示 " "*short*,\"l\" 表示 *long*。當網路的位元組順序和主機位元組順序相同時,這些函" -"式不會做任何操作,但當主機的位元組順序相反時,這些函式會適當的交換位元組順序。" +"式不會做任何操作,但當主機的位元組順序相反時,這些函式會適當的交換位元組順" +"序。" #: ../../howto/sockets.rst:268 msgid "" @@ -498,8 +500,8 @@ msgid "" msgstr "" "有效使用 ``shutdown`` 的一種方式是在類似 HTTP 的交換中,用戶端發送請求後,然" "後使用 ``shutdown(1)``。這告訴伺服器「這個用戶端已經發送完成,但仍可以接" -"收」。伺服器可以通過接收「零位元組」來檢測 \"EOF\"。這樣它就可以確定已經接收到" -"完整的請求。伺服器發送回覆,如果 ``send`` 成功完成,那麼用戶端確實在持續接" +"收」。伺服器可以通過接收「零位元組」來檢測 \"EOF\"。這樣它就可以確定已經接收" +"到完整的請求。伺服器發送回覆,如果 ``send`` 成功完成,那麼用戶端確實在持續接" "收。" #: ../../howto/sockets.rst:294 @@ -511,10 +513,10 @@ msgid "" "indefinitely, thinking you're just being slow. *Please* ``close`` your " "sockets when you're done." msgstr "" -"Python 更進一步地採取自動關閉的步驟,並且當 socket 被垃圾回收機制回收時,如果需要" -"的話,他會自動執行 ``close``。但依賴這個機制是一個非常不好的習慣,如果你的 " -"socket 在沒有 ``close`` 的情況下消失了,那麼另一端的 socket 可能會認為你只是" -"慢了一步,而無期限的等待。*請務必* \\在使用完畢後使用 ``close`` 關閉你的 " +"Python 更進一步地採取自動關閉的步驟,並且當 socket 被垃圾回收機制回收時,如果" +"需要的話,他會自動執行 ``close``。但依賴這個機制是一個非常不好的習慣,如果你" +"的 socket 在沒有 ``close`` 的情況下消失了,那麼另一端的 socket 可能會認為你只" +"是慢了一步,而無期限的等待。*請務必* \\在使用完畢後使用 ``close`` 關閉你的 " "sockets。" #: ../../howto/sockets.rst:302 @@ -538,10 +540,10 @@ msgstr "" "使用阻塞式 socket 最糟糕的地方可能是在另一端突然強制關閉(未執行 ``close``)" "的情況下會發生什麼?你的 socket 很可能會處於阻塞狀態。TCP 是一種可靠的協議," "它在放棄連線之前會等待很長很長的時間。如果你正在使用執行緒,整個執行緒基本上" -"已經無法使用。在這方面,你無法做太多事情。只要你不做一些愚蠢的事情,比如在" -"執行阻塞式讀取時持有一個鎖,那麼執行緒並不會消耗太多資源。*不要*\\ 試圖終止" -"執行緒 - 執行緒比行程更有效的部分原因是它們避免了與自動回收資源相關的開銷。換" -"句話說,如果你確實設法終止了執行緒,整個行程可能會出現問題。" +"已經無法使用。在這方面,你無法做太多事情。只要你不做一些愚蠢的事情,比如在執" +"行阻塞式讀取時持有一個鎖,那麼執行緒並不會消耗太多資源。*不要*\\ 試圖終止執行" +"緒 - 執行緒比行程更有效的部分原因是它們避免了與自動回收資源相關的開銷。換句話" +"說,如果你確實設法終止了執行緒,整個行程可能會出現問題。" #: ../../howto/sockets.rst:318 msgid "Non-blocking Sockets" @@ -555,8 +557,8 @@ msgid "" "will be almost inside-out." msgstr "" "如果你已經理解了前面的內容,你已經知道了大部分關於使用 sockets 的機制的所需知" -"識,你仍然會以非常相似的方式使用相同的函式。就這樣而已,如果你做的對,你的程式" -"就會是近乎完美的。" +"識,你仍然會以非常相似的方式使用相同的函式。就這樣而已,如果你做的對,你的程" +"式就會是近乎完美的。" #: ../../howto/sockets.rst:325 msgid "" @@ -568,10 +570,10 @@ msgid "" "it. (Actually, if you're nuts, you can switch back and forth.)" msgstr "" "在 Python 中可以使用 ``socket.setblocking(False)`` 來設定為非阻塞。在 C 的作" -"法更為複雜(例如,你需要在 BSD 風格的 ``O_NONBLOCK`` 和幾乎沒有區別的 POSIX 風" -"格的 ``O_NDELAY`` 之間做出選擇,這與 ``TCP_NODELAY`` 完全不同),但基本思想是" -"一樣的,你要在建立 socket 後但在使用它之前執行此操作。(實際上,如果你願意的" -"話,你甚至可以來回切換。)" +"法更為複雜(例如,你需要在 BSD 風格的 ``O_NONBLOCK`` 和幾乎沒有區別的 POSIX " +"風格的 ``O_NDELAY`` 之間做出選擇,這與 ``TCP_NODELAY`` 完全不同),但基本思想" +"是一樣的,你要在建立 socket 後但在使用它之前執行此操作。(實際上,如果你願意" +"的話,你甚至可以來回切換。)" #: ../../howto/sockets.rst:332 msgid "" @@ -614,8 +616,8 @@ msgstr "" "你傳遞給 ``select`` 三個列表:第一個列表包含你可能想要嘗試讀取的所有 " "sockets;第二個包含所有你可能想要嘗試寫入的 sockets,最後一個(通常為空)包含" "你想要檢查錯誤的 sockets。你應該注意,一個 socket 可以同時存在於多個列表中。" -"``select`` 呼叫是阻塞的,但你可以設置超時。通常這是一個明智的做法 - 除非有" -"充分的理由,否則給它一個很長的超時(比如一分鐘)。" +"``select`` 呼叫是阻塞的,但你可以設置超時。通常這是一個明智的做法 - 除非有充" +"分的理由,否則給它一個很長的超時(比如一分鐘)。" #: ../../howto/sockets.rst:360 msgid "" @@ -636,10 +638,10 @@ msgid "" "it just means outbound network buffer space is available.)" msgstr "" "如果一個 socket 在輸出的可讀列表中,你可以幾乎確定,在這個業務中我們能夠得到" -"的最接近確定的事情是,對該 socket 的 ``recv`` 呼叫將會回傳一些\\ *內容*。對於可寫" -"列表,也是同樣的想法。你將能夠發送一些 *內容*。也許不是全部,但\\ *一些內容*\\ 總比" -"什麼都沒有好。(實際上,任何比較正常的 socket 都會以可寫的方式回傳 - 這只是意味" -"者「外送網路 (outbound network)」的緩衝空間是可用的。)" +"的最接近確定的事情是,對該 socket 的 ``recv`` 呼叫將會回傳一些\\ *內容*。對於" +"可寫列表,也是同樣的想法。你將能夠發送一些 *內容*。也許不是全部,但\\ *一些內" +"容*\\ 總比什麼都沒有好。(實際上,任何比較正常的 socket 都會以可寫的方式回傳 " +"- 這只是意味者「外送網路 (outbound network)」的緩衝空間是可用的。)" #: ../../howto/sockets.rst:371 msgid "" @@ -662,8 +664,8 @@ msgid "" "problem of determining whether the other end is done, or just busy with " "something else." msgstr "" -"實際上,即使是使用阻塞式 socket 的情況下,``select`` 也很方便。這是一種判斷是否" -"會被阻塞的方法之一 - 當緩衝區中有某些內容時, socket 會回傳為可讀。然而,這" +"實際上,即使是使用阻塞式 socket 的情況下,``select`` 也很方便。這是一種判斷是" +"否會被阻塞的方法之一 - 當緩衝區中有某些內容時, socket 會回傳為可讀。然而,這" "仍然無法解決判斷另一端是否完成,或者只是忙於其他事情的問題。" #: ../../howto/sockets.rst:382 @@ -677,5 +679,5 @@ msgstr "" "**可移植性警告**:在 Unix 上,``select`` 同時適用於 sockets 和文件。但請不要" "在 Windows 上嘗試這麼做,在 Windows 上,``select`` 只適用於 sockets。同時,請" "注意,在 C 語言中,許多更進階的 socket 選項在 Windows 上有不同的實現方式。實" -"際上,在 Windows 上,我通常會使用執行緒(這非常,非常有效)與我的 sockets 一起" -"使用。" +"際上,在 Windows 上,我通常會使用執行緒(這非常,非常有效)與我的 sockets 一" +"起使用。" diff --git a/howto/sorting.po b/howto/sorting.po index 358468a15f..9eb633ec2b 100644 --- a/howto/sorting.po +++ b/howto/sorting.po @@ -138,8 +138,8 @@ msgid "" "attrgetter`, and a :func:`~operator.methodcaller` function." msgstr "" "上述的鍵函式模式非常常見,所以 Python 提供了方便的函式讓物件存取更簡單且快" -"速。:mod:`operator` 模組裡有 :func:`~operator.itemgetter`、:func:" -"`~operator.attrgetter` 及 :func:`~operator.methodcaller` 函式可以使用。" +"速。:mod:`operator` 模組裡有 :func:`~operator.itemgetter`、:func:`~operator." +"attrgetter` 及 :func:`~operator.methodcaller` 函式可以使用。" #: ../../howto/sorting.rst:108 msgid "Using those functions, the above examples become simpler and faster:" @@ -249,8 +249,8 @@ msgid "" "items are compared; if they are the same then the second items are compared, " "and so on." msgstr "" -"這個方式會有效是因為元組是依照字典順序 (lexicographically) 來比較,先比較第" -"一個項目,如果一樣再比較第二個項目,並依此類推。" +"這個方式會有效是因為元組是依照字典順序 (lexicographically) 來比較,先比較第一" +"個項目,如果一樣再比較第二個項目,並依此類推。" #: ../../howto/sorting.rst:212 msgid "" diff --git a/library/__future__.po b/library/__future__.po index 7ed9891f84..8522041612 100644 --- a/library/__future__.po +++ b/library/__future__.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2023-12-04 13:57+0000\n" "PO-Revision-Date: 2023-08-11 02:12+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -56,11 +56,11 @@ msgstr "" "記錄何時出現不相容的變更,以及何時開始強制執行這些變更。這是一種可執行文件的" "形式,可以透過引入 :mod:`__future__` 並檢查其內容以程式化的方式進行檢查。" -#: ../../library/__future__.rst:25 +#: ../../library/__future__.rst:29 msgid "Each statement in :file:`__future__.py` is of the form::" msgstr ":file:`__future__.py` 中的每個陳述式的形式如下: ::" -#: ../../library/__future__.rst:31 +#: ../../library/__future__.rst:34 msgid "" "where, normally, *OptionalRelease* is less than *MandatoryRelease*, and both " "are 5-tuples of the same form as :data:`sys.version_info`::" @@ -68,13 +68,13 @@ msgstr "" "通常,*OptionalRelease* 會小於 *MandatoryRelease*,且兩者都是與 :data:`sys." "version_info` 形式相同的 5 元組 (5-tuple): ::" -#: ../../library/__future__.rst:41 +#: ../../library/__future__.rst:46 msgid "" "*OptionalRelease* records the first release in which the feature was " "accepted." msgstr "*OptionalRelease* 記錄該功能首次發布時的 Python 版本。" -#: ../../library/__future__.rst:43 +#: ../../library/__future__.rst:50 msgid "" "In the case of a *MandatoryRelease* that has not yet occurred, " "*MandatoryRelease* predicts the release in which the feature will become " @@ -83,7 +83,7 @@ msgstr "" "如果 *MandatoryRelease* 尚未發布,*MandatoryRelease* 會預測該功能將成為該語言" "一部分的版本。" -#: ../../library/__future__.rst:47 +#: ../../library/__future__.rst:54 msgid "" "Else *MandatoryRelease* records when the feature became part of the " "language; in releases at or after that, modules no longer need a future " @@ -93,32 +93,26 @@ msgstr "" "否則 *MandatoryRelease* 會記錄該功能是何時成為語言的一部分;在該版本或之後的" "版本中,模組不再需要 future 聲明來使用相關功能,但可以繼續使用此種引入方式。" -#: ../../library/__future__.rst:51 +#: ../../library/__future__.rst:58 msgid "" "*MandatoryRelease* may also be ``None``, meaning that a planned feature got " -"dropped." -msgstr "*MandatoryRelease* 也可能是 ``None``,這意味著計劃中的功能被丟棄。" - -#: ../../library/__future__.rst:54 -msgid "" -"Instances of class :class:`_Feature` have two corresponding methods, :meth:" -"`getOptionalRelease` and :meth:`getMandatoryRelease`." +"dropped or that it is not yet decided." msgstr "" -":class:`_Feature` 類別的實例有兩個相應的方法::meth:`getOptionalRelease` 和 :" -"meth:`getMandatoryRelease`。" +"*MandatoryRelease* 也可能是 ``None``,這意味著計劃中的功能被丟棄或者仍未決" +"定。" -#: ../../library/__future__.rst:57 +#: ../../library/__future__.rst:63 msgid "" "*CompilerFlag* is the (bitfield) flag that should be passed in the fourth " "argument to the built-in function :func:`compile` to enable the feature in " -"dynamically compiled code. This flag is stored in the :attr:`compiler_flag` " -"attribute on :class:`_Feature` instances." +"dynamically compiled code. This flag is stored in the :attr:`_Feature." +"compiler_flag` attribute on :class:`_Feature` instances." msgstr "" "*CompilerFlag* 是(位元欄位 (bitfield))旗標,應在第四個引數中傳遞給內建函" "式 :func:`compile` 以在動態編譯的程式碼中啟用該功能。此旗標存儲在 :class:" -"`_Feature` 實例上的 :attr:`compiler_flag` 屬性中。" +"`_Feature` 實例上的 :attr:`_Feature.compiler_flag` 屬性中。" -#: ../../library/__future__.rst:62 +#: ../../library/__future__.rst:68 msgid "" "No feature description will ever be deleted from :mod:`__future__`. Since " "its introduction in Python 2.1 the following features have found their way " @@ -127,153 +121,153 @@ msgstr "" "不會從 :mod:`__future__` 中刪除任何功能描述。自從在 Python 2.1 中引入以來,以" "下功能已透過這種機制引入到該語言中:" -#: ../../library/__future__.rst:67 +#: ../../library/__future__.rst:73 msgid "feature" msgstr "功能" -#: ../../library/__future__.rst:67 +#: ../../library/__future__.rst:73 msgid "optional in" msgstr "可選的版本" -#: ../../library/__future__.rst:67 +#: ../../library/__future__.rst:73 msgid "mandatory in" msgstr "強制性的版本" -#: ../../library/__future__.rst:67 +#: ../../library/__future__.rst:73 msgid "effect" msgstr "影響" -#: ../../library/__future__.rst:69 +#: ../../library/__future__.rst:75 msgid "nested_scopes" msgstr "nested_scopes" -#: ../../library/__future__.rst:69 +#: ../../library/__future__.rst:75 msgid "2.1.0b1" msgstr "2.1.0b1" -#: ../../library/__future__.rst:69 +#: ../../library/__future__.rst:75 msgid "2.2" msgstr "2.2" -#: ../../library/__future__.rst:69 +#: ../../library/__future__.rst:75 msgid ":pep:`227`: *Statically Nested Scopes*" msgstr ":pep:`227`: *靜態巢狀作用域 (Statically Nested Scopes)*" -#: ../../library/__future__.rst:72 +#: ../../library/__future__.rst:78 msgid "generators" msgstr "generators" -#: ../../library/__future__.rst:72 +#: ../../library/__future__.rst:78 msgid "2.2.0a1" msgstr "2.2.0a1" -#: ../../library/__future__.rst:72 +#: ../../library/__future__.rst:78 msgid "2.3" msgstr "2.3" -#: ../../library/__future__.rst:72 +#: ../../library/__future__.rst:78 msgid ":pep:`255`: *Simple Generators*" msgstr ":pep:`255`: *簡單產生器 (Simple Generators)*" -#: ../../library/__future__.rst:75 +#: ../../library/__future__.rst:81 msgid "division" msgstr "division" -#: ../../library/__future__.rst:75 +#: ../../library/__future__.rst:81 msgid "2.2.0a2" msgstr "2.2.0a2" -#: ../../library/__future__.rst:75 ../../library/__future__.rst:78 -#: ../../library/__future__.rst:84 ../../library/__future__.rst:87 +#: ../../library/__future__.rst:81 ../../library/__future__.rst:84 +#: ../../library/__future__.rst:90 ../../library/__future__.rst:93 msgid "3.0" msgstr "3.0" -#: ../../library/__future__.rst:75 +#: ../../library/__future__.rst:81 msgid ":pep:`238`: *Changing the Division Operator*" msgstr ":pep:`238`: *更改除法運算子 (Changing the Division Operator)*" -#: ../../library/__future__.rst:78 +#: ../../library/__future__.rst:84 msgid "absolute_import" msgstr "absolute_import" -#: ../../library/__future__.rst:78 ../../library/__future__.rst:81 +#: ../../library/__future__.rst:84 ../../library/__future__.rst:87 msgid "2.5.0a1" msgstr "2.5.0a1" -#: ../../library/__future__.rst:78 +#: ../../library/__future__.rst:84 msgid ":pep:`328`: *Imports: Multi-Line and Absolute/Relative*" msgstr "" ":pep:`328`: *引入:多列與絕對/相對 (Imports: Multi-Line and Absolute/" "Relative)*" -#: ../../library/__future__.rst:81 +#: ../../library/__future__.rst:87 msgid "with_statement" msgstr "with_statement" -#: ../../library/__future__.rst:81 +#: ../../library/__future__.rst:87 msgid "2.6" msgstr "2.6" -#: ../../library/__future__.rst:81 +#: ../../library/__future__.rst:87 msgid ":pep:`343`: *The \"with\" Statement*" msgstr ":pep:`343`: *\"with\" 陳述式 (The \"with\" Statement)*" -#: ../../library/__future__.rst:84 +#: ../../library/__future__.rst:90 msgid "print_function" msgstr "print_function" -#: ../../library/__future__.rst:84 ../../library/__future__.rst:87 +#: ../../library/__future__.rst:90 ../../library/__future__.rst:93 msgid "2.6.0a2" msgstr "2.6.0a2" -#: ../../library/__future__.rst:84 +#: ../../library/__future__.rst:90 msgid ":pep:`3105`: *Make print a function*" msgstr ":pep:`3105`: *使 print 成為一個函式 (Make print a function)*" -#: ../../library/__future__.rst:87 +#: ../../library/__future__.rst:93 msgid "unicode_literals" msgstr "unicode_literals" -#: ../../library/__future__.rst:87 +#: ../../library/__future__.rst:93 msgid ":pep:`3112`: *Bytes literals in Python 3000*" msgstr "" ":pep:`3112`: *Python 3000 中的位元組字面值 (Bytes literals in Python 3000)*" -#: ../../library/__future__.rst:90 +#: ../../library/__future__.rst:96 msgid "generator_stop" msgstr "generator_stop" -#: ../../library/__future__.rst:90 +#: ../../library/__future__.rst:96 msgid "3.5.0b1" msgstr "3.5.0b1" -#: ../../library/__future__.rst:90 +#: ../../library/__future__.rst:96 msgid "3.7" msgstr "3.7" -#: ../../library/__future__.rst:90 +#: ../../library/__future__.rst:96 msgid ":pep:`479`: *StopIteration handling inside generators*" msgstr "" ":pep:`479`: *產生器內部的 StopIteration 處理 (StopIteration handling inside " "generators)*" -#: ../../library/__future__.rst:93 +#: ../../library/__future__.rst:99 msgid "annotations" msgstr "annotations" -#: ../../library/__future__.rst:93 +#: ../../library/__future__.rst:99 msgid "3.7.0b1" msgstr "3.7.0b1" -#: ../../library/__future__.rst:93 +#: ../../library/__future__.rst:99 msgid "TBD [1]_" msgstr "TBD [1]_" -#: ../../library/__future__.rst:93 +#: ../../library/__future__.rst:99 msgid ":pep:`563`: *Postponed evaluation of annotations*" msgstr ":pep:`563`: *推遲對註釋的求值 (Postponed evaluation of annotations)*" -#: ../../library/__future__.rst:100 +#: ../../library/__future__.rst:106 msgid "" "``from __future__ import annotations`` was previously scheduled to become " "mandatory in Python 3.10, but the Python Steering Council twice decided to " @@ -291,10 +285,17 @@ msgstr "" "VIZEBX5EYMSYIJNDBF6DMUMZOCWHARSO/>`__)。目前還尚未做出決定。另請參閱 :pep:" "`563` 和 :pep:`649`。" -#: ../../library/__future__.rst:110 +#: ../../library/__future__.rst:116 msgid ":ref:`future`" msgstr ":ref:`future`" -#: ../../library/__future__.rst:111 +#: ../../library/__future__.rst:117 msgid "How the compiler treats future imports." msgstr "編譯器如何處理 future 引入。" + +#~ msgid "" +#~ "Instances of class :class:`_Feature` have two corresponding methods, :" +#~ "meth:`getOptionalRelease` and :meth:`getMandatoryRelease`." +#~ msgstr "" +#~ ":class:`_Feature` 類別的實例有兩個相應的方法::meth:`getOptionalRelease` " +#~ "和 :meth:`getMandatoryRelease`。" diff --git a/library/abc.po b/library/abc.po index 36c2de8375..4b60588f66 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-10-20 00:03+0000\n" +"POT-Creation-Date: 2023-12-04 13:57+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-" @@ -47,12 +47,12 @@ msgid "" "ABCs; these can, of course, be further derived. In addition, the :mod:" "`collections.abc` submodule has some ABCs that can be used to test whether a " "class or instance provides a particular interface, for example, if it is :" -"term:`hashable` or if it is a mapping." +"term:`hashable` or if it is a :term:`mapping`." msgstr "" ":mod:`collections` 模組中有一些衍生自 ABC 的具體類別;當然這些類別還可以進一" "步衍生出其他類別。此外,:mod:`collections.abc` 子模組中有一些 ABC 可被用於測" "試一個類別或實例是否提供特定介面,例如它是否\\ :term:`可雜湊 (hashable) " -"` 或它是否為對映 (mapping)。" +"` 或它是否為\\ :term:`對映 `。" #: ../../library/abc.rst:27 msgid "" @@ -65,28 +65,24 @@ msgstr "" #: ../../library/abc.rst:32 msgid "" "A helper class that has :class:`ABCMeta` as its metaclass. With this class, " -"an abstract base class can be created by simply deriving from :class:`ABC` " +"an abstract base class can be created by simply deriving from :class:`!ABC` " "avoiding sometimes confusing metaclass usage, for example::" msgstr "" "一個使用 :class:`ABCMeta` 作為元類別的工具類別。抽象基底類別可以透過自 :" -"class:`ABC` 衍生而建立,這就避免了在某些情況下會令人混淆的元類別用法,用法如" -"以下範例:\n" -"\n" -"::" +"class:`!ABC` 衍生而建立,這就避免了在某些情況下會令人混淆的元類別用法,用法如" +"以下範例: ::" #: ../../library/abc.rst:41 msgid "" -"Note that the type of :class:`ABC` is still :class:`ABCMeta`, therefore " -"inheriting from :class:`ABC` requires the usual precautions regarding " +"Note that the type of :class:`!ABC` is still :class:`ABCMeta`, therefore " +"inheriting from :class:`!ABC` requires the usual precautions regarding " "metaclass usage, as multiple inheritance may lead to metaclass conflicts. " "One may also define an abstract base class by passing the metaclass keyword " -"and using :class:`ABCMeta` directly, for example::" +"and using :class:`!ABCMeta` directly, for example::" msgstr "" -"注意 :class:`ABC` 的型別仍然是 :class:`ABCMeta`,因此繼承 :class:`ABC` 仍然需" -"要關注使用元類別的注意事項,如多重繼承可能會導致元類別衝突。當然你也可以傳入" -"元類別關鍵字並直接使用 :class:`ABCMeta` 來定義一個抽象基底類別,例如:\n" -"\n" -"::" +"注意 :class:`!ABC` 的型別仍然是 :class:`ABCMeta`,因此繼承 :class:`!ABC` 仍然" +"需要關注使用元類別的注意事項,如多重繼承可能會導致元類別衝突。當然你也可以傳" +"入元類別關鍵字並直接使用 :class:`!ABCMeta` 來定義一個抽象基底類別,例如: ::" #: ../../library/abc.rst:57 msgid "Metaclass for defining Abstract Base Classes (ABCs)." @@ -112,17 +108,14 @@ msgstr "" #: ../../library/abc.rst:68 msgid "" -"Classes created with a metaclass of :class:`ABCMeta` have the following " +"Classes created with a metaclass of :class:`!ABCMeta` have the following " "method:" -msgstr "使用 :class:`ABCMeta` 作為元類別建立的類別含有以下的方法:" +msgstr "使用 :class:`!ABCMeta` 作為元類別建立的類別含有以下的方法:" #: ../../library/abc.rst:72 msgid "" "Register *subclass* as a \"virtual subclass\" of this ABC. For example::" -msgstr "" -"將\\ *子類別*\\ 註冊為該 ABC 的「抽象子類別」,例如:\n" -"\n" -"::" +msgstr "將\\ *子類別*\\ 註冊為該 ABC 的「抽象子類別」,例如: ::" #: ../../library/abc.rst:85 msgid "Returns the registered subclass, to allow usage as a class decorator." @@ -130,10 +123,10 @@ msgstr "回傳已註冊的子類別,使其能夠作為類別裝飾器。" #: ../../library/abc.rst:88 msgid "" -"To detect calls to :meth:`register`, you can use the :func:`get_cache_token` " -"function." +"To detect calls to :meth:`!register`, you can use the :func:" +"`get_cache_token` function." msgstr "" -"你可以使用 :func:`get_cache_token` 函式來檢測對 :meth:`register` 的呼叫。" +"你可以使用 :func:`get_cache_token` 函式來檢測對 :meth:`!register` 的呼叫。" #: ../../library/abc.rst:92 msgid "You can also override this method in an abstract base class:" @@ -146,15 +139,15 @@ msgstr "(必須定義為類別方法。)" #: ../../library/abc.rst:98 msgid "" "Check whether *subclass* is considered a subclass of this ABC. This means " -"that you can customize the behavior of ``issubclass`` further without the " -"need to call :meth:`register` on every class you want to consider a subclass " -"of the ABC. (This class method is called from the :meth:`__subclasscheck__` " -"method of the ABC.)" +"that you can customize the behavior of :func:`issubclass` further without " +"the need to call :meth:`register` on every class you want to consider a " +"subclass of the ABC. (This class method is called from the :meth:`~class." +"__subclasscheck__` method of the ABC.)" msgstr "" -"檢查 *subclass* 是否該被認為是該 ABC 的子類別,也就是說你可以直接自訂 " -"``issubclass`` 的行為,而不用對於那些你希望定義為該 ABC 的子類別的類別都個別" -"呼叫 :meth:`register` 方法。(這個類別方法是在 ABC 的 :meth:" -"`__subclasscheck__` 方法中呼叫。)" +"檢查 *subclass* 是否該被認為是該 ABC 的子類別,也就是說你可以直接自訂 :func:" +"`issubclass` 的行為,而不用對於那些你希望定義為該 ABC 的子類別的類別都個別呼" +"叫 :meth:`register` 方法。(這個類別方法是在 ABC 的 :meth:`~class." +"__subclasscheck__` 方法中呼叫。)" #: ../../library/abc.rst:104 msgid "" @@ -172,22 +165,19 @@ msgstr "" #: ../../library/abc.rst:114 msgid "" "For a demonstration of these concepts, look at this example ABC definition::" -msgstr "" -"為了對這些概念做一演示,請見以下定義 ABC 的範例:\n" -"\n" -"::" +msgstr "為了對這些概念做一演示,請見以下定義 ABC 的範例: ::" #: ../../library/abc.rst:143 msgid "" "The ABC ``MyIterable`` defines the standard iterable method, :meth:" "`~iterator.__iter__`, as an abstract method. The implementation given here " -"can still be called from subclasses. The :meth:`get_iterator` method is " +"can still be called from subclasses. The :meth:`!get_iterator` method is " "also part of the ``MyIterable`` abstract base class, but it does not have to " "be overridden in non-abstract derived classes." msgstr "" "ABC ``MyIterable`` 定義了作為抽象方法的一個標準疊代方法 :meth:`~iterator." -"__iter__`。這裡給定的實作仍可在子類別中被呼叫。:meth:`get_iterator` 方法也是 " -"``MyIterable`` 抽象基底類別的一部分,但它不必被非抽象衍生類別覆寫。" +"__iter__`。這裡給定的實作仍可在子類別中被呼叫。:meth:`!get_iterator` 方法也" +"是 ``MyIterable`` 抽象基底類別的一部分,但它不必被非抽象衍生類別覆寫。" #: ../../library/abc.rst:149 msgid "" @@ -204,18 +194,19 @@ msgstr "" msgid "" "Finally, the last line makes ``Foo`` a virtual subclass of ``MyIterable``, " "even though it does not define an :meth:`~iterator.__iter__` method (it uses " -"the old-style iterable protocol, defined in terms of :meth:`__len__` and :" -"meth:`~object.__getitem__`). Note that this will not make ``get_iterator`` " -"available as a method of ``Foo``, so it is provided separately." +"the old-style iterable protocol, defined in terms of :meth:`~object.__len__` " +"and :meth:`~object.__getitem__`). Note that this will not make " +"``get_iterator`` available as a method of ``Foo``, so it is provided " +"separately." msgstr "" "最後,即使 ``Foo`` 沒有定義 :meth:`~iterator.__iter__` 方法(它使用了以 :" -"meth:`__len__` 和 :meth:`~object.__getitem__` 所定義的舊式可疊代物件協定)," -"最末一行使其成為 ``MyIterable`` 的一個虛擬子類別。請注意這不會使 " +"meth:`~object.__len__` 和 :meth:`~object.__getitem__` 所定義的舊式可疊代物件" +"協定),最末一行使其成為 ``MyIterable`` 的一個虛擬子類別。請注意這不會使 " "``get_iterator`` 成為 ``Foo`` 的一個可用方法,所以它是需要被另外提供的。" #: ../../library/abc.rst:163 -msgid "The :mod:`abc` module also provides the following decorator:" -msgstr ":mod:`abc` 模組也提供了這些裝飾器:" +msgid "The :mod:`!abc` module also provides the following decorator:" +msgstr ":mod:`!abc` 模組也提供了這些裝飾器:" #: ../../library/abc.rst:167 msgid "A decorator indicating abstract methods." @@ -224,56 +215,52 @@ msgstr "用於表示抽象方法的裝飾器。" #: ../../library/abc.rst:169 msgid "" "Using this decorator requires that the class's metaclass is :class:`ABCMeta` " -"or is derived from it. A class that has a metaclass derived from :class:" -"`ABCMeta` cannot be instantiated unless all of its abstract methods and " +"or is derived from it. A class that has a metaclass derived from :class:`!" +"ABCMeta` cannot be instantiated unless all of its abstract methods and " "properties are overridden. The abstract methods can be called using any of " -"the normal 'super' call mechanisms. :func:`abstractmethod` may be used to " +"the normal 'super' call mechanisms. :func:`!abstractmethod` may be used to " "declare abstract methods for properties and descriptors." msgstr "" "類別的元類別是 :class:`ABCMeta` 或是從該類別衍生才能使用此裝飾器。一個具有衍" -"生自 :class:`ABCMeta` 之元類別的類別不可以被實例化,除非它全部的抽象方法和特" -"性均已被覆寫。抽象方法可透過任何一般的 'super' 呼叫機制來呼叫。:func:" -"`abstractmethod` 可被用於為特性和描述器宣告的抽象方法。" +"生自 :class:`!ABCMeta` 之元類別的類別不可以被實例化,除非它全部的抽象方法和特" +"性均已被覆寫。抽象方法可透過任何一般的 'super' 呼叫機制來呼叫。:func:`!" +"abstractmethod` 可被用於為特性和描述器宣告的抽象方法。" #: ../../library/abc.rst:176 msgid "" "Dynamically adding abstract methods to a class, or attempting to modify the " "abstraction status of a method or class once it is created, are only " -"supported using the :func:`update_abstractmethods` function. The :func:" -"`abstractmethod` only affects subclasses derived using regular inheritance; " -"\"virtual subclasses\" registered with the ABC's :meth:`register` method are " -"not affected." +"supported using the :func:`update_abstractmethods` function. The :func:`!" +"abstractmethod` only affects subclasses derived using regular inheritance; " +"\"virtual subclasses\" registered with the ABC's :meth:`~ABCMeta.register` " +"method are not affected." msgstr "" "僅在使用 :func:`update_abstractmethods` 函式時,才能夠動態地為一個類別新增抽" -"象方法,或者嘗試在方法或類別被建立後修改其抽象狀態。:func:`abstractmethod` 只" -"會影響使用常規繼承所衍生出的子類別;透過 ABC 的 :meth:`register` 方法註冊的" -"「虛擬子類別」不會受到影響。" +"象方法,或者嘗試在方法或類別被建立後修改其抽象狀態。:func:`!abstractmethod` " +"只會影響使用常規繼承所衍生出的子類別;透過 ABC 的 :meth:`~ABCMeta.register` " +"方法註冊的「虛擬子類別」不會受到影響。" #: ../../library/abc.rst:183 msgid "" -"When :func:`abstractmethod` is applied in combination with other method " +"When :func:`!abstractmethod` is applied in combination with other method " "descriptors, it should be applied as the innermost decorator, as shown in " "the following usage examples::" msgstr "" -"當 :func:`abstractmethod` 與其他方法描述器 (method descriptor) 配合應用時,它" -"應被當最內層的裝飾器,如以下用法範例所示:\n" -"\n" -"::" +"當 :func:`!abstractmethod` 與其他方法描述器 (method descriptor) 配合應用時," +"它應被當最內層的裝飾器,如以下用法範例所示: ::" #: ../../library/abc.rst:217 msgid "" "In order to correctly interoperate with the abstract base class machinery, " -"the descriptor must identify itself as abstract using :attr:" -"`__isabstractmethod__`. In general, this attribute should be ``True`` if any " +"the descriptor must identify itself as abstract using :attr:`!" +"__isabstractmethod__`. In general, this attribute should be ``True`` if any " "of the methods used to compose the descriptor are abstract. For example, " "Python's built-in :class:`property` does the equivalent of::" msgstr "" -"為了能正確地與 ABC 機制實作相互操作,描述器必須使用 :attr:" -"`__isabstractmethod__` 將自身標識為抽象的。一般來說,如果被用於組成描述器的任" +"為了能正確地與 ABC 機制實作相互操作,描述器必須使用 :attr:`!" +"__isabstractmethod__` 將自身標識為抽象的。一般來說,如果被用於組成描述器的任" "一方法是抽象的,則此屬性應當為 ``True``。 例如,Python 的內建 :class:" -"`property` 所做的就等價於:\n" -"\n" -"::" +"`property` 所做的就等價於: ::" #: ../../library/abc.rst:232 msgid "" @@ -288,8 +275,8 @@ msgstr "" "inheritance) 的框架中,可以被用作 super 呼叫的一個端點 (end-point)。" #: ../../library/abc.rst:239 -msgid "The :mod:`abc` module also supports the following legacy decorators:" -msgstr ":mod:`abc` 模組還支援下列舊式裝飾器:" +msgid "The :mod:`!abc` module also supports the following legacy decorators:" +msgstr ":mod:`!abc` 模組還支援下列舊式裝飾器:" #: ../../library/abc.rst:244 msgid "" @@ -313,9 +300,7 @@ msgid "" "correctly identified as abstract when applied to an abstract method::" msgstr "" "這個特例已被棄用,因為現在當 :func:`classmethod` 裝飾器應用於抽象方法時已會被" -"正確地標識為是抽象的:\n" -"\n" -"::" +"正確地標識為是抽象的: ::" #: ../../library/abc.rst:265 msgid "" @@ -339,9 +324,7 @@ msgid "" "now correctly identified as abstract when applied to an abstract method::" msgstr "" "這個特例已被棄用,因為現在當 :func:`staticmethod` 裝飾器應用於抽象方法時已會" -"被正確地標識為是抽象的:\n" -"\n" -"::" +"被正確地標識為是抽象的: ::" #: ../../library/abc.rst:285 msgid "" @@ -364,9 +347,7 @@ msgid "" "correctly identified as abstract when applied to an abstract method::" msgstr "" "這個特例已被棄用,因為現在當 :func:`property` 裝飾器應用於抽象方法時已會被正" -"確地標識為是抽象的:\n" -"\n" -"::" +"確地標識為是抽象的: ::" #: ../../library/abc.rst:303 msgid "" @@ -375,22 +356,18 @@ msgid "" "underlying methods as abstract::" msgstr "" "上面的例子定義了一個唯讀特性;你也可以透過適當地將一個或多個底層方法標記為抽" -"象的來定義可讀寫的抽象特性:\n" -"\n" -"::" +"象的來定義可讀寫的抽象特性: ::" #: ../../library/abc.rst:317 msgid "" "If only some components are abstract, only those components need to be " "updated to create a concrete property in a subclass::" msgstr "" -"如果只有某些元件是抽象的,則只需更新那些元件即可在子類別中建立具體的特性:\n" -"\n" -"::" +"如果只有某些元件是抽象的,則只需更新那些元件即可在子類別中建立具體的特性: ::" #: ../../library/abc.rst:326 -msgid "The :mod:`abc` module also provides the following functions:" -msgstr ":mod:`abc` 模組也提供了這些函式:" +msgid "The :mod:`!abc` module also provides the following functions:" +msgstr ":mod:`!abc` 模組也提供了這些函式:" #: ../../library/abc.rst:330 msgid "Returns the current abstract base class cache token." diff --git a/library/array.po b/library/array.po index d4376b7284..fc3b060231 100644 --- a/library/array.po +++ b/library/array.po @@ -215,9 +215,9 @@ msgid "" "``Py_UNICODE``. This change doesn't affect its behavior because " "``Py_UNICODE`` is alias of :c:type:`wchar_t` since Python 3.3." msgstr "" -"目前 ``array('u')`` 使用 :c:type:`wchar_t` 取代已棄用的 ``Py_UNICODE`` 作為 C " -"type。這個異動並沒有影響到它的作用,因爲自從 Python 3.3 開始 ``Py_UNICODE`` " -"即為 :c:type:`wchar_t` 的別名。" +"目前 ``array('u')`` 使用 :c:type:`wchar_t` 取代已棄用的 ``Py_UNICODE`` 作為 " +"C type。這個異動並沒有影響到它的作用,因爲自從 Python 3.3 開始 " +"``Py_UNICODE`` 即為 :c:type:`wchar_t` 的別名。" #: ../../library/array.rst:61 msgid "" diff --git a/library/asyncio-exceptions.po b/library/asyncio-exceptions.po index fecf2b0148..edf7cb0316 100644 --- a/library/asyncio-exceptions.po +++ b/library/asyncio-exceptions.po @@ -56,7 +56,9 @@ msgstr "" msgid "" ":exc:`CancelledError` is now a subclass of :class:`BaseException` rather " "than :class:`Exception`." -msgstr ":exc:`CancelledError` 現在是 :class:`BaseException` 而非 :class:`Exception` 的子類別。" +msgstr "" +":exc:`CancelledError` 現在是 :class:`BaseException` 而非 :class:`Exception` " +"的子類別。" #: ../../library/asyncio-exceptions.rst:39 msgid "Invalid internal state of :class:`Task` or :class:`Future`." diff --git a/library/asyncio-runner.po b/library/asyncio-runner.po index 3cb6c222b4..d20d462c0e 100644 --- a/library/asyncio-runner.po +++ b/library/asyncio-runner.po @@ -28,15 +28,15 @@ msgstr "**原始碼:**\\ :source:`Lib/asyncio/runners.py`" #: ../../library/asyncio-runner.rst:11 msgid "" "This section outlines high-level asyncio primitives to run asyncio code." -msgstr "" -"這個章節概述用於執行 asyncio 程式碼的高階 asyncio 原始物件。" +msgstr "這個章節概述用於執行 asyncio 程式碼的高階 asyncio 原始物件。" #: ../../library/asyncio-runner.rst:13 msgid "" "They are built on top of an :ref:`event loop ` with the " "aim to simplify async code usage for common wide-spread scenarios." msgstr "" -"他們是基於一個\\ :ref:`事件迴圈 `,目的是為了簡化常見且廣泛運用場景的非同步程式碼。" +"他們是基於一個\\ :ref:`事件迴圈 `,目的是為了簡化常見且廣" +"泛運用場景的非同步程式碼。" #: ../../library/asyncio-runner.rst:23 msgid "Running an asyncio Program" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index fd1ced339d..e94d3e7c84 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-11-27 00:03+0000\n" "PO-Revision-Date: 2022-10-31 16:28+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -109,7 +109,7 @@ msgstr "移除 *loop* 參數。" #: ../../library/asyncio-stream.rst:86 ../../library/asyncio-stream.rst:128 #: ../../library/asyncio-stream.rst:160 ../../library/asyncio-stream.rst:190 -#: ../../library/asyncio-stream.rst:368 +#: ../../library/asyncio-stream.rst:372 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "新增 *ssl_shutdown_timeout* 參數。" @@ -224,10 +224,14 @@ msgstr "" "`start_server` 會是較好的做法。" #: ../../library/asyncio-stream.rst:209 +msgid "Acknowledge the EOF." +msgstr "" + +#: ../../library/asyncio-stream.rst:213 msgid "Read up to *n* bytes from the stream." msgstr "從串流中讀取至多 *n* 個位元組的資料。" -#: ../../library/asyncio-stream.rst:211 +#: ../../library/asyncio-stream.rst:215 msgid "" "If *n* is not provided or set to ``-1``, read until EOF, then return all " "read :class:`bytes`. If EOF was received and the internal buffer is empty, " @@ -237,39 +241,39 @@ msgstr "" "的 :class:`bytes`。讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物" "件。" -#: ../../library/asyncio-stream.rst:216 +#: ../../library/asyncio-stream.rst:220 msgid "If *n* is ``0``, return an empty ``bytes`` object immediately." msgstr "如果 *n* 為 ``0``,則立即回傳一個空的 ``bytes`` 物件。" -#: ../../library/asyncio-stream.rst:218 +#: ../../library/asyncio-stream.rst:222 msgid "" "If *n* is positive, return at most *n* available ``bytes`` as soon as at " "least 1 byte is available in the internal buffer. If EOF is received before " "any byte is read, return an empty ``bytes`` object." msgstr "" -#: ../../library/asyncio-stream.rst:225 +#: ../../library/asyncio-stream.rst:229 msgid "" "Read one line, where \"line\" is a sequence of bytes ending with ``\\n``." msgstr "讀取一行,其中\"行\"指的是以 ``\\n`` 結尾的位元組序列。" -#: ../../library/asyncio-stream.rst:228 +#: ../../library/asyncio-stream.rst:232 msgid "" "If EOF is received and ``\\n`` was not found, the method returns partially " "read data." msgstr "如果讀取到 EOF 而沒有找到 ``\\n``,該方法會回傳部分的已讀取資料。" -#: ../../library/asyncio-stream.rst:231 +#: ../../library/asyncio-stream.rst:235 msgid "" "If EOF is received and the internal buffer is empty, return an empty " "``bytes`` object." msgstr "如果讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物件。" -#: ../../library/asyncio-stream.rst:236 +#: ../../library/asyncio-stream.rst:240 msgid "Read exactly *n* bytes." msgstr "讀取剛好 *n* 個位元組。" -#: ../../library/asyncio-stream.rst:238 +#: ../../library/asyncio-stream.rst:242 msgid "" "Raise an :exc:`IncompleteReadError` if EOF is reached before *n* can be " "read. Use the :attr:`IncompleteReadError.partial` attribute to get the " @@ -279,11 +283,11 @@ msgstr "" "`IncompleteReadError`。使用 :attr:`IncompleteReadError.partial` 屬性來獲取串" "流結束前已讀取的部分資料。" -#: ../../library/asyncio-stream.rst:244 +#: ../../library/asyncio-stream.rst:248 msgid "Read data from the stream until *separator* is found." msgstr "從串流中持續讀取資料直到出現 *separator*。" -#: ../../library/asyncio-stream.rst:246 +#: ../../library/asyncio-stream.rst:250 msgid "" "On success, the data and separator will be removed from the internal buffer " "(consumed). Returned data will include the separator at the end." @@ -291,7 +295,7 @@ msgstr "" "成功後,資料和 separator(分隔符號)會從內部緩衝區中刪除(或者說是被消費掉 " "(consumed))。回傳的資料在末尾會有一個 separator。" -#: ../../library/asyncio-stream.rst:250 +#: ../../library/asyncio-stream.rst:254 msgid "" "If the amount of data read exceeds the configured stream limit, a :exc:" "`LimitOverrunError` exception is raised, and the data is left in the " @@ -300,7 +304,7 @@ msgstr "" "如果讀取的資料量超過了設定的串流限制,將會引發 :exc:`LimitOverrunError` 例" "外,資料將被留在內部緩衝區中,並可以再次被讀取。" -#: ../../library/asyncio-stream.rst:254 +#: ../../library/asyncio-stream.rst:258 msgid "" "If EOF is reached before the complete separator is found, an :exc:" "`IncompleteReadError` exception is raised, and the internal buffer is " @@ -311,20 +315,20 @@ msgstr "" "`IncompleteReadError` 例外,且內部緩衝區會被重置。:attr:`IncompleteReadError." "partial` 屬性可能包含一部分的 separator。" -#: ../../library/asyncio-stream.rst:263 +#: ../../library/asyncio-stream.rst:267 msgid "Return ``True`` if the buffer is empty and :meth:`feed_eof` was called." msgstr "如果緩衝區是空的且 :meth:`feed_eof` 曾被呼叫則回傳 ``True``。" -#: ../../library/asyncio-stream.rst:268 +#: ../../library/asyncio-stream.rst:272 msgid "StreamWriter" msgstr "StreamWriter" -#: ../../library/asyncio-stream.rst:272 +#: ../../library/asyncio-stream.rst:276 msgid "" "Represents a writer object that provides APIs to write data to the IO stream." msgstr "表示一個有提供 API 來將資料寫入 IO 串流的 writer 物件。" -#: ../../library/asyncio-stream.rst:275 +#: ../../library/asyncio-stream.rst:279 msgid "" "It is not recommended to instantiate *StreamWriter* objects directly; use :" "func:`open_connection` and :func:`start_server` instead." @@ -332,7 +336,7 @@ msgstr "" "不建議直接實例化 *StreamWriter* 物件;使用 :func:`open_connection` 和 :func:" "`start_server` 會是較好的做法。" -#: ../../library/asyncio-stream.rst:281 +#: ../../library/asyncio-stream.rst:285 msgid "" "The method attempts to write the *data* to the underlying socket " "immediately. If that fails, the data is queued in an internal write buffer " @@ -341,14 +345,14 @@ msgstr "" "此方法會嘗試立即將 *data* 寫入到底層的 socket。如果失敗,資料會被放到內部寫入" "緩衝中排隊等待 (queue),直到它可被發送。" -#: ../../library/asyncio-stream.rst:285 ../../library/asyncio-stream.rst:297 +#: ../../library/asyncio-stream.rst:289 ../../library/asyncio-stream.rst:301 msgid "The method should be used along with the ``drain()`` method::" msgstr "" "此方法應當與 ``drain()`` 方法一起使用:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:292 +#: ../../library/asyncio-stream.rst:296 msgid "" "The method writes a list (or any iterable) of bytes to the underlying socket " "immediately. If that fails, the data is queued in an internal write buffer " @@ -357,11 +361,11 @@ msgstr "" "此方法會立即嘗試將一個位元組 list(或任何可疊代物件 (iterable))寫入到底層的 " "socket。如果失敗,資料會被放到內部寫入緩衝中排隊等待,直到它可被發送。" -#: ../../library/asyncio-stream.rst:304 +#: ../../library/asyncio-stream.rst:308 msgid "The method closes the stream and the underlying socket." msgstr "此方法會關閉串流以及底層的 socket。" -#: ../../library/asyncio-stream.rst:306 +#: ../../library/asyncio-stream.rst:310 msgid "" "The method should be used, though not mandatory, along with the " "``wait_closed()`` method::" @@ -370,7 +374,7 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-stream.rst:314 +#: ../../library/asyncio-stream.rst:318 msgid "" "Return ``True`` if the underlying transport supports the :meth:`write_eof` " "method, ``False`` otherwise." @@ -378,29 +382,29 @@ msgstr "" "如果底層的傳輸支援 :meth:`write_eof` 方法就回傳 ``True``,否則回傳 " "``False``。" -#: ../../library/asyncio-stream.rst:319 +#: ../../library/asyncio-stream.rst:323 msgid "" "Close the write end of the stream after the buffered write data is flushed." msgstr "在已緩衝的寫入資料被清理 (flush) 後關閉串流的寫入端。" -#: ../../library/asyncio-stream.rst:324 +#: ../../library/asyncio-stream.rst:328 msgid "Return the underlying asyncio transport." msgstr "回傳底層的 asyncio 傳輸。" -#: ../../library/asyncio-stream.rst:328 +#: ../../library/asyncio-stream.rst:332 msgid "" "Access optional transport information; see :meth:`BaseTransport." "get_extra_info` for details." msgstr "存取可選的傳輸資訊;詳情請見 :meth:`BaseTransport.get_extra_info`。" -#: ../../library/asyncio-stream.rst:333 +#: ../../library/asyncio-stream.rst:337 msgid "Wait until it is appropriate to resume writing to the stream. Example::" msgstr "" "等待直到可以繼續寫入到串流。範例:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:339 +#: ../../library/asyncio-stream.rst:343 msgid "" "This is a flow control method that interacts with the underlying IO write " "buffer. When the size of the buffer reaches the high watermark, *drain()* " @@ -412,48 +416,48 @@ msgstr "" "(high watermark) 時,*drain()* 會阻塞直到緩衝區大小減少至最低標記位 (low " "watermark) 以便繼續寫入。當沒有要等待的資料時,:meth:`drain` 會立即回傳。" -#: ../../library/asyncio-stream.rst:349 +#: ../../library/asyncio-stream.rst:353 msgid "Upgrade an existing stream-based connection to TLS." msgstr "" -#: ../../library/asyncio-stream.rst:351 +#: ../../library/asyncio-stream.rst:355 msgid "Parameters:" msgstr "" -#: ../../library/asyncio-stream.rst:353 +#: ../../library/asyncio-stream.rst:357 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: ../../library/asyncio-stream.rst:355 +#: ../../library/asyncio-stream.rst:359 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: ../../library/asyncio-stream.rst:358 +#: ../../library/asyncio-stream.rst:362 msgid "" "*ssl_handshake_timeout* is the time in seconds to wait for the TLS handshake " "to complete before aborting the connection. ``60.0`` seconds if ``None`` " "(default)." msgstr "" -#: ../../library/asyncio-stream.rst:362 +#: ../../library/asyncio-stream.rst:366 msgid "" "*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " "to complete before aborting the connection. ``30.0`` seconds if ``None`` " "(default)." msgstr "" -#: ../../library/asyncio-stream.rst:374 +#: ../../library/asyncio-stream.rst:378 msgid "" "Return ``True`` if the stream is closed or in the process of being closed." msgstr "如果串流已被關閉或正在被關閉則回傳 ``True``。" -#: ../../library/asyncio-stream.rst:381 +#: ../../library/asyncio-stream.rst:385 msgid "Wait until the stream is closed." msgstr "等待直到串流被關閉。" -#: ../../library/asyncio-stream.rst:383 +#: ../../library/asyncio-stream.rst:387 msgid "" "Should be called after :meth:`close` to wait until the underlying connection " "is closed, ensuring that all data has been flushed before e.g. exiting the " @@ -462,22 +466,22 @@ msgstr "" "應當在 :meth:`close` 之後才被呼叫,這會持續等待直到底層的連線被關閉,以確保在" "這之前(例如在程式退出前)所有資料都已經被清空" -#: ../../library/asyncio-stream.rst:391 +#: ../../library/asyncio-stream.rst:395 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-stream.rst:396 +#: ../../library/asyncio-stream.rst:400 msgid "TCP echo client using streams" msgstr "使用串流的 TCP echo 客戶端" -#: ../../library/asyncio-stream.rst:398 +#: ../../library/asyncio-stream.rst:402 msgid "TCP echo client using the :func:`asyncio.open_connection` function::" msgstr "" "使用 :func:`asyncio.open_connection` 函式的 TCP echo 客戶端:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:422 +#: ../../library/asyncio-stream.rst:426 msgid "" "The :ref:`TCP echo client protocol " "` example uses the low-level :meth:" @@ -486,18 +490,18 @@ msgstr "" "使用低階 :meth:`loop.create_connection` 方法的 :ref:`TCP echo 客戶端協定 " "`\\ 範例。" -#: ../../library/asyncio-stream.rst:429 +#: ../../library/asyncio-stream.rst:433 msgid "TCP echo server using streams" msgstr "使用串流的 TCP echo 伺服器" -#: ../../library/asyncio-stream.rst:431 +#: ../../library/asyncio-stream.rst:435 msgid "TCP echo server using the :func:`asyncio.start_server` function::" msgstr "" "TCP echo 伺服器使用 :func:`asyncio.start_server` 函式:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:465 +#: ../../library/asyncio-stream.rst:469 msgid "" "The :ref:`TCP echo server protocol " "` example uses the :meth:`loop." @@ -506,11 +510,11 @@ msgstr "" "使用 :meth:`loop.create_server` 方法的 :ref:`TCP echo 伺服器協定 " "` 範例。" -#: ../../library/asyncio-stream.rst:470 +#: ../../library/asyncio-stream.rst:474 msgid "Get HTTP headers" msgstr "獲取 HTTP 標頭" -#: ../../library/asyncio-stream.rst:472 +#: ../../library/asyncio-stream.rst:476 msgid "" "Simple example querying HTTP headers of the URL passed on the command line::" msgstr "" @@ -518,25 +522,25 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-stream.rst:511 +#: ../../library/asyncio-stream.rst:515 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:515 +#: ../../library/asyncio-stream.rst:519 msgid "or with HTTPS::" msgstr "" "或使用 HTTPS:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:523 +#: ../../library/asyncio-stream.rst:527 msgid "Register an open socket to wait for data using streams" msgstr "註冊一個使用串流來等待資料的開放 socket" -#: ../../library/asyncio-stream.rst:525 +#: ../../library/asyncio-stream.rst:529 msgid "" "Coroutine waiting until a socket receives data using the :func:" "`open_connection` function::" @@ -545,7 +549,7 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-stream.rst:560 +#: ../../library/asyncio-stream.rst:564 msgid "" "The :ref:`register an open socket to wait for data using a protocol " "` example uses a low-level protocol and " @@ -555,7 +559,7 @@ msgstr "" "`\\ 範例中,有使用了低階協定以及 :meth:" "`loop.create_connection` 方法。" -#: ../../library/asyncio-stream.rst:564 +#: ../../library/asyncio-stream.rst:568 msgid "" "The :ref:`watch a file descriptor for read events " "` example uses the low-level :meth:`loop." diff --git a/library/bisect.po b/library/bisect.po index ed33160d81..178cf2efd2 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -52,9 +52,9 @@ msgid "" "only call the :meth:`__lt__` method and will return an insertion point " "between values in an array." msgstr "" -"這個模組被稱為 :mod:`bisect` 是因為它使用基本二分演算法來完成其工作。不像其它搜尋" -"特定值的二分法工具,本模組中的函式旨在定位插入點。因此,這些函式永遠不會呼" -"叫 :meth:`__eq__` 方法來確認是否找到一個值。相反地,這些函式只呼叫 :meth:" +"這個模組被稱為 :mod:`bisect` 是因為它使用基本二分演算法來完成其工作。不像其它" +"搜尋特定值的二分法工具,本模組中的函式旨在定位插入點。因此,這些函式永遠不會" +"呼叫 :meth:`__eq__` 方法來確認是否找到一個值。相反地,這些函式只呼叫 :meth:" "`__lt__` 方法,並在陣列中的值回傳一個插入點。" #: ../../library/bisect.rst:29 diff --git a/library/colorsys.po b/library/colorsys.po index 80023c1488..a36f25e9d0 100644 --- a/library/colorsys.po +++ b/library/colorsys.po @@ -39,10 +39,10 @@ msgid "" "or negative. In all other spaces, the coordinates are all between 0 and 1." msgstr "" ":mod:`colorsys` 模組 (module) 定義了電腦顯示器所用的 RGB (紅綠藍)色彩空間與" -"三種其他色彩座標系統:YIQ、HLS (色相、亮度、飽和度) 和 HSV (色相、 " -"飽和度、 明度) 所表示的顏色值之間的雙向轉換。所有這些色彩空間的座標都使用" -"浮點數值 (floating point) 來表示。在 YIQ 空間中,Y 座標值為 0 和 1 之間,而 " -"I 和 Q 座標均可以為正數或負數。在所有其他空間中,座標值均為 0 和 1 之間。" +"三種其他色彩座標系統:YIQ、HLS (色相、亮度、飽和度) 和 HSV (色相、 飽和度、 " +"明度) 所表示的顏色值之間的雙向轉換。所有這些色彩空間的座標都使用浮點數值 " +"(floating point) 來表示。在 YIQ 空間中,Y 座標值為 0 和 1 之間,而 I 和 Q 座" +"標均可以為正數或負數。在所有其他空間中,座標值均為 0 和 1 之間。" #: ../../library/colorsys.rst:23 msgid "" diff --git a/library/constants.po b/library/constants.po index 96a30cff11..59e2f6395e 100644 --- a/library/constants.po +++ b/library/constants.po @@ -54,7 +54,8 @@ msgid "" msgstr "" "型別 ``NoneType`` 的唯一值。``None`` 經常被使用來表達缺少值,例如未傳送預設的" "引數至函式時,相對應參數即會被賦予 ``None``。對於 ``None`` 的賦值是不合法的," -"並且會拋出 :exc:`SyntaxError`。``None`` 是型別 :data:`~types.NoneType` 的唯一實例。" +"並且會拋出 :exc:`SyntaxError`。``None`` 是型別 :data:`~types.NoneType` 的唯一" +"實例。" #: ../../library/constants.rst:30 msgid "" @@ -68,11 +69,11 @@ msgid "" "NotImplementedType` type." msgstr "" "會被二元特殊方法 (binary special methods)(如::meth:`~object.__eq__`、:meth:" -"`~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.__lt__`、:meth:`~object.__add__`、:meth:`~object.__rsub__` 等)所回" +"傳的特殊值,代表著該運算沒有針對其他型別的實作。同理也可以被原地二元特殊方法 " +"(in-place binary special methods) (如::meth:`~object.__imul__`、:meth:" +"`~object.__iand__` 等)回傳。它不應該被作為 boolean(布林)來解讀。" +"``NotImplemented`` 是型別 :data:`types.NotImplementedType` 的唯一實例。" #: ../../library/constants.rst:40 msgid "" diff --git a/library/contextlib.po b/library/contextlib.po index e31c9625e1..8bac829d3b 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-20 00:03+0000\n" +"POT-Creation-Date: 2023-11-11 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -261,16 +261,16 @@ msgstr "" #: ../../library/contextlib.rst:307 msgid "" -"If the code within the :keyword:`!with` block raises an :exc:" -"`ExceptionGroup`, suppressed exceptions are removed from the group. If any " -"exceptions in the group are not suppressed, a group containing them is re-" -"raised." +"If the code within the :keyword:`!with` block raises a :exc:" +"`BaseExceptionGroup`, suppressed exceptions are removed from the group. If " +"any exceptions in the group are not suppressed, a group containing them is " +"re-raised." msgstr "" #: ../../library/contextlib.rst:313 msgid "" "``suppress`` now supports suppressing exceptions raised as part of an :exc:" -"`ExceptionGroup`." +"`BaseExceptionGroup`." msgstr "" #: ../../library/contextlib.rst:319 diff --git a/library/datetime.po b/library/datetime.po index d185585c26..789fb08c75 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-03 00:03+0000\n" +"POT-Creation-Date: 2023-11-09 00:04+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-" @@ -74,27 +74,28 @@ msgstr "" msgid "Third-party library with expanded time zone and parsing support." msgstr "" -#: ../../library/datetime.rst:41 +#: ../../library/datetime.rst:42 msgid "Package `DateType `_" msgstr "" #: ../../library/datetime.rst:41 msgid "" -"Third-party library that introduces distinct static types to e.g. allow " -"static type checkers to differentiate between naive and aware datetimes." +"Third-party library that introduces distinct static types to e.g. allow :" +"term:`static type checkers ` to differentiate between " +"naive and aware datetimes." msgstr "" -#: ../../library/datetime.rst:47 +#: ../../library/datetime.rst:48 msgid "Aware and Naive Objects" msgstr "" -#: ../../library/datetime.rst:49 +#: ../../library/datetime.rst:50 msgid "" "Date and time objects may be categorized as \"aware\" or \"naive\" depending " "on whether or not they include timezone information." msgstr "" -#: ../../library/datetime.rst:52 +#: ../../library/datetime.rst:53 msgid "" "With sufficient knowledge of applicable algorithmic and political time " "adjustments, such as time zone and daylight saving time information, an " @@ -103,7 +104,7 @@ msgid "" "interpretation. [#]_" msgstr "" -#: ../../library/datetime.rst:58 +#: ../../library/datetime.rst:59 msgid "" "A **naive** object does not contain enough information to unambiguously " "locate itself relative to other date/time objects. Whether a naive object " @@ -114,7 +115,7 @@ msgid "" "some aspects of reality." msgstr "" -#: ../../library/datetime.rst:65 +#: ../../library/datetime.rst:66 msgid "" "For applications requiring aware objects, :class:`.datetime` and :class:`." "time` objects have an optional time zone information attribute, :attr:`!" @@ -124,7 +125,7 @@ msgid "" "is in effect." msgstr "" -#: ../../library/datetime.rst:71 +#: ../../library/datetime.rst:72 msgid "" "Only one concrete :class:`tzinfo` class, the :class:`timezone` class, is " "supplied by the :mod:`datetime` module. The :class:`timezone` class can " @@ -135,42 +136,42 @@ msgid "" "there is no standard suitable for every application aside from UTC." msgstr "" -#: ../../library/datetime.rst:80 +#: ../../library/datetime.rst:81 msgid "Constants" msgstr "常數" -#: ../../library/datetime.rst:82 +#: ../../library/datetime.rst:83 msgid "The :mod:`datetime` module exports the following constants:" msgstr ":mod:`datetime` 模組匯出以下常數:" -#: ../../library/datetime.rst:86 +#: ../../library/datetime.rst:87 msgid "" "The smallest year number allowed in a :class:`date` or :class:`.datetime` " "object. :const:`MINYEAR` is ``1``." msgstr "" -#: ../../library/datetime.rst:92 +#: ../../library/datetime.rst:93 msgid "" "The largest year number allowed in a :class:`date` or :class:`.datetime` " "object. :const:`MAXYEAR` is ``9999``." msgstr "" -#: ../../library/datetime.rst:97 +#: ../../library/datetime.rst:98 msgid "Alias for the UTC timezone singleton :attr:`datetime.timezone.utc`." msgstr "" -#: ../../library/datetime.rst:102 +#: ../../library/datetime.rst:103 msgid "Available Types" msgstr "" -#: ../../library/datetime.rst:107 +#: ../../library/datetime.rst:108 msgid "" "An idealized naive date, assuming the current Gregorian calendar always was, " "and always will be, in effect. Attributes: :attr:`year`, :attr:`month`, and :" "attr:`day`." msgstr "" -#: ../../library/datetime.rst:115 +#: ../../library/datetime.rst:116 msgid "" "An idealized time, independent of any particular day, assuming that every " "day has exactly 24\\*60\\*60 seconds. (There is no notion of \"leap " @@ -178,14 +179,14 @@ msgid "" "attr:`microsecond`, and :attr:`.tzinfo`." msgstr "" -#: ../../library/datetime.rst:124 +#: ../../library/datetime.rst:125 msgid "" "A combination of a date and a time. Attributes: :attr:`year`, :attr:" "`month`, :attr:`day`, :attr:`hour`, :attr:`minute`, :attr:`second`, :attr:" "`microsecond`, and :attr:`.tzinfo`." msgstr "" -#: ../../library/datetime.rst:132 +#: ../../library/datetime.rst:133 msgid "" "A duration expressing the difference between two :class:`date`, :class:`." "time`, or :class:`.datetime` instances to microsecond resolution." @@ -193,7 +194,7 @@ msgstr "" "表示兩個 :class:`date`、:class:`.time` 或 :class:`.datetime` 實例之間時間的差" "異,以微秒為解析度。" -#: ../../library/datetime.rst:139 +#: ../../library/datetime.rst:140 msgid "" "An abstract base class for time zone information objects. These are used by " "the :class:`.datetime` and :class:`.time` classes to provide a customizable " @@ -201,158 +202,158 @@ msgid "" "daylight saving time)." msgstr "" -#: ../../library/datetime.rst:147 +#: ../../library/datetime.rst:148 msgid "" "A class that implements the :class:`tzinfo` abstract base class as a fixed " "offset from the UTC." msgstr "" -#: ../../library/datetime.rst:152 ../../library/datetime.rst:170 +#: ../../library/datetime.rst:153 ../../library/datetime.rst:171 msgid "Objects of these types are immutable." msgstr "" -#: ../../library/datetime.rst:154 +#: ../../library/datetime.rst:155 msgid "Subclass relationships::" msgstr "" -#: ../../library/datetime.rst:165 +#: ../../library/datetime.rst:166 msgid "Common Properties" msgstr "常見屬性" -#: ../../library/datetime.rst:167 +#: ../../library/datetime.rst:168 msgid "" "The :class:`date`, :class:`.datetime`, :class:`.time`, and :class:`timezone` " "types share these common features:" msgstr "" -#: ../../library/datetime.rst:171 +#: ../../library/datetime.rst:172 msgid "" "Objects of these types are :term:`hashable`, meaning that they can be used " "as dictionary keys." msgstr "" -#: ../../library/datetime.rst:173 +#: ../../library/datetime.rst:174 msgid "" "Objects of these types support efficient pickling via the :mod:`pickle` " "module." msgstr "" -#: ../../library/datetime.rst:176 +#: ../../library/datetime.rst:177 msgid "Determining if an Object is Aware or Naive" msgstr "" -#: ../../library/datetime.rst:178 +#: ../../library/datetime.rst:179 msgid "Objects of the :class:`date` type are always naive." msgstr "" -#: ../../library/datetime.rst:180 +#: ../../library/datetime.rst:181 msgid "" "An object of type :class:`.time` or :class:`.datetime` may be aware or naive." msgstr "" -#: ../../library/datetime.rst:182 +#: ../../library/datetime.rst:183 msgid "A :class:`.datetime` object *d* is aware if both of the following hold:" msgstr "" -#: ../../library/datetime.rst:184 +#: ../../library/datetime.rst:185 msgid "``d.tzinfo`` is not ``None``" msgstr "``d.tzinfo`` 不是 ``None``" -#: ../../library/datetime.rst:185 +#: ../../library/datetime.rst:186 msgid "``d.tzinfo.utcoffset(d)`` does not return ``None``" msgstr "``d.tzinfo.utcoffset(d)`` 不會回傳 ``None``" -#: ../../library/datetime.rst:187 +#: ../../library/datetime.rst:188 msgid "Otherwise, *d* is naive." msgstr "否則 *d* 會是 naive 的。" -#: ../../library/datetime.rst:189 +#: ../../library/datetime.rst:190 msgid "A :class:`.time` object *t* is aware if both of the following hold:" msgstr "" -#: ../../library/datetime.rst:191 +#: ../../library/datetime.rst:192 msgid "``t.tzinfo`` is not ``None``" msgstr "``t.tzinfo`` 不是 ``None``" -#: ../../library/datetime.rst:192 +#: ../../library/datetime.rst:193 msgid "``t.tzinfo.utcoffset(None)`` does not return ``None``." msgstr "``t.tzinfo.utcoffset(None)`` 沒有回傳 ``None``\\ 。" -#: ../../library/datetime.rst:194 +#: ../../library/datetime.rst:195 msgid "Otherwise, *t* is naive." msgstr "" -#: ../../library/datetime.rst:196 +#: ../../library/datetime.rst:197 msgid "" "The distinction between aware and naive doesn't apply to :class:`timedelta` " "objects." msgstr "" -#: ../../library/datetime.rst:202 +#: ../../library/datetime.rst:203 msgid ":class:`timedelta` Objects" msgstr ":class:`timedelta` 物件" -#: ../../library/datetime.rst:204 +#: ../../library/datetime.rst:205 msgid "" "A :class:`timedelta` object represents a duration, the difference between " "two dates or times." msgstr "" "一個 :class:`timedelta` 物件代表著一段持續時間,即兩個日期或時間之間的差異。" -#: ../../library/datetime.rst:209 +#: ../../library/datetime.rst:210 msgid "" "All arguments are optional and default to ``0``. Arguments may be integers " "or floats, and may be positive or negative." msgstr "" -#: ../../library/datetime.rst:212 +#: ../../library/datetime.rst:213 msgid "" "Only *days*, *seconds* and *microseconds* are stored internally. Arguments " "are converted to those units:" msgstr "" -#: ../../library/datetime.rst:215 +#: ../../library/datetime.rst:216 msgid "A millisecond is converted to 1000 microseconds." msgstr "一毫秒會被轉換為 1000 微秒。" -#: ../../library/datetime.rst:216 +#: ../../library/datetime.rst:217 msgid "A minute is converted to 60 seconds." msgstr "一分鐘會被轉換為 60 秒。" -#: ../../library/datetime.rst:217 +#: ../../library/datetime.rst:218 msgid "An hour is converted to 3600 seconds." msgstr "一小時會被轉換為 3600 秒。" -#: ../../library/datetime.rst:218 +#: ../../library/datetime.rst:219 msgid "A week is converted to 7 days." msgstr "一週會被轉換為 7 天。" -#: ../../library/datetime.rst:220 +#: ../../library/datetime.rst:221 msgid "" "and days, seconds and microseconds are then normalized so that the " "representation is unique, with" msgstr "" -#: ../../library/datetime.rst:223 +#: ../../library/datetime.rst:224 msgid "``0 <= microseconds < 1000000``" msgstr "``0 <= microseconds < 1000000``" -#: ../../library/datetime.rst:224 +#: ../../library/datetime.rst:225 msgid "``0 <= seconds < 3600*24`` (the number of seconds in one day)" msgstr "" -#: ../../library/datetime.rst:225 +#: ../../library/datetime.rst:226 msgid "``-999999999 <= days <= 999999999``" msgstr "``-999999999 <= days <= 999999999``" -#: ../../library/datetime.rst:227 +#: ../../library/datetime.rst:228 msgid "" "The following example illustrates how any arguments besides *days*, " "*seconds* and *microseconds* are \"merged\" and normalized into those three " "resulting attributes::" msgstr "" -#: ../../library/datetime.rst:245 +#: ../../library/datetime.rst:246 msgid "" "If any argument is a float and there are fractional microseconds, the " "fractional microseconds left over from all arguments are combined and their " @@ -361,281 +362,281 @@ msgid "" "processes are exact (no information is lost)." msgstr "" -#: ../../library/datetime.rst:252 +#: ../../library/datetime.rst:253 msgid "" "If the normalized value of days lies outside the indicated range, :exc:" "`OverflowError` is raised." msgstr "" -#: ../../library/datetime.rst:255 +#: ../../library/datetime.rst:256 msgid "" "Note that normalization of negative values may be surprising at first. For " "example::" msgstr "" -#: ../../library/datetime.rst:264 ../../library/datetime.rst:560 -#: ../../library/datetime.rst:1073 ../../library/datetime.rst:1692 -#: ../../library/datetime.rst:2294 +#: ../../library/datetime.rst:265 ../../library/datetime.rst:561 +#: ../../library/datetime.rst:1074 ../../library/datetime.rst:1693 +#: ../../library/datetime.rst:2295 msgid "Class attributes:" msgstr "類別屬性:" -#: ../../library/datetime.rst:268 +#: ../../library/datetime.rst:269 msgid "The most negative :class:`timedelta` object, ``timedelta(-999999999)``." msgstr "" -#: ../../library/datetime.rst:273 +#: ../../library/datetime.rst:274 msgid "" "The most positive :class:`timedelta` object, ``timedelta(days=999999999, " "hours=23, minutes=59, seconds=59, microseconds=999999)``." msgstr "" -#: ../../library/datetime.rst:279 +#: ../../library/datetime.rst:280 msgid "" "The smallest possible difference between non-equal :class:`timedelta` " "objects, ``timedelta(microseconds=1)``." msgstr "" -#: ../../library/datetime.rst:282 +#: ../../library/datetime.rst:283 msgid "" "Note that, because of normalization, ``timedelta.max`` > ``-timedelta.min``. " "``-timedelta.max`` is not representable as a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:285 ../../library/datetime.rst:578 -#: ../../library/datetime.rst:1093 ../../library/datetime.rst:1712 +#: ../../library/datetime.rst:286 ../../library/datetime.rst:579 +#: ../../library/datetime.rst:1094 ../../library/datetime.rst:1713 msgid "Instance attributes (read-only):" msgstr "" -#: ../../library/datetime.rst:288 +#: ../../library/datetime.rst:289 msgid "Attribute" msgstr "屬性" -#: ../../library/datetime.rst:288 +#: ../../library/datetime.rst:289 msgid "Value" msgstr "" -#: ../../library/datetime.rst:290 +#: ../../library/datetime.rst:291 msgid "``days``" msgstr "``days``" -#: ../../library/datetime.rst:290 +#: ../../library/datetime.rst:291 msgid "Between -999999999 and 999999999 inclusive" msgstr "" -#: ../../library/datetime.rst:292 +#: ../../library/datetime.rst:293 msgid "``seconds``" msgstr "``seconds``" -#: ../../library/datetime.rst:292 +#: ../../library/datetime.rst:293 msgid "Between 0 and 86399 inclusive" msgstr "在 0 到 86399 (含)之間" -#: ../../library/datetime.rst:294 +#: ../../library/datetime.rst:295 msgid "``microseconds``" msgstr "``microseconds``" -#: ../../library/datetime.rst:294 +#: ../../library/datetime.rst:295 msgid "Between 0 and 999999 inclusive" msgstr "在 0 到 999999 (含)之間" -#: ../../library/datetime.rst:297 ../../library/datetime.rst:595 -#: ../../library/datetime.rst:1146 +#: ../../library/datetime.rst:298 ../../library/datetime.rst:596 +#: ../../library/datetime.rst:1147 msgid "Supported operations:" msgstr "" -#: ../../library/datetime.rst:302 ../../library/datetime.rst:598 -#: ../../library/datetime.rst:1149 +#: ../../library/datetime.rst:303 ../../library/datetime.rst:599 +#: ../../library/datetime.rst:1150 msgid "Operation" msgstr "" -#: ../../library/datetime.rst:302 ../../library/datetime.rst:598 -#: ../../library/datetime.rst:1149 +#: ../../library/datetime.rst:303 ../../library/datetime.rst:599 +#: ../../library/datetime.rst:1150 msgid "Result" msgstr "" -#: ../../library/datetime.rst:304 +#: ../../library/datetime.rst:305 msgid "``t1 = t2 + t3``" msgstr "``t1 = t2 + t3``" -#: ../../library/datetime.rst:304 +#: ../../library/datetime.rst:305 msgid "" "Sum of *t2* and *t3*. Afterwards *t1*-*t2* == *t3* and *t1*-*t3* == *t2* are " "true. (1)" msgstr "" -#: ../../library/datetime.rst:307 +#: ../../library/datetime.rst:308 msgid "``t1 = t2 - t3``" msgstr "``t1 = t2 - t3``" -#: ../../library/datetime.rst:307 +#: ../../library/datetime.rst:308 msgid "" "Difference of *t2* and *t3*. Afterwards *t1* == *t2* - *t3* and *t2* == *t1* " "+ *t3* are true. (1)(6)" msgstr "" -#: ../../library/datetime.rst:311 +#: ../../library/datetime.rst:312 msgid "``t1 = t2 * i or t1 = i * t2``" msgstr "``t1 = t2 * i or t1 = i * t2``" -#: ../../library/datetime.rst:311 +#: ../../library/datetime.rst:312 msgid "" "Delta multiplied by an integer. Afterwards *t1* // i == *t2* is true, " "provided ``i != 0``." msgstr "" -#: ../../library/datetime.rst:315 +#: ../../library/datetime.rst:316 msgid "In general, *t1* \\* i == *t1* \\* (i-1) + *t1* is true. (1)" msgstr "" -#: ../../library/datetime.rst:318 +#: ../../library/datetime.rst:319 msgid "``t1 = t2 * f or t1 = f * t2``" msgstr "``t1 = t2 * f or t1 = f * t2``" -#: ../../library/datetime.rst:318 +#: ../../library/datetime.rst:319 msgid "" "Delta multiplied by a float. The result is rounded to the nearest multiple " "of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:322 +#: ../../library/datetime.rst:323 msgid "``f = t2 / t3``" msgstr "``f = t2 / t3``" -#: ../../library/datetime.rst:322 +#: ../../library/datetime.rst:323 msgid "" "Division (3) of overall duration *t2* by interval unit *t3*. Returns a :" "class:`float` object." msgstr "" -#: ../../library/datetime.rst:326 +#: ../../library/datetime.rst:327 msgid "``t1 = t2 / f or t1 = t2 / i``" msgstr "``t1 = t2 / f or t1 = t2 / i``" -#: ../../library/datetime.rst:326 +#: ../../library/datetime.rst:327 msgid "" "Delta divided by a float or an int. The result is rounded to the nearest " "multiple of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:330 +#: ../../library/datetime.rst:331 msgid "``t1 = t2 // i`` or ``t1 = t2 // t3``" msgstr "``t1 = t2 // i`` or ``t1 = t2 // t3``" -#: ../../library/datetime.rst:330 +#: ../../library/datetime.rst:331 msgid "" "The floor is computed and the remainder (if any) is thrown away. In the " "second case, an integer is returned. (3)" msgstr "" -#: ../../library/datetime.rst:334 +#: ../../library/datetime.rst:335 msgid "``t1 = t2 % t3``" msgstr "``t1 = t2 % t3``" -#: ../../library/datetime.rst:334 +#: ../../library/datetime.rst:335 msgid "The remainder is computed as a :class:`timedelta` object. (3)" msgstr "" -#: ../../library/datetime.rst:337 +#: ../../library/datetime.rst:338 msgid "``q, r = divmod(t1, t2)``" msgstr "``q, r = divmod(t1, t2)``" -#: ../../library/datetime.rst:337 +#: ../../library/datetime.rst:338 msgid "" "Computes the quotient and the remainder: ``q = t1 // t2`` (3) and ``r = t1 % " "t2``. q is an integer and r is a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:342 +#: ../../library/datetime.rst:343 msgid "``+t1``" msgstr "``+t1``" -#: ../../library/datetime.rst:342 +#: ../../library/datetime.rst:343 msgid "Returns a :class:`timedelta` object with the same value. (2)" msgstr "" -#: ../../library/datetime.rst:345 +#: ../../library/datetime.rst:346 msgid "``-t1``" msgstr "``-t1``" -#: ../../library/datetime.rst:345 +#: ../../library/datetime.rst:346 msgid "" "equivalent to :class:`timedelta`\\ (-*t1.days*, -*t1.seconds*, -*t1." "microseconds*), and to *t1*\\* -1. (1)(4)" msgstr "" -#: ../../library/datetime.rst:350 +#: ../../library/datetime.rst:351 msgid "``abs(t)``" msgstr "``abs(t)``" -#: ../../library/datetime.rst:350 +#: ../../library/datetime.rst:351 msgid "" "equivalent to +\\ *t* when ``t.days >= 0``, and to -*t* when ``t.days < 0``. " "(2)" msgstr "" -#: ../../library/datetime.rst:353 +#: ../../library/datetime.rst:354 msgid "``str(t)``" msgstr "``str(t)``" -#: ../../library/datetime.rst:353 +#: ../../library/datetime.rst:354 msgid "" "Returns a string in the form ``[D day[s], ][H]H:MM:SS[.UUUUUU]``, where D is " "negative for negative ``t``. (5)" msgstr "" -#: ../../library/datetime.rst:357 +#: ../../library/datetime.rst:358 msgid "``repr(t)``" msgstr "``repr(t)``" -#: ../../library/datetime.rst:357 +#: ../../library/datetime.rst:358 msgid "" "Returns a string representation of the :class:`timedelta` object as a " "constructor call with canonical attribute values." msgstr "" -#: ../../library/datetime.rst:363 ../../library/datetime.rst:612 -#: ../../library/datetime.rst:2525 +#: ../../library/datetime.rst:364 ../../library/datetime.rst:613 +#: ../../library/datetime.rst:2526 msgid "Notes:" msgstr "註解:" -#: ../../library/datetime.rst:366 +#: ../../library/datetime.rst:367 msgid "This is exact but may overflow." msgstr "這是精確的,但可能會溢位。" -#: ../../library/datetime.rst:369 +#: ../../library/datetime.rst:370 msgid "This is exact and cannot overflow." msgstr "這是精確的,且不會溢位。" -#: ../../library/datetime.rst:372 +#: ../../library/datetime.rst:373 msgid "Division by 0 raises :exc:`ZeroDivisionError`." msgstr "" -#: ../../library/datetime.rst:375 +#: ../../library/datetime.rst:376 msgid "-*timedelta.max* is not representable as a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:378 +#: ../../library/datetime.rst:379 msgid "" "String representations of :class:`timedelta` objects are normalized " "similarly to their internal representation. This leads to somewhat unusual " "results for negative timedeltas. For example::" msgstr "" -#: ../../library/datetime.rst:388 +#: ../../library/datetime.rst:389 msgid "" "The expression ``t2 - t3`` will always be equal to the expression ``t2 + (-" "t3)`` except when t3 is equal to ``timedelta.max``; in that case the former " "will produce a result while the latter will overflow." msgstr "" -#: ../../library/datetime.rst:392 +#: ../../library/datetime.rst:393 msgid "" "In addition to the operations listed above, :class:`timedelta` objects " "support certain additions and subtractions with :class:`date` and :class:`." "datetime` objects (see below)." msgstr "" -#: ../../library/datetime.rst:396 +#: ../../library/datetime.rst:397 msgid "" "Floor division and true division of a :class:`timedelta` object by another :" "class:`timedelta` object are now supported, as are remainder operations and " @@ -643,119 +644,119 @@ msgid "" "`timedelta` object by a :class:`float` object are now supported." msgstr "" -#: ../../library/datetime.rst:403 +#: ../../library/datetime.rst:404 msgid "" "Comparisons of :class:`timedelta` objects are supported, with some caveats." msgstr "" -#: ../../library/datetime.rst:405 +#: ../../library/datetime.rst:406 msgid "" "The comparisons ``==`` or ``!=`` *always* return a :class:`bool`, no matter " "the type of the compared object::" msgstr "" -#: ../../library/datetime.rst:416 +#: ../../library/datetime.rst:417 msgid "" "For all other comparisons (such as ``<`` and ``>``), when a :class:" "`timedelta` object is compared to an object of a different type, :exc:" "`TypeError` is raised::" msgstr "" -#: ../../library/datetime.rst:427 +#: ../../library/datetime.rst:428 msgid "" "In Boolean contexts, a :class:`timedelta` object is considered to be true if " "and only if it isn't equal to ``timedelta(0)``." msgstr "" -#: ../../library/datetime.rst:430 ../../library/datetime.rst:641 -#: ../../library/datetime.rst:1220 ../../library/datetime.rst:1820 +#: ../../library/datetime.rst:431 ../../library/datetime.rst:642 +#: ../../library/datetime.rst:1221 ../../library/datetime.rst:1821 msgid "Instance methods:" msgstr "實例方法:" -#: ../../library/datetime.rst:434 +#: ../../library/datetime.rst:435 msgid "" "Return the total number of seconds contained in the duration. Equivalent to " "``td / timedelta(seconds=1)``. For interval units other than seconds, use " "the division form directly (e.g. ``td / timedelta(microseconds=1)``)." msgstr "" -#: ../../library/datetime.rst:438 +#: ../../library/datetime.rst:439 msgid "" "Note that for very large time intervals (greater than 270 years on most " "platforms) this method will lose microsecond accuracy." msgstr "" -#: ../../library/datetime.rst:444 +#: ../../library/datetime.rst:445 msgid "Examples of usage: :class:`timedelta`" msgstr "用法範例:\\ :class:`timedelta`" -#: ../../library/datetime.rst:446 +#: ../../library/datetime.rst:447 msgid "An additional example of normalization::" msgstr "" -#: ../../library/datetime.rst:458 +#: ../../library/datetime.rst:459 msgid "Examples of :class:`timedelta` arithmetic::" msgstr "" -#: ../../library/datetime.rst:477 +#: ../../library/datetime.rst:478 msgid ":class:`date` Objects" msgstr ":class:`date` 物件" -#: ../../library/datetime.rst:479 +#: ../../library/datetime.rst:480 msgid "" "A :class:`date` object represents a date (year, month and day) in an " "idealized calendar, the current Gregorian calendar indefinitely extended in " "both directions." msgstr "" -#: ../../library/datetime.rst:483 +#: ../../library/datetime.rst:484 msgid "" "January 1 of year 1 is called day number 1, January 2 of year 1 is called " "day number 2, and so on. [#]_" msgstr "" -#: ../../library/datetime.rst:488 +#: ../../library/datetime.rst:489 msgid "" "All arguments are required. Arguments must be integers, in the following " "ranges:" msgstr "" -#: ../../library/datetime.rst:491 +#: ../../library/datetime.rst:492 msgid "``MINYEAR <= year <= MAXYEAR``" msgstr "``MINYEAR <= year <= MAXYEAR``" -#: ../../library/datetime.rst:492 +#: ../../library/datetime.rst:493 msgid "``1 <= month <= 12``" msgstr "``1 <= month <= 12``" -#: ../../library/datetime.rst:493 +#: ../../library/datetime.rst:494 msgid "``1 <= day <= number of days in the given month and year``" msgstr "" -#: ../../library/datetime.rst:495 ../../library/datetime.rst:856 +#: ../../library/datetime.rst:496 ../../library/datetime.rst:857 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:498 ../../library/datetime.rst:861 +#: ../../library/datetime.rst:499 ../../library/datetime.rst:862 msgid "Other constructors, all class methods:" msgstr "" -#: ../../library/datetime.rst:502 +#: ../../library/datetime.rst:503 msgid "Return the current local date." msgstr "回傳目前的本地日期。" -#: ../../library/datetime.rst:504 +#: ../../library/datetime.rst:505 msgid "This is equivalent to ``date.fromtimestamp(time.time())``." msgstr "這等同於 ``date.fromtimestamp(time.time())``。" -#: ../../library/datetime.rst:508 +#: ../../library/datetime.rst:509 msgid "" "Return the local date corresponding to the POSIX timestamp, such as is " "returned by :func:`time.time`." msgstr "" -#: ../../library/datetime.rst:511 +#: ../../library/datetime.rst:512 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " "values supported by the platform C :c:func:`localtime` function, and :exc:" @@ -765,7 +766,7 @@ msgid "" "ignored by :meth:`fromtimestamp`." msgstr "" -#: ../../library/datetime.rst:518 +#: ../../library/datetime.rst:519 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -773,96 +774,96 @@ msgid "" "`localtime` failure." msgstr "" -#: ../../library/datetime.rst:527 +#: ../../library/datetime.rst:528 msgid "" "Return the date corresponding to the proleptic Gregorian ordinal, where " "January 1 of year 1 has ordinal 1." msgstr "" -#: ../../library/datetime.rst:530 +#: ../../library/datetime.rst:531 msgid "" ":exc:`ValueError` is raised unless ``1 <= ordinal <= date.max.toordinal()``. " "For any date *d*, ``date.fromordinal(d.toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:537 +#: ../../library/datetime.rst:538 msgid "" "Return a :class:`date` corresponding to a *date_string* given in any valid " "ISO 8601 format, except ordinal dates (e.g. ``YYYY-DDD``)::" msgstr "" -#: ../../library/datetime.rst:549 +#: ../../library/datetime.rst:550 msgid "Previously, this method only supported the format ``YYYY-MM-DD``." msgstr "" -#: ../../library/datetime.rst:554 +#: ../../library/datetime.rst:555 msgid "" "Return a :class:`date` corresponding to the ISO calendar date specified by " "year, week and day. This is the inverse of the function :meth:`date." "isocalendar`." msgstr "" -#: ../../library/datetime.rst:564 +#: ../../library/datetime.rst:565 msgid "The earliest representable date, ``date(MINYEAR, 1, 1)``." msgstr "" -#: ../../library/datetime.rst:569 +#: ../../library/datetime.rst:570 msgid "The latest representable date, ``date(MAXYEAR, 12, 31)``." msgstr "" -#: ../../library/datetime.rst:574 +#: ../../library/datetime.rst:575 msgid "" "The smallest possible difference between non-equal date objects, " "``timedelta(days=1)``." msgstr "" -#: ../../library/datetime.rst:582 ../../library/datetime.rst:1097 +#: ../../library/datetime.rst:583 ../../library/datetime.rst:1098 msgid "Between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:587 ../../library/datetime.rst:1102 +#: ../../library/datetime.rst:588 ../../library/datetime.rst:1103 msgid "Between 1 and 12 inclusive." msgstr "在 1 到 12 (含)之間。" -#: ../../library/datetime.rst:592 ../../library/datetime.rst:1107 +#: ../../library/datetime.rst:593 ../../library/datetime.rst:1108 msgid "Between 1 and the number of days in the given month of the given year." msgstr "" -#: ../../library/datetime.rst:600 +#: ../../library/datetime.rst:601 msgid "``date2 = date1 + timedelta``" msgstr "``date2 = date1 + timedelta``" -#: ../../library/datetime.rst:600 +#: ../../library/datetime.rst:601 msgid "*date2* will be ``timedelta.days`` days after *date1*. (1)" msgstr "" -#: ../../library/datetime.rst:603 +#: ../../library/datetime.rst:604 msgid "``date2 = date1 - timedelta``" msgstr "``date2 = date1 - timedelta``" -#: ../../library/datetime.rst:603 +#: ../../library/datetime.rst:604 msgid "Computes *date2* such that ``date2 + timedelta == date1``. (2)" msgstr "" -#: ../../library/datetime.rst:606 +#: ../../library/datetime.rst:607 msgid "``timedelta = date1 - date2``" msgstr "``timedelta = date1 - date2``" -#: ../../library/datetime.rst:606 ../../library/datetime.rst:1155 +#: ../../library/datetime.rst:607 ../../library/datetime.rst:1156 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/datetime.rst:608 +#: ../../library/datetime.rst:609 msgid "``date1 < date2``" msgstr "``date1 < date2``" -#: ../../library/datetime.rst:608 +#: ../../library/datetime.rst:609 msgid "" "*date1* is considered less than *date2* when *date1* precedes *date2* in " "time. (4)" msgstr "" -#: ../../library/datetime.rst:615 +#: ../../library/datetime.rst:616 msgid "" "*date2* is moved forward in time if ``timedelta.days > 0``, or backward if " "``timedelta.days < 0``. Afterward ``date2 - date1 == timedelta.days``. " @@ -871,17 +872,17 @@ msgid "" "`MINYEAR` or larger than :const:`MAXYEAR`." msgstr "" -#: ../../library/datetime.rst:622 +#: ../../library/datetime.rst:623 msgid "``timedelta.seconds`` and ``timedelta.microseconds`` are ignored." msgstr "``timedelta.seconds`` 和 ``timedelta.microseconds`` 被忽略。" -#: ../../library/datetime.rst:625 +#: ../../library/datetime.rst:626 msgid "" "This is exact, and cannot overflow. timedelta.seconds and timedelta." "microseconds are 0, and date2 + timedelta == date1 after." msgstr "" -#: ../../library/datetime.rst:629 +#: ../../library/datetime.rst:630 msgid "" "In other words, ``date1 < date2`` if and only if ``date1.toordinal() < date2." "toordinal()``. Date comparison raises :exc:`TypeError` if the other " @@ -894,56 +895,56 @@ msgid "" "`True`, respectively." msgstr "" -#: ../../library/datetime.rst:639 +#: ../../library/datetime.rst:640 msgid "" "In Boolean contexts, all :class:`date` objects are considered to be true." msgstr "" -#: ../../library/datetime.rst:645 +#: ../../library/datetime.rst:646 msgid "" "Return a date with the same value, except for those parameters given new " "values by whichever keyword arguments are specified." msgstr "" -#: ../../library/datetime.rst:648 ../../library/datetime.rst:1863 +#: ../../library/datetime.rst:649 ../../library/datetime.rst:1864 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/datetime.rst:658 ../../library/datetime.rst:1333 +#: ../../library/datetime.rst:659 ../../library/datetime.rst:1334 msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." "localtime`." msgstr "" "回傳一個 :class:`time.struct_time`,如同 :func:`time.localtime` 所回傳。" -#: ../../library/datetime.rst:660 +#: ../../library/datetime.rst:661 msgid "The hours, minutes and seconds are 0, and the DST flag is -1." msgstr "" -#: ../../library/datetime.rst:662 ../../library/datetime.rst:1335 +#: ../../library/datetime.rst:663 ../../library/datetime.rst:1336 msgid "``d.timetuple()`` is equivalent to::" msgstr "" "``d.timetuple()`` 等價於:\n" "\n" "::" -#: ../../library/datetime.rst:666 +#: ../../library/datetime.rst:667 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." msgstr "" -#: ../../library/datetime.rst:672 +#: ../../library/datetime.rst:673 msgid "" "Return the proleptic Gregorian ordinal of the date, where January 1 of year " "1 has ordinal 1. For any :class:`date` object *d*, ``date.fromordinal(d." "toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:679 +#: ../../library/datetime.rst:680 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "For example, ``date(2002, 12, 4).weekday() == 2``, a Wednesday. See also :" @@ -952,25 +953,25 @@ msgstr "" "回傳一個代表星期幾的整數,星期一為 0、星期日為 6。例如 ``date(2002, 12, 4)." "weekday() == 2`` 為星期三。也請參考 :meth:`isoweekday`。" -#: ../../library/datetime.rst:686 +#: ../../library/datetime.rst:687 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "For example, ``date(2002, 12, 4).isoweekday() == 3``, a Wednesday. See also :" "meth:`weekday`, :meth:`isocalendar`." msgstr "" -#: ../../library/datetime.rst:693 +#: ../../library/datetime.rst:694 msgid "" "Return a :term:`named tuple` object with three components: ``year``, " "``week`` and ``weekday``." msgstr "" -#: ../../library/datetime.rst:696 +#: ../../library/datetime.rst:697 msgid "" "The ISO calendar is a widely used variant of the Gregorian calendar. [#]_" msgstr "" -#: ../../library/datetime.rst:698 +#: ../../library/datetime.rst:699 msgid "" "The ISO year consists of 52 or 53 full weeks, and where a week starts on a " "Monday and ends on a Sunday. The first week of an ISO year is the first " @@ -979,17 +980,17 @@ msgid "" "Gregorian year." msgstr "" -#: ../../library/datetime.rst:703 +#: ../../library/datetime.rst:704 msgid "" "For example, 2004 begins on a Thursday, so the first week of ISO year 2004 " "begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004::" msgstr "" -#: ../../library/datetime.rst:712 +#: ../../library/datetime.rst:713 msgid "Result changed from a tuple to a :term:`named tuple`." msgstr "" -#: ../../library/datetime.rst:717 +#: ../../library/datetime.rst:718 msgid "" "Return a string representing the date in ISO 8601 format, ``YYYY-MM-DD``::" msgstr "" @@ -997,29 +998,29 @@ msgstr "" "\n" "::" -#: ../../library/datetime.rst:725 +#: ../../library/datetime.rst:726 msgid "For a date *d*, ``str(d)`` is equivalent to ``d.isoformat()``." msgstr "" -#: ../../library/datetime.rst:730 +#: ../../library/datetime.rst:731 msgid "Return a string representing the date::" msgstr "" -#: ../../library/datetime.rst:736 ../../library/datetime.rst:1519 +#: ../../library/datetime.rst:737 ../../library/datetime.rst:1520 msgid "``d.ctime()`` is equivalent to::" msgstr "" "``d.ctime()`` 等價於:\n" "\n" "::" -#: ../../library/datetime.rst:740 +#: ../../library/datetime.rst:741 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`date.ctime` does not invoke) conforms to " "the C standard." msgstr "" -#: ../../library/datetime.rst:747 +#: ../../library/datetime.rst:748 msgid "" "Return a string representing the date, controlled by an explicit format " "string. Format codes referring to hours, minutes or seconds will see 0 " @@ -1027,7 +1028,7 @@ msgid "" "isoformat`." msgstr "" -#: ../../library/datetime.rst:754 +#: ../../library/datetime.rst:755 msgid "" "Same as :meth:`.date.strftime`. This makes it possible to specify a format " "string for a :class:`.date` object in :ref:`formatted string literals 0, or backward if ``timedelta.days`` < 0. " @@ -1457,7 +1458,7 @@ msgid "" "the input is an aware object." msgstr "" -#: ../../library/datetime.rst:1171 +#: ../../library/datetime.rst:1172 msgid "" "Computes the datetime2 such that datetime2 + timedelta == datetime1. As for " "addition, the result has the same :attr:`~.datetime.tzinfo` attribute as the " @@ -1465,14 +1466,14 @@ msgid "" "aware." msgstr "" -#: ../../library/datetime.rst:1176 +#: ../../library/datetime.rst:1177 msgid "" "Subtraction of a :class:`.datetime` from a :class:`.datetime` is defined " "only if both operands are naive, or if both are aware. If one is aware and " "the other is naive, :exc:`TypeError` is raised." msgstr "" -#: ../../library/datetime.rst:1180 +#: ../../library/datetime.rst:1181 msgid "" "If both are naive, or both are aware and have the same :attr:`~.datetime." "tzinfo` attribute, the :attr:`~.datetime.tzinfo` attributes are ignored, and " @@ -1480,7 +1481,7 @@ msgid "" "datetime1``. No time zone adjustments are done in this case." msgstr "" -#: ../../library/datetime.rst:1185 +#: ../../library/datetime.rst:1186 msgid "" "If both are aware and have different :attr:`~.datetime.tzinfo` attributes, " "``a-b`` acts as if *a* and *b* were first converted to naive UTC datetimes " @@ -1489,20 +1490,20 @@ msgid "" "overflows." msgstr "" -#: ../../library/datetime.rst:1191 +#: ../../library/datetime.rst:1192 msgid "" "*datetime1* is considered less than *datetime2* when *datetime1* precedes " "*datetime2* in time." msgstr "" -#: ../../library/datetime.rst:1194 +#: ../../library/datetime.rst:1195 msgid "" "If one comparand is naive and the other is aware, :exc:`TypeError` is raised " "if an order comparison is attempted. For equality comparisons, naive " "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1198 +#: ../../library/datetime.rst:1199 msgid "" "If both comparands are aware, and have the same :attr:`~.datetime.tzinfo` " "attribute, the common :attr:`~.datetime.tzinfo` attribute is ignored and the " @@ -1512,13 +1513,13 @@ msgid "" "utcoffset()``)." msgstr "" -#: ../../library/datetime.rst:1204 +#: ../../library/datetime.rst:1205 msgid "" "Equality comparisons between aware and naive :class:`.datetime` instances " "don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1210 +#: ../../library/datetime.rst:1211 msgid "" "In order to stop comparison from falling back to the default scheme of " "comparing object addresses, datetime comparison normally raises :exc:" @@ -1531,27 +1532,27 @@ msgid "" "cases return :const:`False` or :const:`True`, respectively." msgstr "" -#: ../../library/datetime.rst:1224 +#: ../../library/datetime.rst:1225 msgid "Return :class:`date` object with same year, month and day." msgstr "" -#: ../../library/datetime.rst:1229 +#: ../../library/datetime.rst:1230 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:1232 ../../library/datetime.rst:1241 +#: ../../library/datetime.rst:1233 ../../library/datetime.rst:1242 msgid "The fold value is copied to the returned :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:1238 +#: ../../library/datetime.rst:1239 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond, " "fold, and tzinfo attributes. See also method :meth:`time`." msgstr "" -#: ../../library/datetime.rst:1249 +#: ../../library/datetime.rst:1250 msgid "" "Return a datetime with the same attributes, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1559,21 +1560,21 @@ msgid "" "datetime with no conversion of date and time data." msgstr "" -#: ../../library/datetime.rst:1260 +#: ../../library/datetime.rst:1261 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:1264 +#: ../../library/datetime.rst:1265 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:1268 +#: ../../library/datetime.rst:1269 msgid "" "If called without arguments (or with ``tz=None``) the system local timezone " "is assumed for the target timezone. The ``.tzinfo`` attribute of the " @@ -1581,7 +1582,7 @@ msgid "" "with the zone name and offset obtained from the OS." msgstr "" -#: ../../library/datetime.rst:1273 +#: ../../library/datetime.rst:1274 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 " @@ -1590,7 +1591,7 @@ msgid "" "date and time data as ``dt - dt.utcoffset()``." msgstr "" -#: ../../library/datetime.rst:1279 +#: ../../library/datetime.rst:1280 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 " @@ -1598,56 +1599,56 @@ msgid "" "without conversion of date and time data, use ``dt.replace(tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1284 +#: ../../library/datetime.rst:1285 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:1296 +#: ../../library/datetime.rst:1297 msgid "*tz* now can be omitted." msgstr "" -#: ../../library/datetime.rst:1299 +#: ../../library/datetime.rst:1300 msgid "" "The :meth:`astimezone` method can now be called on naive instances that are " "presumed to represent system local time." msgstr "" -#: ../../library/datetime.rst:1306 +#: ../../library/datetime.rst:1307 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:1310 ../../library/datetime.rst:1903 -#: ../../library/datetime.rst:2009 ../../library/datetime.rst:2254 -#: ../../library/datetime.rst:2266 ../../library/datetime.rst:2578 +#: ../../library/datetime.rst:1311 ../../library/datetime.rst:1904 +#: ../../library/datetime.rst:2010 ../../library/datetime.rst:2255 +#: ../../library/datetime.rst:2267 ../../library/datetime.rst:2579 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1316 +#: ../../library/datetime.rst:1317 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:1320 ../../library/datetime.rst:1913 -#: ../../library/datetime.rst:2063 +#: ../../library/datetime.rst:1321 ../../library/datetime.rst:1914 +#: ../../library/datetime.rst:2064 msgid "The DST offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1326 +#: ../../library/datetime.rst:1327 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:1341 +#: ../../library/datetime.rst:1342 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 :" @@ -1657,14 +1658,14 @@ msgid "" "attr:`tm_isdst` is set to ``1``; else :attr:`tm_isdst` is set to ``0``." msgstr "" -#: ../../library/datetime.rst:1352 +#: ../../library/datetime.rst:1353 msgid "" "If :class:`.datetime` instance *d* is naive, this is the same as ``d." "timetuple()`` except that :attr:`tm_isdst` is forced to 0 regardless of what " "``d.dst()`` returns. DST is never in effect for a UTC time." msgstr "" -#: ../../library/datetime.rst:1356 +#: ../../library/datetime.rst:1357 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 " @@ -1673,7 +1674,7 @@ msgid "" "spills over a year boundary." msgstr "" -#: ../../library/datetime.rst:1365 +#: ../../library/datetime.rst:1366 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 " @@ -1683,20 +1684,20 @@ msgid "" "meth:`.datetime.timetuple`." msgstr "" -#: ../../library/datetime.rst:1374 +#: ../../library/datetime.rst:1375 msgid "" "Return the proleptic Gregorian ordinal of the date. The same as ``self." "date().toordinal()``." msgstr "" -#: ../../library/datetime.rst:1379 +#: ../../library/datetime.rst:1380 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:1383 +#: ../../library/datetime.rst:1384 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 " @@ -1706,18 +1707,18 @@ msgid "" "future." msgstr "" -#: ../../library/datetime.rst:1390 +#: ../../library/datetime.rst:1391 msgid "" "For aware :class:`.datetime` instances, the return value is computed as::" msgstr "" -#: ../../library/datetime.rst:1397 +#: ../../library/datetime.rst:1398 msgid "" "The :meth:`timestamp` method uses the :attr:`.fold` attribute to " "disambiguate the times during a repeated interval." msgstr "" -#: ../../library/datetime.rst:1403 +#: ../../library/datetime.rst:1404 msgid "" "There is no method to obtain the POSIX timestamp directly from a naive :" "class:`.datetime` instance representing UTC time. If your application uses " @@ -1725,49 +1726,49 @@ msgid "" "the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" -#: ../../library/datetime.rst:1411 +#: ../../library/datetime.rst:1412 msgid "or by calculating the timestamp directly::" msgstr "" -#: ../../library/datetime.rst:1417 +#: ../../library/datetime.rst:1418 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:1423 +#: ../../library/datetime.rst:1424 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:1430 +#: ../../library/datetime.rst:1431 msgid "" "Return a :term:`named tuple` with three components: ``year``, ``week`` and " "``weekday``. The same as ``self.date().isocalendar()``." msgstr "" -#: ../../library/datetime.rst:1436 +#: ../../library/datetime.rst:1437 msgid "Return a string representing the date and time in ISO 8601 format:" msgstr "" -#: ../../library/datetime.rst:1438 +#: ../../library/datetime.rst:1439 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:1439 +#: ../../library/datetime.rst:1440 msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" msgstr "``YYYY-MM-DDTHH:MM:SS``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1441 +#: ../../library/datetime.rst:1442 msgid "" "If :meth:`utcoffset` does not return ``None``, a string is appended, giving " "the UTC offset:" msgstr "" "如果 :meth:`utcoffset` 没有回傳 ``None``,則會附加一个字串,給出 UTC 偏移:" -#: ../../library/datetime.rst:1444 +#: ../../library/datetime.rst:1445 msgid "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " "is not 0" @@ -1775,99 +1776,99 @@ msgstr "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` " "不是 0" -#: ../../library/datetime.rst:1446 +#: ../../library/datetime.rst:1447 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:1456 +#: ../../library/datetime.rst:1457 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:1470 ../../library/datetime.rst:1843 +#: ../../library/datetime.rst:1471 ../../library/datetime.rst:1844 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:1474 ../../library/datetime.rst:1847 +#: ../../library/datetime.rst:1475 ../../library/datetime.rst:1848 msgid "" "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " "``'microseconds'`` otherwise." msgstr "" -#: ../../library/datetime.rst:1476 ../../library/datetime.rst:1849 +#: ../../library/datetime.rst:1477 ../../library/datetime.rst:1850 msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." msgstr "" -#: ../../library/datetime.rst:1477 ../../library/datetime.rst:1850 +#: ../../library/datetime.rst:1478 ../../library/datetime.rst:1851 msgid "" "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." msgstr "" -#: ../../library/datetime.rst:1478 ../../library/datetime.rst:1851 +#: ../../library/datetime.rst:1479 ../../library/datetime.rst:1852 msgid "" "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " "``HH:MM:SS`` format." msgstr "" -#: ../../library/datetime.rst:1480 ../../library/datetime.rst:1853 +#: ../../library/datetime.rst:1481 ../../library/datetime.rst:1854 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" -#: ../../library/datetime.rst:1482 ../../library/datetime.rst:1855 +#: ../../library/datetime.rst:1483 ../../library/datetime.rst:1856 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" -#: ../../library/datetime.rst:1486 ../../library/datetime.rst:1859 +#: ../../library/datetime.rst:1487 ../../library/datetime.rst:1860 msgid "Excluded time components are truncated, not rounded." msgstr "" -#: ../../library/datetime.rst:1488 +#: ../../library/datetime.rst:1489 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" -#: ../../library/datetime.rst:1498 ../../library/datetime.rst:1874 +#: ../../library/datetime.rst:1499 ../../library/datetime.rst:1875 msgid "Added the *timespec* argument." msgstr "新增 *timespec* 引數。" -#: ../../library/datetime.rst:1504 +#: ../../library/datetime.rst:1505 msgid "" "For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" -#: ../../library/datetime.rst:1510 +#: ../../library/datetime.rst:1511 msgid "Return a string representing the date and time::" msgstr "" -#: ../../library/datetime.rst:1516 +#: ../../library/datetime.rst:1517 msgid "" "The output string will *not* include time zone information, regardless of " "whether the input is aware or naive." msgstr "" -#: ../../library/datetime.rst:1523 +#: ../../library/datetime.rst:1524 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:1530 +#: ../../library/datetime.rst:1531 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:1537 +#: ../../library/datetime.rst:1538 msgid "" "Same as :meth:`.datetime.strftime`. This makes it possible to specify a " "format string for a :class:`.datetime` object in :ref:`formatted string " @@ -1875,70 +1876,70 @@ msgid "" "`strftime-strptime-behavior` and :meth:`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1544 +#: ../../library/datetime.rst:1545 msgid "Examples of Usage: :class:`.datetime`" msgstr "" -#: ../../library/datetime.rst:1546 +#: ../../library/datetime.rst:1547 msgid "Examples of working with :class:`~datetime.datetime` objects:" msgstr "" -#: ../../library/datetime.rst:1599 +#: ../../library/datetime.rst:1600 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:1646 +#: ../../library/datetime.rst:1647 msgid "Usage of ``KabulTz`` from above::" msgstr "" -#: ../../library/datetime.rst:1672 +#: ../../library/datetime.rst:1673 msgid ":class:`.time` Objects" msgstr ":class:`.time` 物件" -#: ../../library/datetime.rst:1674 +#: ../../library/datetime.rst:1675 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:1679 +#: ../../library/datetime.rst:1680 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:1689 +#: ../../library/datetime.rst:1690 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:1697 +#: ../../library/datetime.rst:1698 msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." msgstr "" -#: ../../library/datetime.rst:1702 +#: ../../library/datetime.rst:1703 msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." msgstr "" -#: ../../library/datetime.rst:1707 +#: ../../library/datetime.rst:1708 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:1736 +#: ../../library/datetime.rst:1737 msgid "" "The object passed as the tzinfo argument to the :class:`.time` constructor, " "or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1750 +#: ../../library/datetime.rst:1751 msgid "" ":class:`.time` objects support comparison of :class:`.time` to :class:`." "time`, where *a* is considered less than *b* when *a* precedes *b* in time. " @@ -1947,7 +1948,7 @@ msgid "" "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1756 +#: ../../library/datetime.rst:1757 msgid "" "If both comparands are aware, and have the same :attr:`~time.tzinfo` " "attribute, the common :attr:`~time.tzinfo` attribute is ignored and the base " @@ -1961,18 +1962,18 @@ msgid "" "respectively." msgstr "" -#: ../../library/datetime.rst:1766 +#: ../../library/datetime.rst:1767 msgid "" "Equality comparisons between aware and naive :class:`~datetime.time` " "instances don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1770 +#: ../../library/datetime.rst:1771 msgid "" "In Boolean contexts, a :class:`.time` object is always considered to be true." msgstr "" -#: ../../library/datetime.rst:1772 +#: ../../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-" @@ -1980,35 +1981,35 @@ msgid "" "details." msgstr "" -#: ../../library/datetime.rst:1779 +#: ../../library/datetime.rst:1780 msgid "Other constructor:" msgstr "" -#: ../../library/datetime.rst:1783 +#: ../../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:1787 +#: ../../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:1789 +#: ../../library/datetime.rst:1790 msgid "" "Fractional seconds may have any number of digits (anything beyond 6 will be " "truncated)." msgstr "" -#: ../../library/datetime.rst:1815 +#: ../../library/datetime.rst:1816 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`time.isoformat()`." msgstr "" -#: ../../library/datetime.rst:1825 +#: ../../library/datetime.rst:1826 msgid "" "Return a :class:`.time` with the same value, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -2016,46 +2017,46 @@ msgid "" "aware :class:`.time`, without conversion of the time data." msgstr "" -#: ../../library/datetime.rst:1836 +#: ../../library/datetime.rst:1837 msgid "Return a string representing the time in ISO 8601 format, one of:" msgstr "" -#: ../../library/datetime.rst:1838 +#: ../../library/datetime.rst:1839 msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1839 +#: ../../library/datetime.rst:1840 msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1840 +#: ../../library/datetime.rst:1841 msgid "" "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " "return ``None``" msgstr "" -#: ../../library/datetime.rst:1841 +#: ../../library/datetime.rst:1842 msgid "" "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" "`utcoffset` does not return ``None``" msgstr "" -#: ../../library/datetime.rst:1861 +#: ../../library/datetime.rst:1862 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "" -#: ../../library/datetime.rst:1880 +#: ../../library/datetime.rst:1881 msgid "For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" -#: ../../library/datetime.rst:1885 +#: ../../library/datetime.rst:1886 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:1891 +#: ../../library/datetime.rst:1892 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:2146 +#: ../../library/datetime.rst:2147 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 " @@ -2325,7 +2326,7 @@ msgid "" "ends the minute after 1:59 (EDT) on the first Sunday in November::" msgstr "" -#: ../../library/datetime.rst:2160 +#: ../../library/datetime.rst:2161 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, " @@ -2334,7 +2335,7 @@ msgid "" "get::" msgstr "" -#: ../../library/datetime.rst:2179 +#: ../../library/datetime.rst:2180 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 " @@ -2349,13 +2350,13 @@ msgid "" "transition of 2016, we get::" msgstr "" -#: ../../library/datetime.rst:2201 +#: ../../library/datetime.rst:2202 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:2204 +#: ../../library/datetime.rst:2205 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " "the value of the :attr:`~datetime.fold` attribute or avoid using hybrid :" @@ -2365,28 +2366,28 @@ msgid "" "offset -4 hours))." msgstr "" -#: ../../library/datetime.rst:2218 +#: ../../library/datetime.rst:2219 msgid ":mod:`zoneinfo`" msgstr ":mod:`zoneinfo`" -#: ../../library/datetime.rst:2213 +#: ../../library/datetime.rst:2214 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:2217 +#: ../../library/datetime.rst:2218 msgid "" "``zoneinfo`` brings the *IANA timezone database* (also known as the Olson " "database) to Python, and its usage is recommended." msgstr "" -#: ../../library/datetime.rst:2224 +#: ../../library/datetime.rst:2225 msgid "`IANA timezone database `_" msgstr "`IANA 時區資料庫 `_" -#: ../../library/datetime.rst:2221 +#: ../../library/datetime.rst:2222 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 " @@ -2395,24 +2396,24 @@ msgid "" "saving rules." msgstr "" -#: ../../library/datetime.rst:2231 +#: ../../library/datetime.rst:2232 msgid ":class:`timezone` Objects" msgstr ":class:`timezone` 物件" -#: ../../library/datetime.rst:2233 +#: ../../library/datetime.rst:2234 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:2237 +#: ../../library/datetime.rst:2238 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:2244 +#: ../../library/datetime.rst:2245 msgid "" "The *offset* argument must be specified as a :class:`timedelta` object " "representing the difference between the local time and UTC. It must be " @@ -2420,25 +2421,25 @@ msgid "" "otherwise :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:2249 +#: ../../library/datetime.rst:2250 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:2260 ../../library/datetime.rst:2271 +#: ../../library/datetime.rst:2261 ../../library/datetime.rst:2272 msgid "" "Return the fixed value specified when the :class:`timezone` instance is " "constructed." msgstr "" -#: ../../library/datetime.rst:2263 +#: ../../library/datetime.rst:2264 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:2274 +#: ../../library/datetime.rst:2275 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 " @@ -2447,144 +2448,144 @@ msgid "" "are two digits of ``offset.hours`` and ``offset.minutes`` respectively." msgstr "" -#: ../../library/datetime.rst:2280 +#: ../../library/datetime.rst:2281 msgid "" "Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not " "``'UTC+00:00'``." msgstr "" -#: ../../library/datetime.rst:2287 +#: ../../library/datetime.rst:2288 msgid "Always returns ``None``." msgstr "" -#: ../../library/datetime.rst:2291 +#: ../../library/datetime.rst:2292 msgid "" "Return ``dt + offset``. The *dt* argument must be an aware :class:`." "datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" -#: ../../library/datetime.rst:2298 +#: ../../library/datetime.rst:2299 msgid "The UTC timezone, ``timezone(timedelta(0))``." msgstr "" -#: ../../library/datetime.rst:2307 +#: ../../library/datetime.rst:2308 msgid ":meth:`strftime` and :meth:`strptime` Behavior" msgstr ":meth:`strftime` 與 :meth:`strptime` 的行為" -#: ../../library/datetime.rst:2309 +#: ../../library/datetime.rst:2310 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:2313 +#: ../../library/datetime.rst:2314 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:2317 +#: ../../library/datetime.rst:2318 msgid "" "The table below provides a high-level comparison of :meth:`strftime` versus :" "meth:`strptime`:" msgstr "" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2322 msgid "``strftime``" msgstr "``strftime``" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2322 msgid "``strptime``" msgstr "``strptime``" -#: ../../library/datetime.rst:2323 +#: ../../library/datetime.rst:2324 msgid "Usage" msgstr "用法" -#: ../../library/datetime.rst:2323 +#: ../../library/datetime.rst:2324 msgid "Convert object to a string according to a given format" msgstr "" -#: ../../library/datetime.rst:2323 +#: ../../library/datetime.rst:2324 msgid "" "Parse a string into a :class:`.datetime` object given a corresponding format" msgstr "" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2326 msgid "Type of method" msgstr "" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2326 msgid "Instance method" msgstr "實例方法" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2326 msgid "Class method" msgstr "類別方法" -#: ../../library/datetime.rst:2327 +#: ../../library/datetime.rst:2328 msgid "Method of" msgstr "" -#: ../../library/datetime.rst:2327 +#: ../../library/datetime.rst:2328 msgid ":class:`date`; :class:`.datetime`; :class:`.time`" msgstr "" -#: ../../library/datetime.rst:2327 +#: ../../library/datetime.rst:2328 msgid ":class:`.datetime`" msgstr ":class:`.datetime`" -#: ../../library/datetime.rst:2329 +#: ../../library/datetime.rst:2330 msgid "Signature" msgstr "" -#: ../../library/datetime.rst:2329 +#: ../../library/datetime.rst:2330 msgid "``strftime(format)``" msgstr "``strftime(format)``" -#: ../../library/datetime.rst:2329 +#: ../../library/datetime.rst:2330 msgid "``strptime(date_string, format)``" msgstr "``strptime(date_string, format)``" -#: ../../library/datetime.rst:2336 +#: ../../library/datetime.rst:2337 msgid ":meth:`strftime` and :meth:`strptime` Format Codes" msgstr "" -#: ../../library/datetime.rst:2338 +#: ../../library/datetime.rst:2339 msgid "" "These methods accept format codes that can be used to parse and format " "dates::" msgstr "" -#: ../../library/datetime.rst:2346 +#: ../../library/datetime.rst:2347 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:2350 ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2351 ../../library/datetime.rst:2454 msgid "Directive" msgstr "" -#: ../../library/datetime.rst:2350 ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2351 ../../library/datetime.rst:2454 msgid "Meaning" msgstr "" -#: ../../library/datetime.rst:2350 ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2351 ../../library/datetime.rst:2454 msgid "Example" msgstr "範例" -#: ../../library/datetime.rst:2350 ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2351 ../../library/datetime.rst:2454 msgid "Notes" msgstr "註解" -#: ../../library/datetime.rst:2352 +#: ../../library/datetime.rst:2353 msgid "``%a``" msgstr "``%a``" -#: ../../library/datetime.rst:2352 +#: ../../library/datetime.rst:2353 msgid "Weekday as locale's abbreviated name." msgstr "" @@ -2596,11 +2597,11 @@ msgstr "" msgid "So, Mo, ..., Sa (de_DE)" msgstr "" -#: ../../library/datetime.rst:2357 +#: ../../library/datetime.rst:2358 msgid "``%A``" msgstr "``%A``" -#: ../../library/datetime.rst:2357 +#: ../../library/datetime.rst:2358 msgid "Weekday as locale's full name." msgstr "" @@ -2612,42 +2613,42 @@ msgstr "" msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" -#: ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:2363 msgid "``%w``" msgstr "``%w``" -#: ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:2363 msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." msgstr "" -#: ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:2363 msgid "0, 1, ..., 6" msgstr "0, 1, ..., 6" -#: ../../library/datetime.rst:2366 +#: ../../library/datetime.rst:2367 msgid "``%d``" msgstr "``%d``" -#: ../../library/datetime.rst:2366 +#: ../../library/datetime.rst:2367 msgid "Day of the month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2366 +#: ../../library/datetime.rst:2367 msgid "01, 02, ..., 31" msgstr "01, 02, ..., 31" -#: ../../library/datetime.rst:2366 ../../library/datetime.rst:2379 -#: ../../library/datetime.rst:2382 ../../library/datetime.rst:2388 -#: ../../library/datetime.rst:2391 ../../library/datetime.rst:2397 -#: ../../library/datetime.rst:2415 +#: ../../library/datetime.rst:2367 ../../library/datetime.rst:2380 +#: ../../library/datetime.rst:2383 ../../library/datetime.rst:2389 +#: ../../library/datetime.rst:2392 ../../library/datetime.rst:2398 +#: ../../library/datetime.rst:2416 msgid "\\(9)" msgstr "\\(9)" -#: ../../library/datetime.rst:2369 +#: ../../library/datetime.rst:2370 msgid "``%b``" msgstr "``%b``" -#: ../../library/datetime.rst:2369 +#: ../../library/datetime.rst:2370 msgid "Month as locale's abbreviated name." msgstr "" @@ -2659,11 +2660,11 @@ msgstr "" msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" -#: ../../library/datetime.rst:2374 +#: ../../library/datetime.rst:2375 msgid "``%B``" msgstr "``%B``" -#: ../../library/datetime.rst:2374 +#: ../../library/datetime.rst:2375 msgid "Month as locale's full name." msgstr "" @@ -2675,67 +2676,67 @@ msgstr "" msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" -#: ../../library/datetime.rst:2379 +#: ../../library/datetime.rst:2380 msgid "``%m``" msgstr "``%m``" -#: ../../library/datetime.rst:2379 +#: ../../library/datetime.rst:2380 msgid "Month as a zero-padded decimal number." msgstr "以零填充的並以十進位數字表示的月份。" -#: ../../library/datetime.rst:2379 ../../library/datetime.rst:2391 +#: ../../library/datetime.rst:2380 ../../library/datetime.rst:2392 msgid "01, 02, ..., 12" msgstr "01, 02, ..., 12" -#: ../../library/datetime.rst:2382 +#: ../../library/datetime.rst:2383 msgid "``%y``" msgstr "``%y``" -#: ../../library/datetime.rst:2382 +#: ../../library/datetime.rst:2383 msgid "Year without century as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2382 +#: ../../library/datetime.rst:2383 msgid "00, 01, ..., 99" msgstr "00, 01, ..., 99" -#: ../../library/datetime.rst:2385 +#: ../../library/datetime.rst:2386 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/datetime.rst:2385 +#: ../../library/datetime.rst:2386 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/datetime.rst:2385 ../../library/datetime.rst:2455 +#: ../../library/datetime.rst:2386 ../../library/datetime.rst:2456 msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgstr "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" -#: ../../library/datetime.rst:2388 +#: ../../library/datetime.rst:2389 msgid "``%H``" msgstr "``%H``" -#: ../../library/datetime.rst:2388 +#: ../../library/datetime.rst:2389 msgid "Hour (24-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2388 +#: ../../library/datetime.rst:2389 msgid "00, 01, ..., 23" msgstr "00, 01, ..., 23" -#: ../../library/datetime.rst:2391 +#: ../../library/datetime.rst:2392 msgid "``%I``" msgstr "``%I``" -#: ../../library/datetime.rst:2391 +#: ../../library/datetime.rst:2392 msgid "Hour (12-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2394 +#: ../../library/datetime.rst:2395 msgid "``%p``" msgstr "``%p``" -#: ../../library/datetime.rst:2394 +#: ../../library/datetime.rst:2395 msgid "Locale's equivalent of either AM or PM." msgstr "" @@ -2747,128 +2748,128 @@ msgstr "AM, PM (en_US);" msgid "am, pm (de_DE)" msgstr "am, pm (de_DE)" -#: ../../library/datetime.rst:2394 +#: ../../library/datetime.rst:2395 msgid "\\(1), \\(3)" msgstr "\\(1), \\(3)" -#: ../../library/datetime.rst:2397 +#: ../../library/datetime.rst:2398 msgid "``%M``" msgstr "``%M``" -#: ../../library/datetime.rst:2397 +#: ../../library/datetime.rst:2398 msgid "Minute as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2397 ../../library/datetime.rst:2400 +#: ../../library/datetime.rst:2398 ../../library/datetime.rst:2401 msgid "00, 01, ..., 59" msgstr "00, 01, ..., 59" -#: ../../library/datetime.rst:2400 +#: ../../library/datetime.rst:2401 msgid "``%S``" msgstr "``%S``" -#: ../../library/datetime.rst:2400 +#: ../../library/datetime.rst:2401 msgid "Second as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2400 +#: ../../library/datetime.rst:2401 msgid "\\(4), \\(9)" msgstr "\\(4), \\(9)" -#: ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2404 msgid "``%f``" msgstr "``%f``" -#: ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2404 msgid "Microsecond as a decimal number, zero-padded to 6 digits." msgstr "" -#: ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2404 msgid "000000, 000001, ..., 999999" msgstr "000000, 000001, ..., 999999" -#: ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2404 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/datetime.rst:2407 ../../library/datetime.rst:2576 +#: ../../library/datetime.rst:2408 ../../library/datetime.rst:2577 msgid "``%z``" msgstr "``%z``" -#: ../../library/datetime.rst:2407 +#: ../../library/datetime.rst:2408 msgid "" "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " "naive)." msgstr "" -#: ../../library/datetime.rst:2407 +#: ../../library/datetime.rst:2408 msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" msgstr "" -#: ../../library/datetime.rst:2407 ../../library/datetime.rst:2412 -#: ../../library/datetime.rst:2469 +#: ../../library/datetime.rst:2408 ../../library/datetime.rst:2413 +#: ../../library/datetime.rst:2470 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/datetime.rst:2412 ../../library/datetime.rst:2604 +#: ../../library/datetime.rst:2413 ../../library/datetime.rst:2605 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/datetime.rst:2412 +#: ../../library/datetime.rst:2413 msgid "Time zone name (empty string if the object is naive)." msgstr "" -#: ../../library/datetime.rst:2412 +#: ../../library/datetime.rst:2413 msgid "(empty), UTC, GMT" msgstr "" -#: ../../library/datetime.rst:2415 +#: ../../library/datetime.rst:2416 msgid "``%j``" msgstr "``%j``" -#: ../../library/datetime.rst:2415 +#: ../../library/datetime.rst:2416 msgid "Day of the year as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2415 +#: ../../library/datetime.rst:2416 msgid "001, 002, ..., 366" msgstr "001, 002, ..., 366" -#: ../../library/datetime.rst:2418 +#: ../../library/datetime.rst:2419 msgid "``%U``" msgstr "``%U``" -#: ../../library/datetime.rst:2418 +#: ../../library/datetime.rst:2419 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:2418 ../../library/datetime.rst:2426 +#: ../../library/datetime.rst:2419 ../../library/datetime.rst:2427 msgid "00, 01, ..., 53" msgstr "00, 01, ..., 53" -#: ../../library/datetime.rst:2418 ../../library/datetime.rst:2426 +#: ../../library/datetime.rst:2419 ../../library/datetime.rst:2427 msgid "\\(7), \\(9)" msgstr "\\(7), \\(9)" -#: ../../library/datetime.rst:2426 +#: ../../library/datetime.rst:2427 msgid "``%W``" msgstr "``%W``" -#: ../../library/datetime.rst:2426 +#: ../../library/datetime.rst:2427 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:2434 +#: ../../library/datetime.rst:2435 msgid "``%c``" msgstr "``%c``" -#: ../../library/datetime.rst:2434 +#: ../../library/datetime.rst:2435 msgid "Locale's appropriate date and time representation." msgstr "" @@ -2880,11 +2881,11 @@ msgstr "" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2439 +#: ../../library/datetime.rst:2440 msgid "``%x``" msgstr "``%x``" -#: ../../library/datetime.rst:2439 +#: ../../library/datetime.rst:2440 msgid "Locale's appropriate date representation." msgstr "" @@ -2900,11 +2901,11 @@ msgstr "" msgid "16.08.1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2443 +#: ../../library/datetime.rst:2444 msgid "``%X``" msgstr "``%X``" -#: ../../library/datetime.rst:2443 +#: ../../library/datetime.rst:2444 msgid "Locale's appropriate time representation." msgstr "" @@ -2916,83 +2917,83 @@ msgstr "" msgid "21:30:00 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2446 +#: ../../library/datetime.rst:2447 msgid "``%%``" msgstr "``%%``" -#: ../../library/datetime.rst:2446 +#: ../../library/datetime.rst:2447 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/datetime.rst:2446 +#: ../../library/datetime.rst:2447 msgid "%" msgstr "%" -#: ../../library/datetime.rst:2449 +#: ../../library/datetime.rst:2450 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:2455 +#: ../../library/datetime.rst:2456 msgid "``%G``" msgstr "``%G``" -#: ../../library/datetime.rst:2455 +#: ../../library/datetime.rst:2456 msgid "" "ISO 8601 year with century representing the year that contains the greater " "part of the ISO week (``%V``)." msgstr "" -#: ../../library/datetime.rst:2455 +#: ../../library/datetime.rst:2456 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/datetime.rst:2460 +#: ../../library/datetime.rst:2461 msgid "``%u``" msgstr "``%u``" -#: ../../library/datetime.rst:2460 +#: ../../library/datetime.rst:2461 msgid "ISO 8601 weekday as a decimal number where 1 is Monday." msgstr "" -#: ../../library/datetime.rst:2460 +#: ../../library/datetime.rst:2461 msgid "1, 2, ..., 7" msgstr "1, 2, ..., 7" -#: ../../library/datetime.rst:2463 +#: ../../library/datetime.rst:2464 msgid "``%V``" msgstr "``%V``" -#: ../../library/datetime.rst:2463 +#: ../../library/datetime.rst:2464 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:2463 +#: ../../library/datetime.rst:2464 msgid "01, 02, ..., 53" msgstr "01, 02, ..., 53" -#: ../../library/datetime.rst:2463 +#: ../../library/datetime.rst:2464 msgid "\\(8), \\(9)" msgstr "\\(8), \\(9)" -#: ../../library/datetime.rst:2469 ../../library/datetime.rst:2590 +#: ../../library/datetime.rst:2470 ../../library/datetime.rst:2591 msgid "``%:z``" msgstr "``%:z``" -#: ../../library/datetime.rst:2469 +#: ../../library/datetime.rst:2470 msgid "" "UTC offset in the form ``±HH:MM[:SS[.ffffff]]`` (empty string if the object " "is naive)." msgstr "" -#: ../../library/datetime.rst:2469 +#: ../../library/datetime.rst:2470 msgid "(empty), +00:00, -04:00, +10:30, +06:34:15, -03:07:12.345216" msgstr "" -#: ../../library/datetime.rst:2475 +#: ../../library/datetime.rst:2476 msgid "" "These may not be available on all platforms when used with the :meth:" "`strftime` method. The ISO 8601 year and ISO 8601 week directives are not " @@ -3001,7 +3002,7 @@ msgid "" "a :exc:`ValueError`." msgstr "" -#: ../../library/datetime.rst:2480 +#: ../../library/datetime.rst:2481 msgid "" "The full set of format codes supported varies across platforms, because " "Python calls the platform C library's :func:`strftime` function, and " @@ -3011,37 +3012,37 @@ msgid "" "unsupported format specifiers." msgstr "" -#: ../../library/datetime.rst:2486 +#: ../../library/datetime.rst:2487 msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "新增 ``%G``\\ 、\\ ``%u`` 與 ``%V``\\ 。" -#: ../../library/datetime.rst:2489 +#: ../../library/datetime.rst:2490 msgid "``%:z`` was added." msgstr "" -#: ../../library/datetime.rst:2493 +#: ../../library/datetime.rst:2494 msgid "Technical Detail" msgstr "技術細節" -#: ../../library/datetime.rst:2495 +#: ../../library/datetime.rst:2496 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:`timetuple` method." msgstr "" -#: ../../library/datetime.rst:2499 +#: ../../library/datetime.rst:2500 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:2503 +#: ../../library/datetime.rst:2504 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:2507 +#: ../../library/datetime.rst:2508 msgid "" "except when the format includes sub-second components or timezone offset " "information, which are supported in ``datetime.strptime`` but are discarded " @@ -3049,7 +3050,7 @@ msgid "" msgstr "" # format code 在這份文件第一次出現的地方是 ../../library/datetime.rst:739,應該要改成在那邊註記 (format code) -#: ../../library/datetime.rst:2511 +#: ../../library/datetime.rst:2512 #, fuzzy msgid "" "For :class:`.time` objects, the format codes for year, month, and day should " @@ -3061,7 +3062,7 @@ msgstr "" "為 :class:`time` 物件並沒有這些值。如果使用這些格式碼,年份會以 ``1900`` 代" "替、月及日會以 ``1`` 代替。" -#: ../../library/datetime.rst:2515 +#: ../../library/datetime.rst:2516 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 " @@ -3070,7 +3071,7 @@ msgstr "" "對 :class:`.date` 物件來說,不應該使用時、分、秒、微秒的格式碼,因為 :class:" "`date` 物件並沒有這些值。如果使用這些格式碼,這些值都會以 ``0`` 代替。" -#: ../../library/datetime.rst:2519 +#: ../../library/datetime.rst:2520 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 " @@ -3079,7 +3080,7 @@ msgid "" "`UnicodeError` or return an empty string instead." msgstr "" -#: ../../library/datetime.rst:2528 +#: ../../library/datetime.rst:2529 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 " @@ -3087,37 +3088,37 @@ msgid "" "contain non-ASCII characters." msgstr "" -#: ../../library/datetime.rst:2534 +#: ../../library/datetime.rst:2535 msgid "" "The :meth:`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:2537 +#: ../../library/datetime.rst:2538 msgid "" "In previous versions, :meth:`strftime` method was restricted to years >= " "1900." msgstr "" -#: ../../library/datetime.rst:2541 +#: ../../library/datetime.rst:2542 msgid "" "In version 3.2, :meth:`strftime` method was restricted to years >= 1000." msgstr "" -#: ../../library/datetime.rst:2546 +#: ../../library/datetime.rst:2547 msgid "" "When used with the :meth:`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:2550 +#: ../../library/datetime.rst:2551 msgid "" "Unlike the :mod:`time` module, the :mod:`datetime` module does not support " "leap seconds." msgstr "" -#: ../../library/datetime.rst:2554 +#: ../../library/datetime.rst:2555 msgid "" "When used with the :meth:`strptime` method, the ``%f`` directive accepts " "from one to six digits and zero pads on the right. ``%f`` is an extension to " @@ -3125,17 +3126,17 @@ msgid "" "in datetime objects, and therefore always available)." msgstr "" -#: ../../library/datetime.rst:2561 +#: ../../library/datetime.rst:2562 msgid "" "For a naive object, the ``%z``, ``%:z`` and ``%Z`` format codes are replaced " "by empty strings." msgstr "" -#: ../../library/datetime.rst:2564 +#: ../../library/datetime.rst:2565 msgid "For an aware object:" msgstr "" -#: ../../library/datetime.rst:2567 +#: ../../library/datetime.rst:2568 msgid "" ":meth:`utcoffset` is transformed into a string of the form ``±HHMM[SS[." "ffffff]]``, where ``HH`` is a 2-digit string giving the number of UTC offset " @@ -3149,7 +3150,7 @@ msgid "" "``'-0330'``." msgstr "" -#: ../../library/datetime.rst:2581 +#: ../../library/datetime.rst:2582 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, the " "UTC offsets can have a colon as a separator between hours, minutes and " @@ -3157,53 +3158,53 @@ msgid "" "hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``." msgstr "" -#: ../../library/datetime.rst:2589 +#: ../../library/datetime.rst:2590 msgid "" "Behaves exactly as ``%z``, but has a colon separator added between hours, " "minutes and seconds." msgstr "" -#: ../../library/datetime.rst:2593 +#: ../../library/datetime.rst:2594 msgid "" "In :meth:`strftime`, ``%Z`` is replaced by an empty string if :meth:`tzname` " "returns ``None``; otherwise ``%Z`` is replaced by the returned value, which " "must be a string." msgstr "" -#: ../../library/datetime.rst:2597 +#: ../../library/datetime.rst:2598 msgid ":meth:`strptime` only accepts certain values for ``%Z``:" msgstr "" -#: ../../library/datetime.rst:2599 +#: ../../library/datetime.rst:2600 msgid "any value in ``time.tzname`` for your machine's locale" msgstr "" -#: ../../library/datetime.rst:2600 +#: ../../library/datetime.rst:2601 msgid "the hard-coded values ``UTC`` and ``GMT``" msgstr "" -#: ../../library/datetime.rst:2602 +#: ../../library/datetime.rst:2603 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:2606 +#: ../../library/datetime.rst:2607 msgid "" "When the ``%z`` directive is provided to the :meth:`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:2612 +#: ../../library/datetime.rst:2613 msgid "" "When used with the :meth:`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:2617 +#: ../../library/datetime.rst:2618 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:" @@ -3211,22 +3212,22 @@ msgid "" "interchangeable." msgstr "" -#: ../../library/datetime.rst:2623 +#: ../../library/datetime.rst:2624 msgid "" "When used with the :meth:`strptime` method, the leading zero is optional " "for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ``%U``, " "``%W``, and ``%V``. Format ``%y`` does require a leading zero." msgstr "" -#: ../../library/datetime.rst:2628 +#: ../../library/datetime.rst:2629 msgid "Footnotes" msgstr "註解" -#: ../../library/datetime.rst:2629 +#: ../../library/datetime.rst:2630 msgid "If, that is, we ignore the effects of Relativity" msgstr "也就是說,我們會忽略相對論的效應" -#: ../../library/datetime.rst:2631 +#: ../../library/datetime.rst:2632 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -3235,23 +3236,23 @@ msgid "" "systems." msgstr "" -#: ../../library/datetime.rst:2637 +#: ../../library/datetime.rst:2638 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " "`_ for a good explanation." msgstr "" -#: ../../library/datetime.rst:2641 +#: ../../library/datetime.rst:2642 msgid "" "Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since ``1900`` is " "not a leap year." msgstr "" -#: ../../library/datetime.rst:2301 +#: ../../library/datetime.rst:2302 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/datetime.rst:2301 +#: ../../library/datetime.rst:2302 msgid "datetime format" msgstr "datetime format(日期時間格式)" diff --git a/library/dis.po b/library/dis.po index 5b4accee2c..b9269f6301 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-18 00:04+0000\n" +"POT-Creation-Date: 2023-12-06 00:03+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -743,8 +743,8 @@ msgstr "" #: ../../library/dis.rst:773 msgid "" "Re-raises the exception currently on top of the stack. If oparg is non-zero, " -"pops an additional value from the stack which is used to set ``f_lasti`` of " -"the current frame." +"pops an additional value from the stack which is used to set :attr:`~frame." +"f_lasti` of the current frame." msgstr "" #: ../../library/dis.rst:784 diff --git a/library/doctest.po b/library/doctest.po index 64c365b17f..42306072da 100644 --- a/library/doctest.po +++ b/library/doctest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-20 00:03+0000\n" +"POT-Creation-Date: 2023-11-26 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-" @@ -90,11 +90,11 @@ msgstr "" #: ../../library/doctest.rst:145 msgid "" "The simplest way to start using doctest (but not necessarily the way you'll " -"continue to do it) is to end each module :mod:`M` with::" +"continue to do it) is to end each module :mod:`!M` with::" msgstr "" #: ../../library/doctest.rst:152 -msgid ":mod:`doctest` then examines docstrings in module :mod:`M`." +msgid ":mod:`!doctest` then examines docstrings in module :mod:`!M`." msgstr "" #: ../../library/doctest.rst:154 @@ -353,10 +353,10 @@ msgstr "" #: ../../library/doctest.rst:405 msgid "" "By default, each time :mod:`doctest` finds a docstring to test, it uses a " -"*shallow copy* of :mod:`M`'s globals, so that running tests doesn't change " -"the module's real globals, and so that one test in :mod:`M` can't leave " +"*shallow copy* of :mod:`!M`'s globals, so that running tests doesn't change " +"the module's real globals, and so that one test in :mod:`!M` can't leave " "behind crumbs that accidentally allow another test to work. This means " -"examples can freely use any names defined at top-level in :mod:`M`, and " +"examples can freely use any names defined at top-level in :mod:`!M`, and " "names defined earlier in the docstring being run. Examples cannot see names " "defined in other docstrings." msgstr "" @@ -902,14 +902,14 @@ msgid "" "continue running examples." msgstr "" -#: ../../library/doctest.rst:930 ../../library/doctest.rst:1070 +#: ../../library/doctest.rst:930 ../../library/doctest.rst:1071 msgid "" "Optional argument *parser* specifies a :class:`DocTestParser` (or subclass) " "that should be used to extract tests from the files. It defaults to a " "normal parser (i.e., ``DocTestParser()``)." msgstr "" -#: ../../library/doctest.rst:934 ../../library/doctest.rst:1074 +#: ../../library/doctest.rst:934 ../../library/doctest.rst:1075 msgid "" "Optional argument *encoding* specifies an encoding that should be used to " "convert the file to unicode." @@ -956,44 +956,45 @@ msgid "" "Optional argument *exclude_empty* defaults to false. If true, objects for " "which no doctests are found are excluded from consideration. The default is " "a backward compatibility hack, so that code still using :meth:`doctest." -"master.summarize` in conjunction with :func:`testmod` continues to get " -"output for objects with no tests. The *exclude_empty* argument to the newer :" -"class:`DocTestFinder` constructor defaults to true." +"master.summarize ` in conjunction with :func:" +"`testmod` continues to get output for objects with no tests. The " +"*exclude_empty* argument to the newer :class:`DocTestFinder` constructor " +"defaults to true." msgstr "" -#: ../../library/doctest.rst:966 +#: ../../library/doctest.rst:967 msgid "" "Optional arguments *extraglobs*, *verbose*, *report*, *optionflags*, " "*raise_on_error*, and *globs* are the same as for function :func:`testfile` " "above, except that *globs* defaults to ``m.__dict__``." msgstr "" -#: ../../library/doctest.rst:973 +#: ../../library/doctest.rst:974 msgid "" "Test examples associated with object *f*; for example, *f* may be a string, " "a module, a function, or a class object." msgstr "" -#: ../../library/doctest.rst:976 +#: ../../library/doctest.rst:977 msgid "" "A shallow copy of dictionary argument *globs* is used for the execution " "context." msgstr "" -#: ../../library/doctest.rst:978 +#: ../../library/doctest.rst:979 msgid "" "Optional argument *name* is used in failure messages, and defaults to " "``\"NoName\"``." msgstr "" -#: ../../library/doctest.rst:981 +#: ../../library/doctest.rst:982 msgid "" "If optional argument *verbose* is true, output is generated even if there " "are no failures. By default, output is generated only in case of an example " "failure." msgstr "" -#: ../../library/doctest.rst:984 +#: ../../library/doctest.rst:985 msgid "" "Optional argument *compileflags* gives the set of flags that should be used " "by the Python compiler when running the examples. By default, or if " @@ -1001,37 +1002,38 @@ msgid "" "found in *globs*." msgstr "" -#: ../../library/doctest.rst:988 +#: ../../library/doctest.rst:989 msgid "" "Optional argument *optionflags* works as for function :func:`testfile` above." msgstr "" -#: ../../library/doctest.rst:994 +#: ../../library/doctest.rst:995 msgid "Unittest API" msgstr "" -#: ../../library/doctest.rst:996 +#: ../../library/doctest.rst:997 msgid "" "As your collection of doctest'ed modules grows, you'll want a way to run all " "their doctests systematically. :mod:`doctest` provides two functions that " "can be used to create :mod:`unittest` test suites from modules and text " "files containing doctests. To integrate with :mod:`unittest` test " -"discovery, include a :func:`load_tests` function in your test module::" +"discovery, include a :ref:`load_tests ` function in " +"your test module::" msgstr "" -#: ../../library/doctest.rst:1010 +#: ../../library/doctest.rst:1011 msgid "" "There are two main functions for creating :class:`unittest.TestSuite` " "instances from text files and modules with doctests:" msgstr "" -#: ../../library/doctest.rst:1016 +#: ../../library/doctest.rst:1017 msgid "" "Convert doctest tests from one or more text files to a :class:`unittest." "TestSuite`." msgstr "" -#: ../../library/doctest.rst:1019 +#: ../../library/doctest.rst:1020 msgid "" "The returned :class:`unittest.TestSuite` is to be run by the unittest " "framework and runs the interactive examples in each file. If an example in " @@ -1040,21 +1042,21 @@ msgid "" "containing the test and a (sometimes approximate) line number." msgstr "" -#: ../../library/doctest.rst:1025 +#: ../../library/doctest.rst:1026 msgid "Pass one or more paths (as strings) to text files to be examined." msgstr "" -#: ../../library/doctest.rst:1027 +#: ../../library/doctest.rst:1028 msgid "Options may be provided as keyword arguments:" msgstr "" -#: ../../library/doctest.rst:1029 +#: ../../library/doctest.rst:1030 msgid "" "Optional argument *module_relative* specifies how the filenames in *paths* " "should be interpreted:" msgstr "" -#: ../../library/doctest.rst:1032 +#: ../../library/doctest.rst:1033 msgid "" "If *module_relative* is ``True`` (the default), then each filename in " "*paths* specifies an OS-independent module-relative path. By default, this " @@ -1065,14 +1067,14 @@ msgid "" "``)." msgstr "" -#: ../../library/doctest.rst:1040 +#: ../../library/doctest.rst:1041 msgid "" "If *module_relative* is ``False``, then each filename in *paths* specifies " "an OS-specific path. The path may be absolute or relative; relative paths " "are resolved with respect to the current working directory." msgstr "" -#: ../../library/doctest.rst:1044 +#: ../../library/doctest.rst:1045 msgid "" "Optional argument *package* is a Python package or the name of a Python " "package whose directory should be used as the base directory for module-" @@ -1082,7 +1084,7 @@ msgid "" "``False``." msgstr "" -#: ../../library/doctest.rst:1051 +#: ../../library/doctest.rst:1052 msgid "" "Optional argument *setUp* specifies a set-up function for the test suite. " "This is called before running the tests in each file. The *setUp* function " @@ -1090,7 +1092,7 @@ msgid "" "test globals as the *globs* attribute of the test passed." msgstr "" -#: ../../library/doctest.rst:1056 +#: ../../library/doctest.rst:1057 msgid "" "Optional argument *tearDown* specifies a tear-down function for the test " "suite. This is called after running the tests in each file. The *tearDown* " @@ -1098,14 +1100,14 @@ msgid "" "access the test globals as the *globs* attribute of the test passed." msgstr "" -#: ../../library/doctest.rst:1061 ../../library/doctest.rst:1095 +#: ../../library/doctest.rst:1062 ../../library/doctest.rst:1096 msgid "" "Optional argument *globs* is a dictionary containing the initial global " "variables for the tests. A new copy of this dictionary is created for each " "test. By default, *globs* is a new empty dictionary." msgstr "" -#: ../../library/doctest.rst:1065 +#: ../../library/doctest.rst:1066 msgid "" "Optional argument *optionflags* specifies the default doctest options for " "the tests, created by or-ing together individual option flags. See section :" @@ -1113,17 +1115,17 @@ msgid "" "for a better way to set reporting options." msgstr "" -#: ../../library/doctest.rst:1077 +#: ../../library/doctest.rst:1078 msgid "" "The global ``__file__`` is added to the globals provided to doctests loaded " "from a text file using :func:`DocFileSuite`." msgstr "" -#: ../../library/doctest.rst:1083 +#: ../../library/doctest.rst:1084 msgid "Convert doctest tests for a module to a :class:`unittest.TestSuite`." msgstr "" -#: ../../library/doctest.rst:1085 +#: ../../library/doctest.rst:1086 msgid "" "The returned :class:`unittest.TestSuite` is to be run by the unittest " "framework and runs each doctest in the module. If any of the doctests fail, " @@ -1132,61 +1134,69 @@ msgid "" "(sometimes approximate) line number." msgstr "" -#: ../../library/doctest.rst:1091 +#: ../../library/doctest.rst:1092 msgid "" "Optional argument *module* provides the module to be tested. It can be a " "module object or a (possibly dotted) module name. If not specified, the " "module calling this function is used." msgstr "" -#: ../../library/doctest.rst:1099 +#: ../../library/doctest.rst:1100 msgid "" "Optional argument *extraglobs* specifies an extra set of global variables, " "which is merged into *globs*. By default, no extra globals are used." msgstr "" -#: ../../library/doctest.rst:1102 +#: ../../library/doctest.rst:1103 msgid "" "Optional argument *test_finder* is the :class:`DocTestFinder` object (or a " "drop-in replacement) that is used to extract doctests from the module." msgstr "" -#: ../../library/doctest.rst:1105 +#: ../../library/doctest.rst:1106 msgid "" "Optional arguments *setUp*, *tearDown*, and *optionflags* are the same as " "for function :func:`DocFileSuite` above." msgstr "" -#: ../../library/doctest.rst:1108 +#: ../../library/doctest.rst:1109 msgid "This function uses the same search technique as :func:`testmod`." msgstr "" -#: ../../library/doctest.rst:1110 +#: ../../library/doctest.rst:1111 msgid "" ":func:`DocTestSuite` returns an empty :class:`unittest.TestSuite` if " "*module* contains no docstrings instead of raising :exc:`ValueError`." msgstr "" -#: ../../library/doctest.rst:1115 +#: ../../library/doctest.rst:1117 +msgid "" +"When doctests which have been converted to unit tests by :func:" +"`DocFileSuite` or :func:`DocTestSuite` fail, this exception is raised " +"showing the name of the file containing the test and a (sometimes " +"approximate) line number." +msgstr "" + +#: ../../library/doctest.rst:1121 msgid "" "Under the covers, :func:`DocTestSuite` creates a :class:`unittest.TestSuite` " -"out of :class:`doctest.DocTestCase` instances, and :class:`DocTestCase` is a " -"subclass of :class:`unittest.TestCase`. :class:`DocTestCase` isn't " +"out of :class:`!doctest.DocTestCase` instances, and :class:`!DocTestCase` is " +"a subclass of :class:`unittest.TestCase`. :class:`!DocTestCase` isn't " "documented here (it's an internal detail), but studying its code can answer " "questions about the exact details of :mod:`unittest` integration." msgstr "" -#: ../../library/doctest.rst:1121 +#: ../../library/doctest.rst:1127 msgid "" "Similarly, :func:`DocFileSuite` creates a :class:`unittest.TestSuite` out " -"of :class:`doctest.DocFileCase` instances, and :class:`DocFileCase` is a " -"subclass of :class:`DocTestCase`." +"of :class:`!doctest.DocFileCase` instances, and :class:`!DocFileCase` is a " +"subclass of :class:`!DocTestCase`." msgstr "" -#: ../../library/doctest.rst:1125 +#: ../../library/doctest.rst:1131 msgid "" "So both ways of creating a :class:`unittest.TestSuite` run instances of :" -"class:`DocTestCase`. This is important for a subtle reason: when you run :" +"class:`!DocTestCase`. This is important for a subtle reason: when you run :" "mod:`doctest` functions yourself, you can control the :mod:`doctest` options " "in use directly, by passing option flags to :mod:`doctest` functions. " "However, if you're writing a :mod:`unittest` framework, :mod:`unittest` " @@ -1196,47 +1206,47 @@ msgid "" "through :mod:`unittest` to :mod:`doctest` test runners." msgstr "" -#: ../../library/doctest.rst:1135 +#: ../../library/doctest.rst:1141 msgid "" "For this reason, :mod:`doctest` also supports a notion of :mod:`doctest` " "reporting flags specific to :mod:`unittest` support, via this function:" msgstr "" -#: ../../library/doctest.rst:1141 +#: ../../library/doctest.rst:1147 msgid "Set the :mod:`doctest` reporting flags to use." msgstr "" -#: ../../library/doctest.rst:1143 +#: ../../library/doctest.rst:1149 msgid "" "Argument *flags* takes the :ref:`bitwise OR ` of option flags. See " "section :ref:`doctest-options`. Only \"reporting flags\" can be used." msgstr "" -#: ../../library/doctest.rst:1146 +#: ../../library/doctest.rst:1152 msgid "" "This is a module-global setting, and affects all future doctests run by " -"module :mod:`unittest`: the :meth:`runTest` method of :class:`DocTestCase` " -"looks at the option flags specified for the test case when the :class:" -"`DocTestCase` instance was constructed. If no reporting flags were " -"specified (which is the typical and expected case), :mod:`doctest`'s :mod:" +"module :mod:`unittest`: the :meth:`!runTest` method of :class:`!" +"DocTestCase` looks at the option flags specified for the test case when the :" +"class:`!DocTestCase` instance was constructed. If no reporting flags were " +"specified (which is the typical and expected case), :mod:`!doctest`'s :mod:" "`unittest` reporting flags are :ref:`bitwise ORed ` into the option " "flags, and the option flags so augmented are passed to the :class:" "`DocTestRunner` instance created to run the doctest. If any reporting flags " -"were specified when the :class:`DocTestCase` instance was constructed, :mod:" -"`doctest`'s :mod:`unittest` reporting flags are ignored." +"were specified when the :class:`!DocTestCase` instance was constructed, :mod:" +"`!doctest`'s :mod:`unittest` reporting flags are ignored." msgstr "" -#: ../../library/doctest.rst:1157 +#: ../../library/doctest.rst:1163 msgid "" "The value of the :mod:`unittest` reporting flags in effect before the " "function was called is returned by the function." msgstr "" -#: ../../library/doctest.rst:1164 +#: ../../library/doctest.rst:1170 msgid "Advanced API" msgstr "" -#: ../../library/doctest.rst:1166 +#: ../../library/doctest.rst:1172 msgid "" "The basic API is a simple wrapper that's intended to make doctest easy to " "use. It is fairly flexible, and should meet most users' needs; however, if " @@ -1244,85 +1254,85 @@ msgid "" "doctest's capabilities, then you should use the advanced API." msgstr "" -#: ../../library/doctest.rst:1171 +#: ../../library/doctest.rst:1177 msgid "" "The advanced API revolves around two container classes, which are used to " "store the interactive examples extracted from doctest cases:" msgstr "" -#: ../../library/doctest.rst:1174 +#: ../../library/doctest.rst:1180 msgid "" ":class:`Example`: A single Python :term:`statement`, paired with its " "expected output." msgstr "" -#: ../../library/doctest.rst:1177 +#: ../../library/doctest.rst:1183 msgid "" ":class:`DocTest`: A collection of :class:`Example`\\ s, typically extracted " "from a single docstring or text file." msgstr "" -#: ../../library/doctest.rst:1180 +#: ../../library/doctest.rst:1186 msgid "" "Additional processing classes are defined to find, parse, and run, and check " "doctest examples:" msgstr "" -#: ../../library/doctest.rst:1183 +#: ../../library/doctest.rst:1189 msgid "" ":class:`DocTestFinder`: Finds all docstrings in a given module, and uses a :" "class:`DocTestParser` to create a :class:`DocTest` from every docstring that " "contains interactive examples." msgstr "" -#: ../../library/doctest.rst:1187 +#: ../../library/doctest.rst:1193 msgid "" ":class:`DocTestParser`: Creates a :class:`DocTest` object from a string " "(such as an object's docstring)." msgstr "" -#: ../../library/doctest.rst:1190 +#: ../../library/doctest.rst:1196 msgid "" ":class:`DocTestRunner`: Executes the examples in a :class:`DocTest`, and " "uses an :class:`OutputChecker` to verify their output." msgstr "" -#: ../../library/doctest.rst:1193 +#: ../../library/doctest.rst:1199 msgid "" ":class:`OutputChecker`: Compares the actual output from a doctest example " "with the expected output, and decides whether they match." msgstr "" -#: ../../library/doctest.rst:1196 +#: ../../library/doctest.rst:1202 msgid "" "The relationships among these processing classes are summarized in the " "following diagram::" msgstr "" -#: ../../library/doctest.rst:1212 +#: ../../library/doctest.rst:1218 msgid "DocTest Objects" msgstr "DocTest 物件" -#: ../../library/doctest.rst:1217 +#: ../../library/doctest.rst:1223 msgid "" "A collection of doctest examples that should be run in a single namespace. " "The constructor arguments are used to initialize the attributes of the same " "names." msgstr "" -#: ../../library/doctest.rst:1221 +#: ../../library/doctest.rst:1227 msgid "" ":class:`DocTest` defines the following attributes. They are initialized by " "the constructor, and should not be modified directly." msgstr "" -#: ../../library/doctest.rst:1227 +#: ../../library/doctest.rst:1233 msgid "" "A list of :class:`Example` objects encoding the individual interactive " "Python examples that should be run by this test." msgstr "" -#: ../../library/doctest.rst:1233 +#: ../../library/doctest.rst:1239 msgid "" "The namespace (aka globals) that the examples should be run in. This is a " "dictionary mapping names to values. Any changes to the namespace made by " @@ -1330,57 +1340,57 @@ msgid "" "`globs` after the test is run." msgstr "" -#: ../../library/doctest.rst:1241 +#: ../../library/doctest.rst:1247 msgid "" "A string name identifying the :class:`DocTest`. Typically, this is the name " "of the object or file that the test was extracted from." msgstr "" -#: ../../library/doctest.rst:1247 +#: ../../library/doctest.rst:1253 msgid "" "The name of the file that this :class:`DocTest` was extracted from; or " "``None`` if the filename is unknown, or if the :class:`DocTest` was not " "extracted from a file." msgstr "" -#: ../../library/doctest.rst:1254 +#: ../../library/doctest.rst:1260 msgid "" "The line number within :attr:`filename` where this :class:`DocTest` begins, " "or ``None`` if the line number is unavailable. This line number is zero-" "based with respect to the beginning of the file." msgstr "" -#: ../../library/doctest.rst:1261 +#: ../../library/doctest.rst:1267 msgid "" "The string that the test was extracted from, or ``None`` if the string is " "unavailable, or if the test was not extracted from a string." msgstr "" -#: ../../library/doctest.rst:1268 +#: ../../library/doctest.rst:1274 msgid "Example Objects" msgstr "Example 物件" -#: ../../library/doctest.rst:1273 +#: ../../library/doctest.rst:1279 msgid "" "A single interactive example, consisting of a Python statement and its " "expected output. The constructor arguments are used to initialize the " "attributes of the same names." msgstr "" -#: ../../library/doctest.rst:1278 +#: ../../library/doctest.rst:1284 msgid "" ":class:`Example` defines the following attributes. They are initialized by " "the constructor, and should not be modified directly." msgstr "" -#: ../../library/doctest.rst:1284 +#: ../../library/doctest.rst:1290 msgid "" "A string containing the example's source code. This source code consists of " "a single Python statement, and always ends with a newline; the constructor " "adds a newline when necessary." msgstr "" -#: ../../library/doctest.rst:1291 +#: ../../library/doctest.rst:1297 msgid "" "The expected output from running the example's source code (either from " "stdout, or a traceback in case of exception). :attr:`want` ends with a " @@ -1388,7 +1398,7 @@ msgid "" "The constructor adds a newline when necessary." msgstr "" -#: ../../library/doctest.rst:1299 +#: ../../library/doctest.rst:1305 msgid "" "The exception message generated by the example, if the example is expected " "to generate an exception; or ``None`` if it is not expected to generate an " @@ -1397,33 +1407,33 @@ msgid "" "unless it's ``None``. The constructor adds a newline if needed." msgstr "" -#: ../../library/doctest.rst:1308 +#: ../../library/doctest.rst:1314 msgid "" "The line number within the string containing this example where the example " "begins. This line number is zero-based with respect to the beginning of the " "containing string." msgstr "" -#: ../../library/doctest.rst:1315 +#: ../../library/doctest.rst:1321 msgid "" "The example's indentation in the containing string, i.e., the number of " "space characters that precede the example's first prompt." msgstr "" -#: ../../library/doctest.rst:1321 +#: ../../library/doctest.rst:1327 msgid "" "A dictionary mapping from option flags to ``True`` or ``False``, which is " "used to override default options for this example. Any option flags not " "contained in this dictionary are left at their default value (as specified " -"by the :class:`DocTestRunner`'s :attr:`optionflags`). By default, no options " -"are set." +"by the :class:`DocTestRunner`'s :ref:`optionflags `). By " +"default, no options are set." msgstr "" -#: ../../library/doctest.rst:1330 +#: ../../library/doctest.rst:1337 msgid "DocTestFinder objects" msgstr "DocTestFinder 物件" -#: ../../library/doctest.rst:1335 +#: ../../library/doctest.rst:1342 msgid "" "A processing class used to extract the :class:`DocTest`\\ s that are " "relevant to a given object, from its docstring and the docstrings of its " @@ -1431,48 +1441,48 @@ msgid "" "classes, functions, methods, staticmethods, classmethods, and properties." msgstr "" -#: ../../library/doctest.rst:1340 +#: ../../library/doctest.rst:1347 msgid "" "The optional argument *verbose* can be used to display the objects searched " "by the finder. It defaults to ``False`` (no output)." msgstr "" -#: ../../library/doctest.rst:1343 +#: ../../library/doctest.rst:1350 msgid "" "The optional argument *parser* specifies the :class:`DocTestParser` object " "(or a drop-in replacement) that is used to extract doctests from docstrings." msgstr "" -#: ../../library/doctest.rst:1346 +#: ../../library/doctest.rst:1353 msgid "" "If the optional argument *recurse* is false, then :meth:`DocTestFinder.find` " "will only examine the given object, and not any contained objects." msgstr "" -#: ../../library/doctest.rst:1349 +#: ../../library/doctest.rst:1356 msgid "" "If the optional argument *exclude_empty* is false, then :meth:`DocTestFinder." "find` will include tests for objects with empty docstrings." msgstr "" -#: ../../library/doctest.rst:1353 +#: ../../library/doctest.rst:1360 msgid ":class:`DocTestFinder` defines the following method:" msgstr "" -#: ../../library/doctest.rst:1358 +#: ../../library/doctest.rst:1365 msgid "" "Return a list of the :class:`DocTest`\\ s that are defined by *obj*'s " "docstring, or by any of its contained objects' docstrings." msgstr "" -#: ../../library/doctest.rst:1361 +#: ../../library/doctest.rst:1368 msgid "" "The optional argument *name* specifies the object's name; this name will be " "used to construct names for the returned :class:`DocTest`\\ s. If *name* is " "not specified, then ``obj.__name__`` is used." msgstr "" -#: ../../library/doctest.rst:1365 +#: ../../library/doctest.rst:1372 msgid "" "The optional parameter *module* is the module that contains the given " "object. If the module is not specified or is ``None``, then the test finder " @@ -1480,26 +1490,26 @@ msgid "" "module is used:" msgstr "" -#: ../../library/doctest.rst:1369 +#: ../../library/doctest.rst:1376 msgid "As a default namespace, if *globs* is not specified." msgstr "" -#: ../../library/doctest.rst:1371 +#: ../../library/doctest.rst:1378 msgid "" "To prevent the DocTestFinder from extracting DocTests from objects that are " "imported from other modules. (Contained objects with modules other than " "*module* are ignored.)" msgstr "" -#: ../../library/doctest.rst:1375 +#: ../../library/doctest.rst:1382 msgid "To find the name of the file containing the object." msgstr "" -#: ../../library/doctest.rst:1377 +#: ../../library/doctest.rst:1384 msgid "To help find the line number of the object within its file." msgstr "" -#: ../../library/doctest.rst:1379 +#: ../../library/doctest.rst:1386 msgid "" "If *module* is ``False``, no attempt to find the module will be made. This " "is obscure, of use mostly in testing doctest itself: if *module* is " @@ -1508,7 +1518,7 @@ msgid "" "contained objects will (recursively) be searched for doctests." msgstr "" -#: ../../library/doctest.rst:1385 +#: ../../library/doctest.rst:1392 msgid "" "The globals for each :class:`DocTest` is formed by combining *globs* and " "*extraglobs* (bindings in *extraglobs* override bindings in *globs*). A new " @@ -1518,34 +1528,34 @@ msgid "" "defaults to ``{}``." msgstr "" -#: ../../library/doctest.rst:1396 +#: ../../library/doctest.rst:1403 msgid "DocTestParser objects" msgstr "DocTestParser 物件" -#: ../../library/doctest.rst:1401 +#: ../../library/doctest.rst:1408 msgid "" "A processing class used to extract interactive examples from a string, and " "use them to create a :class:`DocTest` object." msgstr "" -#: ../../library/doctest.rst:1405 ../../library/doctest.rst:1473 +#: ../../library/doctest.rst:1412 ../../library/doctest.rst:1480 msgid ":class:`DocTestParser` defines the following methods:" msgstr "" -#: ../../library/doctest.rst:1410 +#: ../../library/doctest.rst:1417 msgid "" "Extract all doctest examples from the given string, and collect them into a :" "class:`DocTest` object." msgstr "" -#: ../../library/doctest.rst:1413 +#: ../../library/doctest.rst:1420 msgid "" "*globs*, *name*, *filename*, and *lineno* are attributes for the new :class:" "`DocTest` object. See the documentation for :class:`DocTest` for more " "information." msgstr "" -#: ../../library/doctest.rst:1420 +#: ../../library/doctest.rst:1427 msgid "" "Extract all doctest examples from the given string, and return them as a " "list of :class:`Example` objects. Line numbers are 0-based. The optional " @@ -1553,7 +1563,7 @@ msgid "" "error messages." msgstr "" -#: ../../library/doctest.rst:1427 +#: ../../library/doctest.rst:1434 msgid "" "Divide the given string into examples and intervening text, and return them " "as a list of alternating :class:`Example`\\ s and strings. Line numbers for " @@ -1561,17 +1571,17 @@ msgid "" "name identifying this string, and is only used for error messages." msgstr "" -#: ../../library/doctest.rst:1436 +#: ../../library/doctest.rst:1443 msgid "DocTestRunner objects" msgstr "DocTestRunner 物件" -#: ../../library/doctest.rst:1441 +#: ../../library/doctest.rst:1448 msgid "" "A processing class used to execute and verify the interactive examples in a :" "class:`DocTest`." msgstr "" -#: ../../library/doctest.rst:1444 +#: ../../library/doctest.rst:1451 msgid "" "The comparison between expected outputs and actual outputs is done by an :" "class:`OutputChecker`. This comparison may be customized with a number of " @@ -1581,25 +1591,25 @@ msgid "" "constructor." msgstr "" -#: ../../library/doctest.rst:1450 +#: ../../library/doctest.rst:1457 msgid "" "The test runner's display output can be controlled in two ways. First, an " -"output function can be passed to :meth:`TestRunner.run`; this function will " -"be called with strings that should be displayed. It defaults to ``sys." -"stdout.write``. If capturing the output is not sufficient, then the display " -"output can be also customized by subclassing DocTestRunner, and overriding " -"the methods :meth:`report_start`, :meth:`report_success`, :meth:" +"output function can be passed to :meth:`run`; this function will be called " +"with strings that should be displayed. It defaults to ``sys.stdout." +"write``. If capturing the output is not sufficient, then the display output " +"can be also customized by subclassing DocTestRunner, and overriding the " +"methods :meth:`report_start`, :meth:`report_success`, :meth:" "`report_unexpected_exception`, and :meth:`report_failure`." msgstr "" -#: ../../library/doctest.rst:1458 +#: ../../library/doctest.rst:1465 msgid "" "The optional keyword argument *checker* specifies the :class:`OutputChecker` " "object (or drop-in replacement) that should be used to compare the expected " "outputs to the actual outputs of doctest examples." msgstr "" -#: ../../library/doctest.rst:1462 +#: ../../library/doctest.rst:1469 msgid "" "The optional keyword argument *verbose* controls the :class:" "`DocTestRunner`'s verbosity. If *verbose* is ``True``, then information is " @@ -1608,56 +1618,56 @@ msgid "" "verbose output is used iff the command-line switch ``-v`` is used." msgstr "" -#: ../../library/doctest.rst:1468 +#: ../../library/doctest.rst:1475 msgid "" "The optional keyword argument *optionflags* can be used to control how the " "test runner compares expected output to actual output, and how it displays " "failures. For more information, see section :ref:`doctest-options`." msgstr "" -#: ../../library/doctest.rst:1478 +#: ../../library/doctest.rst:1485 msgid "" "Report that the test runner is about to process the given example. This " "method is provided to allow subclasses of :class:`DocTestRunner` to " "customize their output; it should not be called directly." msgstr "" -#: ../../library/doctest.rst:1482 +#: ../../library/doctest.rst:1489 msgid "" "*example* is the example about to be processed. *test* is the test " "*containing example*. *out* is the output function that was passed to :meth:" "`DocTestRunner.run`." msgstr "" -#: ../../library/doctest.rst:1489 +#: ../../library/doctest.rst:1496 msgid "" "Report that the given example ran successfully. This method is provided to " "allow subclasses of :class:`DocTestRunner` to customize their output; it " "should not be called directly." msgstr "" -#: ../../library/doctest.rst:1493 ../../library/doctest.rst:1504 +#: ../../library/doctest.rst:1500 ../../library/doctest.rst:1511 msgid "" "*example* is the example about to be processed. *got* is the actual output " "from the example. *test* is the test containing *example*. *out* is the " "output function that was passed to :meth:`DocTestRunner.run`." msgstr "" -#: ../../library/doctest.rst:1500 +#: ../../library/doctest.rst:1507 msgid "" "Report that the given example failed. This method is provided to allow " "subclasses of :class:`DocTestRunner` to customize their output; it should " "not be called directly." msgstr "" -#: ../../library/doctest.rst:1511 +#: ../../library/doctest.rst:1518 msgid "" "Report that the given example raised an unexpected exception. This method is " "provided to allow subclasses of :class:`DocTestRunner` to customize their " "output; it should not be called directly." msgstr "" -#: ../../library/doctest.rst:1515 +#: ../../library/doctest.rst:1522 msgid "" "*example* is the example about to be processed. *exc_info* is a tuple " "containing information about the unexpected exception (as returned by :func:" @@ -1665,13 +1675,13 @@ msgid "" "output function that was passed to :meth:`DocTestRunner.run`." msgstr "" -#: ../../library/doctest.rst:1523 +#: ../../library/doctest.rst:1530 msgid "" "Run the examples in *test* (a :class:`DocTest` object), and display the " "results using the writer function *out*." msgstr "" -#: ../../library/doctest.rst:1526 +#: ../../library/doctest.rst:1533 msgid "" "The examples are run in the namespace ``test.globs``. If *clear_globs* is " "true (the default), then this namespace will be cleared after the test runs, " @@ -1679,39 +1689,39 @@ msgid "" "after the test completes, then use *clear_globs=False*." msgstr "" -#: ../../library/doctest.rst:1531 +#: ../../library/doctest.rst:1538 msgid "" "*compileflags* gives the set of flags that should be used by the Python " "compiler when running the examples. If not specified, then it will default " "to the set of future-import flags that apply to *globs*." msgstr "" -#: ../../library/doctest.rst:1535 +#: ../../library/doctest.rst:1542 msgid "" "The output of each example is checked using the :class:`DocTestRunner`'s " -"output checker, and the results are formatted by the :meth:`DocTestRunner." +"output checker, and the results are formatted by the :meth:`!DocTestRunner." "report_\\*` methods." msgstr "" -#: ../../library/doctest.rst:1542 +#: ../../library/doctest.rst:1549 msgid "" "Print a summary of all the test cases that have been run by this " "DocTestRunner, and return a :term:`named tuple` ``TestResults(failed, " "attempted)``." msgstr "" -#: ../../library/doctest.rst:1545 +#: ../../library/doctest.rst:1552 msgid "" "The optional *verbose* argument controls how detailed the summary is. If " "the verbosity is not specified, then the :class:`DocTestRunner`'s verbosity " "is used." msgstr "" -#: ../../library/doctest.rst:1552 +#: ../../library/doctest.rst:1559 msgid "OutputChecker objects" msgstr "OutputChecker 物件" -#: ../../library/doctest.rst:1557 +#: ../../library/doctest.rst:1564 msgid "" "A class used to check the whether the actual output from a doctest example " "matches the expected output. :class:`OutputChecker` defines two methods: :" @@ -1720,11 +1730,11 @@ msgid "" "string describing the differences between two outputs." msgstr "" -#: ../../library/doctest.rst:1564 +#: ../../library/doctest.rst:1571 msgid ":class:`OutputChecker` defines the following methods:" msgstr "" -#: ../../library/doctest.rst:1568 +#: ../../library/doctest.rst:1575 msgid "" "Return ``True`` iff the actual output from an example (*got*) matches the " "expected output (*want*). These strings are always considered to match if " @@ -1733,28 +1743,28 @@ msgid "" "`doctest-options` for more information about option flags." msgstr "" -#: ../../library/doctest.rst:1577 +#: ../../library/doctest.rst:1584 msgid "" "Return a string describing the differences between the expected output for a " "given example (*example*) and the actual output (*got*). *optionflags* is " "the set of option flags used to compare *want* and *got*." msgstr "" -#: ../../library/doctest.rst:1585 +#: ../../library/doctest.rst:1592 msgid "Debugging" msgstr "" -#: ../../library/doctest.rst:1587 +#: ../../library/doctest.rst:1594 msgid "Doctest provides several mechanisms for debugging doctest examples:" msgstr "" -#: ../../library/doctest.rst:1589 +#: ../../library/doctest.rst:1596 msgid "" "Several functions convert doctests to executable Python programs, which can " "be run under the Python debugger, :mod:`pdb`." msgstr "" -#: ../../library/doctest.rst:1592 +#: ../../library/doctest.rst:1599 msgid "" "The :class:`DebugRunner` class is a subclass of :class:`DocTestRunner` that " "raises an exception for the first failing example, containing information " @@ -1762,13 +1772,13 @@ msgid "" "debugging on the example." msgstr "" -#: ../../library/doctest.rst:1597 +#: ../../library/doctest.rst:1604 msgid "" "The :mod:`unittest` cases generated by :func:`DocTestSuite` support the :" "meth:`debug` method defined by :class:`unittest.TestCase`." msgstr "" -#: ../../library/doctest.rst:1600 +#: ../../library/doctest.rst:1607 msgid "" "You can add a call to :func:`pdb.set_trace` in a doctest example, and you'll " "drop into the Python debugger when that line is executed. Then you can " @@ -1776,21 +1786,21 @@ msgid "" "`a.py` contains just this module docstring::" msgstr "" -#: ../../library/doctest.rst:1615 +#: ../../library/doctest.rst:1622 msgid "Then an interactive Python session may look like this::" msgstr "" -#: ../../library/doctest.rst:1648 +#: ../../library/doctest.rst:1655 msgid "" "Functions that convert doctests to Python code, and possibly run the " "synthesized code under the debugger:" msgstr "" -#: ../../library/doctest.rst:1654 +#: ../../library/doctest.rst:1661 msgid "Convert text with examples to a script." msgstr "" -#: ../../library/doctest.rst:1656 +#: ../../library/doctest.rst:1663 msgid "" "Argument *s* is a string containing doctest examples. The string is " "converted to a Python script, where doctest examples in *s* are converted to " @@ -1798,42 +1808,42 @@ msgid "" "generated script is returned as a string. For example, ::" msgstr "" -#: ../../library/doctest.rst:1671 +#: ../../library/doctest.rst:1678 msgid "displays::" msgstr "" -#: ../../library/doctest.rst:1681 +#: ../../library/doctest.rst:1688 msgid "" "This function is used internally by other functions (see below), but can " "also be useful when you want to transform an interactive Python session into " "a Python script." msgstr "" -#: ../../library/doctest.rst:1688 +#: ../../library/doctest.rst:1695 msgid "Convert the doctest for an object to a script." msgstr "" -#: ../../library/doctest.rst:1690 +#: ../../library/doctest.rst:1697 msgid "" "Argument *module* is a module object, or dotted name of a module, containing " "the object whose doctests are of interest. Argument *name* is the name " "(within the module) of the object with the doctests of interest. The result " "is a string, containing the object's docstring converted to a Python script, " "as described for :func:`script_from_examples` above. For example, if " -"module :file:`a.py` contains a top-level function :func:`f`, then ::" +"module :file:`a.py` contains a top-level function :func:`!f`, then ::" msgstr "" -#: ../../library/doctest.rst:1700 +#: ../../library/doctest.rst:1707 msgid "" -"prints a script version of function :func:`f`'s docstring, with doctests " +"prints a script version of function :func:`!f`'s docstring, with doctests " "converted to code, and the rest placed in comments." msgstr "" -#: ../../library/doctest.rst:1706 +#: ../../library/doctest.rst:1713 msgid "Debug the doctests for an object." msgstr "" -#: ../../library/doctest.rst:1708 +#: ../../library/doctest.rst:1715 msgid "" "The *module* and *name* arguments are the same as for function :func:" "`testsource` above. The synthesized Python script for the named object's " @@ -1841,13 +1851,13 @@ msgid "" "the control of the Python debugger, :mod:`pdb`." msgstr "" -#: ../../library/doctest.rst:1713 +#: ../../library/doctest.rst:1720 msgid "" "A shallow copy of ``module.__dict__`` is used for both local and global " "execution context." msgstr "" -#: ../../library/doctest.rst:1716 +#: ../../library/doctest.rst:1723 msgid "" "Optional argument *pm* controls whether post-mortem debugging is used. If " "*pm* has a true value, the script file is run directly, and the debugger " @@ -1859,30 +1869,30 @@ msgid "" "to :func:`pdb.run`." msgstr "" -#: ../../library/doctest.rst:1727 +#: ../../library/doctest.rst:1734 msgid "Debug the doctests in a string." msgstr "" -#: ../../library/doctest.rst:1729 +#: ../../library/doctest.rst:1736 msgid "" "This is like function :func:`debug` above, except that a string containing " "doctest examples is specified directly, via the *src* argument." msgstr "" -#: ../../library/doctest.rst:1732 +#: ../../library/doctest.rst:1739 msgid "" "Optional argument *pm* has the same meaning as in function :func:`debug` " "above." msgstr "" -#: ../../library/doctest.rst:1734 +#: ../../library/doctest.rst:1741 msgid "" "Optional argument *globs* gives a dictionary to use as both local and global " "execution context. If not specified, or ``None``, an empty dictionary is " "used. If specified, a shallow copy of the dictionary is used." msgstr "" -#: ../../library/doctest.rst:1739 +#: ../../library/doctest.rst:1746 msgid "" "The :class:`DebugRunner` class, and the special exceptions it may raise, are " "of most interest to testing framework authors, and will only be sketched " @@ -1890,7 +1900,7 @@ msgid "" "(which is a doctest!) for more details:" msgstr "" -#: ../../library/doctest.rst:1747 +#: ../../library/doctest.rst:1754 msgid "" "A subclass of :class:`DocTestRunner` that raises an exception as soon as a " "failure is encountered. If an unexpected exception occurs, an :exc:" @@ -1900,89 +1910,89 @@ msgid "" "the actual output." msgstr "" -#: ../../library/doctest.rst:1754 +#: ../../library/doctest.rst:1761 msgid "" "For information about the constructor parameters and methods, see the " "documentation for :class:`DocTestRunner` in section :ref:`doctest-advanced-" "api`." msgstr "" -#: ../../library/doctest.rst:1757 +#: ../../library/doctest.rst:1764 msgid "" "There are two exceptions that may be raised by :class:`DebugRunner` " "instances:" msgstr "" -#: ../../library/doctest.rst:1762 +#: ../../library/doctest.rst:1769 msgid "" "An exception raised by :class:`DocTestRunner` to signal that a doctest " "example's actual output did not match its expected output. The constructor " "arguments are used to initialize the attributes of the same names." msgstr "" -#: ../../library/doctest.rst:1766 +#: ../../library/doctest.rst:1773 msgid ":exc:`DocTestFailure` defines the following attributes:" msgstr "" -#: ../../library/doctest.rst:1771 ../../library/doctest.rst:1795 +#: ../../library/doctest.rst:1778 ../../library/doctest.rst:1802 msgid "The :class:`DocTest` object that was being run when the example failed." msgstr "" -#: ../../library/doctest.rst:1776 ../../library/doctest.rst:1800 +#: ../../library/doctest.rst:1783 ../../library/doctest.rst:1807 msgid "The :class:`Example` that failed." msgstr "" -#: ../../library/doctest.rst:1781 +#: ../../library/doctest.rst:1788 msgid "The example's actual output." msgstr "" -#: ../../library/doctest.rst:1786 +#: ../../library/doctest.rst:1793 msgid "" "An exception raised by :class:`DocTestRunner` to signal that a doctest " "example raised an unexpected exception. The constructor arguments are used " "to initialize the attributes of the same names." msgstr "" -#: ../../library/doctest.rst:1790 +#: ../../library/doctest.rst:1797 msgid ":exc:`UnexpectedException` defines the following attributes:" msgstr "" -#: ../../library/doctest.rst:1805 +#: ../../library/doctest.rst:1812 msgid "" "A tuple containing information about the unexpected exception, as returned " "by :func:`sys.exc_info`." msgstr "" -#: ../../library/doctest.rst:1812 +#: ../../library/doctest.rst:1819 msgid "Soapbox" msgstr "" -#: ../../library/doctest.rst:1814 +#: ../../library/doctest.rst:1821 msgid "" "As mentioned in the introduction, :mod:`doctest` has grown to have three " "primary uses:" msgstr "" -#: ../../library/doctest.rst:1817 +#: ../../library/doctest.rst:1824 msgid "Checking examples in docstrings." msgstr "" -#: ../../library/doctest.rst:1819 +#: ../../library/doctest.rst:1826 msgid "Regression testing." msgstr "" -#: ../../library/doctest.rst:1821 +#: ../../library/doctest.rst:1828 msgid "Executable documentation / literate testing." msgstr "" -#: ../../library/doctest.rst:1823 +#: ../../library/doctest.rst:1830 msgid "" "These uses have different requirements, and it is important to distinguish " "them. In particular, filling your docstrings with obscure test cases makes " "for bad documentation." msgstr "" -#: ../../library/doctest.rst:1827 +#: ../../library/doctest.rst:1834 msgid "" "When writing a docstring, choose docstring examples with care. There's an " "art to this that needs to be learned---it may not be natural at first. " @@ -1994,7 +2004,7 @@ msgid "" "\"harmless\" change." msgstr "" -#: ../../library/doctest.rst:1835 +#: ../../library/doctest.rst:1842 msgid "" "Doctest also makes an excellent tool for regression testing, especially if " "you don't skimp on explanatory text. By interleaving prose and examples, it " @@ -2015,13 +2025,13 @@ msgid "" "different results, blurring the distinction between testing and explaining." msgstr "" -#: ../../library/doctest.rst:1853 +#: ../../library/doctest.rst:1860 msgid "" "Regression testing is best confined to dedicated objects or files. There " "are several options for organizing tests:" msgstr "" -#: ../../library/doctest.rst:1856 +#: ../../library/doctest.rst:1863 msgid "" "Write text files containing test cases as interactive examples, and test the " "files using :func:`testfile` or :func:`DocFileSuite`. This is recommended, " @@ -2029,7 +2039,7 @@ msgid "" "doctest." msgstr "" -#: ../../library/doctest.rst:1861 +#: ../../library/doctest.rst:1868 msgid "" "Define functions named ``_regrtest_topic`` that consist of single " "docstrings, containing test cases for the named topics. These functions can " @@ -2037,13 +2047,13 @@ msgid "" "test file." msgstr "" -#: ../../library/doctest.rst:1865 +#: ../../library/doctest.rst:1872 msgid "" "Define a ``__test__`` dictionary mapping from regression test topics to " "docstrings containing test cases." msgstr "" -#: ../../library/doctest.rst:1868 +#: ../../library/doctest.rst:1875 msgid "" "When you have placed your tests in a module, the module can itself be the " "test runner. When a test fails, you can arrange for your test runner to re-" @@ -2051,11 +2061,11 @@ msgid "" "example of such a test runner::" msgstr "" -#: ../../library/doctest.rst:1890 +#: ../../library/doctest.rst:1897 msgid "Footnotes" msgstr "註解" -#: ../../library/doctest.rst:1891 +#: ../../library/doctest.rst:1898 msgid "" "Examples containing both expected output and an exception are not supported. " "Trying to guess where one ends and the other begins is too error-prone, and " diff --git a/library/email.charset.po b/library/email.charset.po index 72c705d2cd..513b7b2e7f 100644 --- a/library/email.charset.po +++ b/library/email.charset.po @@ -31,15 +31,14 @@ msgid "" "This module is part of the legacy (``Compat32``) email API. In the new API " "only the aliases table is used." msgstr "" -"此模組是舊版 (``Compat32``) email API的其中一部份,在新版的 API " -"只有使用別名表。" +"此模組是舊版 (``Compat32``) email API的其中一部份,在新版的 API 只有使用別名" +"表。" #: ../../library/email.charset.rst:14 msgid "" "The remaining text in this section is the original documentation of the " "module." -msgstr "" -"此章節的其餘文字是原始模組的說明文件" +msgstr "此章節的其餘文字是原始模組的說明文件" #: ../../library/email.charset.rst:16 msgid "" @@ -49,9 +48,9 @@ msgid "" "Instances of :class:`Charset` are used in several other modules within the :" "mod:`email` package." msgstr "" -"此模組提供一個 class(類別) :class:`Charset` 來表示電子郵件中的字元" -"集合和字元集合轉換,以及字元集合登錄檔 (registry) 和其他許多便捷的方法以運用此登錄檔。" -"在 :mod:`email` 套件中有許多其他模組使用 :class:`Charset` 的實例。" +"此模組提供一個 class(類別) :class:`Charset` 來表示電子郵件中的字元集合和字" +"元集合轉換,以及字元集合登錄檔 (registry) 和其他許多便捷的方法以運用此登錄" +"檔。在 :mod:`email` 套件中有許多其他模組使用 :class:`Charset` 的實例。" #: ../../library/email.charset.rst:22 msgid "Import this class from the :mod:`email.charset` module." diff --git a/library/email.errors.po b/library/email.errors.po index 65fd76a9da..89a55a81c7 100644 --- a/library/email.errors.po +++ b/library/email.errors.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2023-11-27 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -80,7 +80,19 @@ msgid "" "`~email.mime.image.MIMEImage`)." msgstr "" -#: ../../library/email.errors.rst:62 +#: ../../library/email.errors.rst:63 +msgid "" +"This is the base class for all defects found when parsing email messages. It " +"is derived from :exc:`ValueError`." +msgstr "" + +#: ../../library/email.errors.rst:68 +msgid "" +"This is the base class for all defects found when parsing email headers. It " +"is derived from :exc:`MessageDefect`." +msgstr "" + +#: ../../library/email.errors.rst:71 msgid "" "Here is the list of the defects that the :class:`~email.parser.FeedParser` " "can find while parsing messages. Note that the defects are added to the " @@ -90,59 +102,59 @@ msgid "" "not." msgstr "" -#: ../../library/email.errors.rst:68 +#: ../../library/email.errors.rst:77 msgid "" "All defect classes are subclassed from :class:`email.errors.MessageDefect`." msgstr "" -#: ../../library/email.errors.rst:70 +#: ../../library/email.errors.rst:79 msgid "" ":class:`NoBoundaryInMultipartDefect` -- A message claimed to be a multipart, " "but had no :mimetype:`boundary` parameter." msgstr "" -#: ../../library/email.errors.rst:73 +#: ../../library/email.errors.rst:82 msgid "" ":class:`StartBoundaryNotFoundDefect` -- The start boundary claimed in the :" "mailheader:`Content-Type` header was never found." msgstr "" -#: ../../library/email.errors.rst:76 +#: ../../library/email.errors.rst:85 msgid "" ":class:`CloseBoundaryNotFoundDefect` -- A start boundary was found, but no " "corresponding close boundary was ever found." msgstr "" -#: ../../library/email.errors.rst:81 +#: ../../library/email.errors.rst:90 msgid "" ":class:`FirstHeaderLineIsContinuationDefect` -- The message had a " "continuation line as its first header line." msgstr "" -#: ../../library/email.errors.rst:84 +#: ../../library/email.errors.rst:93 msgid "" ":class:`MisplacedEnvelopeHeaderDefect` - A \"Unix From\" header was found in " "the middle of a header block." msgstr "" -#: ../../library/email.errors.rst:87 +#: ../../library/email.errors.rst:96 msgid "" ":class:`MissingHeaderBodySeparatorDefect` - A line was found while parsing " "headers that had no leading white space but contained no ':'. Parsing " "continues assuming that the line represents the first line of the body." msgstr "" -#: ../../library/email.errors.rst:93 +#: ../../library/email.errors.rst:102 msgid "" ":class:`MalformedHeaderDefect` -- A header was found that was missing a " "colon, or was otherwise malformed." msgstr "" -#: ../../library/email.errors.rst:96 +#: ../../library/email.errors.rst:105 msgid "This defect has not been used for several Python versions." msgstr "" -#: ../../library/email.errors.rst:99 +#: ../../library/email.errors.rst:108 msgid "" ":class:`MultipartInvariantViolationDefect` -- A message claimed to be a :" "mimetype:`multipart`, but no subparts were found. Note that when a message " @@ -151,28 +163,28 @@ msgid "" "`multipart`." msgstr "" -#: ../../library/email.errors.rst:104 +#: ../../library/email.errors.rst:113 msgid "" ":class:`InvalidBase64PaddingDefect` -- When decoding a block of base64 " "encoded bytes, the padding was not correct. Enough padding is added to " "perform the decode, but the resulting decoded bytes may be invalid." msgstr "" -#: ../../library/email.errors.rst:108 +#: ../../library/email.errors.rst:117 msgid "" ":class:`InvalidBase64CharactersDefect` -- When decoding a block of base64 " "encoded bytes, characters outside the base64 alphabet were encountered. The " "characters are ignored, but the resulting decoded bytes may be invalid." msgstr "" -#: ../../library/email.errors.rst:112 +#: ../../library/email.errors.rst:121 msgid "" ":class:`InvalidBase64LengthDefect` -- When decoding a block of base64 " "encoded bytes, the number of non-padding base64 characters was invalid (1 " "more than a multiple of 4). The encoded block was kept as-is." msgstr "" -#: ../../library/email.errors.rst:116 +#: ../../library/email.errors.rst:125 msgid "" ":class:`InvalidDateDefect` -- When decoding an invalid or unparsable date " "field. The original value is kept as-is." diff --git a/library/email.header.po b/library/email.header.po index 835449f5be..05707167b9 100644 --- a/library/email.header.po +++ b/library/email.header.po @@ -204,9 +204,9 @@ msgstr "" #: ../../library/email.header.rst:138 msgid "" "*linesep* specifies the characters used to separate the lines of the folded " -"header. It defaults to the most useful value for Python application code (``" -"\\n``), but ``\\r\\n`` can be specified in order to produce headers with RFC-" -"compliant line separators." +"header. It defaults to the most useful value for Python application code " +"(``\\n``), but ``\\r\\n`` can be specified in order to produce headers with " +"RFC-compliant line separators." msgstr "" #: ../../library/email.header.rst:143 diff --git a/library/email.headerregistry.po b/library/email.headerregistry.po index 543287e4df..0d4af9184e 100644 --- a/library/email.headerregistry.po +++ b/library/email.headerregistry.po @@ -181,8 +181,8 @@ msgstr "" msgid "" ":rfc:`5322` specifies a very specific format for dates within email headers. " "The ``DateHeader`` parser recognizes that date format, as well as " -"recognizing a number of variant forms that are sometimes found \"in the wild" -"\"." +"recognizing a number of variant forms that are sometimes found \"in the " +"wild\"." msgstr "" #: ../../library/email.headerregistry.rst:146 diff --git a/library/enum.po b/library/enum.po index 2054456150..44112272ff 100644 --- a/library/enum.po +++ b/library/enum.po @@ -868,8 +868,8 @@ msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." msgstr "" -":attr:`~EnumType.__members__` 是一個唯讀有序的\\ ``成員名稱``:``成員``\\ 項目的" -"對映。只有在類別上可用。" +":attr:`~EnumType.__members__` 是一個唯讀有序的\\ ``成員名稱``:``成員``\\ 項" +"目的對映。只有在類別上可用。" #: ../../library/enum.rst:772 msgid "" diff --git a/library/exceptions.po b/library/exceptions.po index 903b7da466..8a04074753 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: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-12-06 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-" @@ -490,51 +490,52 @@ msgid "" "produced by the iterator." msgstr "" -#: ../../library/exceptions.rst:432 +#: ../../library/exceptions.rst:434 msgid "" -"The exception object has a single attribute :attr:`value`, which is given as " -"an argument when constructing the exception, and defaults to :const:`None`." +"The exception object has a single attribute :attr:`!value`, which is given " +"as an argument when constructing the exception, and defaults to :const:" +"`None`." msgstr "" -#: ../../library/exceptions.rst:436 +#: ../../library/exceptions.rst:438 msgid "" "When a :term:`generator` or :term:`coroutine` function returns, a new :exc:" "`StopIteration` instance is raised, and the value returned by the function " "is used as the :attr:`value` parameter to the constructor of the exception." msgstr "" -#: ../../library/exceptions.rst:441 +#: ../../library/exceptions.rst:443 msgid "" "If a generator code directly or indirectly raises :exc:`StopIteration`, it " "is converted into a :exc:`RuntimeError` (retaining the :exc:`StopIteration` " "as the new exception's cause)." msgstr "" -#: ../../library/exceptions.rst:445 +#: ../../library/exceptions.rst:447 msgid "" "Added ``value`` attribute and the ability for generator functions to use it " "to return a value." msgstr "" -#: ../../library/exceptions.rst:449 +#: ../../library/exceptions.rst:451 msgid "" "Introduced the RuntimeError transformation via ``from __future__ import " "generator_stop``, see :pep:`479`." msgstr "" -#: ../../library/exceptions.rst:453 +#: ../../library/exceptions.rst:455 msgid "" "Enable :pep:`479` for all code by default: a :exc:`StopIteration` error " "raised in a generator is transformed into a :exc:`RuntimeError`." msgstr "" -#: ../../library/exceptions.rst:459 +#: ../../library/exceptions.rst:461 msgid "" "Must be raised by :meth:`~object.__anext__` method of an :term:`asynchronous " "iterator` object to stop the iteration." msgstr "" -#: ../../library/exceptions.rst:466 +#: ../../library/exceptions.rst:468 msgid "" "Raised when the parser encounters a syntax error. This may occur in an :" "keyword:`import` statement, in a call to the built-in functions :func:" @@ -542,45 +543,45 @@ msgid "" "or standard input (also interactively)." msgstr "" -#: ../../library/exceptions.rst:472 +#: ../../library/exceptions.rst:474 msgid "" "The :func:`str` of the exception instance returns only the error message. " "Details is a tuple whose members are also available as separate attributes." msgstr "" -#: ../../library/exceptions.rst:477 +#: ../../library/exceptions.rst:479 msgid "The name of the file the syntax error occurred in." msgstr "" -#: ../../library/exceptions.rst:481 +#: ../../library/exceptions.rst:483 msgid "" "Which line number in the file the error occurred in. This is 1-indexed: the " "first line in the file has a ``lineno`` of 1." msgstr "" -#: ../../library/exceptions.rst:486 +#: ../../library/exceptions.rst:488 msgid "" "The column in the line where the error occurred. This is 1-indexed: the " "first character in the line has an ``offset`` of 1." msgstr "" -#: ../../library/exceptions.rst:491 +#: ../../library/exceptions.rst:493 msgid "The source code text involved in the error." msgstr "" -#: ../../library/exceptions.rst:495 +#: ../../library/exceptions.rst:497 msgid "" "Which line number in the file the error occurred ends in. This is 1-indexed: " "the first line in the file has a ``lineno`` of 1." msgstr "" -#: ../../library/exceptions.rst:500 +#: ../../library/exceptions.rst:502 msgid "" "The column in the end line where the error occurred finishes. This is 1-" "indexed: the first character in the line has an ``offset`` of 1." msgstr "" -#: ../../library/exceptions.rst:503 +#: ../../library/exceptions.rst:505 msgid "" "For errors in f-string fields, the message is prefixed by \"f-string: \" and " "the offsets are offsets in a text constructed from the replacement " @@ -588,30 +589,30 @@ msgid "" "attribute: ('f-string: ...', ('', 1, 2, '(a b)\\n', 1, 5))." msgstr "" -#: ../../library/exceptions.rst:508 +#: ../../library/exceptions.rst:510 msgid "Added the :attr:`end_lineno` and :attr:`end_offset` attributes." msgstr "新增 :attr:`end_lineno` 與 :attr:`end_offset` 屬性。" -#: ../../library/exceptions.rst:513 +#: ../../library/exceptions.rst:515 msgid "" "Base class for syntax errors related to incorrect indentation. This is a " "subclass of :exc:`SyntaxError`." msgstr "" -#: ../../library/exceptions.rst:519 +#: ../../library/exceptions.rst:521 msgid "" "Raised when indentation contains an inconsistent use of tabs and spaces. " "This is a subclass of :exc:`IndentationError`." msgstr "" -#: ../../library/exceptions.rst:525 +#: ../../library/exceptions.rst:527 msgid "" "Raised when the interpreter finds an internal error, but the situation does " "not look so serious to cause it to abandon all hope. The associated value is " "a string indicating what went wrong (in low-level terms)." msgstr "" -#: ../../library/exceptions.rst:529 +#: ../../library/exceptions.rst:531 msgid "" "You should report this to the author or maintainer of your Python " "interpreter. Be sure to report the version of the Python interpreter (``sys." @@ -620,7 +621,7 @@ msgid "" "possible the source of the program that triggered the error." msgstr "" -#: ../../library/exceptions.rst:538 +#: ../../library/exceptions.rst:540 msgid "" "This exception is raised by the :func:`sys.exit` function. It inherits " "from :exc:`BaseException` instead of :exc:`Exception` so that it is not " @@ -634,7 +635,7 @@ msgid "" "printed and the exit status is one." msgstr "" -#: ../../library/exceptions.rst:549 +#: ../../library/exceptions.rst:551 msgid "" "A call to :func:`sys.exit` is translated into an exception so that clean-up " "handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be " @@ -644,20 +645,20 @@ msgid "" "child process after a call to :func:`os.fork`)." msgstr "" -#: ../../library/exceptions.rst:558 +#: ../../library/exceptions.rst:560 msgid "" "The exit status or error message that is passed to the constructor. " "(Defaults to ``None``.)" msgstr "" -#: ../../library/exceptions.rst:564 +#: ../../library/exceptions.rst:566 msgid "" "Raised when an operation or function is applied to an object of " "inappropriate type. The associated value is a string giving details about " "the type mismatch." msgstr "" -#: ../../library/exceptions.rst:567 +#: ../../library/exceptions.rst:569 msgid "" "This exception may be raised by user code to indicate that an attempted " "operation on an object is not supported, and is not meant to be. If an " @@ -665,7 +666,7 @@ msgid "" "implementation, :exc:`NotImplementedError` is the proper exception to raise." msgstr "" -#: ../../library/exceptions.rst:572 +#: ../../library/exceptions.rst:574 msgid "" "Passing arguments of the wrong type (e.g. passing a :class:`list` when an :" "class:`int` is expected) should result in a :exc:`TypeError`, but passing " @@ -673,99 +674,99 @@ msgid "" "should result in a :exc:`ValueError`." msgstr "" -#: ../../library/exceptions.rst:579 +#: ../../library/exceptions.rst:581 msgid "" "Raised when a reference is made to a local variable in a function or method, " "but no value has been bound to that variable. This is a subclass of :exc:" "`NameError`." msgstr "" -#: ../../library/exceptions.rst:586 +#: ../../library/exceptions.rst:588 msgid "" "Raised when a Unicode-related encoding or decoding error occurs. It is a " "subclass of :exc:`ValueError`." msgstr "" -#: ../../library/exceptions.rst:589 +#: ../../library/exceptions.rst:591 msgid "" ":exc:`UnicodeError` has attributes that describe the encoding or decoding " "error. For example, ``err.object[err.start:err.end]`` gives the particular " "invalid input that the codec failed on." msgstr "" -#: ../../library/exceptions.rst:595 +#: ../../library/exceptions.rst:597 msgid "The name of the encoding that raised the error." msgstr "" -#: ../../library/exceptions.rst:599 +#: ../../library/exceptions.rst:601 msgid "A string describing the specific codec error." msgstr "" -#: ../../library/exceptions.rst:603 +#: ../../library/exceptions.rst:605 msgid "The object the codec was attempting to encode or decode." msgstr "" -#: ../../library/exceptions.rst:607 +#: ../../library/exceptions.rst:609 msgid "The first index of invalid data in :attr:`object`." msgstr "" -#: ../../library/exceptions.rst:611 +#: ../../library/exceptions.rst:613 msgid "The index after the last invalid data in :attr:`object`." msgstr "" -#: ../../library/exceptions.rst:616 +#: ../../library/exceptions.rst:618 msgid "" "Raised when a Unicode-related error occurs during encoding. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:622 +#: ../../library/exceptions.rst:624 msgid "" "Raised when a Unicode-related error occurs during decoding. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:628 +#: ../../library/exceptions.rst:630 msgid "" "Raised when a Unicode-related error occurs during translating. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:634 +#: ../../library/exceptions.rst:636 msgid "" "Raised when an operation or function receives an argument that has the right " "type but an inappropriate value, and the situation is not described by a " "more precise exception such as :exc:`IndexError`." msgstr "" -#: ../../library/exceptions.rst:641 +#: ../../library/exceptions.rst:643 msgid "" "Raised when the second argument of a division or modulo operation is zero. " "The associated value is a string indicating the type of the operands and the " "operation." msgstr "" -#: ../../library/exceptions.rst:646 +#: ../../library/exceptions.rst:648 msgid "" "The following exceptions are kept for compatibility with previous versions; " "starting from Python 3.3, they are aliases of :exc:`OSError`." msgstr "" -#: ../../library/exceptions.rst:655 +#: ../../library/exceptions.rst:657 msgid "Only available on Windows." msgstr "" -#: ../../library/exceptions.rst:659 +#: ../../library/exceptions.rst:661 msgid "OS exceptions" msgstr "" -#: ../../library/exceptions.rst:661 +#: ../../library/exceptions.rst:663 msgid "" "The following exceptions are subclasses of :exc:`OSError`, they get raised " "depending on the system error code." msgstr "" -#: ../../library/exceptions.rst:666 +#: ../../library/exceptions.rst:668 msgid "" "Raised when an operation would block on an object (e.g. socket) set for non-" "blocking operation. Corresponds to :c:data:`errno` :py:const:`~errno." @@ -773,36 +774,36 @@ msgid "" "const:`~errno.EINPROGRESS`." msgstr "" -#: ../../library/exceptions.rst:671 +#: ../../library/exceptions.rst:673 msgid "" "In addition to those of :exc:`OSError`, :exc:`BlockingIOError` can have one " "more attribute:" msgstr "" -#: ../../library/exceptions.rst:676 +#: ../../library/exceptions.rst:678 msgid "" "An integer containing the number of characters written to the stream before " "it blocked. This attribute is available when using the buffered I/O classes " "from the :mod:`io` module." msgstr "" -#: ../../library/exceptions.rst:682 +#: ../../library/exceptions.rst:684 msgid "" "Raised when an operation on a child process failed. Corresponds to :c:data:" "`errno` :py:const:`~errno.ECHILD`." msgstr "" -#: ../../library/exceptions.rst:687 +#: ../../library/exceptions.rst:689 msgid "A base class for connection-related issues." msgstr "" -#: ../../library/exceptions.rst:689 +#: ../../library/exceptions.rst:691 msgid "" "Subclasses are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" "`ConnectionRefusedError` and :exc:`ConnectionResetError`." msgstr "" -#: ../../library/exceptions.rst:694 +#: ../../library/exceptions.rst:696 msgid "" "A subclass of :exc:`ConnectionError`, raised when trying to write on a pipe " "while the other end has been closed, or trying to write on a socket which " @@ -810,58 +811,58 @@ msgid "" "`~errno.EPIPE` and :py:const:`~errno.ESHUTDOWN`." msgstr "" -#: ../../library/exceptions.rst:701 +#: ../../library/exceptions.rst:703 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "aborted by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." "ECONNABORTED`." msgstr "" -#: ../../library/exceptions.rst:707 +#: ../../library/exceptions.rst:709 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "refused by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." "ECONNREFUSED`." msgstr "" -#: ../../library/exceptions.rst:713 +#: ../../library/exceptions.rst:715 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection is reset by " "the peer. Corresponds to :c:data:`errno` :py:const:`~errno.ECONNRESET`." msgstr "" -#: ../../library/exceptions.rst:719 +#: ../../library/exceptions.rst:721 msgid "" "Raised when trying to create a file or directory which already exists. " "Corresponds to :c:data:`errno` :py:const:`~errno.EEXIST`." msgstr "" -#: ../../library/exceptions.rst:724 +#: ../../library/exceptions.rst:726 msgid "" "Raised when a file or directory is requested but doesn't exist. Corresponds " "to :c:data:`errno` :py:const:`~errno.ENOENT`." msgstr "" -#: ../../library/exceptions.rst:729 +#: ../../library/exceptions.rst:731 msgid "" "Raised when a system call is interrupted by an incoming signal. Corresponds " "to :c:data:`errno` :py:const:`~errno.EINTR`." msgstr "" -#: ../../library/exceptions.rst:732 +#: ../../library/exceptions.rst:734 msgid "" "Python now retries system calls when a syscall is interrupted by a signal, " "except if the signal handler raises an exception (see :pep:`475` for the " "rationale), instead of raising :exc:`InterruptedError`." msgstr "" -#: ../../library/exceptions.rst:739 +#: ../../library/exceptions.rst:741 msgid "" "Raised when a file operation (such as :func:`os.remove`) is requested on a " "directory. Corresponds to :c:data:`errno` :py:const:`~errno.EISDIR`." msgstr "" -#: ../../library/exceptions.rst:745 +#: ../../library/exceptions.rst:747 msgid "" "Raised when a directory operation (such as :func:`os.listdir`) is requested " "on something which is not a directory. On most POSIX platforms, it may also " @@ -870,7 +871,7 @@ msgid "" "ENOTDIR`." msgstr "" -#: ../../library/exceptions.rst:753 +#: ../../library/exceptions.rst:755 msgid "" "Raised when trying to run an operation without the adequate access rights - " "for example filesystem permissions. Corresponds to :c:data:`errno` :py:const:" @@ -878,131 +879,131 @@ msgid "" "ENOTCAPABLE`." msgstr "" -#: ../../library/exceptions.rst:758 +#: ../../library/exceptions.rst:760 msgid "" "WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to :exc:" "`PermissionError`." msgstr "" -#: ../../library/exceptions.rst:764 +#: ../../library/exceptions.rst:766 msgid "" "Raised when a given process doesn't exist. Corresponds to :c:data:`errno` :" "py:const:`~errno.ESRCH`." msgstr "" -#: ../../library/exceptions.rst:769 +#: ../../library/exceptions.rst:771 msgid "" "Raised when a system function timed out at the system level. Corresponds to :" "c:data:`errno` :py:const:`~errno.ETIMEDOUT`." msgstr "" -#: ../../library/exceptions.rst:772 +#: ../../library/exceptions.rst:774 msgid "All the above :exc:`OSError` subclasses were added." msgstr "" -#: ../../library/exceptions.rst:778 +#: ../../library/exceptions.rst:780 msgid ":pep:`3151` - Reworking the OS and IO exception hierarchy" msgstr "" -#: ../../library/exceptions.rst:784 +#: ../../library/exceptions.rst:786 msgid "Warnings" msgstr "警告" -#: ../../library/exceptions.rst:786 +#: ../../library/exceptions.rst:788 msgid "" "The following exceptions are used as warning categories; see the :ref:" "`warning-categories` documentation for more details." msgstr "" -#: ../../library/exceptions.rst:791 +#: ../../library/exceptions.rst:793 msgid "Base class for warning categories." msgstr "" -#: ../../library/exceptions.rst:796 +#: ../../library/exceptions.rst:798 msgid "Base class for warnings generated by user code." msgstr "" -#: ../../library/exceptions.rst:801 +#: ../../library/exceptions.rst:803 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for other Python developers." msgstr "" -#: ../../library/exceptions.rst:804 +#: ../../library/exceptions.rst:806 msgid "" "Ignored by the default warning filters, except in the ``__main__`` module (:" "pep:`565`). Enabling the :ref:`Python Development Mode ` shows this " "warning." msgstr "" -#: ../../library/exceptions.rst:808 ../../library/exceptions.rst:824 +#: ../../library/exceptions.rst:810 ../../library/exceptions.rst:826 msgid "The deprecation policy is described in :pep:`387`." msgstr "" -#: ../../library/exceptions.rst:813 +#: ../../library/exceptions.rst:815 msgid "" "Base class for warnings about features which are obsolete and expected to be " "deprecated in the future, but are not deprecated at the moment." msgstr "" -#: ../../library/exceptions.rst:817 +#: ../../library/exceptions.rst:819 msgid "" "This class is rarely used as emitting a warning about a possible upcoming " "deprecation is unusual, and :exc:`DeprecationWarning` is preferred for " "already active deprecations." msgstr "" -#: ../../library/exceptions.rst:821 ../../library/exceptions.rst:847 -#: ../../library/exceptions.rst:874 +#: ../../library/exceptions.rst:823 ../../library/exceptions.rst:849 +#: ../../library/exceptions.rst:876 msgid "" "Ignored by the default warning filters. Enabling the :ref:`Python " "Development Mode ` shows this warning." msgstr "" -#: ../../library/exceptions.rst:829 +#: ../../library/exceptions.rst:831 msgid "Base class for warnings about dubious syntax." msgstr "" -#: ../../library/exceptions.rst:834 +#: ../../library/exceptions.rst:836 msgid "Base class for warnings about dubious runtime behavior." msgstr "" -#: ../../library/exceptions.rst:839 +#: ../../library/exceptions.rst:841 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for end users of applications that are written in Python." msgstr "" -#: ../../library/exceptions.rst:845 +#: ../../library/exceptions.rst:847 msgid "Base class for warnings about probable mistakes in module imports." msgstr "" -#: ../../library/exceptions.rst:853 +#: ../../library/exceptions.rst:855 msgid "Base class for warnings related to Unicode." msgstr "" -#: ../../library/exceptions.rst:858 +#: ../../library/exceptions.rst:860 msgid "Base class for warnings related to encodings." msgstr "" -#: ../../library/exceptions.rst:860 +#: ../../library/exceptions.rst:862 msgid "See :ref:`io-encoding-warning` for details." msgstr "細節請見 :ref:`io-encoding-warning`\\ 。" -#: ../../library/exceptions.rst:867 +#: ../../library/exceptions.rst:869 msgid "" "Base class for warnings related to :class:`bytes` and :class:`bytearray`." msgstr "" -#: ../../library/exceptions.rst:872 +#: ../../library/exceptions.rst:874 msgid "Base class for warnings related to resource usage." msgstr "" -#: ../../library/exceptions.rst:883 +#: ../../library/exceptions.rst:885 msgid "Exception groups" msgstr "" -#: ../../library/exceptions.rst:885 +#: ../../library/exceptions.rst:887 msgid "" "The following are used when it is necessary to raise multiple unrelated " "exceptions. They are part of the exception hierarchy so they can be handled " @@ -1011,7 +1012,7 @@ msgid "" "based on the types of the contained exceptions." msgstr "" -#: ../../library/exceptions.rst:894 +#: ../../library/exceptions.rst:896 msgid "" "Both of these exception types wrap the exceptions in the sequence ``excs``. " "The ``msg`` parameter must be a string. The difference between the two " @@ -1022,7 +1023,7 @@ msgid "" "exc:`BaseExceptionGroup`." msgstr "" -#: ../../library/exceptions.rst:902 +#: ../../library/exceptions.rst:904 msgid "" "The :exc:`BaseExceptionGroup` constructor returns an :exc:`ExceptionGroup` " "rather than a :exc:`BaseExceptionGroup` if all contained exceptions are :exc:" @@ -1031,23 +1032,23 @@ msgid "" "`TypeError` if any contained exception is not an :exc:`Exception` subclass." msgstr "" -#: ../../library/exceptions.rst:911 +#: ../../library/exceptions.rst:913 msgid "The ``msg`` argument to the constructor. This is a read-only attribute." msgstr "" -#: ../../library/exceptions.rst:915 +#: ../../library/exceptions.rst:917 msgid "" "A tuple of the exceptions in the ``excs`` sequence given to the constructor. " "This is a read-only attribute." msgstr "" -#: ../../library/exceptions.rst:920 +#: ../../library/exceptions.rst:922 msgid "" "Returns an exception group that contains only the exceptions from the " "current group that match *condition*, or ``None`` if the result is empty." msgstr "" -#: ../../library/exceptions.rst:923 +#: ../../library/exceptions.rst:925 msgid "" "The condition can be either a function that accepts an exception and returns " "true for those that should be in the subgroup, or it can be an exception " @@ -1055,7 +1056,7 @@ msgid "" "the same check that is used in an ``except`` clause." msgstr "" -#: ../../library/exceptions.rst:928 +#: ../../library/exceptions.rst:930 msgid "" "The nesting structure of the current exception is preserved in the result, " "as are the values of its :attr:`message`, :attr:`__traceback__`, :attr:" @@ -1063,34 +1064,34 @@ msgid "" "groups are omitted from the result." msgstr "" -#: ../../library/exceptions.rst:933 +#: ../../library/exceptions.rst:935 msgid "" "The condition is checked for all exceptions in the nested exception group, " "including the top-level and any nested exception groups. If the condition is " "true for such an exception group, it is included in the result in full." msgstr "" -#: ../../library/exceptions.rst:939 +#: ../../library/exceptions.rst:941 msgid "" "Like :meth:`subgroup`, but returns the pair ``(match, rest)`` where " "``match`` is ``subgroup(condition)`` and ``rest`` is the remaining non-" "matching part." msgstr "" -#: ../../library/exceptions.rst:945 +#: ../../library/exceptions.rst:947 msgid "" "Returns an exception group with the same :attr:`message`, but which wraps " "the exceptions in ``excs``." msgstr "" -#: ../../library/exceptions.rst:948 +#: ../../library/exceptions.rst:950 msgid "" "This method is used by :meth:`subgroup` and :meth:`split`. A subclass needs " "to override it in order to make :meth:`subgroup` and :meth:`split` return " "instances of the subclass rather than :exc:`ExceptionGroup`." msgstr "" -#: ../../library/exceptions.rst:953 +#: ../../library/exceptions.rst:955 msgid "" ":meth:`subgroup` and :meth:`split` copy the :attr:`__traceback__`, :attr:" "`__cause__`, :attr:`__context__` and :attr:`__notes__` fields from the " @@ -1098,7 +1099,7 @@ msgid "" "fields do not need to be updated by :meth:`derive`. ::" msgstr "" -#: ../../library/exceptions.rst:982 +#: ../../library/exceptions.rst:984 msgid "" "Note that :exc:`BaseExceptionGroup` defines :meth:`__new__`, so subclasses " "that need a different constructor signature need to override that rather " @@ -1107,18 +1108,18 @@ msgid "" "from it. ::" msgstr "" -#: ../../library/exceptions.rst:997 +#: ../../library/exceptions.rst:999 msgid "" "Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which " "is also a subclass of :exc:`Exception` can only wrap instances of :exc:" "`Exception`." msgstr "" -#: ../../library/exceptions.rst:1005 +#: ../../library/exceptions.rst:1007 msgid "Exception hierarchy" msgstr "" -#: ../../library/exceptions.rst:1007 +#: ../../library/exceptions.rst:1009 msgid "The class hierarchy for built-in exceptions is:" msgstr "" diff --git a/library/filesys.po b/library/filesys.po index d72a5b8f66..d29c99d064 100644 --- a/library/filesys.po +++ b/library/filesys.po @@ -32,8 +32,9 @@ msgid "" "manipulating paths in a portable way, and creating temporary files. The " "full list of modules in this chapter is:" msgstr "" -"本章中描述的 module(模組)用於處理硬碟檔案和目錄。例如,有一些 module 用於讀取檔案的屬性、以可攜" -" (portable) 方式操作路徑以及建立暫存檔。本章中的完整 module 清單是:" +"本章中描述的 module(模組)用於處理硬碟檔案和目錄。例如,有一些 module 用於讀" +"取檔案的屬性、以可攜 (portable) 方式操作路徑以及建立暫存檔。本章中的完整 " +"module 清單是:" #: ../../library/filesys.rst:31 msgid "Module :mod:`os`" @@ -44,7 +45,8 @@ msgid "" "Operating system interfaces, including functions to work with files at a " "lower level than Python :term:`file objects `." msgstr "" -"作業系統介面,包括處理比 Python :term:`檔案物件 `\\ 更低階檔案的函式。" +"作業系統介面,包括處理比 Python :term:`檔案物件 `\\ 更低階檔案的" +"函式。" #: ../../library/filesys.rst:35 msgid "Module :mod:`io`" @@ -54,7 +56,9 @@ msgstr "Module :mod:`io`" msgid "" "Python's built-in I/O library, including both abstract classes and some " "concrete classes such as file I/O." -msgstr "Python 的內建 I/O 函式庫,包含抽象類別和一些具體類別 (concrete class),如檔案 I/O。" +msgstr "" +"Python 的內建 I/O 函式庫,包含抽象類別和一些具體類別 (concrete class),如檔" +"案 I/O。" #: ../../library/filesys.rst:37 msgid "Built-in function :func:`open`" diff --git a/library/functions.po b/library/functions.po index 2b6a0f7429..563e50e541 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: 2023-10-20 00:03+0000\n" +"POT-Creation-Date: 2023-12-04 13:57+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-" @@ -399,23 +399,23 @@ msgstr ":func:`__import__`" #: ../../library/functions.rst:59 msgid "" "Return the absolute value of a number. The argument may be an integer, a " -"floating point number, or an object implementing :meth:`__abs__`. If the " -"argument is a complex number, its magnitude is returned." +"floating point number, or an object implementing :meth:`~object.__abs__`. If " +"the argument is a complex number, its magnitude is returned." msgstr "" -"回傳一個數的絕對值,引數可以是整數、浮點數或有實現 :meth:`__abs__` 的物件。如" -"果引數是一個複數,回傳它的純量(大小)。" +"回傳一個數的絕對值,引數可以是整數、浮點數或有實現 :meth:`~object.__abs__` 的" +"物件。如果引數是一個複數,回傳它的純量(大小)。" -#: ../../library/functions.rst:66 +#: ../../library/functions.rst:67 msgid "" "Return an :term:`asynchronous iterator` for an :term:`asynchronous " "iterable`. Equivalent to calling ``x.__aiter__()``." msgstr "" -#: ../../library/functions.rst:69 +#: ../../library/functions.rst:70 msgid "Note: Unlike :func:`iter`, :func:`aiter` has no 2-argument variant." msgstr "" -#: ../../library/functions.rst:75 +#: ../../library/functions.rst:76 msgid "" "Return ``True`` if all elements of the *iterable* are true (or if the " "iterable is empty). Equivalent to::" @@ -425,18 +425,18 @@ msgstr "" "\n" "::" -#: ../../library/functions.rst:88 +#: ../../library/functions.rst:89 msgid "" "When awaited, return the next item from the given :term:`asynchronous " "iterator`, or *default* if given and the iterator is exhausted." msgstr "" -#: ../../library/functions.rst:91 +#: ../../library/functions.rst:92 msgid "" "This is the async variant of the :func:`next` builtin, and behaves similarly." msgstr "" -#: ../../library/functions.rst:94 +#: ../../library/functions.rst:95 msgid "" "This calls the :meth:`~object.__anext__` method of *async_iterator*, " "returning an :term:`awaitable`. Awaiting this returns the next value of the " @@ -444,7 +444,7 @@ msgid "" "exhausted, otherwise :exc:`StopAsyncIteration` is raised." msgstr "" -#: ../../library/functions.rst:103 +#: ../../library/functions.rst:104 msgid "" "Return ``True`` if any element of the *iterable* is true. If the iterable " "is empty, return ``False``. Equivalent to::" @@ -454,7 +454,7 @@ msgstr "" "\n" "::" -#: ../../library/functions.rst:115 +#: ../../library/functions.rst:116 msgid "" "As :func:`repr`, return a string containing a printable representation of an " "object, but escape the non-ASCII characters in the string returned by :func:" @@ -465,7 +465,7 @@ msgstr "" "非 ASCII 編碼的字元會被跳脫 (escape),像是 ``\\x``、``\\u`` 和 ``\\U``。這個" "函式生成的字串和 Python 2 的 :func:`repr` 回傳的結果相似。" -#: ../../library/functions.rst:123 +#: ../../library/functions.rst:124 msgid "" "Convert an integer number to a binary string prefixed with \"0b\". The " "result is a valid Python expression. If *x* is not a Python :class:`int` " @@ -476,18 +476,18 @@ msgstr "" "算式。如果 *x* 不是 Python 的 :class:`int` 物件,那它需要定義 :meth:`~object." "__index__` method 回傳一個整數。舉例來說:" -#: ../../library/functions.rst:133 +#: ../../library/functions.rst:134 msgid "" "If the prefix \"0b\" is desired or not, you can use either of the following " "ways." msgstr "如果不一定需要 \"0b\" 前綴,還可以使用如下的方法。" -#: ../../library/functions.rst:140 ../../library/functions.rst:842 -#: ../../library/functions.rst:1159 +#: ../../library/functions.rst:141 ../../library/functions.rst:846 +#: ../../library/functions.rst:1164 msgid "See also :func:`format` for more information." msgstr "可參考 :func:`format` 獲取更多資訊。" -#: ../../library/functions.rst:145 +#: ../../library/functions.rst:146 msgid "" "Return a Boolean value, i.e. one of ``True`` or ``False``. *x* is converted " "using the standard :ref:`truth testing procedure `. If *x* is false " @@ -502,12 +502,12 @@ msgstr "" "(參見 :ref:`typesnumeric`),其他 class 不能繼承自它。它只有 ``False`` 和 " "``True`` 兩個實例(參見 :ref:`typebool`)。" -#: ../../library/functions.rst:154 ../../library/functions.rst:707 -#: ../../library/functions.rst:931 +#: ../../library/functions.rst:155 ../../library/functions.rst:711 +#: ../../library/functions.rst:935 msgid "*x* is now a positional-only parameter." msgstr "" -#: ../../library/functions.rst:159 +#: ../../library/functions.rst:160 msgid "" "This function drops you into the debugger at the call site. Specifically, " "it calls :func:`sys.breakpointhook`, passing ``args`` and ``kws`` straight " @@ -520,20 +520,20 @@ msgid "" "not accessible, this function will raise :exc:`RuntimeError`." msgstr "" -#: ../../library/functions.rst:171 +#: ../../library/functions.rst:172 msgid "" "By default, the behavior of :func:`breakpoint` can be changed with the :" "envvar:`PYTHONBREAKPOINT` environment variable. See :func:`sys." "breakpointhook` for usage details." msgstr "" -#: ../../library/functions.rst:175 +#: ../../library/functions.rst:176 msgid "" "Note that this is not guaranteed if :func:`sys.breakpointhook` has been " "replaced." msgstr "" -#: ../../library/functions.rst:178 +#: ../../library/functions.rst:179 msgid "" "Raises an :ref:`auditing event ` ``builtins.breakpoint`` with " "argument ``breakpointhook``." @@ -541,7 +541,7 @@ msgstr "" "引發一個附帶引數 ``breakpointhook`` 的\\ :ref:`稽核事件 ` " "``builtins.breakpoint``。" -#: ../../library/functions.rst:188 +#: ../../library/functions.rst:189 msgid "" "Return a new array of bytes. The :class:`bytearray` class is a mutable " "sequence of integers in the range 0 <= x < 256. It has most of the usual " @@ -553,13 +553,13 @@ msgstr "" "`typesseq-mutable` 中所述),同時也有 :class:`bytes` 型別大部分的 method,參" "見 :ref:`bytes-methods`。" -#: ../../library/functions.rst:193 +#: ../../library/functions.rst:194 msgid "" "The optional *source* parameter can be used to initialize the array in a few " "different ways:" msgstr "選擇性參數 *source* 可以被用來以不同的方式初始化陣列:" -#: ../../library/functions.rst:196 +#: ../../library/functions.rst:197 msgid "" "If it is a *string*, you must also give the *encoding* (and optionally, " "*errors*) parameters; :func:`bytearray` then converts the string to bytes " @@ -569,14 +569,14 @@ msgstr "" "*errors* );\\ :func:`bytearray` 會使用 :meth:`str.encode` method 來將 " "string 轉變成 bytes。" -#: ../../library/functions.rst:200 +#: ../../library/functions.rst:201 msgid "" "If it is an *integer*, the array will have that size and will be initialized " "with null bytes." msgstr "" "如果是一個 *integer*,陣列則會有該數值的長度,並以 null bytes 來當作初始值。" -#: ../../library/functions.rst:203 +#: ../../library/functions.rst:204 msgid "" "If it is an object conforming to the :ref:`buffer interface " "`, a read-only buffer of the object will be used to " @@ -585,7 +585,7 @@ msgstr "" "如果是一個符合 :ref:`buffer 介面 `\\ 的物件,該物件的唯讀 " "buffer 會被用來初始化 bytes 陣列。" -#: ../../library/functions.rst:206 +#: ../../library/functions.rst:207 msgid "" "If it is an *iterable*, it must be an iterable of integers in the range ``0 " "<= x < 256``, which are used as the initial contents of the array." @@ -593,15 +593,15 @@ msgstr "" "如果是一個 *iterable*,它的元素必須是範圍為 ``0 <= x < 256`` 的整數,並且會被" "用作陣列的初始值。" -#: ../../library/functions.rst:209 +#: ../../library/functions.rst:210 msgid "Without an argument, an array of size 0 is created." msgstr "如果沒有引數,則建立長度為 0 的陣列。" -#: ../../library/functions.rst:211 +#: ../../library/functions.rst:212 msgid "See also :ref:`binaryseq` and :ref:`typebytearray`." msgstr "可參考 :ref:`binaryseq` 和 :ref:`typebytearray`。" -#: ../../library/functions.rst:220 +#: ../../library/functions.rst:221 msgid "" "Return a new \"bytes\" object which is an immutable sequence of integers in " "the range ``0 <= x < 256``. :class:`bytes` is an immutable version of :" @@ -612,39 +612,39 @@ msgstr "" "變序列。:class:`bytes` 是 :class:`bytearray` 的不可變版本 — 它的同樣具備不改" "變物件的 method,也有相同的索引和切片操作。" -#: ../../library/functions.rst:225 +#: ../../library/functions.rst:226 msgid "" "Accordingly, constructor arguments are interpreted as for :func:`bytearray`." msgstr "因此,建構函式的引數和 :func:`bytearray` 相同。" -#: ../../library/functions.rst:227 +#: ../../library/functions.rst:228 msgid "Bytes objects can also be created with literals, see :ref:`strings`." msgstr "Bytes 物件還可以用文字建立,參見 :ref:`strings`。" -#: ../../library/functions.rst:229 +#: ../../library/functions.rst:230 msgid "See also :ref:`binaryseq`, :ref:`typebytes`, and :ref:`bytes-methods`." msgstr "可參考 :ref:`binaryseq`、\\ :ref:`typebytes` 和 :ref:`bytes-methods`。" -#: ../../library/functions.rst:234 +#: ../../library/functions.rst:235 msgid "" "Return :const:`True` if the *object* argument appears callable, :const:" "`False` if not. If this returns ``True``, it is still possible that a call " "fails, but if it is ``False``, calling *object* will never succeed. Note " "that classes are callable (calling a class returns a new instance); " -"instances are callable if their class has a :meth:`__call__` method." +"instances are callable if their class has a :meth:`~object.__call__` method." msgstr "" "如果引數 *object* 是可呼叫的,回傳 :const:`True`,否則回傳 :const:`False`。如" "果回傳 ``True``,呼叫仍可能會失敗;但如果回傳 ``False``,則呼叫 *object* 肯定" "會失敗。注意 class 是可呼叫的(呼叫 class 會回傳一個新的實例);如果實例的 " -"class 有定義 :meth:`__call__` method,則它是可呼叫的。" +"class 有定義 :meth:`~object.__call__` method,則它是可呼叫的。" -#: ../../library/functions.rst:240 +#: ../../library/functions.rst:241 msgid "" "This function was first removed in Python 3.0 and then brought back in " "Python 3.2." msgstr "這個函式一開始在 Python 3.0 被移除,但在 Python 3.2 又被重新加入。" -#: ../../library/functions.rst:247 +#: ../../library/functions.rst:248 msgid "" "Return the string representing a character whose Unicode code point is the " "integer *i*. For example, ``chr(97)`` returns the string ``'a'``, while " @@ -653,7 +653,7 @@ msgstr "" "回傳代表字元之 Unicode 編碼位置為整數 *i* 的字串。例如,``chr(97)`` 回傳字串 " "``'a'``,而 ``chr(8364)`` 回傳字串 ``'€'``。這是 :func:`ord` 的逆函式。" -#: ../../library/functions.rst:251 +#: ../../library/functions.rst:252 msgid "" "The valid range for the argument is from 0 through 1,114,111 (0x10FFFF in " "base 16). :exc:`ValueError` will be raised if *i* is outside that range." @@ -661,11 +661,11 @@ msgstr "" "引數的有效範圍是 0 到 1,114,111(16 進制表示為 0x10FFFF)。如果 *i* 超過這個" "範圍,會觸發 :exc:`ValueError`。" -#: ../../library/functions.rst:257 +#: ../../library/functions.rst:258 msgid "Transform a method into a class method." msgstr "把一個 method 封裝成 class method(類別方法)。" -#: ../../library/functions.rst:259 +#: ../../library/functions.rst:260 msgid "" "A class method receives the class as an implicit first argument, just like " "an instance method receives the instance. To declare a class method, use " @@ -676,7 +676,7 @@ msgstr "" "\n" "::" -#: ../../library/functions.rst:267 +#: ../../library/functions.rst:268 msgid "" "The ``@classmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -684,7 +684,7 @@ msgstr "" "``@classmethod`` 語法是一個函式 :term:`decorator` — 參見 :ref:`function` 中關" "於函式定義的詳細介紹。" -#: ../../library/functions.rst:270 +#: ../../library/functions.rst:271 msgid "" "A class method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). The instance is ignored except for its " @@ -695,7 +695,7 @@ msgstr "" "叫。實例除了它的 class 資訊,其他都會被忽略。如果一個 class method 在 " "subclass 上呼叫,subclass 會作為第一個引數傳入。" -#: ../../library/functions.rst:275 +#: ../../library/functions.rst:276 msgid "" "Class methods are different than C++ or Java static methods. If you want " "those, see :func:`staticmethod` in this section. For more information on " @@ -705,26 +705,26 @@ msgstr "" "method,請看本節的 :func:`staticmethod`。關於 class method 的更多資訊,請參" "考 :ref:`types`。" -#: ../../library/functions.rst:279 +#: ../../library/functions.rst:280 msgid "" "Class methods can now wrap other :term:`descriptors ` such as :" "func:`property`." msgstr "" -#: ../../library/functions.rst:283 +#: ../../library/functions.rst:284 msgid "" "Class methods now inherit the method attributes (``__module__``, " "``__name__``, ``__qualname__``, ``__doc__`` and ``__annotations__``) and " "have a new ``__wrapped__`` attribute." msgstr "" -#: ../../library/functions.rst:288 +#: ../../library/functions.rst:289 msgid "" "Class methods can no longer wrap other :term:`descriptors ` such " "as :func:`property`." msgstr "" -#: ../../library/functions.rst:295 +#: ../../library/functions.rst:296 msgid "" "Compile the *source* into a code or AST object. Code objects can be " "executed by :func:`exec` or :func:`eval`. *source* can either be a normal " @@ -735,7 +735,7 @@ msgstr "" "`eval` 執行。*source* 可以是一般的字串、bytes 字串、或者 AST 物件。參見 :mod:" "`ast` module(模組)的文件瞭解如何使用 AST 物件。" -#: ../../library/functions.rst:300 +#: ../../library/functions.rst:301 msgid "" "The *filename* argument should give the file from which the code was read; " "pass some recognizable value if it wasn't read from a file (``''`` " @@ -744,7 +744,7 @@ msgstr "" "*filename* 引數必須是程式碼的檔名;如果程式碼不是從檔案中讀取,可以傳入一些可" "辨識的值(經常會使用 ``''`` 來替代)。" -#: ../../library/functions.rst:304 +#: ../../library/functions.rst:305 msgid "" "The *mode* argument specifies what kind of code must be compiled; it can be " "``'exec'`` if *source* consists of a sequence of statements, ``'eval'`` if " @@ -757,7 +757,7 @@ msgstr "" "式,可以是 ``'single'`` (在最後一種情況下,如果運算式執行結果不是 ``None`` " "則會被印出來)。" -#: ../../library/functions.rst:310 +#: ../../library/functions.rst:311 msgid "" "The optional arguments *flags* and *dont_inherit* control which :ref:" "`compiler options ` should be activated and which :ref:" @@ -771,7 +771,7 @@ msgid "" "in the surrounding code are ignored." msgstr "" -#: ../../library/functions.rst:321 +#: ../../library/functions.rst:322 msgid "" "Compiler options and future statements are specified by bits which can be " "bitwise ORed together to specify multiple options. The bitfield required to " @@ -786,7 +786,7 @@ msgstr "" "compiler_flag` 屬性來獲得。\\ :ref:`編譯器旗標 `\\ 可以" "在 :mod:`ast` module 中搜尋有 ``PyCF_`` 前綴的名稱。" -#: ../../library/functions.rst:329 +#: ../../library/functions.rst:330 msgid "" "The argument *optimize* specifies the optimization level of the compiler; " "the default value of ``-1`` selects the optimization level of the " @@ -799,7 +799,7 @@ msgstr "" "``__debug__`` 為真值)、\\ ``1``\\ (assert 被刪除,\\ ``__debug__`` 為假值)" "或 ``2``\\ (文件字串也被刪除)。" -#: ../../library/functions.rst:335 +#: ../../library/functions.rst:336 msgid "" "This function raises :exc:`SyntaxError` if the compiled source is invalid, " "and :exc:`ValueError` if the source contains null bytes." @@ -807,13 +807,13 @@ msgstr "" "如果編譯的原始碼無效,此函式會觸發 :exc:`SyntaxError`,如果原始碼包含 null " "bytes,則會觸發 :exc:`ValueError`。" -#: ../../library/functions.rst:338 +#: ../../library/functions.rst:339 msgid "" "If you want to parse Python code into its AST representation, see :func:`ast." "parse`." msgstr "如果您想解析 Python 程式碼為 AST 運算式,請參閱 :func:`ast.parse`。" -#: ../../library/functions.rst:341 +#: ../../library/functions.rst:342 msgid "" "Raises an :ref:`auditing event ` ``compile`` with arguments " "``source``, ``filename``." @@ -821,7 +821,7 @@ msgstr "" "引發一個附帶引數 ``source``、``filename`` 的\\ :ref:`稽核事件 ` " "``compile``。" -#: ../../library/functions.rst:343 +#: ../../library/functions.rst:344 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``compile`` with arguments " @@ -831,7 +831,7 @@ msgstr "" "引發一個附帶引數 ``source``、``filename`` 的\\ :ref:`稽核事件 ` " "``compile``。此事件也可能會由 implicit compilation 所引發。" -#: ../../library/functions.rst:349 +#: ../../library/functions.rst:350 msgid "" "When compiling a string with multi-line code in ``'single'`` or ``'eval'`` " "mode, input must be terminated by at least one newline character. This is " @@ -841,7 +841,7 @@ msgstr "" "在 ``'single'`` 或 ``'eval'`` 模式編譯多行程式碼時,輸入必須以至少一個換行符" "結尾。這使 :mod:`code` module 更容易檢測陳述式的完整性。" -#: ../../library/functions.rst:356 +#: ../../library/functions.rst:357 msgid "" "It is possible to crash the Python interpreter with a sufficiently large/" "complex string when compiling to an AST object due to stack depth " @@ -850,7 +850,7 @@ msgstr "" "如果編譯足夠大或者足夠複雜的字串成 AST 物件時,Python 直譯器會因為 Python " "AST 編譯器的 stack 深度限制而崩潰。" -#: ../../library/functions.rst:360 +#: ../../library/functions.rst:361 msgid "" "Allowed use of Windows and Mac newlines. Also, input in ``'exec'`` mode " "does not have to end in a newline anymore. Added the *optimize* parameter." @@ -858,20 +858,20 @@ msgstr "" "允許使用 Windows 和 Mac 的換行符號。在 ``'exec'`` 模式不需要以換行符號結尾。" "增加了 *optimize* 參數。" -#: ../../library/functions.rst:364 +#: ../../library/functions.rst:365 msgid "" "Previously, :exc:`TypeError` was raised when null bytes were encountered in " "*source*." msgstr "" "在之前的版本,*source* 中包含 null bytes 會觸發 :exc:`TypeError` 異常。" -#: ../../library/functions.rst:368 +#: ../../library/functions.rst:369 msgid "" "``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` can now be passed in flags to enable " "support for top-level ``await``, ``async for``, and ``async with``." msgstr "" -#: ../../library/functions.rst:376 +#: ../../library/functions.rst:377 msgid "" "Return a complex number with the value *real* + *imag*\\*1j or convert a " "string or number to a complex number. If the first parameter is a string, " @@ -888,7 +888,7 @@ msgstr "" "預設值為零,建構函式會像 :class:`int` 和 :class:`float` 一樣進行數值轉換。如" "果兩個引數都省略,則回傳 ``0j``。" -#: ../../library/functions.rst:385 +#: ../../library/functions.rst:386 msgid "" "For a general Python object ``x``, ``complex(x)`` delegates to ``x." "__complex__()``. If :meth:`~object.__complex__` is not defined then it " @@ -899,7 +899,7 @@ msgstr "" "未定義 :meth:`~object.__complex__` 則會回退使用 :meth:`~object.__float__`。如" "果未定義 :meth:`!__float__` 則會回退使用 :meth:`~object.__index__`。" -#: ../../library/functions.rst:392 +#: ../../library/functions.rst:393 msgid "" "When converting from a string, the string must not contain whitespace around " "the central ``+`` or ``-`` operator. For example, ``complex('1+2j')`` is " @@ -909,22 +909,22 @@ msgstr "" "``complex('1+2j')`` 是有效的,但 ``complex('1 + 2j')`` 會觸發 :exc:" "`ValueError`。" -#: ../../library/functions.rst:397 +#: ../../library/functions.rst:398 msgid "The complex type is described in :ref:`typesnumeric`." msgstr "複數型別在 :ref:`typesnumeric` 中有相關描述。" -#: ../../library/functions.rst:399 ../../library/functions.rst:704 -#: ../../library/functions.rst:928 +#: ../../library/functions.rst:400 ../../library/functions.rst:708 +#: ../../library/functions.rst:932 msgid "Grouping digits with underscores as in code literals is allowed." msgstr "可以使用底線將程式碼文字中的數字進行分組。" -#: ../../library/functions.rst:402 +#: ../../library/functions.rst:403 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__complex__` and :" "meth:`~object.__float__` are not defined." msgstr "" -#: ../../library/functions.rst:409 +#: ../../library/functions.rst:410 msgid "" "This is a relative of :func:`setattr`. The arguments are an object and a " "string. The string must be the name of one of the object's attributes. The " @@ -937,7 +937,7 @@ msgstr "" "'foobar')`` 等價於 ``del x.foobar``。*name* 不必是個 Python 識別符 " "(identifier)(請見 :func:`setattr`)。" -#: ../../library/functions.rst:422 +#: ../../library/functions.rst:423 msgid "" "Create a new dictionary. The :class:`dict` object is the dictionary class. " "See :class:`dict` and :ref:`typesmapping` for documentation about this class." @@ -945,7 +945,7 @@ msgstr "" "建立一個新的 dictionary(字典)。\\ :class:`dict` 物件是一個 dictionary " "class。參見 :class:`dict` 和 :ref:`typesmapping` 來瞭解這個 class。" -#: ../../library/functions.rst:425 +#: ../../library/functions.rst:426 msgid "" "For other containers see the built-in :class:`list`, :class:`set`, and :" "class:`tuple` classes, as well as the :mod:`collections` module." @@ -953,7 +953,7 @@ msgstr "" "其他容器型別,請參見內建的 :class:`list`、:class:`set` 和 :class:`tuple` " "class,以及 :mod:`collections` module。" -#: ../../library/functions.rst:432 +#: ../../library/functions.rst:433 msgid "" "Without arguments, return the list of names in the current local scope. " "With an argument, attempt to return a list of valid attributes for that " @@ -962,30 +962,32 @@ msgstr "" "如果沒有引數,則回傳當前本地作用域中的名稱列表。如果有引數,它會嘗試回傳該物" "件的有效屬性列表。" -#: ../../library/functions.rst:435 +#: ../../library/functions.rst:436 msgid "" -"If the object has a method named :meth:`__dir__`, this method will be called " -"and must return the list of attributes. This allows objects that implement a " -"custom :func:`__getattr__` or :func:`__getattribute__` function to customize " -"the way :func:`dir` reports their attributes." +"If the object has a method named :meth:`~object.__dir__`, this method will " +"be called and must return the list of attributes. This allows objects that " +"implement a custom :func:`~object.__getattr__` or :func:`~object." +"__getattribute__` function to customize the way :func:`dir` reports their " +"attributes." msgstr "" -"如果物件有一個名為 :meth:`__dir__` 的 method,那麼該 method 將被呼叫,並且必" -"須回傳一個屬性列表。這允許實現自定義 :func:`__getattr__` 或 :func:" -"`__getattribute__` 函式的物件能夠自定義 :func:`dir` 來報告它們的屬性。" +"如果物件有一個名為 :meth:`~object.__dir__` 的 method,那麼該 method 將被呼" +"叫,並且必須回傳一個屬性列表。這允許實現自定義 :func:`~object.__getattr__` " +"或 :func:`~object.__getattribute__` 函式的物件能夠自定義 :func:`dir` 來報告它" +"們的屬性。" -#: ../../library/functions.rst:440 +#: ../../library/functions.rst:443 msgid "" -"If the object does not provide :meth:`__dir__`, the function tries its best " -"to gather information from the object's :attr:`~object.__dict__` attribute, " -"if defined, and from its type object. The resulting list is not necessarily " -"complete and may be inaccurate when the object has a custom :func:" -"`__getattr__`." +"If the object does not provide :meth:`~object.__dir__`, the function tries " +"its best to gather information from the object's :attr:`~object.__dict__` " +"attribute, if defined, and from its type object. The resulting list is not " +"necessarily complete and may be inaccurate when the object has a custom :" +"func:`~object.__getattr__`." msgstr "" -"如果物件不提供 :meth:`__dir__`,這個函式會嘗試從物件已定義的 :attr:`~object." -"__dict__` 屬性和型別物件收集資訊。結果列表並不總是完整的,如果物件有自定義 :" -"func:`__getattr__`,那結果可能不準確。" +"如果物件不提供 :meth:`~object.__dir__`,這個函式會嘗試從物件已定義的 :attr:" +"`~object.__dict__` 屬性和型別物件收集資訊。結果列表並不總是完整的,如果物件有" +"自定義 :func:`~object.__getattr__`,那結果可能不準確。" -#: ../../library/functions.rst:445 +#: ../../library/functions.rst:449 msgid "" "The default :func:`dir` mechanism behaves differently with different types " "of objects, as it attempts to produce the most relevant, rather than " @@ -994,13 +996,13 @@ msgstr "" "預設的 :func:`dir` 機制對不同型別的物件有不同行為,它會試圖回傳最相關而非最完" "整的資訊:" -#: ../../library/functions.rst:449 +#: ../../library/functions.rst:453 msgid "" "If the object is a module object, the list contains the names of the " "module's attributes." msgstr "如果物件是 module 物件,則列表包含 module 的屬性名稱。" -#: ../../library/functions.rst:452 +#: ../../library/functions.rst:456 msgid "" "If the object is a type or class object, the list contains the names of its " "attributes, and recursively of the attributes of its bases." @@ -1008,7 +1010,7 @@ msgstr "" "如果物件是型別或 class 物件,則列表包含它們的屬性名稱,並且遞迴查詢其基礎的所" "有屬性。" -#: ../../library/functions.rst:455 +#: ../../library/functions.rst:459 msgid "" "Otherwise, the list contains the object's attributes' names, the names of " "its class's attributes, and recursively of the attributes of its class's " @@ -1017,11 +1019,11 @@ msgstr "" "否則,包含物件的屬性名稱列表、它的 class 屬性名稱,並且遞迴查詢它的 class 的" "所有基礎 class 的屬性。" -#: ../../library/functions.rst:459 +#: ../../library/functions.rst:463 msgid "The resulting list is sorted alphabetically. For example:" msgstr "回傳的列表按字母表排序,例如:" -#: ../../library/functions.rst:479 +#: ../../library/functions.rst:483 msgid "" "Because :func:`dir` is supplied primarily as a convenience for use at an " "interactive prompt, it tries to supply an interesting set of names more than " @@ -1034,7 +1036,7 @@ msgstr "" "版本之間改變。例如,當引數是一個 class 時,metaclass 的屬性不包含在結果列表" "中。" -#: ../../library/functions.rst:489 +#: ../../library/functions.rst:493 msgid "" "Take two (non-complex) numbers as arguments and return a pair of numbers " "consisting of their quotient and remainder when using integer division. " @@ -1052,7 +1054,7 @@ msgstr "" "等,如果 ``a % b`` 非零,則它的符號和 *b* 一樣,且 ``0 <= abs(a % b) < " "abs(b)``。" -#: ../../library/functions.rst:501 +#: ../../library/functions.rst:505 msgid "" "Return an enumerate object. *iterable* must be a sequence, an :term:" "`iterator`, or some other object which supports iteration. The :meth:" @@ -1065,14 +1067,14 @@ msgstr "" "meth:`~iterator.__next__` method 回傳一個 tuple(元組),裡面包含一個計數值" "(從 *start* 開始,預設為 0)和通過疊代 *iterable* 獲得的值。" -#: ../../library/functions.rst:513 +#: ../../library/functions.rst:517 msgid "Equivalent to::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/functions.rst:525 +#: ../../library/functions.rst:529 msgid "" "The arguments are a string and optional globals and locals. If provided, " "*globals* must be a dictionary. If provided, *locals* can be any mapping " @@ -1081,7 +1083,7 @@ msgstr "" "引數是一個字串,以及選擇性的 globals 和 locals。如果有提供選擇性引數," "*globals* 必須是一個 dictionary。*locals* 可以是任何映射 (mapping) 物件。" -#: ../../library/functions.rst:529 +#: ../../library/functions.rst:533 msgid "" "The *expression* argument is parsed and evaluated as a Python expression " "(technically speaking, a condition list) using the *globals* and *locals* " @@ -1107,13 +1109,13 @@ msgstr "" "呼叫的環境中執行運算式。請注意,*eval()* 在封閉環境中無法存取\\ :term:`巢狀" "域 ` (non-locals)。" -#: ../../library/functions.rst:544 +#: ../../library/functions.rst:548 msgid "" "The return value is the result of the evaluated expression. Syntax errors " "are reported as exceptions. Example:" msgstr "" -#: ../../library/functions.rst:551 +#: ../../library/functions.rst:555 msgid "" "This function can also be used to execute arbitrary code objects (such as " "those created by :func:`compile`). In this case, pass a code object instead " @@ -1124,7 +1126,7 @@ msgstr "" "情況下,傳入的引數是程式碼物件而不是字串。如果編譯該物件時的 *mode* 引數是 " "``'exec'``,那麼 :func:`eval` 回傳值為 ``None``。" -#: ../../library/functions.rst:556 +#: ../../library/functions.rst:560 msgid "" "Hints: dynamic execution of statements is supported by the :func:`exec` " "function. The :func:`globals` and :func:`locals` functions return the " @@ -1135,13 +1137,13 @@ msgstr "" "`locals` 函式分別回傳當前的全域性和局部性 dictionary,它們對於將引數傳遞給 :" "func:`eval` 或 :func:`exec` 可能會方便許多。" -#: ../../library/functions.rst:561 +#: ../../library/functions.rst:565 msgid "" "If the given source is a string, then leading and trailing spaces and tabs " "are stripped." msgstr "" -#: ../../library/functions.rst:564 +#: ../../library/functions.rst:568 msgid "" "See :func:`ast.literal_eval` for a function that can safely evaluate strings " "with expressions containing only literals." @@ -1149,14 +1151,14 @@ msgstr "" "另外可以參閱 :func:`ast.literal_eval`,該函式可以安全執行僅包含文字的運算式字" "串。" -#: ../../library/functions.rst:567 ../../library/functions.rst:608 +#: ../../library/functions.rst:571 ../../library/functions.rst:612 msgid "" "Raises an :ref:`auditing event ` ``exec`` with argument " "``code_object``." msgstr "" "引發一個附帶引數 ``code_object`` 的\\ :ref:`稽核事件 ` ``exec``。" -#: ../../library/functions.rst:569 ../../library/functions.rst:610 +#: ../../library/functions.rst:573 ../../library/functions.rst:614 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``exec`` with the code object as " @@ -1165,7 +1167,7 @@ msgstr "" "引發一個附帶程式碼物件為引數的\\ :ref:`稽核事件 ` ``exec``。也可能" "會引發 code compilation 事件。" -#: ../../library/functions.rst:576 +#: ../../library/functions.rst:580 msgid "" "This function supports dynamic execution of Python code. *object* must be " "either a string or a code object. If it is a string, the string is parsed " @@ -1185,7 +1187,7 @@ msgstr "" "`yield` 和 :keyword:`return` 陳述式也不能在函式之外使用。該函式回傳值是 " "``None``。" -#: ../../library/functions.rst:587 +#: ../../library/functions.rst:591 msgid "" "In all cases, if the optional parts are omitted, the code is executed in the " "current scope. If only *globals* is provided, it must be a dictionary (and " @@ -1204,7 +1206,7 @@ msgstr "" "地變數是相同的 dictionary。如果 exec 有兩個不同的 *globals* 和 *locals* 物" "件,程式碼就像嵌入在 class 定義中一樣執行。" -#: ../../library/functions.rst:597 +#: ../../library/functions.rst:601 msgid "" "If the *globals* dictionary does not contain a value for the key " "``__builtins__``, a reference to the dictionary of the built-in module :mod:" @@ -1217,7 +1219,7 @@ msgstr "" "func:`exec` 之前,可以通過將自己的 ``__builtins__`` dictionary 插入到 " "*globals* 中來控制可以使用哪些內建程式碼。" -#: ../../library/functions.rst:603 +#: ../../library/functions.rst:607 msgid "" "The *closure* argument specifies a closure--a tuple of cellvars. It's only " "valid when the *object* is a code object containing free variables. The " @@ -1225,7 +1227,7 @@ msgid "" "referenced by the code object." msgstr "" -#: ../../library/functions.rst:615 +#: ../../library/functions.rst:619 msgid "" "The built-in functions :func:`globals` and :func:`locals` return the current " "global and local dictionary, respectively, which may be useful to pass " @@ -1234,7 +1236,7 @@ msgstr "" "內建 :func:`globals` 和 :func:`locals` 函式各自回傳當前的全域性和本地 " "dictionary,因此可以將它們傳遞給 :func:`exec` 的第二個和第三個引數。" -#: ../../library/functions.rst:621 +#: ../../library/functions.rst:625 msgid "" "The default *locals* act as described for function :func:`locals` below: " "modifications to the default *locals* dictionary should not be attempted. " @@ -1245,11 +1247,11 @@ msgstr "" "預設的 *locals* dictionary。如果您想在 :func:`exec` 函式回傳時知道程式碼對 " "*locals* 的變動,請明確地傳遞 *locals* dictionary 。" -#: ../../library/functions.rst:626 +#: ../../library/functions.rst:630 msgid "Added the *closure* parameter." msgstr "增加了 *closure* 參數。" -#: ../../library/functions.rst:632 +#: ../../library/functions.rst:636 msgid "" "Construct an iterator from those elements of *iterable* for which *function* " "is true. *iterable* may be either a sequence, a container which supports " @@ -1261,7 +1263,7 @@ msgstr "" "*function* 是 ``None``,則會假設它是一個恆等函式,即 *iterable* 中所有假值元" "素會被移除。" -#: ../../library/functions.rst:638 +#: ../../library/functions.rst:642 msgid "" "Note that ``filter(function, iterable)`` is equivalent to the generator " "expression ``(item for item in iterable if function(item))`` if function is " @@ -1272,7 +1274,7 @@ msgstr "" "是 ``None`` 的時候為 ``(item for item in iterable if function(item))``;" "function 是 ``None`` 的時候為 ``(item for item in iterable if item)``。" -#: ../../library/functions.rst:643 +#: ../../library/functions.rst:647 msgid "" "See :func:`itertools.filterfalse` for the complementary function that " "returns elements of *iterable* for which *function* is false." @@ -1280,11 +1282,11 @@ msgstr "" "請參閱 :func:`itertools.filterfalse`,只有 *function* 為 false 時才選取 " "*iterable* 中元素的互補函式。" -#: ../../library/functions.rst:653 +#: ../../library/functions.rst:657 msgid "Return a floating point number constructed from a number or string *x*." msgstr "回傳從數字或字串 *x* 生成的浮點數。" -#: ../../library/functions.rst:655 +#: ../../library/functions.rst:659 msgid "" "If the argument is a string, it should contain a decimal number, optionally " "preceded by a sign, and optionally embedded in whitespace. The optional " @@ -1299,7 +1301,7 @@ msgstr "" "數也可以是 NaN(非數字)或正負無窮大的字串。確切地說,除去首尾的空格後,輸入" "必須遵循以下語法中 ``floatvalue`` 的生成規則:" -#: ../../library/functions.rst:673 +#: ../../library/functions.rst:677 msgid "" "Here ``digit`` is a Unicode decimal digit (character in the Unicode general " "category ``Nd``). Case is not significant, so, for example, \"inf\", " @@ -1310,7 +1312,7 @@ msgstr "" "大小寫都可以,例如,\"inf\"、\"Inf\"、\"INFINITY\"、\"iNfINity\" 都可以表示正" "無窮大。" -#: ../../library/functions.rst:678 +#: ../../library/functions.rst:682 msgid "" "Otherwise, if the argument is an integer or a floating point number, a " "floating point number with the same value (within Python's floating point " @@ -1320,7 +1322,7 @@ msgstr "" "否則,如果引數是整數或浮點數,則回傳具有相同值(在 Python 浮點精度範圍內)的" "浮點數。如果引數在 Python 浮點精度範圍外,則會觸發 :exc:`OverflowError`。" -#: ../../library/functions.rst:683 +#: ../../library/functions.rst:687 msgid "" "For a general Python object ``x``, ``float(x)`` delegates to ``x." "__float__()``. If :meth:`~object.__float__` is not defined then it falls " @@ -1329,28 +1331,28 @@ msgstr "" "對於一般的 Python 物件 ``x``,``float(x)`` 指派給 ``x.__float__()``。如果未定" "義 :meth:`~object.__float__` 則回退使用 :meth:`~object.__index__`。" -#: ../../library/functions.rst:687 +#: ../../library/functions.rst:691 msgid "If no argument is given, ``0.0`` is returned." msgstr "如果沒有引數,則回傳 ``0.0``。" -#: ../../library/functions.rst:689 +#: ../../library/functions.rst:693 msgid "Examples::" msgstr "" "例如:\n" "\n" "::" -#: ../../library/functions.rst:702 +#: ../../library/functions.rst:706 msgid "The float type is described in :ref:`typesnumeric`." msgstr ":ref:`typesnumeric` 描述了浮點數型別。" -#: ../../library/functions.rst:710 +#: ../../library/functions.rst:714 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__float__` is not " "defined." msgstr "" -#: ../../library/functions.rst:720 +#: ../../library/functions.rst:724 msgid "" "Convert a *value* to a \"formatted\" representation, as controlled by " "*format_spec*. The interpretation of *format_spec* will depend on the type " @@ -1361,7 +1363,7 @@ msgstr "" "取決於 *value* 引數的型別,但是大多數內建型別使用標準格式化語法::ref:" "`formatspec`。" -#: ../../library/functions.rst:725 +#: ../../library/functions.rst:729 msgid "" "The default *format_spec* is an empty string which usually gives the same " "effect as calling :func:`str(value) `." @@ -1369,21 +1371,21 @@ msgstr "" "預設的 *format_spec* 是一個空字串,它通常和呼叫 :func:`str(value) ` 的效" "果相同。" -#: ../../library/functions.rst:728 +#: ../../library/functions.rst:732 msgid "" "A call to ``format(value, format_spec)`` is translated to ``type(value)." "__format__(value, format_spec)`` which bypasses the instance dictionary when " -"searching for the value's :meth:`__format__` method. A :exc:`TypeError` " -"exception is raised if the method search reaches :mod:`object` and the " -"*format_spec* is non-empty, or if either the *format_spec* or the return " -"value are not strings." +"searching for the value's :meth:`~object.__format__` method. A :exc:" +"`TypeError` exception is raised if the method search reaches :mod:`object` " +"and the *format_spec* is non-empty, or if either the *format_spec* or the " +"return value are not strings." msgstr "" "呼叫 ``format(value, format_spec)`` 會轉換成 ``type(value).__format__(value, " -"format_spec)``,當搜尋 value 的 :meth:`__format__` method 時,會忽略實例中的" -"字典。如果搜尋到 :mod:`object` 這個 method 但 *format_spec* 不為空,或是 " -"*format_spec* 或回傳值不是字串,則會觸發 :exc:`TypeError`。" +"format_spec)``,當搜尋 value 的 :meth:`~object.__format__` method 時,會忽略" +"實例中的字典。如果搜尋到 :mod:`object` 這個 method 但 *format_spec* 不為空," +"或是 *format_spec* 或回傳值不是字串,則會觸發 :exc:`TypeError`。" -#: ../../library/functions.rst:735 +#: ../../library/functions.rst:739 msgid "" "``object().__format__(format_spec)`` raises :exc:`TypeError` if " "*format_spec* is not an empty string." @@ -1391,7 +1393,7 @@ msgstr "" "當 *format_spec* 不是空字串時,``object().__format__(format_spec)`` 會觸發 :" "exc:`TypeError`。" -#: ../../library/functions.rst:744 +#: ../../library/functions.rst:748 msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " "*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and :" @@ -1401,7 +1403,7 @@ msgstr "" "素。\\ ``frozenset`` 是一個內建的 class。有關此 class 的文件,請參閱 :class:" "`frozenset` 和 :ref:`types-set`。" -#: ../../library/functions.rst:748 +#: ../../library/functions.rst:752 msgid "" "For other containers see the built-in :class:`set`, :class:`list`, :class:" "`tuple`, and :class:`dict` classes, as well as the :mod:`collections` module." @@ -1409,7 +1411,7 @@ msgstr "" "請參閱內建的 :class:`set`、:class:`list`、:class:`tuple` 和 :class:`dict` " "class,以及 :mod:`collections` module 來了解其它的容器。" -#: ../../library/functions.rst:756 +#: ../../library/functions.rst:760 msgid "" "Return the value of the named attribute of *object*. *name* must be a " "string. If the string is the name of one of the object's attributes, the " @@ -1424,7 +1426,7 @@ msgstr "" "`AttributeError`。*name* 不必是個 Python 識別符 (identifier)(請見 :func:" "`setattr`)。" -#: ../../library/functions.rst:765 +#: ../../library/functions.rst:769 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " @@ -1432,7 +1434,7 @@ msgid "" "`getattr`." msgstr "" -#: ../../library/functions.rst:773 +#: ../../library/functions.rst:777 msgid "" "Return the dictionary implementing the current module namespace. For code " "within functions, this is set when the function is defined and remains the " @@ -1441,7 +1443,7 @@ msgstr "" "回傳代表當前 module 命名空間的 dictionary。對於在函式中的程式碼來說,這在定義" "函式時設定且不論該函式是在何處呼叫都會保持相同。" -#: ../../library/functions.rst:780 +#: ../../library/functions.rst:784 msgid "" "The arguments are an object and a string. The result is ``True`` if the " "string is the name of one of the object's attributes, ``False`` if not. " @@ -1452,7 +1454,7 @@ msgstr "" "則回傳 ``False``。(此功能是通過呼叫 ``getattr(object, name)`` 看是否有 :exc:" "`AttributeError` 來實現的。)" -#: ../../library/functions.rst:788 +#: ../../library/functions.rst:792 msgid "" "Return the hash value of the object (if it has one). Hash values are " "integers. They are used to quickly compare dictionary keys during a " @@ -1463,17 +1465,16 @@ msgstr "" "時用來快速比較 dictionary 的鍵。相同大小的數字數值有相同的雜湊值(即使它們型" "別不同,如 1 和 1.0)。" -#: ../../library/functions.rst:795 +#: ../../library/functions.rst:799 #, fuzzy msgid "" -"For objects with custom :meth:`__hash__` methods, note that :func:`hash` " -"truncates the return value based on the bit width of the host machine. See :" -"meth:`__hash__ ` for details." +"For objects with custom :meth:`~object.__hash__` methods, note that :func:" +"`hash` truncates the return value based on the bit width of the host machine." msgstr "" "請注意,如果物件實現了自己的 :meth:`__hash__` method,:func:`hash` 根據執行機" "器的位元長度來擷取回傳值。另請參閱 :meth:`__hash__ `。" -#: ../../library/functions.rst:802 +#: ../../library/functions.rst:806 msgid "" "Invoke the built-in help system. (This function is intended for interactive " "use.) If no argument is given, the interactive help system starts on the " @@ -1487,7 +1488,7 @@ msgstr "" "鍵字或文件主題中搜索該字串,並在控制台上列印幫助資訊。如果引數是其他任意物" "件,則會生成該物件的幫助頁。" -#: ../../library/functions.rst:809 +#: ../../library/functions.rst:813 msgid "" "Note that if a slash(/) appears in the parameter list of a function when " "invoking :func:`help`, it means that the parameters prior to the slash are " @@ -1495,12 +1496,12 @@ msgid "" "parameters `." msgstr "" -#: ../../library/functions.rst:814 +#: ../../library/functions.rst:818 msgid "" "This function is added to the built-in namespace by the :mod:`site` module." msgstr "該函式透過 :mod:`site` module 加入到內建命名空間。" -#: ../../library/functions.rst:816 +#: ../../library/functions.rst:820 msgid "" "Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures " "for callables are now more comprehensive and consistent." @@ -1508,7 +1509,7 @@ msgstr "" "變更至 :mod:`pydoc` 和 :mod:`inspect` 使得可呼叫物件的簽名信息 (signature) 更" "加全面和一致。" -#: ../../library/functions.rst:823 +#: ../../library/functions.rst:827 msgid "" "Convert an integer number to a lowercase hexadecimal string prefixed with " "\"0x\". If *x* is not a Python :class:`int` object, it has to define an :" @@ -1518,7 +1519,7 @@ msgstr "" "class:`int` 物件,則必須定義一個 :meth:`~object.__index__` method 並且回傳一" "個整數。舉例來說:" -#: ../../library/functions.rst:832 +#: ../../library/functions.rst:836 msgid "" "If you want to convert an integer number to an uppercase or lower " "hexadecimal string with prefix or not, you can use either of the following " @@ -1527,20 +1528,20 @@ msgstr "" "如果要將整數轉換為大寫或小寫的十六進位制字串,並可選擇有無 \"0x\" 前綴,則可" "以使用如下方法:" -#: ../../library/functions.rst:844 +#: ../../library/functions.rst:848 msgid "" "See also :func:`int` for converting a hexadecimal string to an integer using " "a base of 16." msgstr "另請參閱 :func:`int` 將十六進位制字串轉換為以 16 為基數的整數。" -#: ../../library/functions.rst:849 +#: ../../library/functions.rst:853 msgid "" "To obtain a hexadecimal string representation for a float, use the :meth:" "`float.hex` method." msgstr "" "如果要獲取浮點數的十六進位制字串形式,請使用 :meth:`float.hex` method。" -#: ../../library/functions.rst:855 +#: ../../library/functions.rst:859 msgid "" "Return the \"identity\" of an object. This is an integer which is " "guaranteed to be unique and constant for this object during its lifetime. " @@ -1550,18 +1551,18 @@ msgstr "" "回傳物件的 \"標識值\" 。該值是一個整數,在此物件的生命週期中保證是唯一且恆定" "的。兩個生命期不重疊的物件可能具有相同的 :func:`id` 值。" -#: ../../library/functions.rst:860 +#: ../../library/functions.rst:864 msgid "This is the address of the object in memory." msgstr "" -#: ../../library/functions.rst:862 +#: ../../library/functions.rst:866 msgid "" "Raises an :ref:`auditing event ` ``builtins.id`` with argument " "``id``." msgstr "" "引發一個附帶引數 ``id`` 的\\ :ref:`稽核事件 ` ``builtins.id``。" -#: ../../library/functions.rst:868 +#: ../../library/functions.rst:872 msgid "" "If the *prompt* argument is present, it is written to standard output " "without a trailing newline. The function then reads a line from input, " @@ -1574,7 +1575,7 @@ msgstr "" "\n" "::" -#: ../../library/functions.rst:878 +#: ../../library/functions.rst:882 msgid "" "If the :mod:`readline` module was loaded, then :func:`input` will use it to " "provide elaborate line editing and history features." @@ -1582,7 +1583,7 @@ msgstr "" "如果載入了 :mod:`readline` module,:func:`input` 將使用它來提供複雜的行編輯和" "歷史記錄功能。" -#: ../../library/functions.rst:881 +#: ../../library/functions.rst:885 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt``." @@ -1590,7 +1591,7 @@ msgstr "" "引發一個附帶引數 ``prompt`` 的\\ :ref:`稽核事件 ` ``builtins." "input``。" -#: ../../library/functions.rst:883 +#: ../../library/functions.rst:887 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt`` before reading input" @@ -1598,7 +1599,7 @@ msgstr "" "引發一個附帶讀取輸入前的引數 ``prompt`` 的\\ :ref:`稽核事件 ` " "``builtins.input``。" -#: ../../library/functions.rst:886 +#: ../../library/functions.rst:890 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "argument ``result``." @@ -1606,7 +1607,7 @@ msgstr "" "引發一個附帶引數 ``result`` 的\\ :ref:`稽核事件 ` ``builtins.input/" "result``。" -#: ../../library/functions.rst:888 +#: ../../library/functions.rst:892 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "the result after successfully reading input." @@ -1614,7 +1615,7 @@ msgstr "" "引發一個附帶成功讀取結果的\\ :ref:`稽核事件 ` ``builtins.input/" "result``。" -#: ../../library/functions.rst:895 +#: ../../library/functions.rst:899 msgid "" "Return an integer object constructed from a number or string *x*, or return " "``0`` if no arguments are given. If *x* defines :meth:`~object.__int__`, " @@ -1628,7 +1629,7 @@ msgstr "" "*x* 定義了 :meth:`~object.__index__` 則回傳 ``x.__index__()``。如果 *x* 定義" "了 :meth:`~object.__trunc__` 則回傳 ``x.__trunc__()``。對於浮點數則向零舍入。" -#: ../../library/functions.rst:902 +#: ../../library/functions.rst:906 msgid "" "If *x* is not a number or if *base* is given, then *x* must be a string, :" "class:`bytes`, or :class:`bytearray` instance representing an integer in " @@ -1641,7 +1642,7 @@ msgstr "" "前可以有 ``+`` 或 ``-``\\ (中間沒有空格)、可有個前導的零、也可被空格包圍、" "或在數字間有單一底線。" -#: ../../library/functions.rst:908 +#: ../../library/functions.rst:912 msgid "" "A base-n integer string contains digits, each representing a value from 0 to " "n-1. The values 0--9 can be represented by any Unicode decimal digit. The " @@ -1663,11 +1664,11 @@ msgstr "" "進制中的一個,所以 ``int('010', 0)`` 是非法的,但 ``int('010')`` 和 " "``int('010', 8)`` 是有效的。" -#: ../../library/functions.rst:919 +#: ../../library/functions.rst:923 msgid "The integer type is described in :ref:`typesnumeric`." msgstr "整數型別定義請參閱 :ref:`typesnumeric`。" -#: ../../library/functions.rst:921 +#: ../../library/functions.rst:925 msgid "" "If *base* is not an instance of :class:`int` and the *base* object has a :" "meth:`base.__index__ ` method, that method is called to " @@ -1679,17 +1680,17 @@ msgstr "" "使用 :meth:`base.__int__ ` 而不是 :meth:`base.__index__ " "`。" -#: ../../library/functions.rst:934 +#: ../../library/functions.rst:938 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__int__` is not " "defined." msgstr "" -#: ../../library/functions.rst:937 +#: ../../library/functions.rst:941 msgid "The delegation to :meth:`~object.__trunc__` is deprecated." msgstr "" -#: ../../library/functions.rst:940 +#: ../../library/functions.rst:944 msgid "" ":class:`int` string inputs and string representations can be limited to help " "avoid denial of service attacks. A :exc:`ValueError` is raised when the " @@ -1699,7 +1700,7 @@ msgid "" "documentation." msgstr "" -#: ../../library/functions.rst:950 +#: ../../library/functions.rst:954 msgid "" "Return ``True`` if the *object* argument is an instance of the *classinfo* " "argument, or of a (direct, indirect, or :term:`virtual `) of *classinfo*. A class is considered a " @@ -1739,41 +1740,42 @@ msgstr "" "*class* 是 *classinfo* 中任一元素的 subclass 時則回傳 ``True``。其他情況,會" "觸發 :exc:`TypeError`。" -#: ../../library/functions.rst:982 +#: ../../library/functions.rst:986 msgid "" "Return an :term:`iterator` object. The first argument is interpreted very " "differently depending on the presence of the second argument. Without a " "second argument, *object* must be a collection object which supports the :" -"term:`iterable` protocol (the :meth:`__iter__` method), or it must support " -"the sequence protocol (the :meth:`~object.__getitem__` method with integer " -"arguments starting at ``0``). If it does not support either of those " -"protocols, :exc:`TypeError` is raised. If the second argument, *sentinel*, " -"is given, then *object* must be a callable object. The iterator created in " -"this case will call *object* with no arguments for each call to its :meth:" -"`~iterator.__next__` method; if the value returned is equal to *sentinel*, :" -"exc:`StopIteration` will be raised, otherwise the value will be returned." +"term:`iterable` protocol (the :meth:`~object.__iter__` method), or it must " +"support the sequence protocol (the :meth:`~object.__getitem__` method with " +"integer arguments starting at ``0``). If it does not support either of " +"those protocols, :exc:`TypeError` is raised. If the second argument, " +"*sentinel*, is given, then *object* must be a callable object. The iterator " +"created in this case will call *object* with no arguments for each call to " +"its :meth:`~iterator.__next__` method; if the value returned is equal to " +"*sentinel*, :exc:`StopIteration` will be raised, otherwise the value will be " +"returned." msgstr "" "回傳一個 :term:`iterator` 物件。根據是否存在第二個引數,第一個引數的意義是非" "常不同的。如果沒有第二個引數,*object* 必須是支援 :term:`iterable` 協定(有 :" -"meth:`__iter__` method)的集合物件,或必須支援序列協定(有 :meth:`~object." -"__getitem__` 方法,且數字引數從 ``0`` 開始)。如果它不支援這些協定,會觸發 :" -"exc:`TypeError`。如果有第二個引數 *sentinel*,那麼 *object* 必須是可呼叫的物" -"件,這種情況下生成的 iterator,每次疊代呼叫 :meth:`~iterator.__next__` 時會不" -"帶引數地呼叫 *object*\\ ;如果回傳的結果是 *sentinel* 則觸發 :exc:" -"`StopIteration`,否則回傳呼叫結果。" - -#: ../../library/functions.rst:995 +"meth:`~object.__iter__` method)的集合物件,或必須支援序列協定(有 :meth:" +"`~object.__getitem__` 方法,且數字引數從 ``0`` 開始)。如果它不支援這些協定," +"會觸發 :exc:`TypeError`。如果有第二個引數 *sentinel*,那麼 *object* 必須是可" +"呼叫的物件,這種情況下生成的 iterator,每次疊代呼叫 :meth:`~iterator." +"__next__` 時會不帶引數地呼叫 *object*\\ ;如果回傳的結果是 *sentinel* 則觸" +"發 :exc:`StopIteration`,否則回傳呼叫結果。" + +#: ../../library/functions.rst:1000 msgid "See also :ref:`typeiter`." msgstr "另請參閱 :ref:`typeiter`。" -#: ../../library/functions.rst:997 +#: ../../library/functions.rst:1002 msgid "" "One useful application of the second form of :func:`iter` is to build a " "block-reader. For example, reading fixed-width blocks from a binary database " "file until the end of file is reached::" msgstr "" -#: ../../library/functions.rst:1009 +#: ../../library/functions.rst:1014 msgid "" "Return the length (the number of items) of an object. The argument may be a " "sequence (such as a string, bytes, tuple, list, or range) or a collection " @@ -1782,13 +1784,13 @@ msgstr "" "回傳物件的長度(元素個數)。引數可以是序列(如 string、bytes、tuple、list 或 " "range)或集合(如 dictionary、set 或 frozen set)。" -#: ../../library/functions.rst:1015 +#: ../../library/functions.rst:1020 msgid "" "``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys." "maxsize`, such as :class:`range(2 ** 100) `." msgstr "" -#: ../../library/functions.rst:1024 +#: ../../library/functions.rst:1029 msgid "" "Rather than being a function, :class:`list` is actually a mutable sequence " "type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." @@ -1796,7 +1798,7 @@ msgstr "" "除了是函式,:class:`list` 也是可變序列型別,詳情請參閱 :ref:`typesseq-list` " "和 :ref:`typesseq`。" -#: ../../library/functions.rst:1030 +#: ../../library/functions.rst:1035 msgid "" "Update and return a dictionary representing the current local symbol table. " "Free variables are returned by :func:`locals` when it is called in function " @@ -1807,7 +1809,7 @@ msgstr "" "叫 :func:`locals` 時會回傳自由變數。請注意,在 module 階層中,\\ :func:" "`locals` 和 :func:`globals` 是相同的 dictionary。" -#: ../../library/functions.rst:1036 +#: ../../library/functions.rst:1041 msgid "" "The contents of this dictionary should not be modified; changes may not " "affect the values of local and free variables used by the interpreter." @@ -1815,7 +1817,7 @@ msgstr "" "此 dictionary 的內容不應該被更動;更改可能不會影響直譯器使用的本地變數或自由" "變數的值。" -#: ../../library/functions.rst:1041 +#: ../../library/functions.rst:1046 msgid "" "Return an iterator that applies *function* to every item of *iterable*, " "yielding the results. If additional *iterables* arguments are passed, " @@ -1830,13 +1832,13 @@ msgstr "" "iteratable 耗盡時 iterator 也會結束。如果函式的輸入已經是 tuple 的引數,請參" "閱 :func:`itertools.starmap`\\。" -#: ../../library/functions.rst:1053 +#: ../../library/functions.rst:1058 msgid "" "Return the largest item in an iterable or the largest of two or more " "arguments." msgstr "回傳 iterable 中最大的元素,或者回傳兩個及以上引數中最大的。" -#: ../../library/functions.rst:1056 +#: ../../library/functions.rst:1061 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The largest item in the iterable is returned. If two or more positional " @@ -1845,7 +1847,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是個 :term:`iterable`,iterable 中最大的元素" "會被回傳。如果提供了兩個或以上的位置引數,則回傳最大的位置引數。" -#: ../../library/functions.rst:1061 ../../library/functions.rst:1099 +#: ../../library/functions.rst:1066 ../../library/functions.rst:1104 msgid "" "There are two optional keyword-only arguments. The *key* argument specifies " "a one-argument ordering function like that used for :meth:`list.sort`. The " @@ -1857,7 +1859,7 @@ msgstr "" "式,如同 :meth:`list.sort` 使用方式。*default* 引數是當 iterable 為空時回傳的" "值。如果 iterable 為空,並且沒有提供 *default*,則會觸發 :exc:`ValueError`。" -#: ../../library/functions.rst:1067 +#: ../../library/functions.rst:1072 msgid "" "If multiple items are maximal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -1868,15 +1870,15 @@ msgstr "" "``sorted(iterable, key=keyfunc, reverse=True)[0]`` 和 ``heapq.nlargest(1, " "iterable, key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1072 ../../library/functions.rst:1110 +#: ../../library/functions.rst:1077 ../../library/functions.rst:1115 msgid "The *default* keyword-only argument." msgstr "*default* 僅限關鍵字引數。" -#: ../../library/functions.rst:1075 ../../library/functions.rst:1113 +#: ../../library/functions.rst:1080 ../../library/functions.rst:1118 msgid "The *key* can be ``None``." msgstr "" -#: ../../library/functions.rst:1083 +#: ../../library/functions.rst:1088 msgid "" "Return a \"memory view\" object created from the given argument. See :ref:" "`typememoryview` for more information." @@ -1884,13 +1886,13 @@ msgstr "" "回傳由給定的引數建立之 \"memory view\" 物件。有關詳細資訊,請參閱 :ref:" "`typememoryview`。" -#: ../../library/functions.rst:1091 +#: ../../library/functions.rst:1096 msgid "" "Return the smallest item in an iterable or the smallest of two or more " "arguments." msgstr "回傳 iterable 中最小的元素,或者回傳兩個及以上引數中最小的。" -#: ../../library/functions.rst:1094 +#: ../../library/functions.rst:1099 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The smallest item in the iterable is returned. If two or more positional " @@ -1899,7 +1901,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是 :term:`iterable`,iterable 中最小的元素會" "被回傳。如果提供了兩個或以上的位置引數,則回傳最小的位置引數。" -#: ../../library/functions.rst:1105 +#: ../../library/functions.rst:1110 msgid "" "If multiple items are minimal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -1910,7 +1912,7 @@ msgstr "" "``sorted(iterable, key=keyfunc)[0]`` 和 ``heapq.nsmallest(1, iterable, " "key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1120 +#: ../../library/functions.rst:1125 msgid "" "Retrieve the next item from the :term:`iterator` by calling its :meth:" "`~iterator.__next__` method. If *default* is given, it is returned if the " @@ -1920,7 +1922,7 @@ msgstr "" "素。如果 iterator 耗盡,則回傳給定的預設值 *default*,如果沒有預設值則觸發 :" "exc:`StopIteration`。" -#: ../../library/functions.rst:1127 +#: ../../library/functions.rst:1132 msgid "" "Return a new featureless object. :class:`object` is a base for all classes. " "It has methods that are common to all instances of Python classes. This " @@ -1929,7 +1931,7 @@ msgstr "" "回傳一個沒有特徵的新物件。:class:`object` 是所有 class 的基礎,它具有所有 " "Python class 實例的通用 method。這個函式不接受任何引數。" -#: ../../library/functions.rst:1133 +#: ../../library/functions.rst:1138 msgid "" ":class:`object` does *not* have a :attr:`~object.__dict__`, so you can't " "assign arbitrary attributes to an instance of the :class:`object` class." @@ -1937,7 +1939,7 @@ msgstr "" "由於 :class:`object` *沒有* :attr:`~object.__dict__`,因此無法將任意屬性賦" "給 :class:`object` class 的實例。" -#: ../../library/functions.rst:1139 +#: ../../library/functions.rst:1144 msgid "" "Convert an integer number to an octal string prefixed with \"0o\". The " "result is a valid Python expression. If *x* is not a Python :class:`int` " @@ -1948,7 +1950,7 @@ msgstr "" "Python 運算式。如果 *x* 不是 Python 的 :class:`int` 物件,那它需要定義 :meth:" "`~object.__index__` method 回傳一個整數。舉例來說:" -#: ../../library/functions.rst:1149 +#: ../../library/functions.rst:1154 msgid "" "If you want to convert an integer number to an octal string either with the " "prefix \"0o\" or not, you can use either of the following ways." @@ -1956,7 +1958,7 @@ msgstr "" "如果要將整數轉換為八進位制字串,不論是否具備 \"0o\" 前綴,都可以使用下面的方" "法。" -#: ../../library/functions.rst:1166 +#: ../../library/functions.rst:1171 msgid "" "Open *file* and return a corresponding :term:`file object`. If the file " "cannot be opened, an :exc:`OSError` is raised. See :ref:`tut-files` for more " @@ -1965,7 +1967,7 @@ msgstr "" "開啟 *file* 並回傳對應的 :term:`file object`。如果該檔案不能開啟,則觸發 :" "exc:`OSError`。關於使用此函式的更多方法請參閱\\ :ref:`tut-files`。" -#: ../../library/functions.rst:1170 +#: ../../library/functions.rst:1175 msgid "" "*file* is a :term:`path-like object` giving the pathname (absolute or " "relative to the current working directory) of the file to be opened or an " @@ -1978,7 +1980,7 @@ msgstr "" "果有提供檔案描述器,它會隨著回傳的 I/O 物件關閉而關閉,除非 *closefd* 被設為 " "``False``。)" -#: ../../library/functions.rst:1176 +#: ../../library/functions.rst:1181 msgid "" "*mode* is an optional string that specifies the mode in which the file is " "opened. It defaults to ``'r'`` which means open for reading in text mode. " @@ -1999,71 +2001,71 @@ msgstr "" "getencoding()` 來獲取當前的本地編碼。(要讀取和寫入原始 bytes,請使用二進位制" "模式且不要指定 *encoding*。)可用的模式有:" -#: ../../library/functions.rst:1193 +#: ../../library/functions.rst:1198 msgid "Character" msgstr "字元" -#: ../../library/functions.rst:1193 +#: ../../library/functions.rst:1198 msgid "Meaning" msgstr "意義" -#: ../../library/functions.rst:1195 +#: ../../library/functions.rst:1200 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/functions.rst:1195 +#: ../../library/functions.rst:1200 msgid "open for reading (default)" msgstr "讀取(預設)" -#: ../../library/functions.rst:1196 +#: ../../library/functions.rst:1201 msgid "``'w'``" msgstr "``'w'``" -#: ../../library/functions.rst:1196 +#: ../../library/functions.rst:1201 msgid "open for writing, truncating the file first" msgstr "" -#: ../../library/functions.rst:1197 +#: ../../library/functions.rst:1202 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/functions.rst:1197 +#: ../../library/functions.rst:1202 msgid "open for exclusive creation, failing if the file already exists" msgstr "唯一性創建,如果文件已存在則會失敗" -#: ../../library/functions.rst:1198 +#: ../../library/functions.rst:1203 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/functions.rst:1198 +#: ../../library/functions.rst:1203 msgid "open for writing, appending to the end of file if it exists" msgstr "寫入,如果文件存在則在末尾追加寫入內容" -#: ../../library/functions.rst:1199 +#: ../../library/functions.rst:1204 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/functions.rst:1199 ../../library/functions.rst:1343 +#: ../../library/functions.rst:1204 ../../library/functions.rst:1348 msgid "binary mode" msgstr "binary mode(二進位模式)" -#: ../../library/functions.rst:1200 +#: ../../library/functions.rst:1205 msgid "``'t'``" msgstr "``'t'``" -#: ../../library/functions.rst:1200 +#: ../../library/functions.rst:1205 msgid "text mode (default)" msgstr "文字模式(預設)" -#: ../../library/functions.rst:1201 +#: ../../library/functions.rst:1206 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/functions.rst:1201 +#: ../../library/functions.rst:1206 msgid "open for updating (reading and writing)" msgstr "更新(讀取並寫入)" -#: ../../library/functions.rst:1204 +#: ../../library/functions.rst:1209 msgid "" "The default mode is ``'r'`` (open for reading text, a synonym of ``'rt'``). " "Modes ``'w+'`` and ``'w+b'`` open and truncate the file. Modes ``'r+'`` and " @@ -2072,7 +2074,7 @@ msgstr "" "預設的模式是 ``'r'``\\ (開啟並讀取文字,同 ``'rt'``)。對於二進位制寫入," "``'w+b'`` 模式開啟並把檔案內容變成 0 bytes,``'r+b'`` 則不會捨棄原始內容。" -#: ../../library/functions.rst:1208 +#: ../../library/functions.rst:1213 msgid "" "As mentioned in the :ref:`io-overview`, Python distinguishes between binary " "and text I/O. Files opened in binary mode (including ``'b'`` in the *mode* " @@ -2083,27 +2085,27 @@ msgid "" "specified *encoding* if given." msgstr "" -#: ../../library/functions.rst:1218 +#: ../../library/functions.rst:1223 msgid "" "Python doesn't depend on the underlying operating system's notion of text " "files; all the processing is done by Python itself, and is therefore " "platform-independent." msgstr "" -#: ../../library/functions.rst:1222 +#: ../../library/functions.rst:1227 msgid "" "*buffering* is an optional integer used to set the buffering policy. Pass 0 " "to switch buffering off (only allowed in binary mode), 1 to select line " -"buffering (only usable in text mode), and an integer > 1 to indicate the " -"size in bytes of a fixed-size chunk buffer. Note that specifying a buffer " -"size this way applies for binary buffered I/O, but ``TextIOWrapper`` (i.e., " -"files opened with ``mode='r+'``) would have another buffering. To disable " -"buffering in ``TextIOWrapper``, consider using the ``write_through`` flag " -"for :func:`io.TextIOWrapper.reconfigure`. When no *buffering* argument is " -"given, the default buffering policy works as follows:" +"buffering (only usable when writing in text mode), and an integer > 1 to " +"indicate the size in bytes of a fixed-size chunk buffer. Note that " +"specifying a buffer size this way applies for binary buffered I/O, but " +"``TextIOWrapper`` (i.e., files opened with ``mode='r+'``) would have another " +"buffering. To disable buffering in ``TextIOWrapper``, consider using the " +"``write_through`` flag for :func:`io.TextIOWrapper.reconfigure`. When no " +"*buffering* argument is given, the default buffering policy works as follows:" msgstr "" -#: ../../library/functions.rst:1232 +#: ../../library/functions.rst:1237 msgid "" "Binary files are buffered in fixed-size chunks; the size of the buffer is " "chosen using a heuristic trying to determine the underlying device's \"block " @@ -2111,14 +2113,14 @@ msgid "" "systems, the buffer will typically be 4096 or 8192 bytes long." msgstr "" -#: ../../library/functions.rst:1237 +#: ../../library/functions.rst:1242 msgid "" "\"Interactive\" text files (files for which :meth:`~io.IOBase.isatty` " "returns ``True``) use line buffering. Other text files use the policy " "described above for binary files." msgstr "" -#: ../../library/functions.rst:1241 +#: ../../library/functions.rst:1246 msgid "" "*encoding* is the name of the encoding used to decode or encode the file. " "This should only be used in text mode. The default encoding is platform " @@ -2127,7 +2129,7 @@ msgid "" "the list of supported encodings." msgstr "" -#: ../../library/functions.rst:1247 +#: ../../library/functions.rst:1252 msgid "" "*errors* is an optional string that specifies how encoding and decoding " "errors are to be handled—this cannot be used in binary mode. A variety of " @@ -2136,25 +2138,25 @@ msgid "" "register_error` is also valid. The standard names include:" msgstr "" -#: ../../library/functions.rst:1255 +#: ../../library/functions.rst:1260 msgid "" "``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding " "error. The default value of ``None`` has the same effect." msgstr "" -#: ../../library/functions.rst:1259 +#: ../../library/functions.rst:1264 msgid "" "``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to " "data loss." msgstr "" -#: ../../library/functions.rst:1262 +#: ../../library/functions.rst:1267 msgid "" "``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted " "where there is malformed data." msgstr "" -#: ../../library/functions.rst:1265 +#: ../../library/functions.rst:1270 msgid "" "``'surrogateescape'`` will represent any incorrect bytes as low surrogate " "code units ranging from U+DC80 to U+DCFF. These surrogate code units will " @@ -2163,33 +2165,33 @@ msgid "" "an unknown encoding." msgstr "" -#: ../../library/functions.rst:1272 +#: ../../library/functions.rst:1277 msgid "" "``'xmlcharrefreplace'`` is only supported when writing to a file. Characters " "not supported by the encoding are replaced with the appropriate XML " "character reference :samp:`&#{nnn};`." msgstr "" -#: ../../library/functions.rst:1276 +#: ../../library/functions.rst:1281 msgid "" "``'backslashreplace'`` replaces malformed data by Python's backslashed " "escape sequences." msgstr "" -#: ../../library/functions.rst:1279 +#: ../../library/functions.rst:1284 msgid "" "``'namereplace'`` (also only supported when writing) replaces unsupported " "characters with ``\\N{...}`` escape sequences." msgstr "" -#: ../../library/functions.rst:1287 +#: ../../library/functions.rst:1292 msgid "" "*newline* determines how to parse newline characters from the stream. It can " "be ``None``, ``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as " "follows:" msgstr "" -#: ../../library/functions.rst:1291 +#: ../../library/functions.rst:1296 msgid "" "When reading input from the stream, if *newline* is ``None``, universal " "newlines mode is enabled. Lines in the input can end in ``'\\n'``, " @@ -2200,7 +2202,7 @@ msgid "" "given string, and the line ending is returned to the caller untranslated." msgstr "" -#: ../../library/functions.rst:1299 +#: ../../library/functions.rst:1304 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -2209,7 +2211,7 @@ msgid "" "characters written are translated to the given string." msgstr "" -#: ../../library/functions.rst:1305 +#: ../../library/functions.rst:1310 msgid "" "If *closefd* is ``False`` and a file descriptor rather than a filename was " "given, the underlying file descriptor will be kept open when the file is " @@ -2217,7 +2219,7 @@ msgid "" "otherwise, an error will be raised." msgstr "" -#: ../../library/functions.rst:1310 +#: ../../library/functions.rst:1315 msgid "" "A custom opener can be used by passing a callable as *opener*. The " "underlying file descriptor for the file object is then obtained by calling " @@ -2226,11 +2228,11 @@ msgid "" "similar to passing ``None``)." msgstr "" -#: ../../library/functions.rst:1316 +#: ../../library/functions.rst:1321 msgid "The newly created file is :ref:`non-inheritable `." msgstr "新建立的檔案是\\ :ref:`不可繼承的 `。" -#: ../../library/functions.rst:1318 +#: ../../library/functions.rst:1323 msgid "" "The following example uses the :ref:`dir_fd ` parameter of the :func:" "`os.open` function to open a file relative to a given directory::" @@ -2240,7 +2242,7 @@ msgstr "" "\n" "::" -#: ../../library/functions.rst:1331 +#: ../../library/functions.rst:1336 msgid "" "The type of :term:`file object` returned by the :func:`open` function " "depends on the mode. When :func:`open` is used to open a file in a text " @@ -2255,7 +2257,7 @@ msgid "" "FileIO`, is returned." msgstr "" -#: ../../library/functions.rst:1352 +#: ../../library/functions.rst:1357 msgid "" "See also the file handling modules, such as :mod:`fileinput`, :mod:`io` " "(where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:" @@ -2265,7 +2267,7 @@ msgstr "" "`open` 的 module )、:mod:`os`、:mod:`os.path`、:mod:`tempfile` 以及 :mod:" "`shutil`。" -#: ../../library/functions.rst:1356 +#: ../../library/functions.rst:1361 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``file``, " "``mode``, ``flags``." @@ -2273,25 +2275,25 @@ msgstr "" "引發一個附帶引數 ``file``、``model``、``flags`` 的\\ :ref:`稽核事件 " "` ``open``。" -#: ../../library/functions.rst:1358 +#: ../../library/functions.rst:1363 msgid "" "The ``mode`` and ``flags`` arguments may have been modified or inferred from " "the original call." msgstr "" -#: ../../library/functions.rst:1363 +#: ../../library/functions.rst:1368 msgid "The *opener* parameter was added." msgstr "增加了 *opener* 參數。" -#: ../../library/functions.rst:1364 +#: ../../library/functions.rst:1369 msgid "The ``'x'`` mode was added." msgstr "增加了 ``'x'`` 模式。" -#: ../../library/functions.rst:1365 +#: ../../library/functions.rst:1370 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "過去觸發的 :exc:`IOError`,現在是 :exc:`OSError` 的別名。" -#: ../../library/functions.rst:1366 +#: ../../library/functions.rst:1371 msgid "" ":exc:`FileExistsError` is now raised if the file opened in exclusive " "creation mode (``'x'``) already exists." @@ -2299,11 +2301,11 @@ msgstr "" "如果檔案已存在但使用了唯一性建立模式 (\\ ``'x'``\\ ),現在會觸發 :exc:" "`FileExistsError`。" -#: ../../library/functions.rst:1371 +#: ../../library/functions.rst:1376 msgid "The file is now non-inheritable." msgstr "檔案在當前版本開始禁止繼承。" -#: ../../library/functions.rst:1375 +#: ../../library/functions.rst:1380 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 :" @@ -2312,15 +2314,15 @@ msgstr "" "如果系統呼叫被中斷,但訊號處理程序沒有觸發例外,此函式現在會重試系統呼叫,而" "不是觸發 :exc:`InterruptedError`\\ (原因詳見 :pep:`475`)。" -#: ../../library/functions.rst:1378 +#: ../../library/functions.rst:1383 msgid "The ``'namereplace'`` error handler was added." msgstr "增加了 ``'namereplace'`` 錯誤處理程式。" -#: ../../library/functions.rst:1382 +#: ../../library/functions.rst:1387 msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "增加對實現了 :class:`os.PathLike` 物件的支援。" -#: ../../library/functions.rst:1383 +#: ../../library/functions.rst:1388 msgid "" "On Windows, opening a console buffer may return a subclass of :class:`io." "RawIOBase` other than :class:`io.FileIO`." @@ -2328,11 +2330,11 @@ msgstr "" "在 Windows 上,開啟一個控制臺緩衝區可能會回傳 :class:`io.RawIOBase` 的 " "subclass,而不是 :class:`io.FileIO`。" -#: ../../library/functions.rst:1386 +#: ../../library/functions.rst:1391 msgid "The ``'U'`` mode has been removed." msgstr "``'U'`` 模式被移除。" -#: ../../library/functions.rst:1391 +#: ../../library/functions.rst:1396 msgid "" "Given a string representing one Unicode character, return an integer " "representing the Unicode code point of that character. For example, " @@ -2343,7 +2345,7 @@ msgstr "" "``ord('a')`` 回傳整數 ``97``、\\ ``ord('€')``\\ (歐元符號)回傳 ``8364``。這" "是 :func:`chr` 的逆函式。" -#: ../../library/functions.rst:1399 +#: ../../library/functions.rst:1404 msgid "" "Return *base* to the power *exp*; if *mod* is present, return *base* to the " "power *exp*, modulo *mod* (computed more efficiently than ``pow(base, exp) % " @@ -2354,7 +2356,7 @@ msgstr "" "*mod* 取餘數(比直接呼叫 ``pow(base, exp) % mod`` 計算更高效)。兩個引數形式" "的 ``pow(exp, exp)`` 等價於次方運算子:``base**exp``。" -#: ../../library/functions.rst:1404 +#: ../../library/functions.rst:1409 msgid "" "The arguments must have numeric types. With mixed operand types, the " "coercion rules for binary arithmetic operators apply. For :class:`int` " @@ -2367,7 +2369,7 @@ msgid "" "close to ``3j``." msgstr "" -#: ../../library/functions.rst:1414 +#: ../../library/functions.rst:1419 msgid "" "For :class:`int` operands *base* and *exp*, if *mod* is present, *mod* must " "also be of integer type and *mod* must be nonzero. If *mod* is present and " @@ -2376,29 +2378,29 @@ msgid "" "*base* modulo *mod*." msgstr "" -#: ../../library/functions.rst:1420 +#: ../../library/functions.rst:1425 msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" msgstr "" -#: ../../library/functions.rst:1427 +#: ../../library/functions.rst:1432 msgid "" "For :class:`int` operands, the three-argument form of ``pow`` now allows the " "second argument to be negative, permitting computation of modular inverses." msgstr "" -#: ../../library/functions.rst:1432 +#: ../../library/functions.rst:1437 msgid "" "Allow keyword arguments. Formerly, only positional arguments were supported." msgstr "" -#: ../../library/functions.rst:1439 +#: ../../library/functions.rst:1444 msgid "" "Print *objects* to the text stream *file*, separated by *sep* and followed " "by *end*. *sep*, *end*, *file*, and *flush*, if present, must be given as " "keyword arguments." msgstr "" -#: ../../library/functions.rst:1443 +#: ../../library/functions.rst:1448 msgid "" "All non-keyword arguments are converted to strings like :func:`str` does and " "written to the stream, separated by *sep* and followed by *end*. Both *sep* " @@ -2407,7 +2409,7 @@ msgid "" "*end*." msgstr "" -#: ../../library/functions.rst:1449 +#: ../../library/functions.rst:1454 msgid "" "The *file* argument must be an object with a ``write(string)`` method; if it " "is not present or ``None``, :data:`sys.stdout` will be used. Since printed " @@ -2415,38 +2417,38 @@ msgid "" "binary mode file objects. For these, use ``file.write(...)`` instead." msgstr "" -#: ../../library/functions.rst:1454 +#: ../../library/functions.rst:1459 msgid "" "Output buffering is usually determined by *file*. However, if *flush* is " "true, the stream is forcibly flushed." msgstr "" -#: ../../library/functions.rst:1458 +#: ../../library/functions.rst:1463 msgid "Added the *flush* keyword argument." msgstr "增加了 *flush* 關鍵字引數。" -#: ../../library/functions.rst:1464 +#: ../../library/functions.rst:1469 msgid "Return a property attribute." msgstr "回傳 property 屬性。" -#: ../../library/functions.rst:1466 +#: ../../library/functions.rst:1471 msgid "" "*fget* is a function for getting an attribute value. *fset* is a function " "for setting an attribute value. *fdel* is a function for deleting an " "attribute value. And *doc* creates a docstring for the attribute." msgstr "" -#: ../../library/functions.rst:1470 +#: ../../library/functions.rst:1475 msgid "A typical use is to define a managed attribute ``x``::" msgstr "" -#: ../../library/functions.rst:1487 +#: ../../library/functions.rst:1492 msgid "" "If *c* is an instance of *C*, ``c.x`` will invoke the getter, ``c.x = " "value`` will invoke the setter, and ``del c.x`` the deleter." msgstr "" -#: ../../library/functions.rst:1490 +#: ../../library/functions.rst:1495 msgid "" "If given, *doc* will be the docstring of the property attribute. Otherwise, " "the property will copy *fget*'s docstring (if it exists). This makes it " @@ -2454,45 +2456,45 @@ msgid "" "term:`decorator`::" msgstr "" -#: ../../library/functions.rst:1503 +#: ../../library/functions.rst:1508 msgid "" -"The ``@property`` decorator turns the :meth:`voltage` method into a " +"The ``@property`` decorator turns the :meth:`!voltage` method into a " "\"getter\" for a read-only attribute with the same name, and it sets the " "docstring for *voltage* to \"Get the current voltage.\"" msgstr "" -#: ../../library/functions.rst:1507 +#: ../../library/functions.rst:1516 msgid "" -"A property object has :attr:`~property.getter`, :attr:`~property.setter`, " -"and :attr:`~property.deleter` methods usable as decorators that create a " -"copy of the property with the corresponding accessor function set to the " -"decorated function. This is best explained with an example::" +"A property object has ``getter``, ``setter``, and ``deleter`` methods usable " +"as decorators that create a copy of the property with the corresponding " +"accessor function set to the decorated function. This is best explained " +"with an example:" msgstr "" -#: ../../library/functions.rst:1529 +#: ../../library/functions.rst:1540 msgid "" "This code is exactly equivalent to the first example. Be sure to give the " "additional functions the same name as the original property (``x`` in this " "case.)" msgstr "" -#: ../../library/functions.rst:1533 +#: ../../library/functions.rst:1544 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." msgstr "" -#: ../../library/functions.rst:1536 +#: ../../library/functions.rst:1547 msgid "The docstrings of property objects are now writeable." msgstr "" -#: ../../library/functions.rst:1545 +#: ../../library/functions.rst:1556 msgid "" "Rather than being a function, :class:`range` is actually an immutable " "sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1551 +#: ../../library/functions.rst:1562 msgid "" "Return a string containing a printable representation of an object. For " "many types, this function makes an attempt to return a string that would " @@ -2500,27 +2502,27 @@ msgid "" "the representation is a string enclosed in angle brackets that contains the " "name of the type of the object together with additional information often " "including the name and address of the object. A class can control what this " -"function returns for its instances by defining a :meth:`__repr__` method. " -"If :func:`sys.displayhook` is not accessible, this function will raise :exc:" -"`RuntimeError`." +"function returns for its instances by defining a :meth:`~object.__repr__` " +"method. If :func:`sys.displayhook` is not accessible, this function will " +"raise :exc:`RuntimeError`." msgstr "" -#: ../../library/functions.rst:1564 +#: ../../library/functions.rst:1576 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" -"meth:`__reversed__` method or supports the sequence protocol (the :meth:" -"`__len__` method and the :meth:`~object.__getitem__` method with integer " -"arguments starting at ``0``)." +"meth:`~object.__reversed__` method or supports the sequence protocol (the :" +"meth:`~object.__len__` method and the :meth:`~object.__getitem__` method " +"with integer arguments starting at ``0``)." msgstr "" -#: ../../library/functions.rst:1572 +#: ../../library/functions.rst:1584 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:1576 +#: ../../library/functions.rst:1588 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 " @@ -2531,13 +2533,13 @@ msgid "" "``None``. Otherwise, the return value has the same type as *number*." msgstr "" -#: ../../library/functions.rst:1585 +#: ../../library/functions.rst:1597 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." msgstr "" -#: ../../library/functions.rst:1590 +#: ../../library/functions.rst:1602 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 " @@ -2546,21 +2548,21 @@ msgid "" "information." msgstr "" -#: ../../library/functions.rst:1602 +#: ../../library/functions.rst:1614 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:1606 +#: ../../library/functions.rst:1618 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:1613 +#: ../../library/functions.rst:1625 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 " @@ -2569,7 +2571,7 @@ msgid "" "is equivalent to ``x.foobar = 123``." msgstr "" -#: ../../library/functions.rst:1619 +#: ../../library/functions.rst:1631 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:" @@ -2578,61 +2580,70 @@ msgid "" "notation, but is accessible through :func:`getattr` etc.." msgstr "" -#: ../../library/functions.rst:1627 +#: ../../library/functions.rst:1639 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:1636 +#: ../../library/functions.rst:1648 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``. Slice objects have read-only data attributes :attr:`~slice." -"start`, :attr:`~slice.stop`, and :attr:`~slice.step` which merely return the " -"argument values (or their default). They have no other explicit " -"functionality; however, they are used by NumPy and other third-party " -"packages. 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 iterator." +"``None``." +msgstr "" + +#: ../../library/functions.rst:1656 +msgid "" +"Slice objects have read-only data attributes :attr:`!start`, :attr:`!stop`, " +"and :attr:`!step` which merely return the argument values (or their " +"default). They have no other explicit functionality; however, they are used " +"by NumPy and other third-party packages." msgstr "" -#: ../../library/functions.rst:1646 +#: ../../library/functions.rst:1661 +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:1666 msgid "" "Slice objects are now :term:`hashable` (provided :attr:`~slice.start`, :attr:" "`~slice.stop`, and :attr:`~slice.step` are hashable)." msgstr "" -#: ../../library/functions.rst:1652 +#: ../../library/functions.rst:1672 msgid "Return a new sorted list from the items in *iterable*." msgstr "" -#: ../../library/functions.rst:1654 +#: ../../library/functions.rst:1674 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "有兩個選擇性引數,只能使用關鍵字引數來指定。" -#: ../../library/functions.rst:1656 +#: ../../library/functions.rst:1676 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:1660 +#: ../../library/functions.rst:1680 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:1663 +#: ../../library/functions.rst:1683 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." msgstr "" -#: ../../library/functions.rst:1666 +#: ../../library/functions.rst:1686 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 " @@ -2640,7 +2651,7 @@ msgid "" "example, sort by department, then by salary grade)." msgstr "" -#: ../../library/functions.rst:1671 +#: ../../library/functions.rst:1691 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -2652,22 +2663,22 @@ msgid "" "method." msgstr "" -#: ../../library/functions.rst:1680 +#: ../../library/functions.rst:1700 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functions.rst:1684 +#: ../../library/functions.rst:1704 msgid "Transform a method into a static method." msgstr "" -#: ../../library/functions.rst:1686 +#: ../../library/functions.rst:1706 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" msgstr "" -#: ../../library/functions.rst:1693 +#: ../../library/functions.rst:1713 msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -2675,21 +2686,21 @@ msgstr "" "``@staticmethod`` 語法是一個函式 :term:`decorator` - 參見 :ref:`function` 中" "的詳細介紹。" -#: ../../library/functions.rst:1696 +#: ../../library/functions.rst:1716 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:1700 +#: ../../library/functions.rst:1720 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:1704 +#: ../../library/functions.rst:1724 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 " @@ -2698,36 +2709,36 @@ msgid "" "cases, use this idiom::" msgstr "" -#: ../../library/functions.rst:1716 +#: ../../library/functions.rst:1736 msgid "For more information on static methods, see :ref:`types`." msgstr "關於 static method 的更多資訊,請參考 :ref:`types`。" -#: ../../library/functions.rst:1718 +#: ../../library/functions.rst:1738 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:1733 +#: ../../library/functions.rst:1753 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" -#: ../../library/functions.rst:1735 +#: ../../library/functions.rst:1755 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." msgstr "" -#: ../../library/functions.rst:1741 +#: ../../library/functions.rst:1761 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:1745 +#: ../../library/functions.rst:1765 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 ``''." @@ -2736,37 +2747,37 @@ msgid "" "using :func:`itertools.chain`." msgstr "" -#: ../../library/functions.rst:1751 +#: ../../library/functions.rst:1771 msgid "The *start* parameter can be specified as a keyword argument." msgstr "*start* 參數可被指定為關鍵字引數。" -#: ../../library/functions.rst:1754 +#: ../../library/functions.rst:1774 msgid "" "Summation of floats switched to an algorithm that gives higher accuracy on " "most builds." msgstr "" -#: ../../library/functions.rst:1761 +#: ../../library/functions.rst:1781 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:1765 +#: ../../library/functions.rst:1785 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:1769 +#: ../../library/functions.rst:1789 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:1773 +#: ../../library/functions.rst:1793 msgid "" "The :attr:`~class.__mro__` attribute of the *object_or_type* lists the " "method resolution search order used by both :func:`getattr` and :func:" @@ -2774,7 +2785,7 @@ msgid "" "hierarchy is updated." msgstr "" -#: ../../library/functions.rst:1778 +#: ../../library/functions.rst:1798 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. " @@ -2782,7 +2793,7 @@ msgid "" "(this is useful for classmethods)." msgstr "" -#: ../../library/functions.rst:1783 +#: ../../library/functions.rst:1803 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 " @@ -2790,7 +2801,7 @@ msgid "" "closely parallels the use of *super* in other programming languages." msgstr "" -#: ../../library/functions.rst:1788 +#: ../../library/functions.rst:1808 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 " @@ -2803,28 +2814,28 @@ msgid "" "classes that are unknown prior to runtime)." msgstr "" -#: ../../library/functions.rst:1798 +#: ../../library/functions.rst:1818 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" -#: ../../library/functions.rst:1805 +#: ../../library/functions.rst:1825 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:1809 +#: ../../library/functions.rst:1829 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " -"does so by implementing its own :meth:`__getattribute__` method for " +"does so by implementing its own :meth:`~object.__getattribute__` method for " "searching classes in a predictable order that supports cooperative multiple " "inheritance. Accordingly, :func:`super` is undefined for implicit lookups " "using statements or operators such as ``super()[name]``." msgstr "" -#: ../../library/functions.rst:1816 +#: ../../library/functions.rst:1837 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 " @@ -2834,33 +2845,33 @@ msgid "" "accessing the current instance for ordinary methods." msgstr "" -#: ../../library/functions.rst:1823 +#: ../../library/functions.rst:1844 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_." msgstr "" -#: ../../library/functions.rst:1833 +#: ../../library/functions.rst:1854 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:1842 +#: ../../library/functions.rst:1863 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:1846 +#: ../../library/functions.rst:1867 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:1850 +#: ../../library/functions.rst:1871 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 " @@ -2873,11 +2884,11 @@ msgid "" "identical :class:`type` objects:" msgstr "" -#: ../../library/functions.rst:1865 +#: ../../library/functions.rst:1886 msgid "See also :ref:`bltin-type-objects`." msgstr "另請參閱 :ref:`bltin-type-objects`。" -#: ../../library/functions.rst:1867 +#: ../../library/functions.rst:1888 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -2885,23 +2896,23 @@ msgid "" "would." msgstr "" -#: ../../library/functions.rst:1872 +#: ../../library/functions.rst:1893 msgid "See also :ref:`class-customization`." msgstr "另請參閱 :ref:`class-customization`。" -#: ../../library/functions.rst:1874 +#: ../../library/functions.rst:1895 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:1881 +#: ../../library/functions.rst:1902 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:1884 +#: ../../library/functions.rst:1905 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " @@ -2909,54 +2920,54 @@ msgid "" "`types.MappingProxyType` to prevent direct dictionary updates)." msgstr "" -#: ../../library/functions.rst:1889 +#: ../../library/functions.rst:1910 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:1893 +#: ../../library/functions.rst:1914 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:1899 +#: ../../library/functions.rst:1920 msgid "" "Iterate over several iterables in parallel, producing tuples with an item " "from each one." msgstr "" -#: ../../library/functions.rst:1902 +#: ../../library/functions.rst:1923 msgid "Example::" msgstr "" "例如:\n" "\n" "::" -#: ../../library/functions.rst:1911 +#: ../../library/functions.rst:1932 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:1914 +#: ../../library/functions.rst:1935 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:1918 +#: ../../library/functions.rst:1939 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:1922 +#: ../../library/functions.rst:1943 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 " @@ -2964,51 +2975,51 @@ msgid "" "approaches to dealing with this issue:" msgstr "" -#: ../../library/functions.rst:1927 +#: ../../library/functions.rst:1948 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:1934 +#: ../../library/functions.rst:1955 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:1941 +#: ../../library/functions.rst:1962 msgid "" "Unlike the default behavior, it raises a :exc:`ValueError` if one iterable " "is exhausted before the others:" msgstr "" -#: ../../library/functions.rst:1959 +#: ../../library/functions.rst:1980 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:1963 +#: ../../library/functions.rst:1984 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:1967 +#: ../../library/functions.rst:1988 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:1970 +#: ../../library/functions.rst:1991 msgid "Tips and tricks:" msgstr "" -#: ../../library/functions.rst:1972 +#: ../../library/functions.rst:1993 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 " @@ -3017,23 +3028,23 @@ msgid "" "iterator. This has the effect of dividing the input into n-length chunks." msgstr "" -#: ../../library/functions.rst:1978 +#: ../../library/functions.rst:1999 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -#: ../../library/functions.rst:1989 +#: ../../library/functions.rst:2010 msgid "Added the ``strict`` argument." msgstr "增加了 ``strict`` 引數。" -#: ../../library/functions.rst:2001 +#: ../../library/functions.rst:2022 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2004 +#: ../../library/functions.rst:2025 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -3045,7 +3056,7 @@ msgid "" "discouraged in favor of :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2013 +#: ../../library/functions.rst:2034 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -3055,7 +3066,7 @@ msgid "" "determine the package context of the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:2020 +#: ../../library/functions.rst:2041 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -3064,7 +3075,7 @@ msgid "" "details)." msgstr "" -#: ../../library/functions.rst:2026 +#: ../../library/functions.rst:2047 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 " @@ -3072,58 +3083,58 @@ msgid "" "given, the module named by *name* is returned." msgstr "" -#: ../../library/functions.rst:2031 +#: ../../library/functions.rst:2052 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" -#: ../../library/functions.rst:2036 +#: ../../library/functions.rst:2057 msgid "The statement ``import spam.ham`` results in this call::" msgstr "" -#: ../../library/functions.rst:2040 +#: ../../library/functions.rst:2061 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:2043 +#: ../../library/functions.rst:2064 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" msgstr "" -#: ../../library/functions.rst:2050 +#: ../../library/functions.rst:2071 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:2054 +#: ../../library/functions.rst:2075 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2057 +#: ../../library/functions.rst:2078 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." msgstr "" -#: ../../library/functions.rst:2061 +#: ../../library/functions.rst:2082 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:2066 +#: ../../library/functions.rst:2087 msgid "Footnotes" msgstr "註解" -#: ../../library/functions.rst:2067 +#: ../../library/functions.rst:2088 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 " @@ -3132,110 +3143,110 @@ msgstr "" "剖析器只接受 Unix 風格的行結束符。如果您從檔案中讀取程式碼,請確保用換行符轉" "換模式轉換 Windows 或 Mac 風格的換行符。" -#: ../../library/functions.rst:152 +#: ../../library/functions.rst:153 msgid "Boolean" msgstr "Boolean(布林值)" -#: ../../library/functions.rst:152 ../../library/functions.rst:1840 +#: ../../library/functions.rst:153 ../../library/functions.rst:1861 msgid "type" msgstr "type(型別)" -#: ../../library/functions.rst:572 +#: ../../library/functions.rst:576 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/functions.rst:572 +#: ../../library/functions.rst:576 msgid "exec" msgstr "exec" -#: ../../library/functions.rst:649 +#: ../../library/functions.rst:653 msgid "NaN" msgstr "NaN" -#: ../../library/functions.rst:649 +#: ../../library/functions.rst:653 msgid "Infinity" msgstr "Infinity(無窮)" -#: ../../library/functions.rst:714 +#: ../../library/functions.rst:718 msgid "__format__" msgstr "__format__" -#: ../../library/functions.rst:714 ../../library/functions.rst:1725 +#: ../../library/functions.rst:718 ../../library/functions.rst:1745 msgid "string" msgstr "string(字串)" -#: ../../library/functions.rst:714 +#: ../../library/functions.rst:718 msgid "format() (built-in function)" msgstr "format()(內建函式)" -#: ../../library/functions.rst:1161 +#: ../../library/functions.rst:1166 msgid "file object" msgstr "file object(檔案物件)" -#: ../../library/functions.rst:1161 ../../library/functions.rst:1282 +#: ../../library/functions.rst:1166 ../../library/functions.rst:1287 msgid "open() built-in function" msgstr "open() 內建函式" -#: ../../library/functions.rst:1189 +#: ../../library/functions.rst:1194 msgid "file" msgstr "file(檔案)" -#: ../../library/functions.rst:1189 +#: ../../library/functions.rst:1194 msgid "modes" msgstr "modes(模式)" -#: ../../library/functions.rst:1282 +#: ../../library/functions.rst:1287 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/functions.rst:1343 +#: ../../library/functions.rst:1348 msgid "line-buffered I/O" msgstr "line-buffered I/O(列緩衝 I/O)" -#: ../../library/functions.rst:1343 +#: ../../library/functions.rst:1348 msgid "unbuffered I/O" msgstr "unbuffered I/O(非緩衝 I/O)" -#: ../../library/functions.rst:1343 +#: ../../library/functions.rst:1348 msgid "buffer size, I/O" msgstr "buffer size, I/O(緩衝區大小、I/O)" -#: ../../library/functions.rst:1343 +#: ../../library/functions.rst:1348 msgid "I/O control" msgstr "I/O control(I/O 控制)" -#: ../../library/functions.rst:1343 +#: ../../library/functions.rst:1348 msgid "buffering" msgstr "buffering(緩衝)" -#: ../../library/functions.rst:1343 +#: ../../library/functions.rst:1348 msgid "text mode" msgstr "text mode(文字模式)" -#: ../../library/functions.rst:1343 ../../library/functions.rst:1995 +#: ../../library/functions.rst:1348 ../../library/functions.rst:2016 msgid "module" msgstr "module(模組)" -#: ../../library/functions.rst:1343 +#: ../../library/functions.rst:1348 msgid "sys" msgstr "sys" -#: ../../library/functions.rst:1725 +#: ../../library/functions.rst:1745 msgid "str() (built-in function)" msgstr "str() (內建函式)" -#: ../../library/functions.rst:1840 +#: ../../library/functions.rst:1861 msgid "object" msgstr "object(物件)" -#: ../../library/functions.rst:1995 +#: ../../library/functions.rst:2016 msgid "statement" msgstr "statement(陳述式)" -#: ../../library/functions.rst:1995 +#: ../../library/functions.rst:2016 msgid "import" msgstr "import(引入)" -#: ../../library/functions.rst:1995 +#: ../../library/functions.rst:2016 msgid "builtins" msgstr "builtins(內建)" diff --git a/library/gettext.po b/library/gettext.po index 8933fb9e99..bd7759ba76 100644 --- a/library/gettext.po +++ b/library/gettext.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: 2023-12-04 00:03+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-" @@ -312,8 +312,8 @@ msgstr "" #: ../../library/gettext.rst:260 msgid "" -"Return the \"protected\" :attr:`_info` variable, a dictionary containing the " -"metadata found in the message catalog file." +"Return a dictionary containing the metadata found in the message catalog " +"file." msgstr "" #: ../../library/gettext.rst:266 @@ -359,10 +359,10 @@ msgstr "" #: ../../library/gettext.rst:299 msgid "" -"The :mod:`gettext` module provides one additional class derived from :class:" -"`NullTranslations`: :class:`GNUTranslations`. This class overrides :meth:" -"`_parse` to enable reading GNU :program:`gettext` format :file:`.mo` files " -"in both big-endian and little-endian format." +"The :mod:`!gettext` module provides one additional class derived from :class:" +"`NullTranslations`: :class:`GNUTranslations`. This class overrides :meth:`!" +"_parse` to enable reading GNU :program:`gettext` format :file:`.mo` files in " +"both big-endian and little-endian format." msgstr "" #: ../../library/gettext.rst:304 @@ -372,7 +372,7 @@ msgid "" "the translation for the empty string. This metadata is in :rfc:`822`\\ -" "style ``key: value`` pairs, and should contain the ``Project-Id-Version`` " "key. If the key ``Content-Type`` is found, then the ``charset`` property is " -"used to initialize the \"protected\" :attr:`_charset` instance variable, " +"used to initialize the \"protected\" :attr:`!_charset` instance variable, " "defaulting to ``None`` if not found. If the charset encoding is specified, " "then all message ids and message strings read from the catalog are converted " "to Unicode using this encoding, else ASCII is assumed." @@ -387,7 +387,7 @@ msgstr "" #: ../../library/gettext.rst:317 msgid "" "The entire set of key/value pairs are placed into a dictionary and set as " -"the \"protected\" :attr:`_info` instance variable." +"the \"protected\" :attr:`!_info` instance variable." msgstr "" #: ../../library/gettext.rst:320 @@ -747,9 +747,9 @@ msgstr "註解" #: ../../library/gettext.rst:639 msgid "" -"The default locale directory is system dependent; for example, on RedHat " +"The default locale directory is system dependent; for example, on Red Hat " "Linux it is :file:`/usr/share/locale`, but on Solaris it is :file:`/usr/lib/" -"locale`. The :mod:`gettext` module does not try to support these system " +"locale`. The :mod:`!gettext` module does not try to support these system " "dependent defaults; instead its default is :file:`{sys.base_prefix}/share/" "locale` (see :data:`sys.base_prefix`). For this reason, it is always best to " "call :func:`bindtextdomain` with an explicit absolute path at the start of " diff --git a/library/gzip.po b/library/gzip.po index b0564b3347..182f32d4a8 100644 --- a/library/gzip.po +++ b/library/gzip.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: 2023-11-27 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-" @@ -176,7 +176,7 @@ msgstr "" #: ../../library/gzip.rst:108 msgid "" -"Calling a :class:`GzipFile` object's :meth:`close` method does not close " +"Calling a :class:`GzipFile` object's :meth:`!close` method does not close " "*fileobj*, since you might wish to append more material after the compressed " "data. This also allows you to pass an :class:`io.BytesIO` object opened for " "writing as *fileobj*, and retrieve the resulting memory buffer using the :" diff --git a/library/html.po b/library/html.po index 12a6a39c4e..cfe9b1b431 100644 --- a/library/html.po +++ b/library/html.po @@ -34,14 +34,14 @@ msgstr "此模組定義了操作 HTML 的工具。" msgid "" "Convert the characters ``&``, ``<`` and ``>`` in string *s* to HTML-safe " "sequences. Use this if you need to display text that might contain such " -"characters in HTML. If the optional flag *quote* is true, the characters (``" -"\"``) and (``'``) are also translated; this helps for inclusion in an HTML " -"attribute value delimited by quotes, as in ````." +"characters in HTML. If the optional flag *quote* is true, the characters " +"(``\"``) and (``'``) are also translated; this helps for inclusion in an " +"HTML attribute value delimited by quotes, as in ````." msgstr "" -"將字串 *s* 中的 ``&``、``<`` 和 ``>`` 字元轉換為在 HTML 中安全的序列 (sequence)" -"。如果你需要在 HTML 中顯示可能包含這些字元的文字,可以使用這個函式。如果選擇性的旗標 " -"*quote* 為 true,則 (``\"``) 與 (``'``) 字元也會被轉換;這樣能包含在 HTML " -"中,被引號分隔的屬性值,如 ```` 。" +"將字串 *s* 中的 ``&``、``<`` 和 ``>`` 字元轉換為在 HTML 中安全的序列 " +"(sequence)。如果你需要在 HTML 中顯示可能包含這些字元的文字,可以使用這個函" +"式。如果選擇性的旗標 *quote* 為 true,則 (``\"``) 與 (``'``) 字元也會被轉換;" +"這樣能包含在 HTML 中,被引號分隔的屬性值,如 ```` 。" #: ../../library/html.rst:26 msgid "" @@ -51,10 +51,10 @@ msgid "" "and invalid character references, and the :data:`list of HTML 5 named " "character references `." msgstr "" -"將字串 *s* 中所有附名 (named) 且為數值的 (numeric) 字元參照(如: ``>``、" -" ``>``、``>`` )轉換為對應的 Unicode 字元。此函式針對有效及無效的字元參" -"照,皆使用 HTML 5 標準所定義的規則,以及 :data:`HTML 5 附名字元參照清單" -" ` 。" +"將字串 *s* 中所有附名 (named) 且為數值的 (numeric) 字元參照(如: ``>``、 " +"``>``、``>`` )轉換為對應的 Unicode 字元。此函式針對有效及無效的字元" +"參照,皆使用 HTML 5 標準所定義的規則,以及 :data:`HTML 5 附名字元參照清單 " +"` 。" #: ../../library/html.rst:36 msgid "Submodules in the ``html`` package are:" diff --git a/library/importlib.resources.po b/library/importlib.resources.po index 927b9c1463..a507e0395b 100644 --- a/library/importlib.resources.po +++ b/library/importlib.resources.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-09 00:03+0000\n" +"POT-Creation-Date: 2023-11-27 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -98,7 +98,7 @@ msgstr "" #: ../../library/importlib.resources.rst:66 msgid "" -"*anchor* is an optional :data:`Anchor`. If the anchor is a package, " +"*anchor* is an optional :class:`Anchor`. If the anchor is a package, " "resources are resolved from that package. If a module, resources are " "resolved adjacent to that module (in the same package or the package root). " "If the anchor is omitted, the caller's module is used." @@ -106,10 +106,10 @@ msgstr "" #: ../../library/importlib.resources.rst:74 msgid "" -"\"package\" parameter was renamed to \"anchor\". \"anchor\" can now be a non-" -"package module and if omitted will default to the caller's module. " -"\"package\" is still accepted for compatibility but will raise a " -"DeprecationWarning. Consider passing the anchor positionally or using " +"*package* parameter was renamed to *anchor*. *anchor* can now be a non-" +"package module and if omitted will default to the caller's module. *package* " +"is still accepted for compatibility but will raise a :exc:" +"`DeprecationWarning`. Consider passing the anchor positionally or using " "``importlib_resources >= 5.10`` for a compatible interface on older Pythons." msgstr "" @@ -134,7 +134,7 @@ msgid "" msgstr "" #: ../../library/importlib.resources.rst:98 -msgid "Added support for ``traversable`` representing a directory." +msgid "Added support for *traversable* representing a directory." msgstr "" #: ../../library/importlib.resources.rst:103 diff --git a/library/inspect.po b/library/inspect.po index b8d5bf3058..b0e7a49a1d 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-10-24 00:03+0000\n" +"POT-Creation-Date: 2023-12-06 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-" @@ -21,13 +21,13 @@ msgstr "" #: ../../library/inspect.rst:2 msgid ":mod:`inspect` --- Inspect live objects" -msgstr "" +msgstr ":mod:`inspect` --- 檢視活動物件" -#: ../../library/inspect.rst:10 +#: ../../library/inspect.rst:15 msgid "**Source code:** :source:`Lib/inspect.py`" msgstr "**原始碼:**\\ :source:`Lib/inspect.py`" -#: ../../library/inspect.rst:14 +#: ../../library/inspect.rst:19 msgid "" "The :mod:`inspect` module provides several useful functions to help get " "information about live objects such as modules, classes, methods, functions, " @@ -37,18 +37,18 @@ msgid "" "information you need to display a detailed traceback." msgstr "" -#: ../../library/inspect.rst:21 +#: ../../library/inspect.rst:26 msgid "" "There are four main kinds of services provided by this module: type " "checking, getting source code, inspecting classes and functions, and " "examining the interpreter stack." msgstr "" -#: ../../library/inspect.rst:29 +#: ../../library/inspect.rst:34 msgid "Types and members" msgstr "" -#: ../../library/inspect.rst:31 +#: ../../library/inspect.rst:36 msgid "" "The :func:`getmembers` function retrieves the members of an object such as a " "class or module. The functions whose names begin with \"is\" are mainly " @@ -58,493 +58,493 @@ msgid "" "attributes):" msgstr "" -#: ../../library/inspect.rst:41 +#: ../../library/inspect.rst:46 msgid "Type" msgstr "" -#: ../../library/inspect.rst:41 +#: ../../library/inspect.rst:46 msgid "Attribute" msgstr "屬性" -#: ../../library/inspect.rst:41 +#: ../../library/inspect.rst:46 msgid "Description" msgstr "描述" -#: ../../library/inspect.rst:43 +#: ../../library/inspect.rst:48 msgid "class" msgstr "" -#: ../../library/inspect.rst:43 ../../library/inspect.rst:53 -#: ../../library/inspect.rst:71 ../../library/inspect.rst:233 +#: ../../library/inspect.rst:48 ../../library/inspect.rst:58 +#: ../../library/inspect.rst:76 ../../library/inspect.rst:238 msgid "__doc__" msgstr "__doc__" -#: ../../library/inspect.rst:43 ../../library/inspect.rst:53 -#: ../../library/inspect.rst:71 ../../library/inspect.rst:233 +#: ../../library/inspect.rst:48 ../../library/inspect.rst:58 +#: ../../library/inspect.rst:76 ../../library/inspect.rst:238 msgid "documentation string" msgstr "" -#: ../../library/inspect.rst:45 ../../library/inspect.rst:55 -#: ../../library/inspect.rst:73 ../../library/inspect.rst:202 -#: ../../library/inspect.rst:216 ../../library/inspect.rst:235 +#: ../../library/inspect.rst:50 ../../library/inspect.rst:60 +#: ../../library/inspect.rst:78 ../../library/inspect.rst:207 +#: ../../library/inspect.rst:221 ../../library/inspect.rst:240 msgid "__name__" msgstr "__name__" -#: ../../library/inspect.rst:45 +#: ../../library/inspect.rst:50 msgid "name with which this class was defined" msgstr "" -#: ../../library/inspect.rst:48 ../../library/inspect.rst:58 -#: ../../library/inspect.rst:76 ../../library/inspect.rst:204 -#: ../../library/inspect.rst:218 ../../library/inspect.rst:238 +#: ../../library/inspect.rst:53 ../../library/inspect.rst:63 +#: ../../library/inspect.rst:81 ../../library/inspect.rst:209 +#: ../../library/inspect.rst:223 ../../library/inspect.rst:243 msgid "__qualname__" msgstr "__qualname__" -#: ../../library/inspect.rst:48 ../../library/inspect.rst:58 -#: ../../library/inspect.rst:76 ../../library/inspect.rst:204 -#: ../../library/inspect.rst:218 ../../library/inspect.rst:238 +#: ../../library/inspect.rst:53 ../../library/inspect.rst:63 +#: ../../library/inspect.rst:81 ../../library/inspect.rst:209 +#: ../../library/inspect.rst:223 ../../library/inspect.rst:243 msgid "qualified name" msgstr "" -#: ../../library/inspect.rst:50 ../../library/inspect.rst:68 -#: ../../library/inspect.rst:101 +#: ../../library/inspect.rst:55 ../../library/inspect.rst:73 +#: ../../library/inspect.rst:106 msgid "__module__" msgstr "__module__" -#: ../../library/inspect.rst:50 +#: ../../library/inspect.rst:55 msgid "name of module in which this class was defined" msgstr "" -#: ../../library/inspect.rst:53 +#: ../../library/inspect.rst:58 msgid "method" msgstr "" -#: ../../library/inspect.rst:55 +#: ../../library/inspect.rst:60 msgid "name with which this method was defined" msgstr "" -#: ../../library/inspect.rst:60 +#: ../../library/inspect.rst:65 msgid "__func__" msgstr "__func__" -#: ../../library/inspect.rst:60 +#: ../../library/inspect.rst:65 msgid "function object containing implementation of method" msgstr "" -#: ../../library/inspect.rst:64 ../../library/inspect.rst:240 +#: ../../library/inspect.rst:69 ../../library/inspect.rst:245 msgid "__self__" msgstr "__self__" -#: ../../library/inspect.rst:64 +#: ../../library/inspect.rst:69 msgid "instance to which this method is bound, or ``None``" msgstr "" -#: ../../library/inspect.rst:68 +#: ../../library/inspect.rst:73 msgid "name of module in which this method was defined" msgstr "" -#: ../../library/inspect.rst:71 +#: ../../library/inspect.rst:76 msgid "function" msgstr "函式" -#: ../../library/inspect.rst:73 +#: ../../library/inspect.rst:78 msgid "name with which this function was defined" msgstr "" -#: ../../library/inspect.rst:78 +#: ../../library/inspect.rst:83 msgid "__code__" msgstr "__code__" -#: ../../library/inspect.rst:78 +#: ../../library/inspect.rst:83 msgid "code object containing compiled function :term:`bytecode`" msgstr "" -#: ../../library/inspect.rst:82 +#: ../../library/inspect.rst:87 msgid "__defaults__" msgstr "__defaults__" -#: ../../library/inspect.rst:82 +#: ../../library/inspect.rst:87 msgid "tuple of any default values for positional or keyword parameters" msgstr "" -#: ../../library/inspect.rst:86 +#: ../../library/inspect.rst:91 msgid "__kwdefaults__" msgstr "__kwdefaults__" -#: ../../library/inspect.rst:86 +#: ../../library/inspect.rst:91 msgid "mapping of any default values for keyword-only parameters" msgstr "" -#: ../../library/inspect.rst:90 +#: ../../library/inspect.rst:95 msgid "__globals__" msgstr "__globals__" -#: ../../library/inspect.rst:90 +#: ../../library/inspect.rst:95 msgid "global namespace in which this function was defined" msgstr "" -#: ../../library/inspect.rst:93 +#: ../../library/inspect.rst:98 msgid "__builtins__" msgstr "__builtins__" -#: ../../library/inspect.rst:93 +#: ../../library/inspect.rst:98 msgid "builtins namespace" msgstr "" -#: ../../library/inspect.rst:95 +#: ../../library/inspect.rst:100 msgid "__annotations__" msgstr "__annotations__" -#: ../../library/inspect.rst:95 +#: ../../library/inspect.rst:100 msgid "" "mapping of parameters names to annotations; ``\"return\"`` key is reserved " "for return annotations." msgstr "" -#: ../../library/inspect.rst:101 +#: ../../library/inspect.rst:106 msgid "name of module in which this function was defined" msgstr "" -#: ../../library/inspect.rst:104 +#: ../../library/inspect.rst:109 msgid "traceback" msgstr "traceback" -#: ../../library/inspect.rst:104 +#: ../../library/inspect.rst:109 msgid "tb_frame" msgstr "tb_frame" -#: ../../library/inspect.rst:104 +#: ../../library/inspect.rst:109 msgid "frame object at this level" msgstr "" -#: ../../library/inspect.rst:107 +#: ../../library/inspect.rst:112 msgid "tb_lasti" msgstr "tb_lasti" -#: ../../library/inspect.rst:107 ../../library/inspect.rst:129 +#: ../../library/inspect.rst:112 ../../library/inspect.rst:134 msgid "index of last attempted instruction in bytecode" msgstr "" -#: ../../library/inspect.rst:110 +#: ../../library/inspect.rst:115 msgid "tb_lineno" msgstr "tb_lineno" -#: ../../library/inspect.rst:110 ../../library/inspect.rst:132 +#: ../../library/inspect.rst:115 ../../library/inspect.rst:137 msgid "current line number in Python source code" msgstr "" -#: ../../library/inspect.rst:113 +#: ../../library/inspect.rst:118 msgid "tb_next" msgstr "tb_next" -#: ../../library/inspect.rst:113 +#: ../../library/inspect.rst:118 msgid "next inner traceback object (called by this level)" msgstr "" -#: ../../library/inspect.rst:117 ../../library/inspect.rst:206 -#: ../../library/inspect.rst:223 +#: ../../library/inspect.rst:122 ../../library/inspect.rst:211 +#: ../../library/inspect.rst:228 msgid "frame" msgstr "" -#: ../../library/inspect.rst:117 +#: ../../library/inspect.rst:122 msgid "f_back" msgstr "f_back" -#: ../../library/inspect.rst:117 +#: ../../library/inspect.rst:122 msgid "next outer frame object (this frame's caller)" msgstr "" -#: ../../library/inspect.rst:120 +#: ../../library/inspect.rst:125 msgid "f_builtins" msgstr "f_builtins" -#: ../../library/inspect.rst:120 +#: ../../library/inspect.rst:125 msgid "builtins namespace seen by this frame" msgstr "" -#: ../../library/inspect.rst:123 +#: ../../library/inspect.rst:128 msgid "f_code" msgstr "f_code" -#: ../../library/inspect.rst:123 +#: ../../library/inspect.rst:128 msgid "code object being executed in this frame" msgstr "" -#: ../../library/inspect.rst:126 +#: ../../library/inspect.rst:131 msgid "f_globals" msgstr "f_globals" -#: ../../library/inspect.rst:126 +#: ../../library/inspect.rst:131 msgid "global namespace seen by this frame" msgstr "" -#: ../../library/inspect.rst:129 +#: ../../library/inspect.rst:134 msgid "f_lasti" msgstr "f_lasti" -#: ../../library/inspect.rst:132 +#: ../../library/inspect.rst:137 msgid "f_lineno" msgstr "f_lineno" -#: ../../library/inspect.rst:135 +#: ../../library/inspect.rst:140 msgid "f_locals" msgstr "f_locals" -#: ../../library/inspect.rst:135 +#: ../../library/inspect.rst:140 msgid "local namespace seen by this frame" msgstr "" -#: ../../library/inspect.rst:138 +#: ../../library/inspect.rst:143 msgid "f_trace" msgstr "f_trace" -#: ../../library/inspect.rst:138 +#: ../../library/inspect.rst:143 msgid "tracing function for this frame, or ``None``" msgstr "" -#: ../../library/inspect.rst:141 ../../library/inspect.rst:210 -#: ../../library/inspect.rst:227 +#: ../../library/inspect.rst:146 ../../library/inspect.rst:215 +#: ../../library/inspect.rst:232 msgid "code" msgstr "code(程式碼)" -#: ../../library/inspect.rst:141 +#: ../../library/inspect.rst:146 msgid "co_argcount" msgstr "co_argcount" -#: ../../library/inspect.rst:141 +#: ../../library/inspect.rst:146 msgid "" "number of arguments (not including keyword only arguments, \\* or \\*\\* " "args)" msgstr "" -#: ../../library/inspect.rst:146 +#: ../../library/inspect.rst:151 msgid "co_code" msgstr "co_code" -#: ../../library/inspect.rst:146 +#: ../../library/inspect.rst:151 msgid "string of raw compiled bytecode" msgstr "" -#: ../../library/inspect.rst:149 +#: ../../library/inspect.rst:154 msgid "co_cellvars" msgstr "co_cellvars" -#: ../../library/inspect.rst:149 +#: ../../library/inspect.rst:154 msgid "tuple of names of cell variables (referenced by containing scopes)" msgstr "" -#: ../../library/inspect.rst:153 +#: ../../library/inspect.rst:158 msgid "co_consts" msgstr "co_consts" -#: ../../library/inspect.rst:153 +#: ../../library/inspect.rst:158 msgid "tuple of constants used in the bytecode" msgstr "" -#: ../../library/inspect.rst:156 +#: ../../library/inspect.rst:161 msgid "co_filename" msgstr "co_filename" -#: ../../library/inspect.rst:156 +#: ../../library/inspect.rst:161 msgid "name of file in which this code object was created" msgstr "" -#: ../../library/inspect.rst:160 +#: ../../library/inspect.rst:165 msgid "co_firstlineno" msgstr "co_firstlineno" -#: ../../library/inspect.rst:160 +#: ../../library/inspect.rst:165 msgid "number of first line in Python source code" msgstr "" -#: ../../library/inspect.rst:163 +#: ../../library/inspect.rst:168 msgid "co_flags" msgstr "co_flags" -#: ../../library/inspect.rst:163 +#: ../../library/inspect.rst:168 msgid "" "bitmap of ``CO_*`` flags, read more :ref:`here `" msgstr "" -#: ../../library/inspect.rst:167 +#: ../../library/inspect.rst:172 msgid "co_lnotab" msgstr "co_lnotab" -#: ../../library/inspect.rst:167 +#: ../../library/inspect.rst:172 msgid "encoded mapping of line numbers to bytecode indices" msgstr "" -#: ../../library/inspect.rst:171 +#: ../../library/inspect.rst:176 msgid "co_freevars" msgstr "co_freevars" -#: ../../library/inspect.rst:171 +#: ../../library/inspect.rst:176 msgid "tuple of names of free variables (referenced via a function's closure)" msgstr "" -#: ../../library/inspect.rst:175 +#: ../../library/inspect.rst:180 msgid "co_posonlyargcount" msgstr "co_posonlyargcount" -#: ../../library/inspect.rst:175 +#: ../../library/inspect.rst:180 msgid "number of positional only arguments" msgstr "" -#: ../../library/inspect.rst:178 +#: ../../library/inspect.rst:183 msgid "co_kwonlyargcount" msgstr "co_kwonlyargcount" -#: ../../library/inspect.rst:178 +#: ../../library/inspect.rst:183 msgid "number of keyword only arguments (not including \\*\\* arg)" msgstr "" -#: ../../library/inspect.rst:182 +#: ../../library/inspect.rst:187 msgid "co_name" msgstr "co_name" -#: ../../library/inspect.rst:182 +#: ../../library/inspect.rst:187 msgid "name with which this code object was defined" msgstr "" -#: ../../library/inspect.rst:185 +#: ../../library/inspect.rst:190 msgid "co_qualname" msgstr "co_qualname" -#: ../../library/inspect.rst:185 +#: ../../library/inspect.rst:190 msgid "fully qualified name with which this code object was defined" msgstr "" -#: ../../library/inspect.rst:189 +#: ../../library/inspect.rst:194 msgid "co_names" msgstr "co_names" -#: ../../library/inspect.rst:189 +#: ../../library/inspect.rst:194 msgid "tuple of names other than arguments and function locals" msgstr "" -#: ../../library/inspect.rst:193 +#: ../../library/inspect.rst:198 msgid "co_nlocals" msgstr "co_nlocals" -#: ../../library/inspect.rst:193 +#: ../../library/inspect.rst:198 msgid "number of local variables" msgstr "" -#: ../../library/inspect.rst:195 +#: ../../library/inspect.rst:200 msgid "co_stacksize" msgstr "co_stacksize" -#: ../../library/inspect.rst:195 +#: ../../library/inspect.rst:200 msgid "virtual machine stack space required" msgstr "" -#: ../../library/inspect.rst:198 +#: ../../library/inspect.rst:203 msgid "co_varnames" msgstr "co_varnames" -#: ../../library/inspect.rst:198 +#: ../../library/inspect.rst:203 msgid "tuple of names of arguments and local variables" msgstr "" -#: ../../library/inspect.rst:202 +#: ../../library/inspect.rst:207 msgid "generator" msgstr "" -#: ../../library/inspect.rst:202 ../../library/inspect.rst:216 +#: ../../library/inspect.rst:207 ../../library/inspect.rst:221 msgid "name" msgstr "" -#: ../../library/inspect.rst:206 +#: ../../library/inspect.rst:211 msgid "gi_frame" msgstr "gi_frame" -#: ../../library/inspect.rst:208 +#: ../../library/inspect.rst:213 msgid "gi_running" msgstr "gi_running" -#: ../../library/inspect.rst:208 +#: ../../library/inspect.rst:213 msgid "is the generator running?" msgstr "" -#: ../../library/inspect.rst:210 +#: ../../library/inspect.rst:215 msgid "gi_code" msgstr "gi_code" -#: ../../library/inspect.rst:212 +#: ../../library/inspect.rst:217 msgid "gi_yieldfrom" msgstr "gi_yieldfrom" -#: ../../library/inspect.rst:212 +#: ../../library/inspect.rst:217 msgid "object being iterated by ``yield from``, or ``None``" msgstr "" -#: ../../library/inspect.rst:216 +#: ../../library/inspect.rst:221 msgid "coroutine" msgstr "" -#: ../../library/inspect.rst:220 +#: ../../library/inspect.rst:225 msgid "cr_await" msgstr "cr_await" -#: ../../library/inspect.rst:220 +#: ../../library/inspect.rst:225 msgid "object being awaited on, or ``None``" msgstr "" -#: ../../library/inspect.rst:223 +#: ../../library/inspect.rst:228 msgid "cr_frame" msgstr "cr_frame" -#: ../../library/inspect.rst:225 +#: ../../library/inspect.rst:230 msgid "cr_running" msgstr "cr_running" -#: ../../library/inspect.rst:225 +#: ../../library/inspect.rst:230 msgid "is the coroutine running?" msgstr "" -#: ../../library/inspect.rst:227 +#: ../../library/inspect.rst:232 msgid "cr_code" msgstr "cr_code" -#: ../../library/inspect.rst:229 +#: ../../library/inspect.rst:234 msgid "cr_origin" msgstr "cr_origin" -#: ../../library/inspect.rst:229 +#: ../../library/inspect.rst:234 msgid "where coroutine was created, or ``None``. See |coroutine-origin-link|" msgstr "" -#: ../../library/inspect.rst:233 +#: ../../library/inspect.rst:238 msgid "builtin" msgstr "" -#: ../../library/inspect.rst:235 +#: ../../library/inspect.rst:240 msgid "original name of this function or method" msgstr "" -#: ../../library/inspect.rst:240 +#: ../../library/inspect.rst:245 msgid "instance to which a method is bound, or ``None``" msgstr "" -#: ../../library/inspect.rst:247 +#: ../../library/inspect.rst:252 msgid "Add ``__qualname__`` and ``gi_yieldfrom`` attributes to generators." msgstr "" -#: ../../library/inspect.rst:249 +#: ../../library/inspect.rst:254 msgid "" "The ``__name__`` attribute of generators is now set from the function name, " "instead of the code name, and it can now be modified." msgstr "" -#: ../../library/inspect.rst:254 +#: ../../library/inspect.rst:259 msgid "Add ``cr_origin`` attribute to coroutines." -msgstr "" +msgstr "新增協程的 ``cr_origin`` 屬性。" -#: ../../library/inspect.rst:258 +#: ../../library/inspect.rst:263 msgid "Add ``__builtins__`` attribute to functions." -msgstr "" +msgstr "新增函式的 ``__builtins__`` 屬性。" -#: ../../library/inspect.rst:262 +#: ../../library/inspect.rst:267 msgid "" "Return all the members of an object in a list of ``(name, value)`` pairs " "sorted by name. If the optional *predicate* argument—which will be called " @@ -552,14 +552,14 @@ msgid "" "the predicate returns a true value are included." msgstr "" -#: ../../library/inspect.rst:269 +#: ../../library/inspect.rst:274 msgid "" ":func:`getmembers` will only return class attributes defined in the " "metaclass when the argument is a class and those attributes have been listed " -"in the metaclass' custom :meth:`__dir__`." +"in the metaclass' custom :meth:`~object.__dir__`." msgstr "" -#: ../../library/inspect.rst:276 +#: ../../library/inspect.rst:281 msgid "" "Return all the members of an object in a list of ``(name, value)`` pairs " "sorted by name without triggering dynamic lookup via the descriptor " @@ -567,7 +567,7 @@ msgid "" "that satisfy a given predicate." msgstr "" -#: ../../library/inspect.rst:283 +#: ../../library/inspect.rst:288 msgid "" ":func:`getmembers_static` may not be able to retrieve all members that " "getmembers can fetch (like dynamically created attributes) and may find " @@ -576,7 +576,7 @@ msgid "" "cases." msgstr "" -#: ../../library/inspect.rst:294 +#: ../../library/inspect.rst:299 msgid "" "Return the name of the module named by the file *path*, without including " "the names of enclosing packages. The file extension is checked against all " @@ -585,52 +585,52 @@ msgid "" "``None`` is returned." msgstr "" -#: ../../library/inspect.rst:300 +#: ../../library/inspect.rst:305 msgid "" "Note that this function *only* returns a meaningful name for actual Python " "modules - paths that potentially refer to Python packages will still return " "``None``." msgstr "" -#: ../../library/inspect.rst:304 +#: ../../library/inspect.rst:309 msgid "The function is based directly on :mod:`importlib`." -msgstr "" +msgstr "此函式直接基於 :mod:`importlib`。" -#: ../../library/inspect.rst:310 +#: ../../library/inspect.rst:315 msgid "Return ``True`` if the object is a module." -msgstr "" +msgstr "如果物件是模組,則回傳 ``True``。" -#: ../../library/inspect.rst:315 +#: ../../library/inspect.rst:320 msgid "" "Return ``True`` if the object is a class, whether built-in or created in " "Python code." msgstr "" -#: ../../library/inspect.rst:321 +#: ../../library/inspect.rst:326 msgid "Return ``True`` if the object is a bound method written in Python." msgstr "" -#: ../../library/inspect.rst:326 +#: ../../library/inspect.rst:331 msgid "" "Return ``True`` if the object is a Python function, which includes functions " "created by a :term:`lambda` expression." msgstr "" -#: ../../library/inspect.rst:332 +#: ../../library/inspect.rst:337 msgid "Return ``True`` if the object is a Python generator function." -msgstr "" +msgstr "如果物件是 Python 產生器函式,則回傳 ``True``。" -#: ../../library/inspect.rst:334 +#: ../../library/inspect.rst:339 msgid "" "Functions wrapped in :func:`functools.partial` now return ``True`` if the " "wrapped function is a Python generator function." msgstr "" -#: ../../library/inspect.rst:341 +#: ../../library/inspect.rst:346 msgid "Return ``True`` if the object is a generator." -msgstr "" +msgstr "如果物件是產生器,則回傳 ``True``。" -#: ../../library/inspect.rst:346 +#: ../../library/inspect.rst:351 msgid "" "Return ``True`` if the object is a :term:`coroutine function` (a function " "defined with an :keyword:`async def` syntax), a :func:`functools.partial` " @@ -638,175 +638,176 @@ msgid "" "`markcoroutinefunction`." msgstr "" -#: ../../library/inspect.rst:353 +#: ../../library/inspect.rst:358 msgid "" "Functions wrapped in :func:`functools.partial` now return ``True`` if the " "wrapped function is a :term:`coroutine function`." msgstr "" -#: ../../library/inspect.rst:357 +#: ../../library/inspect.rst:362 msgid "" "Sync functions marked with :func:`markcoroutinefunction` now return ``True``." msgstr "" -#: ../../library/inspect.rst:364 +#: ../../library/inspect.rst:369 msgid "" "Decorator to mark a callable as a :term:`coroutine function` if it would not " "otherwise be detected by :func:`iscoroutinefunction`." msgstr "" -#: ../../library/inspect.rst:367 +#: ../../library/inspect.rst:372 msgid "" "This may be of use for sync functions that return a :term:`coroutine`, if " "the function is passed to an API that requires :func:`iscoroutinefunction`." msgstr "" -#: ../../library/inspect.rst:370 +#: ../../library/inspect.rst:375 msgid "" "When possible, using an :keyword:`async def` function is preferred. Also " "acceptable is calling the function and testing the return with :func:" "`iscoroutine`." msgstr "" -#: ../../library/inspect.rst:379 +#: ../../library/inspect.rst:384 msgid "" "Return ``True`` if the object is a :term:`coroutine` created by an :keyword:" "`async def` function." msgstr "" -#: ../../library/inspect.rst:387 +#: ../../library/inspect.rst:392 msgid "" "Return ``True`` if the object can be used in :keyword:`await` expression." msgstr "" -#: ../../library/inspect.rst:389 +#: ../../library/inspect.rst:394 msgid "" "Can also be used to distinguish generator-based coroutines from regular " -"generators::" +"generators:" msgstr "" -#: ../../library/inspect.rst:406 +#: ../../library/inspect.rst:415 msgid "" "Return ``True`` if the object is an :term:`asynchronous generator` function, " -"for example::" +"for example:" msgstr "" -#: ../../library/inspect.rst:417 +#: ../../library/inspect.rst:428 msgid "" "Functions wrapped in :func:`functools.partial` now return ``True`` if the " "wrapped function is a :term:`asynchronous generator` function." msgstr "" -#: ../../library/inspect.rst:424 +#: ../../library/inspect.rst:435 msgid "" "Return ``True`` if the object is an :term:`asynchronous generator iterator` " "created by an :term:`asynchronous generator` function." msgstr "" -#: ../../library/inspect.rst:431 +#: ../../library/inspect.rst:442 msgid "Return ``True`` if the object is a traceback." msgstr "" -#: ../../library/inspect.rst:436 +#: ../../library/inspect.rst:447 msgid "Return ``True`` if the object is a frame." msgstr "" -#: ../../library/inspect.rst:441 +#: ../../library/inspect.rst:452 msgid "Return ``True`` if the object is a code." msgstr "" -#: ../../library/inspect.rst:446 +#: ../../library/inspect.rst:457 msgid "" "Return ``True`` if the object is a built-in function or a bound built-in " "method." msgstr "" -#: ../../library/inspect.rst:451 +#: ../../library/inspect.rst:462 msgid "" "Return ``True`` if the type of object is a :class:`~types.MethodWrapperType`." msgstr "" -#: ../../library/inspect.rst:453 +#: ../../library/inspect.rst:464 msgid "" "These are instances of :class:`~types.MethodWrapperType`, such as :meth:" "`~object.__str__`, :meth:`~object.__eq__` and :meth:`~object.__repr__`." msgstr "" -#: ../../library/inspect.rst:461 +#: ../../library/inspect.rst:472 msgid "" "Return ``True`` if the object is a user-defined or built-in function or " "method." -msgstr "" +msgstr "如果物件是使用者定義或內建的函式或方法,則回傳 ``True``。" -#: ../../library/inspect.rst:466 +#: ../../library/inspect.rst:477 msgid "Return ``True`` if the object is an abstract base class." -msgstr "" +msgstr "如果物件是抽象基底類別,則回傳 ``True``。" -#: ../../library/inspect.rst:471 +#: ../../library/inspect.rst:482 msgid "" "Return ``True`` if the object is a method descriptor, but not if :func:" "`ismethod`, :func:`isclass`, :func:`isfunction` or :func:`isbuiltin` are " "true." msgstr "" -#: ../../library/inspect.rst:475 +#: ../../library/inspect.rst:486 msgid "" "This, for example, is true of ``int.__add__``. An object passing this test " "has a :meth:`~object.__get__` method but not a :meth:`~object.__set__` " "method, but beyond that the set of attributes varies. A :attr:`~definition." -"__name__` attribute is usually sensible, and :attr:`__doc__` often is." +"__name__` attribute is usually sensible, and :attr:`!__doc__` often is." msgstr "" -#: ../../library/inspect.rst:481 +#: ../../library/inspect.rst:492 msgid "" "Methods implemented via descriptors that also pass one of the other tests " "return ``False`` from the :func:`ismethoddescriptor` test, simply because " -"the other tests promise more -- you can, e.g., count on having the :attr:" -"`__func__` attribute (etc) when an object passes :func:`ismethod`." +"the other tests promise more -- you can, e.g., count on having the :ref:" +"`__func__ ` attribute (etc) when an object passes :func:" +"`ismethod`." msgstr "" -#: ../../library/inspect.rst:489 +#: ../../library/inspect.rst:501 msgid "Return ``True`` if the object is a data descriptor." msgstr "" -#: ../../library/inspect.rst:491 +#: ../../library/inspect.rst:503 msgid "" "Data descriptors have a :attr:`~object.__set__` or a :attr:`~object." "__delete__` method. Examples are properties (defined in Python), getsets, " "and members. The latter two are defined in C and there are more specific " "tests available for those types, which is robust across Python " "implementations. Typically, data descriptors will also have :attr:" -"`~definition.__name__` and :attr:`__doc__` attributes (properties, getsets, " +"`~definition.__name__` and :attr:`!__doc__` attributes (properties, getsets, " "and members have both of these attributes), but this is not guaranteed." msgstr "" -#: ../../library/inspect.rst:502 +#: ../../library/inspect.rst:514 msgid "Return ``True`` if the object is a getset descriptor." msgstr "" -#: ../../library/inspect.rst:506 +#: ../../library/inspect.rst:518 msgid "" "getsets are attributes defined in extension modules via :c:type:" "`PyGetSetDef` structures. For Python implementations without such types, " "this method will always return ``False``." msgstr "" -#: ../../library/inspect.rst:513 +#: ../../library/inspect.rst:525 msgid "Return ``True`` if the object is a member descriptor." msgstr "" -#: ../../library/inspect.rst:517 +#: ../../library/inspect.rst:529 msgid "" "Member descriptors are attributes defined in extension modules via :c:type:" "`PyMemberDef` structures. For Python implementations without such types, " "this method will always return ``False``." msgstr "" -#: ../../library/inspect.rst:525 +#: ../../library/inspect.rst:537 msgid "Retrieving source code" msgstr "" -#: ../../library/inspect.rst:529 +#: ../../library/inspect.rst:541 msgid "" "Get the documentation string for an object, cleaned up with :func:" "`cleandoc`. If the documentation string for an object is not provided and " @@ -815,11 +816,11 @@ msgid "" "documentation string is invalid or missing." msgstr "" -#: ../../library/inspect.rst:535 +#: ../../library/inspect.rst:547 msgid "Documentation strings are now inherited if not overridden." msgstr "" -#: ../../library/inspect.rst:541 +#: ../../library/inspect.rst:553 msgid "" "Return in a single string any lines of comments immediately preceding the " "object's source code (for a class, function, or method), or at the top of " @@ -828,27 +829,27 @@ msgid "" "been defined in C or the interactive shell." msgstr "" -#: ../../library/inspect.rst:550 +#: ../../library/inspect.rst:562 msgid "" "Return the name of the (text or binary) file in which an object was defined. " "This will fail with a :exc:`TypeError` if the object is a built-in module, " "class, or function." msgstr "" -#: ../../library/inspect.rst:557 +#: ../../library/inspect.rst:569 msgid "" "Try to guess which module an object was defined in. Return ``None`` if the " "module cannot be determined." msgstr "" -#: ../../library/inspect.rst:563 +#: ../../library/inspect.rst:575 msgid "" "Return the name of the Python source file in which an object was defined or " "``None`` if no way can be identified to get the source. This will fail with " "a :exc:`TypeError` if the object is a built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:571 +#: ../../library/inspect.rst:583 msgid "" "Return a list of source lines and starting line number for an object. The " "argument may be a module, class, method, function, traceback, frame, or code " @@ -859,13 +860,13 @@ msgid "" "built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:580 ../../library/inspect.rst:594 +#: ../../library/inspect.rst:592 ../../library/inspect.rst:606 msgid "" ":exc:`OSError` is raised instead of :exc:`IOError`, now an alias of the " "former." msgstr "" -#: ../../library/inspect.rst:587 +#: ../../library/inspect.rst:599 msgid "" "Return the text of the source code for an object. The argument may be a " "module, class, method, function, traceback, frame, or code object. The " @@ -874,13 +875,13 @@ msgid "" "object is a built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:601 +#: ../../library/inspect.rst:613 msgid "" "Clean up indentation from docstrings that are indented to line up with " "blocks of code." msgstr "" -#: ../../library/inspect.rst:604 +#: ../../library/inspect.rst:616 msgid "" "All leading whitespace is removed from the first line. Any leading " "whitespace that can be uniformly removed from the second line onwards is " @@ -888,86 +889,85 @@ msgid "" "Also, all tabs are expanded to spaces." msgstr "" -#: ../../library/inspect.rst:613 +#: ../../library/inspect.rst:625 msgid "Introspecting callables with the Signature object" msgstr "" -#: ../../library/inspect.rst:617 +#: ../../library/inspect.rst:629 msgid "" -"The Signature object represents the call signature of a callable object and " -"its return annotation. To retrieve a Signature object, use the :func:" -"`signature` function." +"The :class:`Signature` object represents the call signature of a callable " +"object and its return annotation. To retrieve a :class:`!Signature` object, " +"use the :func:`!signature` function." msgstr "" -#: ../../library/inspect.rst:623 -msgid "Return a :class:`Signature` object for the given ``callable``::" +#: ../../library/inspect.rst:636 +msgid "Return a :class:`Signature` object for the given *callable*:" msgstr "" -#: ../../library/inspect.rst:640 +#: ../../library/inspect.rst:655 msgid "" "Accepts a wide range of Python callables, from plain functions and classes " "to :func:`functools.partial` objects." msgstr "" -#: ../../library/inspect.rst:643 +#: ../../library/inspect.rst:658 msgid "" "If the passed object has a ``__signature__`` attribute, this function " "returns it without further computations." msgstr "" -#: ../../library/inspect.rst:646 +#: ../../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:`inspect." -"get_annotations()`. The ``global``, ``locals``, and ``eval_str`` parameters " -"are passed into :func:`inspect.get_annotations()` when resolving the " -"annotations; see the documentation for :func:`inspect.get_annotations()` for " -"instructions on how to use these parameters." +"automatically un-stringize the annotations using :func:`get_annotations`. " +"The *globals*, *locals*, and *eval_str* parameters are passed into :func:" +"`get_annotations` when resolving the annotations; see the documentation for :" +"func:`get_annotations` for instructions on how to use these parameters." msgstr "" -#: ../../library/inspect.rst:655 +#: ../../library/inspect.rst:670 msgid "" "Raises :exc:`ValueError` if no signature can be provided, and :exc:" "`TypeError` if that type of object is not supported. Also, if the " -"annotations are stringized, and ``eval_str`` is not false, the ``eval()`` " -"call(s) to un-stringize the annotations could potentially raise any kind of " -"exception." +"annotations are stringized, and *eval_str* is not false, the ``eval()`` " +"call(s) to un-stringize the annotations in :func:`get_annotations` could " +"potentially raise any kind of exception." msgstr "" -#: ../../library/inspect.rst:661 +#: ../../library/inspect.rst:676 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:665 +#: ../../library/inspect.rst:680 msgid "" -"``follow_wrapped`` parameter. Pass ``False`` to get a signature of " -"``callable`` specifically (``callable.__wrapped__`` will not be used to " +"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:670 -msgid "``globals``, ``locals``, and ``eval_str`` parameters." +#: ../../library/inspect.rst:686 ../../library/inspect.rst:789 +msgid "The *globals*, *locals*, and *eval_str* parameters were added." msgstr "" -#: ../../library/inspect.rst:675 +#: ../../library/inspect.rst:691 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:682 +#: ../../library/inspect.rst:698 msgid "" -"A 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." +"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:686 +#: ../../library/inspect.rst:703 msgid "" "The optional *parameters* argument is a sequence of :class:`Parameter` " "objects, which is validated to check that there are no parameters with " @@ -976,54 +976,54 @@ msgid "" "defaults follow parameters without defaults." msgstr "" -#: ../../library/inspect.rst:692 +#: ../../library/inspect.rst:709 msgid "" -"The optional *return_annotation* argument, can be an arbitrary Python " -"object, is the \"return\" annotation of the callable." +"The optional *return_annotation* argument can be an arbitrary Python object. " +"It represents the \"return\" annotation of the callable." msgstr "" -#: ../../library/inspect.rst:695 +#: ../../library/inspect.rst:712 msgid "" -"Signature objects are *immutable*. Use :meth:`Signature.replace` to make a " -"modified copy." +":class:`!Signature` objects are *immutable*. Use :meth:`Signature.replace` " +"to make a modified copy." msgstr "" -#: ../../library/inspect.rst:698 -msgid "Signature objects are picklable and :term:`hashable`." +#: ../../library/inspect.rst:715 +msgid ":class:`!Signature` objects are now picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:703 +#: ../../library/inspect.rst:720 msgid "A special class-level marker to specify absence of a return annotation." msgstr "" -#: ../../library/inspect.rst:707 +#: ../../library/inspect.rst:724 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:711 ../../library/inspect.rst:1039 +#: ../../library/inspect.rst:728 ../../library/inspect.rst:1065 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:718 +#: ../../library/inspect.rst:735 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:723 +#: ../../library/inspect.rst:740 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:729 +#: ../../library/inspect.rst:746 msgid "" "Works the same way as :meth:`Signature.bind`, but allows the omission of " "some required arguments (mimics :func:`functools.partial` behavior.) " @@ -1031,255 +1031,251 @@ msgid "" "arguments do not match the signature." msgstr "" -#: ../../library/inspect.rst:736 +#: ../../library/inspect.rst:753 msgid "" -"Create a new Signature instance based on the instance :meth:`replace` was " -"invoked on. It is possible to pass different ``parameters`` and/or " -"``return_annotation`` to override the corresponding properties of the base " -"signature. To remove return_annotation from the copied Signature, pass in :" -"attr:`Signature.empty`." +"Create a new :class:`Signature` instance based on the instance :meth:" +"`replace` was invoked on. It is possible to pass different *parameters* and/" +"or *return_annotation* to override the corresponding properties of the base " +"signature. To remove ``return_annotation`` from the copied :class:`!" +"Signature`, pass in :attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:754 +#: ../../library/inspect.rst:773 msgid "" "Return a :class:`Signature` (or its subclass) object for a given callable " -"``obj``. Pass ``follow_wrapped=False`` to get a signature of ``obj`` " -"without unwrapping its ``__wrapped__`` chain. ``globalns`` and ``localns`` " -"will be used as the namespaces when resolving annotations." +"*obj*." msgstr "" -#: ../../library/inspect.rst:759 -msgid "This method simplifies subclassing of :class:`Signature`::" +#: ../../library/inspect.rst:776 +msgid "This method simplifies subclassing of :class:`Signature`:" msgstr "" -#: ../../library/inspect.rst:766 +#: ../../library/inspect.rst:785 msgid "Its behavior is otherwise identical to that of :func:`signature`." msgstr "" -#: ../../library/inspect.rst:770 -msgid "``globalns`` and ``localns`` parameters." -msgstr "" - -#: ../../library/inspect.rst:776 +#: ../../library/inspect.rst:795 msgid "" -"Parameter objects are *immutable*. Instead of modifying a Parameter object, " -"you can use :meth:`Parameter.replace` to create a modified copy." +":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:779 -msgid "Parameter objects are picklable and :term:`hashable`." +#: ../../library/inspect.rst:799 +msgid "Parameter objects are now picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:784 +#: ../../library/inspect.rst:804 msgid "" "A special class-level marker to specify absence of default values and " "annotations." msgstr "" -#: ../../library/inspect.rst:789 +#: ../../library/inspect.rst:809 msgid "" "The name of the parameter as a string. The name must be a valid Python " "identifier." msgstr "" -#: ../../library/inspect.rst:794 +#: ../../library/inspect.rst:814 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:798 +#: ../../library/inspect.rst:818 msgid "" -"These parameter names are exposed by this module as names like ``implicit0``." +"These parameter names are now exposed by this module as names like " +"``implicit0``." msgstr "" -#: ../../library/inspect.rst:804 +#: ../../library/inspect.rst:824 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:809 +#: ../../library/inspect.rst:829 msgid "" "The annotation for the parameter. If the parameter has no annotation, this " "attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:814 +#: ../../library/inspect.rst:834 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:821 +#: ../../library/inspect.rst:841 msgid "Name" msgstr "名稱" -#: ../../library/inspect.rst:821 +#: ../../library/inspect.rst:841 msgid "Meaning" msgstr "意義" -#: ../../library/inspect.rst:823 +#: ../../library/inspect.rst:843 msgid "*POSITIONAL_ONLY*" msgstr "*POSITIONAL_ONLY*" -#: ../../library/inspect.rst:823 +#: ../../library/inspect.rst:843 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:828 +#: ../../library/inspect.rst:848 msgid "*POSITIONAL_OR_KEYWORD*" msgstr "*POSITIONAL_OR_KEYWORD*" -#: ../../library/inspect.rst:828 +#: ../../library/inspect.rst:848 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:833 +#: ../../library/inspect.rst:853 msgid "*VAR_POSITIONAL*" msgstr "*VAR_POSITIONAL*" -#: ../../library/inspect.rst:833 +#: ../../library/inspect.rst:853 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:838 +#: ../../library/inspect.rst:858 msgid "*KEYWORD_ONLY*" msgstr "*KEYWORD_ONLY*" -#: ../../library/inspect.rst:838 +#: ../../library/inspect.rst:858 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:843 +#: ../../library/inspect.rst:863 msgid "*VAR_KEYWORD*" msgstr "*VAR_KEYWORD*" -#: ../../library/inspect.rst:843 +#: ../../library/inspect.rst:863 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:849 -msgid "Example: print all keyword-only arguments without default values::" +#: ../../library/inspect.rst:869 +msgid "Example: print all keyword-only arguments without default values:" msgstr "" -#: ../../library/inspect.rst:863 -msgid "Describes a enum value of Parameter.kind." +#: ../../library/inspect.rst:885 +msgid "Describes a enum value of :attr:`Parameter.kind`." msgstr "" -#: ../../library/inspect.rst:867 -msgid "Example: print all descriptions of arguments::" -msgstr "" +#: ../../library/inspect.rst:889 +msgid "Example: print all descriptions of arguments:" +msgstr "範例:列印所有引數的描述:" -#: ../../library/inspect.rst:882 +#: ../../library/inspect.rst:906 msgid "" -"Create a new Parameter instance based on the instance replaced was invoked " -"on. To override a :class:`Parameter` attribute, pass the corresponding " -"argument. To remove a default value or/and an annotation from a Parameter, " -"pass :attr:`Parameter.empty`." +"Create a new :class:`Parameter` instance based on the instance replaced was " +"invoked on. To override a :class:`!Parameter` attribute, pass the " +"corresponding argument. To remove a default value or/and an annotation from " +"a :class:`!Parameter`, pass :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:900 +#: ../../library/inspect.rst:924 msgid "" -"In Python 3.3 Parameter objects were allowed to have ``name`` set to " -"``None`` if their ``kind`` was set to ``POSITIONAL_ONLY``. This is no longer " -"permitted." +"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:907 +#: ../../library/inspect.rst:931 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:912 +#: ../../library/inspect.rst:936 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:916 +#: ../../library/inspect.rst:940 msgid "" "Should be used in conjunction with :attr:`Signature.parameters` for any " "argument processing purposes." msgstr "" -#: ../../library/inspect.rst:921 +#: ../../library/inspect.rst:945 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:926 +#: ../../library/inspect.rst:950 msgid "" ":attr:`arguments` is now of type :class:`dict`. Formerly, it was of type :" "class:`collections.OrderedDict`." msgstr "" -#: ../../library/inspect.rst:932 +#: ../../library/inspect.rst:956 msgid "" "A tuple of positional arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:937 +#: ../../library/inspect.rst:961 msgid "" "A dict of keyword arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:942 +#: ../../library/inspect.rst:966 msgid "A reference to the parent :class:`Signature` object." msgstr "" -#: ../../library/inspect.rst:946 +#: ../../library/inspect.rst:970 msgid "Set default values for missing arguments." -msgstr "" +msgstr "為遺漏的引數設定預設值。" -#: ../../library/inspect.rst:948 +#: ../../library/inspect.rst:972 msgid "" "For variable-positional arguments (``*args``) the default is an empty tuple." msgstr "" -#: ../../library/inspect.rst:951 +#: ../../library/inspect.rst:975 msgid "" "For variable-keyword arguments (``**kwargs``) the default is an empty dict." msgstr "" -#: ../../library/inspect.rst:964 +#: ../../library/inspect.rst:988 msgid "" "The :attr:`args` and :attr:`kwargs` properties can be used to invoke " -"functions::" +"functions:" msgstr "" -#: ../../library/inspect.rst:977 +#: ../../library/inspect.rst:1003 msgid ":pep:`362` - Function Signature Object." msgstr "" -#: ../../library/inspect.rst:978 +#: ../../library/inspect.rst:1004 msgid "The detailed specification, implementation details and examples." msgstr "" -#: ../../library/inspect.rst:984 +#: ../../library/inspect.rst:1010 msgid "Classes and functions" -msgstr "" +msgstr "類別與函式" -#: ../../library/inspect.rst:988 +#: ../../library/inspect.rst:1014 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 " @@ -1290,19 +1286,19 @@ msgid "" "will appear multiple times." msgstr "" -#: ../../library/inspect.rst:999 +#: ../../library/inspect.rst:1025 msgid "" "Get the names and default values of a Python function's parameters. A :term:" "`named tuple` is returned:" msgstr "" -#: ../../library/inspect.rst:1002 +#: ../../library/inspect.rst:1028 msgid "" "``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, " "annotations)``" msgstr "" -#: ../../library/inspect.rst:1005 +#: ../../library/inspect.rst:1031 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 " @@ -1317,7 +1313,7 @@ msgid "" "report the function return value annotation (if any)." msgstr "" -#: ../../library/inspect.rst:1020 +#: ../../library/inspect.rst:1046 msgid "" "Note that :func:`signature` and :ref:`Signature Object ` provide the recommended API for callable introspection, and support " @@ -1327,14 +1323,14 @@ msgid "" "``inspect`` module API." msgstr "" -#: ../../library/inspect.rst:1027 +#: ../../library/inspect.rst:1053 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:1032 +#: ../../library/inspect.rst:1058 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 " @@ -1342,7 +1338,7 @@ msgid "" "code migrating away from the legacy :func:`getargspec` API." msgstr "" -#: ../../library/inspect.rst:1047 +#: ../../library/inspect.rst:1073 msgid "" "Get information about arguments passed into a particular frame. A :term:" "`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. " @@ -1351,18 +1347,18 @@ msgid "" "dictionary of the given frame." msgstr "" -#: ../../library/inspect.rst:1054 ../../library/inspect.rst:1064 +#: ../../library/inspect.rst:1080 ../../library/inspect.rst:1090 msgid "This function was inadvertently marked as deprecated in Python 3.5." msgstr "" -#: ../../library/inspect.rst:1059 +#: ../../library/inspect.rst:1085 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:1069 +#: ../../library/inspect.rst:1095 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 " @@ -1370,7 +1366,7 @@ msgid "" "user-defined metatype is in use, cls will be the first element of the tuple." msgstr "" -#: ../../library/inspect.rst:1077 +#: ../../library/inspect.rst:1103 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 " @@ -1380,14 +1376,14 @@ msgid "" "In case of invoking *func* incorrectly, i.e. whenever ``func(*args, " "**kwds)`` would raise an exception because of incompatible signature, an " "exception of the same type and the same or similar message is raised. For " -"example::" +"example:" msgstr "" -#: ../../library/inspect.rst:1101 +#: ../../library/inspect.rst:1129 msgid "Use :meth:`Signature.bind` and :meth:`Signature.bind_partial` instead." -msgstr "" +msgstr "請改用 :meth:`Signature.bind` 與 :meth:`Signature.bind_partial`。" -#: ../../library/inspect.rst:1107 +#: ../../library/inspect.rst:1135 msgid "" "Get the mapping of external name references in a Python function or method " "*func* to their current values. A :term:`named tuple` " @@ -1399,18 +1395,18 @@ msgid "" "builtins." msgstr "" -#: ../../library/inspect.rst:1116 +#: ../../library/inspect.rst:1144 msgid "" ":exc:`TypeError` is raised if *func* is not a Python function or method." -msgstr "" +msgstr "如果 *func* 不是 Python 函式或方法,則引發 :exc:`TypeError`。" -#: ../../library/inspect.rst:1123 +#: ../../library/inspect.rst:1151 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:1126 +#: ../../library/inspect.rst:1154 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 " @@ -1420,68 +1416,68 @@ msgid "" "``__signature__`` attribute defined." msgstr "" -#: ../../library/inspect.rst:1133 +#: ../../library/inspect.rst:1161 msgid ":exc:`ValueError` is raised if a cycle is encountered." -msgstr "" +msgstr "如果遇到循環,則引發 :exc:`ValueError`。" -#: ../../library/inspect.rst:1140 +#: ../../library/inspect.rst:1168 msgid "Compute the annotations dict for an object." msgstr "" -#: ../../library/inspect.rst:1142 +#: ../../library/inspect.rst:1170 msgid "" "``obj`` may be a callable, class, or module. Passing in an object of any " "other type raises :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:1145 +#: ../../library/inspect.rst:1173 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:1149 +#: ../../library/inspect.rst:1177 msgid "This function handles several details for you:" msgstr "" -#: ../../library/inspect.rst:1151 +#: ../../library/inspect.rst:1179 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:1155 +#: ../../library/inspect.rst:1183 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:1159 +#: ../../library/inspect.rst:1187 msgid "" "Ignores inherited annotations on classes. If a class doesn't have its own " "annotations dict, returns an empty dict." msgstr "" -#: ../../library/inspect.rst:1161 +#: ../../library/inspect.rst:1189 msgid "" "All accesses to object members and dict values are done using ``getattr()`` " "and ``dict.get()`` for safety." msgstr "" -#: ../../library/inspect.rst:1163 +#: ../../library/inspect.rst:1191 msgid "Always, always, always returns a freshly created dict." msgstr "" -#: ../../library/inspect.rst:1165 +#: ../../library/inspect.rst:1193 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:1168 +#: ../../library/inspect.rst:1196 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()` " @@ -1489,12 +1485,12 @@ msgid "" "call.)" msgstr "" -#: ../../library/inspect.rst:1172 +#: ../../library/inspect.rst:1200 msgid "" "If eval_str is false (the default), values of type ``str`` are unchanged." msgstr "" -#: ../../library/inspect.rst:1174 +#: ../../library/inspect.rst:1202 msgid "" "``globals`` and ``locals`` are passed in to :func:`eval()`; see the " "documentation for :func:`eval()` for more information. If ``globals`` or " @@ -1502,35 +1498,35 @@ msgid "" "specific default, contingent on ``type(obj)``:" msgstr "" -#: ../../library/inspect.rst:1179 +#: ../../library/inspect.rst:1207 msgid "If ``obj`` is a module, ``globals`` defaults to ``obj.__dict__``." msgstr "" -#: ../../library/inspect.rst:1180 +#: ../../library/inspect.rst:1208 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:1183 +#: ../../library/inspect.rst:1211 msgid "" "If ``obj`` is a callable, ``globals`` defaults to ``obj.__globals__``, " "although if ``obj`` is a wrapped function (using ``functools." "update_wrapper()``) it is first unwrapped." msgstr "" -#: ../../library/inspect.rst:1187 +#: ../../library/inspect.rst:1215 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:1197 +#: ../../library/inspect.rst:1225 msgid "The interpreter stack" msgstr "" -#: ../../library/inspect.rst:1199 +#: ../../library/inspect.rst:1227 msgid "" "Some of the following functions return :class:`FrameInfo` objects. For " "backwards compatibility these objects allow tuple-like operations on all " @@ -1538,95 +1534,95 @@ msgid "" "may be removed in the future." msgstr "" -#: ../../library/inspect.rst:1208 +#: ../../library/inspect.rst:1236 msgid "The :ref:`frame object ` that the record corresponds to." msgstr "" -#: ../../library/inspect.rst:1212 +#: ../../library/inspect.rst:1240 msgid "" "The file name associated with the code being executed by the frame this " "record corresponds to." msgstr "" -#: ../../library/inspect.rst:1217 +#: ../../library/inspect.rst:1245 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:1222 +#: ../../library/inspect.rst:1250 msgid "" "The function name that is being executed by the frame this record " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1226 +#: ../../library/inspect.rst:1254 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:1231 ../../library/inspect.rst:1270 +#: ../../library/inspect.rst:1259 ../../library/inspect.rst:1298 msgid "" "The index of the current line being executed in the :attr:`code_context` " "list." msgstr "" -#: ../../library/inspect.rst:1235 +#: ../../library/inspect.rst:1263 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:1239 +#: ../../library/inspect.rst:1267 msgid "Return a :term:`named tuple` instead of a :class:`tuple`." msgstr "" -#: ../../library/inspect.rst:1242 +#: ../../library/inspect.rst:1270 msgid "" ":class:`!FrameInfo` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1251 +#: ../../library/inspect.rst:1279 msgid "" "The file name associated with the code being executed by the frame this " "traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1256 +#: ../../library/inspect.rst:1284 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:1261 +#: ../../library/inspect.rst:1289 msgid "" "The function name that is being executed by the frame this traceback " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1265 +#: ../../library/inspect.rst:1293 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:1274 +#: ../../library/inspect.rst:1302 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:1279 +#: ../../library/inspect.rst:1307 msgid "" ":class:`!Traceback` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1286 +#: ../../library/inspect.rst:1314 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 " @@ -1638,7 +1634,7 @@ msgid "" "consumption which occurs." msgstr "" -#: ../../library/inspect.rst:1294 +#: ../../library/inspect.rst:1322 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 :" @@ -1646,31 +1642,31 @@ msgid "" "disabled when Python was compiled or using :func:`gc.disable`. For example::" msgstr "" -#: ../../library/inspect.rst:1306 +#: ../../library/inspect.rst:1334 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:1310 +#: ../../library/inspect.rst:1338 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:1317 +#: ../../library/inspect.rst:1345 msgid "" "Get information about a frame or traceback object. A :class:`Traceback` " "object is returned." msgstr "" -#: ../../library/inspect.rst:1320 +#: ../../library/inspect.rst:1348 msgid "A :class:`Traceback` object is returned instead of a named tuple." msgstr "" -#: ../../library/inspect.rst:1325 +#: ../../library/inspect.rst:1353 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 " @@ -1678,19 +1674,19 @@ msgid "" "represents the outermost call on *frame*'s stack." msgstr "" -#: ../../library/inspect.rst:1330 ../../library/inspect.rst:1345 -#: ../../library/inspect.rst:1371 ../../library/inspect.rst:1386 +#: ../../library/inspect.rst:1358 ../../library/inspect.rst:1373 +#: ../../library/inspect.rst:1399 ../../library/inspect.rst:1414 msgid "" "A list of :term:`named tuples ` ``FrameInfo(frame, filename, " "lineno, function, code_context, index)`` is returned." msgstr "" -#: ../../library/inspect.rst:1335 ../../library/inspect.rst:1350 -#: ../../library/inspect.rst:1376 ../../library/inspect.rst:1391 +#: ../../library/inspect.rst:1363 ../../library/inspect.rst:1378 +#: ../../library/inspect.rst:1404 ../../library/inspect.rst:1419 msgid "A list of :class:`FrameInfo` objects is returned." -msgstr "" +msgstr "回傳一個 :class:`FrameInfo` 物件串列。" -#: ../../library/inspect.rst:1340 +#: ../../library/inspect.rst:1368 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 " @@ -1698,11 +1694,11 @@ msgid "" "represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1355 +#: ../../library/inspect.rst:1383 msgid "Return the frame object for the caller's stack frame." msgstr "" -#: ../../library/inspect.rst:1359 +#: ../../library/inspect.rst:1387 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 " @@ -1710,14 +1706,14 @@ msgid "" "``None``." msgstr "" -#: ../../library/inspect.rst:1367 +#: ../../library/inspect.rst:1395 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:1381 +#: ../../library/inspect.rst:1409 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 " @@ -1725,32 +1721,32 @@ msgid "" "entry represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1395 +#: ../../library/inspect.rst:1423 msgid "Fetching attributes statically" msgstr "" -#: ../../library/inspect.rst:1397 +#: ../../library/inspect.rst:1425 msgid "" "Both :func:`getattr` and :func:`hasattr` can trigger code execution when " "fetching or checking for the existence of attributes. Descriptors, like " -"properties, will be invoked and :meth:`__getattr__` and :meth:" -"`__getattribute__` may be called." +"properties, will be invoked and :meth:`~object.__getattr__` and :meth:" +"`~object.__getattribute__` may be called." msgstr "" -#: ../../library/inspect.rst:1402 +#: ../../library/inspect.rst:1431 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:1408 +#: ../../library/inspect.rst:1437 msgid "" "Retrieve attributes without triggering dynamic lookup via the descriptor " -"protocol, :meth:`__getattr__` or :meth:`__getattribute__`." +"protocol, :meth:`~object.__getattr__` or :meth:`~object.__getattribute__`." msgstr "" -#: ../../library/inspect.rst:1411 +#: ../../library/inspect.rst:1441 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 " @@ -1758,31 +1754,31 @@ msgid "" "return descriptors objects instead of instance members." msgstr "" -#: ../../library/inspect.rst:1417 +#: ../../library/inspect.rst:1447 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:1423 +#: ../../library/inspect.rst:1453 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:1427 +#: ../../library/inspect.rst:1457 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:1453 +#: ../../library/inspect.rst:1483 msgid "Current State of Generators, Coroutines, and Asynchronous Generators" msgstr "" -#: ../../library/inspect.rst:1455 +#: ../../library/inspect.rst:1485 msgid "" "When implementing coroutine schedulers and for other advanced uses of " "generators, it is useful to determine whether a generator is currently " @@ -1791,32 +1787,32 @@ msgid "" "generator to be determined easily." msgstr "" -#: ../../library/inspect.rst:1463 +#: ../../library/inspect.rst:1493 msgid "Get current state of a generator-iterator." msgstr "" -#: ../../library/inspect.rst:1465 ../../library/inspect.rst:1481 -#: ../../library/inspect.rst:1498 +#: ../../library/inspect.rst:1495 ../../library/inspect.rst:1511 +#: ../../library/inspect.rst:1528 msgid "Possible states are:" msgstr "" -#: ../../library/inspect.rst:1467 +#: ../../library/inspect.rst:1497 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1468 +#: ../../library/inspect.rst:1498 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1469 +#: ../../library/inspect.rst:1499 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1470 +#: ../../library/inspect.rst:1500 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1476 +#: ../../library/inspect.rst:1506 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 " @@ -1824,23 +1820,23 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1483 +#: ../../library/inspect.rst:1513 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1484 +#: ../../library/inspect.rst:1514 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1485 +#: ../../library/inspect.rst:1515 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: ../../library/inspect.rst:1486 +#: ../../library/inspect.rst:1516 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1492 +#: ../../library/inspect.rst:1522 msgid "" "Get current state of an asynchronous generator object. The function is " "intended to be used with asynchronous iterator objects created by :keyword:" @@ -1849,30 +1845,30 @@ msgid "" "``ag_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1500 +#: ../../library/inspect.rst:1530 msgid "AGEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1501 +#: ../../library/inspect.rst:1531 msgid "AGEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1502 +#: ../../library/inspect.rst:1532 msgid "AGEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1503 +#: ../../library/inspect.rst:1533 msgid "AGEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1507 +#: ../../library/inspect.rst:1537 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:1513 +#: ../../library/inspect.rst:1543 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. " @@ -1880,14 +1876,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: ../../library/inspect.rst:1518 +#: ../../library/inspect.rst:1548 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:1524 +#: ../../library/inspect.rst:1554 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 " @@ -1895,79 +1891,79 @@ msgid "" "dictionary." msgstr "" -#: ../../library/inspect.rst:1533 +#: ../../library/inspect.rst:1563 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: ../../library/inspect.rst:1540 +#: ../../library/inspect.rst:1570 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:1550 +#: ../../library/inspect.rst:1580 msgid "Code Objects Bit Flags" msgstr "" -#: ../../library/inspect.rst:1552 +#: ../../library/inspect.rst:1582 msgid "" "Python code objects have a ``co_flags`` attribute, which is a bitmap of the " "following flags:" msgstr "" -#: ../../library/inspect.rst:1557 +#: ../../library/inspect.rst:1587 msgid "The code object is optimized, using fast locals." msgstr "" -#: ../../library/inspect.rst:1561 +#: ../../library/inspect.rst:1591 msgid "" -"If set, a new dict will be created for the frame's ``f_locals`` when the " -"code object is executed." +"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:1566 +#: ../../library/inspect.rst:1596 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: ../../library/inspect.rst:1570 +#: ../../library/inspect.rst:1600 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: ../../library/inspect.rst:1574 +#: ../../library/inspect.rst:1604 msgid "The flag is set when the code object is a nested function." msgstr "" -#: ../../library/inspect.rst:1578 +#: ../../library/inspect.rst:1608 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:1583 +#: ../../library/inspect.rst:1613 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:1591 +#: ../../library/inspect.rst:1621 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:1600 +#: ../../library/inspect.rst:1630 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:1607 +#: ../../library/inspect.rst:1637 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -1975,45 +1971,39 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: ../../library/inspect.rst:1615 +#: ../../library/inspect.rst:1645 msgid "Buffer flags" msgstr "" -#: ../../library/inspect.rst:1619 +#: ../../library/inspect.rst:1649 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:1623 +#: ../../library/inspect.rst:1653 msgid "The meaning of the flags is explained at :ref:`buffer-request-types`." msgstr "" -#: ../../library/inspect.rst:1650 +#: ../../library/inspect.rst:1680 msgid "Command Line Interface" msgstr "命令列介面" -#: ../../library/inspect.rst:1652 +#: ../../library/inspect.rst:1682 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: ../../library/inspect.rst:1657 +#: ../../library/inspect.rst:1687 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:1663 +#: ../../library/inspect.rst:1693 msgid "" "Print information about the specified object rather than the source code" msgstr "" - -#~ msgid "module" -#~ msgstr "模組" - -#~ msgid "__file__" -#~ msgstr "__file__" diff --git a/library/intro.po b/library/intro.po index a90a3416b5..33dd5d7944 100644 --- a/library/intro.po +++ b/library/intro.po @@ -33,12 +33,12 @@ msgstr "「Python 函式庫」包含了許多不同的部分。" #: ../../library/intro.rst:9 msgid "" -"It contains data types that would normally be considered part of the \"core" -"\" of a language, such as numbers and lists. For these types, the Python " -"language core defines the form of literals and places some constraints on " -"their semantics, but does not fully define the semantics. (On the other " -"hand, the language core does define syntactic properties like the spelling " -"and priorities of operators.)" +"It contains data types that would normally be considered part of the " +"\"core\" of a language, such as numbers and lists. For these types, the " +"Python language core defines the form of literals and places some " +"constraints on their semantics, but does not fully define the semantics. " +"(On the other hand, the language core does define syntactic properties like " +"the spelling and priorities of operators.)" msgstr "" "函式庫中包括被視為程式語言「核心」部分的資料型態,像是數字 (number) 或是串列 " "(list)。對於這些型別,Python 核心對這些字面值 (literal) 的形式做定義,並對它" @@ -104,12 +104,12 @@ msgid "" "familiarity with this material." msgstr "" "這代表如果你從這個手冊的最開始讀起,並在感到無聊時跳到下一個章節,你仍然可以" -"得到一個對 Python 函式庫所支援的模組與其合理應用的概觀。當然,你\\ *沒有必要*" -"\\ 像是在讀一本小說一樣讀這本手冊——你可以快速瀏覽目錄(在手冊的最前頭)、或是" -"你可以利用最後面的索引來查詢特定的函式或模組。最後,如果你享受閱讀一些隨機的" -"主題,你可以選擇一個隨機的數字並開始閱讀(見 :mod:`random` 模組) 。不管你想要" -"以什麼順序來閱讀這個手冊,\\ :ref:`built-in-funcs`\\ 會是一個很好的入門,因為" -"手冊中其他章節都預設你已經對這個章節有一定的熟悉程度。" +"得到一個對 Python 函式庫所支援的模組與其合理應用的概觀。當然,你\\ *沒有必要" +"*\\ 像是在讀一本小說一樣讀這本手冊——你可以快速瀏覽目錄(在手冊的最前頭)、或" +"是你可以利用最後面的索引來查詢特定的函式或模組。最後,如果你享受閱讀一些隨機" +"的主題,你可以選擇一個隨機的數字並開始閱讀(見 :mod:`random` 模組) 。不管你想" +"要以什麼順序來閱讀這個手冊,\\ :ref:`built-in-funcs`\\ 會是一個很好的入門,因" +"為手冊中其他章節都預設你已經對這個章節有一定的熟悉程度。" #: ../../library/intro.rst:48 msgid "Let the show begin!" diff --git a/library/ipaddress.po b/library/ipaddress.po index 5579254068..95bee5e142 100644 --- a/library/ipaddress.po +++ b/library/ipaddress.po @@ -654,8 +654,8 @@ msgstr "" #: ../../library/ipaddress.rst:670 msgid "" -"It uses the same ordering and comparison algorithm as \"<\", \"==\", and \">" -"\"" +"It uses the same ordering and comparison algorithm as \"<\", \"==\", and " +"\">\"" msgstr "" #: ../../library/ipaddress.rst:676 diff --git a/library/numbers.po b/library/numbers.po index c776e0b454..4c5f1a44a3 100644 --- a/library/numbers.po +++ b/library/numbers.po @@ -182,9 +182,8 @@ msgid "" "and :meth:`__radd__` should be defined as::" msgstr "" "我們想要實作算術操作,來使得混合模式操作要麼呼叫一個作者知道兩個引數之型別的" -"實作,要麼將其轉換成最接近的內建型別並執行這個操作。對於 :class:" -"`Integral` 的子型別,這意味著 :meth:`__add__` 和 :meth:`__radd__` 必須用如下方式定" -"義:\n" +"實作,要麼將其轉換成最接近的內建型別並執行這個操作。對於 :class:`Integral` 的" +"子型別,這意味著 :meth:`__add__` 和 :meth:`__radd__` 必須用如下方式定義:\n" "\n" "::" @@ -198,8 +197,8 @@ msgid "" msgstr "" ":class:`Complex` 的子類別有 5 種不同的混合型別操作。我將上面提到所有不涉及 " "``MyIntegral`` 和 ``OtherTypeIKnowAbout`` 的程式碼稱作「模板 " -"(boilerplate)」。``a`` 是 :class:`Complex` 之子型別 ``A`` 的實例 (``a : A " -"<: Complex``),同時 ``b : B <: Complex``。我將要計算 ``a + b``:" +"(boilerplate)」。``a`` 是 :class:`Complex` 之子型別 ``A`` 的實例 (``a : A <: " +"Complex``),同時 ``b : B <: Complex``。我將要計算 ``a + b``:" #: ../../library/numbers.rst:163 msgid "If ``A`` defines an :meth:`__add__` which accepts ``b``, all is well." @@ -248,9 +247,9 @@ msgid "" "then the appropriate shared operation is the one involving the built in :" "class:`complex`, and both :meth:`__radd__` s land there, so ``a+b == b+a``." msgstr "" -"如果 ``A <: Complex`` 和 ``B <: Real`` 且沒有共享任何其他型別上的理解,那麼適當的共享操作會涉" -"及內建的 :class:`complex`,並且分別用到 :meth:`__radd__`,因此 ``a+b == b" -"+a``。" +"如果 ``A <: Complex`` 和 ``B <: Real`` 且沒有共享任何其他型別上的理解,那麼適" +"當的共享操作會涉及內建的 :class:`complex`,並且分別用到 :meth:`__radd__`,因" +"此 ``a+b == b+a``。" #: ../../library/numbers.rst:186 msgid "" @@ -259,7 +258,8 @@ msgid "" "reverse instances of any given operator. For example, :class:`fractions." "Fraction` uses::" msgstr "" -"由於大部分對任意給定類型的操作都十分相似的,定義一個為任意給定運算子生成向前 (forward) 與向" -"後 (reverse) 實例的輔助函式可能會非常有用。例如,:class:`fractions.Fraction` 使用了:\n" +"由於大部分對任意給定類型的操作都十分相似的,定義一個為任意給定運算子生成向前 " +"(forward) 與向後 (reverse) 實例的輔助函式可能會非常有用。例如,:class:" +"`fractions.Fraction` 使用了:\n" "\n" "::" diff --git a/library/os.path.po b/library/os.path.po index 4b7fbe0c1d..b1f560fc99 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -271,8 +271,8 @@ msgid "" "On Windows, ``%name%`` expansions are supported in addition to ``$name`` and " "``${name}``." msgstr "" -"在 Windows 上,除了支援 ``$name`` 和 ``${name}`` 形式的展開外,還支援 ``%name" -"%`` 形式的展開。" +"在 Windows 上,除了支援 ``$name`` 和 ``${name}`` 形式的展開外,還支援 " +"``%name%`` 形式的展開。" #: ../../library/os.path.rst:203 msgid "" diff --git a/library/profile.po b/library/profile.po index 16a0def997..cd5bc2abd1 100644 --- a/library/profile.po +++ b/library/profile.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: 2023-11-20 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-" @@ -101,9 +101,8 @@ msgstr "" msgid "" "The first line indicates that 214 calls were monitored. Of those calls, 207 " "were :dfn:`primitive`, meaning that the call was not induced via recursion. " -"The next line: ``Ordered by: cumulative time``, indicates that the text " -"string in the far right column was used to sort the output. The column " -"headings include:" +"The next line: ``Ordered by: cumulative time`` indicates the output is " +"sorted by the ``cumtime`` values. The column headings include:" msgstr "" #: ../../library/profile.rst:89 diff --git a/library/queue.po b/library/queue.po index a729993bfd..434fc9493e 100644 --- a/library/queue.po +++ b/library/queue.po @@ -121,8 +121,8 @@ msgid "" "the one that would be returned by ``min(entries)``). A typical pattern for " "entries is a tuple in the form: ``(priority_number, data)``." msgstr "" -"最低值的條目會最先被取出(最低值的條目是被會 ``min(entries)`` 回傳的那一個)" -"。條目的典型模式是格式為 ``(priority_number, data)`` 的 tuple(元組)。" +"最低值的條目會最先被取出(最低值的條目是被會 ``min(entries)`` 回傳的那一" +"個)。條目的典型模式是格式為 ``(priority_number, data)`` 的 tuple(元組)。" #: ../../library/queue.rst:63 msgid "" diff --git a/library/secrets.po b/library/secrets.po index bfbd0de256..9dbc2024e5 100644 --- a/library/secrets.po +++ b/library/secrets.po @@ -138,11 +138,11 @@ msgid "" "is sufficient for the typical use-case expected for the :mod:`secrets` " "module." msgstr "" -"為了在面對\\ `暴力攻擊 `_" -"\\ 時能保證安全,權杖必須具有足夠的隨機性。 不幸的是,對隨機性是否足夠的標" -"準,會隨著電腦越來越強大並能夠在更短時間內進行更多猜測而不斷提高。 在 2015 年" -"時,人們認為 32 位元組(256 位元)的隨機性對於 :mod:`secrets` 模組所預期的一" -"般使用場景來說是足夠的。" +"為了在面對\\ `暴力攻擊 `_\\ 時能保證安全,權杖必須具有足夠的隨機性。 不幸的是,對隨機性" +"是否足夠的標準,會隨著電腦越來越強大並能夠在更短時間內進行更多猜測而不斷提" +"高。 在 2015 年時,人們認為 32 位元組(256 位元)的隨機性對於 :mod:`secrets` " +"模組所預期的一般使用場景來說是足夠的。" #: ../../library/secrets.rst:112 msgid "" @@ -176,9 +176,10 @@ msgstr "其他函式" #: ../../library/secrets.rst:131 msgid "" "Return ``True`` if strings or :term:`bytes-like objects ` " -"*a* and *b* are equal, otherwise ``False``, using a \"constant-time compare" -"\" to reduce the risk of `timing attacks `_. See :func:`hmac.compare_digest` for additional details." +"*a* and *b* are equal, otherwise ``False``, using a \"constant-time " +"compare\" to reduce the risk of `timing attacks `_. See :func:`hmac.compare_digest` for additional " +"details." msgstr "" "如果字串或\\ :term:`類位元組串物件 ` *a* 與 *b* 相等則回" "傳 ``True``,否則回傳 ``False``,以\"恆定時間比較 (constant-time compare) " diff --git a/library/socket.po b/library/socket.po index 585c4b7523..9fd68f67fa 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-10-30 00:03+0000\n" +"POT-Creation-Date: 2023-11-28 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-" @@ -56,11 +56,11 @@ msgstr "" msgid "" "The Python interface is a straightforward transliteration of the Unix system " "call and library interface for sockets to Python's object-oriented style: " -"the :func:`.socket` function returns a :dfn:`socket object` whose methods " -"implement the various socket system calls. Parameter types are somewhat " -"higher-level than in the C interface: as with :meth:`read` and :meth:`write` " -"operations on Python files, buffer allocation on receive operations is " -"automatic, and buffer length is implicit on send operations." +"the :func:`~socket.socket` function returns a :dfn:`socket object` whose " +"methods implement the various socket system calls. Parameter types are " +"somewhat higher-level than in the C interface: as with :meth:`read` and :" +"meth:`write` operations on Python files, buffer allocation on receive " +"operations is automatic, and buffer length is implicit on send operations." msgstr "" #: ../../library/socket.rst:36 @@ -113,8 +113,8 @@ msgid "" "Previously, :const:`AF_UNIX` socket paths were assumed to use UTF-8 encoding." msgstr "" -#: ../../library/socket.rst:66 ../../library/socket.rst:1149 -#: ../../library/socket.rst:1191 ../../library/socket.rst:1950 +#: ../../library/socket.rst:66 ../../library/socket.rst:1148 +#: ../../library/socket.rst:1190 ../../library/socket.rst:1949 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "" @@ -288,8 +288,8 @@ msgstr "" msgid "*feat* and *mask* are unsigned 32bit integers." msgstr "" -#: ../../library/socket.rst:171 ../../library/socket.rst:590 -#: ../../library/socket.rst:1872 +#: ../../library/socket.rst:171 ../../library/socket.rst:589 +#: ../../library/socket.rst:1871 msgid ":ref:`Availability `: Linux >= 2.6.38." msgstr ":ref:`適用 `:Linux >= 2.6.38。" @@ -304,7 +304,7 @@ msgid "" "context ID or CID and port are integers." msgstr "" -#: ../../library/socket.rst:181 ../../library/socket.rst:663 +#: ../../library/socket.rst:181 ../../library/socket.rst:662 msgid ":ref:`Availability `: Linux >= 3.9" msgstr ":ref:`適用 `:Linux 3.9 以上。" @@ -315,7 +315,7 @@ msgstr "請見 :manpage:`vsock(7)`" #: ../../library/socket.rst:187 msgid "" ":const:`AF_PACKET` is a low-level interface directly to network devices. The " -"packets are represented by the tuple ``(ifname, proto[, pkttype[, hatype[, " +"addresses are represented by the tuple ``(ifname, proto[, pkttype[, hatype[, " "addr]]])`` where:" msgstr "" @@ -327,54 +327,53 @@ msgstr "" msgid "" "*proto* - The Ethernet protocol number. May be :data:`ETH_P_ALL` to capture " "all protocols, one of the :ref:`ETHERTYPE_* constants ` or any other Ethernet protocol number. Value must be in network-byte-" -"order." +"types>` or any other Ethernet protocol number." msgstr "" -#: ../../library/socket.rst:197 +#: ../../library/socket.rst:196 msgid "*pkttype* - Optional integer specifying the packet type:" msgstr "" -#: ../../library/socket.rst:199 +#: ../../library/socket.rst:198 msgid "``PACKET_HOST`` (the default) - Packet addressed to the local host." msgstr "" -#: ../../library/socket.rst:200 +#: ../../library/socket.rst:199 msgid "``PACKET_BROADCAST`` - Physical-layer broadcast packet." msgstr "" -#: ../../library/socket.rst:201 +#: ../../library/socket.rst:200 msgid "" "``PACKET_MULTICAST`` - Packet sent to a physical-layer multicast address." msgstr "" -#: ../../library/socket.rst:202 +#: ../../library/socket.rst:201 msgid "" "``PACKET_OTHERHOST`` - Packet to some other host that has been caught by a " "device driver in promiscuous mode." msgstr "" -#: ../../library/socket.rst:204 +#: ../../library/socket.rst:203 msgid "" "``PACKET_OUTGOING`` - Packet originating from the local host that is looped " "back to a packet socket." msgstr "" -#: ../../library/socket.rst:206 +#: ../../library/socket.rst:205 msgid "*hatype* - Optional integer specifying the ARP hardware address type." msgstr "" -#: ../../library/socket.rst:207 +#: ../../library/socket.rst:206 msgid "" "*addr* - Optional bytes-like object specifying the hardware physical " "address, whose interpretation depends on the device." msgstr "" -#: ../../library/socket.rst:210 ../../library/socket.rst:538 +#: ../../library/socket.rst:209 ../../library/socket.rst:537 msgid ":ref:`Availability `: Linux >= 2.2." msgstr ":ref:`適用 `:Linux >= 2.2。" -#: ../../library/socket.rst:212 +#: ../../library/socket.rst:211 msgid "" ":const:`AF_QIPCRTR` is a Linux-only socket based interface for communicating " "with services running on co-processors in Qualcomm platforms. The address " @@ -382,11 +381,11 @@ msgid "" "*port* are non-negative integers." msgstr "" -#: ../../library/socket.rst:217 ../../library/socket.rst:639 +#: ../../library/socket.rst:216 ../../library/socket.rst:638 msgid ":ref:`Availability `: Linux >= 4.7." msgstr ":ref:`適用 `:Linux >= 4.7。" -#: ../../library/socket.rst:221 +#: ../../library/socket.rst:220 msgid "" ":const:`IPPROTO_UDPLITE` is a variant of UDP which allows you to specify " "what portion of a packet is covered with the checksum. It adds two socket " @@ -397,18 +396,18 @@ msgid "" "of their data. In both cases ``length`` should be in ``range(8, 2**16, 8)``." msgstr "" -#: ../../library/socket.rst:230 +#: ../../library/socket.rst:229 msgid "" "Such a socket should be constructed with ``socket(AF_INET, SOCK_DGRAM, " "IPPROTO_UDPLITE)`` for IPv4 or ``socket(AF_INET6, SOCK_DGRAM, " "IPPROTO_UDPLITE)`` for IPv6." msgstr "" -#: ../../library/socket.rst:234 +#: ../../library/socket.rst:233 msgid ":ref:`Availability `: Linux >= 2.6.20, FreeBSD >= 10.1" msgstr ":ref:`適用 `:Linux 2.6.20 以上、FreeBSD 10.1 以上。" -#: ../../library/socket.rst:238 +#: ../../library/socket.rst:237 msgid "" ":const:`AF_HYPERV` is a Windows-only socket based interface for " "communicating with Hyper-V hosts and guests. The address family is " @@ -416,49 +415,49 @@ msgid "" "``service_id`` are UUID strings." msgstr "" -#: ../../library/socket.rst:243 +#: ../../library/socket.rst:242 msgid "" "The ``vm_id`` is the virtual machine identifier or a set of known VMID " "values if the target is not a specific virtual machine. Known VMID constants " "defined on ``socket`` are:" msgstr "" -#: ../../library/socket.rst:247 +#: ../../library/socket.rst:246 msgid "``HV_GUID_ZERO``" msgstr "``HV_GUID_ZERO``" -#: ../../library/socket.rst:248 +#: ../../library/socket.rst:247 msgid "``HV_GUID_BROADCAST``" msgstr "``HV_GUID_BROADCAST``" -#: ../../library/socket.rst:249 +#: ../../library/socket.rst:248 msgid "" "``HV_GUID_WILDCARD`` - Used to bind on itself and accept connections from " "all partitions." msgstr "" -#: ../../library/socket.rst:251 +#: ../../library/socket.rst:250 msgid "" "``HV_GUID_CHILDREN`` - Used to bind on itself and accept connection from " "child partitions." msgstr "" -#: ../../library/socket.rst:253 +#: ../../library/socket.rst:252 msgid "``HV_GUID_LOOPBACK`` - Used as a target to itself." msgstr "" -#: ../../library/socket.rst:254 +#: ../../library/socket.rst:253 msgid "" "``HV_GUID_PARENT`` - When used as a bind accepts connection from the parent " "partition. When used as an address target it will connect to the parent " "partition." msgstr "" -#: ../../library/socket.rst:257 +#: ../../library/socket.rst:256 msgid "The ``service_id`` is the service identifier of the registered service." msgstr "" -#: ../../library/socket.rst:261 +#: ../../library/socket.rst:260 msgid "" "If you use a hostname in the *host* portion of IPv4/v6 socket address, the " "program may show a nondeterministic behavior, as Python uses the first " @@ -468,41 +467,41 @@ msgid "" "deterministic behavior use a numeric address in *host* portion." msgstr "" -#: ../../library/socket.rst:268 +#: ../../library/socket.rst:267 msgid "" "All errors raise exceptions. The normal exceptions for invalid argument " "types and out-of-memory conditions can be raised. Errors related to socket " "or address semantics raise :exc:`OSError` or one of its subclasses." msgstr "" -#: ../../library/socket.rst:273 +#: ../../library/socket.rst:272 msgid "" "Non-blocking mode is supported through :meth:`~socket.setblocking`. A " "generalization of this based on timeouts is supported through :meth:`~socket." "settimeout`." msgstr "" -#: ../../library/socket.rst:279 +#: ../../library/socket.rst:278 msgid "Module contents" msgstr "模組內容" -#: ../../library/socket.rst:281 +#: ../../library/socket.rst:280 msgid "The module :mod:`socket` exports the following elements." msgstr "" -#: ../../library/socket.rst:285 +#: ../../library/socket.rst:284 msgid "Exceptions" msgstr "例外" -#: ../../library/socket.rst:289 +#: ../../library/socket.rst:288 msgid "A deprecated alias of :exc:`OSError`." msgstr "一個已棄用的 :exc:`OSError` 的別名。" -#: ../../library/socket.rst:291 +#: ../../library/socket.rst:290 msgid "Following :pep:`3151`, this class was made an alias of :exc:`OSError`." msgstr "" -#: ../../library/socket.rst:297 +#: ../../library/socket.rst:296 msgid "" "A subclass of :exc:`OSError`, this exception is raised for address-related " "errors, i.e. for functions that use *h_errno* in the POSIX C API, including :" @@ -512,12 +511,12 @@ msgid "" "description of *h_errno*, as returned by the :c:func:`hstrerror` C function." msgstr "" -#: ../../library/socket.rst:305 ../../library/socket.rst:318 -#: ../../library/socket.rst:331 +#: ../../library/socket.rst:304 ../../library/socket.rst:317 +#: ../../library/socket.rst:330 msgid "This class was made a subclass of :exc:`OSError`." msgstr "" -#: ../../library/socket.rst:310 +#: ../../library/socket.rst:309 msgid "" "A subclass of :exc:`OSError`, this exception is raised for address-related " "errors by :func:`getaddrinfo` and :func:`getnameinfo`. The accompanying " @@ -527,11 +526,11 @@ msgid "" "match one of the :const:`EAI_\\*` constants defined in this module." msgstr "" -#: ../../library/socket.rst:323 +#: ../../library/socket.rst:322 msgid "A deprecated alias of :exc:`TimeoutError`." msgstr "" -#: ../../library/socket.rst:325 +#: ../../library/socket.rst:324 msgid "" "A subclass of :exc:`OSError`, this exception is raised when a timeout occurs " "on a socket which has had timeouts enabled via a prior call to :meth:" @@ -540,105 +539,105 @@ msgid "" "currently always \"timed out\"." msgstr "" -#: ../../library/socket.rst:334 +#: ../../library/socket.rst:333 msgid "This class was made an alias of :exc:`TimeoutError`." msgstr "" -#: ../../library/socket.rst:339 +#: ../../library/socket.rst:338 msgid "Constants" msgstr "常數" -#: ../../library/socket.rst:341 +#: ../../library/socket.rst:340 msgid "" "The AF_* and SOCK_* constants are now :class:`AddressFamily` and :class:" "`SocketKind` :class:`.IntEnum` collections." msgstr "" -#: ../../library/socket.rst:350 +#: ../../library/socket.rst:349 msgid "" "These constants represent the address (and protocol) families, used for the " -"first argument to :func:`.socket`. If the :const:`AF_UNIX` constant is not " -"defined then this protocol is unsupported. More constants may be available " -"depending on the system." +"first argument to :func:`~socket.socket`. If the :const:`AF_UNIX` constant " +"is not defined then this protocol is unsupported. More constants may be " +"available depending on the system." msgstr "" -#: ../../library/socket.rst:357 +#: ../../library/socket.rst:356 msgid "" ":const:`AF_UNSPEC` means that :func:`getaddrinfo` should return socket " "addresses for any address family (either IPv4, IPv6, or any other) that can " "be used." msgstr "" -#: ../../library/socket.rst:367 +#: ../../library/socket.rst:366 msgid "" "These constants represent the socket types, used for the second argument to :" -"func:`.socket`. More constants may be available depending on the system. " -"(Only :const:`SOCK_STREAM` and :const:`SOCK_DGRAM` appear to be generally " -"useful.)" +"func:`~socket.socket`. More constants may be available depending on the " +"system. (Only :const:`SOCK_STREAM` and :const:`SOCK_DGRAM` appear to be " +"generally useful.)" msgstr "" -#: ../../library/socket.rst:375 +#: ../../library/socket.rst:374 msgid "" "These two constants, if defined, can be combined with the socket types and " "allow you to set some flags atomically (thus avoiding possible race " "conditions and the need for separate calls)." msgstr "" -#: ../../library/socket.rst:381 +#: ../../library/socket.rst:380 msgid "" "`Secure File Descriptor Handling `_ for a more thorough explanation." msgstr "" -#: ../../library/socket.rst:384 +#: ../../library/socket.rst:383 msgid ":ref:`Availability `: Linux >= 2.6.27." msgstr ":ref:`適用 `:Linux >= 2.6.27。" -#: ../../library/socket.rst:405 +#: ../../library/socket.rst:404 msgid "" "Many constants of these forms, documented in the Unix documentation on " "sockets and/or the IP protocol, are also defined in the socket module. They " -"are generally used in arguments to the :meth:`setsockopt` and :meth:" -"`getsockopt` methods of socket objects. In most cases, only those symbols " -"that are defined in the Unix header files are defined; for a few symbols, " -"default values are provided." +"are generally used in arguments to the :meth:`~socket.setsockopt` and :meth:" +"`~socket.getsockopt` methods of socket objects. In most cases, only those " +"symbols that are defined in the Unix header files are defined; for a few " +"symbols, default values are provided." msgstr "" -#: ../../library/socket.rst:412 +#: ../../library/socket.rst:411 msgid "" "``SO_DOMAIN``, ``SO_PROTOCOL``, ``SO_PEERSEC``, ``SO_PASSSEC``, " "``TCP_USER_TIMEOUT``, ``TCP_CONGESTION`` were added." msgstr "" -#: ../../library/socket.rst:416 +#: ../../library/socket.rst:415 msgid "" "On Windows, ``TCP_FASTOPEN``, ``TCP_KEEPCNT`` appear if run-time Windows " "supports." msgstr "" -#: ../../library/socket.rst:420 +#: ../../library/socket.rst:419 msgid "``TCP_NOTSENT_LOWAT`` was added." msgstr "新增 ``TCP_NOTSENT_LOWAT``。" -#: ../../library/socket.rst:423 +#: ../../library/socket.rst:422 msgid "" "On Windows, ``TCP_KEEPIDLE``, ``TCP_KEEPINTVL`` appear if run-time Windows " "supports." msgstr "" -#: ../../library/socket.rst:426 +#: ../../library/socket.rst:425 msgid "" "``IP_RECVTOS`` was added. Added ``TCP_KEEPALIVE``. On MacOS this constant " "can be used in the same way that ``TCP_KEEPIDLE`` is used on Linux." msgstr "" -#: ../../library/socket.rst:431 +#: ../../library/socket.rst:430 msgid "" "Added ``TCP_CONNECTION_INFO``. On MacOS this constant can be used in the " "same way that ``TCP_INFO`` is used on Linux and BSD." msgstr "" -#: ../../library/socket.rst:435 +#: ../../library/socket.rst:434 msgid "" "Added ``SO_RTABLE`` and ``SO_USER_COOKIE``. On OpenBSD and FreeBSD " "respectively those constants can be used in the same way that ``SO_MARK`` is " @@ -654,166 +653,166 @@ msgid "" "``IP_DROP_SOURCE_MEMBERSHIP``." msgstr "" -#: ../../library/socket.rst:454 ../../library/socket.rst:535 -#: ../../library/socket.rst:559 +#: ../../library/socket.rst:453 ../../library/socket.rst:534 +#: ../../library/socket.rst:558 msgid "" "Many constants of these forms, documented in the Linux documentation, are " "also defined in the socket module." msgstr "" -#: ../../library/socket.rst:457 +#: ../../library/socket.rst:456 msgid ":ref:`Availability `: Linux >= 2.6.25, NetBSD >= 8." msgstr ":ref:`適用 `:Linux 2.6.25 以上、NetBSD 8 以上。" -#: ../../library/socket.rst:461 +#: ../../library/socket.rst:460 msgid "NetBSD support was added." msgstr "" -#: ../../library/socket.rst:467 +#: ../../library/socket.rst:466 msgid "" "CAN_BCM, in the CAN protocol family, is the broadcast manager (BCM) " "protocol. Broadcast manager constants, documented in the Linux " "documentation, are also defined in the socket module." msgstr "" -#: ../../library/socket.rst:471 ../../library/socket.rst:506 +#: ../../library/socket.rst:470 ../../library/socket.rst:505 msgid ":ref:`Availability `: Linux >= 2.6.25." msgstr ":ref:`適用 `:Linux >= 2.6.25。" -#: ../../library/socket.rst:474 +#: ../../library/socket.rst:473 msgid "" "The :data:`CAN_BCM_CAN_FD_FRAME` flag is only available on Linux >= 4.8." msgstr "" -#: ../../library/socket.rst:480 +#: ../../library/socket.rst:479 msgid "" "Enables CAN FD support in a CAN_RAW socket. This is disabled by default. " "This allows your application to send both CAN and CAN FD frames; however, " "you must accept both CAN and CAN FD frames when reading from the socket." msgstr "" -#: ../../library/socket.rst:484 ../../library/socket.rst:495 +#: ../../library/socket.rst:483 ../../library/socket.rst:494 msgid "This constant is documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:486 +#: ../../library/socket.rst:485 msgid ":ref:`Availability `: Linux >= 3.6." msgstr ":ref:`適用 `:Linux >= 3.6。" -#: ../../library/socket.rst:492 +#: ../../library/socket.rst:491 msgid "" "Joins the applied CAN filters such that only CAN frames that match all given " "CAN filters are passed to user space." msgstr "" -#: ../../library/socket.rst:497 +#: ../../library/socket.rst:496 msgid ":ref:`Availability `: Linux >= 4.1." msgstr ":ref:`適用 `:Linux >= 4.1。" -#: ../../library/socket.rst:503 +#: ../../library/socket.rst:502 msgid "" "CAN_ISOTP, in the CAN protocol family, is the ISO-TP (ISO 15765-2) protocol. " "ISO-TP constants, documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:512 +#: ../../library/socket.rst:511 msgid "" "CAN_J1939, in the CAN protocol family, is the SAE J1939 protocol. J1939 " "constants, documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:515 +#: ../../library/socket.rst:514 msgid ":ref:`Availability `: Linux >= 5.4." msgstr ":ref:`適用 `:Linux >= 5.4。" -#: ../../library/socket.rst:523 +#: ../../library/socket.rst:522 msgid "" "These two constants, documented in the FreeBSD divert(4) manual page, are " "also defined in the socket module." msgstr "" -#: ../../library/socket.rst:526 +#: ../../library/socket.rst:525 msgid ":ref:`Availability `: FreeBSD >= 14.0." msgstr ":ref:`適用 `:FreeBSD >= 14.0。" -#: ../../library/socket.rst:543 +#: ../../library/socket.rst:542 msgid "" ":data:`!ETH_P_ALL` can be used in the :class:`~socket.socket` constructor as " "*proto* for the :const:`AF_PACKET` family in order to capture every packet, " "regardless of protocol." msgstr "" -#: ../../library/socket.rst:547 +#: ../../library/socket.rst:546 msgid "For more information, see the :manpage:`packet(7)` manpage." msgstr "" -#: ../../library/socket.rst:549 +#: ../../library/socket.rst:548 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/socket.rst:562 +#: ../../library/socket.rst:561 msgid ":ref:`Availability `: Linux >= 2.6.30." msgstr ":ref:`適用 `:Linux >= 2.6.30。" -#: ../../library/socket.rst:572 +#: ../../library/socket.rst:571 msgid "" "Constants for Windows' WSAIoctl(). The constants are used as arguments to " "the :meth:`~socket.socket.ioctl` method of socket objects." msgstr "" -#: ../../library/socket.rst:575 ../../library/socket.rst:1564 +#: ../../library/socket.rst:574 ../../library/socket.rst:1563 msgid "``SIO_LOOPBACK_FAST_PATH`` was added." msgstr "加入 ``SIO_LOOPBACK_FAST_PATH``。" -#: ../../library/socket.rst:581 +#: ../../library/socket.rst:580 msgid "" "TIPC related constants, matching the ones exported by the C socket API. See " "the TIPC documentation for more information." msgstr "" -#: ../../library/socket.rst:588 +#: ../../library/socket.rst:587 msgid "Constants for Linux Kernel cryptography." msgstr "" -#: ../../library/socket.rst:600 +#: ../../library/socket.rst:599 msgid "Constants for Linux host/guest communication." msgstr "" -#: ../../library/socket.rst:602 +#: ../../library/socket.rst:601 msgid ":ref:`Availability `: Linux >= 4.8." msgstr ":ref:`適用 `:Linux >= 4.8。" -#: ../../library/socket.rst:608 +#: ../../library/socket.rst:607 msgid ":ref:`Availability `: BSD, macOS." msgstr ":ref:`適用 `:BSD、macOS。" -#: ../../library/socket.rst:614 +#: ../../library/socket.rst:613 msgid "" "This constant contains a boolean value which indicates if IPv6 is supported " "on this platform." msgstr "" -#: ../../library/socket.rst:620 +#: ../../library/socket.rst:619 msgid "" "These are string constants containing Bluetooth addresses with special " "meanings. For example, :const:`BDADDR_ANY` can be used to indicate any " "address when specifying the binding socket with :const:`BTPROTO_RFCOMM`." msgstr "" -#: ../../library/socket.rst:629 +#: ../../library/socket.rst:628 msgid "" "For use with :const:`BTPROTO_HCI`. :const:`HCI_FILTER` is not available for " "NetBSD or DragonFlyBSD. :const:`HCI_TIME_STAMP` and :const:`HCI_DATA_DIR` " "are not available for FreeBSD, NetBSD, or DragonFlyBSD." msgstr "" -#: ../../library/socket.rst:636 +#: ../../library/socket.rst:635 msgid "" "Constant for Qualcomm's IPC router protocol, used to communicate with " "service providing remote processors." msgstr "" -#: ../../library/socket.rst:645 +#: ../../library/socket.rst:644 msgid "" "LOCAL_CREDS and LOCAL_CREDS_PERSISTENT can be used with SOCK_DGRAM, " "SOCK_STREAM sockets, equivalent to Linux/DragonFlyBSD SO_PASSCRED, while " @@ -822,49 +821,49 @@ msgid "" "message type." msgstr "" -#: ../../library/socket.rst:654 +#: ../../library/socket.rst:653 msgid ":ref:`Availability `: FreeBSD." msgstr ":ref:`適用 `:FreeBSD。" -#: ../../library/socket.rst:658 +#: ../../library/socket.rst:657 msgid "" "Constant to optimize CPU locality, to be used in conjunction with :data:" "`SO_REUSEPORT`." msgstr "" -#: ../../library/socket.rst:678 +#: ../../library/socket.rst:677 msgid "Constants for Windows Hyper-V sockets for host/guest communications." msgstr "" -#: ../../library/socket.rst:680 ../../library/socket.rst:887 -#: ../../library/socket.rst:1978 +#: ../../library/socket.rst:679 ../../library/socket.rst:886 +#: ../../library/socket.rst:1977 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/socket.rst:691 +#: ../../library/socket.rst:690 msgid "" "`IEEE 802.3 protocol number `_. constants." msgstr "" -#: ../../library/socket.rst:695 +#: ../../library/socket.rst:694 msgid ":ref:`Availability `: Linux, FreeBSD, macOS." msgstr ":ref:`適用 `:Linux、FreeBSD、macOS。" -#: ../../library/socket.rst:701 +#: ../../library/socket.rst:700 msgid "Functions" msgstr "函式" -#: ../../library/socket.rst:704 +#: ../../library/socket.rst:703 msgid "Creating sockets" msgstr "建立 sockets" -#: ../../library/socket.rst:706 +#: ../../library/socket.rst:705 msgid "" "The following functions all create :ref:`socket objects `." msgstr "" -#: ../../library/socket.rst:711 +#: ../../library/socket.rst:710 msgid "" "Create a new socket using the given address family, socket type and protocol " "number. The address family should be :const:`AF_INET` (the default), :const:" @@ -877,7 +876,7 @@ msgid "" "`CAN_J1939`." msgstr "" -#: ../../library/socket.rst:721 +#: ../../library/socket.rst:720 msgid "" "If *fileno* is specified, the values for *family*, *type*, and *proto* are " "auto-detected from the specified file descriptor. Auto-detection can be " @@ -888,12 +887,12 @@ msgid "" "This may help close a detached socket using :meth:`socket.close()`." msgstr "" -#: ../../library/socket.rst:730 ../../library/socket.rst:876 -#: ../../library/socket.rst:1383 ../../library/socket.rst:1477 +#: ../../library/socket.rst:729 ../../library/socket.rst:875 +#: ../../library/socket.rst:1382 ../../library/socket.rst:1476 msgid "The newly created socket is :ref:`non-inheritable `." msgstr "" -#: ../../library/socket.rst:743 +#: ../../library/socket.rst:742 msgid "" "Raises an :ref:`auditing event ` ``socket.__new__`` with arguments " "``self``, ``family``, ``type``, ``protocol``." @@ -901,71 +900,71 @@ msgstr "" "引發一個附帶引數 ``self``、``family``、``type``、``protocol`` 的\\ :ref:`稽核" "事件 ` ``socket.__new__``。" -#: ../../library/socket.rst:734 +#: ../../library/socket.rst:733 msgid "The AF_CAN family was added. The AF_RDS family was added." msgstr "" -#: ../../library/socket.rst:738 +#: ../../library/socket.rst:737 msgid "The CAN_BCM protocol was added." msgstr "新增 CAN_BCM 協定。" -#: ../../library/socket.rst:741 ../../library/socket.rst:878 +#: ../../library/socket.rst:740 ../../library/socket.rst:877 msgid "The returned socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:744 +#: ../../library/socket.rst:743 msgid "The CAN_ISOTP protocol was added." msgstr "新增 CAN_ISOTP 協定。" -#: ../../library/socket.rst:747 +#: ../../library/socket.rst:746 msgid "" "When :const:`SOCK_NONBLOCK` or :const:`SOCK_CLOEXEC` bit flags are applied " "to *type* they are cleared, and :attr:`socket.type` will not reflect them. " "They are still passed to the underlying system ``socket()`` call. Therefore," msgstr "" -#: ../../library/socket.rst:759 +#: ../../library/socket.rst:758 msgid "" "will still create a non-blocking socket on OSes that support " "``SOCK_NONBLOCK``, but ``sock.type`` will be set to ``socket.SOCK_STREAM``." msgstr "" -#: ../../library/socket.rst:763 +#: ../../library/socket.rst:762 msgid "The CAN_J1939 protocol was added." msgstr "新增 CAN_J1939 協定。" -#: ../../library/socket.rst:766 +#: ../../library/socket.rst:765 msgid "The IPPROTO_MPTCP protocol was added." msgstr "新增 IPPROTO_MPTCP 協定。" -#: ../../library/socket.rst:771 +#: ../../library/socket.rst:770 msgid "" "Build a pair of connected socket objects using the given address family, " "socket type, and protocol number. Address family, socket type, and protocol " -"number are as for the :func:`.socket` function above. The default family is :" -"const:`AF_UNIX` if defined on the platform; otherwise, the default is :const:" -"`AF_INET`." +"number are as for the :func:`~socket.socket` function above. The default " +"family is :const:`AF_UNIX` if defined on the platform; otherwise, the " +"default is :const:`AF_INET`." msgstr "" -#: ../../library/socket.rst:776 +#: ../../library/socket.rst:775 msgid "The newly created sockets are :ref:`non-inheritable `." msgstr "" -#: ../../library/socket.rst:778 +#: ../../library/socket.rst:777 msgid "" "The returned socket objects now support the whole socket API, rather than a " "subset." msgstr "" -#: ../../library/socket.rst:782 +#: ../../library/socket.rst:781 msgid "The returned sockets are now non-inheritable." msgstr "" -#: ../../library/socket.rst:785 +#: ../../library/socket.rst:784 msgid "Windows support added." msgstr "新增對 Windows 的支援。" -#: ../../library/socket.rst:791 +#: ../../library/socket.rst:790 msgid "" "Connect to a TCP service listening on the internet *address* (a 2-tuple " "``(host, port)``), and return the socket object. This is a higher-level " @@ -976,21 +975,21 @@ msgid "" "IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:799 +#: ../../library/socket.rst:798 msgid "" "Passing the optional *timeout* parameter will set the timeout on the socket " "instance before attempting to connect. If no *timeout* is supplied, the " "global default timeout setting returned by :func:`getdefaulttimeout` is used." msgstr "" -#: ../../library/socket.rst:804 +#: ../../library/socket.rst:803 msgid "" "If supplied, *source_address* must be a 2-tuple ``(host, port)`` for the " "socket to bind to as its source address before connecting. If host or port " "are '' or 0 respectively the OS default behavior will be used." msgstr "" -#: ../../library/socket.rst:808 +#: ../../library/socket.rst:807 msgid "" "When a connection cannot be created, an exception is raised. By default, it " "is the exception from the last address in the list. If *all_errors* is " @@ -998,21 +997,21 @@ msgid "" "attempts." msgstr "" -#: ../../library/socket.rst:813 +#: ../../library/socket.rst:812 msgid "*source_address* was added." msgstr "新增 *source_address*\\ 。" -#: ../../library/socket.rst:816 +#: ../../library/socket.rst:815 msgid "*all_errors* was added." msgstr "新增 *all_errors*\\ 。" -#: ../../library/socket.rst:822 +#: ../../library/socket.rst:821 msgid "" "Convenience function which creates a TCP socket bound to *address* (a 2-" "tuple ``(host, port)``) and returns the socket object." msgstr "" -#: ../../library/socket.rst:825 +#: ../../library/socket.rst:824 msgid "" "*family* should be either :data:`AF_INET` or :data:`AF_INET6`. *backlog* is " "the queue size passed to :meth:`socket.listen`; if not specified , a default " @@ -1020,7 +1019,7 @@ msgid "" "`SO_REUSEPORT` socket option." msgstr "" -#: ../../library/socket.rst:830 +#: ../../library/socket.rst:829 msgid "" "If *dualstack_ipv6* is true and the platform supports it the socket will be " "able to accept both IPv4 and IPv6 connections, else it will raise :exc:" @@ -1033,60 +1032,60 @@ msgid "" "func:`has_dualstack_ipv6`:" msgstr "" -#: ../../library/socket.rst:852 +#: ../../library/socket.rst:851 msgid "" "On POSIX platforms the :data:`SO_REUSEADDR` socket option is set in order to " "immediately reuse previous sockets which were bound on the same *address* " "and remained in TIME_WAIT state." msgstr "" -#: ../../library/socket.rst:860 +#: ../../library/socket.rst:859 msgid "" "Return ``True`` if the platform supports creating a TCP socket which can " "handle both IPv4 and IPv6 connections." msgstr "" -#: ../../library/socket.rst:867 +#: ../../library/socket.rst:866 msgid "" "Duplicate the file descriptor *fd* (an integer as returned by a file " "object's :meth:`~io.IOBase.fileno` method) and build a socket object from " "the result. Address family, socket type and protocol number are as for the :" -"func:`.socket` function above. The file descriptor should refer to a socket, " -"but this is not checked --- subsequent operations on the object may fail if " -"the file descriptor is invalid. This function is rarely needed, but can be " -"used to get or set socket options on a socket passed to a program as " +"func:`~socket.socket` function above. The file descriptor should refer to a " +"socket, but this is not checked --- subsequent operations on the object may " +"fail if the file descriptor is invalid. This function is rarely needed, but " +"can be used to get or set socket options on a socket passed to a program as " "standard input or output (such as a server started by the Unix inet " "daemon). The socket is assumed to be in blocking mode." msgstr "" -#: ../../library/socket.rst:884 +#: ../../library/socket.rst:883 msgid "" "Instantiate a socket from data obtained from the :meth:`socket.share` " "method. The socket is assumed to be in blocking mode." msgstr "" -#: ../../library/socket.rst:894 +#: ../../library/socket.rst:893 msgid "" "This is a Python type object that represents the socket object type. It is " "the same as ``type(socket(...))``." msgstr "" -#: ../../library/socket.rst:899 +#: ../../library/socket.rst:898 msgid "Other functions" msgstr "其他函式" -#: ../../library/socket.rst:901 +#: ../../library/socket.rst:900 msgid "The :mod:`socket` module also offers various network-related services:" msgstr "" -#: ../../library/socket.rst:906 +#: ../../library/socket.rst:905 msgid "" "Close a socket file descriptor. This is like :func:`os.close`, but for " "sockets. On some platforms (most noticeable Windows) :func:`os.close` does " "not work for socket file descriptors." msgstr "" -#: ../../library/socket.rst:914 +#: ../../library/socket.rst:913 msgid "" "Translate the *host*/*port* argument into a sequence of 5-tuples that " "contain all the necessary arguments for creating a socket connected to that " @@ -1096,7 +1095,7 @@ msgid "" "and *port*, you can pass ``NULL`` to the underlying C API." msgstr "" -#: ../../library/socket.rst:921 +#: ../../library/socket.rst:920 msgid "" "The *family*, *type* and *proto* arguments can be optionally specified in " "order to narrow the list of addresses returned. Passing zero as a value for " @@ -1107,27 +1106,27 @@ msgid "" "domain name." msgstr "" -#: ../../library/socket.rst:929 +#: ../../library/socket.rst:928 msgid "The function returns a list of 5-tuples with the following structure:" msgstr "" -#: ../../library/socket.rst:931 +#: ../../library/socket.rst:930 msgid "``(family, type, proto, canonname, sockaddr)``" msgstr "``(family, type, proto, canonname, sockaddr)``" -#: ../../library/socket.rst:933 +#: ../../library/socket.rst:932 msgid "" "In these tuples, *family*, *type*, *proto* are all integers and are meant to " -"be passed to the :func:`.socket` function. *canonname* will be a string " -"representing the canonical name of the *host* if :const:`AI_CANONNAME` is " -"part of the *flags* argument; else *canonname* will be empty. *sockaddr* is " -"a tuple describing a socket address, whose format depends on the returned " -"*family* (a ``(address, port)`` 2-tuple for :const:`AF_INET`, a ``(address, " -"port, flowinfo, scope_id)`` 4-tuple for :const:`AF_INET6`), and is meant to " -"be passed to the :meth:`socket.connect` method." +"be passed to the :func:`~socket.socket` function. *canonname* will be a " +"string representing the canonical name of the *host* if :const:" +"`AI_CANONNAME` is part of the *flags* argument; else *canonname* will be " +"empty. *sockaddr* is a tuple describing a socket address, whose format " +"depends on the returned *family* (a ``(address, port)`` 2-tuple for :const:" +"`AF_INET`, a ``(address, port, flowinfo, scope_id)`` 4-tuple for :const:" +"`AF_INET6`), and is meant to be passed to the :meth:`socket.connect` method." msgstr "" -#: ../../library/socket.rst:954 +#: ../../library/socket.rst:953 msgid "" "Raises an :ref:`auditing event ` ``socket.getaddrinfo`` with " "arguments ``host``, ``port``, ``family``, ``type``, ``protocol``." @@ -1135,24 +1134,24 @@ msgstr "" "引發一個附帶引數 ``host``、``port``、``family``、``type``、``protocol`` 的" "\\ :ref:`稽核事件 ` ``socket.getaddrinfo``。" -#: ../../library/socket.rst:945 +#: ../../library/socket.rst:944 msgid "" "The following example fetches address information for a hypothetical TCP " "connection to ``example.org`` on port 80 (results may differ on your system " "if IPv6 isn't enabled)::" msgstr "" -#: ../../library/socket.rst:955 +#: ../../library/socket.rst:954 msgid "parameters can now be passed using keyword arguments." msgstr "" -#: ../../library/socket.rst:958 +#: ../../library/socket.rst:957 msgid "" "for IPv6 multicast addresses, string representing an address will not " "contain ``%scope_id`` part." msgstr "" -#: ../../library/socket.rst:964 +#: ../../library/socket.rst:963 msgid "" "Return a fully qualified domain name for *name*. If *name* is omitted or " "empty, it is interpreted as the local host. To find the fully qualified " @@ -1163,7 +1162,7 @@ msgid "" "``'0.0.0.0'``, the hostname from :func:`gethostname` is returned." msgstr "" -#: ../../library/socket.rst:975 +#: ../../library/socket.rst:974 msgid "" "Translate a host name to IPv4 address format. The IPv4 address is returned " "as a string, such as ``'100.50.200.5'``. If the host name is an IPv4 " @@ -1173,7 +1172,7 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:992 ../../library/socket.rst:1008 +#: ../../library/socket.rst:991 ../../library/socket.rst:1007 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyname`` with " "argument ``hostname``." @@ -1181,18 +1180,18 @@ msgstr "" "引發一個附帶引數 ``hostname`` 的\\ :ref:`稽核事件 ` ``socket." "gethostbyname``。" -#: ../../library/socket.rst:983 ../../library/socket.rst:999 -#: ../../library/socket.rst:1012 ../../library/socket.rst:1027 -#: ../../library/socket.rst:1044 ../../library/socket.rst:1055 -#: ../../library/socket.rst:1066 ../../library/socket.rst:1077 -#: ../../library/socket.rst:1401 ../../library/socket.rst:1448 -#: ../../library/socket.rst:1462 ../../library/socket.rst:1482 -#: ../../library/socket.rst:1529 ../../library/socket.rst:1574 -#: ../../library/socket.rst:1956 ../../library/socket.rst:1966 +#: ../../library/socket.rst:982 ../../library/socket.rst:998 +#: ../../library/socket.rst:1011 ../../library/socket.rst:1026 +#: ../../library/socket.rst:1043 ../../library/socket.rst:1054 +#: ../../library/socket.rst:1065 ../../library/socket.rst:1076 +#: ../../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 msgid ":ref:`Availability `: not WASI." msgstr ":ref:`適用 `:非 WASI。" -#: ../../library/socket.rst:988 +#: ../../library/socket.rst:987 msgid "" "Translate a host name to IPv4 address format, extended interface. Return a 3-" "tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's " @@ -1204,26 +1203,26 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:1004 +#: ../../library/socket.rst:1003 msgid "" "Return a string containing the hostname of the machine where the Python " "interpreter is currently executing." msgstr "" -#: ../../library/socket.rst:1018 +#: ../../library/socket.rst:1017 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostname`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``socket.gethostname``。" -#: ../../library/socket.rst:1009 +#: ../../library/socket.rst:1008 msgid "" "Note: :func:`gethostname` doesn't always return the fully qualified domain " "name; use :func:`getfqdn` for that." msgstr "" -#: ../../library/socket.rst:1017 +#: ../../library/socket.rst:1016 msgid "" "Return a 3-tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is " "the primary host name responding to the given *ip_address*, *aliaslist* is a " @@ -1234,7 +1233,7 @@ msgid "" "`gethostbyaddr` supports both IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:1036 +#: ../../library/socket.rst:1035 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with " "argument ``ip_address``." @@ -1242,7 +1241,7 @@ msgstr "" "引發一個附帶引數 ``ip_address`` 的\\ :ref:`稽核事件 ` ``socket." "gethostbyaddr``。" -#: ../../library/socket.rst:1032 +#: ../../library/socket.rst:1031 msgid "" "Translate a socket address *sockaddr* into a 2-tuple ``(host, port)``. " "Depending on the settings of *flags*, the result can contain a fully " @@ -1250,18 +1249,18 @@ msgid "" "Similarly, *port* can contain a string port name or a numeric port number." msgstr "" -#: ../../library/socket.rst:1037 +#: ../../library/socket.rst:1036 msgid "" "For IPv6 addresses, ``%scope_id`` is appended to the host part if *sockaddr* " "contains meaningful *scope_id*. Usually this happens for multicast addresses." msgstr "" -#: ../../library/socket.rst:1040 +#: ../../library/socket.rst:1039 msgid "" "For more information about *flags* you can consult :manpage:`getnameinfo(3)`." msgstr "" -#: ../../library/socket.rst:1053 +#: ../../library/socket.rst:1052 msgid "" "Raises an :ref:`auditing event ` ``socket.getnameinfo`` with " "argument ``sockaddr``." @@ -1269,23 +1268,23 @@ msgstr "" "引發一個附帶引數 ``sockaddr`` 的\\ :ref:`稽核事件 ` ``socket." "getnameinfo``。" -#: ../../library/socket.rst:1049 +#: ../../library/socket.rst:1048 msgid "" "Translate an internet protocol name (for example, ``'icmp'``) to a constant " -"suitable for passing as the (optional) third argument to the :func:`.socket` " -"function. This is usually only needed for sockets opened in \"raw\" mode (:" -"const:`SOCK_RAW`); for the normal socket modes, the correct protocol is " -"chosen automatically if the protocol is omitted or zero." +"suitable for passing as the (optional) third argument to the :func:`~socket." +"socket` function. This is usually only needed for sockets opened in \"raw\" " +"mode (:const:`SOCK_RAW`); for the normal socket modes, the correct protocol " +"is chosen automatically if the protocol is omitted or zero." msgstr "" -#: ../../library/socket.rst:1060 +#: ../../library/socket.rst:1059 msgid "" "Translate an internet service name and protocol name to a port number for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:1075 +#: ../../library/socket.rst:1074 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyname`` with " "arguments ``servicename``, ``protocolname``." @@ -1293,14 +1292,14 @@ msgstr "" "引發一個附帶引數 ``sockaddr``、``protocolname`` 的\\ :ref:`稽核事件 " "` ``socket.getservbyname``。" -#: ../../library/socket.rst:1071 +#: ../../library/socket.rst:1070 msgid "" "Translate an internet port number and protocol name to a service name for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:1086 +#: ../../library/socket.rst:1085 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyport`` with " "arguments ``port``, ``protocolname``." @@ -1308,40 +1307,40 @@ msgstr "" "引發一個附帶引數 ``port``、``protocolname`` 的\\ :ref:`稽核事件 ` " "``socket.getservbyport``。" -#: ../../library/socket.rst:1082 +#: ../../library/socket.rst:1081 msgid "" "Convert 32-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:1089 +#: ../../library/socket.rst:1088 msgid "" "Convert 16-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:1093 ../../library/socket.rst:1111 +#: ../../library/socket.rst:1092 ../../library/socket.rst:1110 msgid "" "Raises :exc:`OverflowError` if *x* does not fit in a 16-bit unsigned integer." msgstr "" -#: ../../library/socket.rst:1100 +#: ../../library/socket.rst:1099 msgid "" "Convert 32-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:1107 +#: ../../library/socket.rst:1106 msgid "" "Convert 16-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:1118 +#: ../../library/socket.rst:1117 msgid "" "Convert an IPv4 address from dotted-quad string format (for example, " "'123.45.67.89') to 32-bit packed binary format, as a bytes object four " @@ -1350,26 +1349,26 @@ msgid "" "which is the C type for the 32-bit packed binary this function returns." msgstr "" -#: ../../library/socket.rst:1124 +#: ../../library/socket.rst:1123 msgid "" ":func:`inet_aton` also accepts strings with less than three dots; see the " "Unix manual page :manpage:`inet(3)` for details." msgstr "" -#: ../../library/socket.rst:1127 +#: ../../library/socket.rst:1126 msgid "" "If the IPv4 address string passed to this function is invalid, :exc:" "`OSError` will be raised. Note that exactly what is valid depends on the " "underlying C implementation of :c:func:`inet_aton`." msgstr "" -#: ../../library/socket.rst:1131 +#: ../../library/socket.rst:1130 msgid "" ":func:`inet_aton` does not support IPv6, and :func:`inet_pton` should be " "used instead for IPv4/v6 dual stack support." msgstr "" -#: ../../library/socket.rst:1137 +#: ../../library/socket.rst:1136 msgid "" "Convert a 32-bit packed IPv4 address (a :term:`bytes-like object` four bytes " "in length) to its standard dotted-quad string representation (for example, " @@ -1379,7 +1378,7 @@ msgid "" "argument." msgstr "" -#: ../../library/socket.rst:1144 +#: ../../library/socket.rst:1143 msgid "" "If the byte sequence passed to this function is not exactly 4 bytes in " "length, :exc:`OSError` will be raised. :func:`inet_ntoa` does not support " @@ -1387,7 +1386,7 @@ msgid "" "support." msgstr "" -#: ../../library/socket.rst:1155 +#: ../../library/socket.rst:1154 msgid "" "Convert an IP address from its family-specific string format to a packed, " "binary format. :func:`inet_pton` is useful when a library or network " @@ -1395,7 +1394,7 @@ msgid "" "`inet_aton`) or :c:struct:`in6_addr`." msgstr "" -#: ../../library/socket.rst:1160 +#: ../../library/socket.rst:1159 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the IP address string *ip_string* is invalid, :exc:" @@ -1404,15 +1403,15 @@ msgid "" "`inet_pton`." msgstr "" -#: ../../library/socket.rst:1166 ../../library/socket.rst:1186 +#: ../../library/socket.rst:1165 ../../library/socket.rst:1185 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/socket.rst:1168 ../../library/socket.rst:1188 +#: ../../library/socket.rst:1167 ../../library/socket.rst:1187 msgid "Windows support added" msgstr "" -#: ../../library/socket.rst:1174 +#: ../../library/socket.rst:1173 msgid "" "Convert a packed IP address (a :term:`bytes-like object` of some number of " "bytes) to its standard, family-specific string representation (for example, " @@ -1421,7 +1420,7 @@ msgid "" "(similar to :func:`inet_ntoa`) or :c:struct:`in6_addr`." msgstr "" -#: ../../library/socket.rst:1181 +#: ../../library/socket.rst:1180 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the bytes object *packed_ip* is not the correct length " @@ -1429,7 +1428,7 @@ msgid "" "`OSError` is raised for errors from the call to :func:`inet_ntop`." msgstr "" -#: ../../library/socket.rst:1203 +#: ../../library/socket.rst:1202 msgid "" "Return the total length, without trailing padding, of an ancillary data item " "with associated data of the given *length*. This value can often be used as " @@ -1440,16 +1439,16 @@ msgid "" "the permissible range of values." msgstr "" -#: ../../library/socket.rst:1212 ../../library/socket.rst:1235 +#: ../../library/socket.rst:1211 ../../library/socket.rst:1234 msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" -#: ../../library/socket.rst:1214 ../../library/socket.rst:1704 -#: ../../library/socket.rst:1748 ../../library/socket.rst:1856 +#: ../../library/socket.rst:1213 ../../library/socket.rst:1703 +#: ../../library/socket.rst:1747 ../../library/socket.rst:1855 msgid "Most Unix platforms." msgstr "" -#: ../../library/socket.rst:1221 +#: ../../library/socket.rst:1220 msgid "" "Return the buffer size needed for :meth:`~socket.recvmsg` to receive an " "ancillary data item with associated data of the given *length*, along with " @@ -1459,7 +1458,7 @@ msgid "" "values." msgstr "" -#: ../../library/socket.rst:1229 +#: ../../library/socket.rst:1228 msgid "" "Note that some systems might support ancillary data without providing this " "function. Also note that setting the buffer size using the results of this " @@ -1467,31 +1466,31 @@ msgid "" "received, since additional data may be able to fit into the padding area." msgstr "" -#: ../../library/socket.rst:1237 +#: ../../library/socket.rst:1236 msgid "most Unix platforms." msgstr "" -#: ../../library/socket.rst:1244 +#: ../../library/socket.rst:1243 msgid "" "Return the default timeout in seconds (float) for new socket objects. A " "value of ``None`` indicates that new socket objects have no timeout. When " "the socket module is first imported, the default is ``None``." msgstr "" -#: ../../library/socket.rst:1251 +#: ../../library/socket.rst:1250 msgid "" "Set the default timeout in seconds (float) for new socket objects. When the " "socket module is first imported, the default is ``None``. See :meth:" "`~socket.settimeout` for possible values and their respective meanings." msgstr "" -#: ../../library/socket.rst:1259 +#: ../../library/socket.rst:1258 msgid "" "Set the machine's hostname to *name*. This will raise an :exc:`OSError` if " "you don't have enough rights." msgstr "" -#: ../../library/socket.rst:1273 +#: ../../library/socket.rst:1272 msgid "" "Raises an :ref:`auditing event ` ``socket.sethostname`` with " "argument ``name``." @@ -1499,114 +1498,114 @@ msgstr "" "引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``socket." "sethostname``。" -#: ../../library/socket.rst:1264 ../../library/socket.rst:1702 -#: ../../library/socket.rst:1746 +#: ../../library/socket.rst:1263 ../../library/socket.rst:1701 +#: ../../library/socket.rst:1745 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/socket.rst:1271 +#: ../../library/socket.rst:1270 msgid "" "Return a list of network interface information (index int, name string) " "tuples. :exc:`OSError` if the system call fails." msgstr "" -#: ../../library/socket.rst:1275 ../../library/socket.rst:1302 -#: ../../library/socket.rst:1319 ../../library/socket.rst:1336 -#: ../../library/socket.rst:1350 +#: ../../library/socket.rst:1274 ../../library/socket.rst:1301 +#: ../../library/socket.rst:1318 ../../library/socket.rst:1335 +#: ../../library/socket.rst:1349 msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" -#: ../../library/socket.rst:1279 ../../library/socket.rst:1306 -#: ../../library/socket.rst:1323 +#: ../../library/socket.rst:1278 ../../library/socket.rst:1305 +#: ../../library/socket.rst:1322 msgid "Windows support was added." msgstr "增加對 Windows 的支援。" -#: ../../library/socket.rst:1284 +#: ../../library/socket.rst:1283 msgid "" "On Windows network interfaces have different names in different contexts " "(all names are examples):" msgstr "" -#: ../../library/socket.rst:1287 +#: ../../library/socket.rst:1286 msgid "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" msgstr "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" -#: ../../library/socket.rst:1288 +#: ../../library/socket.rst:1287 msgid "name: ``ethernet_32770``" msgstr "" -#: ../../library/socket.rst:1289 +#: ../../library/socket.rst:1288 msgid "friendly name: ``vEthernet (nat)``" msgstr "" -#: ../../library/socket.rst:1290 +#: ../../library/socket.rst:1289 msgid "description: ``Hyper-V Virtual Ethernet Adapter``" msgstr "" -#: ../../library/socket.rst:1292 +#: ../../library/socket.rst:1291 msgid "" "This function returns names of the second form from the list, " "``ethernet_32770`` in this example case." msgstr "" -#: ../../library/socket.rst:1298 +#: ../../library/socket.rst:1297 msgid "" "Return a network interface index number corresponding to an interface name. :" "exc:`OSError` if no interface with the given name exists." msgstr "" -#: ../../library/socket.rst:1310 ../../library/socket.rst:1327 +#: ../../library/socket.rst:1309 ../../library/socket.rst:1326 msgid "\"Interface name\" is a name as documented in :func:`if_nameindex`." msgstr "" -#: ../../library/socket.rst:1315 +#: ../../library/socket.rst:1314 msgid "" "Return a network interface name corresponding to an interface index number. :" "exc:`OSError` if no interface with the given index exists." msgstr "" -#: ../../library/socket.rst:1332 +#: ../../library/socket.rst:1331 msgid "" "Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket " "*sock*. The *fds* parameter is a sequence of file descriptors. Consult :meth:" -"`sendmsg` for the documentation of these parameters." +"`~socket.sendmsg` for the documentation of these parameters." msgstr "" -#: ../../library/socket.rst:1338 ../../library/socket.rst:1352 +#: ../../library/socket.rst:1337 ../../library/socket.rst:1351 msgid "" "Unix platforms supporting :meth:`~socket.sendmsg` and :const:`SCM_RIGHTS` " "mechanism." msgstr "" -#: ../../library/socket.rst:1346 +#: ../../library/socket.rst:1345 msgid "" "Receive up to *maxfds* file descriptors from an :const:`AF_UNIX` socket " -"*sock*. Return ``(msg, list(fds), flags, addr)``. Consult :meth:`recvmsg` " -"for the documentation of these parameters." +"*sock*. Return ``(msg, list(fds), flags, addr)``. Consult :meth:`~socket." +"recvmsg` for the documentation of these parameters." msgstr "" -#: ../../library/socket.rst:1359 +#: ../../library/socket.rst:1358 msgid "Any truncated integers at the end of the list of file descriptors." msgstr "" -#: ../../library/socket.rst:1365 +#: ../../library/socket.rst:1364 msgid "Socket Objects" msgstr "Socket 物件" -#: ../../library/socket.rst:1367 +#: ../../library/socket.rst:1366 msgid "" "Socket objects have the following methods. Except for :meth:`~socket." "makefile`, these correspond to Unix system calls applicable to sockets." msgstr "" -#: ../../library/socket.rst:1371 +#: ../../library/socket.rst:1370 msgid "" "Support for the :term:`context manager` protocol was added. Exiting the " "context manager is equivalent to calling :meth:`~socket.close`." msgstr "" -#: ../../library/socket.rst:1378 +#: ../../library/socket.rst:1377 msgid "" "Accept a connection. The socket must be bound to an address and listening " "for connections. The return value is a pair ``(conn, address)`` where *conn* " @@ -1615,27 +1614,27 @@ msgid "" "connection." msgstr "" -#: ../../library/socket.rst:1385 ../../library/socket.rst:1479 +#: ../../library/socket.rst:1384 ../../library/socket.rst:1478 msgid "The socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:1388 ../../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 +#: ../../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 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the method now retries the system call instead of raising an :exc:" "`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1396 +#: ../../library/socket.rst:1395 msgid "" "Bind the socket to *address*. The socket must not already be bound. (The " "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1410 +#: ../../library/socket.rst:1409 msgid "" "Raises an :ref:`auditing event ` ``socket.bind`` with arguments " "``self``, ``address``." @@ -1643,7 +1642,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.bind``。" -#: ../../library/socket.rst:1406 +#: ../../library/socket.rst:1405 msgid "" "Mark the socket closed. The underlying system resource (e.g. a file " "descriptor) is also closed when all file objects from :meth:`makefile()` are " @@ -1652,20 +1651,20 @@ msgid "" "flushed)." msgstr "" -#: ../../library/socket.rst:1412 +#: ../../library/socket.rst:1411 msgid "" "Sockets are automatically closed when they are garbage-collected, but it is " "recommended to :meth:`close` them explicitly, or to use a :keyword:`with` " "statement around them." msgstr "" -#: ../../library/socket.rst:1416 +#: ../../library/socket.rst:1415 msgid "" ":exc:`OSError` is now raised if an error occurs when the underlying :c:func:" "`close` call is made." msgstr "" -#: ../../library/socket.rst:1422 +#: ../../library/socket.rst:1421 msgid "" ":meth:`close()` releases the resource associated with a connection but does " "not necessarily close the connection immediately. If you want to close the " @@ -1673,13 +1672,13 @@ msgid "" "`close()`." msgstr "" -#: ../../library/socket.rst:1430 +#: ../../library/socket.rst:1429 msgid "" "Connect to a remote socket at *address*. (The format of *address* depends on " "the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1433 +#: ../../library/socket.rst:1432 msgid "" "If the connection is interrupted by a signal, the method waits until the " "connection completes, or raise a :exc:`TimeoutError` on timeout, if the " @@ -1689,7 +1688,7 @@ msgid "" "(or the exception raised by the signal handler)." msgstr "" -#: ../../library/socket.rst:1451 ../../library/socket.rst:1471 +#: ../../library/socket.rst:1450 ../../library/socket.rst:1470 msgid "" "Raises an :ref:`auditing event ` ``socket.connect`` with arguments " "``self``, ``address``." @@ -1697,7 +1696,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.connect``。" -#: ../../library/socket.rst:1442 +#: ../../library/socket.rst:1441 msgid "" "The method now waits until the connection completes instead of raising an :" "exc:`InterruptedError` exception if the connection is interrupted by a " @@ -1705,7 +1704,7 @@ msgid "" "blocking or has a timeout (see the :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1453 +#: ../../library/socket.rst:1452 msgid "" "Like ``connect(address)``, but return an error indicator instead of raising " "an exception for errors returned by the C-level :c:func:`connect` call " @@ -1715,38 +1714,38 @@ msgid "" "asynchronous connects." msgstr "" -#: ../../library/socket.rst:1466 +#: ../../library/socket.rst:1465 msgid "" "Put the socket object into closed state without actually closing the " "underlying file descriptor. The file descriptor is returned, and can be " "reused for other purposes." msgstr "" -#: ../../library/socket.rst:1475 +#: ../../library/socket.rst:1474 msgid "Duplicate the socket." msgstr "" -#: ../../library/socket.rst:1487 +#: ../../library/socket.rst:1486 msgid "" "Return the socket's file descriptor (a small integer), or -1 on failure. " "This is useful with :func:`select.select`." msgstr "" -#: ../../library/socket.rst:1490 +#: ../../library/socket.rst:1489 msgid "" "Under Windows the small integer returned by this method cannot be used where " "a file descriptor can be used (such as :func:`os.fdopen`). Unix does not " "have this limitation." msgstr "" -#: ../../library/socket.rst:1496 +#: ../../library/socket.rst:1495 msgid "" "Get the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle: ``True`` if the socket can be inherited in " "child processes, ``False`` if it cannot." msgstr "" -#: ../../library/socket.rst:1505 +#: ../../library/socket.rst:1504 msgid "" "Return the remote address to which the socket is connected. This is useful " "to find out the port number of a remote IPv4/v6 socket, for instance. (The " @@ -1754,14 +1753,14 @@ msgid "" "above.) On some systems this function is not supported." msgstr "" -#: ../../library/socket.rst:1513 +#: ../../library/socket.rst:1512 msgid "" "Return the socket's own address. This is useful to find out the port number " "of an IPv4/v6 socket, for instance. (The format of the address returned " "depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1520 +#: ../../library/socket.rst:1519 msgid "" "Return the value of the given socket option (see the Unix man page :manpage:" "`getsockopt(2)`). The needed symbolic constants (:const:`SO_\\*` etc.) are " @@ -1773,16 +1772,16 @@ msgid "" "`struct` for a way to decode C structures encoded as byte strings)." msgstr "" -#: ../../library/socket.rst:1534 +#: ../../library/socket.rst:1533 msgid "" "Return ``True`` if socket is in blocking mode, ``False`` if in non-blocking." msgstr "" -#: ../../library/socket.rst:1537 +#: ../../library/socket.rst:1536 msgid "This is equivalent to checking ``socket.gettimeout() != 0``." msgstr "這等同於檢查 ``socket.gettimeout() != 0``。" -#: ../../library/socket.rst:1544 +#: ../../library/socket.rst:1543 msgid "" "Return the timeout in seconds (float) associated with socket operations, or " "``None`` if no timeout is set. This reflects the last call to :meth:" @@ -1793,30 +1792,30 @@ msgstr "" msgid "platform" msgstr "平台" -#: ../../library/socket.rst:1551 +#: ../../library/socket.rst:1550 msgid "Windows" msgstr "Windows" -#: ../../library/socket.rst:1553 +#: ../../library/socket.rst:1552 msgid "" "The :meth:`ioctl` method is a limited interface to the WSAIoctl system " "interface. Please refer to the `Win32 documentation `_ for more information." msgstr "" -#: ../../library/socket.rst:1558 +#: ../../library/socket.rst:1557 msgid "" "On other platforms, the generic :func:`fcntl.fcntl` and :func:`fcntl.ioctl` " "functions may be used; they accept a socket object as their first argument." msgstr "" -#: ../../library/socket.rst:1561 +#: ../../library/socket.rst:1560 msgid "" "Currently only the following control codes are supported: ``SIO_RCVALL``, " "``SIO_KEEPALIVE_VALS``, and ``SIO_LOOPBACK_FAST_PATH``." msgstr "" -#: ../../library/socket.rst:1569 +#: ../../library/socket.rst:1568 msgid "" "Enable a server to accept connections. If *backlog* is specified, it must " "be at least 0 (if it is lower, it is set to 0); it specifies the number of " @@ -1824,11 +1823,11 @@ msgid "" "connections. If not specified, a default reasonable value is chosen." msgstr "" -#: ../../library/socket.rst:1576 +#: ../../library/socket.rst:1575 msgid "The *backlog* parameter is now optional." msgstr "" -#: ../../library/socket.rst:1585 +#: ../../library/socket.rst:1584 msgid "" "Return a :term:`file object` associated with the socket. The exact returned " "type depends on the arguments given to :meth:`makefile`. These arguments " @@ -1837,28 +1836,28 @@ msgid "" "``'b'``." msgstr "" -#: ../../library/socket.rst:1590 +#: ../../library/socket.rst:1589 msgid "" "The socket must be in blocking mode; it can have a timeout, but the file " "object's internal buffer may end up in an inconsistent state if a timeout " "occurs." msgstr "" -#: ../../library/socket.rst:1594 +#: ../../library/socket.rst:1593 msgid "" "Closing the file object returned by :meth:`makefile` won't close the " "original socket unless all other file objects have been closed and :meth:" "`socket.close` has been called on the socket object." msgstr "" -#: ../../library/socket.rst:1600 +#: ../../library/socket.rst:1599 msgid "" "On Windows, the file-like object created by :meth:`makefile` cannot be used " "where a file object with a file descriptor is expected, such as the stream " "arguments of :meth:`subprocess.Popen`." msgstr "" -#: ../../library/socket.rst:1607 +#: ../../library/socket.rst:1606 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 " @@ -1867,13 +1866,13 @@ msgid "" "zero." msgstr "" -#: ../../library/socket.rst:1614 +#: ../../library/socket.rst:1613 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:1625 +#: ../../library/socket.rst:1624 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 +1882,14 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1636 +#: ../../library/socket.rst:1635 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:1643 +#: ../../library/socket.rst:1642 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 +1900,7 @@ msgid "" "*flags* argument defaults to 0 and has the same meaning as for :meth:`recv`." msgstr "" -#: ../../library/socket.rst:1653 +#: ../../library/socket.rst:1652 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 +1915,7 @@ msgid "" "socket, if available; otherwise, its value is unspecified." msgstr "" -#: ../../library/socket.rst:1667 +#: ../../library/socket.rst:1666 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 +1928,7 @@ msgid "" "descriptors received via this mechanism." msgstr "" -#: ../../library/socket.rst:1678 +#: ../../library/socket.rst:1677 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 +1937,7 @@ msgid "" "provided it has not been truncated before the start of its associated data." msgstr "" -#: ../../library/socket.rst:1685 +#: ../../library/socket.rst:1684 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 +1946,7 @@ msgid "" "meth:`sendmsg`. ::" msgstr "" -#: ../../library/socket.rst:1716 +#: ../../library/socket.rst:1715 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 +1959,7 @@ msgid "" "arguments have the same meaning as for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1727 +#: ../../library/socket.rst:1726 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 +1967,14 @@ msgid "" "for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1732 +#: ../../library/socket.rst:1731 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/socket.rst:1755 +#: ../../library/socket.rst:1754 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 +1984,7 @@ msgid "" "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1765 +#: ../../library/socket.rst:1764 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 +1993,7 @@ msgid "" "of the optional argument *flags*; it defaults to zero." msgstr "" -#: ../../library/socket.rst:1774 +#: ../../library/socket.rst:1773 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 +2003,7 @@ msgid "" "data. For further information on this topic, consult the :ref:`socket-howto`." msgstr "" -#: ../../library/socket.rst:1789 +#: ../../library/socket.rst:1788 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 +2013,13 @@ msgid "" "to determine how much data, if any, was successfully sent." msgstr "" -#: ../../library/socket.rst:1796 +#: ../../library/socket.rst:1795 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:1809 +#: ../../library/socket.rst:1808 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 +2028,7 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1826 +#: ../../library/socket.rst:1825 msgid "" "Raises an :ref:`auditing event ` ``socket.sendto`` with arguments " "``self``, ``address``." @@ -2037,7 +2036,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendto``。" -#: ../../library/socket.rst:1825 +#: ../../library/socket.rst:1824 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 +2056,18 @@ msgid "" "bytes of non-ancillary data sent." msgstr "" -#: ../../library/socket.rst:1845 +#: ../../library/socket.rst:1844 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:1854 +#: ../../library/socket.rst:1853 msgid ":ref:`Availability `: Unix, not WASI." msgstr ":ref:`適用 `:Unix、非 WASI。" -#: ../../library/socket.rst:1869 +#: ../../library/socket.rst:1868 msgid "" "Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments " "``self``, ``address``." @@ -2076,14 +2075,14 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendmsg``。" -#: ../../library/socket.rst:1869 +#: ../../library/socket.rst:1868 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:1878 +#: ../../library/socket.rst:1877 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 +2096,38 @@ msgid "" "be of :const:`SOCK_STREAM` type. Non-blocking sockets are not supported." msgstr "" -#: ../../library/socket.rst:1894 +#: ../../library/socket.rst:1893 msgid "" "Set the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle." msgstr "" -#: ../../library/socket.rst:1902 +#: ../../library/socket.rst:1901 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:1905 +#: ../../library/socket.rst:1904 msgid "" "This method is a shorthand for certain :meth:`~socket.settimeout` calls:" msgstr "" -#: ../../library/socket.rst:1907 +#: ../../library/socket.rst:1906 msgid "``sock.setblocking(True)`` is equivalent to ``sock.settimeout(None)``" msgstr "``sock.setblocking(True)`` 等價於 ``sock.settimeout(None)``" -#: ../../library/socket.rst:1909 +#: ../../library/socket.rst:1908 msgid "``sock.setblocking(False)`` is equivalent to ``sock.settimeout(0.0)``" msgstr "``sock.setblocking(False)`` 等價於 ``sock.settimeout(0.0)``" -#: ../../library/socket.rst:1911 +#: ../../library/socket.rst:1910 msgid "" "The method no longer applies :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1918 +#: ../../library/socket.rst:1917 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 +2137,19 @@ msgid "" "blocking mode. If ``None`` is given, the socket is put in blocking mode." msgstr "" -#: ../../library/socket.rst:1925 +#: ../../library/socket.rst:1924 msgid "" "For further information, please consult the :ref:`notes on socket timeouts " "`." msgstr "" -#: ../../library/socket.rst:1927 +#: ../../library/socket.rst:1926 msgid "" "The method no longer toggles :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1940 +#: ../../library/socket.rst:1939 msgid "" "Set the value of the given socket option (see the Unix manual page :manpage:" "`setsockopt(2)`). The needed symbolic constants are defined in the :mod:" @@ -2163,11 +2162,11 @@ msgid "" "C function with ``optval=NULL`` and ``optlen=optlen``." msgstr "" -#: ../../library/socket.rst:1953 +#: ../../library/socket.rst:1952 msgid "setsockopt(level, optname, None, optlen: int) form added." msgstr "" -#: ../../library/socket.rst:1961 +#: ../../library/socket.rst:1960 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 +2174,7 @@ msgid "" "and receives are disallowed." msgstr "" -#: ../../library/socket.rst:1971 +#: ../../library/socket.rst:1970 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 +2185,48 @@ msgid "" "process." msgstr "" -#: ../../library/socket.rst:1983 +#: ../../library/socket.rst:1982 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:1986 +#: ../../library/socket.rst:1985 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:1992 +#: ../../library/socket.rst:1991 msgid "The socket family." msgstr "" -#: ../../library/socket.rst:1997 +#: ../../library/socket.rst:1996 msgid "The socket type." msgstr "" -#: ../../library/socket.rst:2002 +#: ../../library/socket.rst:2001 msgid "The socket protocol." msgstr "" -#: ../../library/socket.rst:2009 +#: ../../library/socket.rst:2008 msgid "Notes on socket timeouts" msgstr "" -#: ../../library/socket.rst:2011 +#: ../../library/socket.rst:2010 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:2015 +#: ../../library/socket.rst:2014 msgid "" "In *blocking mode*, operations block until complete or the system returns an " "error (such as connection timed out)." msgstr "" -#: ../../library/socket.rst:2018 +#: ../../library/socket.rst:2017 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 +2234,14 @@ msgid "" "available for reading or writing." msgstr "" -#: ../../library/socket.rst:2023 +#: ../../library/socket.rst:2022 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:2028 +#: ../../library/socket.rst:2027 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 +2250,11 @@ msgid "" "you decide to use the :meth:`~socket.fileno()` of a socket." msgstr "" -#: ../../library/socket.rst:2035 +#: ../../library/socket.rst:2034 msgid "Timeouts and the ``connect`` method" msgstr "" -#: ../../library/socket.rst:2037 +#: ../../library/socket.rst:2036 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 +2264,24 @@ msgid "" "setting." msgstr "" -#: ../../library/socket.rst:2045 +#: ../../library/socket.rst:2044 msgid "Timeouts and the ``accept`` method" msgstr "" -#: ../../library/socket.rst:2047 +#: ../../library/socket.rst:2046 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:2051 +#: ../../library/socket.rst:2050 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:2054 +#: ../../library/socket.rst:2053 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,31 +2289,31 @@ msgid "" "it is recommended you manually override this setting." msgstr "" -#: ../../library/socket.rst:2063 +#: ../../library/socket.rst:2062 msgid "Example" msgstr "範例" -#: ../../library/socket.rst:2065 +#: ../../library/socket.rst:2064 msgid "" "Here are four minimal example programs using the TCP/IP protocol: a server " "that echoes all data that it receives back (servicing only one client), and " -"a client using it. Note that a server must perform the sequence :func:`." -"socket`, :meth:`~socket.bind`, :meth:`~socket.listen`, :meth:`~socket." -"accept` (possibly repeating the :meth:`~socket.accept` to service more than " -"one client), while a client only needs the sequence :func:`.socket`, :meth:" -"`~socket.connect`. Also note that the server does not :meth:`~socket." -"sendall`/:meth:`~socket.recv` on the socket it is listening on but on the " -"new socket returned by :meth:`~socket.accept`." +"a client using it. Note that a server must perform the sequence :func:" +"`~socket.socket`, :meth:`~socket.bind`, :meth:`~socket.listen`, :meth:" +"`~socket.accept` (possibly repeating the :meth:`~socket.accept` to service " +"more than one client), while a client only needs the sequence :func:`~socket." +"socket`, :meth:`~socket.connect`. Also note that the server does not :meth:" +"`~socket.sendall`/:meth:`~socket.recv` on the socket it is listening on but " +"on the new socket returned by :meth:`~socket.accept`." msgstr "" -#: ../../library/socket.rst:2075 +#: ../../library/socket.rst:2074 msgid "The first two examples support IPv4 only. ::" msgstr "" "前兩個範例只支援 IPv4:\n" "\n" "::" -#: ../../library/socket.rst:2106 +#: ../../library/socket.rst:2105 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 +2323,73 @@ msgid "" "resolution, and sends traffic to the first one connected successfully. ::" msgstr "" -#: ../../library/socket.rst:2178 +#: ../../library/socket.rst:2177 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:2203 +#: ../../library/socket.rst:2202 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:2209 +#: ../../library/socket.rst:2208 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:2213 +#: ../../library/socket.rst:2212 msgid "This last example might require special privileges::" msgstr "" -#: ../../library/socket.rst:2253 +#: ../../library/socket.rst:2252 msgid "" "Running an example several times with too small delay between executions, " "could lead to this error::" msgstr "" -#: ../../library/socket.rst:2258 +#: ../../library/socket.rst:2257 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:2261 +#: ../../library/socket.rst:2260 msgid "" "There is a :mod:`socket` flag to set, in order to prevent this, :const:" "`socket.SO_REUSEADDR`::" msgstr "" -#: ../../library/socket.rst:2268 +#: ../../library/socket.rst:2267 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:2274 +#: ../../library/socket.rst:2273 msgid "" "For an introduction to socket programming (in C), see the following papers:" msgstr "" -#: ../../library/socket.rst:2276 +#: ../../library/socket.rst:2275 msgid "" "*An Introductory 4.3BSD Interprocess Communication Tutorial*, by Stuart " "Sechrest" msgstr "" -#: ../../library/socket.rst:2278 +#: ../../library/socket.rst:2277 msgid "" "*An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. " "Leffler et al," msgstr "" -#: ../../library/socket.rst:2281 +#: ../../library/socket.rst:2280 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 " @@ -2409,18 +2408,18 @@ msgstr "object(物件)" msgid "socket" msgstr "socket" -#: ../../library/socket.rst:1583 +#: ../../library/socket.rst:1582 msgid "I/O control" msgstr "I/O control(I/O 控制)" -#: ../../library/socket.rst:1583 +#: ../../library/socket.rst:1582 msgid "buffering" msgstr "buffering(緩衝)" -#: ../../library/socket.rst:1938 +#: ../../library/socket.rst:1937 msgid "module" msgstr "module(模組)" -#: ../../library/socket.rst:1938 +#: ../../library/socket.rst:1937 msgid "struct" msgstr "struct" diff --git a/library/sqlite3.po b/library/sqlite3.po index 43b1ec9efa..baf000f431 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-26 00:03+0000\n" +"POT-Creation-Date: 2023-11-28 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-" @@ -1422,8 +1422,8 @@ msgstr "" #: ../../library/sqlite3.rst:1474 msgid "" -"Execute SQL a single SQL statement, optionally binding Python values using :" -"ref:`placeholders `." +"Execute a single SQL statement, optionally binding Python values using :ref:" +"`placeholders `." msgstr "" #: ../../library/sqlite3.rst:1478 diff --git a/library/string.po b/library/string.po index 89796f864a..349e3c7756 100644 --- a/library/string.po +++ b/library/string.po @@ -49,7 +49,8 @@ msgid "" "`ascii_uppercase` constants described below. This value is not locale-" "dependent." msgstr "" -"下文描述的 :const:`ascii_lowercase` 和 :const:`ascii_uppercase` 常數的串接,該值不依賴於區域設定。" +"下文描述的 :const:`ascii_lowercase` 和 :const:`ascii_uppercase` 常數的串接," +"該值不依賴於區域設定。" #: ../../library/string.rst:32 msgid "" @@ -150,10 +151,9 @@ msgid "" "by :meth:`vformat` to break the string into either literal text, or " "replacement fields." msgstr "" -"將 format_string 放入迴圈,並回傳一個可疊代物件,其元素為 " -"(*literal_text*, *field_name*, *format_spec*, *conversion*)。這會被" -" :meth:`vformat` 用於將字串裁切為字面文本或" -"替換欄位。" +"將 format_string 放入迴圈,並回傳一個可疊代物件,其元素為 (*literal_text*, " +"*field_name*, *format_spec*, *conversion*)。這會被 :meth:`vformat` 用於將字串" +"裁切為字面文本或替換欄位。" #: ../../library/string.rst:122 msgid "" @@ -926,12 +926,10 @@ msgid "" "Python. As an example of a library built on template strings for i18n, see " "the `flufl.i18n `_ package." msgstr "" -"樣板字串提供如 :pep:`292` 所述更簡單的字串替換。" -"樣板字串的主要用例是國際化 (i18n)," -"因為在這種情況下,更簡單的語法和功能使得它" -"比其他 Python 內建字串格式化工具更容易翻譯。" -"基於樣板字串建構的 i18n 函式庫範例,請參閱 " -"`flufl.i18n `_ 套件。" +"樣板字串提供如 :pep:`292` 所述更簡單的字串替換。樣板字串的主要用例是國際化 " +"(i18n),因為在這種情況下,更簡單的語法和功能使得它比其他 Python 內建字串格式" +"化工具更容易翻譯。基於樣板字串建構的 i18n 函式庫範例,請參閱 `flufl.i18n " +"`_ 套件。" #: ../../library/string.rst:748 msgid "" diff --git a/library/sunau.po b/library/sunau.po index 1a70de77e5..deeb530def 100644 --- a/library/sunau.po +++ b/library/sunau.po @@ -234,8 +234,8 @@ msgid "" "Returns compression type. Supported compression types are ``'ULAW'``, " "``'ALAW'`` and ``'NONE'``." msgstr "" -"回傳壓縮種類。支援的壓縮種類有 ``'ULAW'``\\ 、\\ ``'ALAW'`` 和 ``'NONE'``" -"\\ 。" +"回傳壓縮種類。支援的壓縮種類有 ``'ULAW'``\\ 、\\ ``'ALAW'`` 和 " +"``'NONE'``\\ 。" #: ../../library/sunau.rst:147 msgid "" diff --git a/library/sys.monitoring.po b/library/sys.monitoring.po index 1e665b2e7e..1f35f4e55c 100644 --- a/library/sys.monitoring.po +++ b/library/sys.monitoring.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-26 00:03+0000\n" +"POT-Creation-Date: 2023-11-22 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -55,7 +55,7 @@ msgstr "" #: ../../library/sys.monitoring.rst:30 msgid ":ref:`Callbacks `" -msgstr "" +msgstr ":ref:`回呼 (callbacks) `" #: ../../library/sys.monitoring.rst:33 msgid "Tool identifiers" @@ -92,124 +92,132 @@ msgstr "" #: ../../library/sys.monitoring.rst:59 msgid "" +":func:`free_tool_id` will not disable global or local events associated with " +"*tool_id*, nor will it unregister any callback functions. This function is " +"only intended to be used to notify the VM that the particular *tool_id* is " +"no longer in use." +msgstr "" + +#: ../../library/sys.monitoring.rst:66 +msgid "" "Returns the name of the tool if *tool_id* is in use, otherwise it returns " "``None``. *tool_id* must be in the range 0 to 5 inclusive." msgstr "" -#: ../../library/sys.monitoring.rst:63 +#: ../../library/sys.monitoring.rst:70 msgid "" "All IDs are treated the same by the VM with regard to events, but the " "following IDs are pre-defined to make co-operation of tools easier::" msgstr "" -#: ../../library/sys.monitoring.rst:71 +#: ../../library/sys.monitoring.rst:78 msgid "" "There is no obligation to set an ID, nor is there anything preventing a tool " "from using an ID even it is already in use. However, tools are encouraged to " "use a unique ID and respect other tools." msgstr "" -#: ../../library/sys.monitoring.rst:76 +#: ../../library/sys.monitoring.rst:83 msgid "Events" msgstr "" -#: ../../library/sys.monitoring.rst:78 +#: ../../library/sys.monitoring.rst:85 msgid "The following events are supported:" msgstr "" -#: ../../library/sys.monitoring.rst:82 +#: ../../library/sys.monitoring.rst:89 msgid "A conditional branch is taken (or not)." msgstr "" -#: ../../library/sys.monitoring.rst:86 +#: ../../library/sys.monitoring.rst:93 msgid "A call in Python code (event occurs before the call)." msgstr "" -#: ../../library/sys.monitoring.rst:90 +#: ../../library/sys.monitoring.rst:97 msgid "" "An exception raised from any callable, except for Python functions (event " "occurs after the exit)." msgstr "" -#: ../../library/sys.monitoring.rst:94 +#: ../../library/sys.monitoring.rst:101 msgid "" "Return from any callable, except for Python functions (event occurs after " "the return)." msgstr "" -#: ../../library/sys.monitoring.rst:98 +#: ../../library/sys.monitoring.rst:105 msgid "An exception is handled." msgstr "" -#: ../../library/sys.monitoring.rst:102 +#: ../../library/sys.monitoring.rst:109 msgid "A VM instruction is about to be executed." msgstr "" -#: ../../library/sys.monitoring.rst:106 +#: ../../library/sys.monitoring.rst:113 msgid "An unconditional jump in the control flow graph is made." msgstr "" -#: ../../library/sys.monitoring.rst:110 +#: ../../library/sys.monitoring.rst:117 msgid "" "An instruction is about to be executed that has a different line number from " "the preceding instruction." msgstr "" -#: ../../library/sys.monitoring.rst:114 +#: ../../library/sys.monitoring.rst:121 msgid "" "Resumption of a Python function (for generator and coroutine functions), " "except for ``throw()`` calls." msgstr "" -#: ../../library/sys.monitoring.rst:118 +#: ../../library/sys.monitoring.rst:125 msgid "" "Return from a Python function (occurs immediately before the return, the " "callee's frame will be on the stack)." msgstr "" -#: ../../library/sys.monitoring.rst:122 +#: ../../library/sys.monitoring.rst:129 msgid "" "Start of a Python function (occurs immediately after the call, the callee's " "frame will be on the stack)" msgstr "" -#: ../../library/sys.monitoring.rst:126 +#: ../../library/sys.monitoring.rst:133 msgid "A Python function is resumed by a ``throw()`` call." msgstr "" -#: ../../library/sys.monitoring.rst:130 +#: ../../library/sys.monitoring.rst:137 msgid "Exit from a Python function during exception unwinding." msgstr "" -#: ../../library/sys.monitoring.rst:134 +#: ../../library/sys.monitoring.rst:141 msgid "" "Yield from a Python function (occurs immediately before the yield, the " "callee's frame will be on the stack)." msgstr "" -#: ../../library/sys.monitoring.rst:138 +#: ../../library/sys.monitoring.rst:145 msgid "" "An exception is raised, except those that cause a :monitoring-event:" "`STOP_ITERATION` event." msgstr "" -#: ../../library/sys.monitoring.rst:142 +#: ../../library/sys.monitoring.rst:149 msgid "" "An exception is re-raised, for example at the end of a :keyword:`finally` " "block." msgstr "" -#: ../../library/sys.monitoring.rst:146 +#: ../../library/sys.monitoring.rst:153 msgid "" "An artificial :exc:`StopIteration` is raised; see `the STOP_ITERATION " "event`_." msgstr "" -#: ../../library/sys.monitoring.rst:149 +#: ../../library/sys.monitoring.rst:156 msgid "More events may be added in the future." msgstr "" -#: ../../library/sys.monitoring.rst:151 +#: ../../library/sys.monitoring.rst:158 msgid "" "These events are attributes of the :mod:`!sys.monitoring.events` namespace. " "Each event is represented as a power-of-2 integer constant. To define a set " @@ -218,84 +226,84 @@ msgid "" "events, use the expression ``PY_RETURN | PY_START``." msgstr "" -#: ../../library/sys.monitoring.rst:159 +#: ../../library/sys.monitoring.rst:166 msgid "An alias for ``0`` so users can do explict comparisions like::" msgstr "" -#: ../../library/sys.monitoring.rst:164 +#: ../../library/sys.monitoring.rst:171 msgid "Events are divided into three groups:" msgstr "" -#: ../../library/sys.monitoring.rst:167 +#: ../../library/sys.monitoring.rst:174 msgid "Local events" msgstr "" -#: ../../library/sys.monitoring.rst:169 +#: ../../library/sys.monitoring.rst:176 msgid "" "Local events are associated with normal execution of the program and happen " "at clearly defined locations. All local events can be disabled. The local " "events are:" msgstr "" -#: ../../library/sys.monitoring.rst:173 +#: ../../library/sys.monitoring.rst:180 msgid ":monitoring-event:`PY_START`" -msgstr "" +msgstr ":monitoring-event:`PY_START`" -#: ../../library/sys.monitoring.rst:174 +#: ../../library/sys.monitoring.rst:181 msgid ":monitoring-event:`PY_RESUME`" -msgstr "" +msgstr ":monitoring-event:`PY_RESUME`" -#: ../../library/sys.monitoring.rst:175 +#: ../../library/sys.monitoring.rst:182 msgid ":monitoring-event:`PY_RETURN`" -msgstr "" +msgstr ":monitoring-event:`PY_RETURN`" -#: ../../library/sys.monitoring.rst:176 +#: ../../library/sys.monitoring.rst:183 msgid ":monitoring-event:`PY_YIELD`" -msgstr "" +msgstr ":monitoring-event:`PY_YIELD`" -#: ../../library/sys.monitoring.rst:177 +#: ../../library/sys.monitoring.rst:184 msgid ":monitoring-event:`CALL`" -msgstr "" +msgstr ":monitoring-event:`CALL`" -#: ../../library/sys.monitoring.rst:178 +#: ../../library/sys.monitoring.rst:185 msgid ":monitoring-event:`LINE`" -msgstr "" +msgstr ":monitoring-event:`LINE`" -#: ../../library/sys.monitoring.rst:179 +#: ../../library/sys.monitoring.rst:186 msgid ":monitoring-event:`INSTRUCTION`" -msgstr "" +msgstr ":monitoring-event:`INSTRUCTION`" -#: ../../library/sys.monitoring.rst:180 +#: ../../library/sys.monitoring.rst:187 msgid ":monitoring-event:`JUMP`" -msgstr "" +msgstr ":monitoring-event:`JUMP`" -#: ../../library/sys.monitoring.rst:181 +#: ../../library/sys.monitoring.rst:188 msgid ":monitoring-event:`BRANCH`" -msgstr "" +msgstr ":monitoring-event:`BRANCH`" -#: ../../library/sys.monitoring.rst:182 +#: ../../library/sys.monitoring.rst:189 msgid ":monitoring-event:`STOP_ITERATION`" -msgstr "" +msgstr ":monitoring-event:`STOP_ITERATION`" -#: ../../library/sys.monitoring.rst:185 +#: ../../library/sys.monitoring.rst:192 msgid "Ancillary events" msgstr "" -#: ../../library/sys.monitoring.rst:187 +#: ../../library/sys.monitoring.rst:194 msgid "" "Ancillary events can be monitored like other events, but are controlled by " "another event:" msgstr "" -#: ../../library/sys.monitoring.rst:190 +#: ../../library/sys.monitoring.rst:197 msgid ":monitoring-event:`C_RAISE`" -msgstr "" +msgstr ":monitoring-event:`C_RAISE`" -#: ../../library/sys.monitoring.rst:191 +#: ../../library/sys.monitoring.rst:198 msgid ":monitoring-event:`C_RETURN`" -msgstr "" +msgstr ":monitoring-event:`C_RETURN`" -#: ../../library/sys.monitoring.rst:193 +#: ../../library/sys.monitoring.rst:200 msgid "" "The :monitoring-event:`C_RETURN` and :monitoring-event:`C_RAISE` events are " "controlled by the :monitoring-event:`CALL` event. :monitoring-event:" @@ -303,41 +311,41 @@ msgid "" "corresponding :monitoring-event:`CALL` event is being monitored." msgstr "" -#: ../../library/sys.monitoring.rst:199 +#: ../../library/sys.monitoring.rst:206 msgid "Other events" msgstr "" -#: ../../library/sys.monitoring.rst:201 +#: ../../library/sys.monitoring.rst:208 msgid "" "Other events are not necessarily tied to a specific location in the program " "and cannot be individually disabled." msgstr "" -#: ../../library/sys.monitoring.rst:204 +#: ../../library/sys.monitoring.rst:211 msgid "The other events that can be monitored are:" msgstr "" -#: ../../library/sys.monitoring.rst:206 +#: ../../library/sys.monitoring.rst:213 msgid ":monitoring-event:`PY_THROW`" -msgstr "" +msgstr ":monitoring-event:`PY_THROW`" -#: ../../library/sys.monitoring.rst:207 +#: ../../library/sys.monitoring.rst:214 msgid ":monitoring-event:`PY_UNWIND`" -msgstr "" +msgstr ":monitoring-event:`PY_UNWIND`" -#: ../../library/sys.monitoring.rst:208 +#: ../../library/sys.monitoring.rst:215 msgid ":monitoring-event:`RAISE`" -msgstr "" +msgstr ":monitoring-event:`RAISE`" -#: ../../library/sys.monitoring.rst:209 +#: ../../library/sys.monitoring.rst:216 msgid ":monitoring-event:`EXCEPTION_HANDLED`" -msgstr "" +msgstr ":monitoring-event:`EXCEPTION_HANDLED`" -#: ../../library/sys.monitoring.rst:213 +#: ../../library/sys.monitoring.rst:220 msgid "The STOP_ITERATION event" msgstr "" -#: ../../library/sys.monitoring.rst:215 +#: ../../library/sys.monitoring.rst:222 msgid "" ":pep:`PEP 380 <380#use-of-stopiteration-to-return-values>` specifies that a :" "exc:`StopIteration` exception is raised when returning a value from a " @@ -346,7 +354,7 @@ msgid "" "an exception unless it would be visible to other code." msgstr "" -#: ../../library/sys.monitoring.rst:221 +#: ../../library/sys.monitoring.rst:228 msgid "" "To allow tools to monitor for real exceptions without slowing down " "generators and coroutines, the :monitoring-event:`STOP_ITERATION` event is " @@ -354,83 +362,83 @@ msgid "" "unlike :monitoring-event:`RAISE`." msgstr "" -#: ../../library/sys.monitoring.rst:227 +#: ../../library/sys.monitoring.rst:234 msgid "Turning events on and off" msgstr "" -#: ../../library/sys.monitoring.rst:229 +#: ../../library/sys.monitoring.rst:236 msgid "" "In order to monitor an event, it must be turned on and a corresponding " "callback must be registered. Events can be turned on or off by setting the " "events either globally or for a particular code object." msgstr "" -#: ../../library/sys.monitoring.rst:236 +#: ../../library/sys.monitoring.rst:243 msgid "Setting events globally" msgstr "" -#: ../../library/sys.monitoring.rst:238 +#: ../../library/sys.monitoring.rst:245 msgid "" "Events can be controlled globally by modifying the set of events being " "monitored." msgstr "" -#: ../../library/sys.monitoring.rst:242 +#: ../../library/sys.monitoring.rst:249 msgid "Returns the ``int`` representing all the active events." msgstr "" -#: ../../library/sys.monitoring.rst:246 +#: ../../library/sys.monitoring.rst:253 msgid "" "Activates all events which are set in *event_set*. Raises a :exc:" "`ValueError` if *tool_id* is not in use." msgstr "" -#: ../../library/sys.monitoring.rst:249 +#: ../../library/sys.monitoring.rst:256 msgid "No events are active by default." msgstr "" -#: ../../library/sys.monitoring.rst:252 +#: ../../library/sys.monitoring.rst:259 msgid "Per code object events" msgstr "" -#: ../../library/sys.monitoring.rst:254 +#: ../../library/sys.monitoring.rst:261 msgid "Events can also be controlled on a per code object basis." msgstr "" -#: ../../library/sys.monitoring.rst:258 +#: ../../library/sys.monitoring.rst:265 msgid "Returns all the local events for *code*" msgstr "" -#: ../../library/sys.monitoring.rst:262 +#: ../../library/sys.monitoring.rst:269 msgid "" "Activates all the local events for *code* which are set in *event_set*. " "Raises a :exc:`ValueError` if *tool_id* is not in use." msgstr "" -#: ../../library/sys.monitoring.rst:265 +#: ../../library/sys.monitoring.rst:272 msgid "" "Local events add to global events, but do not mask them. In other words, all " "global events will trigger for a code object, regardless of the local events." msgstr "" -#: ../../library/sys.monitoring.rst:271 +#: ../../library/sys.monitoring.rst:278 msgid "Disabling events" msgstr "" -#: ../../library/sys.monitoring.rst:275 +#: ../../library/sys.monitoring.rst:282 msgid "" "A special value that can be returned from a callback function to disable " "events for the current code location." msgstr "" -#: ../../library/sys.monitoring.rst:278 +#: ../../library/sys.monitoring.rst:285 msgid "" "Local events can be disabled for a specific code location by returning :data:" "`sys.monitoring.DISABLE` from a callback function. This does not change " "which events are set, or any other code locations for the same event." msgstr "" -#: ../../library/sys.monitoring.rst:282 +#: ../../library/sys.monitoring.rst:289 msgid "" "Disabling events for specific locations is very important for high " "performance monitoring. For example, a program can be run under a debugger " @@ -438,105 +446,110 @@ msgid "" "breakpoints." msgstr "" -#: ../../library/sys.monitoring.rst:289 +#: ../../library/sys.monitoring.rst:296 msgid "" "Enable all the events that were disabled by :data:`sys.monitoring.DISABLE` " "for all tools." msgstr "" -#: ../../library/sys.monitoring.rst:296 +#: ../../library/sys.monitoring.rst:303 msgid "Registering callback functions" msgstr "" -#: ../../library/sys.monitoring.rst:298 +#: ../../library/sys.monitoring.rst:305 msgid "To register a callable for events call" msgstr "" -#: ../../library/sys.monitoring.rst:302 +#: ../../library/sys.monitoring.rst:309 msgid "Registers the callable *func* for the *event* with the given *tool_id*" msgstr "" -#: ../../library/sys.monitoring.rst:304 +#: ../../library/sys.monitoring.rst:311 msgid "" "If another callback was registered for the given *tool_id* and *event*, it " "is unregistered and returned. Otherwise :func:`register_callback` returns " "``None``." msgstr "" -#: ../../library/sys.monitoring.rst:309 +#: ../../library/sys.monitoring.rst:316 msgid "" "Functions can be unregistered by calling ``sys.monitoring." "register_callback(tool_id, event, None)``." msgstr "" -#: ../../library/sys.monitoring.rst:312 +#: ../../library/sys.monitoring.rst:319 msgid "Callback functions can be registered and unregistered at any time." msgstr "" -#: ../../library/sys.monitoring.rst:314 +#: ../../library/sys.monitoring.rst:321 msgid "" "Registering or unregistering a callback function will generate a :func:`sys." "audit` event." msgstr "" -#: ../../library/sys.monitoring.rst:318 +#: ../../library/sys.monitoring.rst:325 msgid "Callback function arguments" msgstr "" -#: ../../library/sys.monitoring.rst:322 +#: ../../library/sys.monitoring.rst:329 msgid "" "A special value that is passed to a callback function to indicate that there " "are no arguments to the call." msgstr "" -#: ../../library/sys.monitoring.rst:325 +#: ../../library/sys.monitoring.rst:332 msgid "" "When an active event occurs, the registered callback function is called. " "Different events will provide the callback function with different " "arguments, as follows:" msgstr "" -#: ../../library/sys.monitoring.rst:328 +#: ../../library/sys.monitoring.rst:335 msgid ":monitoring-event:`PY_START` and :monitoring-event:`PY_RESUME`::" -msgstr "" +msgstr ":monitoring-event:`PY_START` 和 :monitoring-event:`PY_RESUME`: ::" -#: ../../library/sys.monitoring.rst:332 +#: ../../library/sys.monitoring.rst:339 msgid ":monitoring-event:`PY_RETURN` and :monitoring-event:`PY_YIELD`::" -msgstr "" +msgstr ":monitoring-event:`PY_RETURN` 和 :monitoring-event:`PY_YIELD`: ::" -#: ../../library/sys.monitoring.rst:336 +#: ../../library/sys.monitoring.rst:343 msgid "" ":monitoring-event:`CALL`, :monitoring-event:`C_RAISE` and :monitoring-event:" "`C_RETURN`::" msgstr "" +":monitoring-event:`CALL`、:monitoring-event:`C_RAISE` 和 :monitoring-event:" +"`C_RETURN`: ::" -#: ../../library/sys.monitoring.rst:340 +#: ../../library/sys.monitoring.rst:347 msgid "" "If there are no arguments, *arg0* is set to :data:`sys.monitoring.MISSING`." msgstr "" -#: ../../library/sys.monitoring.rst:342 +#: ../../library/sys.monitoring.rst:349 msgid "" ":monitoring-event:`RAISE`, :monitoring-event:`RERAISE`, :monitoring-event:" "`EXCEPTION_HANDLED`, :monitoring-event:`PY_UNWIND`, :monitoring-event:" "`PY_THROW` and :monitoring-event:`STOP_ITERATION`::" msgstr "" +":monitoring-event:`RAISE`、:monitoring-event:`RERAISE`、:monitoring-event:" +"`EXCEPTION_HANDLED`、:monitoring-event:`PY_UNWIND`、:monitoring-event:" +"`PY_THROW` 和 :monitoring-event:`STOP_ITERATION`: ::" -#: ../../library/sys.monitoring.rst:347 +#: ../../library/sys.monitoring.rst:354 msgid ":monitoring-event:`LINE`::" -msgstr "" +msgstr ":monitoring-event:`LINE`: ::" -#: ../../library/sys.monitoring.rst:351 +#: ../../library/sys.monitoring.rst:358 msgid ":monitoring-event:`BRANCH` and :monitoring-event:`JUMP`::" -msgstr "" +msgstr ":monitoring-event:`BRANCH` 和 :monitoring-event:`JUMP`: ::" -#: ../../library/sys.monitoring.rst:355 +#: ../../library/sys.monitoring.rst:362 msgid "" "Note that the *destination_offset* is where the code will next execute. For " "an untaken branch this will be the offset of the instruction following the " "branch." msgstr "" -#: ../../library/sys.monitoring.rst:359 +#: ../../library/sys.monitoring.rst:366 msgid ":monitoring-event:`INSTRUCTION`::" -msgstr "" +msgstr ":monitoring-event:`INSTRUCTION`: ::" diff --git a/library/sys.po b/library/sys.po index e95afb800e..911070ff26 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: 2023-11-01 00:03+0000\n" +"POT-Creation-Date: 2023-12-06 00:03+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-" @@ -375,7 +375,7 @@ msgid "Integer specifying the handle of the Python DLL." msgstr "" #: ../../library/sys.rst:286 ../../library/sys.rst:976 -#: ../../library/sys.rst:1730 ../../library/sys.rst:1966 +#: ../../library/sys.rst:1731 ../../library/sys.rst:1967 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -1263,7 +1263,7 @@ msgstr "" msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`\\ 。" -#: ../../library/sys.rst:999 ../../library/sys.rst:1662 +#: ../../library/sys.rst:999 ../../library/sys.rst:1663 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" @@ -1275,7 +1275,7 @@ msgid "" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:1011 ../../library/sys.rst:1683 +#: ../../library/sys.rst:1011 ../../library/sys.rst:1684 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." @@ -1890,7 +1890,7 @@ msgid "" "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1497 ../../library/sys.rst:1595 +#: ../../library/sys.rst:1497 ../../library/sys.rst:1596 msgid "``'return'``" msgstr "``'return'``" @@ -2021,7 +2021,7 @@ msgid "" "trace function." msgstr "" -#: ../../library/sys.rst:1589 +#: ../../library/sys.rst:1590 msgid "``'line'``" msgstr "``'line'``" @@ -2031,11 +2031,11 @@ msgid "" "condition of a loop. The local trace function is called; *arg* is ``None``; " "the return value specifies the new local trace function. See :file:`Objects/" "lnotab_notes.txt` for a detailed explanation of how this works. Per-line " -"events may be disabled for a frame by setting :attr:`!f_trace_lines` to :" -"const:`False` on that :ref:`frame `." +"events may be disabled for a frame by setting :attr:`~frame.f_trace_lines` " +"to :const:`False` on that :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1592 +#: ../../library/sys.rst:1593 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 " @@ -2043,37 +2043,38 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1600 +#: ../../library/sys.rst:1601 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1598 +#: ../../library/sys.rst:1599 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:1608 +#: ../../library/sys.rst:1609 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1603 +#: ../../library/sys.rst:1604 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 " "value specifies the new local trace function. Per-opcode events are not " -"emitted by default: they must be explicitly requested by setting :attr:`!" -"f_trace_opcodes` to :const:`True` on the :ref:`frame `." +"emitted by default: they must be explicitly requested by setting :attr:" +"`~frame.f_trace_opcodes` to :const:`True` on the :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1610 +#: ../../library/sys.rst:1611 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:1613 +#: ../../library/sys.rst:1614 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 " @@ -2087,17 +2088,17 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1624 +#: ../../library/sys.rst:1625 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:1626 +#: ../../library/sys.rst:1627 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:1630 +#: ../../library/sys.rst:1631 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2105,13 +2106,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1637 +#: ../../library/sys.rst:1638 msgid "" -"``'opcode'`` event type added; :attr:`!f_trace_lines` and :attr:`!" -"f_trace_opcodes` attributes added to frames" +"``'opcode'`` event type added; :attr:`~frame.f_trace_lines` and :attr:" +"`~frame.f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1642 +#: ../../library/sys.rst:1643 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2120,7 +2121,7 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:1648 +#: ../../library/sys.rst:1649 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." @@ -2128,7 +2129,7 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_firstiter``。" -#: ../../library/sys.rst:1650 +#: ../../library/sys.rst:1651 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." @@ -2136,20 +2137,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_finalizer``。" -#: ../../library/sys.rst:1652 +#: ../../library/sys.rst:1653 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:1655 +#: ../../library/sys.rst:1656 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:1667 +#: ../../library/sys.rst:1668 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2158,105 +2159,105 @@ msgid "" "disabled, ``cr_origin`` will be None." msgstr "" -#: ../../library/sys.rst:1674 +#: ../../library/sys.rst:1675 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:1678 +#: ../../library/sys.rst:1679 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1688 +#: ../../library/sys.rst:1689 msgid "" "Activate the stack profiler trampoline *backend*. The only supported backend " "is ``\"perf\"``." msgstr "" -#: ../../library/sys.rst:1691 ../../library/sys.rst:1706 -#: ../../library/sys.rst:1714 +#: ../../library/sys.rst:1692 ../../library/sys.rst:1707 +#: ../../library/sys.rst:1715 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/sys.rst:1697 +#: ../../library/sys.rst:1698 msgid ":ref:`perf_profiling`" msgstr "" -#: ../../library/sys.rst:1698 +#: ../../library/sys.rst:1699 msgid "https://perf.wiki.kernel.org" msgstr "" -#: ../../library/sys.rst:1702 +#: ../../library/sys.rst:1703 msgid "Deactivate the current stack profiler trampoline backend." msgstr "" -#: ../../library/sys.rst:1704 +#: ../../library/sys.rst:1705 msgid "If no stack profiler is activated, this function has no effect." msgstr "" -#: ../../library/sys.rst:1712 +#: ../../library/sys.rst:1713 msgid "Return ``True`` if a stack profiler trampoline is active." msgstr "" -#: ../../library/sys.rst:1720 +#: ../../library/sys.rst:1721 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:1724 +#: ../../library/sys.rst:1725 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1727 +#: ../../library/sys.rst:1728 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1732 +#: ../../library/sys.rst:1733 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`\\ 。" -#: ../../library/sys.rst:1739 +#: ../../library/sys.rst:1740 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1742 +#: ../../library/sys.rst:1743 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1744 +#: ../../library/sys.rst:1745 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:1746 +#: ../../library/sys.rst:1747 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1748 +#: ../../library/sys.rst:1749 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:1752 +#: ../../library/sys.rst:1753 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:1755 +#: ../../library/sys.rst:1756 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 " @@ -2267,14 +2268,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1764 +#: ../../library/sys.rst:1765 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:1769 +#: ../../library/sys.rst:1770 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2283,7 +2284,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1776 +#: ../../library/sys.rst:1777 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2292,19 +2293,19 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1782 +#: ../../library/sys.rst:1783 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1788 +#: ../../library/sys.rst:1789 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:1792 +#: ../../library/sys.rst:1793 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 " @@ -2312,7 +2313,7 @@ msgid "" "support the :attr:`!buffer` attribute." msgstr "" -#: ../../library/sys.rst:1802 +#: ../../library/sys.rst:1803 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2320,7 +2321,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1807 +#: ../../library/sys.rst:1808 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, " @@ -2328,7 +2329,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1813 +#: ../../library/sys.rst:1814 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2336,12 +2337,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1821 +#: ../../library/sys.rst:1822 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1823 +#: ../../library/sys.rst:1824 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 " @@ -2349,7 +2350,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1828 +#: ../../library/sys.rst:1829 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 " @@ -2357,60 +2358,60 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1833 +#: ../../library/sys.rst:1834 msgid "See also the :data:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1840 +#: ../../library/sys.rst:1841 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1845 +#: ../../library/sys.rst:1846 msgid "The name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1847 +#: ../../library/sys.rst:1848 msgid "``\"nt\"``: Windows threads" msgstr "``\"nt\"``: Windows 執行緒" -#: ../../library/sys.rst:1848 +#: ../../library/sys.rst:1849 msgid "``\"pthread\"``: POSIX threads" msgstr "``\"pthread\"``: POSIX 執行緒" -#: ../../library/sys.rst:1849 +#: ../../library/sys.rst:1850 msgid "" "``\"pthread-stubs\"``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1851 +#: ../../library/sys.rst:1852 msgid "``\"solaris\"``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1855 +#: ../../library/sys.rst:1856 msgid "The name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1857 +#: ../../library/sys.rst:1858 msgid "``\"semaphore\"``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1858 +#: ../../library/sys.rst:1859 msgid "``\"mutex+cond\"``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1859 +#: ../../library/sys.rst:1860 msgid "``None`` if this information is unknown" msgstr "為 ``None`` 表示此資訊未知" -#: ../../library/sys.rst:1863 +#: ../../library/sys.rst:1864 msgid "" "The name and version of the thread library. It is a string, or ``None`` if " "this information is unknown." msgstr "" -#: ../../library/sys.rst:1871 +#: ../../library/sys.rst:1872 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2419,73 +2420,73 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1879 +#: ../../library/sys.rst:1880 msgid "Handle an unraisable exception." msgstr "處理一個不可被引發的例外。" -#: ../../library/sys.rst:1881 +#: ../../library/sys.rst:1882 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:1885 +#: ../../library/sys.rst:1886 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1887 +#: ../../library/sys.rst:1888 msgid ":attr:`!exc_type`: Exception type." msgstr ":attr:`!exc_type`: 例外型別。" -#: ../../library/sys.rst:1888 +#: ../../library/sys.rst:1889 msgid ":attr:`!exc_value`: Exception value, can be ``None``." msgstr ":attr:`!exc_value`: 例外值,可以為 ``None``。" -#: ../../library/sys.rst:1889 +#: ../../library/sys.rst:1890 msgid ":attr:`!exc_traceback`: Exception traceback, can be ``None``." msgstr ":attr:`!exc_traceback`: 例外追蹤,可以為 ``None``。" -#: ../../library/sys.rst:1890 +#: ../../library/sys.rst:1891 msgid ":attr:`!err_msg`: Error message, can be ``None``." msgstr ":attr:`!err_msg`: 錯誤訊息,可以為 ``None``。" -#: ../../library/sys.rst:1891 +#: ../../library/sys.rst:1892 msgid ":attr:`!object`: Object causing the exception, can be ``None``." msgstr ":attr:`!object`: 導致例外的物件,可以為 ``None``。" -#: ../../library/sys.rst:1893 +#: ../../library/sys.rst:1894 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:1897 +#: ../../library/sys.rst:1898 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1902 +#: ../../library/sys.rst:1903 msgid ":func:`excepthook` which handles uncaught exceptions." msgstr "處理未被捕捉到例外的 :func:`excepthook`。" -#: ../../library/sys.rst:1906 +#: ../../library/sys.rst:1907 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:1910 +#: ../../library/sys.rst:1911 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:1914 +#: ../../library/sys.rst:1915 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``sys.unraisablehook`` with " @@ -2494,7 +2495,7 @@ msgstr "" "引發一個附帶引數 ``hook``、``unraisable`` 的\\ :ref:`稽核事件 ` " "``sys.unraisablehook``。" -#: ../../library/sys.rst:1916 +#: ../../library/sys.rst:1917 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments *hook*, " "*unraisable* when an exception that cannot be handled occurs. The " @@ -2502,7 +2503,7 @@ msgid "" "hook has been set, *hook* may be ``None``." msgstr "" -#: ../../library/sys.rst:1925 +#: ../../library/sys.rst:1926 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2511,13 +2512,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1934 +#: ../../library/sys.rst:1935 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:1940 +#: ../../library/sys.rst:1941 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2528,18 +2529,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1948 +#: ../../library/sys.rst:1949 msgid "Added named component attributes." msgstr "新增了附名的元件屬性。" -#: ../../library/sys.rst:1953 +#: ../../library/sys.rst:1954 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:1960 +#: ../../library/sys.rst:1961 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 " @@ -2548,31 +2549,31 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1972 +#: ../../library/sys.rst:1973 msgid "" "Namespace containing functions and constants for register callbacks and " "controlling monitoring events. See :mod:`sys.monitoring` for details." msgstr "" -#: ../../library/sys.rst:1978 +#: ../../library/sys.rst:1979 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:1994 +#: ../../library/sys.rst:1995 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:2002 +#: ../../library/sys.rst:2003 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:2003 +#: ../../library/sys.rst:2004 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/" diff --git a/library/test.po b/library/test.po index 30b923688b..ef51fb93fb 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: 2023-10-30 00:03+0000\n" +"POT-Creation-Date: 2023-11-26 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-" @@ -20,7 +20,7 @@ msgstr "" #: ../../library/test.rst:2 msgid ":mod:`test` --- Regression tests package for Python" -msgstr "" +msgstr ":mod:`test` --- Python 的回歸測試 (regression tests) 套件" #: ../../library/test.rst:10 msgid "" @@ -54,7 +54,7 @@ msgstr ":mod:`unittest` 模組" #: ../../library/test.rst:33 msgid "Writing PyUnit regression tests." -msgstr "" +msgstr "撰寫 PyUnit 回歸測試。" #: ../../library/test.rst:35 msgid "Module :mod:`doctest`" @@ -62,11 +62,11 @@ msgstr ":mod:`doctest` 模組" #: ../../library/test.rst:36 msgid "Tests embedded in documentation strings." -msgstr "" +msgstr "鑲嵌在文件字串中的測試。" #: ../../library/test.rst:42 msgid "Writing Unit Tests for the :mod:`test` package" -msgstr "" +msgstr "撰寫 :mod:`test` 套件的單元測試" #: ../../library/test.rst:44 msgid "" @@ -170,17 +170,17 @@ msgstr "" #: ../../library/test.rst:153 msgid "Test Driven Development" -msgstr "" +msgstr "測試驅動開發" #: ../../library/test.rst:154 msgid "A book by Kent Beck on writing tests before code." -msgstr "" +msgstr "由 Kent Beck 所著,關於先寫測試再寫程式的書籍。" #: ../../library/test.rst:160 msgid "Running tests using the command-line interface" -msgstr "" +msgstr "使用命令列介面執行測試" -#: ../../library/test.rst:162 +#: ../../library/test.rst:165 msgid "" "The :mod:`test` package can be run as a script to drive Python's regression " "test suite, thanks to the :option:`-m` option: :program:`python -m test`. " @@ -196,7 +196,7 @@ msgid "" "print whether the test passed or failed." msgstr "" -#: ../../library/test.rst:175 +#: ../../library/test.rst:178 msgid "" "Running :mod:`test` directly allows what resources are available for tests " "to use to be set. You do this by using the ``-u`` command-line option. " @@ -209,7 +209,7 @@ msgid "" "more command-line options, run :program:`python -m test -h`." msgstr "" -#: ../../library/test.rst:186 +#: ../../library/test.rst:189 msgid "" "Some other ways to execute the regression tests depend on what platform the " "tests are being executed on. On Unix, you can run :program:`make test` at " @@ -218,142 +218,142 @@ msgid "" "tests." msgstr "" -#: ../../library/test.rst:194 +#: ../../library/test.rst:197 msgid ":mod:`test.support` --- Utilities for the Python test suite" -msgstr "" +msgstr ":mod:`test.support` --- Python 測試套件的工具" -#: ../../library/test.rst:200 +#: ../../library/test.rst:203 msgid "" "The :mod:`test.support` module provides support for Python's regression test " "suite." -msgstr "" +msgstr ":mod:`test.support` 模組提供 Python 回歸測試套件的支援。" -#: ../../library/test.rst:205 +#: ../../library/test.rst:208 msgid "" ":mod:`test.support` is not a public module. It is documented here to help " "Python developers write tests. The API of this module is subject to change " "without backwards compatibility concerns between releases." msgstr "" -#: ../../library/test.rst:210 +#: ../../library/test.rst:213 msgid "This module defines the following exceptions:" -msgstr "" +msgstr "此模組定義了以下例外:" -#: ../../library/test.rst:214 +#: ../../library/test.rst:217 msgid "" "Exception to be raised when a test fails. This is deprecated in favor of :" "mod:`unittest`\\ -based tests and :class:`unittest.TestCase`'s assertion " "methods." msgstr "" -#: ../../library/test.rst:221 +#: ../../library/test.rst:224 msgid "" "Subclass of :exc:`unittest.SkipTest`. Raised when a resource (such as a " "network connection) is not available. Raised by the :func:`requires` " "function." msgstr "" -#: ../../library/test.rst:226 +#: ../../library/test.rst:229 msgid "The :mod:`test.support` module defines the following constants:" -msgstr "" +msgstr ":mod:`test.support` 模組定義了以下常數:" -#: ../../library/test.rst:230 +#: ../../library/test.rst:233 msgid "" "``True`` when verbose output is enabled. Should be checked when more " "detailed information is desired about a running test. *verbose* is set by :" "mod:`test.regrtest`." msgstr "" -#: ../../library/test.rst:237 +#: ../../library/test.rst:240 msgid "``True`` if the running interpreter is Jython." -msgstr "" +msgstr "如果執行的直譯器是 Jython,則為 ``True``。" -#: ../../library/test.rst:242 +#: ../../library/test.rst:245 msgid "``True`` if the system is Android." -msgstr "" +msgstr "如果系統是 Android,則為 ``True``。" -#: ../../library/test.rst:247 +#: ../../library/test.rst:250 msgid "Path for shell if not on Windows; otherwise ``None``." msgstr "" -#: ../../library/test.rst:252 +#: ../../library/test.rst:255 msgid "" "Timeout in seconds for tests using a network server listening on the network " "local loopback interface like ``127.0.0.1``." msgstr "" -#: ../../library/test.rst:255 +#: ../../library/test.rst:258 msgid "" "The timeout is long enough to prevent test failure: it takes into account " "that the client and the server can run in different threads or even " "different processes." msgstr "" -#: ../../library/test.rst:259 +#: ../../library/test.rst:262 msgid "" "The timeout should be long enough for :meth:`~socket.socket.connect`, :meth:" "`~socket.socket.recv` and :meth:`~socket.socket.send` methods of :class:" "`socket.socket`." msgstr "" -#: ../../library/test.rst:263 +#: ../../library/test.rst:266 msgid "Its default value is 5 seconds." -msgstr "" +msgstr "預設值為 5 秒。" -#: ../../library/test.rst:265 +#: ../../library/test.rst:268 msgid "See also :data:`INTERNET_TIMEOUT`." -msgstr "另請參閱 :data:`INTERNET_TIMEOUT`\\ 。" +msgstr "另請參閱 :data:`INTERNET_TIMEOUT`。" -#: ../../library/test.rst:270 +#: ../../library/test.rst:273 msgid "Timeout in seconds for network requests going to the internet." msgstr "" -#: ../../library/test.rst:272 +#: ../../library/test.rst:275 msgid "" "The timeout is short enough to prevent a test to wait for too long if the " "internet request is blocked for whatever reason." msgstr "" -#: ../../library/test.rst:275 +#: ../../library/test.rst:278 msgid "" "Usually, a timeout using :data:`INTERNET_TIMEOUT` should not mark a test as " "failed, but skip the test instead: see :func:`~test.support.socket_helper." "transient_internet`." msgstr "" -#: ../../library/test.rst:279 +#: ../../library/test.rst:282 msgid "Its default value is 1 minute." -msgstr "" +msgstr "預設值為 1 分鐘。" -#: ../../library/test.rst:281 +#: ../../library/test.rst:284 msgid "See also :data:`LOOPBACK_TIMEOUT`." -msgstr "另請參閱 :data:`LOOPBACK_TIMEOUT`\\ 。" +msgstr "另請參閱 :data:`LOOPBACK_TIMEOUT`。" -#: ../../library/test.rst:286 +#: ../../library/test.rst:289 msgid "" "Timeout in seconds to mark a test as failed if the test takes \"too long\"." msgstr "" -#: ../../library/test.rst:288 +#: ../../library/test.rst:291 msgid "" "The timeout value depends on the regrtest ``--timeout`` command line option." msgstr "" -#: ../../library/test.rst:290 +#: ../../library/test.rst:293 msgid "" "If a test using :data:`SHORT_TIMEOUT` starts to fail randomly on slow " "buildbots, use :data:`LONG_TIMEOUT` instead." msgstr "" -#: ../../library/test.rst:293 +#: ../../library/test.rst:296 msgid "Its default value is 30 seconds." -msgstr "" +msgstr "預設值為 30 秒。" -#: ../../library/test.rst:298 +#: ../../library/test.rst:301 msgid "Timeout in seconds to detect when a test hangs." msgstr "" -#: ../../library/test.rst:300 +#: ../../library/test.rst:303 msgid "" "It is long enough to reduce the risk of test failure on the slowest Python " "buildbots. It should not be used to mark a test as failed if the test takes " @@ -361,178 +361,174 @@ msgid "" "command line option." msgstr "" -#: ../../library/test.rst:305 +#: ../../library/test.rst:308 msgid "Its default value is 5 minutes." -msgstr "" +msgstr "預設值為 5 分鐘。" -#: ../../library/test.rst:307 +#: ../../library/test.rst:310 msgid "" "See also :data:`LOOPBACK_TIMEOUT`, :data:`INTERNET_TIMEOUT` and :data:" "`SHORT_TIMEOUT`." msgstr "" +"請參閱 :data:`LOOPBACK_TIMEOUT`、:data:`INTERNET_TIMEOUT` 和 :data:" +"`SHORT_TIMEOUT`。" -#: ../../library/test.rst:313 +#: ../../library/test.rst:316 msgid "Set when tests can be skipped when they are not useful for PGO." msgstr "" -#: ../../library/test.rst:318 +#: ../../library/test.rst:321 msgid "" "A constant that is likely larger than the underlying OS pipe buffer size, to " "make writes blocking." msgstr "" -#: ../../library/test.rst:324 +#: ../../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>`)." msgstr "" -#: ../../library/test.rst:333 +#: ../../library/test.rst:336 msgid "" "A constant that is likely larger than the underlying OS socket buffer size, " "to make writes blocking." msgstr "" -#: ../../library/test.rst:339 +#: ../../library/test.rst:342 msgid "Set to the top level directory that contains :mod:`test.support`." -msgstr "" +msgstr "設定為包含 :mod:`test.support` 的頂層目錄。" -#: ../../library/test.rst:344 +#: ../../library/test.rst:347 msgid "Set to the top level directory for the test package." -msgstr "" +msgstr "設定為測試套件的頂層目錄。" -#: ../../library/test.rst:349 +#: ../../library/test.rst:352 msgid "Set to the ``data`` directory within the test package." -msgstr "" +msgstr "設定為測試套件中的 ``data`` 目錄。" -#: ../../library/test.rst:354 +#: ../../library/test.rst:357 msgid "Set to :data:`sys.maxsize` for big memory tests." -msgstr "" +msgstr "設定為 :data:`sys.maxsize` 以進行大記憶體測試。" -#: ../../library/test.rst:359 +#: ../../library/test.rst:362 msgid "" "Set by :func:`set_memlimit` as the memory limit for big memory tests. " "Limited by :data:`MAX_Py_ssize_t`." msgstr "" -#: ../../library/test.rst:365 +#: ../../library/test.rst:368 msgid "" "Set by :func:`set_memlimit` as the memory limit for big memory tests. Not " "limited by :data:`MAX_Py_ssize_t`." msgstr "" -#: ../../library/test.rst:371 +#: ../../library/test.rst:374 msgid "" "Set to ``True`` if Python is built without docstrings (the :c:macro:" "`WITH_DOC_STRINGS` macro is not defined). See the :option:`configure --" "without-doc-strings <--without-doc-strings>` option." msgstr "" -#: ../../library/test.rst:375 +#: ../../library/test.rst:378 msgid "See also the :data:`HAVE_DOCSTRINGS` variable." msgstr "" -#: ../../library/test.rst:380 +#: ../../library/test.rst:383 msgid "" "Set to ``True`` if function docstrings are available. See the :option:" "`python -OO <-O>` option, which strips docstrings of functions implemented " "in Python." msgstr "" -#: ../../library/test.rst:383 +#: ../../library/test.rst:386 msgid "See also the :data:`MISSING_C_DOCSTRINGS` variable." -msgstr "" +msgstr "請參閱 :data:`MISSING_C_DOCSTRINGS` 變數。" -#: ../../library/test.rst:388 +#: ../../library/test.rst:391 msgid "Define the URL of a dedicated HTTP server for the network tests." msgstr "" -#: ../../library/test.rst:393 +#: ../../library/test.rst:396 msgid "Object that is equal to anything. Used to test mixed type comparison." msgstr "" -#: ../../library/test.rst:398 +#: ../../library/test.rst:401 msgid "" "Object that is not equal to anything (even to :data:`ALWAYS_EQ`). Used to " "test mixed type comparison." msgstr "" -#: ../../library/test.rst:404 +#: ../../library/test.rst:407 msgid "" "Object that is greater than anything (except itself). Used to test mixed " "type comparison." msgstr "" -#: ../../library/test.rst:410 +#: ../../library/test.rst:413 msgid "" "Object that is less than anything (except itself). Used to test mixed type " "comparison." msgstr "" -#: ../../library/test.rst:414 +#: ../../library/test.rst:417 msgid "The :mod:`test.support` module defines the following functions:" -msgstr "" +msgstr ":mod:`test.support` 模組定義了以下函式:" -#: ../../library/test.rst:418 +#: ../../library/test.rst:421 msgid "Run the loop body until ``break`` stops the loop." -msgstr "" +msgstr "執行迴圈主體直到 ``break`` 停止迴圈。" -#: ../../library/test.rst:420 +#: ../../library/test.rst:423 msgid "" "After *timeout* seconds, raise an :exc:`AssertionError` if *error* is true, " "or just stop the loop if *error* is false." msgstr "" -#: ../../library/test.rst:423 +#: ../../library/test.rst:426 msgid "Example::" -msgstr "" -"範例:\n" -"\n" -"::" +msgstr "範例: ::" -#: ../../library/test.rst:429 ../../library/test.rst:453 +#: ../../library/test.rst:432 ../../library/test.rst:456 msgid "Example of error=False usage::" -msgstr "" -"error=False 用法範例:\n" -"\n" -"::" +msgstr "error=False 用法範例: ::" -#: ../../library/test.rst:439 +#: ../../library/test.rst:442 msgid "Wait strategy that applies exponential backoff." msgstr "" -#: ../../library/test.rst:441 +#: ../../library/test.rst:444 msgid "" "Run the loop body until ``break`` stops the loop. Sleep at each loop " "iteration, but not at the first iteration. The sleep delay is doubled at " "each iteration (up to *max_delay* seconds)." msgstr "" -#: ../../library/test.rst:445 +#: ../../library/test.rst:448 msgid "See :func:`busy_retry` documentation for the parameters usage." -msgstr "" +msgstr "請見 :func:`busy_retry` 文件以瞭解參數用法。" -#: ../../library/test.rst:447 +#: ../../library/test.rst:450 msgid "Example raising an exception after SHORT_TIMEOUT seconds::" -msgstr "" +msgstr "在 SHORT_TIMEOUT 秒後引發例外的範例: ::" -#: ../../library/test.rst:463 +#: ../../library/test.rst:466 msgid "" "Return ``True`` if *resource* is enabled and available. The list of " "available resources is only set when :mod:`test.regrtest` is executing the " "tests." msgstr "" -#: ../../library/test.rst:470 +#: ../../library/test.rst:473 msgid "Return ``True`` if Python was not built with ``-O0`` or ``-Og``." -msgstr "" +msgstr "如果 Python 不是使用 ``-O0`` 或 ``-Og`` 建置則回傳 ``True``。" -#: ../../library/test.rst:475 +#: ../../library/test.rst:478 msgid "Return :const:`_testcapi.WITH_PYMALLOC`." -msgstr "" +msgstr "回傳 :const:`_testcapi.WITH_PYMALLOC`。" -#: ../../library/test.rst:480 +#: ../../library/test.rst:483 msgid "" "Raise :exc:`ResourceDenied` if *resource* is not available. *msg* is the " "argument to :exc:`ResourceDenied` if it is raised. Always returns ``True`` " @@ -540,89 +536,89 @@ msgid "" "tests are executed by :mod:`test.regrtest`." msgstr "" -#: ../../library/test.rst:488 +#: ../../library/test.rst:491 msgid "Return a repr of *dict* with keys sorted." msgstr "" -#: ../../library/test.rst:493 +#: ../../library/test.rst:496 msgid "" "Return the path to the file named *filename*. If no match is found " "*filename* is returned. This does not equal a failure since it could be the " "path to the file." msgstr "" -#: ../../library/test.rst:497 +#: ../../library/test.rst:500 msgid "" "Setting *subdir* indicates a relative path to use to find the file rather " "than looking directly in the path directories." msgstr "" -#: ../../library/test.rst:503 +#: ../../library/test.rst:506 msgid "Get size of a page in bytes." msgstr "" -#: ../../library/test.rst:510 +#: ../../library/test.rst:513 msgid "" "Set the :func:`sys.setswitchinterval` to the given *interval*. Defines a " "minimum interval for Android systems to prevent the system from hanging." msgstr "" -#: ../../library/test.rst:516 +#: ../../library/test.rst:519 msgid "" "Use this check to guard CPython's implementation-specific tests or to run " "them only on the implementations guarded by the arguments. This function " "returns ``True`` or ``False`` depending on the host platform. Example usage::" msgstr "" -#: ../../library/test.rst:528 +#: ../../library/test.rst:531 msgid "" "Set the values for :data:`max_memuse` and :data:`real_max_memuse` for big " "memory tests." msgstr "" -#: ../../library/test.rst:534 +#: ../../library/test.rst:537 msgid "" "Store the value from *stdout*. It is meant to hold the stdout at the time " "the regrtest began." msgstr "" -#: ../../library/test.rst:540 +#: ../../library/test.rst:543 msgid "" "Return the original stdout set by :func:`record_original_stdout` or ``sys." "stdout`` if it's not set." msgstr "" -#: ../../library/test.rst:546 +#: ../../library/test.rst:549 msgid "" "Return a list of command line arguments reproducing the current settings in " "``sys.flags`` and ``sys.warnoptions``." msgstr "" -#: ../../library/test.rst:552 +#: ../../library/test.rst:555 msgid "" "Return a list of command line arguments reproducing the current optimization " "settings in ``sys.flags``." msgstr "" -#: ../../library/test.rst:560 +#: ../../library/test.rst:563 msgid "" "A context managers that temporarily replaces the named stream with :class:" "`io.StringIO` object." msgstr "" -#: ../../library/test.rst:563 +#: ../../library/test.rst:566 msgid "Example use with output streams::" -msgstr "" +msgstr "使用輸出串流的範例: ::" -#: ../../library/test.rst:571 +#: ../../library/test.rst:574 msgid "Example use with input stream::" -msgstr "" +msgstr "使用輸入串流的範例: ::" -#: ../../library/test.rst:583 +#: ../../library/test.rst:586 msgid "A context manager that temporary disables :mod:`faulthandler`." msgstr "" -#: ../../library/test.rst:588 +#: ../../library/test.rst:591 msgid "" "Force as many objects as possible to be collected. This is needed because " "timely deallocation is not guaranteed by the garbage collector. This means " @@ -630,115 +626,112 @@ msgid "" "remain alive for longer than expected." msgstr "" -#: ../../library/test.rst:596 +#: ../../library/test.rst:599 msgid "" "A context manager that disables the garbage collector on entry. On exit, the " "garbage collector is restored to its prior state." msgstr "" -#: ../../library/test.rst:602 +#: ../../library/test.rst:605 msgid "Context manager to swap out an attribute with a new object." msgstr "" -#: ../../library/test.rst:604 ../../library/test.rst:622 -#: ../../library/test.rst:857 ../../library/test.rst:1323 +#: ../../library/test.rst:607 ../../library/test.rst:625 +#: ../../library/test.rst:860 ../../library/test.rst:1326 msgid "Usage::" -msgstr "" -"用法:\n" -"\n" -"::" +msgstr "用法: ::" -#: ../../library/test.rst:609 +#: ../../library/test.rst:612 msgid "" "This will set ``obj.attr`` to 5 for the duration of the ``with`` block, " "restoring the old value at the end of the block. If ``attr`` doesn't exist " "on ``obj``, it will be created and then deleted at the end of the block." msgstr "" -#: ../../library/test.rst:614 ../../library/test.rst:632 +#: ../../library/test.rst:617 ../../library/test.rst:635 msgid "" "The old value (or ``None`` if it doesn't exist) will be assigned to the " "target of the \"as\" clause, if there is one." msgstr "" -#: ../../library/test.rst:620 +#: ../../library/test.rst:623 msgid "Context manager to swap out an item with a new object." msgstr "" -#: ../../library/test.rst:627 +#: ../../library/test.rst:630 msgid "" "This will set ``obj[\"item\"]`` to 5 for the duration of the ``with`` block, " "restoring the old value at the end of the block. If ``item`` doesn't exist " "on ``obj``, it will be created and then deleted at the end of the block." msgstr "" -#: ../../library/test.rst:638 +#: ../../library/test.rst:641 msgid "" "Call the ``flush()`` method on :data:`sys.stdout` and then on :data:`sys." "stderr`. It can be used to make sure that the logs order is consistent " "before writing into stderr." msgstr "" -#: ../../library/test.rst:647 +#: ../../library/test.rst:650 msgid "" "Print a warning into :data:`sys.__stderr__`. Format the message as: " "``f\"Warning -- {msg}\"``. If *msg* is made of multiple lines, add " "``\"Warning -- \"`` prefix to each line." msgstr "" -#: ../../library/test.rst:656 +#: ../../library/test.rst:659 msgid "" "Wait until process *pid* completes and check that the process exit code is " "*exitcode*." msgstr "" -#: ../../library/test.rst:659 +#: ../../library/test.rst:662 msgid "" "Raise an :exc:`AssertionError` if the process exit code is not equal to " "*exitcode*." -msgstr "" +msgstr "如果行程退出代號不等於 *exitcode* 則引發 :exc:`AssertionError`。" -#: ../../library/test.rst:662 +#: ../../library/test.rst:665 msgid "" "If the process runs longer than *timeout* seconds (:data:`SHORT_TIMEOUT` by " "default), kill the process and raise an :exc:`AssertionError`. The timeout " "feature is not available on Windows." msgstr "" -#: ../../library/test.rst:671 +#: ../../library/test.rst:674 msgid "" "Return the size of the :c:type:`PyObject` whose structure members are " "defined by *fmt*. The returned value includes the size of the Python object " "header and alignment." msgstr "" -#: ../../library/test.rst:677 +#: ../../library/test.rst:680 msgid "" "Return the size of the :c:type:`PyVarObject` whose structure members are " "defined by *fmt*. The returned value includes the size of the Python object " "header and alignment." msgstr "" -#: ../../library/test.rst:683 +#: ../../library/test.rst:686 msgid "" "For testcase *test*, assert that the ``sys.getsizeof`` for *o* plus the GC " "header size equals *size*." msgstr "" -#: ../../library/test.rst:689 +#: ../../library/test.rst:692 msgid "" "A decorator to conditionally mark tests with :func:`unittest." "expectedFailure`. Any use of this decorator should have an associated " "comment identifying the relevant tracker issue." msgstr "" -#: ../../library/test.rst:696 +#: ../../library/test.rst:699 msgid "" "A decorator that skips the decorated test on TLS certification validation " "failures." msgstr "" -#: ../../library/test.rst:701 +#: ../../library/test.rst:704 msgid "" "A decorator for running a function in a different locale, correctly " "resetting it after it has finished. *catstr* is the locale category as a " @@ -746,79 +739,79 @@ msgid "" "sequentially, and the first valid locale will be used." msgstr "" -#: ../../library/test.rst:709 +#: ../../library/test.rst:712 msgid "" "A decorator for running a function in a specific timezone, correctly " "resetting it after it has finished." msgstr "" -#: ../../library/test.rst:715 +#: ../../library/test.rst:718 msgid "" "Decorator for the minimum version when running test on FreeBSD. If the " "FreeBSD version is less than the minimum, the test is skipped." msgstr "" -#: ../../library/test.rst:721 +#: ../../library/test.rst:724 msgid "" "Decorator for the minimum version when running test on Linux. If the Linux " "version is less than the minimum, the test is skipped." msgstr "" -#: ../../library/test.rst:727 +#: ../../library/test.rst:730 msgid "" "Decorator for the minimum version when running test on macOS. If the macOS " "version is less than the minimum, the test is skipped." msgstr "" -#: ../../library/test.rst:733 +#: ../../library/test.rst:736 msgid "Decorator for skipping tests on non-IEEE 754 platforms." msgstr "" -#: ../../library/test.rst:738 +#: ../../library/test.rst:741 msgid "Decorator for skipping tests if :mod:`zlib` doesn't exist." -msgstr "" +msgstr "如果 :mod:`zlib` 不存在則跳過測試的裝飾器。" -#: ../../library/test.rst:743 +#: ../../library/test.rst:746 msgid "Decorator for skipping tests if :mod:`gzip` doesn't exist." -msgstr "" +msgstr "如果 :mod:`gzip` 不存在則跳過測試的裝飾器。" -#: ../../library/test.rst:748 +#: ../../library/test.rst:751 msgid "Decorator for skipping tests if :mod:`bz2` doesn't exist." -msgstr "" +msgstr "如果 :mod:`bz2` 不存在則跳過測試的裝飾器。" -#: ../../library/test.rst:753 +#: ../../library/test.rst:756 msgid "Decorator for skipping tests if :mod:`lzma` doesn't exist." -msgstr "" +msgstr "如果 :mod:`lzma` 不存在則跳過測試的裝飾器。" -#: ../../library/test.rst:758 +#: ../../library/test.rst:761 msgid "Decorator for skipping tests if *resource* is not available." -msgstr "" +msgstr "如果 *resource* 不可用則跳過測試的裝飾器。" -#: ../../library/test.rst:763 +#: ../../library/test.rst:766 msgid "Decorator for only running the test if :data:`HAVE_DOCSTRINGS`." msgstr "" -#: ../../library/test.rst:768 +#: ../../library/test.rst:771 msgid "" "Decorator for only running the test if :ref:`Limited C API ` " "is available." msgstr "" -#: ../../library/test.rst:774 +#: ../../library/test.rst:777 msgid "Decorator for tests only applicable to CPython." msgstr "" -#: ../../library/test.rst:779 +#: ../../library/test.rst:782 msgid "" "Decorator for invoking :func:`check_impl_detail` on *guards*. If that " "returns ``False``, then uses *msg* as the reason for skipping the test." msgstr "" -#: ../../library/test.rst:785 +#: ../../library/test.rst:788 msgid "Decorator to temporarily turn off tracing for the duration of the test." msgstr "" -#: ../../library/test.rst:790 +#: ../../library/test.rst:793 msgid "" "Decorator for tests which involve reference counting. The decorator does " "not run the test if it is not run by CPython. Any trace function is unset " @@ -826,11 +819,11 @@ msgid "" "trace function." msgstr "" -#: ../../library/test.rst:798 +#: ../../library/test.rst:801 msgid "Decorator for bigmem tests." -msgstr "" +msgstr "大記憶體測試的裝飾器。" -#: ../../library/test.rst:800 +#: ../../library/test.rst:803 msgid "" "*size* is a requested size for the test (in arbitrary, test-interpreted " "units.) *memuse* is the number of bytes per unit for the test, or a good " @@ -838,7 +831,7 @@ msgid "" "each, could be decorated with ``@bigmemtest(size=_4G, memuse=2)``." msgstr "" -#: ../../library/test.rst:805 +#: ../../library/test.rst:808 msgid "" "The *size* argument is normally passed to the decorated test method as an " "extra argument. If *dry_run* is ``True``, the value passed to the test " @@ -846,11 +839,11 @@ msgid "" "means the test doesn't support dummy runs when ``-M`` is not specified." msgstr "" -#: ../../library/test.rst:813 +#: ../../library/test.rst:816 msgid "Decorator for tests that fill the address space." msgstr "" -#: ../../library/test.rst:818 +#: ../../library/test.rst:821 msgid "" "Test for syntax errors in *statement* by attempting to compile *statement*. " "*testcase* is the :mod:`unittest` instance for the test. *errtext* is the " @@ -860,44 +853,44 @@ msgid "" "of the exception." msgstr "" -#: ../../library/test.rst:828 +#: ../../library/test.rst:831 msgid "Open *url*. If open fails, raises :exc:`TestFailed`." msgstr "" -#: ../../library/test.rst:833 +#: ../../library/test.rst:836 msgid "" "Use this at the end of ``test_main`` whenever sub-processes are started. " "This will help ensure that no extra children (zombies) stick around to hog " "resources and create problems when looking for refleaks." msgstr "" -#: ../../library/test.rst:840 +#: ../../library/test.rst:843 msgid "" "Get an attribute, raising :exc:`unittest.SkipTest` if :exc:`AttributeError` " "is raised." msgstr "" -#: ../../library/test.rst:846 +#: ../../library/test.rst:849 msgid "" "Context manager catching unraisable exception using :func:`sys." "unraisablehook`." msgstr "" -#: ../../library/test.rst:849 +#: ../../library/test.rst:852 msgid "" "Storing the exception value (``cm.unraisable.exc_value``) creates a " "reference cycle. The reference cycle is broken explicitly when the context " "manager exits." msgstr "" -#: ../../library/test.rst:853 +#: ../../library/test.rst:856 msgid "" "Storing the object (``cm.unraisable.object``) can resurrect it if it is set " "to an object which is being finalized. Exiting the context manager clears " "the stored object." msgstr "" -#: ../../library/test.rst:874 +#: ../../library/test.rst:877 msgid "" "Generic implementation of the :mod:`unittest` ``load_tests`` protocol for " "use in test packages. *pkg_dir* is the root directory of the package; " @@ -906,55 +899,57 @@ msgid "" "the following::" msgstr "" -#: ../../library/test.rst:889 +#: ../../library/test.rst:892 msgid "" "Returns the set of attributes, functions or methods of *ref_api* not found " "on *other_api*, except for a defined list of items to be ignored in this " "check specified in *ignore*." msgstr "" -#: ../../library/test.rst:893 +#: ../../library/test.rst:896 msgid "" "By default this skips private attributes beginning with '_' but includes all " "magic methods, i.e. those starting and ending in '__'." msgstr "" +"這預設會跳過以 '_' 開頭的私有屬性,但會包含所有魔術方法,即以 '__' 開頭和結尾" +"的方法。" -#: ../../library/test.rst:901 +#: ../../library/test.rst:904 msgid "" "Override *object_to_patch.attr_name* with *new_value*. Also add cleanup " "procedure to *test_instance* to restore *object_to_patch* for *attr_name*. " "The *attr_name* should be a valid attribute for *object_to_patch*." msgstr "" -#: ../../library/test.rst:909 +#: ../../library/test.rst:912 msgid "" "Run *code* in subinterpreter. Raise :exc:`unittest.SkipTest` if :mod:" "`tracemalloc` is enabled." msgstr "" -#: ../../library/test.rst:915 +#: ../../library/test.rst:918 msgid "Assert instances of *cls* are deallocated after iterating." msgstr "" -#: ../../library/test.rst:920 +#: ../../library/test.rst:923 msgid "" "Check for the existence of the compiler executables whose names are listed " "in *cmd_names* or all the compiler executables when *cmd_names* is empty and " "return the first missing executable or ``None`` when none is found missing." msgstr "" -#: ../../library/test.rst:928 +#: ../../library/test.rst:931 msgid "" "Assert that the ``__all__`` variable of *module* contains all public names." msgstr "" -#: ../../library/test.rst:930 +#: ../../library/test.rst:933 msgid "" "The module's public names (its API) are detected automatically based on " "whether they match the public name convention and were defined in *module*." msgstr "" -#: ../../library/test.rst:934 +#: ../../library/test.rst:937 msgid "" "The *name_of_module* argument can specify (as a string or tuple thereof) " "what module(s) an API could be defined in order to be detected as a public " @@ -962,7 +957,7 @@ msgid "" "other modules, possibly a C backend (like ``csv`` and its ``_csv``)." msgstr "" -#: ../../library/test.rst:939 +#: ../../library/test.rst:942 msgid "" "The *extra* argument can be a set of names that wouldn't otherwise be " "automatically detected as \"public\", like objects without a proper " @@ -970,31 +965,28 @@ msgid "" "detected ones." msgstr "" -#: ../../library/test.rst:943 +#: ../../library/test.rst:946 msgid "" "The *not_exported* argument can be a set of names that must not be treated " "as part of the public API even though their names indicate otherwise." msgstr "" -#: ../../library/test.rst:946 ../../library/test.rst:1572 +#: ../../library/test.rst:949 ../../library/test.rst:1575 msgid "Example use::" -msgstr "" -"用法範例:\n" -"\n" -"::" +msgstr "用法範例: ::" -#: ../../library/test.rst:969 +#: ../../library/test.rst:972 msgid "" "Skip tests if the :mod:`multiprocessing.synchronize` module is missing, if " "there is no available semaphore implementation, or if creating a lock raises " "an :exc:`OSError`." msgstr "" -#: ../../library/test.rst:978 +#: ../../library/test.rst:981 msgid "Assert that type *tp* cannot be instantiated using *args* and *kwds*." msgstr "" -#: ../../library/test.rst:985 +#: ../../library/test.rst:988 msgid "" "This function returns a context manager that will change the global :func:" "`sys.set_int_max_str_digits` setting for the duration of the context to " @@ -1002,73 +994,73 @@ msgid "" "digits when converting between an integer and string." msgstr "" -#: ../../library/test.rst:993 +#: ../../library/test.rst:996 msgid "The :mod:`test.support` module defines the following classes:" -msgstr "" +msgstr ":mod:`test.support` 模組定義了以下類別:" -#: ../../library/test.rst:998 +#: ../../library/test.rst:1001 msgid "" "A context manager used to try to prevent crash dialog popups on tests that " "are expected to crash a subprocess." msgstr "" -#: ../../library/test.rst:1001 +#: ../../library/test.rst:1004 msgid "" "On Windows, it disables Windows Error Reporting dialogs using `SetErrorMode " "`_." msgstr "" -#: ../../library/test.rst:1004 +#: ../../library/test.rst:1007 msgid "" "On UNIX, :func:`resource.setrlimit` is used to set :const:`resource." "RLIMIT_CORE`'s soft limit to 0 to prevent coredump file creation." msgstr "" -#: ../../library/test.rst:1008 +#: ../../library/test.rst:1011 msgid "" "On both platforms, the old value is restored by :meth:`~object.__exit__`." -msgstr "" +msgstr "在兩個平台上,舊值會被 :meth:`~object.__exit__` 還原。" -#: ../../library/test.rst:1013 +#: ../../library/test.rst:1016 msgid "" "Class to save and restore signal handlers registered by the Python signal " "handler." msgstr "" -#: ../../library/test.rst:1018 +#: ../../library/test.rst:1021 msgid "" "Save the signal handlers to a dictionary mapping signal numbers to the " "current signal handler." msgstr "" -#: ../../library/test.rst:1023 +#: ../../library/test.rst:1026 msgid "" "Set the signal numbers from the :meth:`save` dictionary to the saved handler." msgstr "" -#: ../../library/test.rst:1031 +#: ../../library/test.rst:1034 msgid "Try to match a single dict with the supplied arguments." msgstr "" -#: ../../library/test.rst:1036 +#: ../../library/test.rst:1039 msgid "Try to match a single stored value (*dv*) with a supplied value (*v*)." msgstr "" -#: ../../library/test.rst:1040 +#: ../../library/test.rst:1043 msgid ":mod:`test.support.socket_helper` --- Utilities for socket tests" -msgstr "" +msgstr ":mod:`test.support.socket_helper` --- 用於 socket 測試的工具" -#: ../../library/test.rst:1046 +#: ../../library/test.rst:1049 msgid "" "The :mod:`test.support.socket_helper` module provides support for socket " "tests." msgstr "" -#: ../../library/test.rst:1053 +#: ../../library/test.rst:1056 msgid "Set to ``True`` if IPv6 is enabled on this host, ``False`` otherwise." msgstr "" -#: ../../library/test.rst:1058 +#: ../../library/test.rst:1061 msgid "" "Returns an unused port that should be suitable for binding. This is " "achieved by creating a temporary socket with the same family and type as the " @@ -1079,7 +1071,7 @@ msgid "" "port is returned." msgstr "" -#: ../../library/test.rst:1067 +#: ../../library/test.rst:1070 msgid "" "Either this method or :func:`bind_port` should be used for any tests where a " "server socket needs to be bound to a particular port for the duration of the " @@ -1092,7 +1084,7 @@ msgid "" "simultaneously, which is a problem for buildbots." msgstr "" -#: ../../library/test.rst:1081 +#: ../../library/test.rst:1084 msgid "" "Bind the socket to a free port and return the port number. Relies on " "ephemeral ports in order to ensure we are using an unbound port. This is " @@ -1105,7 +1097,7 @@ msgid "" "testing multicasting via multiple UDP sockets." msgstr "" -#: ../../library/test.rst:1092 +#: ../../library/test.rst:1095 msgid "" "Additionally, if the :const:`~socket.SO_EXCLUSIVEADDRUSE` socket option is " "available (i.e. on Windows), it will be set on the socket. This will " @@ -1113,58 +1105,59 @@ msgid "" "test." msgstr "" -#: ../../library/test.rst:1100 +#: ../../library/test.rst:1103 msgid "" "Bind a Unix socket, raising :exc:`unittest.SkipTest` if :exc:" "`PermissionError` is raised." msgstr "" -#: ../../library/test.rst:1106 +#: ../../library/test.rst:1109 msgid "" "A decorator for running tests that require a functional ``bind()`` for Unix " "sockets." msgstr "" -#: ../../library/test.rst:1112 +#: ../../library/test.rst:1115 msgid "" "A context manager that raises :exc:`~test.support.ResourceDenied` when " "various issues with the internet connection manifest themselves as " "exceptions." msgstr "" -#: ../../library/test.rst:1118 +#: ../../library/test.rst:1121 msgid "" ":mod:`test.support.script_helper` --- Utilities for the Python execution " "tests" -msgstr "" +msgstr ":mod:`test.support.script_helper` --- 用於 Python 執行測試的工具" -#: ../../library/test.rst:1124 +#: ../../library/test.rst:1127 msgid "" "The :mod:`test.support.script_helper` module provides support for Python's " "script execution tests." msgstr "" +":mod:`test.support.script_helper` 模組提供 Python 的腳本執行測試的支援。" -#: ../../library/test.rst:1129 +#: ../../library/test.rst:1132 msgid "" "Return ``True`` if ``sys.executable interpreter`` requires environment " "variables in order to be able to run at all." msgstr "" -#: ../../library/test.rst:1132 +#: ../../library/test.rst:1135 msgid "" "This is designed to be used with ``@unittest.skipIf()`` to annotate tests " "that need to use an ``assert_python*()`` function to launch an isolated mode " "(``-I``) or no environment mode (``-E``) sub-interpreter process." msgstr "" -#: ../../library/test.rst:1136 +#: ../../library/test.rst:1139 msgid "" "A normal build & test does not run into this situation but it can happen " "when trying to run the standard library test suite from an interpreter that " "doesn't have an obvious home with Python's current home finding logic." msgstr "" -#: ../../library/test.rst:1140 +#: ../../library/test.rst:1143 msgid "" "Setting :envvar:`PYTHONHOME` is one way to get most of the testsuite to run " "in that situation. :envvar:`PYTHONPATH` or :envvar:`PYTHONUSERSITE` are " @@ -1172,85 +1165,85 @@ msgid "" "interpreter can start." msgstr "" -#: ../../library/test.rst:1148 +#: ../../library/test.rst:1151 msgid "" "Set up the environment based on *env_vars* for running the interpreter in a " "subprocess. The values can include ``__isolated``, ``__cleanenv``, " "``__cwd``, and ``TERM``." msgstr "" -#: ../../library/test.rst:1152 ../../library/test.rst:1168 -#: ../../library/test.rst:1180 +#: ../../library/test.rst:1155 ../../library/test.rst:1171 +#: ../../library/test.rst:1183 msgid "The function no longer strips whitespaces from *stderr*." -msgstr "" +msgstr "此函式不再從 *stderr* 中移除空白。" -#: ../../library/test.rst:1158 +#: ../../library/test.rst:1161 msgid "" "Assert that running the interpreter with *args* and optional environment " "variables *env_vars* succeeds (``rc == 0``) and return a ``(return code, " "stdout, stderr)`` tuple." msgstr "" -#: ../../library/test.rst:1162 +#: ../../library/test.rst:1165 msgid "" "If the *__cleanenv* keyword-only parameter is set, *env_vars* is used as a " "fresh environment." msgstr "" -#: ../../library/test.rst:1165 +#: ../../library/test.rst:1168 msgid "" "Python is started in isolated mode (command line option ``-I``), except if " "the *__isolated* keyword-only parameter is set to ``False``." msgstr "" -#: ../../library/test.rst:1174 +#: ../../library/test.rst:1177 msgid "" "Assert that running the interpreter with *args* and optional environment " "variables *env_vars* fails (``rc != 0``) and return a ``(return code, " "stdout, stderr)`` tuple." msgstr "" -#: ../../library/test.rst:1178 +#: ../../library/test.rst:1181 msgid "See :func:`assert_python_ok` for more options." -msgstr "更多選項請見 :func:`assert_python_ok`\\ 。" +msgstr "更多選項請見 :func:`assert_python_ok`。" -#: ../../library/test.rst:1186 +#: ../../library/test.rst:1189 msgid "Run a Python subprocess with the given arguments." msgstr "" -#: ../../library/test.rst:1188 +#: ../../library/test.rst:1191 msgid "" "*kw* is extra keyword args to pass to :func:`subprocess.Popen`. Returns a :" "class:`subprocess.Popen` object." msgstr "" -#: ../../library/test.rst:1194 +#: ../../library/test.rst:1197 msgid "" "Run the given :class:`subprocess.Popen` process until completion and return " "stdout." msgstr "" -#: ../../library/test.rst:1200 +#: ../../library/test.rst:1203 msgid "" "Create script containing *source* in path *script_dir* and " "*script_basename*. If *omit_suffix* is ``False``, append ``.py`` to the " "name. Return the full script path." msgstr "" -#: ../../library/test.rst:1207 +#: ../../library/test.rst:1210 msgid "" "Create zip file at *zip_dir* and *zip_basename* with extension ``zip`` which " "contains the files in *script_name*. *name_in_zip* is the archive name. " "Return a tuple containing ``(full path, full path of archive name)``." msgstr "" -#: ../../library/test.rst:1214 +#: ../../library/test.rst:1217 msgid "" "Create a directory named *pkg_dir* containing an ``__init__`` file with " "*init_source* as its contents." msgstr "" -#: ../../library/test.rst:1221 +#: ../../library/test.rst:1224 msgid "" "Create a zip package directory with a path of *zip_dir* and *zip_basename* " "containing an empty ``__init__`` file and a file *script_basename* " @@ -1259,60 +1252,62 @@ msgid "" "path and the archive name for the zip file." msgstr "" -#: ../../library/test.rst:1229 +#: ../../library/test.rst:1232 msgid "" ":mod:`test.support.bytecode_helper` --- Support tools for testing correct " "bytecode generation" msgstr "" +":mod:`test.support.bytecode_helper` --- 用於測試位元組碼能正確產生的支援工具" -#: ../../library/test.rst:1234 +#: ../../library/test.rst:1237 msgid "" "The :mod:`test.support.bytecode_helper` module provides support for testing " "and inspecting bytecode generation." msgstr "" +":mod:`test.support.bytecode_helper` 模組提供測試和檢查位元組碼產生的支援。" -#: ../../library/test.rst:1239 +#: ../../library/test.rst:1242 msgid "The module defines the following class:" -msgstr "" +msgstr "此模組定義了以下類別:" -#: ../../library/test.rst:1243 +#: ../../library/test.rst:1246 msgid "This class has custom assertion methods for inspecting bytecode." msgstr "" -#: ../../library/test.rst:1247 +#: ../../library/test.rst:1250 msgid "Return the disassembly of *co* as string." msgstr "" -#: ../../library/test.rst:1252 +#: ../../library/test.rst:1255 msgid "" "Return instr if *opname* is found, otherwise throws :exc:`AssertionError`." msgstr "" -#: ../../library/test.rst:1257 +#: ../../library/test.rst:1260 msgid "Throws :exc:`AssertionError` if *opname* is found." msgstr "" -#: ../../library/test.rst:1261 +#: ../../library/test.rst:1264 msgid ":mod:`test.support.threading_helper` --- Utilities for threading tests" msgstr "" -#: ../../library/test.rst:1266 +#: ../../library/test.rst:1269 msgid "" "The :mod:`test.support.threading_helper` module provides support for " "threading tests." msgstr "" -#: ../../library/test.rst:1273 +#: ../../library/test.rst:1276 msgid "" "Join a *thread* within *timeout*. Raise an :exc:`AssertionError` if thread " "is still alive after *timeout* seconds." msgstr "" -#: ../../library/test.rst:1279 +#: ../../library/test.rst:1282 msgid "Decorator to ensure the threads are cleaned up even if the test fails." msgstr "" -#: ../../library/test.rst:1284 +#: ../../library/test.rst:1287 msgid "" "Context manager to start *threads*, which is a sequence of threads. *unlock* " "is a function called after the threads are started, even if an exception was " @@ -1320,79 +1315,79 @@ msgid "" "will attempt to join the started threads upon exit." msgstr "" -#: ../../library/test.rst:1292 +#: ../../library/test.rst:1295 msgid "" "Cleanup up threads not specified in *original_values*. Designed to emit a " "warning if a test leaves running threads in the background." msgstr "" -#: ../../library/test.rst:1298 +#: ../../library/test.rst:1301 msgid "Return current thread count and copy of dangling threads." msgstr "" -#: ../../library/test.rst:1303 +#: ../../library/test.rst:1306 msgid "" "Context manager to wait until all threads created in the ``with`` statement " "exit." msgstr "" -#: ../../library/test.rst:1309 +#: ../../library/test.rst:1312 msgid "" "Context manager catching :class:`threading.Thread` exception using :func:" "`threading.excepthook`." msgstr "" -#: ../../library/test.rst:1312 +#: ../../library/test.rst:1315 msgid "Attributes set when an exception is caught:" -msgstr "" +msgstr "當捕捉到例外時會設定的屬性:" -#: ../../library/test.rst:1314 +#: ../../library/test.rst:1317 msgid "``exc_type``" msgstr "``exc_type``" -#: ../../library/test.rst:1315 +#: ../../library/test.rst:1318 msgid "``exc_value``" msgstr "``exc_value``" -#: ../../library/test.rst:1316 +#: ../../library/test.rst:1319 msgid "``exc_traceback``" msgstr "``exc_traceback``" -#: ../../library/test.rst:1317 +#: ../../library/test.rst:1320 msgid "``thread``" msgstr "``thread``" -#: ../../library/test.rst:1319 +#: ../../library/test.rst:1322 msgid "See :func:`threading.excepthook` documentation." msgstr "參閱 :func:`threading.excepthook` 文件。" -#: ../../library/test.rst:1321 +#: ../../library/test.rst:1324 msgid "These attributes are deleted at the context manager exit." -msgstr "" +msgstr "這些屬性會在離開情境管理器時被刪除。" -#: ../../library/test.rst:1341 +#: ../../library/test.rst:1344 msgid ":mod:`test.support.os_helper` --- Utilities for os tests" -msgstr "" +msgstr ":mod:`test.support.os_helper` --- 用於 os 測試的工具" -#: ../../library/test.rst:1346 +#: ../../library/test.rst:1349 msgid "The :mod:`test.support.os_helper` module provides support for os tests." -msgstr "" +msgstr ":mod:`test.support.os_helper` 模組提供 os 測試的支援。" -#: ../../library/test.rst:1353 +#: ../../library/test.rst:1356 msgid "A non-ASCII character encodable by :func:`os.fsencode`." msgstr "" -#: ../../library/test.rst:1358 +#: ../../library/test.rst:1361 msgid "Set to :func:`os.getcwd`." -msgstr "" +msgstr "設定為 :func:`os.getcwd`。" -#: ../../library/test.rst:1363 +#: ../../library/test.rst:1366 msgid "" "Set to a name that is safe to use as the name of a temporary file. Any " "temporary file that is created should be closed and unlinked (removed)." msgstr "" -#: ../../library/test.rst:1369 +#: ../../library/test.rst:1372 msgid "" "Set to a filename containing the :data:`FS_NONASCII` character, if it " "exists. This guarantees that if the filename exists, it can be encoded and " @@ -1400,25 +1395,25 @@ msgid "" "a non-ASCII filename to be easily skipped on platforms where they can't work." msgstr "" -#: ../../library/test.rst:1377 +#: ../../library/test.rst:1380 msgid "" "Set to a filename (str type) that should not be able to be encoded by file " "system encoding in strict mode. It may be ``None`` if it's not possible to " "generate such a filename." msgstr "" -#: ../../library/test.rst:1384 +#: ../../library/test.rst:1387 msgid "" "Set to a filename (bytes type) that should not be able to be decoded by file " "system encoding in strict mode. It may be ``None`` if it's not possible to " "generate such a filename." msgstr "" -#: ../../library/test.rst:1391 +#: ../../library/test.rst:1394 msgid "Set to a non-ASCII name for a temporary file." msgstr "" -#: ../../library/test.rst:1396 +#: ../../library/test.rst:1399 msgid "" "Class used to temporarily set or unset environment variables. Instances can " "be used as a context manager and have a complete dictionary interface for " @@ -1427,75 +1422,75 @@ msgid "" "instance will be rolled back." msgstr "" -#: ../../library/test.rst:1402 +#: ../../library/test.rst:1405 msgid "Added dictionary interface." msgstr "新增字典介面。" -#: ../../library/test.rst:1408 +#: ../../library/test.rst:1411 msgid "" "Simple :term:`path-like object`. It implements the :meth:`__fspath__` " "method which just returns the *path* argument. If *path* is an exception, " "it will be raised in :meth:`!__fspath__`." msgstr "" -#: ../../library/test.rst:1415 +#: ../../library/test.rst:1418 msgid "" "Temporarily set the environment variable ``envvar`` to the value of " "``value``." msgstr "" -#: ../../library/test.rst:1421 +#: ../../library/test.rst:1424 msgid "Temporarily unset the environment variable ``envvar``." -msgstr "" +msgstr "暫時取消環境變數 ``envvar``。" -#: ../../library/test.rst:1426 +#: ../../library/test.rst:1429 msgid "Return ``True`` if the OS supports symbolic links, ``False`` otherwise." -msgstr "" +msgstr "如果作業系統支援符號連結則回傳 ``True``,否則回傳 ``False``。" -#: ../../library/test.rst:1432 +#: ../../library/test.rst:1435 msgid "Return ``True`` if the OS supports xattr, ``False`` otherwise." -msgstr "" +msgstr "如果作業系統支援 xattr 則回傳 ``True``,否則回傳 ``False``。" -#: ../../library/test.rst:1438 +#: ../../library/test.rst:1441 msgid "" "A context manager that temporarily changes the current working directory to " "*path* and yields the directory." msgstr "" -#: ../../library/test.rst:1441 +#: ../../library/test.rst:1444 msgid "" "If *quiet* is ``False``, the context manager raises an exception on error. " "Otherwise, it issues only a warning and keeps the current working directory " "the same." msgstr "" -#: ../../library/test.rst:1448 +#: ../../library/test.rst:1451 msgid "" "Create an empty file with *filename*. If it already exists, truncate it." msgstr "" -#: ../../library/test.rst:1453 +#: ../../library/test.rst:1456 msgid "Count the number of open file descriptors." msgstr "" -#: ../../library/test.rst:1458 +#: ../../library/test.rst:1461 msgid "Return ``True`` if the file system for *directory* is case-insensitive." msgstr "" -#: ../../library/test.rst:1463 +#: ../../library/test.rst:1466 msgid "" "Create an invalid file descriptor by opening and closing a temporary file, " "and returning its descriptor." msgstr "" -#: ../../library/test.rst:1469 +#: ../../library/test.rst:1472 msgid "" "Call :func:`os.rmdir` on *filename*. On Windows platforms, this is wrapped " "with a wait loop that checks for the existence of the file, which is needed " "due to antivirus programs that can hold files open and prevent deletion." msgstr "" -#: ../../library/test.rst:1477 +#: ../../library/test.rst:1480 msgid "" "Call :func:`shutil.rmtree` on *path* or call :func:`os.lstat` and :func:`os." "rmdir` to remove a path and its contents. As with :func:`rmdir`, on Windows " @@ -1503,21 +1498,21 @@ msgid "" "the files." msgstr "" -#: ../../library/test.rst:1485 +#: ../../library/test.rst:1488 msgid "A decorator for running tests that require support for symbolic links." msgstr "" -#: ../../library/test.rst:1490 +#: ../../library/test.rst:1493 msgid "A decorator for running tests that require support for xattr." msgstr "" -#: ../../library/test.rst:1495 +#: ../../library/test.rst:1498 msgid "" "A context manager that temporarily creates a new directory and changes the " "current working directory (CWD)." msgstr "" -#: ../../library/test.rst:1498 +#: ../../library/test.rst:1501 msgid "" "The context manager creates a temporary directory in the current directory " "with name *name* before temporarily changing the current working directory. " @@ -1525,20 +1520,20 @@ msgid "" "`tempfile.mkdtemp`." msgstr "" -#: ../../library/test.rst:1503 +#: ../../library/test.rst:1506 msgid "" "If *quiet* is ``False`` and it is not possible to create or change the CWD, " "an error is raised. Otherwise, only a warning is raised and the original " "CWD is used." msgstr "" -#: ../../library/test.rst:1510 +#: ../../library/test.rst:1513 msgid "" "A context manager that creates a temporary directory at *path* and yields " "the directory." msgstr "" -#: ../../library/test.rst:1513 +#: ../../library/test.rst:1516 msgid "" "If *path* is ``None``, the temporary directory is created using :func:" "`tempfile.mkdtemp`. If *quiet* is ``False``, the context manager raises an " @@ -1546,34 +1541,34 @@ msgid "" "created, only a warning is issued." msgstr "" -#: ../../library/test.rst:1521 +#: ../../library/test.rst:1524 msgid "A context manager that temporarily sets the process umask." msgstr "" -#: ../../library/test.rst:1526 +#: ../../library/test.rst:1529 msgid "" "Call :func:`os.unlink` on *filename*. As with :func:`rmdir`, on Windows " "platforms, this is wrapped with a wait loop that checks for the existence of " "the file." msgstr "" -#: ../../library/test.rst:1532 +#: ../../library/test.rst:1535 msgid ":mod:`test.support.import_helper` --- Utilities for import tests" -msgstr "" +msgstr ":mod:`test.support.import_helper` --- 用於 import 測試的工具" -#: ../../library/test.rst:1537 +#: ../../library/test.rst:1540 msgid "" "The :mod:`test.support.import_helper` module provides support for import " "tests." -msgstr "" +msgstr ":mod:`test.support.import_helper` 模組提供 import 測試的支援。" -#: ../../library/test.rst:1544 +#: ../../library/test.rst:1547 msgid "" "Remove the module named *module_name* from ``sys.modules`` and delete any " "byte-compiled files of the module." msgstr "" -#: ../../library/test.rst:1550 +#: ../../library/test.rst:1553 msgid "" "This function imports and returns a fresh copy of the named Python module by " "removing the named module from ``sys.modules`` before doing the import. Note " @@ -1581,46 +1576,46 @@ msgid "" "operation." msgstr "" -#: ../../library/test.rst:1555 +#: ../../library/test.rst:1558 msgid "" "*fresh* is an iterable of additional module names that are also removed from " "the ``sys.modules`` cache before doing the import." msgstr "" -#: ../../library/test.rst:1558 +#: ../../library/test.rst:1561 msgid "" "*blocked* is an iterable of module names that are replaced with ``None`` in " "the module cache during the import to ensure that attempts to import them " "raise :exc:`ImportError`." msgstr "" -#: ../../library/test.rst:1562 +#: ../../library/test.rst:1565 msgid "" "The named module and any modules named in the *fresh* and *blocked* " "parameters are saved before starting the import and then reinserted into " "``sys.modules`` when the fresh import is complete." msgstr "" -#: ../../library/test.rst:1566 +#: ../../library/test.rst:1569 msgid "" "Module and package deprecation messages are suppressed during this import if " "*deprecated* is ``True``." msgstr "" -#: ../../library/test.rst:1569 +#: ../../library/test.rst:1572 msgid "" "This function will raise :exc:`ImportError` if the named module cannot be " "imported." -msgstr "" +msgstr "如果無法引入指定的模組則此函式會引發 :exc:`ImportError`。" -#: ../../library/test.rst:1586 +#: ../../library/test.rst:1589 msgid "" "This function imports and returns the named module. Unlike a normal import, " "this function raises :exc:`unittest.SkipTest` if the module cannot be " "imported." msgstr "" -#: ../../library/test.rst:1590 +#: ../../library/test.rst:1593 msgid "" "Module and package deprecation messages are suppressed during this import if " "*deprecated* is ``True``. If a module is required on a platform but " @@ -1628,21 +1623,21 @@ msgid "" "which will be compared against :data:`sys.platform`." msgstr "" -#: ../../library/test.rst:1600 +#: ../../library/test.rst:1603 msgid "Return a copy of :data:`sys.modules`." -msgstr "" +msgstr "回傳 :data:`sys.modules` 的複本。" -#: ../../library/test.rst:1605 +#: ../../library/test.rst:1608 msgid "" "Remove modules except for *oldmodules* and ``encodings`` in order to " "preserve internal cache." msgstr "" -#: ../../library/test.rst:1611 +#: ../../library/test.rst:1614 msgid "Delete *name* from ``sys.modules``." -msgstr "" +msgstr "從 ``sys.modules`` 中刪除 *name*。" -#: ../../library/test.rst:1616 +#: ../../library/test.rst:1619 msgid "" "Move a :pep:`3147`/:pep:`488` pyc file to its legacy pyc location and return " "the file system path to the legacy pyc file. The *source* value is the file " @@ -1650,42 +1645,42 @@ msgid "" "3147/488 pyc file must exist." msgstr "" -#: ../../library/test.rst:1624 +#: ../../library/test.rst:1627 msgid "" "A context manager to force import to return a new module reference. This is " "useful for testing module-level behaviors, such as the emission of a :exc:" "`DeprecationWarning` on import. Example usage::" msgstr "" -#: ../../library/test.rst:1634 +#: ../../library/test.rst:1637 msgid "A context manager to temporarily add directories to :data:`sys.path`." msgstr "" -#: ../../library/test.rst:1636 +#: ../../library/test.rst:1639 msgid "" "This makes a copy of :data:`sys.path`, appends any directories given as " "positional arguments, then reverts :data:`sys.path` to the copied settings " "when the context ends." msgstr "" -#: ../../library/test.rst:1640 +#: ../../library/test.rst:1643 msgid "" "Note that *all* :data:`sys.path` modifications in the body of the context " "manager, including replacement of the object, will be reverted at the end of " "the block." msgstr "" -#: ../../library/test.rst:1646 +#: ../../library/test.rst:1649 msgid ":mod:`test.support.warnings_helper` --- Utilities for warnings tests" -msgstr "" +msgstr ":mod:`test.support.warnings_helper` --- 用於 warnings 測試的工具" -#: ../../library/test.rst:1651 +#: ../../library/test.rst:1654 msgid "" "The :mod:`test.support.warnings_helper` module provides support for warnings " "tests." -msgstr "" +msgstr ":mod:`test.support.warnings_helper` 模組提供 warnings 測試的支援。" -#: ../../library/test.rst:1658 +#: ../../library/test.rst:1661 msgid "" "Suppress warnings that are instances of *category*, which must be :exc:" "`Warning` or a subclass. Roughly equivalent to :func:`warnings." @@ -1693,14 +1688,14 @@ msgid "" "category=category) `. For example::" msgstr "" -#: ../../library/test.rst:1673 +#: ../../library/test.rst:1676 msgid "" "Context manager to check that no :exc:`ResourceWarning` was raised. You " "must remove the object which may emit :exc:`ResourceWarning` before the end " "of the context manager." msgstr "" -#: ../../library/test.rst:1680 +#: ../../library/test.rst:1683 msgid "" "Test for syntax warning in *statement* by attempting to compile *statement*. " "Test also that the :exc:`SyntaxWarning` is emitted only once, and that it " @@ -1712,7 +1707,7 @@ msgid "" "``None``, compares to the offset of the exception." msgstr "" -#: ../../library/test.rst:1694 +#: ../../library/test.rst:1697 msgid "" "A convenience wrapper for :func:`warnings.catch_warnings()` that makes it " "easier to test that a warning was correctly raised. It is approximately " @@ -1721,7 +1716,7 @@ msgid "" "automatically validate the results that are recorded." msgstr "" -#: ../../library/test.rst:1700 +#: ../../library/test.rst:1703 msgid "" "``check_warnings`` accepts 2-tuples of the form ``(\"message regexp\", " "WarningCategory)`` as positional arguments. If one or more *filters* are " @@ -1733,15 +1728,15 @@ msgid "" "*quiet* to ``True``." msgstr "" -#: ../../library/test.rst:1709 +#: ../../library/test.rst:1712 msgid "If no arguments are specified, it defaults to::" -msgstr "" +msgstr "如果沒有指定引數,預設為: ::" -#: ../../library/test.rst:1713 +#: ../../library/test.rst:1716 msgid "In this case all warnings are caught and no errors are raised." msgstr "" -#: ../../library/test.rst:1715 +#: ../../library/test.rst:1718 msgid "" "On entry to the context manager, a :class:`WarningRecorder` instance is " "returned. The underlying warnings list from :func:`~warnings.catch_warnings` " @@ -1753,39 +1748,39 @@ msgid "" "return ``None``." msgstr "" -#: ../../library/test.rst:1724 +#: ../../library/test.rst:1727 msgid "" "The recorder object also has a :meth:`reset` method, which clears the " "warnings list." msgstr "" -#: ../../library/test.rst:1727 +#: ../../library/test.rst:1730 msgid "The context manager is designed to be used like this::" msgstr "" -#: ../../library/test.rst:1734 +#: ../../library/test.rst:1737 msgid "" "In this case if either warning was not raised, or some other warning was " "raised, :func:`check_warnings` would raise an error." msgstr "" -#: ../../library/test.rst:1737 +#: ../../library/test.rst:1740 msgid "" "When a test needs to look more deeply into the warnings, rather than just " "checking whether or not they occurred, code like this can be used::" msgstr "" -#: ../../library/test.rst:1751 +#: ../../library/test.rst:1754 msgid "" "Here all warnings will be caught, and the test code tests the captured " "warnings directly." msgstr "" -#: ../../library/test.rst:1754 +#: ../../library/test.rst:1757 msgid "New optional arguments *filters* and *quiet*." -msgstr "" +msgstr "新的可選引數 *filters* 和 *quiet*。" -#: ../../library/test.rst:1760 +#: ../../library/test.rst:1763 msgid "" "Class used to record warnings for unit tests. See documentation of :func:" "`check_warnings` above for more details." diff --git a/library/text.po b/library/text.po index 3a51a505f5..d1455bb8d7 100644 --- a/library/text.po +++ b/library/text.po @@ -37,5 +37,5 @@ msgid "" "highly relevant to text processing. In addition, see the documentation for " "Python's built-in string type in :ref:`textseq`." msgstr "" -"在 :ref:`binaryservices` 下所描述的 :mod:`codecs` 模組也與文本處理高度相" -"關。另外也請參閱在 :ref:`textseq` 中所描述的 Python 內建字串型別。" +"在 :ref:`binaryservices` 下所描述的 :mod:`codecs` 模組也與文本處理高度相關。" +"另外也請參閱在 :ref:`textseq` 中所描述的 Python 內建字串型別。" diff --git a/library/tkinter.po b/library/tkinter.po index 8b8ad0bd3e..a9daa8c89d 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-29 12:27+0000\n" +"POT-Creation-Date: 2023-11-30 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -126,15 +126,15 @@ msgstr "由 Mark Roseman 所著。(ISBN 978-1999149567)" #: ../../library/tkinter.rst:62 msgid "" -"`Python and Tkinter Programming `_" +"`Python GUI programming with Tkinter `_" msgstr "" -"`Python and Tkinter Programming `_" +"`Python GUI programming with Tkinter `_" #: ../../library/tkinter.rst:62 -msgid "By Alan Moore. (ISBN 978-1788835886)" -msgstr "由 Alan Moore 所著。(ISBN 978-1788835886)" +msgid "By Alan D. Moore. (ISBN 978-1788835886)" +msgstr "由 Alan D. Moore 所著。(ISBN 978-1788835886)" #: ../../library/tkinter.rst:65 msgid "`Programming Python `_" @@ -190,7 +190,7 @@ msgid "" "difference (see `Threading model`_ for details)." msgstr "" -#: ../../library/tkinter.rst:97 ../../library/tkinter.rst:908 +#: ../../library/tkinter.rst:97 ../../library/tkinter.rst:911 msgid "Tk" msgstr "Tk" @@ -450,11 +450,11 @@ msgstr "" msgid "Additional modules:" msgstr "" -#: ../../library/tkinter.rst:240 +#: ../../library/tkinter.rst:243 msgid ":mod:`_tkinter`" msgstr ":mod:`_tkinter`" -#: ../../library/tkinter.rst:236 +#: ../../library/tkinter.rst:239 msgid "" "A binary module that contains the low-level interface to Tcl/Tk. It is " "automatically imported by the main :mod:`tkinter` module, and should never " @@ -463,60 +463,60 @@ msgid "" "interpreter." msgstr "" -#: ../../library/tkinter.rst:244 +#: ../../library/tkinter.rst:247 msgid ":mod:`idlelib`" msgstr ":mod:`idlelib`" -#: ../../library/tkinter.rst:243 +#: ../../library/tkinter.rst:246 msgid "" "Python's Integrated Development and Learning Environment (IDLE). Based on :" "mod:`tkinter`." msgstr "" -#: ../../library/tkinter.rst:249 +#: ../../library/tkinter.rst:252 msgid ":mod:`tkinter.constants`" msgstr ":mod:`tkinter.constants`" -#: ../../library/tkinter.rst:247 +#: ../../library/tkinter.rst:250 msgid "" "Symbolic constants that can be used in place of strings when passing various " "parameters to Tkinter calls. Automatically imported by the main :mod:" "`tkinter` module." msgstr "" -#: ../../library/tkinter.rst:253 +#: ../../library/tkinter.rst:256 msgid ":mod:`tkinter.dnd`" msgstr ":mod:`tkinter.dnd`" -#: ../../library/tkinter.rst:252 +#: ../../library/tkinter.rst:255 msgid "" "(experimental) Drag-and-drop support for :mod:`tkinter`. This will become " "deprecated when it is replaced with the Tk DND." msgstr "" -#: ../../library/tkinter.rst:257 +#: ../../library/tkinter.rst:260 msgid ":mod:`tkinter.tix`" msgstr ":mod:`tkinter.tix`" -#: ../../library/tkinter.rst:256 +#: ../../library/tkinter.rst:259 msgid "" "(deprecated) An older third-party Tcl/Tk package that adds several new " "widgets. Better alternatives for most can be found in :mod:`tkinter.ttk`." msgstr "" -#: ../../library/tkinter.rst:261 +#: ../../library/tkinter.rst:264 msgid ":mod:`turtle`" msgstr ":mod:`turtle`" -#: ../../library/tkinter.rst:260 +#: ../../library/tkinter.rst:263 msgid "Turtle graphics in a Tk window." msgstr "" -#: ../../library/tkinter.rst:264 +#: ../../library/tkinter.rst:267 msgid "Tkinter Life Preserver" msgstr "" -#: ../../library/tkinter.rst:266 +#: ../../library/tkinter.rst:269 msgid "" "This section is not designed to be an exhaustive tutorial on either Tk or " "Tkinter. For that, refer to one of the external resources noted earlier. " @@ -525,7 +525,7 @@ msgid "" "how the Tkinter wrapper is structured." msgstr "" -#: ../../library/tkinter.rst:272 +#: ../../library/tkinter.rst:275 msgid "" "The remainder of this section will help you to identify the classes, " "methods, and options you'll need in your Tkinter application, and where to " @@ -533,18 +533,18 @@ msgid "" "reference manual." msgstr "" -#: ../../library/tkinter.rst:279 +#: ../../library/tkinter.rst:282 msgid "A Hello World Program" msgstr "" -#: ../../library/tkinter.rst:281 +#: ../../library/tkinter.rst:284 msgid "" "We'll start by walking through a \"Hello World\" application in Tkinter. " "This isn't the smallest one we could write, but has enough to illustrate " "some key concepts you'll need to know." msgstr "" -#: ../../library/tkinter.rst:297 +#: ../../library/tkinter.rst:300 msgid "" "After the imports, the next line creates an instance of the :class:`Tk` " "class, which initializes Tk and creates its associated Tcl interpreter. It " @@ -552,56 +552,56 @@ msgid "" "the main window of the application." msgstr "" -#: ../../library/tkinter.rst:302 +#: ../../library/tkinter.rst:305 msgid "" "The following line creates a frame widget, which in this case will contain a " "label and a button we'll create next. The frame is fit inside the root " "window." msgstr "" -#: ../../library/tkinter.rst:306 +#: ../../library/tkinter.rst:309 msgid "" "The next line creates a label widget holding a static text string. The :meth:" "`grid` method is used to specify the relative layout (position) of the label " "within its containing frame widget, similar to how tables in HTML work." msgstr "" -#: ../../library/tkinter.rst:310 +#: ../../library/tkinter.rst:313 msgid "" "A button widget is then created, and placed to the right of the label. When " "pressed, it will call the :meth:`destroy` method of the root window." msgstr "" -#: ../../library/tkinter.rst:313 +#: ../../library/tkinter.rst:316 msgid "" "Finally, the :meth:`mainloop` method puts everything on the display, and " "responds to user input until the program terminates." msgstr "" -#: ../../library/tkinter.rst:319 +#: ../../library/tkinter.rst:322 msgid "Important Tk Concepts" msgstr "" -#: ../../library/tkinter.rst:321 +#: ../../library/tkinter.rst:324 msgid "Even this simple program illustrates the following key Tk concepts:" msgstr "" -#: ../../library/tkinter.rst:326 +#: ../../library/tkinter.rst:329 msgid "widgets" msgstr "" -#: ../../library/tkinter.rst:324 +#: ../../library/tkinter.rst:327 msgid "" "A Tkinter user interface is made up of individual *widgets*. Each widget is " "represented as a Python object, instantiated from classes like :class:`ttk." "Frame`, :class:`ttk.Label`, and :class:`ttk.Button`." msgstr "" -#: ../../library/tkinter.rst:332 +#: ../../library/tkinter.rst:335 msgid "widget hierarchy" msgstr "" -#: ../../library/tkinter.rst:329 +#: ../../library/tkinter.rst:332 msgid "" "Widgets are arranged in a *hierarchy*. The label and button were contained " "within a frame, which in turn was contained within the root window. When " @@ -609,44 +609,44 @@ msgid "" "argument to the widget constructor." msgstr "" -#: ../../library/tkinter.rst:337 +#: ../../library/tkinter.rst:340 msgid "configuration options" msgstr "" -#: ../../library/tkinter.rst:335 +#: ../../library/tkinter.rst:338 msgid "" "Widgets have *configuration options*, which modify their appearance and " "behavior, such as the text to display in a label or button. Different " "classes of widgets will have different sets of options." msgstr "" -#: ../../library/tkinter.rst:342 +#: ../../library/tkinter.rst:345 msgid "geometry management" msgstr "" -#: ../../library/tkinter.rst:340 +#: ../../library/tkinter.rst:343 msgid "" "Widgets aren't automatically added to the user interface when they are " "created. A *geometry manager* like ``grid`` controls where in the user " "interface they are placed." msgstr "" -#: ../../library/tkinter.rst:348 +#: ../../library/tkinter.rst:351 msgid "event loop" msgstr "" -#: ../../library/tkinter.rst:345 +#: ../../library/tkinter.rst:348 msgid "" "Tkinter reacts to user input, changes from your program, and even refreshes " "the display only when actively running an *event loop*. If your program " "isn't running the event loop, your user interface won't update." msgstr "" -#: ../../library/tkinter.rst:351 +#: ../../library/tkinter.rst:354 msgid "Understanding How Tkinter Wraps Tcl/Tk" msgstr "" -#: ../../library/tkinter.rst:353 +#: ../../library/tkinter.rst:356 msgid "" "When your application uses Tkinter's classes and methods, internally Tkinter " "is assembling strings representing Tcl/Tk commands, and executing those " @@ -654,7 +654,7 @@ msgid "" "instance." msgstr "" -#: ../../library/tkinter.rst:358 +#: ../../library/tkinter.rst:361 msgid "" "Whether it's trying to navigate reference documentation, trying to find the " "right method or option, adapting some existing code, or debugging your " @@ -662,13 +662,13 @@ msgid "" "what those underlying Tcl/Tk commands look like." msgstr "" -#: ../../library/tkinter.rst:363 +#: ../../library/tkinter.rst:366 msgid "" "To illustrate, here is the Tcl/Tk equivalent of the main part of the Tkinter " "script above." msgstr "" -#: ../../library/tkinter.rst:374 +#: ../../library/tkinter.rst:377 msgid "" "Tcl's syntax is similar to many shell languages, where the first word is the " "command to be executed, with arguments to that command following it, " @@ -676,25 +676,25 @@ msgid "" "following:" msgstr "" -#: ../../library/tkinter.rst:378 +#: ../../library/tkinter.rst:381 msgid "" "The commands used to create widgets (like ``ttk::frame``) correspond to " "widget classes in Tkinter." msgstr "" -#: ../../library/tkinter.rst:381 +#: ../../library/tkinter.rst:384 msgid "" "Tcl widget options (like ``-text``) correspond to keyword arguments in " "Tkinter." msgstr "" -#: ../../library/tkinter.rst:384 +#: ../../library/tkinter.rst:387 msgid "" "Widgets are referred to by a *pathname* in Tcl (like ``.frm.btn``), whereas " "Tkinter doesn't use names but object references." msgstr "" -#: ../../library/tkinter.rst:387 +#: ../../library/tkinter.rst:390 msgid "" "A widget's place in the widget hierarchy is encoded in its (hierarchical) " "pathname, which uses a ``.`` (dot) as a path separator. The pathname for the " @@ -702,7 +702,7 @@ msgid "" "pathname but by specifying the parent widget when creating each child widget." msgstr "" -#: ../../library/tkinter.rst:393 +#: ../../library/tkinter.rst:396 msgid "" "Operations which are implemented as separate *commands* in Tcl (like " "``grid`` or ``destroy``) are represented as *methods* on Tkinter widget " @@ -711,18 +711,18 @@ msgid "" "in Tkinter." msgstr "" -#: ../../library/tkinter.rst:401 +#: ../../library/tkinter.rst:404 msgid "How do I...? What option does...?" msgstr "" -#: ../../library/tkinter.rst:403 +#: ../../library/tkinter.rst:406 msgid "" "If you're not sure how to do something in Tkinter, and you can't immediately " "find it in the tutorial or reference documentation you're using, there are a " "few strategies that can be helpful." msgstr "" -#: ../../library/tkinter.rst:407 +#: ../../library/tkinter.rst:410 msgid "" "First, remember that the details of how individual widgets work may vary " "across different versions of both Tkinter and Tcl/Tk. If you're searching " @@ -730,7 +730,7 @@ msgid "" "installed on your system." msgstr "" -#: ../../library/tkinter.rst:412 +#: ../../library/tkinter.rst:415 msgid "" "When searching for how to use an API, it helps to know the exact name of the " "class, option, or method that you're using. Introspection, either in an " @@ -738,7 +738,7 @@ msgid "" "you need." msgstr "" -#: ../../library/tkinter.rst:417 +#: ../../library/tkinter.rst:420 msgid "" "To find out what configuration options are available on any widget, call " "its :meth:`configure` method, which returns a dictionary containing a " @@ -746,7 +746,7 @@ msgid "" "values. Use :meth:`keys` to get just the names of each option." msgstr "" -#: ../../library/tkinter.rst:427 +#: ../../library/tkinter.rst:430 msgid "" "As most widgets have many configuration options in common, it can be useful " "to find out which are specific to a particular widget class. Comparing the " @@ -754,7 +754,7 @@ msgid "" "that." msgstr "" -#: ../../library/tkinter.rst:436 +#: ../../library/tkinter.rst:439 msgid "" "Similarly, you can find the available methods for a widget object using the " "standard :func:`dir` function. If you try it, you'll see there are over 200 " @@ -762,11 +762,11 @@ msgid "" "is helpful." msgstr "" -#: ../../library/tkinter.rst:448 +#: ../../library/tkinter.rst:451 msgid "Navigating the Tcl/Tk Reference Manual" msgstr "" -#: ../../library/tkinter.rst:450 +#: ../../library/tkinter.rst:453 msgid "" "As noted, the official `Tk commands `_ reference manual (man pages) is often the most accurate " @@ -775,7 +775,7 @@ msgid "" "places to look." msgstr "" -#: ../../library/tkinter.rst:455 +#: ../../library/tkinter.rst:458 msgid "" "While all operations in Tkinter are implemented as method calls on widget " "objects, you've seen that many Tcl/Tk operations appear as commands that " @@ -783,7 +783,7 @@ msgid "" "parameters, e.g." msgstr "" -#: ../../library/tkinter.rst:465 +#: ../../library/tkinter.rst:468 msgid "" "Others, however, look more like methods called on a widget object (in fact, " "when you create a widget in Tcl/Tk, it creates a Tcl command with the name " @@ -791,7 +791,7 @@ msgid "" "name of a method to call)." msgstr "" -#: ../../library/tkinter.rst:476 +#: ../../library/tkinter.rst:479 msgid "" "In the official Tcl/Tk reference documentation, you'll find most operations " "that look like method calls on the man page for a specific widget (e.g., " @@ -801,7 +801,7 @@ msgid "" "www.tcl.tk/man/tcl8.6/TkCmd/grid.htm>`_)." msgstr "" -#: ../../library/tkinter.rst:484 +#: ../../library/tkinter.rst:487 msgid "" "You'll find many common options and methods in the `options `_ or `ttk::widget `_ man page." msgstr "" -#: ../../library/tkinter.rst:495 +#: ../../library/tkinter.rst:498 msgid "" "Somewhat confusingly, there are also methods on all Tkinter widgets that " "don't actually operate on the widget, but operate at a global scope, " @@ -826,17 +826,17 @@ msgid "" "class:`Widget` class that all Tkinter widgets inherit from)." msgstr "" -#: ../../library/tkinter.rst:504 +#: ../../library/tkinter.rst:507 msgid "Threading model" msgstr "" -#: ../../library/tkinter.rst:506 +#: ../../library/tkinter.rst:509 msgid "" "Python and Tcl/Tk have very different threading models, which :mod:`tkinter` " "tries to bridge. If you use threads, you may need to be aware of this." msgstr "" -#: ../../library/tkinter.rst:509 +#: ../../library/tkinter.rst:512 msgid "" "A Python interpreter may have many threads associated with it. In Tcl, " "multiple threads can be created, but each thread has a separate Tcl " @@ -845,7 +845,7 @@ msgid "" "by the one thread that created it." msgstr "" -#: ../../library/tkinter.rst:514 +#: ../../library/tkinter.rst:517 msgid "" "Each :class:`Tk` object created by :mod:`tkinter` contains a Tcl " "interpreter. It also keeps track of which thread created that interpreter. " @@ -855,7 +855,7 @@ msgid "" "executed, the result is returned to the calling Python thread." msgstr "" -#: ../../library/tkinter.rst:521 +#: ../../library/tkinter.rst:524 msgid "" "Tcl/Tk applications are normally event-driven, meaning that after " "initialization, the interpreter runs an event loop (i.e. :func:`Tk." @@ -868,18 +868,18 @@ msgid "" "event handlers." msgstr "" -#: ../../library/tkinter.rst:530 +#: ../../library/tkinter.rst:533 msgid "" "If the Tcl interpreter is not running the event loop and processing events, " "any :mod:`tkinter` calls made from threads other than the one running the " "Tcl interpreter will fail." msgstr "" -#: ../../library/tkinter.rst:534 +#: ../../library/tkinter.rst:537 msgid "A number of special cases exist:" msgstr "" -#: ../../library/tkinter.rst:536 +#: ../../library/tkinter.rst:539 msgid "" "Tcl/Tk libraries can be built so they are not thread-aware. In this case, :" "mod:`tkinter` calls the library from the originating Python thread, even if " @@ -887,7 +887,7 @@ msgid "" "lock ensures only one call occurs at a time." msgstr "" -#: ../../library/tkinter.rst:541 +#: ../../library/tkinter.rst:544 msgid "" "While :mod:`tkinter` allows you to create more than one instance of a :class:" "`Tk` object (with its own interpreter), all interpreters that are part of " @@ -897,7 +897,7 @@ msgid "" "running a thread-aware Tcl/Tk build." msgstr "" -#: ../../library/tkinter.rst:547 +#: ../../library/tkinter.rst:550 msgid "" "Blocking event handlers are not the only way to prevent the Tcl interpreter " "from reentering the event loop. It is even possible to run multiple nested " @@ -905,47 +905,47 @@ msgid "" "tricky when it comes to events or threads, be aware of these possibilities." msgstr "" -#: ../../library/tkinter.rst:552 +#: ../../library/tkinter.rst:555 msgid "" "There are a few select :mod:`tkinter` functions that presently work only " "when called from the thread that created the Tcl interpreter." msgstr "" -#: ../../library/tkinter.rst:557 +#: ../../library/tkinter.rst:560 msgid "Handy Reference" msgstr "" -#: ../../library/tkinter.rst:563 +#: ../../library/tkinter.rst:566 msgid "Setting Options" msgstr "" -#: ../../library/tkinter.rst:565 +#: ../../library/tkinter.rst:568 msgid "" "Options control things like the color and border width of a widget. Options " "can be set in three ways:" msgstr "" -#: ../../library/tkinter.rst:571 +#: ../../library/tkinter.rst:574 msgid "At object creation time, using keyword arguments" msgstr "" -#: ../../library/tkinter.rst:577 +#: ../../library/tkinter.rst:580 msgid "After object creation, treating the option name like a dictionary index" msgstr "" -#: ../../library/tkinter.rst:582 +#: ../../library/tkinter.rst:585 msgid "" "Use the config() method to update multiple attrs subsequent to object " "creation" msgstr "" -#: ../../library/tkinter.rst:584 +#: ../../library/tkinter.rst:587 msgid "" "For a complete explanation of a given option and its behavior, see the Tk " "man pages for the widget in question." msgstr "" -#: ../../library/tkinter.rst:587 +#: ../../library/tkinter.rst:590 msgid "" "Note that the man pages list \"STANDARD OPTIONS\" and \"WIDGET SPECIFIC " "OPTIONS\" for each widget. The former is a list of options that are common " @@ -954,7 +954,7 @@ msgid "" "`options(3)` man page." msgstr "" -#: ../../library/tkinter.rst:593 +#: ../../library/tkinter.rst:596 msgid "" "No distinction between standard and widget-specific options is made in this " "document. Some options don't apply to some kinds of widgets. Whether a " @@ -962,7 +962,7 @@ msgid "" "widget; buttons have a ``command`` option, labels do not." msgstr "" -#: ../../library/tkinter.rst:598 +#: ../../library/tkinter.rst:601 msgid "" "The options supported by a given widget are listed in that widget's man " "page, or can be queried at runtime by calling the :meth:`config` method " @@ -971,7 +971,7 @@ msgid "" "option as a string (for example, ``'relief'``) and whose values are 5-tuples." msgstr "" -#: ../../library/tkinter.rst:604 +#: ../../library/tkinter.rst:607 msgid "" "Some options, like ``bg`` are synonyms for common options with long names " "(``bg`` is shorthand for \"background\"). Passing the ``config()`` method " @@ -980,92 +980,92 @@ msgid "" "option (such as ``('bg', 'background')``)." msgstr "" -#: ../../library/tkinter.rst:611 +#: ../../library/tkinter.rst:614 msgid "Index" msgstr "" -#: ../../library/tkinter.rst:611 +#: ../../library/tkinter.rst:614 msgid "Meaning" msgstr "" -#: ../../library/tkinter.rst:611 +#: ../../library/tkinter.rst:614 msgid "Example" msgstr "範例" -#: ../../library/tkinter.rst:613 +#: ../../library/tkinter.rst:616 msgid "0" msgstr "0" -#: ../../library/tkinter.rst:613 +#: ../../library/tkinter.rst:616 msgid "option name" msgstr "" -#: ../../library/tkinter.rst:613 ../../library/tkinter.rst:615 +#: ../../library/tkinter.rst:616 ../../library/tkinter.rst:618 msgid "``'relief'``" msgstr "``'relief'``" -#: ../../library/tkinter.rst:615 +#: ../../library/tkinter.rst:618 msgid "1" msgstr "1" -#: ../../library/tkinter.rst:615 +#: ../../library/tkinter.rst:618 msgid "option name for database lookup" msgstr "" -#: ../../library/tkinter.rst:617 +#: ../../library/tkinter.rst:620 msgid "2" msgstr "2" -#: ../../library/tkinter.rst:617 +#: ../../library/tkinter.rst:620 msgid "option class for database lookup" msgstr "" -#: ../../library/tkinter.rst:617 +#: ../../library/tkinter.rst:620 msgid "``'Relief'``" msgstr "``'Relief'``" -#: ../../library/tkinter.rst:620 +#: ../../library/tkinter.rst:623 msgid "3" msgstr "3" -#: ../../library/tkinter.rst:620 +#: ../../library/tkinter.rst:623 msgid "default value" msgstr "" -#: ../../library/tkinter.rst:620 +#: ../../library/tkinter.rst:623 msgid "``'raised'``" msgstr "``'raised'``" -#: ../../library/tkinter.rst:622 +#: ../../library/tkinter.rst:625 msgid "4" msgstr "4" -#: ../../library/tkinter.rst:622 +#: ../../library/tkinter.rst:625 msgid "current value" msgstr "" -#: ../../library/tkinter.rst:622 +#: ../../library/tkinter.rst:625 msgid "``'groove'``" msgstr "``'groove'``" -#: ../../library/tkinter.rst:625 +#: ../../library/tkinter.rst:628 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/tkinter.rst:630 +#: ../../library/tkinter.rst:633 msgid "" "Of course, the dictionary printed will include all the options available and " "their values. This is meant only as an example." msgstr "" -#: ../../library/tkinter.rst:635 +#: ../../library/tkinter.rst:638 msgid "The Packer" msgstr "" -#: ../../library/tkinter.rst:639 +#: ../../library/tkinter.rst:642 msgid "" "The packer is one of Tk's geometry-management mechanisms. Geometry " "managers are used to specify the relative positioning of widgets within " @@ -1076,7 +1076,7 @@ msgid "" "coordinates for you." msgstr "" -#: ../../library/tkinter.rst:646 +#: ../../library/tkinter.rst:649 msgid "" "The size of any *master* widget is determined by the size of the \"slave " "widgets\" inside. The packer is used to control where slave widgets appear " @@ -1086,7 +1086,7 @@ msgid "" "accommodate incremental changes to the configuration, once it is packed." msgstr "" -#: ../../library/tkinter.rst:653 +#: ../../library/tkinter.rst:656 msgid "" "Note that widgets do not appear until they have had their geometry specified " "with a geometry manager. It's a common early mistake to leave out the " @@ -1095,79 +1095,79 @@ msgid "" "the packer's :meth:`pack` method applied to it." msgstr "" -#: ../../library/tkinter.rst:659 +#: ../../library/tkinter.rst:662 msgid "" "The pack() method can be called with keyword-option/value pairs that control " "where the widget is to appear within its container, and how it is to behave " "when the main application window is resized. Here are some examples::" msgstr "" -#: ../../library/tkinter.rst:669 +#: ../../library/tkinter.rst:672 msgid "Packer Options" msgstr "" -#: ../../library/tkinter.rst:671 +#: ../../library/tkinter.rst:674 msgid "" "For more extensive information on the packer and the options that it can " "take, see the man pages and page 183 of John Ousterhout's book." msgstr "" -#: ../../library/tkinter.rst:675 ../../library/tkinter.rst:795 +#: ../../library/tkinter.rst:678 ../../library/tkinter.rst:798 msgid "anchor" msgstr "" -#: ../../library/tkinter.rst:675 +#: ../../library/tkinter.rst:678 msgid "" "Anchor type. Denotes where the packer is to place each slave in its parcel." msgstr "" -#: ../../library/tkinter.rst:678 +#: ../../library/tkinter.rst:681 msgid "expand" msgstr "" -#: ../../library/tkinter.rst:678 +#: ../../library/tkinter.rst:681 msgid "Boolean, ``0`` or ``1``." msgstr "" -#: ../../library/tkinter.rst:681 +#: ../../library/tkinter.rst:684 msgid "fill" msgstr "" -#: ../../library/tkinter.rst:681 +#: ../../library/tkinter.rst:684 msgid "Legal values: ``'x'``, ``'y'``, ``'both'``, ``'none'``." msgstr "" -#: ../../library/tkinter.rst:684 +#: ../../library/tkinter.rst:687 msgid "ipadx and ipady" msgstr "" -#: ../../library/tkinter.rst:684 +#: ../../library/tkinter.rst:687 msgid "" "A distance - designating internal padding on each side of the slave widget." msgstr "" -#: ../../library/tkinter.rst:687 +#: ../../library/tkinter.rst:690 msgid "padx and pady" msgstr "" -#: ../../library/tkinter.rst:687 +#: ../../library/tkinter.rst:690 msgid "" "A distance - designating external padding on each side of the slave widget." msgstr "" -#: ../../library/tkinter.rst:691 +#: ../../library/tkinter.rst:694 msgid "side" msgstr "" -#: ../../library/tkinter.rst:690 +#: ../../library/tkinter.rst:693 msgid "Legal values are: ``'left'``, ``'right'``, ``'top'``, ``'bottom'``." msgstr "" -#: ../../library/tkinter.rst:694 +#: ../../library/tkinter.rst:697 msgid "Coupling Widget Variables" msgstr "" -#: ../../library/tkinter.rst:696 +#: ../../library/tkinter.rst:699 msgid "" "The current-value setting of some widgets (like text entry widgets) can be " "connected directly to application variables by using special options. These " @@ -1177,7 +1177,7 @@ msgid "" "value." msgstr "" -#: ../../library/tkinter.rst:702 +#: ../../library/tkinter.rst:705 msgid "" "Unfortunately, in the current implementation of :mod:`tkinter` it is not " "possible to hand over an arbitrary Python variable to a widget through a " @@ -1186,7 +1186,7 @@ msgid "" "Variable, defined in :mod:`tkinter`." msgstr "" -#: ../../library/tkinter.rst:708 +#: ../../library/tkinter.rst:711 msgid "" "There are many useful subclasses of Variable already defined: :class:" "`StringVar`, :class:`IntVar`, :class:`DoubleVar`, and :class:`BooleanVar`. " @@ -1196,18 +1196,15 @@ msgid "" "no further intervention on your part." msgstr "" -#: ../../library/tkinter.rst:715 ../../library/tkinter.rst:895 +#: ../../library/tkinter.rst:718 ../../library/tkinter.rst:898 msgid "For example::" -msgstr "" -"舉例來說:\n" -"\n" -"::" +msgstr "舉例來說: ::" -#: ../../library/tkinter.rst:748 +#: ../../library/tkinter.rst:751 msgid "The Window Manager" msgstr "" -#: ../../library/tkinter.rst:752 +#: ../../library/tkinter.rst:755 msgid "" "In Tk, there is a utility command, ``wm``, for interacting with the window " "manager. Options to the ``wm`` command allow you to control things like " @@ -1217,7 +1214,7 @@ msgid "" "the :class:`Wm` methods directly." msgstr "" -#: ../../library/tkinter.rst:759 +#: ../../library/tkinter.rst:762 msgid "" "To get at the toplevel window that contains a given widget, you can often " "just refer to the widget's master. Of course if the widget has been packed " @@ -1228,29 +1225,29 @@ msgid "" "to Tk functionality." msgstr "" -#: ../../library/tkinter.rst:766 +#: ../../library/tkinter.rst:769 msgid "Here are some examples of typical usage::" msgstr "" "以下是一些常見用法範例:\n" "\n" "::" -#: ../../library/tkinter.rst:789 ../../library/tkinter.rst:791 +#: ../../library/tkinter.rst:792 ../../library/tkinter.rst:794 msgid "Tk Option Data Types" msgstr "" -#: ../../library/tkinter.rst:794 +#: ../../library/tkinter.rst:797 msgid "" "Legal values are points of the compass: ``\"n\"``, ``\"ne\"``, ``\"e\"``, " "``\"se\"``, ``\"s\"``, ``\"sw\"``, ``\"w\"``, ``\"nw\"``, and also " "``\"center\"``." msgstr "" -#: ../../library/tkinter.rst:801 +#: ../../library/tkinter.rst:804 msgid "bitmap" msgstr "" -#: ../../library/tkinter.rst:798 +#: ../../library/tkinter.rst:801 msgid "" "There are eight built-in, named bitmaps: ``'error'``, ``'gray25'``, " "``'gray50'``, ``'hourglass'``, ``'info'``, ``'questhead'``, ``'question'``, " @@ -1258,27 +1255,27 @@ msgid "" "file, preceded with an ``@``, as in ``\"@/usr/contrib/bitmap/gumby.bit\"``." msgstr "" -#: ../../library/tkinter.rst:804 +#: ../../library/tkinter.rst:807 msgid "boolean" msgstr "" -#: ../../library/tkinter.rst:804 +#: ../../library/tkinter.rst:807 msgid "You can pass integers 0 or 1 or the strings ``\"yes\"`` or ``\"no\"``." msgstr "" -#: ../../library/tkinter.rst:811 +#: ../../library/tkinter.rst:814 msgid "callback" msgstr "" -#: ../../library/tkinter.rst:807 +#: ../../library/tkinter.rst:810 msgid "This is any Python function that takes no arguments. For example::" msgstr "" -#: ../../library/tkinter.rst:817 +#: ../../library/tkinter.rst:820 msgid "color" msgstr "" -#: ../../library/tkinter.rst:814 +#: ../../library/tkinter.rst:817 msgid "" "Colors can be given as the names of X colors in the rgb.txt file, or as " "strings representing RGB values in 4 bit: ``\"#RGB\"``, 8 bit: " @@ -1287,11 +1284,11 @@ msgid "" "digit. See page 160 of Ousterhout's book for details." msgstr "" -#: ../../library/tkinter.rst:823 +#: ../../library/tkinter.rst:826 msgid "cursor" msgstr "" -#: ../../library/tkinter.rst:820 +#: ../../library/tkinter.rst:823 msgid "" "The standard X cursor names from :file:`cursorfont.h` can be used, without " "the ``XC_`` prefix. For example to get a hand cursor (:const:`XC_hand2`), " @@ -1299,11 +1296,11 @@ msgid "" "of your own. See page 179 of Ousterhout's book." msgstr "" -#: ../../library/tkinter.rst:830 +#: ../../library/tkinter.rst:833 msgid "distance" msgstr "" -#: ../../library/tkinter.rst:826 +#: ../../library/tkinter.rst:829 msgid "" "Screen distances can be specified in either pixels or absolute distances. " "Pixels are given as numbers and absolute distances as strings, with the " @@ -1312,120 +1309,120 @@ msgid "" "is expressed as ``\"3.5i\"``." msgstr "" -#: ../../library/tkinter.rst:835 +#: ../../library/tkinter.rst:838 msgid "font" msgstr "" -#: ../../library/tkinter.rst:833 +#: ../../library/tkinter.rst:836 msgid "" "Tk uses a list font name format, such as ``{courier 10 bold}``. Font sizes " "with positive numbers are measured in points; sizes with negative numbers " "are measured in pixels." msgstr "" -#: ../../library/tkinter.rst:840 +#: ../../library/tkinter.rst:843 msgid "geometry" msgstr "" -#: ../../library/tkinter.rst:838 +#: ../../library/tkinter.rst:841 msgid "" "This is a string of the form ``widthxheight``, where width and height are " "measured in pixels for most widgets (in characters for widgets displaying " "text). For example: ``fred[\"geometry\"] = \"200x100\"``." msgstr "" -#: ../../library/tkinter.rst:844 +#: ../../library/tkinter.rst:847 msgid "justify" msgstr "" -#: ../../library/tkinter.rst:843 +#: ../../library/tkinter.rst:846 msgid "" "Legal values are the strings: ``\"left\"``, ``\"center\"``, ``\"right\"``, " "and ``\"fill\"``." msgstr "" -#: ../../library/tkinter.rst:849 +#: ../../library/tkinter.rst:852 msgid "region" msgstr "" -#: ../../library/tkinter.rst:847 +#: ../../library/tkinter.rst:850 msgid "" "This is a string with four space-delimited elements, each of which is a " "legal distance (see above). For example: ``\"2 3 4 5\"`` and ``\"3i 2i 4.5i " "2i\"`` and ``\"3c 2c 4c 10.43c\"`` are all legal regions." msgstr "" -#: ../../library/tkinter.rst:853 +#: ../../library/tkinter.rst:856 msgid "relief" msgstr "" -#: ../../library/tkinter.rst:852 +#: ../../library/tkinter.rst:855 msgid "" "Determines what the border style of a widget will be. Legal values are: " "``\"raised\"``, ``\"sunken\"``, ``\"flat\"``, ``\"groove\"``, and " "``\"ridge\"``." msgstr "" -#: ../../library/tkinter.rst:857 +#: ../../library/tkinter.rst:860 msgid "scrollcommand" msgstr "" -#: ../../library/tkinter.rst:856 +#: ../../library/tkinter.rst:859 msgid "" "This is almost always the :meth:`!set` method of some scrollbar widget, but " "can be any widget method that takes a single argument." msgstr "" -#: ../../library/tkinter.rst:860 +#: ../../library/tkinter.rst:863 msgid "wrap" msgstr "" -#: ../../library/tkinter.rst:860 +#: ../../library/tkinter.rst:863 msgid "Must be one of: ``\"none\"``, ``\"char\"``, or ``\"word\"``." msgstr "" -#: ../../library/tkinter.rst:865 +#: ../../library/tkinter.rst:868 msgid "Bindings and Events" msgstr "" -#: ../../library/tkinter.rst:871 +#: ../../library/tkinter.rst:874 msgid "" "The bind method from the widget command allows you to watch for certain " "events and to have a callback function trigger when that event type occurs. " "The form of the bind method is::" msgstr "" -#: ../../library/tkinter.rst:877 +#: ../../library/tkinter.rst:880 msgid "where:" msgstr "" -#: ../../library/tkinter.rst:882 +#: ../../library/tkinter.rst:885 msgid "sequence" msgstr "sequence(序列)" -#: ../../library/tkinter.rst:880 +#: ../../library/tkinter.rst:883 msgid "" "is a string that denotes the target kind of event. (See the :manpage:" "`bind(3tk)` man page, and page 201 of John Ousterhout's book, :title-" "reference:`Tcl and the Tk Toolkit (2nd edition)`, for details)." msgstr "" -#: ../../library/tkinter.rst:887 +#: ../../library/tkinter.rst:890 msgid "func" msgstr "" -#: ../../library/tkinter.rst:885 +#: ../../library/tkinter.rst:888 msgid "" "is a Python function, taking one argument, to be invoked when the event " "occurs. An Event instance will be passed as the argument. (Functions " "deployed this way are commonly known as *callbacks*.)" msgstr "" -#: ../../library/tkinter.rst:893 +#: ../../library/tkinter.rst:896 msgid "add" msgstr "" -#: ../../library/tkinter.rst:890 +#: ../../library/tkinter.rst:893 msgid "" "is optional, either ``''`` or ``'+'``. Passing an empty string denotes that " "this binding is to replace any other bindings that this event is associated " @@ -1433,7 +1430,7 @@ msgid "" "of functions bound to this event type." msgstr "" -#: ../../library/tkinter.rst:902 +#: ../../library/tkinter.rst:905 msgid "" "Notice how the widget field of the event is being accessed in the " "``turn_red()`` callback. This field contains the widget that caught the X " @@ -1442,209 +1439,209 @@ msgid "" "pages." msgstr "" -#: ../../library/tkinter.rst:908 +#: ../../library/tkinter.rst:911 msgid "Tkinter Event Field" msgstr "" -#: ../../library/tkinter.rst:910 +#: ../../library/tkinter.rst:913 msgid "%f" msgstr "%f" -#: ../../library/tkinter.rst:910 +#: ../../library/tkinter.rst:913 msgid "focus" msgstr "" -#: ../../library/tkinter.rst:910 +#: ../../library/tkinter.rst:913 msgid "%A" msgstr "%A" -#: ../../library/tkinter.rst:910 +#: ../../library/tkinter.rst:913 msgid "char" msgstr "char" -#: ../../library/tkinter.rst:912 +#: ../../library/tkinter.rst:915 msgid "%h" msgstr "%h" -#: ../../library/tkinter.rst:912 +#: ../../library/tkinter.rst:915 msgid "height" msgstr "" -#: ../../library/tkinter.rst:912 +#: ../../library/tkinter.rst:915 msgid "%E" msgstr "%E" -#: ../../library/tkinter.rst:912 +#: ../../library/tkinter.rst:915 msgid "send_event" msgstr "send_event" -#: ../../library/tkinter.rst:914 +#: ../../library/tkinter.rst:917 msgid "%k" msgstr "%k" -#: ../../library/tkinter.rst:914 +#: ../../library/tkinter.rst:917 msgid "keycode" msgstr "" -#: ../../library/tkinter.rst:914 +#: ../../library/tkinter.rst:917 msgid "%K" msgstr "%K" -#: ../../library/tkinter.rst:914 +#: ../../library/tkinter.rst:917 msgid "keysym" msgstr "" -#: ../../library/tkinter.rst:916 +#: ../../library/tkinter.rst:919 msgid "%s" msgstr "%s" -#: ../../library/tkinter.rst:916 +#: ../../library/tkinter.rst:919 msgid "state" msgstr "" -#: ../../library/tkinter.rst:916 +#: ../../library/tkinter.rst:919 msgid "%N" msgstr "%N" -#: ../../library/tkinter.rst:916 +#: ../../library/tkinter.rst:919 msgid "keysym_num" msgstr "keysym_num" -#: ../../library/tkinter.rst:918 +#: ../../library/tkinter.rst:921 msgid "%t" msgstr "%t" -#: ../../library/tkinter.rst:918 +#: ../../library/tkinter.rst:921 msgid "time" msgstr "" -#: ../../library/tkinter.rst:918 +#: ../../library/tkinter.rst:921 msgid "%T" msgstr "%T" -#: ../../library/tkinter.rst:918 +#: ../../library/tkinter.rst:921 msgid "type" msgstr "" -#: ../../library/tkinter.rst:920 +#: ../../library/tkinter.rst:923 msgid "%w" msgstr "%w" -#: ../../library/tkinter.rst:920 +#: ../../library/tkinter.rst:923 msgid "width" msgstr "" -#: ../../library/tkinter.rst:920 +#: ../../library/tkinter.rst:923 msgid "%W" msgstr "%W" -#: ../../library/tkinter.rst:920 +#: ../../library/tkinter.rst:923 msgid "widget" msgstr "" -#: ../../library/tkinter.rst:922 +#: ../../library/tkinter.rst:925 msgid "%x" msgstr "%x" -#: ../../library/tkinter.rst:922 +#: ../../library/tkinter.rst:925 msgid "x" msgstr "x" -#: ../../library/tkinter.rst:922 +#: ../../library/tkinter.rst:925 msgid "%X" msgstr "%X" -#: ../../library/tkinter.rst:922 +#: ../../library/tkinter.rst:925 msgid "x_root" msgstr "x_root" -#: ../../library/tkinter.rst:924 +#: ../../library/tkinter.rst:927 msgid "%y" msgstr "%y" -#: ../../library/tkinter.rst:924 +#: ../../library/tkinter.rst:927 msgid "y" msgstr "y" -#: ../../library/tkinter.rst:924 +#: ../../library/tkinter.rst:927 msgid "%Y" msgstr "%Y" -#: ../../library/tkinter.rst:924 +#: ../../library/tkinter.rst:927 msgid "y_root" msgstr "y_root" -#: ../../library/tkinter.rst:929 +#: ../../library/tkinter.rst:932 msgid "The index Parameter" msgstr "" -#: ../../library/tkinter.rst:931 +#: ../../library/tkinter.rst:934 msgid "" "A number of widgets require \"index\" parameters to be passed. These are " "used to point at a specific place in a Text widget, or to particular " "characters in an Entry widget, or to particular menu items in a Menu widget." msgstr "" -#: ../../library/tkinter.rst:938 +#: ../../library/tkinter.rst:941 msgid "Entry widget indexes (index, view index, etc.)" msgstr "" -#: ../../library/tkinter.rst:936 +#: ../../library/tkinter.rst:939 msgid "" "Entry widgets have options that refer to character positions in the text " "being displayed. You can use these :mod:`tkinter` functions to access these " "special points in text widgets:" msgstr "" -#: ../../library/tkinter.rst:942 +#: ../../library/tkinter.rst:945 msgid "Text widget indexes" msgstr "" -#: ../../library/tkinter.rst:941 +#: ../../library/tkinter.rst:944 msgid "" "The index notation for Text widgets is very rich and is best described in " "the Tk man pages." msgstr "" -#: ../../library/tkinter.rst:967 +#: ../../library/tkinter.rst:970 msgid "Menu indexes (menu.invoke(), menu.entryconfig(), etc.)" msgstr "" -#: ../../library/tkinter.rst:945 +#: ../../library/tkinter.rst:948 msgid "" "Some options and methods for menus manipulate specific menu entries. Anytime " "a menu index is needed for an option or a parameter, you may pass in:" msgstr "" -#: ../../library/tkinter.rst:948 +#: ../../library/tkinter.rst:951 msgid "" "an integer which refers to the numeric position of the entry in the widget, " "counted from the top, starting with 0;" msgstr "" -#: ../../library/tkinter.rst:951 +#: ../../library/tkinter.rst:954 msgid "" "the string ``\"active\"``, which refers to the menu position that is " "currently under the cursor;" msgstr "" -#: ../../library/tkinter.rst:954 +#: ../../library/tkinter.rst:957 msgid "the string ``\"last\"`` which refers to the last menu item;" msgstr "" -#: ../../library/tkinter.rst:956 +#: ../../library/tkinter.rst:959 msgid "" "An integer preceded by ``@``, as in ``@6``, where the integer is interpreted " "as a y pixel coordinate in the menu's coordinate system;" msgstr "" -#: ../../library/tkinter.rst:959 +#: ../../library/tkinter.rst:962 msgid "" "the string ``\"none\"``, which indicates no menu entry at all, most often " "used with menu.activate() to deactivate all entries, and finally," msgstr "" -#: ../../library/tkinter.rst:962 +#: ../../library/tkinter.rst:965 msgid "" "a text string that is pattern matched against the label of the menu entry, " "as scanned from the top of the menu to the bottom. Note that this index " @@ -1653,33 +1650,33 @@ msgid "" "above literals, instead." msgstr "" -#: ../../library/tkinter.rst:970 +#: ../../library/tkinter.rst:973 msgid "Images" msgstr "" -#: ../../library/tkinter.rst:972 +#: ../../library/tkinter.rst:975 msgid "" "Images of different formats can be created through the corresponding " "subclass of :class:`tkinter.Image`:" msgstr "" -#: ../../library/tkinter.rst:975 +#: ../../library/tkinter.rst:978 msgid ":class:`BitmapImage` for images in XBM format." msgstr "" -#: ../../library/tkinter.rst:977 +#: ../../library/tkinter.rst:980 msgid "" ":class:`PhotoImage` for images in PGM, PPM, GIF and PNG formats. The latter " "is supported starting with Tk 8.6." msgstr "" -#: ../../library/tkinter.rst:980 +#: ../../library/tkinter.rst:983 msgid "" "Either type of image is created through either the ``file`` or the ``data`` " "option (other options are available as well)." msgstr "" -#: ../../library/tkinter.rst:983 +#: ../../library/tkinter.rst:986 msgid "" "The image object can then be used wherever an ``image`` option is supported " "by some widget (e.g. labels, buttons, menus). In these cases, Tk will not " @@ -1688,28 +1685,28 @@ msgid "" "empty box wherever the image was used." msgstr "" -#: ../../library/tkinter.rst:991 +#: ../../library/tkinter.rst:994 msgid "" "The `Pillow `_ package adds support for formats " "such as BMP, JPEG, TIFF, and WebP, among others." msgstr "" -#: ../../library/tkinter.rst:997 +#: ../../library/tkinter.rst:1000 msgid "File Handlers" msgstr "" -#: ../../library/tkinter.rst:999 +#: ../../library/tkinter.rst:1002 msgid "" "Tk allows you to register and unregister a callback function which will be " "called from the Tk mainloop when I/O is possible on a file descriptor. Only " "one handler may be registered per file descriptor. Example code::" msgstr "" -#: ../../library/tkinter.rst:1010 +#: ../../library/tkinter.rst:1013 msgid "This feature is not available on Windows." msgstr "" -#: ../../library/tkinter.rst:1012 +#: ../../library/tkinter.rst:1015 msgid "" "Since you don't know how many bytes are available for reading, you may not " "want to use the :class:`~io.BufferedIOBase` or :class:`~io.TextIOBase` :meth:" @@ -1720,7 +1717,7 @@ msgid "" "maxbytecount)``." msgstr "" -#: ../../library/tkinter.rst:1023 +#: ../../library/tkinter.rst:1026 msgid "" "Registers the file handler callback function *func*. The *file* argument may " "either be an object with a :meth:`~io.IOBase.fileno` method (such as a file " @@ -1729,26 +1726,26 @@ msgid "" "as follows::" msgstr "" -#: ../../library/tkinter.rst:1034 +#: ../../library/tkinter.rst:1037 msgid "Unregisters a file handler." msgstr "" -#: ../../library/tkinter.rst:1041 +#: ../../library/tkinter.rst:1044 msgid "Constants used in the *mask* arguments." msgstr "" -#: ../../library/tkinter.rst:637 +#: ../../library/tkinter.rst:640 msgid "packing (widgets)" msgstr "" -#: ../../library/tkinter.rst:750 +#: ../../library/tkinter.rst:753 msgid "window manager (widgets)" msgstr "" -#: ../../library/tkinter.rst:867 +#: ../../library/tkinter.rst:870 msgid "bind (widgets)" msgstr "" -#: ../../library/tkinter.rst:867 +#: ../../library/tkinter.rst:870 msgid "events (widgets)" msgstr "" diff --git a/library/tkinter.ttk.po b/library/tkinter.ttk.po index 2e0a1f367a..123100888a 100644 --- a/library/tkinter.ttk.po +++ b/library/tkinter.ttk.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-21 00:03+0000\n" +"POT-Creation-Date: 2023-11-28 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1976,68 +1976,71 @@ msgstr "" #: ../../library/tkinter.ttk.rst:1393 msgid "" "Create a new element in the current theme, of the given *etype* which is " -"expected to be either \"image\", \"from\" or \"vsapi\". The latter is only " -"available in Tk 8.6a for Windows XP and Vista and is not described here." +"expected to be either \"image\" or \"from\"." msgstr "" -#: ../../library/tkinter.ttk.rst:1397 +#: ../../library/tkinter.ttk.rst:1396 msgid "" "If \"image\" is used, *args* should contain the default image name followed " "by statespec/value pairs (this is the imagespec), and *kw* may have the " "following options:" msgstr "" -#: ../../library/tkinter.ttk.rst:1403 +#: ../../library/tkinter.ttk.rst:1402 msgid "border=padding" msgstr "" -#: ../../library/tkinter.ttk.rst:1402 +#: ../../library/tkinter.ttk.rst:1401 msgid "" "padding is a list of up to four integers, specifying the left, top, right, " "and bottom borders, respectively." msgstr "" -#: ../../library/tkinter.ttk.rst:1407 +#: ../../library/tkinter.ttk.rst:1406 msgid "height=height" msgstr "" -#: ../../library/tkinter.ttk.rst:1406 +#: ../../library/tkinter.ttk.rst:1405 msgid "" "Specifies a minimum height for the element. If less than zero, the base " "image's height is used as a default." msgstr "" -#: ../../library/tkinter.ttk.rst:1411 +#: ../../library/tkinter.ttk.rst:1410 msgid "padding=padding" msgstr "" -#: ../../library/tkinter.ttk.rst:1410 +#: ../../library/tkinter.ttk.rst:1409 msgid "" "Specifies the element's interior padding. Defaults to border's value if not " "specified." msgstr "" -#: ../../library/tkinter.ttk.rst:1415 +#: ../../library/tkinter.ttk.rst:1414 msgid "sticky=spec" msgstr "" -#: ../../library/tkinter.ttk.rst:1414 +#: ../../library/tkinter.ttk.rst:1413 msgid "" "Specifies how the image is placed within the final parcel. spec contains " "zero or more characters \"n\", \"s\", \"w\", or \"e\"." msgstr "" -#: ../../library/tkinter.ttk.rst:1419 +#: ../../library/tkinter.ttk.rst:1418 msgid "width=width" msgstr "" -#: ../../library/tkinter.ttk.rst:1418 +#: ../../library/tkinter.ttk.rst:1417 msgid "" "Specifies a minimum width for the element. If less than zero, the base " "image's width is used as a default." msgstr "" -#: ../../library/tkinter.ttk.rst:1421 +#: ../../library/tkinter.ttk.rst:1420 ../../library/tkinter.ttk.rst:1437 +msgid "Example::" +msgstr "" + +#: ../../library/tkinter.ttk.rst:1430 msgid "" "If \"from\" is used as the value of *etype*, :meth:`element_create` will " "clone an existing element. *args* is expected to contain a themename, from " @@ -2046,19 +2049,19 @@ msgid "" "used. *kw* is discarded." msgstr "" -#: ../../library/tkinter.ttk.rst:1431 +#: ../../library/tkinter.ttk.rst:1445 msgid "Returns the list of elements defined in the current theme." msgstr "" -#: ../../library/tkinter.ttk.rst:1436 +#: ../../library/tkinter.ttk.rst:1450 msgid "Returns the list of *elementname*'s options." msgstr "" -#: ../../library/tkinter.ttk.rst:1441 +#: ../../library/tkinter.ttk.rst:1455 msgid "Create a new theme." msgstr "" -#: ../../library/tkinter.ttk.rst:1443 +#: ../../library/tkinter.ttk.rst:1457 msgid "" "It is an error if *themename* already exists. If *parent* is specified, the " "new theme will inherit styles, elements and layouts from the parent theme. " @@ -2066,13 +2069,13 @@ msgid "" "for :meth:`theme_settings`." msgstr "" -#: ../../library/tkinter.ttk.rst:1451 +#: ../../library/tkinter.ttk.rst:1465 msgid "" "Temporarily sets the current theme to *themename*, apply specified " "*settings* and then restore the previous theme." msgstr "" -#: ../../library/tkinter.ttk.rst:1454 +#: ../../library/tkinter.ttk.rst:1468 msgid "" "Each key in *settings* is a style and each value may contain the keys " "'configure', 'map', 'layout' and 'element create' and they are expected to " @@ -2081,26 +2084,26 @@ msgid "" "respectively." msgstr "" -#: ../../library/tkinter.ttk.rst:1460 +#: ../../library/tkinter.ttk.rst:1474 msgid "As an example, let's change the Combobox for the default theme a bit::" msgstr "" -#: ../../library/tkinter.ttk.rst:1488 +#: ../../library/tkinter.ttk.rst:1502 msgid "Returns a list of all known themes." msgstr "" -#: ../../library/tkinter.ttk.rst:1493 +#: ../../library/tkinter.ttk.rst:1507 msgid "" "If *themename* is not given, returns the theme in use. Otherwise, sets the " "current theme to *themename*, refreshes all widgets and emits a " "<> event." msgstr "" -#: ../../library/tkinter.ttk.rst:1499 +#: ../../library/tkinter.ttk.rst:1513 msgid "Layouts" msgstr "" -#: ../../library/tkinter.ttk.rst:1501 +#: ../../library/tkinter.ttk.rst:1515 msgid "" "A layout can be just ``None``, if it takes no options, or a dict of options " "specifying how to arrange the element. The layout mechanism uses a " @@ -2108,40 +2111,40 @@ msgid "" "each element is allocated a parcel. Valid options/values are:" msgstr "" -#: ../../library/tkinter.ttk.rst:1510 +#: ../../library/tkinter.ttk.rst:1524 msgid "side: whichside" msgstr "" -#: ../../library/tkinter.ttk.rst:1508 +#: ../../library/tkinter.ttk.rst:1522 msgid "" "Specifies which side of the cavity to place the element; one of top, right, " "bottom or left. If omitted, the element occupies the entire cavity." msgstr "" -#: ../../library/tkinter.ttk.rst:1513 +#: ../../library/tkinter.ttk.rst:1527 msgid "sticky: nswe" msgstr "" -#: ../../library/tkinter.ttk.rst:1513 +#: ../../library/tkinter.ttk.rst:1527 msgid "Specifies where the element is placed inside its allocated parcel." msgstr "" -#: ../../library/tkinter.ttk.rst:1518 +#: ../../library/tkinter.ttk.rst:1532 msgid "unit: 0 or 1" msgstr "" -#: ../../library/tkinter.ttk.rst:1516 +#: ../../library/tkinter.ttk.rst:1530 msgid "" "If set to 1, causes the element and all of its descendants to be treated as " "a single element for the purposes of :meth:`Widget.identify` et al. It's " "used for things like scrollbar thumbs with grips." msgstr "" -#: ../../library/tkinter.ttk.rst:1523 +#: ../../library/tkinter.ttk.rst:1537 msgid "children: [sublayout... ]" msgstr "" -#: ../../library/tkinter.ttk.rst:1521 +#: ../../library/tkinter.ttk.rst:1535 msgid "" "Specifies a list of elements to place inside the element. Each element is a " "tuple (or other sequence type) where the first item is the layout name, and " diff --git a/library/types.po b/library/types.po index c5476075e6..f1cf259061 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: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-12-06 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-" @@ -433,12 +433,13 @@ msgstr "" #: ../../library/types.rst:388 msgid "" "The type of objects defined in extension modules with ``PyGetSetDef``, such " -"as ``FrameType.f_locals`` or ``array.array.typecode``. This type is used as " -"descriptor for object attributes; it has the same purpose as the :class:" -"`property` type, but for classes defined in extension modules." +"as :attr:`FrameType.f_locals ` or ``array.array.typecode``. " +"This type is used as descriptor for object attributes; it has the same " +"purpose as the :class:`property` type, but for classes defined in extension " +"modules." msgstr "" -#: ../../library/types.rst:396 +#: ../../library/types.rst:397 msgid "" "The type of objects defined in extension modules with ``PyMemberDef``, such " "as ``datetime.timedelta.days``. This type is used as descriptor for simple " @@ -447,117 +448,117 @@ msgid "" "modules." msgstr "" -#: ../../library/types.rst:403 +#: ../../library/types.rst:404 msgid "" "In other implementations of Python, this type may be identical to " "``GetSetDescriptorType``." msgstr "" -#: ../../library/types.rst:408 +#: ../../library/types.rst:409 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:416 +#: ../../library/types.rst:417 msgid "" "Updated to support the new union (``|``) operator from :pep:`584`, which " "simply delegates to the underlying mapping." msgstr "" -#: ../../library/types.rst:421 +#: ../../library/types.rst:422 msgid "" "Return ``True`` if the underlying mapping has a key *key*, else ``False``." msgstr "" -#: ../../library/types.rst:426 +#: ../../library/types.rst:427 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:431 +#: ../../library/types.rst:432 msgid "" "Return an iterator over the keys of the underlying mapping. This is a " "shortcut for ``iter(proxy.keys())``." msgstr "" -#: ../../library/types.rst:436 +#: ../../library/types.rst:437 msgid "Return the number of items in the underlying mapping." msgstr "" -#: ../../library/types.rst:440 +#: ../../library/types.rst:441 msgid "Return a shallow copy of the underlying mapping." msgstr "" -#: ../../library/types.rst:444 +#: ../../library/types.rst:445 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:450 +#: ../../library/types.rst:451 msgid "" "Return a new view of the underlying mapping's items (``(key, value)`` pairs)." msgstr "" -#: ../../library/types.rst:455 +#: ../../library/types.rst:456 msgid "Return a new view of the underlying mapping's keys." msgstr "" -#: ../../library/types.rst:459 +#: ../../library/types.rst:460 msgid "Return a new view of the underlying mapping's values." msgstr "" -#: ../../library/types.rst:463 +#: ../../library/types.rst:464 msgid "Return a reverse iterator over the keys of the underlying mapping." msgstr "" -#: ../../library/types.rst:469 +#: ../../library/types.rst:470 msgid "Return a hash of the underlying mapping." msgstr "" -#: ../../library/types.rst:475 +#: ../../library/types.rst:476 msgid "Additional Utility Classes and Functions" msgstr "" -#: ../../library/types.rst:479 +#: ../../library/types.rst:480 msgid "" "A simple :class:`object` subclass that provides attribute access to its " "namespace, as well as a meaningful repr." msgstr "" -#: ../../library/types.rst:482 +#: ../../library/types.rst:483 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:486 +#: ../../library/types.rst:487 msgid "The type is roughly equivalent to the following code::" msgstr "" -#: ../../library/types.rst:501 +#: ../../library/types.rst:502 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:507 +#: ../../library/types.rst:508 msgid "" "Attribute order in the repr changed from alphabetical to insertion (like " "``dict``)." msgstr "" -#: ../../library/types.rst:513 +#: ../../library/types.rst:514 msgid "Route attribute access on a class to __getattr__." msgstr "" -#: ../../library/types.rst:515 +#: ../../library/types.rst:516 msgid "" "This is a descriptor, used to define attributes that act differently when " "accessed through an instance and through a class. Instance access remains " @@ -565,18 +566,18 @@ msgid "" "class's __getattr__ method; this is done by raising AttributeError." msgstr "" -#: ../../library/types.rst:520 +#: ../../library/types.rst:521 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:527 +#: ../../library/types.rst:528 msgid "Coroutine Utility Functions" msgstr "" -#: ../../library/types.rst:531 +#: ../../library/types.rst:532 msgid "" "This function transforms a :term:`generator` function into a :term:" "`coroutine function` which returns a generator-based coroutine. The " @@ -586,11 +587,11 @@ msgid "" "method." msgstr "" -#: ../../library/types.rst:538 +#: ../../library/types.rst:539 msgid "If *gen_func* is a generator function, it will be modified in-place." msgstr "" -#: ../../library/types.rst:540 +#: ../../library/types.rst:541 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/library/typing.po b/library/typing.po index f31e587f99..e47675cc14 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-25 00:03+0000\n" +"POT-Creation-Date: 2023-11-09 00:04+0000\n" "PO-Revision-Date: 2023-11-06 10:51+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,11 +30,11 @@ msgstr "**原始碼:**\\ :source:`Lib/typing.py`" #: ../../library/typing.rst:20 msgid "" "The Python runtime does not enforce function and variable type annotations. " -"They can be used by third party tools such as type checkers, IDEs, linters, " -"etc." +"They can be used by third party tools such as :term:`type checkers `, IDEs, linters, etc." msgstr "" "Python runtime 不強制要求函式與變數的型別註釋。他們可以被第三方工具使用,如:" -"型別檢查器、IDE、linter 等。" +"\\ :term:`型別檢查器 `、IDE、linter 等。" #: ../../library/typing.rst:26 msgid "" @@ -474,8 +474,8 @@ msgstr "" "Callable` 或 :data:`typing.Callable` 進行註釋。 ``Callable[[int], str]`` 象徵" "為一個函式,可以接受一個型別為 :class:`int` 的引數,並回傳一個 :class:`str`。" -#: ../../library/typing.rst:271 ../../library/typing.rst:2894 -#: ../../library/typing.rst:3036 +#: ../../library/typing.rst:271 ../../library/typing.rst:2891 +#: ../../library/typing.rst:3033 msgid "For example:" msgstr "舉例來說:" @@ -528,7 +528,7 @@ msgstr "" "``Callable[Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable], " "ReturnType]`` 的形式。" -#: ../../library/typing.rst:341 ../../library/typing.rst:3565 +#: ../../library/typing.rst:341 ../../library/typing.rst:3562 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." @@ -931,8 +931,8 @@ msgstr "" #: ../../library/typing.rst:843 ../../library/typing.rst:934 #: ../../library/typing.rst:954 ../../library/typing.rst:1011 -#: ../../library/typing.rst:1180 ../../library/typing.rst:1237 -#: ../../library/typing.rst:1446 ../../library/typing.rst:2834 +#: ../../library/typing.rst:1177 ../../library/typing.rst:1234 +#: ../../library/typing.rst:1443 ../../library/typing.rst:2831 msgid "For example::" msgstr "" "舉例來說:\n" @@ -958,7 +958,7 @@ msgid "" "``LiteralString``." msgstr "" -#: ../../library/typing.rst:877 ../../library/typing.rst:1961 +#: ../../library/typing.rst:877 ../../library/typing.rst:1958 msgid "Example:" msgstr "" "舉例來說:\n" @@ -1189,38 +1189,38 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:1167 ../../library/typing.rst:1929 +#: ../../library/typing.rst:1164 ../../library/typing.rst:1926 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)" msgstr "" -#: ../../library/typing.rst:1169 +#: ../../library/typing.rst:1166 msgid ":class:`ParamSpec`" msgstr ":class:`ParamSpec`。" -#: ../../library/typing.rst:1170 ../../library/typing.rst:1932 +#: ../../library/typing.rst:1167 ../../library/typing.rst:1929 msgid ":ref:`annotating-callables`" msgstr ":ref:`annotating-callables`" -#: ../../library/typing.rst:1174 +#: ../../library/typing.rst:1171 msgid "Special typing form to define \"literal types\"." msgstr "" -#: ../../library/typing.rst:1176 +#: ../../library/typing.rst:1173 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:1192 +#: ../../library/typing.rst:1189 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:1198 +#: ../../library/typing.rst:1195 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -1228,22 +1228,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:1206 +#: ../../library/typing.rst:1203 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:1208 +#: ../../library/typing.rst:1205 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:1216 +#: ../../library/typing.rst:1213 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:1218 +#: ../../library/typing.rst:1215 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 " @@ -1251,27 +1251,27 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:1232 +#: ../../library/typing.rst:1229 msgid "Special typing construct to indicate final names to type checkers." msgstr "" -#: ../../library/typing.rst:1234 +#: ../../library/typing.rst:1231 msgid "" "Final names cannot be reassigned in any scope. Final names declared in class " "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1248 ../../library/typing.rst:2850 +#: ../../library/typing.rst:1245 ../../library/typing.rst:2847 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:1255 +#: ../../library/typing.rst:1252 msgid "Special typing construct to mark a :class:`TypedDict` key as required." msgstr "" -#: ../../library/typing.rst:1257 +#: ../../library/typing.rst:1254 msgid "" "This is mainly useful for ``total=False`` TypedDicts. See :class:`TypedDict` " "and :pep:`655` for more details." @@ -1279,21 +1279,21 @@ msgstr "" "主要用於 ``total=False`` 的 TypedDict。更多細節請見 :class:`TypedDict` 與 :" "pep:`655`。" -#: ../../library/typing.rst:1264 +#: ../../library/typing.rst:1261 msgid "" "Special typing construct to mark a :class:`TypedDict` key as potentially " "missing." msgstr "" -#: ../../library/typing.rst:1267 +#: ../../library/typing.rst:1264 msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1273 +#: ../../library/typing.rst:1270 msgid "Special typing form to add context-specific metadata to an annotation." msgstr "" -#: ../../library/typing.rst:1275 +#: ../../library/typing.rst:1272 msgid "" "Add metadata ``x`` to a given type ``T`` by using the annotation " "``Annotated[T, x]``. Metadata added using ``Annotated`` can be used by " @@ -1301,7 +1301,7 @@ msgid "" "a :attr:`!__metadata__` attribute." msgstr "" -#: ../../library/typing.rst:1280 +#: ../../library/typing.rst:1277 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 " @@ -1310,7 +1310,7 @@ msgid "" "system." msgstr "" -#: ../../library/typing.rst:1286 +#: ../../library/typing.rst:1283 msgid "" "Using ``Annotated[T, x]`` as an annotation still allows for static " "typechecking of ``T``, as type checkers will simply ignore the metadata " @@ -1320,7 +1320,7 @@ msgid "" "for a function or class." msgstr "" -#: ../../library/typing.rst:1293 +#: ../../library/typing.rst:1290 msgid "" "The responsibility of how to interpret the metadata lies with the tool or " "library encountering an ``Annotated`` annotation. A tool or library " @@ -1328,108 +1328,108 @@ msgid "" "determine if they are of interest (e.g., using :func:`isinstance`)." msgstr "" -#: ../../library/typing.rst:1301 +#: ../../library/typing.rst:1298 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:1314 +#: ../../library/typing.rst:1311 msgid "Details of the syntax:" msgstr "" -#: ../../library/typing.rst:1316 +#: ../../library/typing.rst:1313 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:1318 +#: ../../library/typing.rst:1315 msgid "" "Multiple metadata elements can be supplied (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:1327 +#: ../../library/typing.rst:1324 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:1331 +#: ../../library/typing.rst:1328 msgid "" "``Annotated`` must be subscripted with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:1334 +#: ../../library/typing.rst:1331 msgid "" "The order of the metadata elements is preserved and matters for equality " "checks::" msgstr "" -#: ../../library/typing.rst:1341 +#: ../../library/typing.rst:1338 msgid "" "Nested ``Annotated`` types are flattened. The order of the metadata elements " "starts with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1348 +#: ../../library/typing.rst:1345 msgid "Duplicated metadata elements are not removed::" msgstr "" -#: ../../library/typing.rst:1354 +#: ../../library/typing.rst:1351 msgid "``Annotated`` can be used with nested and generic aliases:" msgstr "" -#: ../../library/typing.rst:1368 +#: ../../library/typing.rst:1365 msgid "``Annotated`` cannot be used with an unpacked :class:`TypeVarTuple`::" msgstr "" -#: ../../library/typing.rst:1372 +#: ../../library/typing.rst:1369 msgid "This would be equivalent to::" msgstr "" "這會等價於:\n" "\n" "::" -#: ../../library/typing.rst:1376 +#: ../../library/typing.rst:1373 msgid "" "where ``T1``, ``T2``, etc. are :class:`TypeVars `. This would be " "invalid: only one type should be passed to Annotated." msgstr "" -#: ../../library/typing.rst:1379 +#: ../../library/typing.rst:1376 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:1392 +#: ../../library/typing.rst:1389 msgid "" "At runtime, the metadata associated with an ``Annotated`` type can be " "retrieved via the :attr:`!__metadata__` attribute:" msgstr "" -#: ../../library/typing.rst:1406 +#: ../../library/typing.rst:1403 msgid ":pep:`593` - Flexible function and variable annotations" msgstr "" -#: ../../library/typing.rst:1407 +#: ../../library/typing.rst:1404 msgid "The PEP introducing ``Annotated`` to the standard library." msgstr "" -#: ../../library/typing.rst:1414 +#: ../../library/typing.rst:1411 msgid "Special typing construct for marking user-defined type guard functions." msgstr "" -#: ../../library/typing.rst:1416 +#: ../../library/typing.rst:1413 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:1420 +#: ../../library/typing.rst:1417 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 " @@ -1438,44 +1438,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1435 +#: ../../library/typing.rst:1432 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:1439 +#: ../../library/typing.rst:1436 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1442 +#: ../../library/typing.rst:1439 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1443 +#: ../../library/typing.rst:1440 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1460 +#: ../../library/typing.rst:1457 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:1464 +#: ../../library/typing.rst:1461 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:1470 +#: ../../library/typing.rst:1467 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]`` " @@ -1484,24 +1484,24 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1476 +#: ../../library/typing.rst:1473 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1483 +#: ../../library/typing.rst:1480 msgid "Typing operator to conceptually mark an object as having been unpacked." msgstr "" -#: ../../library/typing.rst:1485 +#: ../../library/typing.rst:1482 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:1494 +#: ../../library/typing.rst:1491 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context " "of :class:`typing.TypeVarTuple ` and :class:`builtins.tuple " @@ -1509,29 +1509,29 @@ msgid "" "versions of Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1508 +#: ../../library/typing.rst:1505 msgid "" "``Unpack`` can also be used along with :class:`typing.TypedDict` for typing " "``**kwargs`` in a function signature::" msgstr "" -#: ../../library/typing.rst:1521 +#: ../../library/typing.rst:1518 msgid "" "See :pep:`692` for more details on using ``Unpack`` for ``**kwargs`` typing." msgstr "" -#: ../../library/typing.rst:1526 +#: ../../library/typing.rst:1523 msgid "Building generic types and type aliases" msgstr "" -#: ../../library/typing.rst:1528 +#: ../../library/typing.rst:1525 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:1532 +#: ../../library/typing.rst:1529 msgid "" "These objects can be created through special syntax (:ref:`type parameter " "lists ` and the :keyword:`type` statement). For compatibility " @@ -1539,62 +1539,62 @@ msgid "" "syntax, as documented below." msgstr "" -#: ../../library/typing.rst:1539 +#: ../../library/typing.rst:1536 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1541 +#: ../../library/typing.rst:1538 msgid "" "A generic type is typically declared by adding a list of type parameters " "after the class name::" msgstr "" -#: ../../library/typing.rst:1549 +#: ../../library/typing.rst:1546 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:1553 +#: ../../library/typing.rst:1550 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1561 +#: ../../library/typing.rst:1558 msgid "" "Here the brackets after the function name indicate a :ref:`generic function " "`." msgstr "" -#: ../../library/typing.rst:1564 +#: ../../library/typing.rst:1561 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:1581 +#: ../../library/typing.rst:1578 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1583 +#: ../../library/typing.rst:1580 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:1591 +#: ../../library/typing.rst:1588 msgid "" "This syntax can also be used to create bound and constrained type variables::" msgstr "" -#: ../../library/typing.rst:1601 +#: ../../library/typing.rst:1598 msgid "" "However, if desired, reusable type variables can also be constructed " "manually, like so::" msgstr "" -#: ../../library/typing.rst:1607 +#: ../../library/typing.rst:1604 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 " @@ -1602,13 +1602,13 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1628 +#: ../../library/typing.rst:1625 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1631 +#: ../../library/typing.rst:1628 msgid "" "The variance of type variables is inferred by type checkers when they are " "created through the :ref:`type parameter syntax ` or when " @@ -1618,92 +1618,92 @@ msgid "" "invariant. See :pep:`484` and :pep:`695` for more details." msgstr "" -#: ../../library/typing.rst:1639 +#: ../../library/typing.rst:1636 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:1654 +#: ../../library/typing.rst:1651 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1666 +#: ../../library/typing.rst:1663 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:1677 +#: ../../library/typing.rst:1674 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1681 +#: ../../library/typing.rst:1678 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1685 +#: ../../library/typing.rst:1682 msgid "Whether the type var has been explicitly marked as covariant." msgstr "" -#: ../../library/typing.rst:1689 +#: ../../library/typing.rst:1686 msgid "Whether the type var has been explicitly marked as contravariant." msgstr "" -#: ../../library/typing.rst:1693 +#: ../../library/typing.rst:1690 msgid "" "Whether the type variable's variance should be inferred by type checkers." msgstr "" -#: ../../library/typing.rst:1699 +#: ../../library/typing.rst:1696 msgid "The bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1703 +#: ../../library/typing.rst:1700 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:1709 +#: ../../library/typing.rst:1706 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1713 +#: ../../library/typing.rst:1710 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:1719 +#: ../../library/typing.rst:1716 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:1727 +#: ../../library/typing.rst:1724 msgid "" "Type variable tuple. A specialized form of :ref:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1730 +#: ../../library/typing.rst:1727 msgid "" "Type variable tuples can be declared in :ref:`type parameter lists ` using a single asterisk (``*``) before the name::" msgstr "" -#: ../../library/typing.rst:1736 +#: ../../library/typing.rst:1733 msgid "Or by explicitly invoking the ``TypeVarTuple`` constructor::" msgstr "" -#: ../../library/typing.rst:1744 +#: ../../library/typing.rst:1741 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1711,7 +1711,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1766 +#: ../../library/typing.rst:1763 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, " @@ -1721,36 +1721,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1774 +#: ../../library/typing.rst:1771 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1781 +#: ../../library/typing.rst:1778 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:1789 +#: ../../library/typing.rst:1786 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:1805 +#: ../../library/typing.rst:1802 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:1812 +#: ../../library/typing.rst:1809 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1822 +#: ../../library/typing.rst:1819 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1759,39 +1759,39 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1829 +#: ../../library/typing.rst:1826 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1833 +#: ../../library/typing.rst:1830 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:1839 +#: ../../library/typing.rst:1836 msgid "" "Type variable tuples can now be declared using the :ref:`type parameter " "` syntax introduced by :pep:`695`." msgstr "" -#: ../../library/typing.rst:1844 +#: ../../library/typing.rst:1841 msgid "" "Parameter specification variable. A specialized version of :ref:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1847 +#: ../../library/typing.rst:1844 msgid "" "In :ref:`type parameter lists `, parameter specifications can " "be declared with two asterisks (``**``)::" msgstr "" -#: ../../library/typing.rst:1852 +#: ../../library/typing.rst:1849 msgid "" "For compatibility with Python 3.11 and earlier, ``ParamSpec`` objects can " "also be created as follows::" msgstr "" -#: ../../library/typing.rst:1857 +#: ../../library/typing.rst:1854 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1801,7 +1801,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1864 +#: ../../library/typing.rst:1861 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 " @@ -1809,27 +1809,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1884 +#: ../../library/typing.rst:1881 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:1888 +#: ../../library/typing.rst:1885 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:1890 +#: ../../library/typing.rst:1887 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:1897 +#: ../../library/typing.rst:1894 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1842,11 +1842,11 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1909 +#: ../../library/typing.rst:1906 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:1911 +#: ../../library/typing.rst:1908 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1855,23 +1855,23 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1921 +#: ../../library/typing.rst:1918 msgid "" "Parameter specifications can now be declared using the :ref:`type parameter " "` syntax introduced by :pep:`695`." msgstr "" -#: ../../library/typing.rst:1925 +#: ../../library/typing.rst:1922 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1931 +#: ../../library/typing.rst:1928 msgid ":data:`Concatenate`" msgstr "" -#: ../../library/typing.rst:1937 +#: ../../library/typing.rst:1934 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1879,75 +1879,75 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1942 +#: ../../library/typing.rst:1939 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``:" msgstr "" -#: ../../library/typing.rst:1959 +#: ../../library/typing.rst:1956 msgid "The type of type aliases created through the :keyword:`type` statement." msgstr "" -#: ../../library/typing.rst:1973 +#: ../../library/typing.rst:1970 msgid "The name of the type alias:" msgstr "" -#: ../../library/typing.rst:1983 +#: ../../library/typing.rst:1980 msgid "The module in which the type alias was defined::" msgstr "" -#: ../../library/typing.rst:1991 +#: ../../library/typing.rst:1988 msgid "" "The type parameters of the type alias, or an empty tuple if the alias is not " "generic:" msgstr "" -#: ../../library/typing.rst:2005 +#: ../../library/typing.rst:2002 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:2023 +#: ../../library/typing.rst:2020 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:2025 +#: ../../library/typing.rst:2022 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:2031 +#: ../../library/typing.rst:2028 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:2033 ../../library/typing.rst:2110 -#: ../../library/typing.rst:3076 +#: ../../library/typing.rst:2030 ../../library/typing.rst:2107 +#: ../../library/typing.rst:3073 msgid "Usage::" msgstr "" -#: ../../library/typing.rst:2039 +#: ../../library/typing.rst:2036 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:2043 +#: ../../library/typing.rst:2040 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:2052 +#: ../../library/typing.rst:2049 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:2054 +#: ../../library/typing.rst:2051 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 " @@ -1956,83 +1956,83 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:2060 +#: ../../library/typing.rst:2057 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:2070 +#: ../../library/typing.rst:2067 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:2076 +#: ../../library/typing.rst:2073 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:2086 +#: ../../library/typing.rst:2083 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:2089 +#: ../../library/typing.rst:2086 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:2092 +#: ../../library/typing.rst:2089 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:2096 +#: ../../library/typing.rst:2093 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:2100 +#: ../../library/typing.rst:2097 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:2105 +#: ../../library/typing.rst:2102 msgid "Helper class to create low-overhead :ref:`distinct types `." msgstr "" -#: ../../library/typing.rst:2107 +#: ../../library/typing.rst:2104 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:2117 +#: ../../library/typing.rst:2114 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:2121 +#: ../../library/typing.rst:2118 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:2125 +#: ../../library/typing.rst:2122 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:2129 +#: ../../library/typing.rst:2126 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:2134 +#: ../../library/typing.rst:2131 msgid "Base class for protocol classes." msgstr "" -#: ../../library/typing.rst:2136 +#: ../../library/typing.rst:2133 msgid "Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:2142 +#: ../../library/typing.rst:2139 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:2154 +#: ../../library/typing.rst:2151 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -2040,21 +2040,21 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:2159 +#: ../../library/typing.rst:2156 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:2165 +#: ../../library/typing.rst:2162 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:2178 +#: ../../library/typing.rst:2175 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:2180 +#: ../../library/typing.rst:2177 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 " @@ -2063,7 +2063,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:2200 +#: ../../library/typing.rst:2197 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -2074,7 +2074,7 @@ msgid "" "(instantiate) :class:`ssl.SSLObject`." msgstr "" -#: ../../library/typing.rst:2211 +#: ../../library/typing.rst:2208 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -2082,7 +2082,7 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:2219 +#: ../../library/typing.rst:2216 msgid "" "The internal implementation of :func:`isinstance` checks against runtime-" "checkable protocols now uses :func:`inspect.getattr_static` to look up " @@ -2092,7 +2092,7 @@ msgid "" "versa. Most users are unlikely to be affected by this change." msgstr "" -#: ../../library/typing.rst:2228 +#: ../../library/typing.rst:2225 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 " @@ -2101,13 +2101,13 @@ msgid "" "`\"What's new in Python 3.12\" ` for more details." msgstr "" -#: ../../library/typing.rst:2239 +#: ../../library/typing.rst:2236 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:2242 +#: ../../library/typing.rst:2239 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 " @@ -2115,53 +2115,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:2258 +#: ../../library/typing.rst:2255 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:2262 +#: ../../library/typing.rst:2259 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:2266 +#: ../../library/typing.rst:2263 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:2273 +#: ../../library/typing.rst:2270 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:2274 +#: ../../library/typing.rst:2271 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:2286 +#: ../../library/typing.rst:2283 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:2297 +#: ../../library/typing.rst:2294 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:2300 +#: ../../library/typing.rst:2297 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:2310 +#: ../../library/typing.rst:2307 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 " @@ -2169,53 +2169,53 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:2315 +#: ../../library/typing.rst:2312 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:2330 +#: ../../library/typing.rst:2327 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:2337 +#: ../../library/typing.rst:2334 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:2345 +#: ../../library/typing.rst:2342 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:2360 +#: ../../library/typing.rst:2357 msgid "A ``TypedDict`` can be generic::" msgstr "" -#: ../../library/typing.rst:2366 +#: ../../library/typing.rst:2363 msgid "" "To create a generic ``TypedDict`` that is compatible with Python 3.11 or " "lower, inherit from :class:`Generic` explicitly:" msgstr "" -#: ../../library/typing.rst:2377 +#: ../../library/typing.rst:2374 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:2383 +#: ../../library/typing.rst:2380 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2399 +#: ../../library/typing.rst:2396 msgid "" "This attribute reflects *only* the value of the ``total`` argument to the " "current ``TypedDict`` class, not whether the class is semantically total. " @@ -2226,21 +2226,21 @@ msgid "" "introspection." msgstr "" -#: ../../library/typing.rst:2412 +#: ../../library/typing.rst:2409 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2415 +#: ../../library/typing.rst:2412 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:2418 +#: ../../library/typing.rst:2415 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 " @@ -2249,7 +2249,7 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2443 +#: ../../library/typing.rst:2440 msgid "" "If ``from __future__ import annotations`` is used or if annotations are " "given as strings, annotations are not evaluated when the ``TypedDict`` is " @@ -2258,133 +2258,133 @@ msgid "" "attributes may be incorrect." msgstr "" -#: ../../library/typing.rst:2449 +#: ../../library/typing.rst:2446 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2453 +#: ../../library/typing.rst:2450 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2457 +#: ../../library/typing.rst:2454 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2461 +#: ../../library/typing.rst:2458 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2463 +#: ../../library/typing.rst:2460 msgid "" "The following protocols are provided by the typing module. All are decorated " "with :func:`@runtime_checkable `." msgstr "" -#: ../../library/typing.rst:2468 +#: ../../library/typing.rst:2465 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2473 +#: ../../library/typing.rst:2470 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2477 +#: ../../library/typing.rst:2474 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2481 +#: ../../library/typing.rst:2478 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2485 +#: ../../library/typing.rst:2482 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2491 +#: ../../library/typing.rst:2488 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2495 +#: ../../library/typing.rst:2492 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2499 +#: ../../library/typing.rst:2496 msgid "ABCs for working with IO" msgstr "" -#: ../../library/typing.rst:2505 +#: ../../library/typing.rst:2502 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:2511 +#: ../../library/typing.rst:2508 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2515 +#: ../../library/typing.rst:2512 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2517 +#: ../../library/typing.rst:2514 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:2524 +#: ../../library/typing.rst:2521 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2526 +#: ../../library/typing.rst:2523 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:2529 +#: ../../library/typing.rst:2526 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:2536 +#: ../../library/typing.rst:2533 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:2550 +#: ../../library/typing.rst:2547 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2552 +#: ../../library/typing.rst:2549 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2563 +#: ../../library/typing.rst:2560 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:2568 +#: ../../library/typing.rst:2565 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 " @@ -2394,59 +2394,59 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2576 +#: ../../library/typing.rst:2573 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2579 +#: ../../library/typing.rst:2576 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2587 +#: ../../library/typing.rst:2584 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2589 +#: ../../library/typing.rst:2586 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2595 +#: ../../library/typing.rst:2592 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2598 +#: ../../library/typing.rst:2595 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2603 +#: ../../library/typing.rst:2600 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2608 +#: ../../library/typing.rst:2605 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2620 +#: ../../library/typing.rst:2617 msgid "" "Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:2623 +#: ../../library/typing.rst:2620 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -2455,19 +2455,19 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:2630 +#: ../../library/typing.rst:2627 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2644 +#: ../../library/typing.rst:2641 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2653 +#: ../../library/typing.rst:2650 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2664 +#: ../../library/typing.rst:2661 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:2804 +#: ../../library/typing.rst:2801 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -2685,32 +2685,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2811 +#: ../../library/typing.rst:2808 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2819 +#: ../../library/typing.rst:2816 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2821 +#: ../../library/typing.rst:2818 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2828 +#: ../../library/typing.rst:2825 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2830 +#: ../../library/typing.rst:2827 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:2855 +#: ../../library/typing.rst:2852 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__\", " @@ -2720,11 +2720,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2866 +#: ../../library/typing.rst:2863 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:2865 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 " @@ -2732,38 +2732,38 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2874 +#: ../../library/typing.rst:2871 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2878 +#: ../../library/typing.rst:2875 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2880 +#: ../../library/typing.rst:2877 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2886 +#: ../../library/typing.rst:2883 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:2889 +#: ../../library/typing.rst:2886 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:2911 +#: ../../library/typing.rst:2908 msgid "There is no runtime checking of this property." msgstr "" -#: ../../library/typing.rst:2913 +#: ../../library/typing.rst:2910 msgid "" "The decorator will attempt to set an ``__override__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, " @@ -2773,38 +2773,38 @@ msgid "" "without raising an exception." msgstr "" -#: ../../library/typing.rst:2920 +#: ../../library/typing.rst:2917 msgid "See :pep:`698` for more details." msgstr "更多細節請見 :pep:`698`。" -#: ../../library/typing.rst:2927 +#: ../../library/typing.rst:2924 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2929 +#: ../../library/typing.rst:2926 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:2940 +#: ../../library/typing.rst:2937 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2944 +#: ../../library/typing.rst:2941 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2948 +#: ../../library/typing.rst:2945 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2951 +#: ../../library/typing.rst:2948 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2813,21 +2813,21 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2957 +#: ../../library/typing.rst:2954 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:2974 +#: ../../library/typing.rst:2971 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:2979 +#: ../../library/typing.rst:2976 msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." @@ -2835,20 +2835,20 @@ msgstr "" "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。更多資訊請見 :data:" "`Annotated` 的文件。" -#: ../../library/typing.rst:2983 +#: ../../library/typing.rst:2980 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:2990 +#: ../../library/typing.rst:2987 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:2993 +#: ../../library/typing.rst:2990 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 :" @@ -2856,17 +2856,17 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:2999 ../../library/typing.rst:3022 +#: ../../library/typing.rst:2996 ../../library/typing.rst:3019 msgid "Examples:" msgstr "舉例:" -#: ../../library/typing.rst:3014 +#: ../../library/typing.rst:3011 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:3017 +#: ../../library/typing.rst:3014 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 " @@ -2874,40 +2874,40 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:3034 +#: ../../library/typing.rst:3031 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:3055 +#: ../../library/typing.rst:3052 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:3057 +#: ../../library/typing.rst:3054 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:3062 +#: ../../library/typing.rst:3059 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:3069 +#: ../../library/typing.rst:3066 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:3073 +#: ../../library/typing.rst:3070 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:3084 +#: ../../library/typing.rst:3081 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2915,7 +2915,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:3091 +#: ../../library/typing.rst:3088 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2923,11 +2923,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:3103 +#: ../../library/typing.rst:3100 msgid "Deprecated aliases" msgstr "棄用的別名" -#: ../../library/typing.rst:3105 +#: ../../library/typing.rst:3102 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the typing module in " @@ -2936,7 +2936,7 @@ msgid "" "existing classes were enhanced to support ``[]`` (see :pep:`585`)." msgstr "" -#: ../../library/typing.rst:3112 +#: ../../library/typing.rst:3109 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 " @@ -2944,7 +2944,7 @@ msgid "" "the interpreter for these aliases." msgstr "" -#: ../../library/typing.rst:3117 +#: ../../library/typing.rst:3114 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 " @@ -2952,188 +2952,188 @@ msgid "" "typing module without deprecation warnings until at least Python 3.14." msgstr "" -#: ../../library/typing.rst:3122 +#: ../../library/typing.rst:3119 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:3128 +#: ../../library/typing.rst:3125 msgid "Aliases to built-in types" msgstr "內建型別的別名" -#: ../../library/typing.rst:3132 +#: ../../library/typing.rst:3129 msgid "Deprecated alias to :class:`dict`." msgstr "棄用 :class:`dict` 的別名。" -#: ../../library/typing.rst:3134 +#: ../../library/typing.rst:3131 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:3138 ../../library/typing.rst:3380 +#: ../../library/typing.rst:3135 ../../library/typing.rst:3377 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:3143 +#: ../../library/typing.rst:3140 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3149 +#: ../../library/typing.rst:3146 msgid "Deprecated alias to :class:`list`." msgstr "棄用 :class:`list` 的別名。" -#: ../../library/typing.rst:3151 +#: ../../library/typing.rst:3148 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:3155 +#: ../../library/typing.rst:3152 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:3163 +#: ../../library/typing.rst:3160 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3169 +#: ../../library/typing.rst:3166 msgid "Deprecated alias to :class:`builtins.set `." msgstr "棄用 :class:`builtins.set ` 的別名。" -#: ../../library/typing.rst:3171 +#: ../../library/typing.rst:3168 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:3175 +#: ../../library/typing.rst:3172 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3181 +#: ../../library/typing.rst:3178 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "棄用 :class:`builtins.frozenset ` 的別名。" -#: ../../library/typing.rst:3183 +#: ../../library/typing.rst:3180 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3190 +#: ../../library/typing.rst:3187 msgid "Deprecated alias for :class:`tuple`." msgstr "棄用 :class:`tuple` 的別名。" -#: ../../library/typing.rst:3192 +#: ../../library/typing.rst:3189 msgid "" ":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" "`annotating-tuples` for more details." msgstr "" -#: ../../library/typing.rst:3195 +#: ../../library/typing.rst:3192 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3201 +#: ../../library/typing.rst:3198 msgid "Deprecated alias to :class:`type`." msgstr "棄用 :class:`type` 的別名。" -#: ../../library/typing.rst:3203 +#: ../../library/typing.rst:3200 msgid "" "See :ref:`type-of-class-objects` for details on using :class:`type` or " "``typing.Type`` in type annotations." msgstr "" -#: ../../library/typing.rst:3208 +#: ../../library/typing.rst:3205 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3215 +#: ../../library/typing.rst:3212 msgid "Aliases to types in :mod:`collections`" msgstr ":mod:`collections` 中型別的別名" -#: ../../library/typing.rst:3219 +#: ../../library/typing.rst:3216 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "棄用 :class:`collections.defaultdict` 的別名。" -#: ../../library/typing.rst:3223 +#: ../../library/typing.rst:3220 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3229 +#: ../../library/typing.rst:3226 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "棄用 :class:`collections.OrderedDict` 的別名。" -#: ../../library/typing.rst:3233 +#: ../../library/typing.rst:3230 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3239 +#: ../../library/typing.rst:3236 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "棄用 :class:`collections.ChainMap` 的別名。" -#: ../../library/typing.rst:3244 +#: ../../library/typing.rst:3241 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3250 +#: ../../library/typing.rst:3247 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "棄用 :class:`collections.Counter` 的別名。" -#: ../../library/typing.rst:3255 +#: ../../library/typing.rst:3252 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3261 +#: ../../library/typing.rst:3258 msgid "Deprecated alias to :class:`collections.deque`." msgstr "棄用 :class:`collections.deque` 的別名。" -#: ../../library/typing.rst:3266 +#: ../../library/typing.rst:3263 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3273 +#: ../../library/typing.rst:3270 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:3278 +#: ../../library/typing.rst:3275 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:3282 +#: ../../library/typing.rst:3279 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:3285 +#: ../../library/typing.rst:3282 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -3141,391 +3141,391 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:3293 +#: ../../library/typing.rst:3290 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:3294 +#: ../../library/typing.rst:3291 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3300 +#: ../../library/typing.rst:3297 msgid "Deprecated alias for :class:`str`." msgstr "棄用 :class:`str` 的別名。" -#: ../../library/typing.rst:3302 +#: ../../library/typing.rst:3299 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:3306 +#: ../../library/typing.rst:3303 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:3314 +#: ../../library/typing.rst:3311 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:3324 +#: ../../library/typing.rst:3321 msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr ":mod:`collections.abc` 中容器 ABC 的別名" -#: ../../library/typing.rst:3328 +#: ../../library/typing.rst:3325 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "棄用 :class:`collections.abc.Set` 的別名。" -#: ../../library/typing.rst:3330 +#: ../../library/typing.rst:3327 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3336 +#: ../../library/typing.rst:3333 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:3340 +#: ../../library/typing.rst:3337 msgid "" "Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray " "| memoryview``." msgstr "" -#: ../../library/typing.rst:3344 +#: ../../library/typing.rst:3341 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "棄用 :class:`collections.abc.Collection` 的別名。" -#: ../../library/typing.rst:3348 +#: ../../library/typing.rst:3345 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3354 +#: ../../library/typing.rst:3351 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "棄用 :class:`collections.abc.Container` 的別名。" -#: ../../library/typing.rst:3356 +#: ../../library/typing.rst:3353 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3362 +#: ../../library/typing.rst:3359 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "棄用 :class:`collections.abc.ItemsView` 的別名。" -#: ../../library/typing.rst:3364 +#: ../../library/typing.rst:3361 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3370 +#: ../../library/typing.rst:3367 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "棄用 :class:`collections.abc.KeysView` 的別名。" -#: ../../library/typing.rst:3372 +#: ../../library/typing.rst:3369 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3378 +#: ../../library/typing.rst:3375 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "棄用 :class:`collections.abc.Mapping` 的別名。" -#: ../../library/typing.rst:3385 +#: ../../library/typing.rst:3382 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3391 +#: ../../library/typing.rst:3388 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "棄用 :class:`collections.abc.MappingView` 的別名。" -#: ../../library/typing.rst:3393 +#: ../../library/typing.rst:3390 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3399 +#: ../../library/typing.rst:3396 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "棄用 :class:`collections.abc.MutableMapping` 的別名。" -#: ../../library/typing.rst:3401 +#: ../../library/typing.rst:3398 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3408 +#: ../../library/typing.rst:3405 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "棄用 :class:`collections.abc.MutableSequence` 的別名。" -#: ../../library/typing.rst:3410 +#: ../../library/typing.rst:3407 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3417 +#: ../../library/typing.rst:3414 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "棄用 :class:`collections.abc.MutableSet` 的別名。" -#: ../../library/typing.rst:3419 +#: ../../library/typing.rst:3416 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3425 +#: ../../library/typing.rst:3422 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "棄用 :class:`collections.abc.Sequence` 的別名。" -#: ../../library/typing.rst:3427 +#: ../../library/typing.rst:3424 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3433 +#: ../../library/typing.rst:3430 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "棄用 :class:`collections.abc.ValuesView` 的別名。" -#: ../../library/typing.rst:3435 +#: ../../library/typing.rst:3432 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3442 +#: ../../library/typing.rst:3439 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3446 +#: ../../library/typing.rst:3443 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "棄用 :class:`collections.abc.Coroutine` 的別名。" -#: ../../library/typing.rst:3448 +#: ../../library/typing.rst:3445 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:3459 +#: ../../library/typing.rst:3456 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3465 +#: ../../library/typing.rst:3462 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "棄用 :class:`collections.abc.AsyncGenerator` 的別名。" -#: ../../library/typing.rst:3467 +#: ../../library/typing.rst:3464 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3476 +#: ../../library/typing.rst:3473 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:3480 +#: ../../library/typing.rst:3477 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3488 +#: ../../library/typing.rst:3485 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3498 +#: ../../library/typing.rst:3495 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3505 +#: ../../library/typing.rst:3502 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "棄用 :class:`collections.abc.AsyncIterable` 的別名。" -#: ../../library/typing.rst:3509 +#: ../../library/typing.rst:3506 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3515 +#: ../../library/typing.rst:3512 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "棄用 :class:`collections.abc.AsyncIterator` 的別名。" -#: ../../library/typing.rst:3519 +#: ../../library/typing.rst:3516 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3525 +#: ../../library/typing.rst:3522 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "棄用 :class:`collections.abc.Awaitable` 的別名。" -#: ../../library/typing.rst:3529 +#: ../../library/typing.rst:3526 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3536 +#: ../../library/typing.rst:3533 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3540 +#: ../../library/typing.rst:3537 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "棄用 :class:`collections.abc.Iterable` 的別名。" -#: ../../library/typing.rst:3542 +#: ../../library/typing.rst:3539 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3548 +#: ../../library/typing.rst:3545 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "棄用 :class:`collections.abc.Iterator` 的別名。" -#: ../../library/typing.rst:3550 +#: ../../library/typing.rst:3547 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3556 +#: ../../library/typing.rst:3553 msgid "Deprecated alias to :class:`collections.abc.Callable`." msgstr "棄用 :class:`collections.abc.Callable` 的別名。" -#: ../../library/typing.rst:3558 +#: ../../library/typing.rst:3555 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:3561 +#: ../../library/typing.rst:3558 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3571 +#: ../../library/typing.rst:3568 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "棄用 :class:`collections.abc.Generator` 的別名。" -#: ../../library/typing.rst:3573 +#: ../../library/typing.rst:3570 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:3582 +#: ../../library/typing.rst:3579 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:3586 +#: ../../library/typing.rst:3583 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3594 +#: ../../library/typing.rst:3591 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3602 +#: ../../library/typing.rst:3599 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3608 +#: ../../library/typing.rst:3605 msgid "Deprecated alias to :class:`collections.abc.Hashable`." msgstr "棄用 :class:`collections.abc.Hashable` 的別名。" -#: ../../library/typing.rst:3610 +#: ../../library/typing.rst:3607 msgid "Use :class:`collections.abc.Hashable` directly instead." msgstr "改為直接使用 :class:`collections.abc.Hashable`。" -#: ../../library/typing.rst:3615 +#: ../../library/typing.rst:3612 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "棄用 :class:`collections.abc.Reversible` 的別名。" -#: ../../library/typing.rst:3617 +#: ../../library/typing.rst:3614 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3623 +#: ../../library/typing.rst:3620 msgid "Deprecated alias to :class:`collections.abc.Sized`." msgstr "棄用 :class:`collections.abc.Sized` 的別名。" -#: ../../library/typing.rst:3625 +#: ../../library/typing.rst:3622 msgid "Use :class:`collections.abc.Sized` directly instead." msgstr "改為直接使用 :class:`collections.abc.Sized`。" -#: ../../library/typing.rst:3631 +#: ../../library/typing.rst:3628 msgid "Aliases to :mod:`contextlib` ABCs" msgstr ":mod:`contextlib` ABC 的別名" -#: ../../library/typing.rst:3635 +#: ../../library/typing.rst:3632 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3640 +#: ../../library/typing.rst:3637 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3647 +#: ../../library/typing.rst:3644 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3652 +#: ../../library/typing.rst:3649 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3658 +#: ../../library/typing.rst:3655 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3660 +#: ../../library/typing.rst:3657 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3533,99 +3533,99 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3667 +#: ../../library/typing.rst:3664 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3668 +#: ../../library/typing.rst:3665 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3669 +#: ../../library/typing.rst:3666 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3670 +#: ../../library/typing.rst:3667 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3671 +#: ../../library/typing.rst:3668 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "``typing.io`` 和 ``typing.re`` 子模組" -#: ../../library/typing.rst:3672 +#: ../../library/typing.rst:3669 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3673 +#: ../../library/typing.rst:3670 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3674 +#: ../../library/typing.rst:3671 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3675 +#: ../../library/typing.rst:3672 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3676 ../../library/typing.rst:3680 +#: ../../library/typing.rst:3673 ../../library/typing.rst:3677 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3677 +#: ../../library/typing.rst:3674 msgid "Undecided (see :ref:`deprecated-aliases` for more information)" msgstr "" -#: ../../library/typing.rst:3678 +#: ../../library/typing.rst:3675 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3679 +#: ../../library/typing.rst:3676 msgid ":class:`typing.ByteString`" msgstr ":class:`typing.ByteString`" -#: ../../library/typing.rst:3681 +#: ../../library/typing.rst:3678 msgid "3.14" msgstr "3.14" -#: ../../library/typing.rst:3682 +#: ../../library/typing.rst:3679 msgid ":gh:`91896`" msgstr ":gh:`91896`" -#: ../../library/typing.rst:3683 +#: ../../library/typing.rst:3680 msgid ":data:`typing.Text`" msgstr ":data:`typing.Text`" -#: ../../library/typing.rst:3684 +#: ../../library/typing.rst:3681 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3685 ../../library/typing.rst:3689 -#: ../../library/typing.rst:3693 +#: ../../library/typing.rst:3682 ../../library/typing.rst:3686 +#: ../../library/typing.rst:3690 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:3686 +#: ../../library/typing.rst:3683 msgid ":gh:`92332`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:3687 +#: ../../library/typing.rst:3684 msgid ":class:`typing.Hashable` and :class:`typing.Sized`" msgstr ":class:`typing.Hashable` 和 :class:`typing.Sized`。" -#: ../../library/typing.rst:3688 ../../library/typing.rst:3692 +#: ../../library/typing.rst:3685 ../../library/typing.rst:3689 msgid "3.12" msgstr "" -#: ../../library/typing.rst:3690 +#: ../../library/typing.rst:3687 msgid ":gh:`94309`" msgstr ":gh:`94309`" -#: ../../library/typing.rst:3691 +#: ../../library/typing.rst:3688 msgid ":data:`typing.TypeAlias`" msgstr ":data:`typing.TypeAlias`" -#: ../../library/typing.rst:3694 +#: ../../library/typing.rst:3691 msgid ":pep:`695`" msgstr ":pep:`695`" diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 6b9d6326e3..f23db0d849 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -469,9 +469,9 @@ msgid "" "mocks and the return value mock (if any) are reset as well." msgstr "" "這在你想要進行一系列重複使用同一物件的斷言時非常有用。請注意,預設情況下,:" -"meth:`reset_mock` *不會*\\ 清除回傳值、:attr:`side_effect` 或使用普通賦值設定的" -"任何子屬性。如果你想要重置 *return_value* 或 :attr:`side_effect`,則將相應的" -"參數設置為 ``True``。Child mock 和回傳值 mock(如果有的話)也會被重置。" +"meth:`reset_mock` *不會*\\ 清除回傳值、:attr:`side_effect` 或使用普通賦值設定" +"的任何子屬性。如果你想要重置 *return_value* 或 :attr:`side_effect`,則將相應" +"的參數設置為 ``True``。Child mock 和回傳值 mock(如果有的話)也會被重置。" #: ../../library/unittest.mock.rst:420 msgid "*return_value*, and :attr:`side_effect` are keyword-only arguments." diff --git a/library/unittest.po b/library/unittest.po index 4d7ca66c6a..469d67bfbb 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-31 00:03+0000\n" +"POT-Creation-Date: 2023-11-26 00:03+0000\n" "PO-Revision-Date: 2022-10-16 06:03+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2777,34 +2777,34 @@ msgid "" "names." msgstr "" -#: ../../library/unittest.rst:2322 +#: ../../library/unittest.rst:2324 msgid "load_tests Protocol" msgstr "" -#: ../../library/unittest.rst:2326 +#: ../../library/unittest.rst:2328 msgid "" "Modules or packages can customize how tests are loaded from them during " "normal test runs or test discovery by implementing a function called " "``load_tests``." msgstr "" -#: ../../library/unittest.rst:2329 +#: ../../library/unittest.rst:2331 msgid "" "If a test module defines ``load_tests`` it will be called by :meth:" "`TestLoader.loadTestsFromModule` with the following arguments::" msgstr "" -#: ../../library/unittest.rst:2334 +#: ../../library/unittest.rst:2336 msgid "" "where *pattern* is passed straight through from ``loadTestsFromModule``. It " "defaults to ``None``." msgstr "" -#: ../../library/unittest.rst:2337 +#: ../../library/unittest.rst:2339 msgid "It should return a :class:`TestSuite`." msgstr "" -#: ../../library/unittest.rst:2339 +#: ../../library/unittest.rst:2341 msgid "" "*loader* is the instance of :class:`TestLoader` doing the loading. " "*standard_tests* are the tests that would be loaded by default from the " @@ -2813,13 +2813,13 @@ msgid "" "packages as part of test discovery." msgstr "" -#: ../../library/unittest.rst:2345 +#: ../../library/unittest.rst:2347 msgid "" "A typical ``load_tests`` function that loads tests from a specific set of :" "class:`TestCase` classes may look like::" msgstr "" -#: ../../library/unittest.rst:2357 +#: ../../library/unittest.rst:2359 msgid "" "If discovery is started in a directory containing a package, either from the " "command line or by calling :meth:`TestLoader.discover`, then the package :" @@ -2829,31 +2829,31 @@ msgid "" "left up to ``load_tests`` which is called with the following arguments::" msgstr "" -#: ../../library/unittest.rst:2366 +#: ../../library/unittest.rst:2368 msgid "" "This should return a :class:`TestSuite` representing all the tests from the " "package. (``standard_tests`` will only contain tests collected from :file:" "`__init__.py`.)" msgstr "" -#: ../../library/unittest.rst:2370 +#: ../../library/unittest.rst:2372 msgid "" "Because the pattern is passed into ``load_tests`` the package is free to " "continue (and potentially modify) test discovery. A 'do nothing' " "``load_tests`` function for a test package would look like::" msgstr "" -#: ../../library/unittest.rst:2381 +#: ../../library/unittest.rst:2383 msgid "" "Discovery no longer checks package names for matching *pattern* due to the " "impossibility of package names matching the default pattern." msgstr "" -#: ../../library/unittest.rst:2388 +#: ../../library/unittest.rst:2390 msgid "Class and Module Fixtures" msgstr "" -#: ../../library/unittest.rst:2390 +#: ../../library/unittest.rst:2392 msgid "" "Class and module level fixtures are implemented in :class:`TestSuite`. When " "the test suite encounters a test from a new class then :meth:`tearDownClass` " @@ -2861,27 +2861,27 @@ msgid "" "`setUpClass` from the new class." msgstr "" -#: ../../library/unittest.rst:2395 +#: ../../library/unittest.rst:2397 msgid "" "Similarly if a test is from a different module from the previous test then " "``tearDownModule`` from the previous module is run, followed by " "``setUpModule`` from the new module." msgstr "" -#: ../../library/unittest.rst:2399 +#: ../../library/unittest.rst:2401 msgid "" "After all the tests have run the final ``tearDownClass`` and " "``tearDownModule`` are run." msgstr "" -#: ../../library/unittest.rst:2402 +#: ../../library/unittest.rst:2404 msgid "" "Note that shared fixtures do not play well with [potential] features like " "test parallelization and they break test isolation. They should be used with " "care." msgstr "" -#: ../../library/unittest.rst:2405 +#: ../../library/unittest.rst:2407 msgid "" "The default ordering of tests created by the unittest test loaders is to " "group all tests from the same modules and classes together. This will lead " @@ -2891,14 +2891,14 @@ msgid "" "functions may be called multiple times in a single test run." msgstr "" -#: ../../library/unittest.rst:2412 +#: ../../library/unittest.rst:2414 msgid "" "Shared fixtures are not intended to work with suites with non-standard " "ordering. A ``BaseTestSuite`` still exists for frameworks that don't want to " "support shared fixtures." msgstr "" -#: ../../library/unittest.rst:2416 +#: ../../library/unittest.rst:2418 msgid "" "If there are any exceptions raised during one of the shared fixture " "functions the test is reported as an error. Because there is no " @@ -2908,22 +2908,22 @@ msgid "" "matter, but if you are a framework author it may be relevant." msgstr "" -#: ../../library/unittest.rst:2425 +#: ../../library/unittest.rst:2427 msgid "setUpClass and tearDownClass" msgstr "" -#: ../../library/unittest.rst:2427 +#: ../../library/unittest.rst:2429 msgid "These must be implemented as class methods::" msgstr "" -#: ../../library/unittest.rst:2440 +#: ../../library/unittest.rst:2442 msgid "" "If you want the ``setUpClass`` and ``tearDownClass`` on base classes called " "then you must call up to them yourself. The implementations in :class:" "`TestCase` are empty." msgstr "" -#: ../../library/unittest.rst:2444 +#: ../../library/unittest.rst:2446 msgid "" "If an exception is raised during a ``setUpClass`` then the tests in the " "class are not run and the ``tearDownClass`` is not run. Skipped classes will " @@ -2932,15 +2932,15 @@ msgid "" "instead of as an error." msgstr "" -#: ../../library/unittest.rst:2452 +#: ../../library/unittest.rst:2454 msgid "setUpModule and tearDownModule" msgstr "" -#: ../../library/unittest.rst:2454 +#: ../../library/unittest.rst:2456 msgid "These should be implemented as functions::" msgstr "" -#: ../../library/unittest.rst:2462 +#: ../../library/unittest.rst:2464 msgid "" "If an exception is raised in a ``setUpModule`` then none of the tests in the " "module will be run and the ``tearDownModule`` will not be run. If the " @@ -2948,13 +2948,13 @@ msgid "" "having been skipped instead of as an error." msgstr "" -#: ../../library/unittest.rst:2467 +#: ../../library/unittest.rst:2469 msgid "" "To add cleanup code that must be run even in the case of an exception, use " "``addModuleCleanup``:" msgstr "" -#: ../../library/unittest.rst:2473 +#: ../../library/unittest.rst:2475 msgid "" "Add a function to be called after :func:`tearDownModule` to cleanup " "resources used during the test class. Functions will be called in reverse " @@ -2963,13 +2963,13 @@ msgid "" "`addModuleCleanup` when they are added." msgstr "" -#: ../../library/unittest.rst:2479 +#: ../../library/unittest.rst:2481 msgid "" "If :meth:`setUpModule` fails, meaning that :func:`tearDownModule` is not " "called, then any cleanup functions added will still be called." msgstr "" -#: ../../library/unittest.rst:2487 +#: ../../library/unittest.rst:2489 msgid "" "Enter the supplied :term:`context manager`. If successful, also add its :" "meth:`~object.__exit__` method as a cleanup function by :func:" @@ -2977,30 +2977,30 @@ msgid "" "method." msgstr "" -#: ../../library/unittest.rst:2497 +#: ../../library/unittest.rst:2499 msgid "" "This function is called unconditionally after :func:`tearDownModule`, or " "after :func:`setUpModule` if :func:`setUpModule` raises an exception." msgstr "" -#: ../../library/unittest.rst:2500 +#: ../../library/unittest.rst:2502 msgid "" "It is responsible for calling all the cleanup functions added by :func:" "`addModuleCleanup`. If you need cleanup functions to be called *prior* to :" "func:`tearDownModule` then you can call :func:`doModuleCleanups` yourself." msgstr "" -#: ../../library/unittest.rst:2505 +#: ../../library/unittest.rst:2507 msgid "" ":func:`doModuleCleanups` pops methods off the stack of cleanup functions one " "at a time, so it can be called at any time." msgstr "" -#: ../../library/unittest.rst:2512 +#: ../../library/unittest.rst:2514 msgid "Signal Handling" msgstr "" -#: ../../library/unittest.rst:2516 +#: ../../library/unittest.rst:2518 msgid "" "The :option:`-c/--catch ` command-line option to unittest, " "along with the ``catchbreak`` parameter to :func:`unittest.main()`, provide " @@ -3010,7 +3010,7 @@ msgid "" "A second control-c will raise a :exc:`KeyboardInterrupt` in the usual way." msgstr "" -#: ../../library/unittest.rst:2523 +#: ../../library/unittest.rst:2525 msgid "" "The control-c handling signal handler attempts to remain compatible with " "code or tests that install their own :const:`signal.SIGINT` handler. If the " @@ -3022,41 +3022,41 @@ msgid "" "disabled the :func:`removeHandler` decorator can be used." msgstr "" -#: ../../library/unittest.rst:2532 +#: ../../library/unittest.rst:2534 msgid "" "There are a few utility functions for framework authors to enable control-c " "handling functionality within test frameworks." msgstr "" -#: ../../library/unittest.rst:2537 +#: ../../library/unittest.rst:2539 msgid "" "Install the control-c handler. When a :const:`signal.SIGINT` is received " "(usually in response to the user pressing control-c) all registered results " "have :meth:`~TestResult.stop` called." msgstr "" -#: ../../library/unittest.rst:2544 +#: ../../library/unittest.rst:2546 msgid "" "Register a :class:`TestResult` object for control-c handling. Registering a " "result stores a weak reference to it, so it doesn't prevent the result from " "being garbage collected." msgstr "" -#: ../../library/unittest.rst:2548 +#: ../../library/unittest.rst:2550 msgid "" "Registering a :class:`TestResult` object has no side-effects if control-c " "handling is not enabled, so test frameworks can unconditionally register all " "results they create independently of whether or not handling is enabled." msgstr "" -#: ../../library/unittest.rst:2555 +#: ../../library/unittest.rst:2557 msgid "" "Remove a registered result. Once a result has been removed then :meth:" "`~TestResult.stop` will no longer be called on that result object in " "response to a control-c." msgstr "" -#: ../../library/unittest.rst:2562 +#: ../../library/unittest.rst:2564 msgid "" "When called without arguments this function removes the control-c handler if " "it has been installed. This function can also be used as a test decorator to " diff --git a/library/wsgiref.po b/library/wsgiref.po index 599513b00f..00003f6b38 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-20 00:03+0000\n" +"POT-Creation-Date: 2023-11-06 08:18+0000\n" "PO-Revision-Date: 2016-11-19 00:36+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -239,10 +239,11 @@ msgid "" "object's :meth:`read` method to obtain bytestrings to yield. When :meth:" "`read` returns an empty bytestring, iteration is ended and is not resumable." msgstr "" -":class:`wsgiref.types.FileWrapper` 協議的具體實作,用於將類檔案物件轉換" -"為 :term:`iterator`。產生的物件是 :term:`iterable`。當物件進行疊代時,將可選" -"的 *blksize* 引數重複傳遞給 *filelike* 物件的 :meth:`read` 方法來獲得將產生(yield)的" -"位元組字串。當 :meth:`read` 回傳一個空位元組字串,代表疊代已結束且無法回復。" +":class:`wsgiref.types.FileWrapper` 協議的具體實作,用於將類檔案物件轉換為 :" +"term:`iterator`。產生的物件是 :term:`iterable`。當物件進行疊代時,將可選的 " +"*blksize* 引數重複傳遞給 *filelike* 物件的 :meth:`read` 方法來獲得將產生" +"(yield)的位元組字串。當 :meth:`read` 回傳一個空位元組字串,代表疊代已結束且" +"無法回復。" #: ../../library/wsgiref.rst:166 msgid "" @@ -254,8 +255,8 @@ msgstr "" "法,並在呼叫時呼叫 *filelike* 物件的 :meth:`close` 方法。" #: ../../library/wsgiref.rst:182 -msgid "Support for :meth:`__getitem__` method has been removed." -msgstr "已移除對 :meth:`__getitem__` 方法的支援。" +msgid "Support for :meth:`~object.__getitem__` method has been removed." +msgstr "已移除對 :meth:`~object.__getitem__` 方法的支援。" #: ../../library/wsgiref.rst:187 msgid ":mod:`wsgiref.headers` -- WSGI response header tools" @@ -450,8 +451,8 @@ msgid "" "You do not normally need to call this constructor, as the :func:" "`make_server` function can handle all the details for you." msgstr "" -"通常你不需要呼叫這個建構函式(constructor),因為 :func:`make_server` 函式可以為你處理所有細" -"節。" +"通常你不需要呼叫這個建構函式(constructor),因為 :func:`make_server` 函式可" +"以為你處理所有細節。" #: ../../library/wsgiref.rst:325 msgid "" @@ -501,9 +502,9 @@ msgid "" "`make_server` function. Some possibly relevant methods for overriding in " "subclasses:" msgstr "" -"你不需要直接建立這個類別的實例;它們會在需要時由 :class:`WSGIServer` 物件自動建" -"立。不過,你可以建立這個類別的子類別並將其作為 *handler_class* 提供給 :func:" -"`make_server` 函式。一些可能相關的方法可以在子類別中進行覆寫:" +"你不需要直接建立這個類別的實例;它們會在需要時由 :class:`WSGIServer` 物件自動" +"建立。不過,你可以建立這個類別的子類別並將其作為 *handler_class* 提供給 :" +"func:`make_server` 函式。一些可能相關的方法可以在子類別中進行覆寫:" #: ../../library/wsgiref.rst:359 msgid "" @@ -754,8 +755,8 @@ msgid "" "The :meth:`~io.BufferedIOBase.write` method of *stdout* should write each " "chunk in full, like :class:`io.BufferedIOBase`." msgstr "" -"*stdout* 的 :meth:`~io.BufferedIOBase.write` 方法應該完整地寫入每個塊(chunk),像是 :" -"class:`io.BufferedIOBase`。" +"*stdout* 的 :meth:`~io.BufferedIOBase.write` 方法應該完整地寫入每個塊" +"(chunk),像是 :class:`io.BufferedIOBase`。" #: ../../library/wsgiref.rst:535 msgid "" diff --git a/library/xml.dom.po b/library/xml.dom.po index f6a4f67364..9d91f2189f 100644 --- a/library/xml.dom.po +++ b/library/xml.dom.po @@ -56,9 +56,9 @@ msgstr "" #: ../../library/xml.dom.rst:33 msgid "" -"The Document Object Model is being defined by the W3C in stages, or \"levels" -"\" in their terminology. The Python mapping of the API is substantially " -"based on the DOM Level 2 recommendation." +"The Document Object Model is being defined by the W3C in stages, or " +"\"levels\" in their terminology. The Python mapping of the API is " +"substantially based on the DOM Level 2 recommendation." msgstr "" #: ../../library/xml.dom.rst:45 diff --git a/library/xml.po b/library/xml.po index 0bdf948410..aa38c6ef93 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-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-11-27 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-" @@ -188,11 +188,11 @@ msgstr "**脆弱**" msgid "" "Expat 2.4.1 and newer is not vulnerable to the \"billion laughs\" and " "\"quadratic blowup\" vulnerabilities. Items still listed as vulnerable due " -"to potential reliance on system-provided libraries. Check :const:`pyexpat." +"to potential reliance on system-provided libraries. Check :const:`!pyexpat." "EXPAT_VERSION`." msgstr "" "Expat 2.4.1 及更新的版本不易受到「十億笑聲」和「二次爆炸」漏洞的影響。但仍可" -"能由於依賴系統提供的函式庫而被列為易受攻擊的項目。請檢查 :const:`pyexpat." +"能由於依賴系統提供的函式庫而被列為易受攻擊的項目。請檢查 :const:`!pyexpat." "EXPAT_VERSION`。" #: ../../library/xml.rst:77 diff --git a/reference/datamodel.po b/reference/datamodel.po index 48ab47c007..856acc800b 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-20 00:03+0000\n" +"POT-Creation-Date: 2023-12-06 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-" @@ -105,7 +105,7 @@ msgid "" "or windows. It is understood that these resources are freed when the object " "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 " +"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 " "ways to do this." @@ -598,7 +598,7 @@ msgid "" "containing the same number of items as the function's formal parameter list." msgstr "" -#: ../../reference/datamodel.rst:535 ../../reference/datamodel.rst:926 +#: ../../reference/datamodel.rst:535 ../../reference/datamodel.rst:928 msgid "Special attributes:" msgstr "" @@ -610,8 +610,8 @@ msgstr "屬性" msgid "Meaning" msgstr "" -#: ../../reference/datamodel.rst:556 ../../reference/datamodel.rst:843 -#: ../../reference/datamodel.rst:942 +#: ../../reference/datamodel.rst:556 ../../reference/datamodel.rst:845 +#: ../../reference/datamodel.rst:944 msgid ":attr:`__doc__`" msgstr ":attr:`__doc__`" @@ -645,7 +645,7 @@ msgstr ":attr:`~definition.\\ __qualname__`" msgid "The function's :term:`qualified name`." msgstr "" -#: ../../reference/datamodel.rst:569 ../../reference/datamodel.rst:932 +#: ../../reference/datamodel.rst:569 ../../reference/datamodel.rst:934 msgid ":attr:`__module__`" msgstr ":attr:`__module__`" @@ -687,7 +687,7 @@ msgstr "" msgid "Read-only" msgstr "" -#: ../../reference/datamodel.rst:589 ../../reference/datamodel.rst:935 +#: ../../reference/datamodel.rst:589 ../../reference/datamodel.rst:937 msgid ":attr:`~object.__dict__`" msgstr ":attr:`~object.__dict__`" @@ -705,8 +705,8 @@ msgid "" "variables. See below for information on the ``cell_contents`` attribute." msgstr "" -#: ../../reference/datamodel.rst:600 ../../reference/datamodel.rst:858 -#: ../../reference/datamodel.rst:949 +#: ../../reference/datamodel.rst:600 ../../reference/datamodel.rst:860 +#: ../../reference/datamodel.rst:951 msgid ":attr:`__annotations__`" msgstr ":attr:`__annotations__`" @@ -726,7 +726,7 @@ msgstr ":attr:`__kwdefaults__`" msgid "A dict containing defaults for keyword-only parameters." msgstr "" -#: ../../reference/datamodel.rst:613 ../../reference/datamodel.rst:954 +#: ../../reference/datamodel.rst:613 ../../reference/datamodel.rst:956 msgid ":attr:`__type_params__`" msgstr ":attr:`__type_params__`" @@ -765,17 +765,17 @@ msgid "" "`cell ` type can be accessed in the :mod:`types` module." msgstr "" -#: ../../reference/datamodel.rst:638 +#: ../../reference/datamodel.rst:640 msgid "Instance methods" msgstr "" -#: ../../reference/datamodel.rst:645 +#: ../../reference/datamodel.rst:647 msgid "" "An instance method object combines a class, a class instance and any " "callable object (normally a user-defined function)." msgstr "" -#: ../../reference/datamodel.rst:655 +#: ../../reference/datamodel.rst:657 msgid "" "Special read-only attributes: :attr:`__self__` is the class instance " "object, :attr:`__func__` is the function object; :attr:`__doc__` is the " @@ -785,20 +785,20 @@ msgid "" "``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:661 +#: ../../reference/datamodel.rst:663 msgid "" "Methods also support accessing (but not setting) the arbitrary function " "attributes on the underlying function object." msgstr "" -#: ../../reference/datamodel.rst:664 +#: ../../reference/datamodel.rst:666 msgid "" "User-defined method objects may be created when getting an attribute of a " "class (perhaps via an instance of that class), if that attribute is a user-" "defined function object or a class method object." msgstr "" -#: ../../reference/datamodel.rst:668 +#: ../../reference/datamodel.rst:670 msgid "" "When an instance method object is created by retrieving a user-defined " "function object from a class via one of its instances, its :attr:`__self__` " @@ -806,7 +806,7 @@ msgid "" "new method's :attr:`__func__` attribute is the original function object." msgstr "" -#: ../../reference/datamodel.rst:674 +#: ../../reference/datamodel.rst:676 msgid "" "When an instance method object is created by retrieving a class method " "object from a class or instance, its :attr:`__self__` attribute is the class " @@ -814,16 +814,16 @@ msgid "" "the class method." msgstr "" -#: ../../reference/datamodel.rst:679 +#: ../../reference/datamodel.rst:681 msgid "" "When an instance method object is called, the underlying function (:attr:" "`__func__`) is called, inserting the class instance (:attr:`__self__`) in " -"front of the argument list. For instance, when :class:`C` is a class which " -"contains a definition for a function :meth:`f`, and ``x`` is an instance of :" -"class:`C`, calling ``x.f(1)`` is equivalent to calling ``C.f(x, 1)``." +"front of the argument list. For instance, when :class:`!C` is a class which " +"contains a definition for a function :meth:`!f`, and ``x`` is an instance " +"of :class:`!C`, calling ``x.f(1)`` is equivalent to calling ``C.f(x, 1)``." msgstr "" -#: ../../reference/datamodel.rst:686 +#: ../../reference/datamodel.rst:688 msgid "" "When an instance method object is derived from a class method object, the " "\"class instance\" stored in :attr:`__self__` will actually be the class " @@ -831,7 +831,7 @@ msgid "" "calling ``f(C,1)`` where ``f`` is the underlying function." msgstr "" -#: ../../reference/datamodel.rst:691 +#: ../../reference/datamodel.rst:693 msgid "" "Note that the transformation from function object to instance method object " "happens each time the attribute is retrieved from the instance. In some " @@ -844,11 +844,11 @@ msgid "" "the function is an attribute of the class." msgstr "" -#: ../../reference/datamodel.rst:704 +#: ../../reference/datamodel.rst:706 msgid "Generator functions" msgstr "" -#: ../../reference/datamodel.rst:710 +#: ../../reference/datamodel.rst:712 msgid "" "A function or method which uses the :keyword:`yield` statement (see section :" "ref:`yield`) is called a :dfn:`generator function`. Such a function, when " @@ -861,11 +861,11 @@ msgid "" "values to be returned." msgstr "" -#: ../../reference/datamodel.rst:722 +#: ../../reference/datamodel.rst:724 msgid "Coroutine functions" msgstr "" -#: ../../reference/datamodel.rst:727 +#: ../../reference/datamodel.rst:729 msgid "" "A function or method which is defined using :keyword:`async def` is called " "a :dfn:`coroutine function`. Such a function, when called, returns a :term:" @@ -874,11 +874,11 @@ msgid "" "ref:`coroutine-objects` section." msgstr "" -#: ../../reference/datamodel.rst:735 +#: ../../reference/datamodel.rst:737 msgid "Asynchronous generator functions" msgstr "" -#: ../../reference/datamodel.rst:741 +#: ../../reference/datamodel.rst:743 msgid "" "A function or method which is defined using :keyword:`async def` and which " "uses the :keyword:`yield` statement is called a :dfn:`asynchronous generator " @@ -887,7 +887,7 @@ msgid "" "execute the body of the function." msgstr "" -#: ../../reference/datamodel.rst:747 +#: ../../reference/datamodel.rst:749 msgid "" "Calling the asynchronous iterator's :meth:`aiterator.__anext__ ` method will return an :term:`awaitable` which when awaited will " @@ -898,11 +898,11 @@ msgid "" "yielded." msgstr "" -#: ../../reference/datamodel.rst:758 +#: ../../reference/datamodel.rst:760 msgid "Built-in functions" msgstr "" -#: ../../reference/datamodel.rst:765 +#: ../../reference/datamodel.rst:767 msgid "" "A built-in function object is a wrapper around a C function. Examples of " "built-in functions are :func:`len` and :func:`math.sin` (:mod:`math` is a " @@ -914,11 +914,11 @@ msgid "" "module the function was defined in or ``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:776 +#: ../../reference/datamodel.rst:778 msgid "Built-in methods" msgstr "" -#: ../../reference/datamodel.rst:783 +#: ../../reference/datamodel.rst:785 msgid "" "This is really a different disguise of a built-in function, this time " "containing an object passed to the C function as an implicit extra " @@ -927,34 +927,34 @@ msgid "" "attr:`__self__` is set to the object denoted by *alist*." msgstr "" -#: ../../reference/datamodel.rst:791 +#: ../../reference/datamodel.rst:793 msgid "Classes" msgstr "" -#: ../../reference/datamodel.rst:793 +#: ../../reference/datamodel.rst:795 msgid "" "Classes are callable. These objects normally act as factories for new " "instances of themselves, but variations are possible for class types that " "override :meth:`~object.__new__`. The arguments of the call are passed to :" -"meth:`__new__` and, in the typical case, to :meth:`~object.__init__` to " +"meth:`!__new__` and, in the typical case, to :meth:`~object.__init__` to " "initialize the new instance." msgstr "" -#: ../../reference/datamodel.rst:801 +#: ../../reference/datamodel.rst:803 msgid "Class Instances" msgstr "" -#: ../../reference/datamodel.rst:803 +#: ../../reference/datamodel.rst:805 msgid "" "Instances of arbitrary classes can be made callable by defining a :meth:" "`~object.__call__` method in their class." msgstr "" -#: ../../reference/datamodel.rst:808 +#: ../../reference/datamodel.rst:810 msgid "Modules" msgstr "模組" -#: ../../reference/datamodel.rst:814 +#: ../../reference/datamodel.rst:816 msgid "" "Modules are a basic organizational unit of Python code, and are created by " "the :ref:`import system ` as invoked either by the :keyword:" @@ -968,33 +968,33 @@ msgid "" "needed once the initialization is done)." msgstr "" -#: ../../reference/datamodel.rst:826 +#: ../../reference/datamodel.rst:828 msgid "" "Attribute assignment updates the module's namespace dictionary, e.g., ``m.x " "= 1`` is equivalent to ``m.__dict__[\"x\"] = 1``." msgstr "" -#: ../../reference/datamodel.rst:836 +#: ../../reference/datamodel.rst:838 msgid "Predefined (writable) attributes:" msgstr "" -#: ../../reference/datamodel.rst:839 +#: ../../reference/datamodel.rst:841 msgid ":attr:`__name__`" msgstr ":attr:`__name__`" -#: ../../reference/datamodel.rst:839 +#: ../../reference/datamodel.rst:841 msgid "The module's name." msgstr "" -#: ../../reference/datamodel.rst:842 +#: ../../reference/datamodel.rst:844 msgid "The module's documentation string, or ``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:852 +#: ../../reference/datamodel.rst:854 msgid ":attr:`__file__`" msgstr ":attr:`__file__`" -#: ../../reference/datamodel.rst:846 +#: ../../reference/datamodel.rst:848 msgid "" "The pathname of the file from which the module was loaded, if it was loaded " "from a file. The :attr:`__file__` attribute may be missing for certain types " @@ -1003,20 +1003,20 @@ msgid "" "library, it's the pathname of the shared library file." msgstr "" -#: ../../reference/datamodel.rst:855 +#: ../../reference/datamodel.rst:857 msgid "" "A dictionary containing :term:`variable annotations ` " "collected during module body execution. For best practices on working with :" "attr:`__annotations__`, please see :ref:`annotations-howto`." msgstr "" -#: ../../reference/datamodel.rst:862 +#: ../../reference/datamodel.rst:864 msgid "" "Special read-only attribute: :attr:`~object.__dict__` is the module's " "namespace as a dictionary object." msgstr "" -#: ../../reference/datamodel.rst:867 +#: ../../reference/datamodel.rst:869 msgid "" "Because of the way CPython clears module dictionaries, the module dictionary " "will be cleared when the module falls out of scope even if the dictionary " @@ -1024,11 +1024,11 @@ msgid "" "module around while using its dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:874 +#: ../../reference/datamodel.rst:876 msgid "Custom classes" msgstr "" -#: ../../reference/datamodel.rst:876 +#: ../../reference/datamodel.rst:878 msgid "" "Custom class types are typically created by class definitions (see section :" "ref:`class`). A class has a namespace implemented by a dictionary object. " @@ -1044,77 +1044,77 @@ msgid "" "python.org/download/releases/2.3/mro/." msgstr "" -#: ../../reference/datamodel.rst:900 +#: ../../reference/datamodel.rst:902 msgid "" -"When a class attribute reference (for class :class:`C`, say) would yield a " +"When a class attribute reference (for class :class:`!C`, say) would yield a " "class method object, it is transformed into an instance method object whose :" -"attr:`__self__` attribute is :class:`C`. When it would yield a static " +"attr:`__self__` attribute is :class:`!C`. When it would yield a static " "method object, it is transformed into the object wrapped by the static " "method object. See section :ref:`descriptors` for another way in which " "attributes retrieved from a class may differ from those actually contained " "in its :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:910 +#: ../../reference/datamodel.rst:912 msgid "" "Class attribute assignments update the class's dictionary, never the " "dictionary of a base class." msgstr "" -#: ../../reference/datamodel.rst:915 +#: ../../reference/datamodel.rst:917 msgid "" "A class object can be called (see above) to yield a class instance (see " "below)." msgstr "" -#: ../../reference/datamodel.rst:929 +#: ../../reference/datamodel.rst:931 msgid ":attr:`~definition.__name__`" msgstr ":attr:`~definition.__name__`" -#: ../../reference/datamodel.rst:929 +#: ../../reference/datamodel.rst:931 msgid "The class name." msgstr "" -#: ../../reference/datamodel.rst:932 +#: ../../reference/datamodel.rst:934 msgid "The name of the module in which the class was defined." msgstr "" -#: ../../reference/datamodel.rst:935 +#: ../../reference/datamodel.rst:937 msgid "The dictionary containing the class's namespace." msgstr "" -#: ../../reference/datamodel.rst:939 +#: ../../reference/datamodel.rst:941 msgid ":attr:`~class.__bases__`" msgstr ":attr:`~class.__bases__`" -#: ../../reference/datamodel.rst:938 +#: ../../reference/datamodel.rst:940 msgid "" "A tuple containing the base classes, in the order of their occurrence in the " "base class list." msgstr "" -#: ../../reference/datamodel.rst:942 +#: ../../reference/datamodel.rst:944 msgid "The class's documentation string, or ``None`` if undefined." msgstr "" -#: ../../reference/datamodel.rst:945 +#: ../../reference/datamodel.rst:947 msgid "" "A dictionary containing :term:`variable annotations ` " "collected during class body execution. For best practices on working with :" "attr:`__annotations__`, please see :ref:`annotations-howto`." msgstr "" -#: ../../reference/datamodel.rst:952 +#: ../../reference/datamodel.rst:954 msgid "" "A tuple containing the :ref:`type parameters ` of a :ref:" "`generic class `." msgstr "" -#: ../../reference/datamodel.rst:957 +#: ../../reference/datamodel.rst:959 msgid "Class instances" msgstr "" -#: ../../reference/datamodel.rst:965 +#: ../../reference/datamodel.rst:967 msgid "" "A class instance is created by calling a class object (see above). A class " "instance has a namespace implemented as a dictionary which is the first " @@ -1131,7 +1131,7 @@ msgid "" "__getattr__` method, that is called to satisfy the lookup." msgstr "" -#: ../../reference/datamodel.rst:981 +#: ../../reference/datamodel.rst:983 msgid "" "Attribute assignments and deletions update the instance's dictionary, never " "a class's dictionary. If the class has a :meth:`~object.__setattr__` or :" @@ -1139,23 +1139,23 @@ msgid "" "instance dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:991 +#: ../../reference/datamodel.rst:993 msgid "" "Class instances can pretend to be numbers, sequences, or mappings if they " "have methods with certain special names. See section :ref:`specialnames`." msgstr "" -#: ../../reference/datamodel.rst:998 +#: ../../reference/datamodel.rst:1000 msgid "" "Special attributes: :attr:`~object.__dict__` is the attribute dictionary; :" "attr:`~instance.__class__` is the instance's class." msgstr "" -#: ../../reference/datamodel.rst:1003 +#: ../../reference/datamodel.rst:1005 msgid "I/O objects (also known as file objects)" msgstr "" -#: ../../reference/datamodel.rst:1018 +#: ../../reference/datamodel.rst:1020 msgid "" "A :term:`file object` represents an open file. Various shortcuts are " "available to create file objects: the :func:`open` built-in function, and " @@ -1164,7 +1164,7 @@ msgid "" "methods provided by extension modules)." msgstr "" -#: ../../reference/datamodel.rst:1024 +#: ../../reference/datamodel.rst:1026 msgid "" "The objects ``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` are initialized " "to file objects corresponding to the interpreter's standard input, output " @@ -1172,22 +1172,22 @@ msgid "" "interface defined by the :class:`io.TextIOBase` abstract class." msgstr "" -#: ../../reference/datamodel.rst:1032 +#: ../../reference/datamodel.rst:1034 msgid "Internal types" msgstr "" -#: ../../reference/datamodel.rst:1038 +#: ../../reference/datamodel.rst:1040 msgid "" "A few types used internally by the interpreter are exposed to the user. " "Their definitions may change with future versions of the interpreter, but " "they are mentioned here for completeness." msgstr "" -#: ../../reference/datamodel.rst:1046 +#: ../../reference/datamodel.rst:1048 msgid "Code objects" msgstr "" -#: ../../reference/datamodel.rst:1050 +#: ../../reference/datamodel.rst:1052 msgid "" "Code objects represent *byte-compiled* executable Python code, or :term:" "`bytecode`. The difference between a code object and a function object is " @@ -1199,7 +1199,7 @@ msgid "" "no references (directly or indirectly) to mutable objects." msgstr "" -#: ../../reference/datamodel.rst:1078 +#: ../../reference/datamodel.rst:1080 msgid "" "Special read-only attributes: :attr:`co_name` gives the function name; :attr:" "`co_qualname` gives the fully qualified function name; :attr:`co_argcount` " @@ -1225,7 +1225,7 @@ msgid "" "flags for the interpreter." msgstr "" -#: ../../reference/datamodel.rst:1104 +#: ../../reference/datamodel.rst:1106 msgid "" "The following flag bits are defined for :attr:`co_flags`: bit ``0x04`` is " "set if the function uses the ``*arguments`` syntax to accept an arbitrary " @@ -1234,7 +1234,7 @@ msgid "" "set if the function is a generator." msgstr "" -#: ../../reference/datamodel.rst:1110 +#: ../../reference/datamodel.rst:1112 msgid "" "Future feature declarations (``from __future__ import division``) also use " "bits in :attr:`co_flags` to indicate whether a code object was compiled with " @@ -1243,23 +1243,23 @@ msgid "" "used in earlier versions of Python." msgstr "" -#: ../../reference/datamodel.rst:1116 +#: ../../reference/datamodel.rst:1118 msgid "Other bits in :attr:`co_flags` are reserved for internal use." msgstr "" -#: ../../reference/datamodel.rst:1120 +#: ../../reference/datamodel.rst:1122 msgid "" "If a code object represents a function, the first item in :attr:`co_consts` " "is the documentation string of the function, or ``None`` if undefined." msgstr "" -#: ../../reference/datamodel.rst:1125 +#: ../../reference/datamodel.rst:1127 msgid "" "Returns an iterable over the source code positions of each bytecode " "instruction in the code object." msgstr "" -#: ../../reference/datamodel.rst:1128 +#: ../../reference/datamodel.rst:1130 msgid "" "The iterator returns tuples containing the ``(start_line, end_line, " "start_column, end_column)``. The *i-th* tuple corresponds to the position of " @@ -1267,37 +1267,37 @@ msgid "" "is 0-indexed utf-8 byte offsets on the given source line." msgstr "" -#: ../../reference/datamodel.rst:1134 +#: ../../reference/datamodel.rst:1136 msgid "" "This positional information can be missing. A non-exhaustive lists of cases " "where this may happen:" msgstr "" -#: ../../reference/datamodel.rst:1137 +#: ../../reference/datamodel.rst:1139 msgid "Running the interpreter with :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1138 +#: ../../reference/datamodel.rst:1140 msgid "" "Loading a pyc file compiled while using :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1139 +#: ../../reference/datamodel.rst:1141 msgid "Position tuples corresponding to artificial instructions." msgstr "" -#: ../../reference/datamodel.rst:1140 +#: ../../reference/datamodel.rst:1142 msgid "" "Line and column numbers that can't be represented due to implementation " "specific limitations." msgstr "" -#: ../../reference/datamodel.rst:1143 +#: ../../reference/datamodel.rst:1145 msgid "" "When this occurs, some or all of the tuple elements can be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:1149 +#: ../../reference/datamodel.rst:1151 msgid "" "This feature requires storing column positions in code objects which may " "result in a small increase of disk usage of compiled Python files or " @@ -1307,87 +1307,123 @@ msgid "" "environment variable can be used." msgstr "" -#: ../../reference/datamodel.rst:1160 +#: ../../reference/datamodel.rst:1162 msgid "Frame objects" msgstr "" -#: ../../reference/datamodel.rst:1164 +#: ../../reference/datamodel.rst:1166 msgid "" "Frame objects represent execution frames. They may occur in traceback " "objects (see below), and are also passed to registered trace functions." msgstr "" -#: ../../reference/datamodel.rst:1175 -msgid "" -"Special read-only attributes: :attr:`f_back` is to the previous stack frame " -"(towards the caller), or ``None`` if this is the bottom stack frame; :attr:" -"`f_code` is the code object being executed in this frame; :attr:`f_locals` " -"is the dictionary used to look up local variables; :attr:`f_globals` is used " -"for global variables; :attr:`f_builtins` is used for built-in (intrinsic) " -"names; :attr:`f_lasti` gives the precise instruction (this is an index into " -"the bytecode string of the code object)." +#: ../../reference/datamodel.rst:1178 +msgid "Special read-only attributes" msgstr "" #: ../../reference/datamodel.rst:1183 msgid "" -"Accessing ``f_code`` raises an :ref:`auditing event ` ``object." +"Points to the previous stack frame (towards the caller), or ``None`` if this " +"is the bottom stack frame" +msgstr "" + +#: ../../reference/datamodel.rst:1187 +msgid "" +"The :ref:`code object ` being executed in this frame. " +"Accessing this attribute raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"f_code\"``." msgstr "" -"存取 ``f_code`` 會引發一個附帶引數 ``obj`` 與 ``\"f_code\"`` 的\\ :ref:`稽核" -"事件 ` ``object.__getattr__``。" +"在這個 frame 中執行的\\ :ref:`程式碼物件 (code object) `。存取" +"這個屬性會引發一個附帶引數 ``obj`` 與 ``\"f_code\"`` 的\\ :ref:`稽核事件 " +"` ``object.__getattr__``。" #: ../../reference/datamodel.rst:1192 msgid "" -"Special writable attributes: :attr:`f_trace`, if not ``None``, is a function " -"called for various events during code execution (this is used by the " -"debugger). Normally an event is triggered for each new source line - this " -"can be disabled by setting :attr:`f_trace_lines` to :const:`False`." +"The dictionary used by the frame to look up :ref:`local variables `" +msgstr "" + +#: ../../reference/datamodel.rst:1196 +msgid "" +"The dictionary used by the frame to look up :ref:`global variables `" msgstr "" -#: ../../reference/datamodel.rst:1197 +#: ../../reference/datamodel.rst:1200 msgid "" -"Implementations *may* allow per-opcode events to be requested by setting :" -"attr:`f_trace_opcodes` to :const:`True`. Note that this may lead to " -"undefined interpreter behaviour if exceptions raised by the trace function " -"escape to the function being traced." +"The dictionary used by the frame to look up :ref:`built-in (intrinsic) names " +"`" msgstr "" -#: ../../reference/datamodel.rst:1202 +#: ../../reference/datamodel.rst:1204 msgid "" -":attr:`f_lineno` is 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 debugger can implement a Jump command (aka Set Next " -"Statement) by writing to f_lineno." +"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:1207 +#: ../../reference/datamodel.rst:1215 +msgid "Special writable attributes" +msgstr "特殊可寫屬性" + +#: ../../reference/datamodel.rst:1220 +msgid "" +"If not ``None``, this is a function called for various events during code " +"execution (this is used by debuggers). Normally an event is triggered for " +"each new source line (see :attr:`~frame.f_trace_lines`)." +msgstr "" + +#: ../../reference/datamodel.rst:1225 +msgid "" +"Set this attribute to :const:`False` to disable triggering a tracing event " +"for each source line." +msgstr "" + +#: ../../reference/datamodel.rst:1229 +msgid "" +"Set this attribute to :const:`True` to allow per-opcode events to be " +"requested. Note that this may lead to undefined interpreter behaviour if " +"exceptions raised by the trace function escape to the function being traced." +msgstr "" + +#: ../../reference/datamodel.rst:1235 +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 " +"debugger can implement a Jump command (aka Set Next Statement) by writing to " +"this attribute." +msgstr "" + +#: ../../reference/datamodel.rst:1241 +msgid "Frame object methods" +msgstr "" + +#: ../../reference/datamodel.rst:1243 msgid "Frame objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1211 +#: ../../reference/datamodel.rst:1247 msgid "" -"This method clears all references to local variables held by the frame. " -"Also, if the frame belonged to a generator, the generator is finalized. " -"This helps break reference cycles involving frame objects (for example when " -"catching an exception and storing its traceback for later use)." +"This method clears all references to :ref:`local variables ` held by " +"the frame. Also, if the frame belonged to a :term:`generator`, the " +"generator is finalized. This helps break reference cycles involving frame " +"objects (for example when catching an :ref:`exception ` " +"and storing its :ref:`traceback ` for later use)." msgstr "" -#: ../../reference/datamodel.rst:1217 +#: ../../reference/datamodel.rst:1253 msgid ":exc:`RuntimeError` is raised if the frame is currently executing." msgstr "" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1261 msgid "Traceback objects" msgstr "" -#: ../../reference/datamodel.rst:1238 +#: ../../reference/datamodel.rst:1274 msgid "" "Traceback objects represent a stack trace of an exception. A traceback " "object is implicitly created when an exception occurs, and may also be " "explicitly created by calling :class:`types.TracebackType`." msgstr "" -#: ../../reference/datamodel.rst:1242 +#: ../../reference/datamodel.rst:1278 msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " @@ -1397,21 +1433,21 @@ msgid "" "exc_info()``, and as the ``__traceback__`` attribute of the caught exception." msgstr "" -#: ../../reference/datamodel.rst:1250 +#: ../../reference/datamodel.rst:1286 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " "interactive, it is also made available to the user as ``sys.last_traceback``." msgstr "" -#: ../../reference/datamodel.rst:1255 +#: ../../reference/datamodel.rst:1291 msgid "" "For explicitly created tracebacks, it is up to the creator of the traceback " "to determine how the ``tb_next`` attributes should be linked to form a full " "stack trace." msgstr "" -#: ../../reference/datamodel.rst:1265 +#: ../../reference/datamodel.rst:1301 msgid "" "Special read-only attributes: :attr:`tb_frame` points to the execution frame " "of the current level; :attr:`tb_lineno` gives the line number where the " @@ -1421,7 +1457,7 @@ msgid "" "statement with no matching except clause or with a finally clause." msgstr "" -#: ../../reference/datamodel.rst:1274 +#: ../../reference/datamodel.rst:1310 msgid "" "Accessing ``tb_frame`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." @@ -1429,41 +1465,41 @@ msgstr "" "存取 ``tb_frame`` 會引發一個附帶引數 ``obj`` 與 ``\"tb_frame\"`` 的\\ :ref:`" "稽核事件 ` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1280 +#: ../../reference/datamodel.rst:1316 msgid "" "Special writable attribute: :attr:`tb_next` is the next level in the stack " "trace (towards the frame where the exception occurred), or ``None`` if there " "is no next level." msgstr "" -#: ../../reference/datamodel.rst:1284 +#: ../../reference/datamodel.rst:1320 msgid "" "Traceback objects can now be explicitly instantiated from Python code, and " "the ``tb_next`` attribute of existing instances can be updated." msgstr "" -#: ../../reference/datamodel.rst:1290 +#: ../../reference/datamodel.rst:1326 msgid "Slice objects" msgstr "" -#: ../../reference/datamodel.rst:1294 +#: ../../reference/datamodel.rst:1330 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:1303 +#: ../../reference/datamodel.rst:1339 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:1307 +#: ../../reference/datamodel.rst:1343 msgid "Slice objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1311 +#: ../../reference/datamodel.rst:1347 msgid "" "This method takes a single integer argument *length* and computes " "information about the slice that the slice object would describe if applied " @@ -1473,11 +1509,11 @@ msgid "" "a manner consistent with regular slices." msgstr "" -#: ../../reference/datamodel.rst:1320 +#: ../../reference/datamodel.rst:1356 msgid "Static method objects" msgstr "" -#: ../../reference/datamodel.rst:1322 +#: ../../reference/datamodel.rst:1358 msgid "" "Static method objects provide a way of defeating the transformation of " "function objects to method objects described above. A static method object " @@ -1488,11 +1524,11 @@ msgid "" "method objects are created by the built-in :func:`staticmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1332 +#: ../../reference/datamodel.rst:1368 msgid "Class method objects" msgstr "" -#: ../../reference/datamodel.rst:1334 +#: ../../reference/datamodel.rst:1370 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 " @@ -1501,11 +1537,11 @@ msgid "" "objects are created by the built-in :func:`classmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:1380 msgid "Special method names" msgstr "" -#: ../../reference/datamodel.rst:1350 +#: ../../reference/datamodel.rst:1386 msgid "" "A class can implement certain operations that are invoked by special syntax " "(such as arithmetic operations or subscripting and slicing) by defining " @@ -1519,7 +1555,7 @@ msgid "" "`TypeError`)." msgstr "" -#: ../../reference/datamodel.rst:1361 +#: ../../reference/datamodel.rst:1397 msgid "" "Setting a special method to ``None`` indicates that the corresponding " "operation is not available. For example, if a class sets :meth:`~object." @@ -1528,7 +1564,7 @@ msgid "" "`~object.__getitem__`). [#]_" msgstr "" -#: ../../reference/datamodel.rst:1367 +#: ../../reference/datamodel.rst:1403 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 " @@ -1538,11 +1574,11 @@ msgid "" "the W3C's Document Object Model.)" msgstr "" -#: ../../reference/datamodel.rst:1378 +#: ../../reference/datamodel.rst:1414 msgid "Basic customization" msgstr "" -#: ../../reference/datamodel.rst:1384 +#: ../../reference/datamodel.rst:1420 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 " @@ -1552,7 +1588,7 @@ msgid "" "new object instance (usually an instance of *cls*)." msgstr "" -#: ../../reference/datamodel.rst:1391 +#: ../../reference/datamodel.rst:1427 msgid "" "Typical implementations create a new instance of the class by invoking the " "superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` " @@ -1560,7 +1596,7 @@ msgid "" "necessary before returning it." msgstr "" -#: ../../reference/datamodel.rst:1396 +#: ../../reference/datamodel.rst:1432 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 " @@ -1569,13 +1605,13 @@ msgid "" "constructor." msgstr "" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1437 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:1404 +#: ../../reference/datamodel.rst:1440 msgid "" ":meth:`__new__` is intended mainly to allow subclasses of immutable types " "(like int, str, or tuple) to customize instance creation. It is also " @@ -1583,7 +1619,7 @@ msgid "" "creation." msgstr "" -#: ../../reference/datamodel.rst:1413 +#: ../../reference/datamodel.rst:1449 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 " @@ -1593,7 +1629,7 @@ msgid "" "example: ``super().__init__([args...])``." msgstr "" -#: ../../reference/datamodel.rst:1420 +#: ../../reference/datamodel.rst:1456 msgid "" "Because :meth:`__new__` and :meth:`__init__` work together in constructing " "objects (:meth:`__new__` to create it, and :meth:`__init__` to customize " @@ -1601,7 +1637,7 @@ msgid "" "will cause a :exc:`TypeError` to be raised at runtime." msgstr "" -#: ../../reference/datamodel.rst:1433 +#: ../../reference/datamodel.rst:1469 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:" @@ -1610,7 +1646,7 @@ msgid "" "instance." msgstr "" -#: ../../reference/datamodel.rst:1439 +#: ../../reference/datamodel.rst:1475 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. " @@ -1620,20 +1656,20 @@ msgid "" "it once." msgstr "" -#: ../../reference/datamodel.rst:1446 +#: ../../reference/datamodel.rst:1482 msgid "" "It is not guaranteed that :meth:`__del__` methods are called for objects " "that still exist when the interpreter exits." msgstr "" -#: ../../reference/datamodel.rst:1451 +#: ../../reference/datamodel.rst:1487 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:1456 +#: ../../reference/datamodel.rst:1492 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 " @@ -1644,18 +1680,18 @@ msgid "" "caught in the traceback." msgstr "" -#: ../../reference/datamodel.rst:1466 +#: ../../reference/datamodel.rst:1502 msgid "Documentation for the :mod:`gc` module." msgstr "" -#: ../../reference/datamodel.rst:1470 +#: ../../reference/datamodel.rst:1506 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:1474 +#: ../../reference/datamodel.rst:1510 msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " @@ -1664,7 +1700,7 @@ msgid "" "`__del__`." msgstr "" -#: ../../reference/datamodel.rst:1480 +#: ../../reference/datamodel.rst:1516 msgid "" ":meth:`__del__` can be executed during interpreter shutdown. As a " "consequence, the global variables it needs to access (including other " @@ -1675,7 +1711,7 @@ msgid "" "still available at the time when the :meth:`__del__` method is called." msgstr "" -#: ../../reference/datamodel.rst:1495 +#: ../../reference/datamodel.rst:1531 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 " @@ -1687,13 +1723,13 @@ msgid "" "an \"informal\" string representation of instances of that class is required." msgstr "" -#: ../../reference/datamodel.rst:1504 +#: ../../reference/datamodel.rst:1540 msgid "" "This is typically used for debugging, so it is important that the " "representation is information-rich and unambiguous." msgstr "" -#: ../../reference/datamodel.rst:1515 +#: ../../reference/datamodel.rst:1551 msgid "" "Called by :func:`str(object) ` and the built-in functions :func:" "`format` and :func:`print` to compute the \"informal\" or nicely printable " @@ -1701,26 +1737,26 @@ msgid "" "` object." msgstr "" -#: ../../reference/datamodel.rst:1520 +#: ../../reference/datamodel.rst:1556 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:1524 +#: ../../reference/datamodel.rst:1560 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:1534 +#: ../../reference/datamodel.rst:1570 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:1545 +#: ../../reference/datamodel.rst:1581 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -1732,28 +1768,28 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:1555 +#: ../../reference/datamodel.rst:1591 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:1557 +#: ../../reference/datamodel.rst:1593 msgid "The return value must be a string object." msgstr "" -#: ../../reference/datamodel.rst:1559 +#: ../../reference/datamodel.rst:1595 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:1563 +#: ../../reference/datamodel.rst:1599 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:1579 +#: ../../reference/datamodel.rst:1615 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:1668 +#: ../../reference/datamodel.rst:1704 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 " @@ -1872,7 +1908,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:1677 +#: ../../reference/datamodel.rst:1713 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -1880,7 +1916,7 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:1682 +#: ../../reference/datamodel.rst:1718 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 " @@ -1888,22 +1924,22 @@ msgid "" "ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:1687 +#: ../../reference/datamodel.rst:1723 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:1691 +#: ../../reference/datamodel.rst:1727 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`\\ 。" -#: ../../reference/datamodel.rst:1693 +#: ../../reference/datamodel.rst:1729 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:1701 +#: ../../reference/datamodel.rst:1737 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -1912,18 +1948,18 @@ msgid "" "meth:`!__len__` nor :meth:`!__bool__`, all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:1712 +#: ../../reference/datamodel.rst:1748 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:1714 +#: ../../reference/datamodel.rst:1750 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:1722 +#: ../../reference/datamodel.rst:1758 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -1933,7 +1969,7 @@ msgid "" "attribute value or raise an :exc:`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1729 +#: ../../reference/datamodel.rst:1765 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -1946,7 +1982,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:1742 +#: ../../reference/datamodel.rst:1778 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -1958,14 +1994,14 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:1753 +#: ../../reference/datamodel.rst:1789 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or built-in functions. " "See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:1757 +#: ../../reference/datamodel.rst:1793 msgid "" "Raises an :ref:`auditing event ` ``object.__getattr__`` with " "arguments ``obj``, ``name``." @@ -1973,27 +2009,27 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__getattr__``。" -#: ../../reference/datamodel.rst:1759 +#: ../../reference/datamodel.rst:1795 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1766 +#: ../../reference/datamodel.rst:1802 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:1770 +#: ../../reference/datamodel.rst:1806 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:1774 +#: ../../reference/datamodel.rst:1810 msgid "" "Raises an :ref:`auditing event ` ``object.__setattr__`` with " "arguments ``obj``, ``name``, ``value``." @@ -2001,21 +2037,21 @@ msgstr "" "引發一個附帶引數 ``obj``、``name``、``value`` 的\\ :ref:`稽核事件 " "` ``object.__setattr__``。" -#: ../../reference/datamodel.rst:1776 +#: ../../reference/datamodel.rst:1812 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:1783 +#: ../../reference/datamodel.rst:1819 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:1786 +#: ../../reference/datamodel.rst:1822 msgid "" "Raises an :ref:`auditing event ` ``object.__delattr__`` with " "arguments ``obj``, ``name``." @@ -2023,23 +2059,23 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__delattr__``。" -#: ../../reference/datamodel.rst:1788 +#: ../../reference/datamodel.rst:1824 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1795 +#: ../../reference/datamodel.rst:1831 msgid "" "Called when :func:`dir` is called on the object. A sequence must be " "returned. :func:`dir` converts the returned sequence to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:1800 +#: ../../reference/datamodel.rst:1836 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:1807 +#: ../../reference/datamodel.rst:1843 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2051,21 +2087,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:1816 +#: ../../reference/datamodel.rst:1852 msgid "" "The ``__dir__`` function should accept no arguments, and return a sequence " "of strings that represents the names accessible on module. If present, this " "function overrides the standard :func:`dir` search on a module." msgstr "" -#: ../../reference/datamodel.rst:1820 +#: ../../reference/datamodel.rst:1856 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:1838 +#: ../../reference/datamodel.rst:1874 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2073,27 +2109,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:1843 +#: ../../reference/datamodel.rst:1879 msgid "``__class__`` module attribute is now writable." msgstr "" -#: ../../reference/datamodel.rst:1846 +#: ../../reference/datamodel.rst:1882 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "" -#: ../../reference/datamodel.rst:1851 +#: ../../reference/datamodel.rst:1887 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:1852 +#: ../../reference/datamodel.rst:1888 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:1858 +#: ../../reference/datamodel.rst:1894 msgid "Implementing Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1860 +#: ../../reference/datamodel.rst:1896 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 " @@ -2103,7 +2139,7 @@ msgid "" "the owner class' :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:1870 +#: ../../reference/datamodel.rst:1906 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 " @@ -2112,13 +2148,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:1876 +#: ../../reference/datamodel.rst:1912 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1879 +#: ../../reference/datamodel.rst:1915 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2128,27 +2164,33 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:1888 +#: ../../reference/datamodel.rst:1924 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:1891 +#: ../../reference/datamodel.rst:1927 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:1897 +#: ../../reference/datamodel.rst:1933 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:1900 +#: ../../reference/datamodel.rst:1935 +msgid "" +"Instances of descriptors may also have the :attr:`!__objclass__` attribute " +"present:" +msgstr "" + +#: ../../reference/datamodel.rst:1940 msgid "" -"The attribute :attr:`__objclass__` is interpreted by the :mod:`inspect` " +"The attribute :attr:`!__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " "appropriately can assist in runtime introspection of dynamic class " "attributes). For callables, it may indicate that an instance of the given " @@ -2157,11 +2199,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:1911 +#: ../../reference/datamodel.rst:1951 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1913 +#: ../../reference/datamodel.rst:1953 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2170,7 +2212,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:1919 +#: ../../reference/datamodel.rst:1959 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 " @@ -2178,7 +2220,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:1924 +#: ../../reference/datamodel.rst:1964 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 " @@ -2186,71 +2228,72 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:1929 +#: ../../reference/datamodel.rst:1969 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:1934 +#: ../../reference/datamodel.rst:1974 msgid "Direct Call" msgstr "" -#: ../../reference/datamodel.rst:1933 +#: ../../reference/datamodel.rst:1973 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:1938 +#: ../../reference/datamodel.rst:1978 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:1937 +#: ../../reference/datamodel.rst:1977 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:1942 +#: ../../reference/datamodel.rst:1982 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:1941 +#: ../../reference/datamodel.rst:1981 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:1948 +#: ../../reference/datamodel.rst:1988 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:1945 +#: ../../reference/datamodel.rst:1985 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:1982 +#: ../../reference/datamodel.rst:2022 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " "combination of :meth:`~object.__get__`, :meth:`~object.__set__` and :meth:" -"`~object.__delete__`. If it does not define :meth:`__get__`, then accessing " -"the attribute will return the descriptor object itself unless there is a " -"value in the object's instance dictionary. If the descriptor defines :meth:" -"`__set__` and/or :meth:`__delete__`, it is a data descriptor; if it defines " -"neither, it is a non-data descriptor. Normally, data descriptors define " -"both :meth:`__get__` and :meth:`__set__`, while non-data descriptors have " -"just the :meth:`__get__` method. Data descriptors with :meth:`__get__` and :" -"meth:`__set__` (and/or :meth:`__delete__`) defined always override a " -"redefinition in an instance dictionary. In contrast, non-data descriptors " -"can be overridden by instances." +"`~object.__delete__`. If it does not define :meth:`!__get__`, then " +"accessing the attribute will return the descriptor object itself unless " +"there is a value in the object's instance dictionary. If the descriptor " +"defines :meth:`!__set__` and/or :meth:`!__delete__`, it is a data " +"descriptor; if it defines neither, it is a non-data descriptor. Normally, " +"data descriptors define both :meth:`!__get__` and :meth:`!__set__`, while " +"non-data descriptors have just the :meth:`!__get__` method. Data " +"descriptors with :meth:`!__get__` and :meth:`!__set__` (and/or :meth:`!" +"__delete__`) defined always override a redefinition in an instance " +"dictionary. In contrast, non-data descriptors can be overridden by " +"instances." msgstr "" -#: ../../reference/datamodel.rst:1996 +#: ../../reference/datamodel.rst:2037 msgid "" "Python methods (including those decorated with :func:`@staticmethod " "` and :func:`@classmethod `) are implemented as " @@ -2259,30 +2302,30 @@ msgid "" "from other instances of the same class." msgstr "" -#: ../../reference/datamodel.rst:2002 +#: ../../reference/datamodel.rst:2043 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:2009 +#: ../../reference/datamodel.rst:2050 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:2011 +#: ../../reference/datamodel.rst:2052 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:2015 +#: ../../reference/datamodel.rst:2056 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:2020 +#: ../../reference/datamodel.rst:2061 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -2290,18 +2333,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:2029 +#: ../../reference/datamodel.rst:2070 msgid "Notes on using *__slots__*:" msgstr "" -#: ../../reference/datamodel.rst:2031 +#: ../../reference/datamodel.rst:2072 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:2035 +#: ../../reference/datamodel.rst:2076 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -2310,7 +2353,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2042 +#: ../../reference/datamodel.rst:2083 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -2318,7 +2361,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2048 +#: ../../reference/datamodel.rst:2089 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -2326,7 +2369,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:2054 +#: ../../reference/datamodel.rst:2095 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. " @@ -2335,7 +2378,7 @@ msgid "" "names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:2060 +#: ../../reference/datamodel.rst:2101 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 " @@ -2344,7 +2387,7 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:2065 +#: ../../reference/datamodel.rst:2106 msgid "" ":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " "class derived from a :c:member:`\"variable-length\" built-in type " @@ -2352,11 +2395,11 @@ msgid "" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:2070 +#: ../../reference/datamodel.rst:2111 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2072 +#: ../../reference/datamodel.rst:2113 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 " @@ -2364,13 +2407,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:2077 +#: ../../reference/datamodel.rst:2118 msgid "" ":attr:`~instance.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2080 +#: ../../reference/datamodel.rst:2121 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2378,18 +2421,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2086 +#: ../../reference/datamodel.rst:2127 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:2094 +#: ../../reference/datamodel.rst:2135 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:2096 +#: ../../reference/datamodel.rst:2137 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2399,14 +2442,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:2105 +#: ../../reference/datamodel.rst:2146 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:2109 +#: ../../reference/datamodel.rst:2150 msgid "" "Keyword arguments which are given to a new class are passed to the parent's " "class ``__init_subclass__``. For compatibility with other classes using " @@ -2414,13 +2457,13 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2123 +#: ../../reference/datamodel.rst:2164 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2128 +#: ../../reference/datamodel.rst:2169 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2428,41 +2471,41 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2136 +#: ../../reference/datamodel.rst:2177 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:2141 +#: ../../reference/datamodel.rst:2182 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:2147 +#: ../../reference/datamodel.rst:2188 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:2158 +#: ../../reference/datamodel.rst:2199 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`\\ 。" -#: ../../reference/datamodel.rst:2166 +#: ../../reference/datamodel.rst:2207 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2173 +#: ../../reference/datamodel.rst:2214 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:2177 +#: ../../reference/datamodel.rst:2218 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2470,41 +2513,41 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2191 +#: ../../reference/datamodel.rst:2232 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:2194 +#: ../../reference/datamodel.rst:2235 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2196 +#: ../../reference/datamodel.rst:2237 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2197 +#: ../../reference/datamodel.rst:2238 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2198 +#: ../../reference/datamodel.rst:2239 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2199 +#: ../../reference/datamodel.rst:2240 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2200 +#: ../../reference/datamodel.rst:2241 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2204 +#: ../../reference/datamodel.rst:2245 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2208 +#: ../../reference/datamodel.rst:2249 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 " @@ -2516,59 +2559,59 @@ msgid "" "is ignored." msgstr "" -#: ../../reference/datamodel.rst:2220 +#: ../../reference/datamodel.rst:2261 msgid ":func:`types.resolve_bases`" msgstr "" -#: ../../reference/datamodel.rst:2220 +#: ../../reference/datamodel.rst:2261 msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" -#: ../../reference/datamodel.rst:2224 +#: ../../reference/datamodel.rst:2265 msgid ":func:`types.get_original_bases`" msgstr "" -#: ../../reference/datamodel.rst:2223 +#: ../../reference/datamodel.rst:2264 msgid "" "Retrieve a class's \"original bases\" prior to modifications by :meth:" "`~object.__mro_entries__`." msgstr "" -#: ../../reference/datamodel.rst:2226 +#: ../../reference/datamodel.rst:2267 msgid ":pep:`560`" msgstr "" -#: ../../reference/datamodel.rst:2227 +#: ../../reference/datamodel.rst:2268 msgid "Core support for typing module and generic types." msgstr "" -#: ../../reference/datamodel.rst:2231 +#: ../../reference/datamodel.rst:2272 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2235 +#: ../../reference/datamodel.rst:2276 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2237 +#: ../../reference/datamodel.rst:2278 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2238 +#: ../../reference/datamodel.rst:2279 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:2240 +#: ../../reference/datamodel.rst:2281 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:2243 +#: ../../reference/datamodel.rst:2284 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2577,11 +2620,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2253 +#: ../../reference/datamodel.rst:2294 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2258 +#: ../../reference/datamodel.rst:2299 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2593,25 +2636,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2267 +#: ../../reference/datamodel.rst:2308 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2272 +#: ../../reference/datamodel.rst:2313 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2273 +#: ../../reference/datamodel.rst:2314 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2277 +#: ../../reference/datamodel.rst:2318 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2282 +#: ../../reference/datamodel.rst:2323 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2620,7 +2663,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2288 +#: ../../reference/datamodel.rst:2329 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. " @@ -2629,11 +2672,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2297 +#: ../../reference/datamodel.rst:2338 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2304 +#: ../../reference/datamodel.rst:2345 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2641,7 +2684,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2309 +#: ../../reference/datamodel.rst:2350 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 " @@ -2652,7 +2695,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2319 +#: ../../reference/datamodel.rst:2360 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 " @@ -2661,39 +2704,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2325 +#: ../../reference/datamodel.rst:2366 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:2329 +#: ../../reference/datamodel.rst:2370 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:2331 +#: ../../reference/datamodel.rst:2372 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2333 +#: ../../reference/datamodel.rst:2374 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:2336 +#: ../../reference/datamodel.rst:2377 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:2340 +#: ../../reference/datamodel.rst:2381 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 " @@ -2701,19 +2744,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2347 +#: ../../reference/datamodel.rst:2388 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2348 +#: ../../reference/datamodel.rst:2389 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2352 +#: ../../reference/datamodel.rst:2393 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2354 +#: ../../reference/datamodel.rst:2395 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2721,17 +2764,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2361 +#: ../../reference/datamodel.rst:2402 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2363 +#: ../../reference/datamodel.rst:2404 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:2366 +#: ../../reference/datamodel.rst:2407 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2739,21 +2782,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2373 +#: ../../reference/datamodel.rst:2414 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:2380 +#: ../../reference/datamodel.rst:2421 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:2385 +#: ../../reference/datamodel.rst:2426 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 " @@ -2761,11 +2804,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2396 +#: ../../reference/datamodel.rst:2437 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2393 +#: ../../reference/datamodel.rst:2434 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2774,11 +2817,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2401 +#: ../../reference/datamodel.rst:2442 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2403 +#: ../../reference/datamodel.rst:2444 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -2786,65 +2829,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2411 +#: ../../reference/datamodel.rst:2452 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2411 +#: ../../reference/datamodel.rst:2452 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2414 +#: ../../reference/datamodel.rst:2455 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../reference/datamodel.rst:2414 +#: ../../reference/datamodel.rst:2455 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2417 +#: ../../reference/datamodel.rst:2458 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2417 +#: ../../reference/datamodel.rst:2458 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2420 +#: ../../reference/datamodel.rst:2461 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2425 +#: ../../reference/datamodel.rst:2466 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2428 +#: ../../reference/datamodel.rst:2469 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:2434 +#: ../../reference/datamodel.rst:2475 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2436 +#: ../../reference/datamodel.rst:2477 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:2440 +#: ../../reference/datamodel.rst:2481 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -2853,7 +2896,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2446 +#: ../../reference/datamodel.rst:2487 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -2861,11 +2904,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2456 +#: ../../reference/datamodel.rst:2497 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2458 +#: ../../reference/datamodel.rst:2499 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -2875,14 +2918,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2465 +#: ../../reference/datamodel.rst:2506 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:2493 +#: ../../reference/datamodel.rst:2534 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 " @@ -2892,40 +2935,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2512 +#: ../../reference/datamodel.rst:2553 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:2537 +#: ../../reference/datamodel.rst:2578 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2536 +#: ../../reference/datamodel.rst:2577 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:2544 +#: ../../reference/datamodel.rst:2585 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2551 +#: ../../reference/datamodel.rst:2592 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:2558 +#: ../../reference/datamodel.rst:2599 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2560 +#: ../../reference/datamodel.rst:2601 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -2935,33 +2978,33 @@ msgid "" "a mapping; the difference is that for a sequence, the allowable keys should " "be the integers *k* for which ``0 <= k < N`` where *N* is the length of the " "sequence, or :class:`slice` objects, which define a range of items. It is " -"also recommended that mappings provide the methods :meth:`keys`, :meth:" -"`values`, :meth:`items`, :meth:`get`, :meth:`clear`, :meth:`setdefault`, :" -"meth:`pop`, :meth:`popitem`, :meth:`!copy`, and :meth:`update` behaving " +"also recommended that mappings provide the methods :meth:`!keys`, :meth:`!" +"values`, :meth:`!items`, :meth:`!get`, :meth:`!clear`, :meth:`!setdefault`, :" +"meth:`!pop`, :meth:`!popitem`, :meth:`!copy`, and :meth:`!update` behaving " "similar to those for Python's standard :class:`dictionary ` objects. " "The :mod:`collections.abc` module provides a :class:`~collections.abc." "MutableMapping` :term:`abstract base class` to help create those methods " "from a base set of :meth:`~object.__getitem__`, :meth:`~object." -"__setitem__`, :meth:`~object.__delitem__`, and :meth:`keys`. Mutable " -"sequences should provide methods :meth:`append`, :meth:`count`, :meth:" -"`index`, :meth:`extend`, :meth:`insert`, :meth:`pop`, :meth:`remove`, :meth:" -"`reverse` and :meth:`sort`, like Python standard :class:`list` objects. " -"Finally, sequence types should implement addition (meaning concatenation) " -"and multiplication (meaning repetition) by defining the methods :meth:" -"`~object.__add__`, :meth:`~object.__radd__`, :meth:`~object.__iadd__`, :meth:" -"`~object.__mul__`, :meth:`~object.__rmul__` and :meth:`~object.__imul__` " -"described below; they should not define other numerical operators. It is " -"recommended that both mappings and sequences implement the :meth:`~object." -"__contains__` method to allow efficient use of the ``in`` operator; for " -"mappings, ``in`` should search the mapping's keys; for sequences, it should " -"search through the values. It is further recommended that both mappings and " -"sequences implement the :meth:`~object.__iter__` method to allow efficient " -"iteration through the container; for mappings, :meth:`__iter__` should " -"iterate through the object's keys; for sequences, it should iterate through " -"the values." -msgstr "" - -#: ../../reference/datamodel.rst:2600 +"__setitem__`, :meth:`~object.__delitem__`, and :meth:`!keys`. Mutable " +"sequences should provide methods :meth:`!append`, :meth:`!count`, :meth:`!" +"index`, :meth:`!extend`, :meth:`!insert`, :meth:`!pop`, :meth:`!remove`, :" +"meth:`!reverse` and :meth:`!sort`, like Python standard :class:`list` " +"objects. Finally, sequence types should implement addition (meaning " +"concatenation) and multiplication (meaning repetition) by defining the " +"methods :meth:`~object.__add__`, :meth:`~object.__radd__`, :meth:`~object." +"__iadd__`, :meth:`~object.__mul__`, :meth:`~object.__rmul__` and :meth:" +"`~object.__imul__` described below; they should not define other numerical " +"operators. It is recommended that both mappings and sequences implement " +"the :meth:`~object.__contains__` method to allow efficient use of the ``in`` " +"operator; for mappings, ``in`` should search the mapping's keys; for " +"sequences, it should search through the values. It is further recommended " +"that both mappings and sequences implement the :meth:`~object.__iter__` " +"method to allow efficient iteration through the container; for mappings, :" +"meth:`!__iter__` should iterate through the object's keys; for sequences, it " +"should iterate through the values." +msgstr "" + +#: ../../reference/datamodel.rst:2642 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 " @@ -2969,7 +3012,7 @@ msgid "" "returns zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2607 +#: ../../reference/datamodel.rst:2649 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:" @@ -2978,7 +3021,7 @@ msgid "" "`~object.__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2616 +#: ../../reference/datamodel.rst:2658 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). " @@ -2988,20 +3031,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2630 +#: ../../reference/datamodel.rst:2672 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2634 +#: ../../reference/datamodel.rst:2676 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2638 +#: ../../reference/datamodel.rst:2680 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2643 +#: ../../reference/datamodel.rst:2685 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers and slice objects. Note that the " @@ -3014,20 +3057,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2655 +#: ../../reference/datamodel.rst:2697 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:2660 +#: ../../reference/datamodel.rst:2702 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:2668 +#: ../../reference/datamodel.rst:2710 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3036,7 +3079,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2677 +#: ../../reference/datamodel.rst:2719 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3045,13 +3088,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2686 +#: ../../reference/datamodel.rst:2728 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:2692 +#: ../../reference/datamodel.rst:2734 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 " @@ -3059,14 +3102,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2700 +#: ../../reference/datamodel.rst:2742 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:2704 +#: ../../reference/datamodel.rst:2746 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 :" @@ -3075,7 +3118,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2711 +#: ../../reference/datamodel.rst:2753 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3083,14 +3126,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2718 +#: ../../reference/datamodel.rst:2760 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:2722 +#: ../../reference/datamodel.rst:2764 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3098,11 +3141,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2731 +#: ../../reference/datamodel.rst:2773 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2733 +#: ../../reference/datamodel.rst:2775 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3110,7 +3153,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2759 +#: ../../reference/datamodel.rst:2801 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3124,13 +3167,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2770 +#: ../../reference/datamodel.rst:2812 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2793 +#: ../../reference/datamodel.rst:2835 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3143,13 +3186,13 @@ msgid "" "*NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:2805 +#: ../../reference/datamodel.rst:2847 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:2810 +#: ../../reference/datamodel.rst:2852 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 " @@ -3158,7 +3201,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:2831 +#: ../../reference/datamodel.rst:2873 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3174,19 +3217,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:2852 +#: ../../reference/datamodel.rst:2894 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:2865 +#: ../../reference/datamodel.rst:2907 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:2872 +#: ../../reference/datamodel.rst:2914 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3195,14 +3238,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:2878 +#: ../../reference/datamodel.rst:2920 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:2890 +#: ../../reference/datamodel.rst:2932 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3211,21 +3254,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:2896 +#: ../../reference/datamodel.rst:2938 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:2899 +#: ../../reference/datamodel.rst:2941 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:2906 +#: ../../reference/datamodel.rst:2948 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:2908 +#: ../../reference/datamodel.rst:2950 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 " @@ -3235,32 +3278,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:2919 +#: ../../reference/datamodel.rst:2961 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:2922 +#: ../../reference/datamodel.rst:2964 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:2927 +#: ../../reference/datamodel.rst:2969 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:2934 +#: ../../reference/datamodel.rst:2976 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:2938 +#: ../../reference/datamodel.rst:2980 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. " @@ -3268,27 +3311,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:2942 +#: ../../reference/datamodel.rst:2984 msgid "" "Note that :meth:`~object.__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:2949 +#: ../../reference/datamodel.rst:2991 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:2949 +#: ../../reference/datamodel.rst:2991 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:2956 +#: ../../reference/datamodel.rst:2998 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:2958 +#: ../../reference/datamodel.rst:3000 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 " @@ -3296,7 +3339,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:2965 +#: ../../reference/datamodel.rst:3007 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 " @@ -3305,7 +3348,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:2971 +#: ../../reference/datamodel.rst:3013 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3315,19 +3358,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2981 +#: ../../reference/datamodel.rst:3023 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:2982 +#: ../../reference/datamodel.rst:3024 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:2988 +#: ../../reference/datamodel.rst:3030 msgid "Emulating buffer types" msgstr "" -#: ../../reference/datamodel.rst:2990 +#: ../../reference/datamodel.rst:3032 msgid "" "The :ref:`buffer protocol ` provides a way for Python objects " "to expose efficient access to a low-level memory array. This protocol is " @@ -3335,13 +3378,13 @@ msgid "" "and third-party libraries may define additional buffer types." msgstr "" -#: ../../reference/datamodel.rst:2995 +#: ../../reference/datamodel.rst:3037 msgid "" "While buffer types are usually implemented in C, it is also possible to " "implement the protocol in Python." msgstr "" -#: ../../reference/datamodel.rst:3000 +#: ../../reference/datamodel.rst:3042 msgid "" "Called when a buffer is requested from *self* (for example, by the :class:" "`memoryview` constructor). The *flags* argument is an integer representing " @@ -3351,7 +3394,7 @@ msgid "" "`memoryview` object." msgstr "" -#: ../../reference/datamodel.rst:3009 +#: ../../reference/datamodel.rst:3051 msgid "" "Called when a buffer is no longer needed. The *buffer* argument is a :class:" "`memoryview` object that was previously returned by :meth:`~object." @@ -3360,28 +3403,28 @@ msgid "" "to perform any cleanup are not required to implement this method." msgstr "" -#: ../../reference/datamodel.rst:3021 +#: ../../reference/datamodel.rst:3063 msgid ":pep:`688` - Making the buffer protocol accessible in Python" msgstr "" -#: ../../reference/datamodel.rst:3021 +#: ../../reference/datamodel.rst:3063 msgid "" "Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3023 +#: ../../reference/datamodel.rst:3065 msgid ":class:`collections.abc.Buffer`" msgstr "" -#: ../../reference/datamodel.rst:3024 +#: ../../reference/datamodel.rst:3066 msgid "ABC for buffer types." msgstr "" -#: ../../reference/datamodel.rst:3029 +#: ../../reference/datamodel.rst:3071 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:3031 +#: ../../reference/datamodel.rst:3073 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 " @@ -3389,7 +3432,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:3046 +#: ../../reference/datamodel.rst:3088 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3398,21 +3441,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:3060 +#: ../../reference/datamodel.rst:3102 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:3069 +#: ../../reference/datamodel.rst:3111 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:3095 +#: ../../reference/datamodel.rst:3137 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3421,36 +3464,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:3106 +#: ../../reference/datamodel.rst:3148 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:3110 +#: ../../reference/datamodel.rst:3152 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:3112 +#: ../../reference/datamodel.rst:3154 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:3118 +#: ../../reference/datamodel.rst:3160 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:3124 +#: ../../reference/datamodel.rst:3166 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:3130 +#: ../../reference/datamodel.rst:3172 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 " @@ -3458,15 +3501,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:3138 +#: ../../reference/datamodel.rst:3180 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:3144 +#: ../../reference/datamodel.rst:3186 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:3146 +#: ../../reference/datamodel.rst:3188 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3477,29 +3520,29 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:3154 +#: ../../reference/datamodel.rst:3196 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:3158 +#: ../../reference/datamodel.rst:3200 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3164 +#: ../../reference/datamodel.rst:3206 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." "__await__`. If *value* is not ``None``, this method delegates to the :meth:" "`~generator.send` method of the iterator that caused the coroutine to " "suspend. The result (return value, :exc:`StopIteration`, or other " -"exception) is the same as when iterating over the :meth:`__await__` return " +"exception) is the same as when iterating over the :meth:`!__await__` return " "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3175 +#: ../../reference/datamodel.rst:3217 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3510,13 +3553,13 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3186 +#: ../../reference/datamodel.rst:3228 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:3191 +#: ../../reference/datamodel.rst:3233 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3526,99 +3569,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3199 +#: ../../reference/datamodel.rst:3241 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3205 +#: ../../reference/datamodel.rst:3247 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3207 +#: ../../reference/datamodel.rst:3249 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3210 +#: ../../reference/datamodel.rst:3252 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3214 +#: ../../reference/datamodel.rst:3256 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3218 +#: ../../reference/datamodel.rst:3260 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:3221 +#: ../../reference/datamodel.rst:3263 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3238 +#: ../../reference/datamodel.rst:3280 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:3243 +#: ../../reference/datamodel.rst:3285 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:3251 +#: ../../reference/datamodel.rst:3293 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3253 +#: ../../reference/datamodel.rst:3295 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:3256 +#: ../../reference/datamodel.rst:3298 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3260 +#: ../../reference/datamodel.rst:3302 msgid "" "Semantically similar to :meth:`~object.__enter__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3265 +#: ../../reference/datamodel.rst:3307 msgid "" "Semantically similar to :meth:`~object.__exit__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3268 +#: ../../reference/datamodel.rst:3310 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3281 +#: ../../reference/datamodel.rst:3323 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3282 +#: ../../reference/datamodel.rst:3324 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:3286 +#: ../../reference/datamodel.rst:3328 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3626,7 +3669,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3292 +#: ../../reference/datamodel.rst:3334 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 " @@ -3634,7 +3677,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3298 +#: ../../reference/datamodel.rst:3340 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 " @@ -3651,13 +3694,13 @@ msgstr "" #: ../../reference/datamodel.rst:420 ../../reference/datamodel.rst:440 #: ../../reference/datamodel.rst:448 ../../reference/datamodel.rst:459 #: ../../reference/datamodel.rst:476 ../../reference/datamodel.rst:512 -#: ../../reference/datamodel.rst:525 ../../reference/datamodel.rst:640 -#: ../../reference/datamodel.rst:760 ../../reference/datamodel.rst:778 -#: ../../reference/datamodel.rst:810 ../../reference/datamodel.rst:891 -#: ../../reference/datamodel.rst:959 ../../reference/datamodel.rst:986 -#: ../../reference/datamodel.rst:1048 ../../reference/datamodel.rst:1102 -#: ../../reference/datamodel.rst:1162 ../../reference/datamodel.rst:1227 -#: ../../reference/datamodel.rst:1618 ../../reference/datamodel.rst:2626 +#: ../../reference/datamodel.rst:525 ../../reference/datamodel.rst:642 +#: ../../reference/datamodel.rst:762 ../../reference/datamodel.rst:780 +#: ../../reference/datamodel.rst:812 ../../reference/datamodel.rst:893 +#: ../../reference/datamodel.rst:961 ../../reference/datamodel.rst:988 +#: ../../reference/datamodel.rst:1050 ../../reference/datamodel.rst:1104 +#: ../../reference/datamodel.rst:1164 ../../reference/datamodel.rst:1263 +#: ../../reference/datamodel.rst:1654 ../../reference/datamodel.rst:2668 msgid "object" msgstr "object(物件)" @@ -3667,14 +3710,14 @@ msgstr "data(資料)" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:292 #: ../../reference/datamodel.rst:336 ../../reference/datamodel.rst:420 -#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:760 -#: ../../reference/datamodel.rst:1005 ../../reference/datamodel.rst:1292 -#: ../../reference/datamodel.rst:1532 ../../reference/datamodel.rst:1537 -#: ../../reference/datamodel.rst:1618 ../../reference/datamodel.rst:2168 -#: ../../reference/datamodel.rst:2596 ../../reference/datamodel.rst:2754 -#: ../../reference/datamodel.rst:2789 ../../reference/datamodel.rst:2803 -#: ../../reference/datamodel.rst:2850 ../../reference/datamodel.rst:2860 -#: ../../reference/datamodel.rst:2888 +#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:762 +#: ../../reference/datamodel.rst:1007 ../../reference/datamodel.rst:1328 +#: ../../reference/datamodel.rst:1568 ../../reference/datamodel.rst:1573 +#: ../../reference/datamodel.rst:1654 ../../reference/datamodel.rst:2209 +#: ../../reference/datamodel.rst:2638 ../../reference/datamodel.rst:2796 +#: ../../reference/datamodel.rst:2831 ../../reference/datamodel.rst:2845 +#: ../../reference/datamodel.rst:2892 ../../reference/datamodel.rst:2902 +#: ../../reference/datamodel.rst:2930 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -3683,7 +3726,7 @@ msgid "id" msgstr "id" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:122 -#: ../../reference/datamodel.rst:2168 +#: ../../reference/datamodel.rst:2209 msgid "type" msgstr "type(型別)" @@ -3719,7 +3762,7 @@ msgstr "reference counting(參照計數)" msgid "unreachable object" msgstr "unreachable object(不可達物件)" -#: ../../reference/datamodel.rst:95 ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:95 ../../reference/datamodel.rst:893 msgid "container" msgstr "container(容器)" @@ -3733,24 +3776,24 @@ msgstr "extension(擴充)" #: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:393 #: ../../reference/datamodel.rst:394 ../../reference/datamodel.rst:495 -#: ../../reference/datamodel.rst:810 ../../reference/datamodel.rst:829 -#: ../../reference/datamodel.rst:1005 +#: ../../reference/datamodel.rst:812 ../../reference/datamodel.rst:831 +#: ../../reference/datamodel.rst:1007 msgid "module" msgstr "module(模組)" #: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:261 -#: ../../reference/datamodel.rst:760 +#: ../../reference/datamodel.rst:762 msgid "C" msgstr "C" #: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:261 -#: ../../reference/datamodel.rst:760 +#: ../../reference/datamodel.rst:762 msgid "language" msgstr "language(語言)" -#: ../../reference/datamodel.rst:135 ../../reference/datamodel.rst:891 -#: ../../reference/datamodel.rst:908 ../../reference/datamodel.rst:959 -#: ../../reference/datamodel.rst:979 +#: ../../reference/datamodel.rst:135 ../../reference/datamodel.rst:893 +#: ../../reference/datamodel.rst:910 ../../reference/datamodel.rst:961 +#: ../../reference/datamodel.rst:981 msgid "attribute" msgstr "attribute(屬性)" @@ -3770,7 +3813,7 @@ msgstr "..." msgid "ellipsis literal" msgstr "ellipsis literal(刪節號)" -#: ../../reference/datamodel.rst:192 ../../reference/datamodel.rst:986 +#: ../../reference/datamodel.rst:192 ../../reference/datamodel.rst:988 msgid "numeric" msgstr "numeric(數值)" @@ -3807,16 +3850,16 @@ msgstr "number(數字)" msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:2860 +#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:2902 msgid "complex" msgstr "complex(複數)" #: ../../reference/datamodel.rst:292 ../../reference/datamodel.rst:420 -#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2596 +#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2638 msgid "len" msgstr "len" -#: ../../reference/datamodel.rst:292 ../../reference/datamodel.rst:986 +#: ../../reference/datamodel.rst:292 ../../reference/datamodel.rst:988 msgid "sequence" msgstr "sequence(序列)" @@ -3845,8 +3888,8 @@ msgstr "immutable sequence(不可變序列)" msgid "immutable" msgstr "immutable(不可變)" -#: ../../reference/datamodel.rst:332 ../../reference/datamodel.rst:1507 -#: ../../reference/datamodel.rst:1537 +#: ../../reference/datamodel.rst:332 ../../reference/datamodel.rst:1543 +#: ../../reference/datamodel.rst:1573 msgid "string" msgstr "string(字串)" @@ -3882,7 +3925,7 @@ msgstr "singleton(單例)" msgid "empty" msgstr "empty(空的)" -#: ../../reference/datamodel.rst:369 ../../reference/datamodel.rst:1532 +#: ../../reference/datamodel.rst:369 ../../reference/datamodel.rst:1568 msgid "bytes" msgstr "bytes(位元組)" @@ -3898,14 +3941,14 @@ msgstr "mutable sequence(可變序列)" msgid "mutable" msgstr "mutable(可變的)" -#: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:908 -#: ../../reference/datamodel.rst:979 +#: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:910 +#: ../../reference/datamodel.rst:981 msgid "assignment" msgstr "assignment(賦值)" -#: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:810 -#: ../../reference/datamodel.rst:1259 ../../reference/datamodel.rst:1428 -#: ../../reference/datamodel.rst:2915 +#: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:812 +#: ../../reference/datamodel.rst:1295 ../../reference/datamodel.rst:1464 +#: ../../reference/datamodel.rst:2957 msgid "statement" msgstr "statement(陳述式)" @@ -3937,12 +3980,12 @@ msgstr "set(集合)" msgid "frozenset" msgstr "frozenset(凍結集合)" -#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:986 +#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:988 msgid "mapping" msgstr "mapping(對映)" -#: ../../reference/datamodel.rst:476 ../../reference/datamodel.rst:891 -#: ../../reference/datamodel.rst:1618 +#: ../../reference/datamodel.rst:476 ../../reference/datamodel.rst:893 +#: ../../reference/datamodel.rst:1654 msgid "dictionary" msgstr "dictionary(字典)" @@ -3959,13 +4002,13 @@ msgid "callable" msgstr "callable(可呼叫物件)" #: ../../reference/datamodel.rst:512 ../../reference/datamodel.rst:525 -#: ../../reference/datamodel.rst:706 ../../reference/datamodel.rst:724 -#: ../../reference/datamodel.rst:737 ../../reference/datamodel.rst:760 +#: ../../reference/datamodel.rst:708 ../../reference/datamodel.rst:726 +#: ../../reference/datamodel.rst:739 ../../reference/datamodel.rst:762 msgid "function" msgstr "function (函式)" -#: ../../reference/datamodel.rst:512 ../../reference/datamodel.rst:891 -#: ../../reference/datamodel.rst:913 ../../reference/datamodel.rst:2549 +#: ../../reference/datamodel.rst:512 ../../reference/datamodel.rst:893 +#: ../../reference/datamodel.rst:915 ../../reference/datamodel.rst:2590 msgid "call" msgstr "call(呼叫)" @@ -3977,7 +4020,7 @@ msgstr "invocation(調用)" msgid "argument" msgstr "argument(引數)" -#: ../../reference/datamodel.rst:525 ../../reference/datamodel.rst:640 +#: ../../reference/datamodel.rst:525 ../../reference/datamodel.rst:642 msgid "user-defined" msgstr "user-defined(使用者定義)" @@ -4033,563 +4076,563 @@ msgstr "__type_params__ (函式屬性)" msgid "global" msgstr "global(全域)" -#: ../../reference/datamodel.rst:539 ../../reference/datamodel.rst:829 +#: ../../reference/datamodel.rst:539 ../../reference/datamodel.rst:831 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../reference/datamodel.rst:640 ../../reference/datamodel.rst:778 +#: ../../reference/datamodel.rst:642 ../../reference/datamodel.rst:780 msgid "method" msgstr "method(方法)" -#: ../../reference/datamodel.rst:640 +#: ../../reference/datamodel.rst:642 msgid "user-defined method" msgstr "user-defined method(使用者定義方法)" -#: ../../reference/datamodel.rst:648 +#: ../../reference/datamodel.rst:650 msgid "__func__ (method attribute)" msgstr "__func__ (方法屬性)" -#: ../../reference/datamodel.rst:648 +#: ../../reference/datamodel.rst:650 msgid "__self__ (method attribute)" msgstr "__self__ (方法屬性)" -#: ../../reference/datamodel.rst:648 +#: ../../reference/datamodel.rst:650 msgid "__doc__ (method attribute)" msgstr "__doc__ (方法屬性)" -#: ../../reference/datamodel.rst:648 +#: ../../reference/datamodel.rst:650 msgid "__name__ (method attribute)" msgstr "__name__ (方法屬性)" -#: ../../reference/datamodel.rst:648 +#: ../../reference/datamodel.rst:650 msgid "__module__ (method attribute)" msgstr "__module__ (方法屬性)" -#: ../../reference/datamodel.rst:706 ../../reference/datamodel.rst:1102 +#: ../../reference/datamodel.rst:708 ../../reference/datamodel.rst:1104 msgid "generator" msgstr "generator(產生器)" -#: ../../reference/datamodel.rst:706 +#: ../../reference/datamodel.rst:708 msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:724 ../../reference/datamodel.rst:3102 +#: ../../reference/datamodel.rst:726 ../../reference/datamodel.rst:3144 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../reference/datamodel.rst:737 +#: ../../reference/datamodel.rst:739 msgid "asynchronous generator" msgstr "asynchronous generator(非同步產生器)" -#: ../../reference/datamodel.rst:737 +#: ../../reference/datamodel.rst:739 msgid "asynchronous iterator" msgstr "asynchronous iterator(非同步疊代器)" -#: ../../reference/datamodel.rst:778 +#: ../../reference/datamodel.rst:780 msgid "built-in method" msgstr "built-in method(內建方法)" -#: ../../reference/datamodel.rst:778 +#: ../../reference/datamodel.rst:780 msgid "built-in" msgstr "built-in(內建)" -#: ../../reference/datamodel.rst:810 +#: ../../reference/datamodel.rst:812 msgid "import" msgstr "import(引入)" -#: ../../reference/datamodel.rst:829 +#: ../../reference/datamodel.rst:831 msgid "__name__ (module attribute)" msgstr "__name__ (模組屬性)" -#: ../../reference/datamodel.rst:829 +#: ../../reference/datamodel.rst:831 msgid "__doc__ (module attribute)" msgstr "__doc__ (模組屬性)" -#: ../../reference/datamodel.rst:829 +#: ../../reference/datamodel.rst:831 msgid "__file__ (module attribute)" msgstr "__file__ (模組屬性)" -#: ../../reference/datamodel.rst:829 +#: ../../reference/datamodel.rst:831 msgid "__annotations__ (module attribute)" msgstr "__annotations__ (模組屬性)" -#: ../../reference/datamodel.rst:860 +#: ../../reference/datamodel.rst:862 msgid "__dict__ (module attribute)" msgstr "__dict__ (模組屬性)" -#: ../../reference/datamodel.rst:891 ../../reference/datamodel.rst:908 -#: ../../reference/datamodel.rst:959 ../../reference/datamodel.rst:1411 -#: ../../reference/datamodel.rst:2279 +#: ../../reference/datamodel.rst:893 ../../reference/datamodel.rst:910 +#: ../../reference/datamodel.rst:961 ../../reference/datamodel.rst:1447 +#: ../../reference/datamodel.rst:2320 msgid "class" msgstr "class(類別)" -#: ../../reference/datamodel.rst:891 ../../reference/datamodel.rst:959 -#: ../../reference/datamodel.rst:979 +#: ../../reference/datamodel.rst:893 ../../reference/datamodel.rst:961 +#: ../../reference/datamodel.rst:981 msgid "class instance" msgstr "class instance(類別實例)" -#: ../../reference/datamodel.rst:891 ../../reference/datamodel.rst:959 -#: ../../reference/datamodel.rst:2549 +#: ../../reference/datamodel.rst:893 ../../reference/datamodel.rst:961 +#: ../../reference/datamodel.rst:2590 msgid "instance" msgstr "instance(實例)" -#: ../../reference/datamodel.rst:891 ../../reference/datamodel.rst:913 +#: ../../reference/datamodel.rst:893 ../../reference/datamodel.rst:915 msgid "class object" msgstr "class object(類別物件)" -#: ../../reference/datamodel.rst:917 +#: ../../reference/datamodel.rst:919 msgid "__name__ (class attribute)" msgstr "__name__ (類別屬性)" -#: ../../reference/datamodel.rst:917 +#: ../../reference/datamodel.rst:919 msgid "__module__ (class attribute)" msgstr "__module__ (類別屬性)" -#: ../../reference/datamodel.rst:917 +#: ../../reference/datamodel.rst:919 msgid "__dict__ (class attribute)" msgstr "__dict__ (類別屬性)" -#: ../../reference/datamodel.rst:917 +#: ../../reference/datamodel.rst:919 msgid "__bases__ (class attribute)" msgstr "__bases__ (類別屬性)" -#: ../../reference/datamodel.rst:917 +#: ../../reference/datamodel.rst:919 msgid "__doc__ (class attribute)" msgstr "__doc__ (類別屬性)" -#: ../../reference/datamodel.rst:917 +#: ../../reference/datamodel.rst:919 msgid "__annotations__ (class attribute)" msgstr "__annotations__ (類別屬性)" -#: ../../reference/datamodel.rst:917 +#: ../../reference/datamodel.rst:919 msgid "__type_params__ (class attribute)" msgstr "__type_params__ (類別屬性)" -#: ../../reference/datamodel.rst:994 +#: ../../reference/datamodel.rst:996 msgid "__dict__ (instance attribute)" msgstr "__dict__ (實例屬性)" -#: ../../reference/datamodel.rst:994 +#: ../../reference/datamodel.rst:996 msgid "__class__ (instance attribute)" msgstr "__class__ (實例屬性)" -#: ../../reference/datamodel.rst:1005 +#: ../../reference/datamodel.rst:1007 msgid "open" msgstr "open" -#: ../../reference/datamodel.rst:1005 +#: ../../reference/datamodel.rst:1007 msgid "io" msgstr "io" -#: ../../reference/datamodel.rst:1005 +#: ../../reference/datamodel.rst:1007 msgid "popen() (in module os)" msgstr "popen() (於 os 模組中)" -#: ../../reference/datamodel.rst:1005 +#: ../../reference/datamodel.rst:1007 msgid "makefile() (socket method)" msgstr "makefile() (socket 方法)" -#: ../../reference/datamodel.rst:1005 +#: ../../reference/datamodel.rst:1007 msgid "sys.stdin" msgstr "sys.stdin" -#: ../../reference/datamodel.rst:1005 +#: ../../reference/datamodel.rst:1007 msgid "sys.stdout" msgstr "sys.stdout" -#: ../../reference/datamodel.rst:1005 +#: ../../reference/datamodel.rst:1007 msgid "sys.stderr" msgstr "sys.stderr" -#: ../../reference/datamodel.rst:1005 +#: ../../reference/datamodel.rst:1007 msgid "stdio" msgstr "stdio" -#: ../../reference/datamodel.rst:1005 +#: ../../reference/datamodel.rst:1007 msgid "stdin (in module sys)" msgstr "stdin (sys 模組中)" -#: ../../reference/datamodel.rst:1005 +#: ../../reference/datamodel.rst:1007 msgid "stdout (in module sys)" msgstr "stdout (sys 模組中)" -#: ../../reference/datamodel.rst:1005 +#: ../../reference/datamodel.rst:1007 msgid "stderr (in module sys)" msgstr "stderr (sys 模組中)" -#: ../../reference/datamodel.rst:1034 +#: ../../reference/datamodel.rst:1036 msgid "internal type" msgstr "internal type(內部型別)" -#: ../../reference/datamodel.rst:1034 +#: ../../reference/datamodel.rst:1036 msgid "types, internal" msgstr "types(型別), internal(內部)" -#: ../../reference/datamodel.rst:1048 +#: ../../reference/datamodel.rst:1050 msgid "bytecode" msgstr "bytecode(位元組碼)" -#: ../../reference/datamodel.rst:1048 +#: ../../reference/datamodel.rst:1050 msgid "code" msgstr "code(程式碼)" -#: ../../reference/datamodel.rst:1048 +#: ../../reference/datamodel.rst:1050 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1061 msgid "co_argcount (code object attribute)" msgstr "co_argcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1061 msgid "co_posonlyargcount (code object attribute)" msgstr "co_posonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1061 msgid "co_kwonlyargcount (code object attribute)" msgstr "co_kwonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1061 msgid "co_code (code object attribute)" msgstr "co_code (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1061 msgid "co_consts (code object attribute)" msgstr "co_consts (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1061 msgid "co_filename (code object attribute)" msgstr "co_filename (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1061 msgid "co_firstlineno (code object attribute)" msgstr "co_firstlineno (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1061 msgid "co_flags (code object attribute)" msgstr "co_flags (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1061 msgid "co_lnotab (code object attribute)" msgstr "co_lnotab (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1061 msgid "co_name (code object attribute)" msgstr "co_name (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1061 msgid "co_names (code object attribute)" msgstr "co_names (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1061 msgid "co_nlocals (code object attribute)" msgstr "co_nlocals (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1061 msgid "co_stacksize (code object attribute)" msgstr "co_stacksize (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1061 msgid "co_varnames (code object attribute)" msgstr "co_varnames (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1061 msgid "co_cellvars (code object attribute)" msgstr "co_cellvars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1061 msgid "co_freevars (code object attribute)" msgstr "co_freevars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1061 msgid "co_qualname (code object attribute)" msgstr "co_qualname (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1118 +#: ../../reference/datamodel.rst:1120 msgid "documentation string" msgstr "documentation string(文件字串)" -#: ../../reference/datamodel.rst:1162 +#: ../../reference/datamodel.rst:1164 msgid "frame" msgstr "frame" -#: ../../reference/datamodel.rst:1167 +#: ../../reference/datamodel.rst:1169 msgid "f_back (frame attribute)" msgstr "f_back (frame 屬性)" -#: ../../reference/datamodel.rst:1167 +#: ../../reference/datamodel.rst:1169 msgid "f_code (frame attribute)" msgstr "f_code (frame 屬性)" -#: ../../reference/datamodel.rst:1167 +#: ../../reference/datamodel.rst:1169 msgid "f_globals (frame attribute)" msgstr "f_globals (frame 屬性)" -#: ../../reference/datamodel.rst:1167 +#: ../../reference/datamodel.rst:1169 msgid "f_locals (frame attribute)" msgstr "f_locals (frame 屬性)" -#: ../../reference/datamodel.rst:1167 +#: ../../reference/datamodel.rst:1169 msgid "f_lasti (frame attribute)" msgstr "f_lasti (frame 屬性)" -#: ../../reference/datamodel.rst:1167 +#: ../../reference/datamodel.rst:1169 msgid "f_builtins (frame attribute)" msgstr "f_builtins (frame 屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1208 msgid "f_trace (frame attribute)" msgstr "f_trace (frame 屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1208 msgid "f_trace_lines (frame attribute)" msgstr "f_trace_lines (frame 屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1208 msgid "f_trace_opcodes (frame attribute)" msgstr "f_trace_opcodes (frame 屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1208 msgid "f_lineno (frame attribute)" msgstr "f_lineno (frame 屬性)" -#: ../../reference/datamodel.rst:1227 +#: ../../reference/datamodel.rst:1263 msgid "traceback" msgstr "traceback" -#: ../../reference/datamodel.rst:1227 +#: ../../reference/datamodel.rst:1263 msgid "stack" msgstr "stack(堆疊)" -#: ../../reference/datamodel.rst:1227 +#: ../../reference/datamodel.rst:1263 msgid "trace" msgstr "trace(追蹤)" -#: ../../reference/datamodel.rst:1227 +#: ../../reference/datamodel.rst:1263 msgid "exception" msgstr "exception(例外)" -#: ../../reference/datamodel.rst:1227 +#: ../../reference/datamodel.rst:1263 msgid "handler" msgstr "handler(處理器)" -#: ../../reference/datamodel.rst:1227 +#: ../../reference/datamodel.rst:1263 msgid "execution" msgstr "execution(執行)" -#: ../../reference/datamodel.rst:1227 +#: ../../reference/datamodel.rst:1263 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../reference/datamodel.rst:1227 +#: ../../reference/datamodel.rst:1263 msgid "last_traceback (in module sys)" msgstr "last_traceback (sys 模組中)" -#: ../../reference/datamodel.rst:1227 +#: ../../reference/datamodel.rst:1263 msgid "sys.exc_info" msgstr "sys.exc_info" -#: ../../reference/datamodel.rst:1227 +#: ../../reference/datamodel.rst:1263 msgid "sys.exception" msgstr "sys.exception" -#: ../../reference/datamodel.rst:1227 +#: ../../reference/datamodel.rst:1263 msgid "sys.last_traceback" msgstr "sys.last_traceback" -#: ../../reference/datamodel.rst:1259 +#: ../../reference/datamodel.rst:1295 msgid "tb_frame (traceback attribute)" msgstr "tb_frame (traceback 屬性)" -#: ../../reference/datamodel.rst:1259 +#: ../../reference/datamodel.rst:1295 msgid "tb_lineno (traceback attribute)" msgstr "tb_lineno (traceback 屬性)" -#: ../../reference/datamodel.rst:1259 +#: ../../reference/datamodel.rst:1295 msgid "tb_lasti (traceback attribute)" msgstr "tb_lasti (traceback 屬性)" -#: ../../reference/datamodel.rst:1259 +#: ../../reference/datamodel.rst:1295 msgid "try" msgstr "try" -#: ../../reference/datamodel.rst:1277 +#: ../../reference/datamodel.rst:1313 msgid "tb_next (traceback attribute)" msgstr "tb_next (traceback 屬性)" -#: ../../reference/datamodel.rst:1292 ../../reference/datamodel.rst:2626 +#: ../../reference/datamodel.rst:1328 ../../reference/datamodel.rst:2668 msgid "slice" msgstr "slice(切片)" -#: ../../reference/datamodel.rst:1298 +#: ../../reference/datamodel.rst:1334 msgid "start (slice object attribute)" msgstr "start (slice 物件屬性)" -#: ../../reference/datamodel.rst:1298 +#: ../../reference/datamodel.rst:1334 msgid "stop (slice object attribute)" msgstr "stop (slice 物件屬性)" -#: ../../reference/datamodel.rst:1298 +#: ../../reference/datamodel.rst:1334 msgid "step (slice object attribute)" msgstr "step (slice 物件屬性)" -#: ../../reference/datamodel.rst:1346 +#: ../../reference/datamodel.rst:1382 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/datamodel.rst:1346 +#: ../../reference/datamodel.rst:1382 msgid "overloading" msgstr "overloading(多載)" -#: ../../reference/datamodel.rst:1346 +#: ../../reference/datamodel.rst:1382 msgid "__getitem__() (mapping object method)" msgstr "__getitem__() (對映物件方法)" -#: ../../reference/datamodel.rst:1382 +#: ../../reference/datamodel.rst:1418 msgid "subclassing" msgstr "subclassing(子類別化)" -#: ../../reference/datamodel.rst:1382 +#: ../../reference/datamodel.rst:1418 msgid "immutable types" msgstr "immutable types(不可變型別)" -#: ../../reference/datamodel.rst:1411 +#: ../../reference/datamodel.rst:1447 msgid "constructor" msgstr "constructor(建構函式)" -#: ../../reference/datamodel.rst:1428 +#: ../../reference/datamodel.rst:1464 msgid "destructor" msgstr "destructor(解構函式)" -#: ../../reference/datamodel.rst:1428 +#: ../../reference/datamodel.rst:1464 msgid "finalizer" msgstr "finalizer(終結函式)" -#: ../../reference/datamodel.rst:1428 +#: ../../reference/datamodel.rst:1464 msgid "del" msgstr "del" -#: ../../reference/datamodel.rst:1490 +#: ../../reference/datamodel.rst:1526 msgid "repr() (built-in function)" msgstr "repr() (內建函式)" -#: ../../reference/datamodel.rst:1490 +#: ../../reference/datamodel.rst:1526 msgid "__repr__() (object method)" msgstr "__repr__() (物件方法)" -#: ../../reference/datamodel.rst:1507 +#: ../../reference/datamodel.rst:1543 msgid "__str__() (object method)" msgstr "__str__() (物件方法)" -#: ../../reference/datamodel.rst:1507 +#: ../../reference/datamodel.rst:1543 msgid "format() (built-in function)" msgstr "format() (內建函式)" -#: ../../reference/datamodel.rst:1507 +#: ../../reference/datamodel.rst:1543 msgid "print() (built-in function)" msgstr "print() (內建函式)" -#: ../../reference/datamodel.rst:1537 +#: ../../reference/datamodel.rst:1573 msgid "__format__() (object method)" msgstr "__format__() (物件方法)" -#: ../../reference/datamodel.rst:1537 +#: ../../reference/datamodel.rst:1573 msgid "conversion" msgstr "conversion" -#: ../../reference/datamodel.rst:1537 +#: ../../reference/datamodel.rst:1573 msgid "print" msgstr "print" -#: ../../reference/datamodel.rst:1576 +#: ../../reference/datamodel.rst:1612 msgid "comparisons" msgstr "comparison(比較)" -#: ../../reference/datamodel.rst:1618 +#: ../../reference/datamodel.rst:1654 msgid "hash" msgstr "hash(雜湊)" -#: ../../reference/datamodel.rst:1699 +#: ../../reference/datamodel.rst:1735 msgid "__len__() (mapping object method)" msgstr "__len__() (對映物件方法)" -#: ../../reference/datamodel.rst:1802 +#: ../../reference/datamodel.rst:1838 msgid "__getattr__ (module attribute)" msgstr "__getattr__ (模組屬性)" -#: ../../reference/datamodel.rst:1802 +#: ../../reference/datamodel.rst:1838 msgid "__dir__ (module attribute)" msgstr "__dir__ (模組屬性)" -#: ../../reference/datamodel.rst:1802 +#: ../../reference/datamodel.rst:1838 msgid "__class__ (module attribute)" msgstr "__class__ (模組屬性)" -#: ../../reference/datamodel.rst:2168 +#: ../../reference/datamodel.rst:2209 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../reference/datamodel.rst:2168 +#: ../../reference/datamodel.rst:2209 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/datamodel.rst:2168 +#: ../../reference/datamodel.rst:2209 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/datamodel.rst:2232 +#: ../../reference/datamodel.rst:2273 msgid "metaclass hint" msgstr "metaclass hint(元類別提示)" -#: ../../reference/datamodel.rst:2255 +#: ../../reference/datamodel.rst:2296 msgid "__prepare__ (metaclass method)" msgstr "__prepare__ (元類別方法)" -#: ../../reference/datamodel.rst:2279 +#: ../../reference/datamodel.rst:2320 msgid "body" msgstr "body" -#: ../../reference/datamodel.rst:2299 +#: ../../reference/datamodel.rst:2340 msgid "__class__ (method cell)" msgstr "__class__ (方法 cell)" -#: ../../reference/datamodel.rst:2299 +#: ../../reference/datamodel.rst:2340 msgid "__classcell__ (class namespace entry)" msgstr "__classcell__ (類別命名空間項目)" -#: ../../reference/datamodel.rst:2596 +#: ../../reference/datamodel.rst:2638 msgid "__bool__() (object method)" msgstr "__bool__() (物件方法)" -#: ../../reference/datamodel.rst:2754 ../../reference/datamodel.rst:2789 +#: ../../reference/datamodel.rst:2796 ../../reference/datamodel.rst:2831 msgid "divmod" msgstr "divmod" -#: ../../reference/datamodel.rst:2754 ../../reference/datamodel.rst:2789 -#: ../../reference/datamodel.rst:2803 +#: ../../reference/datamodel.rst:2796 ../../reference/datamodel.rst:2831 +#: ../../reference/datamodel.rst:2845 msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:2850 +#: ../../reference/datamodel.rst:2892 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:2860 +#: ../../reference/datamodel.rst:2902 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:2860 +#: ../../reference/datamodel.rst:2902 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:2888 +#: ../../reference/datamodel.rst:2930 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:2915 +#: ../../reference/datamodel.rst:2957 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:2915 +#: ../../reference/datamodel.rst:2957 msgid "context manager" msgstr "context manager(情境管理器)" diff --git a/reference/expressions.po b/reference/expressions.po index a75824076f..a5401c2ff7 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: 2023-10-20 00:03+0000\n" +"POT-Creation-Date: 2023-11-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-" @@ -858,18 +858,30 @@ msgstr "" msgid "" "The primary must evaluate to an object of a type that supports attribute " "references, which most objects do. This object is then asked to produce the " -"attribute whose name is the identifier. This production can be customized " -"by overriding the :meth:`__getattr__` method. If this attribute is not " -"available, the exception :exc:`AttributeError` is raised. Otherwise, the " -"type and value of the object produced is determined by the object. Multiple " -"evaluations of the same attribute reference may yield different objects." +"attribute whose name is the identifier. The type and value produced is " +"determined by the object. Multiple evaluations of the same attribute " +"reference may yield different objects." +msgstr "" + +#: ../../reference/expressions.rst:823 +msgid "" +"This production can be customized by overriding the :meth:`~object." +"__getattribute__` method or the :meth:`~object.__getattr__` method. The :" +"meth:`!__getattribute__` method is called first and either returns a value " +"or raises :exc:`AttributeError` if the attribute is not available." msgstr "" #: ../../reference/expressions.rst:829 +msgid "" +"If an :exc:`AttributeError` is raised and the object has a :meth:`!" +"__getattr__` method, that method is called as a fallback." +msgstr "" + +#: ../../reference/expressions.rst:835 msgid "Subscriptions" msgstr "" -#: ../../reference/expressions.rst:844 +#: ../../reference/expressions.rst:850 msgid "" "The subscription of an instance of a :ref:`container class ` " "will generally select an element from the container. The subscription of a :" @@ -877,13 +889,13 @@ msgid "" "`GenericAlias ` object." msgstr "" -#: ../../reference/expressions.rst:852 +#: ../../reference/expressions.rst:858 msgid "" "When an object is subscripted, the interpreter will evaluate the primary and " "the expression list." msgstr "" -#: ../../reference/expressions.rst:855 +#: ../../reference/expressions.rst:861 msgid "" "The primary must evaluate to an object that supports subscription. An object " "may support subscription through defining one or both of :meth:`~object." @@ -893,20 +905,20 @@ msgid "" "called instead of ``__getitem__``, see :ref:`classgetitem-versus-getitem`." msgstr "" -#: ../../reference/expressions.rst:862 +#: ../../reference/expressions.rst:868 msgid "" "If the expression list contains at least one comma, it will evaluate to a :" "class:`tuple` containing the items of the expression list. Otherwise, the " "expression list will evaluate to the value of the list's sole member." msgstr "" -#: ../../reference/expressions.rst:866 +#: ../../reference/expressions.rst:872 msgid "" "For built-in objects, there are two types of objects that support " "subscription via :meth:`~object.__getitem__`:" msgstr "" -#: ../../reference/expressions.rst:869 +#: ../../reference/expressions.rst:875 msgid "" "Mappings. If the primary is a :term:`mapping`, the expression list must " "evaluate to an object whose value is one of the keys of the mapping, and the " @@ -914,7 +926,7 @@ msgid "" "An example of a builtin mapping class is the :class:`dict` class." msgstr "" -#: ../../reference/expressions.rst:873 +#: ../../reference/expressions.rst:879 msgid "" "Sequences. If the primary is a :term:`sequence`, the expression list must " "evaluate to an :class:`int` or a :class:`slice` (as discussed in the " @@ -922,7 +934,7 @@ msgid "" "`str`, :class:`list` and :class:`tuple` classes." msgstr "" -#: ../../reference/expressions.rst:878 +#: ../../reference/expressions.rst:884 msgid "" "The formal syntax makes no special provision for negative indices in :term:" "`sequences `. However, built-in sequences all provide a :meth:" @@ -936,25 +948,25 @@ msgid "" "explicitly add that support." msgstr "" -#: ../../reference/expressions.rst:892 +#: ../../reference/expressions.rst:898 msgid "" "A :class:`string ` is a special kind of sequence whose items are " "*characters*. A character is not a separate data type but a string of " "exactly one character." msgstr "" -#: ../../reference/expressions.rst:900 +#: ../../reference/expressions.rst:906 msgid "Slicings" msgstr "" -#: ../../reference/expressions.rst:914 +#: ../../reference/expressions.rst:920 msgid "" "A slicing selects a range of items in a sequence object (e.g., a string, " "tuple or list). Slicings may be used as expressions or as targets in " "assignment or :keyword:`del` statements. The syntax for a slicing:" msgstr "" -#: ../../reference/expressions.rst:927 +#: ../../reference/expressions.rst:933 msgid "" "There is ambiguity in the formal syntax here: anything that looks like an " "expression list also looks like a slice list, so any subscription can be " @@ -964,7 +976,7 @@ msgid "" "the case if the slice list contains no proper slice)." msgstr "" -#: ../../reference/expressions.rst:939 +#: ../../reference/expressions.rst:945 msgid "" "The semantics for a slicing are as follows. The primary is indexed (using " "the same :meth:`~object.__getitem__` method as normal subscription) with a " @@ -979,23 +991,23 @@ msgid "" "missing expressions." msgstr "" -#: ../../reference/expressions.rst:963 +#: ../../reference/expressions.rst:969 msgid "Calls" msgstr "" -#: ../../reference/expressions.rst:965 +#: ../../reference/expressions.rst:971 msgid "" "A call calls a callable object (e.g., a :term:`function`) with a possibly " "empty series of :term:`arguments `:" msgstr "" -#: ../../reference/expressions.rst:982 +#: ../../reference/expressions.rst:988 msgid "" "An optional trailing comma may be present after the positional and keyword " "arguments but does not affect the semantics." msgstr "" -#: ../../reference/expressions.rst:988 +#: ../../reference/expressions.rst:994 msgid "" "The primary must evaluate to a callable object (user-defined functions, " "built-in functions, methods of built-in objects, class objects, methods of " @@ -1005,7 +1017,7 @@ msgid "" "formal :term:`parameter` lists." msgstr "" -#: ../../reference/expressions.rst:996 +#: ../../reference/expressions.rst:1002 msgid "" "If keyword arguments are present, they are first converted to positional " "arguments, as follows. First, a list of unfilled slots is created for the " @@ -1026,7 +1038,7 @@ msgid "" "filled slots is used as the argument list for the call." msgstr "" -#: ../../reference/expressions.rst:1016 +#: ../../reference/expressions.rst:1022 msgid "" "An implementation may provide built-in functions whose positional parameters " "do not have names, even if they are 'named' for the purpose of " @@ -1035,7 +1047,7 @@ msgid "" "`PyArg_ParseTuple` to parse their arguments." msgstr "" -#: ../../reference/expressions.rst:1022 +#: ../../reference/expressions.rst:1028 msgid "" "If there are more positional arguments than there are formal parameter " "slots, a :exc:`TypeError` exception is raised, unless a formal parameter " @@ -1044,7 +1056,7 @@ msgid "" "empty tuple if there were no excess positional arguments)." msgstr "" -#: ../../reference/expressions.rst:1028 +#: ../../reference/expressions.rst:1034 msgid "" "If any keyword argument does not correspond to a formal parameter name, a :" "exc:`TypeError` exception is raised, unless a formal parameter using the " @@ -1054,7 +1066,7 @@ msgid "" "(new) empty dictionary if there were no excess keyword arguments." msgstr "" -#: ../../reference/expressions.rst:1039 +#: ../../reference/expressions.rst:1045 msgid "" "If the syntax ``*expression`` appears in the function call, ``expression`` " "must evaluate to an :term:`iterable`. Elements from these iterables are " @@ -1064,20 +1076,20 @@ msgid "" "*y1*, ..., *yM*, *x3*, *x4*." msgstr "" -#: ../../reference/expressions.rst:1046 +#: ../../reference/expressions.rst:1052 msgid "" "A consequence of this is that although the ``*expression`` syntax may appear " "*after* explicit keyword arguments, it is processed *before* the keyword " "arguments (and any ``**expression`` arguments -- see below). So::" msgstr "" -#: ../../reference/expressions.rst:1062 +#: ../../reference/expressions.rst:1068 msgid "" "It is unusual for both keyword arguments and the ``*expression`` syntax to " "be used in the same call, so in practice this confusion does not often arise." msgstr "" -#: ../../reference/expressions.rst:1068 +#: ../../reference/expressions.rst:1074 msgid "" "If the syntax ``**expression`` appears in the function call, ``expression`` " "must evaluate to a :term:`mapping`, the contents of which are treated as " @@ -1086,7 +1098,7 @@ msgid "" "a :exc:`TypeError` exception is raised." msgstr "" -#: ../../reference/expressions.rst:1074 +#: ../../reference/expressions.rst:1080 msgid "" "When ``**expression`` is used, each key in this mapping must be a string. " "Each value from the mapping is assigned to the first formal parameter " @@ -1098,35 +1110,35 @@ msgid "" "is raised." msgstr "" -#: ../../reference/expressions.rst:1084 +#: ../../reference/expressions.rst:1090 msgid "" "Formal parameters using the syntax ``*identifier`` or ``**identifier`` " "cannot be used as positional argument slots or as keyword argument names." msgstr "" -#: ../../reference/expressions.rst:1087 +#: ../../reference/expressions.rst:1093 msgid "" "Function calls accept any number of ``*`` and ``**`` unpackings, positional " "arguments may follow iterable unpackings (``*``), and keyword arguments may " "follow dictionary unpackings (``**``). Originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1093 +#: ../../reference/expressions.rst:1099 msgid "" "A call always returns some value, possibly ``None``, unless it raises an " "exception. How this value is computed depends on the type of the callable " "object." msgstr "" -#: ../../reference/expressions.rst:1097 +#: ../../reference/expressions.rst:1103 msgid "If it is---" msgstr "" -#: ../../reference/expressions.rst:1110 +#: ../../reference/expressions.rst:1116 msgid "a user-defined function:" msgstr "" -#: ../../reference/expressions.rst:1106 +#: ../../reference/expressions.rst:1112 msgid "" "The code block for the function is executed, passing it the argument list. " "The first thing the code block will do is bind the formal parameters to the " @@ -1135,73 +1147,73 @@ msgid "" "value of the function call." msgstr "" -#: ../../reference/expressions.rst:1124 +#: ../../reference/expressions.rst:1130 msgid "a built-in function or method:" msgstr "" -#: ../../reference/expressions.rst:1123 +#: ../../reference/expressions.rst:1129 msgid "" "The result is up to the interpreter; see :ref:`built-in-funcs` for the " "descriptions of built-in functions and methods." msgstr "" -#: ../../reference/expressions.rst:1131 +#: ../../reference/expressions.rst:1137 msgid "a class object:" msgstr "" -#: ../../reference/expressions.rst:1131 +#: ../../reference/expressions.rst:1137 msgid "A new instance of that class is returned." msgstr "" -#: ../../reference/expressions.rst:1141 +#: ../../reference/expressions.rst:1147 msgid "a class instance method:" msgstr "" -#: ../../reference/expressions.rst:1139 +#: ../../reference/expressions.rst:1145 msgid "" "The corresponding user-defined function is called, with an argument list " "that is one longer than the argument list of the call: the instance becomes " "the first argument." msgstr "" -#: ../../reference/expressions.rst:1150 +#: ../../reference/expressions.rst:1156 msgid "a class instance:" msgstr "" -#: ../../reference/expressions.rst:1148 +#: ../../reference/expressions.rst:1154 msgid "" "The class must define a :meth:`__call__` method; the effect is then the same " "as if that method was called." msgstr "" -#: ../../reference/expressions.rst:1156 ../../reference/expressions.rst:1937 +#: ../../reference/expressions.rst:1162 ../../reference/expressions.rst:1944 msgid "Await expression" msgstr "" -#: ../../reference/expressions.rst:1158 +#: ../../reference/expressions.rst:1164 msgid "" "Suspend the execution of :term:`coroutine` on an :term:`awaitable` object. " "Can only be used inside a :term:`coroutine function`." msgstr "" -#: ../../reference/expressions.rst:1170 +#: ../../reference/expressions.rst:1176 msgid "The power operator" msgstr "" -#: ../../reference/expressions.rst:1176 +#: ../../reference/expressions.rst:1182 msgid "" "The power operator binds more tightly than unary operators on its left; it " "binds less tightly than unary operators on its right. The syntax is:" msgstr "" -#: ../../reference/expressions.rst:1182 +#: ../../reference/expressions.rst:1188 msgid "" "Thus, in an unparenthesized sequence of power and unary operators, the " "operators are evaluated from right to left (this does not constrain the " "evaluation order for the operands): ``-1**2`` results in ``-1``." msgstr "" -#: ../../reference/expressions.rst:1186 +#: ../../reference/expressions.rst:1192 msgid "" "The power operator has the same semantics as the built-in :func:`pow` " "function, when called with two arguments: it yields its left argument raised " @@ -1209,7 +1221,7 @@ msgid "" "converted to a common type, and the result is of that type." msgstr "" -#: ../../reference/expressions.rst:1191 +#: ../../reference/expressions.rst:1197 msgid "" "For int operands, the result has the same type as the operands unless the " "second argument is negative; in that case, all arguments are converted to " @@ -1217,40 +1229,40 @@ msgid "" "``100``, but ``10**-2`` returns ``0.01``." msgstr "" -#: ../../reference/expressions.rst:1196 +#: ../../reference/expressions.rst:1202 msgid "" "Raising ``0.0`` to a negative power results in a :exc:`ZeroDivisionError`. " "Raising a negative number to a fractional power results in a :class:" "`complex` number. (In earlier versions it raised a :exc:`ValueError`.)" msgstr "" -#: ../../reference/expressions.rst:1200 +#: ../../reference/expressions.rst:1206 msgid "" "This operation can be customized using the special :meth:`__pow__` method." msgstr "" -#: ../../reference/expressions.rst:1205 +#: ../../reference/expressions.rst:1211 msgid "Unary arithmetic and bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1211 +#: ../../reference/expressions.rst:1217 msgid "All unary arithmetic and bitwise operations have the same priority:" msgstr "" -#: ../../reference/expressions.rst:1222 +#: ../../reference/expressions.rst:1228 msgid "" "The unary ``-`` (minus) operator yields the negation of its numeric " "argument; the operation can be overridden with the :meth:`__neg__` special " "method." msgstr "" -#: ../../reference/expressions.rst:1230 +#: ../../reference/expressions.rst:1236 msgid "" "The unary ``+`` (plus) operator yields its numeric argument unchanged; the " "operation can be overridden with the :meth:`__pos__` special method." msgstr "" -#: ../../reference/expressions.rst:1237 +#: ../../reference/expressions.rst:1243 msgid "" "The unary ``~`` (invert) operator yields the bitwise inversion of its " "integer argument. The bitwise inversion of ``x`` is defined as ``-(x+1)``. " @@ -1258,17 +1270,17 @@ msgid "" "meth:`__invert__` special method." msgstr "" -#: ../../reference/expressions.rst:1246 +#: ../../reference/expressions.rst:1252 msgid "" "In all three cases, if the argument does not have the proper type, a :exc:" "`TypeError` exception is raised." msgstr "" -#: ../../reference/expressions.rst:1253 +#: ../../reference/expressions.rst:1259 msgid "Binary arithmetic operations" msgstr "" -#: ../../reference/expressions.rst:1257 +#: ../../reference/expressions.rst:1263 msgid "" "The binary arithmetic operations have the conventional priority levels. " "Note that some of these operations also apply to certain non-numeric types. " @@ -1276,7 +1288,7 @@ msgid "" "multiplicative operators and one for additive operators:" msgstr "" -#: ../../reference/expressions.rst:1272 +#: ../../reference/expressions.rst:1278 msgid "" "The ``*`` (multiplication) operator yields the product of its arguments. " "The arguments must either both be numbers, or one argument must be an " @@ -1286,19 +1298,19 @@ msgid "" "an empty sequence." msgstr "" -#: ../../reference/expressions.rst:1278 +#: ../../reference/expressions.rst:1284 msgid "" "This operation can be customized using the special :meth:`__mul__` and :meth:" "`__rmul__` methods." msgstr "" -#: ../../reference/expressions.rst:1285 +#: ../../reference/expressions.rst:1291 msgid "" "The ``@`` (at) operator is intended to be used for matrix multiplication. " "No builtin Python types implement this operator." msgstr "" -#: ../../reference/expressions.rst:1296 +#: ../../reference/expressions.rst:1302 msgid "" "The ``/`` (division) and ``//`` (floor division) operators yield the " "quotient of their arguments. The numeric arguments are first converted to a " @@ -1308,13 +1320,13 @@ msgid "" "the :exc:`ZeroDivisionError` exception." msgstr "" -#: ../../reference/expressions.rst:1303 +#: ../../reference/expressions.rst:1309 msgid "" "This operation can be customized using the special :meth:`__truediv__` and :" "meth:`__floordiv__` methods." msgstr "" -#: ../../reference/expressions.rst:1310 +#: ../../reference/expressions.rst:1316 msgid "" "The ``%`` (modulo) operator yields the remainder from the division of the " "first argument by the second. The numeric arguments are first converted to " @@ -1326,7 +1338,7 @@ msgid "" "absolute value of the second operand [#]_." msgstr "" -#: ../../reference/expressions.rst:1319 +#: ../../reference/expressions.rst:1325 msgid "" "The floor division and modulo operators are connected by the following " "identity: ``x == (x//y)*y + (x%y)``. Floor division and modulo are also " @@ -1334,7 +1346,7 @@ msgid "" "y, x%y)``. [#]_." msgstr "" -#: ../../reference/expressions.rst:1324 +#: ../../reference/expressions.rst:1330 msgid "" "In addition to performing the modulo operation on numbers, the ``%`` " "operator is also overloaded by string objects to perform old-style string " @@ -1343,20 +1355,20 @@ msgid "" "formatting`." msgstr "" -#: ../../reference/expressions.rst:1329 +#: ../../reference/expressions.rst:1335 msgid "" "The *modulo* operation can be customized using the special :meth:`__mod__` " "method." msgstr "" -#: ../../reference/expressions.rst:1331 +#: ../../reference/expressions.rst:1337 msgid "" "The floor division operator, the modulo operator, and the :func:`divmod` " "function are not defined for complex numbers. Instead, convert to a " "floating point number using the :func:`abs` function if appropriate." msgstr "" -#: ../../reference/expressions.rst:1340 +#: ../../reference/expressions.rst:1346 msgid "" "The ``+`` (addition) operator yields the sum of its arguments. The " "arguments must either both be numbers or both be sequences of the same " @@ -1364,84 +1376,84 @@ msgid "" "then added together. In the latter case, the sequences are concatenated." msgstr "" -#: ../../reference/expressions.rst:1345 +#: ../../reference/expressions.rst:1351 msgid "" "This operation can be customized using the special :meth:`__add__` and :meth:" "`__radd__` methods." msgstr "" -#: ../../reference/expressions.rst:1353 +#: ../../reference/expressions.rst:1359 msgid "" "The ``-`` (subtraction) operator yields the difference of its arguments. " "The numeric arguments are first converted to a common type." msgstr "" -#: ../../reference/expressions.rst:1356 +#: ../../reference/expressions.rst:1362 msgid "" "This operation can be customized using the special :meth:`__sub__` method." msgstr "" -#: ../../reference/expressions.rst:1362 +#: ../../reference/expressions.rst:1368 msgid "Shifting operations" msgstr "" -#: ../../reference/expressions.rst:1369 +#: ../../reference/expressions.rst:1375 msgid "" "The shifting operations have lower priority than the arithmetic operations:" msgstr "" -#: ../../reference/expressions.rst:1374 +#: ../../reference/expressions.rst:1380 msgid "" "These operators accept integers as arguments. They shift the first argument " "to the left or right by the number of bits given by the second argument." msgstr "" -#: ../../reference/expressions.rst:1377 +#: ../../reference/expressions.rst:1383 msgid "" "This operation can be customized using the special :meth:`__lshift__` and :" "meth:`__rshift__` methods." msgstr "" -#: ../../reference/expressions.rst:1382 +#: ../../reference/expressions.rst:1388 msgid "" "A right shift by *n* bits is defined as floor division by ``pow(2,n)``. A " "left shift by *n* bits is defined as multiplication with ``pow(2,n)``." msgstr "" -#: ../../reference/expressions.rst:1389 +#: ../../reference/expressions.rst:1395 msgid "Binary bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1393 +#: ../../reference/expressions.rst:1399 msgid "Each of the three bitwise operations has a different priority level:" msgstr "" -#: ../../reference/expressions.rst:1404 +#: ../../reference/expressions.rst:1410 msgid "" "The ``&`` operator yields the bitwise AND of its arguments, which must be " "integers or one of them must be a custom object overriding :meth:`__and__` " "or :meth:`__rand__` special methods." msgstr "" -#: ../../reference/expressions.rst:1413 +#: ../../reference/expressions.rst:1419 msgid "" "The ``^`` operator yields the bitwise XOR (exclusive OR) of its arguments, " "which must be integers or one of them must be a custom object overriding :" "meth:`__xor__` or :meth:`__rxor__` special methods." msgstr "" -#: ../../reference/expressions.rst:1422 +#: ../../reference/expressions.rst:1428 msgid "" "The ``|`` operator yields the bitwise (inclusive) OR of its arguments, which " "must be integers or one of them must be a custom object overriding :meth:" "`__or__` or :meth:`__ror__` special methods." msgstr "" -#: ../../reference/expressions.rst:1430 +#: ../../reference/expressions.rst:1436 msgid "Comparisons" msgstr "" -#: ../../reference/expressions.rst:1442 +#: ../../reference/expressions.rst:1448 msgid "" "Unlike C, all comparison operations in Python have the same priority, which " "is lower than that of any arithmetic, shifting or bitwise operation. Also " @@ -1449,14 +1461,14 @@ msgid "" "conventional in mathematics:" msgstr "" -#: ../../reference/expressions.rst:1452 +#: ../../reference/expressions.rst:1458 msgid "" "Comparisons yield boolean values: ``True`` or ``False``. Custom :dfn:`rich " "comparison methods` may return non-boolean values. In this case Python will " "call :func:`bool` on such value in boolean contexts." msgstr "" -#: ../../reference/expressions.rst:1458 +#: ../../reference/expressions.rst:1464 msgid "" "Comparisons can be chained arbitrarily, e.g., ``x < y <= z`` is equivalent " "to ``x < y and y <= z``, except that ``y`` is evaluated only once (but in " @@ -1464,7 +1476,7 @@ msgid "" "false)." msgstr "" -#: ../../reference/expressions.rst:1462 +#: ../../reference/expressions.rst:1468 msgid "" "Formally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*, " "*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y opN " @@ -1472,24 +1484,24 @@ msgid "" "each expression is evaluated at most once." msgstr "" -#: ../../reference/expressions.rst:1467 +#: ../../reference/expressions.rst:1473 msgid "" "Note that ``a op1 b op2 c`` doesn't imply any kind of comparison between *a* " "and *c*, so that, e.g., ``x < y > z`` is perfectly legal (though perhaps not " "pretty)." msgstr "" -#: ../../reference/expressions.rst:1474 +#: ../../reference/expressions.rst:1480 msgid "Value comparisons" msgstr "" -#: ../../reference/expressions.rst:1476 +#: ../../reference/expressions.rst:1482 msgid "" "The operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare the " "values of two objects. The objects do not need to have the same type." msgstr "" -#: ../../reference/expressions.rst:1479 +#: ../../reference/expressions.rst:1485 msgid "" "Chapter :ref:`objects` states that objects have a value (in addition to type " "and identity). The value of an object is a rather abstract notion in " @@ -1501,7 +1513,7 @@ msgid "" "indirectly, by means of their comparison implementation." msgstr "" -#: ../../reference/expressions.rst:1488 +#: ../../reference/expressions.rst:1494 msgid "" "Because all types are (direct or indirect) subtypes of :class:`object`, they " "inherit the default comparison behavior from :class:`object`. Types can " @@ -1509,7 +1521,7 @@ msgid "" "methods` like :meth:`__lt__`, described in :ref:`customization`." msgstr "" -#: ../../reference/expressions.rst:1494 +#: ../../reference/expressions.rst:1500 msgid "" "The default behavior for equality comparison (``==`` and ``!=``) is based on " "the identity of the objects. Hence, equality comparison of instances with " @@ -1519,14 +1531,14 @@ msgid "" "``x is y`` implies ``x == y``)." msgstr "" -#: ../../reference/expressions.rst:1501 +#: ../../reference/expressions.rst:1507 msgid "" "A default order comparison (``<``, ``>``, ``<=``, and ``>=``) is not " "provided; an attempt raises :exc:`TypeError`. A motivation for this default " "behavior is the lack of a similar invariant as for equality." msgstr "" -#: ../../reference/expressions.rst:1505 +#: ../../reference/expressions.rst:1511 msgid "" "The behavior of the default equality comparison, that instances with " "different identities are always unequal, may be in contrast to what types " @@ -1535,13 +1547,13 @@ msgid "" "in fact, a number of built-in types have done that." msgstr "" -#: ../../reference/expressions.rst:1511 +#: ../../reference/expressions.rst:1517 msgid "" "The following list describes the comparison behavior of the most important " "built-in types." msgstr "" -#: ../../reference/expressions.rst:1514 +#: ../../reference/expressions.rst:1520 msgid "" "Numbers of built-in numeric types (:ref:`typesnumeric`) and of the standard " "library types :class:`fractions.Fraction` and :class:`decimal.Decimal` can " @@ -1551,7 +1563,7 @@ msgid "" "of precision." msgstr "" -#: ../../reference/expressions.rst:1521 +#: ../../reference/expressions.rst:1527 msgid "" "The not-a-number values ``float('NaN')`` and ``decimal.Decimal('NaN')`` are " "special. Any ordered comparison of a number to a not-a-number value is " @@ -1561,32 +1573,32 @@ msgid "" "is compliant with IEEE 754." msgstr "" -#: ../../reference/expressions.rst:1528 +#: ../../reference/expressions.rst:1534 msgid "" "``None`` and ``NotImplemented`` are singletons. :PEP:`8` advises that " "comparisons for singletons should always be done with ``is`` or ``is not``, " "never the equality operators." msgstr "" -#: ../../reference/expressions.rst:1532 +#: ../../reference/expressions.rst:1538 msgid "" "Binary sequences (instances of :class:`bytes` or :class:`bytearray`) can be " "compared within and across their types. They compare lexicographically " "using the numeric values of their elements." msgstr "" -#: ../../reference/expressions.rst:1536 +#: ../../reference/expressions.rst:1542 msgid "" "Strings (instances of :class:`str`) compare lexicographically using the " "numerical Unicode code points (the result of the built-in function :func:" "`ord`) of their characters. [#]_" msgstr "" -#: ../../reference/expressions.rst:1540 +#: ../../reference/expressions.rst:1546 msgid "Strings and binary sequences cannot be directly compared." msgstr "" -#: ../../reference/expressions.rst:1542 +#: ../../reference/expressions.rst:1548 msgid "" "Sequences (instances of :class:`tuple`, :class:`list`, or :class:`range`) " "can be compared only within each of their types, with the restriction that " @@ -1595,7 +1607,7 @@ msgid "" "raises :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1548 +#: ../../reference/expressions.rst:1554 msgid "" "Sequences compare lexicographically using comparison of corresponding " "elements. The built-in containers typically assume identical objects are " @@ -1603,19 +1615,19 @@ msgid "" "objects to improve performance and to maintain their internal invariants." msgstr "" -#: ../../reference/expressions.rst:1553 +#: ../../reference/expressions.rst:1559 msgid "" "Lexicographical comparison between built-in collections works as follows:" msgstr "" -#: ../../reference/expressions.rst:1555 +#: ../../reference/expressions.rst:1561 msgid "" "For two collections to compare equal, they must be of the same type, have " "the same length, and each pair of corresponding elements must compare equal " "(for example, ``[1,2] == (1,2)`` is false because the type is not the same)." msgstr "" -#: ../../reference/expressions.rst:1560 +#: ../../reference/expressions.rst:1566 msgid "" "Collections that support order comparison are ordered the same as their " "first unequal elements (for example, ``[1,2,x] <= [1,2,y]`` has the same " @@ -1624,25 +1636,25 @@ msgid "" "true)." msgstr "" -#: ../../reference/expressions.rst:1566 +#: ../../reference/expressions.rst:1572 msgid "" "Mappings (instances of :class:`dict`) compare equal if and only if they have " "equal ``(key, value)`` pairs. Equality comparison of the keys and values " "enforces reflexivity." msgstr "" -#: ../../reference/expressions.rst:1570 +#: ../../reference/expressions.rst:1576 msgid "" "Order comparisons (``<``, ``>``, ``<=``, and ``>=``) raise :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1572 +#: ../../reference/expressions.rst:1578 msgid "" "Sets (instances of :class:`set` or :class:`frozenset`) can be compared " "within and across their types." msgstr "" -#: ../../reference/expressions.rst:1575 +#: ../../reference/expressions.rst:1581 msgid "" "They define order comparison operators to mean subset and superset tests. " "Those relations do not define total orderings (for example, the two sets " @@ -1653,110 +1665,110 @@ msgid "" "sets as inputs)." msgstr "" -#: ../../reference/expressions.rst:1583 +#: ../../reference/expressions.rst:1589 msgid "Comparison of sets enforces reflexivity of its elements." msgstr "" -#: ../../reference/expressions.rst:1585 +#: ../../reference/expressions.rst:1591 msgid "" "Most other built-in types have no comparison methods implemented, so they " "inherit the default comparison behavior." msgstr "" -#: ../../reference/expressions.rst:1588 +#: ../../reference/expressions.rst:1594 msgid "" "User-defined classes that customize their comparison behavior should follow " "some consistency rules, if possible:" msgstr "" -#: ../../reference/expressions.rst:1591 +#: ../../reference/expressions.rst:1597 msgid "" "Equality comparison should be reflexive. In other words, identical objects " "should compare equal:" msgstr "" -#: ../../reference/expressions.rst:1594 +#: ../../reference/expressions.rst:1600 msgid "``x is y`` implies ``x == y``" msgstr "" -#: ../../reference/expressions.rst:1596 +#: ../../reference/expressions.rst:1602 msgid "" "Comparison should be symmetric. In other words, the following expressions " "should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1599 +#: ../../reference/expressions.rst:1605 msgid "``x == y`` and ``y == x``" msgstr "``x == y`` 和 ``y == x``" -#: ../../reference/expressions.rst:1601 +#: ../../reference/expressions.rst:1607 msgid "``x != y`` and ``y != x``" msgstr "``x != y`` 和 ``y != x``" -#: ../../reference/expressions.rst:1603 +#: ../../reference/expressions.rst:1609 msgid "``x < y`` and ``y > x``" msgstr "``x < y`` 和 ``y > x``" -#: ../../reference/expressions.rst:1605 +#: ../../reference/expressions.rst:1611 msgid "``x <= y`` and ``y >= x``" msgstr "``x <= y`` 和 ``y >= x``" -#: ../../reference/expressions.rst:1607 +#: ../../reference/expressions.rst:1613 msgid "" "Comparison should be transitive. The following (non-exhaustive) examples " "illustrate that:" msgstr "" -#: ../../reference/expressions.rst:1610 +#: ../../reference/expressions.rst:1616 msgid "``x > y and y > z`` implies ``x > z``" msgstr "``x > y and y > z`` 暗示了 ``x > z``" -#: ../../reference/expressions.rst:1612 +#: ../../reference/expressions.rst:1618 msgid "``x < y and y <= z`` implies ``x < z``" msgstr "``x < y and y <= z`` 暗示了 ``x < z``" -#: ../../reference/expressions.rst:1614 +#: ../../reference/expressions.rst:1620 msgid "" "Inverse comparison should result in the boolean negation. In other words, " "the following expressions should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1617 +#: ../../reference/expressions.rst:1623 msgid "``x == y`` and ``not x != y``" msgstr "``x == y`` 和 ``not x != y``" -#: ../../reference/expressions.rst:1619 +#: ../../reference/expressions.rst:1625 msgid "``x < y`` and ``not x >= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1621 +#: ../../reference/expressions.rst:1627 msgid "``x > y`` and ``not x <= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1623 +#: ../../reference/expressions.rst:1629 msgid "" "The last two expressions apply to totally ordered collections (e.g. to " "sequences, but not to sets or mappings). See also the :func:`~functools." "total_ordering` decorator." msgstr "" -#: ../../reference/expressions.rst:1627 +#: ../../reference/expressions.rst:1633 msgid "" "The :func:`hash` result should be consistent with equality. Objects that are " "equal should either have the same hash value, or be marked as unhashable." msgstr "" -#: ../../reference/expressions.rst:1631 +#: ../../reference/expressions.rst:1637 msgid "" "Python does not enforce these consistency rules. In fact, the not-a-number " "values are an example for not following these rules." msgstr "" -#: ../../reference/expressions.rst:1640 +#: ../../reference/expressions.rst:1646 msgid "Membership test operations" msgstr "" -#: ../../reference/expressions.rst:1642 +#: ../../reference/expressions.rst:1648 msgid "" "The operators :keyword:`in` and :keyword:`not in` test for membership. ``x " "in s`` evaluates to ``True`` if *x* is a member of *s*, and ``False`` " @@ -1767,7 +1779,7 @@ msgid "" "expression ``x in y`` is equivalent to ``any(x is e or x == e for e in y)``." msgstr "" -#: ../../reference/expressions.rst:1650 +#: ../../reference/expressions.rst:1656 msgid "" "For the string and bytes types, ``x in y`` is ``True`` if and only if *x* is " "a substring of *y*. An equivalent test is ``y.find(x) != -1``. Empty " @@ -1775,14 +1787,14 @@ msgid "" "``\"\" in \"abc\"`` will return ``True``." msgstr "" -#: ../../reference/expressions.rst:1655 +#: ../../reference/expressions.rst:1661 msgid "" "For user-defined classes which define the :meth:`__contains__` method, ``x " "in y`` returns ``True`` if ``y.__contains__(x)`` returns a true value, and " "``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1659 +#: ../../reference/expressions.rst:1665 msgid "" "For user-defined classes which do not define :meth:`__contains__` but do " "define :meth:`__iter__`, ``x in y`` is ``True`` if some value ``z``, for " @@ -1791,7 +1803,7 @@ msgid "" "as if :keyword:`in` raised that exception." msgstr "" -#: ../../reference/expressions.rst:1665 +#: ../../reference/expressions.rst:1671 msgid "" "Lastly, the old-style iteration protocol is tried: if a class defines :meth:" "`~object.__getitem__`, ``x in y`` is ``True`` if and only if there is a non-" @@ -1800,17 +1812,17 @@ msgid "" "exception is raised, it is as if :keyword:`in` raised that exception)." msgstr "" -#: ../../reference/expressions.rst:1677 +#: ../../reference/expressions.rst:1683 msgid "" "The operator :keyword:`not in` is defined to have the inverse truth value " "of :keyword:`in`." msgstr "" -#: ../../reference/expressions.rst:1690 +#: ../../reference/expressions.rst:1696 msgid "Identity comparisons" msgstr "" -#: ../../reference/expressions.rst:1692 +#: ../../reference/expressions.rst:1698 msgid "" "The operators :keyword:`is` and :keyword:`is not` test for an object's " "identity: ``x is y`` is true if and only if *x* and *y* are the same " @@ -1818,11 +1830,11 @@ msgid "" "``x is not y`` yields the inverse truth value. [#]_" msgstr "" -#: ../../reference/expressions.rst:1704 +#: ../../reference/expressions.rst:1710 msgid "Boolean operations" msgstr "" -#: ../../reference/expressions.rst:1715 +#: ../../reference/expressions.rst:1721 msgid "" "In the context of Boolean operations, and also when expressions are used by " "control flow statements, the following values are interpreted as false: " @@ -1833,25 +1845,25 @@ msgid "" "__bool__` method." msgstr "" -#: ../../reference/expressions.rst:1724 +#: ../../reference/expressions.rst:1730 msgid "" "The operator :keyword:`not` yields ``True`` if its argument is false, " "``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1729 +#: ../../reference/expressions.rst:1735 msgid "" "The expression ``x and y`` first evaluates *x*; if *x* is false, its value " "is returned; otherwise, *y* is evaluated and the resulting value is returned." msgstr "" -#: ../../reference/expressions.rst:1734 +#: ../../reference/expressions.rst:1740 msgid "" "The expression ``x or y`` first evaluates *x*; if *x* is true, its value is " "returned; otherwise, *y* is evaluated and the resulting value is returned." msgstr "" -#: ../../reference/expressions.rst:1737 +#: ../../reference/expressions.rst:1743 msgid "" "Note that neither :keyword:`and` nor :keyword:`or` restrict the value and " "type they return to ``False`` and ``True``, but rather return the last " @@ -1862,11 +1874,11 @@ msgid "" "argument (for example, ``not 'foo'`` produces ``False`` rather than ``''``.)" msgstr "" -#: ../../reference/expressions.rst:1753 +#: ../../reference/expressions.rst:1759 msgid "Assignment expressions" msgstr "" -#: ../../reference/expressions.rst:1758 +#: ../../reference/expressions.rst:1764 msgid "" "An assignment expression (sometimes also called a \"named expression\" or " "\"walrus\") assigns an :token:`~python-grammar:expression` to an :token:" @@ -1874,53 +1886,54 @@ msgid "" "`~python-grammar:expression`." msgstr "" -#: ../../reference/expressions.rst:1763 +#: ../../reference/expressions.rst:1769 msgid "One common use case is when handling matched regular expressions:" msgstr "" -#: ../../reference/expressions.rst:1770 +#: ../../reference/expressions.rst:1776 msgid "Or, when processing a file stream in chunks:" msgstr "" -#: ../../reference/expressions.rst:1777 +#: ../../reference/expressions.rst:1783 msgid "" -"Assignment expressions must be surrounded by parentheses when used as sub-" -"expressions in slicing, conditional, lambda, keyword-argument, and " -"comprehension-if expressions and in ``assert`` and ``with`` statements. In " -"all other places where they can be used, parentheses are not required, " -"including in ``if`` and ``while`` statements." +"Assignment expressions must be surrounded by parentheses when used as " +"expression statements and when used as sub-expressions in slicing, " +"conditional, lambda, keyword-argument, and comprehension-if expressions and " +"in ``assert``, ``with``, and ``assignment`` statements. In all other places " +"where they can be used, parentheses are not required, including in ``if`` " +"and ``while`` statements." msgstr "" -#: ../../reference/expressions.rst:1784 +#: ../../reference/expressions.rst:1791 msgid "See :pep:`572` for more details about assignment expressions." msgstr "" -#: ../../reference/expressions.rst:1791 +#: ../../reference/expressions.rst:1798 msgid "Conditional expressions" msgstr "" -#: ../../reference/expressions.rst:1803 +#: ../../reference/expressions.rst:1810 msgid "" "Conditional expressions (sometimes called a \"ternary operator\") have the " "lowest priority of all Python operations." msgstr "" -#: ../../reference/expressions.rst:1806 +#: ../../reference/expressions.rst:1813 msgid "" "The expression ``x if C else y`` first evaluates the condition, *C* rather " "than *x*. If *C* is true, *x* is evaluated and its value is returned; " "otherwise, *y* is evaluated and its value is returned." msgstr "" -#: ../../reference/expressions.rst:1810 +#: ../../reference/expressions.rst:1817 msgid "See :pep:`308` for more details about conditional expressions." msgstr "" -#: ../../reference/expressions.rst:1817 +#: ../../reference/expressions.rst:1824 msgid "Lambdas" msgstr "" -#: ../../reference/expressions.rst:1828 +#: ../../reference/expressions.rst:1835 msgid "" "Lambda expressions (sometimes called lambda forms) are used to create " "anonymous functions. The expression ``lambda parameters: expression`` yields " @@ -1928,25 +1941,25 @@ msgid "" "defined with:" msgstr "" -#: ../../reference/expressions.rst:1837 +#: ../../reference/expressions.rst:1844 msgid "" "See section :ref:`function` for the syntax of parameter lists. Note that " "functions created with lambda expressions cannot contain statements or " "annotations." msgstr "" -#: ../../reference/expressions.rst:1845 +#: ../../reference/expressions.rst:1852 msgid "Expression lists" msgstr "" -#: ../../reference/expressions.rst:1859 +#: ../../reference/expressions.rst:1866 msgid "" "Except when part of a list or set display, an expression list containing at " "least one comma yields a tuple. The length of the tuple is the number of " "expressions in the list. The expressions are evaluated from left to right." msgstr "" -#: ../../reference/expressions.rst:1868 +#: ../../reference/expressions.rst:1875 msgid "" "An asterisk ``*`` denotes :dfn:`iterable unpacking`. Its operand must be " "an :term:`iterable`. The iterable is expanded into a sequence of items, " @@ -1954,12 +1967,12 @@ msgid "" "unpacking." msgstr "" -#: ../../reference/expressions.rst:1873 +#: ../../reference/expressions.rst:1880 msgid "" "Iterable unpacking in expression lists, originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1878 +#: ../../reference/expressions.rst:1885 msgid "" "The trailing comma is required only to create a single tuple (a.k.a. a " "*singleton*); it is optional in all other cases. A single expression " @@ -1968,28 +1981,28 @@ msgid "" "parentheses: ``()``.)" msgstr "" -#: ../../reference/expressions.rst:1888 +#: ../../reference/expressions.rst:1895 msgid "Evaluation order" msgstr "" -#: ../../reference/expressions.rst:1892 +#: ../../reference/expressions.rst:1899 msgid "" "Python evaluates expressions from left to right. Notice that while " "evaluating an assignment, the right-hand side is evaluated before the left-" "hand side." msgstr "" -#: ../../reference/expressions.rst:1895 +#: ../../reference/expressions.rst:1902 msgid "" "In the following lines, expressions will be evaluated in the arithmetic " "order of their suffixes::" msgstr "" -#: ../../reference/expressions.rst:1909 +#: ../../reference/expressions.rst:1916 msgid "Operator precedence" msgstr "" -#: ../../reference/expressions.rst:1914 +#: ../../reference/expressions.rst:1921 msgid "" "The following table summarizes the operator precedence in Python, from " "highest precedence (most binding) to lowest precedence (least binding). " @@ -1999,176 +2012,176 @@ msgid "" "group from right to left)." msgstr "" -#: ../../reference/expressions.rst:1920 +#: ../../reference/expressions.rst:1927 msgid "" "Note that comparisons, membership tests, and identity tests, all have the " "same precedence and have a left-to-right chaining feature as described in " "the :ref:`comparisons` section." msgstr "" -#: ../../reference/expressions.rst:1926 +#: ../../reference/expressions.rst:1933 msgid "Operator" msgstr "" -#: ../../reference/expressions.rst:1926 +#: ../../reference/expressions.rst:1933 msgid "Description" msgstr "描述" -#: ../../reference/expressions.rst:1928 +#: ../../reference/expressions.rst:1935 msgid "``(expressions...)``," msgstr "``(expressions...)``," -#: ../../reference/expressions.rst:1930 +#: ../../reference/expressions.rst:1937 msgid "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" msgstr "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" -#: ../../reference/expressions.rst:1928 +#: ../../reference/expressions.rst:1935 msgid "" "Binding or parenthesized expression, list display, dictionary display, set " "display" msgstr "" -#: ../../reference/expressions.rst:1934 +#: ../../reference/expressions.rst:1941 msgid "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" msgstr "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" -#: ../../reference/expressions.rst:1934 +#: ../../reference/expressions.rst:1941 msgid "Subscription, slicing, call, attribute reference" msgstr "" -#: ../../reference/expressions.rst:1937 +#: ../../reference/expressions.rst:1944 msgid ":keyword:`await x `" msgstr ":keyword:`await x `" -#: ../../reference/expressions.rst:1939 +#: ../../reference/expressions.rst:1946 msgid "``**``" msgstr "``**``" -#: ../../reference/expressions.rst:1939 +#: ../../reference/expressions.rst:1946 msgid "Exponentiation [#]_" msgstr "" -#: ../../reference/expressions.rst:1941 +#: ../../reference/expressions.rst:1948 msgid "``+x``, ``-x``, ``~x``" msgstr "``+x``, ``-x``, ``~x``" -#: ../../reference/expressions.rst:1941 +#: ../../reference/expressions.rst:1948 msgid "Positive, negative, bitwise NOT" msgstr "" -#: ../../reference/expressions.rst:1943 +#: ../../reference/expressions.rst:1950 msgid "``*``, ``@``, ``/``, ``//``, ``%``" msgstr "``*``, ``@``, ``/``, ``//``, ``%``" -#: ../../reference/expressions.rst:1943 +#: ../../reference/expressions.rst:1950 msgid "" "Multiplication, matrix multiplication, division, floor division, remainder " "[#]_" msgstr "" -#: ../../reference/expressions.rst:1947 +#: ../../reference/expressions.rst:1954 msgid "``+``, ``-``" msgstr "``+``, ``-``" -#: ../../reference/expressions.rst:1947 +#: ../../reference/expressions.rst:1954 msgid "Addition and subtraction" msgstr "" -#: ../../reference/expressions.rst:1949 +#: ../../reference/expressions.rst:1956 msgid "``<<``, ``>>``" msgstr "``<<``, ``>>``" -#: ../../reference/expressions.rst:1949 +#: ../../reference/expressions.rst:1956 msgid "Shifts" msgstr "" -#: ../../reference/expressions.rst:1951 +#: ../../reference/expressions.rst:1958 msgid "``&``" msgstr "``&``" -#: ../../reference/expressions.rst:1951 +#: ../../reference/expressions.rst:1958 msgid "Bitwise AND" msgstr "" -#: ../../reference/expressions.rst:1953 +#: ../../reference/expressions.rst:1960 msgid "``^``" msgstr "``^``" -#: ../../reference/expressions.rst:1953 +#: ../../reference/expressions.rst:1960 msgid "Bitwise XOR" msgstr "" -#: ../../reference/expressions.rst:1955 +#: ../../reference/expressions.rst:1962 msgid "``|``" msgstr "``|``" -#: ../../reference/expressions.rst:1955 +#: ../../reference/expressions.rst:1962 msgid "Bitwise OR" msgstr "" -#: ../../reference/expressions.rst:1957 +#: ../../reference/expressions.rst:1964 msgid "" ":keyword:`in`, :keyword:`not in`, :keyword:`is`, :keyword:`is not`, ``<``, " "``<=``, ``>``, ``>=``, ``!=``, ``==``" msgstr "" -#: ../../reference/expressions.rst:1957 +#: ../../reference/expressions.rst:1964 msgid "Comparisons, including membership tests and identity tests" msgstr "" -#: ../../reference/expressions.rst:1961 +#: ../../reference/expressions.rst:1968 msgid ":keyword:`not x `" msgstr ":keyword:`not x `" -#: ../../reference/expressions.rst:1961 +#: ../../reference/expressions.rst:1968 msgid "Boolean NOT" msgstr "" -#: ../../reference/expressions.rst:1963 +#: ../../reference/expressions.rst:1970 msgid ":keyword:`and`" msgstr ":keyword:`and`" -#: ../../reference/expressions.rst:1963 +#: ../../reference/expressions.rst:1970 msgid "Boolean AND" msgstr "" -#: ../../reference/expressions.rst:1965 +#: ../../reference/expressions.rst:1972 msgid ":keyword:`or`" msgstr ":keyword:`or`" -#: ../../reference/expressions.rst:1965 +#: ../../reference/expressions.rst:1972 msgid "Boolean OR" msgstr "" -#: ../../reference/expressions.rst:1967 +#: ../../reference/expressions.rst:1974 msgid ":keyword:`if ` -- :keyword:`!else`" msgstr ":keyword:`if ` -- :keyword:`!else`" -#: ../../reference/expressions.rst:1967 +#: ../../reference/expressions.rst:1974 msgid "Conditional expression" msgstr "" -#: ../../reference/expressions.rst:1969 +#: ../../reference/expressions.rst:1976 msgid ":keyword:`lambda`" msgstr ":keyword:`lambda`" -#: ../../reference/expressions.rst:1969 +#: ../../reference/expressions.rst:1976 msgid "Lambda expression" msgstr "" -#: ../../reference/expressions.rst:1971 +#: ../../reference/expressions.rst:1978 msgid "``:=``" msgstr "``:=``" -#: ../../reference/expressions.rst:1971 +#: ../../reference/expressions.rst:1978 msgid "Assignment expression" msgstr "" -#: ../../reference/expressions.rst:1976 +#: ../../reference/expressions.rst:1983 msgid "Footnotes" msgstr "註解" -#: ../../reference/expressions.rst:1977 +#: ../../reference/expressions.rst:1984 msgid "" "While ``abs(x%y) < abs(y)`` is true mathematically, for floats it may not be " "true numerically due to roundoff. For example, and assuming a platform on " @@ -2180,7 +2193,7 @@ msgid "" "approach is more appropriate depends on the application." msgstr "" -#: ../../reference/expressions.rst:1986 +#: ../../reference/expressions.rst:1993 msgid "" "If x is very close to an exact integer multiple of y, it's possible for ``x//" "y`` to be one larger than ``(x-x%y)//y`` due to rounding. In such cases, " @@ -2188,7 +2201,7 @@ msgid "" "* y + x % y`` be very close to ``x``." msgstr "" -#: ../../reference/expressions.rst:1991 +#: ../../reference/expressions.rst:1998 msgid "" "The Unicode standard distinguishes between :dfn:`code points` (e.g. U+0041) " "and :dfn:`abstract characters` (e.g. \"LATIN CAPITAL LETTER A\"). While most " @@ -2202,7 +2215,7 @@ msgid "" "(COMBINING CEDILLA)." msgstr "" -#: ../../reference/expressions.rst:2002 +#: ../../reference/expressions.rst:2009 msgid "" "The comparison operators on strings compare at the level of Unicode code " "points. This may be counter-intuitive to humans. For example, ``\"\\u00C7\" " @@ -2210,13 +2223,13 @@ msgid "" "same abstract character \"LATIN CAPITAL LETTER C WITH CEDILLA\"." msgstr "" -#: ../../reference/expressions.rst:2007 +#: ../../reference/expressions.rst:2014 msgid "" "To compare strings at the level of abstract characters (that is, in a way " "intuitive to humans), use :func:`unicodedata.normalize`." msgstr "" -#: ../../reference/expressions.rst:2010 +#: ../../reference/expressions.rst:2017 msgid "" "Due to automatic garbage-collection, free lists, and the dynamic nature of " "descriptors, you may notice seemingly unusual behaviour in certain uses of " @@ -2224,22 +2237,22 @@ msgid "" "instance methods, or constants. Check their documentation for more info." msgstr "" -#: ../../reference/expressions.rst:2015 +#: ../../reference/expressions.rst:2022 msgid "" "The power operator ``**`` binds less tightly than an arithmetic or bitwise " "unary operator on its right, that is, ``2**-1`` is ``0.5``." msgstr "" -#: ../../reference/expressions.rst:2018 +#: ../../reference/expressions.rst:2025 msgid "" "The ``%`` operator is also used for string formatting; the same precedence " "applies." msgstr "" #: ../../reference/expressions.rst:8 ../../reference/expressions.rst:362 -#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1706 -#: ../../reference/expressions.rst:1793 ../../reference/expressions.rst:1819 -#: ../../reference/expressions.rst:1847 +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1712 +#: ../../reference/expressions.rst:1800 ../../reference/expressions.rst:1826 +#: ../../reference/expressions.rst:1854 #, fuzzy msgid "expression" msgstr "``(expressions...)``," @@ -2248,8 +2261,8 @@ msgstr "``(expressions...)``," msgid "BNF" msgstr "" -#: ../../reference/expressions.rst:28 ../../reference/expressions.rst:1207 -#: ../../reference/expressions.rst:1255 +#: ../../reference/expressions.rst:28 ../../reference/expressions.rst:1213 +#: ../../reference/expressions.rst:1261 msgid "arithmetic" msgstr "" @@ -2272,8 +2285,8 @@ msgstr "" #: ../../reference/expressions.rst:74 ../../reference/expressions.rst:537 #: ../../reference/expressions.rst:592 ../../reference/expressions.rst:714 #: ../../reference/expressions.rst:766 ../../reference/expressions.rst:812 -#: ../../reference/expressions.rst:1244 ../../reference/expressions.rst:1290 -#: ../../reference/expressions.rst:1380 +#: ../../reference/expressions.rst:1250 ../../reference/expressions.rst:1296 +#: ../../reference/expressions.rst:1386 #, fuzzy msgid "exception" msgstr "描述" @@ -2314,11 +2327,11 @@ msgstr "type(型別)" #: ../../reference/expressions.rst:270 ../../reference/expressions.rst:298 #: ../../reference/expressions.rst:341 ../../reference/expressions.rst:362 #: ../../reference/expressions.rst:525 ../../reference/expressions.rst:704 -#: ../../reference/expressions.rst:812 ../../reference/expressions.rst:835 -#: ../../reference/expressions.rst:908 ../../reference/expressions.rst:952 -#: ../../reference/expressions.rst:1100 ../../reference/expressions.rst:1113 -#: ../../reference/expressions.rst:1127 ../../reference/expressions.rst:1134 -#: ../../reference/expressions.rst:1671 ../../reference/expressions.rst:1857 +#: ../../reference/expressions.rst:812 ../../reference/expressions.rst:841 +#: ../../reference/expressions.rst:914 ../../reference/expressions.rst:958 +#: ../../reference/expressions.rst:1106 ../../reference/expressions.rst:1119 +#: ../../reference/expressions.rst:1133 ../../reference/expressions.rst:1140 +#: ../../reference/expressions.rst:1677 ../../reference/expressions.rst:1864 msgid "object" msgstr "object(物件)" @@ -2327,7 +2340,7 @@ msgid "parenthesized form" msgstr "" #: ../../reference/expressions.rst:133 ../../reference/expressions.rst:362 -#: ../../reference/expressions.rst:952 +#: ../../reference/expressions.rst:958 msgid "() (parentheses)" msgstr "() (圓括號)" @@ -2339,19 +2352,19 @@ msgstr "" msgid "empty" msgstr "" -#: ../../reference/expressions.rst:146 ../../reference/expressions.rst:835 -#: ../../reference/expressions.rst:908 ../../reference/expressions.rst:1857 +#: ../../reference/expressions.rst:146 ../../reference/expressions.rst:841 +#: ../../reference/expressions.rst:914 ../../reference/expressions.rst:1864 msgid "tuple" msgstr "" -#: ../../reference/expressions.rst:152 ../../reference/expressions.rst:1876 +#: ../../reference/expressions.rst:152 ../../reference/expressions.rst:1883 msgid "comma" msgstr "" #: ../../reference/expressions.rst:152 ../../reference/expressions.rst:244 #: ../../reference/expressions.rst:270 ../../reference/expressions.rst:298 -#: ../../reference/expressions.rst:902 ../../reference/expressions.rst:952 -#: ../../reference/expressions.rst:1847 +#: ../../reference/expressions.rst:908 ../../reference/expressions.rst:958 +#: ../../reference/expressions.rst:1854 msgid ", (comma)" msgstr ", (逗號)" @@ -2368,7 +2381,7 @@ msgstr "for" msgid "in comprehensions" msgstr "於 comprehensions(綜合運算)" -#: ../../reference/expressions.rst:177 ../../reference/expressions.rst:1793 +#: ../../reference/expressions.rst:177 ../../reference/expressions.rst:1800 msgid "if" msgstr "if" @@ -2376,13 +2389,13 @@ msgstr "if" msgid "async for" msgstr "async for" -#: ../../reference/expressions.rst:212 ../../reference/expressions.rst:1152 +#: ../../reference/expressions.rst:212 ../../reference/expressions.rst:1158 msgid "await" msgstr "await" #: ../../reference/expressions.rst:244 ../../reference/expressions.rst:812 -#: ../../reference/expressions.rst:835 ../../reference/expressions.rst:908 -#: ../../reference/expressions.rst:1847 +#: ../../reference/expressions.rst:841 ../../reference/expressions.rst:914 +#: ../../reference/expressions.rst:1854 msgid "list" msgstr "list(串列)" @@ -2391,7 +2404,7 @@ msgstr "list(串列)" msgid "display" msgstr "" -#: ../../reference/expressions.rst:244 ../../reference/expressions.rst:831 +#: ../../reference/expressions.rst:244 ../../reference/expressions.rst:837 msgid "[] (square brackets)" msgstr "[] (方括號)" @@ -2400,7 +2413,7 @@ msgid "list expression" msgstr "list expression(串列運算式)" #: ../../reference/expressions.rst:244 ../../reference/expressions.rst:270 -#: ../../reference/expressions.rst:1847 +#: ../../reference/expressions.rst:1854 msgid "expression list" msgstr "expression list(運算式串列)" @@ -2417,7 +2430,7 @@ msgid "set expression" msgstr "set expression(集合運算式)" #: ../../reference/expressions.rst:298 ../../reference/expressions.rst:324 -#: ../../reference/expressions.rst:835 +#: ../../reference/expressions.rst:841 msgid "dictionary" msgstr "dictionary(字典)" @@ -2437,8 +2450,8 @@ msgstr "key/value pair(鍵/值對)" msgid "dictionary expression" msgstr "dictionary expression(字典運算式)" -#: ../../reference/expressions.rst:298 ../../reference/expressions.rst:902 -#: ../../reference/expressions.rst:1819 +#: ../../reference/expressions.rst:298 ../../reference/expressions.rst:908 +#: ../../reference/expressions.rst:1826 msgid ": (colon)" msgstr ": (冒號)" @@ -2450,13 +2463,13 @@ msgstr "於字典運算式" msgid "in dictionary displays" msgstr "於字典顯示" -#: ../../reference/expressions.rst:324 ../../reference/expressions.rst:1035 -#: ../../reference/expressions.rst:1864 +#: ../../reference/expressions.rst:324 ../../reference/expressions.rst:1041 +#: ../../reference/expressions.rst:1871 msgid "unpacking" msgstr "unpacking(解包)" -#: ../../reference/expressions.rst:324 ../../reference/expressions.rst:1065 -#: ../../reference/expressions.rst:1172 +#: ../../reference/expressions.rst:324 ../../reference/expressions.rst:1071 +#: ../../reference/expressions.rst:1178 msgid "**" msgstr "**" @@ -2473,7 +2486,7 @@ msgstr "generator(產生器)" msgid "generator expression" msgstr "generator expression(產生器運算式)" -#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1152 +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1158 msgid "keyword" msgstr "keyword(關鍵字)" @@ -2485,8 +2498,8 @@ msgstr "yield" msgid "from" msgstr "from" -#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1100 -#: ../../reference/expressions.rst:1113 ../../reference/expressions.rst:1819 +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1106 +#: ../../reference/expressions.rst:1119 ../../reference/expressions.rst:1826 msgid "function" msgstr "function (函式)" @@ -2546,456 +2559,456 @@ msgstr "AttributeError" msgid "module" msgstr "module(模組)" -#: ../../reference/expressions.rst:831 +#: ../../reference/expressions.rst:837 msgid "subscription" msgstr "subscription(下標)" -#: ../../reference/expressions.rst:835 ../../reference/expressions.rst:908 -#: ../../reference/expressions.rst:1671 +#: ../../reference/expressions.rst:841 ../../reference/expressions.rst:914 +#: ../../reference/expressions.rst:1677 msgid "sequence" msgstr "sequence(序列)" -#: ../../reference/expressions.rst:835 +#: ../../reference/expressions.rst:841 msgid "mapping" msgstr "mapping(對映)" -#: ../../reference/expressions.rst:835 ../../reference/expressions.rst:888 -#: ../../reference/expressions.rst:908 +#: ../../reference/expressions.rst:841 ../../reference/expressions.rst:894 +#: ../../reference/expressions.rst:914 msgid "string" msgstr "string(字串)" -#: ../../reference/expressions.rst:835 ../../reference/expressions.rst:888 +#: ../../reference/expressions.rst:841 ../../reference/expressions.rst:894 msgid "item" msgstr "item(項目)" -#: ../../reference/expressions.rst:888 +#: ../../reference/expressions.rst:894 msgid "character" msgstr "character(字元)" -#: ../../reference/expressions.rst:902 +#: ../../reference/expressions.rst:908 msgid "slicing" msgstr "slicing(切片)" -#: ../../reference/expressions.rst:902 +#: ../../reference/expressions.rst:908 msgid "slice" msgstr "slice(切片)" -#: ../../reference/expressions.rst:934 +#: ../../reference/expressions.rst:940 msgid "start (slice object attribute)" msgstr "start(切片物件屬性)" -#: ../../reference/expressions.rst:934 +#: ../../reference/expressions.rst:940 msgid "stop (slice object attribute)" msgstr "stop(切片物件屬性)" -#: ../../reference/expressions.rst:934 +#: ../../reference/expressions.rst:940 msgid "step (slice object attribute)" msgstr "step(切片物件屬性)" -#: ../../reference/expressions.rst:952 +#: ../../reference/expressions.rst:958 msgid "callable" msgstr "callable(可呼叫物件)" -#: ../../reference/expressions.rst:952 ../../reference/expressions.rst:1100 -#: ../../reference/expressions.rst:1113 ../../reference/expressions.rst:1127 -#: ../../reference/expressions.rst:1134 ../../reference/expressions.rst:1144 +#: ../../reference/expressions.rst:958 ../../reference/expressions.rst:1106 +#: ../../reference/expressions.rst:1119 ../../reference/expressions.rst:1133 +#: ../../reference/expressions.rst:1140 ../../reference/expressions.rst:1150 msgid "call" msgstr "call(呼叫)" -#: ../../reference/expressions.rst:952 +#: ../../reference/expressions.rst:958 msgid "argument" msgstr "argument(引數)" -#: ../../reference/expressions.rst:952 ../../reference/expressions.rst:985 +#: ../../reference/expressions.rst:958 ../../reference/expressions.rst:991 msgid "call semantics" msgstr "call semantics(呼叫語意)" -#: ../../reference/expressions.rst:952 +#: ../../reference/expressions.rst:958 msgid "argument list" msgstr "argument list(引數列表)" -#: ../../reference/expressions.rst:952 +#: ../../reference/expressions.rst:958 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/expressions.rst:952 ../../reference/expressions.rst:1035 -#: ../../reference/expressions.rst:1065 +#: ../../reference/expressions.rst:958 ../../reference/expressions.rst:1041 +#: ../../reference/expressions.rst:1071 msgid "in function calls" msgstr "於函式呼叫中" -#: ../../reference/expressions.rst:985 +#: ../../reference/expressions.rst:991 msgid "parameter" msgstr "parameter(參數)" -#: ../../reference/expressions.rst:1035 ../../reference/expressions.rst:1268 -#: ../../reference/expressions.rst:1864 +#: ../../reference/expressions.rst:1041 ../../reference/expressions.rst:1274 +#: ../../reference/expressions.rst:1871 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../reference/expressions.rst:1100 +#: ../../reference/expressions.rst:1106 msgid "user-defined" msgstr "user-defined(使用者定義)" -#: ../../reference/expressions.rst:1100 +#: ../../reference/expressions.rst:1106 msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/expressions.rst:1113 +#: ../../reference/expressions.rst:1119 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../reference/expressions.rst:1113 +#: ../../reference/expressions.rst:1119 msgid "method" msgstr "method(方法)" -#: ../../reference/expressions.rst:1113 +#: ../../reference/expressions.rst:1119 msgid "built-in method" msgstr "built-in method(內建方法)" -#: ../../reference/expressions.rst:1127 +#: ../../reference/expressions.rst:1133 msgid "class" msgstr "class(類別)" -#: ../../reference/expressions.rst:1127 +#: ../../reference/expressions.rst:1133 msgid "class object" msgstr "class object(類別物件)" -#: ../../reference/expressions.rst:1134 +#: ../../reference/expressions.rst:1140 msgid "class instance" msgstr "class instance(類別實例)" -#: ../../reference/expressions.rst:1134 ../../reference/expressions.rst:1144 +#: ../../reference/expressions.rst:1140 ../../reference/expressions.rst:1150 msgid "instance" msgstr "instance(實例)" -#: ../../reference/expressions.rst:1144 +#: ../../reference/expressions.rst:1150 msgid "__call__() (object method)" msgstr "__call__() (物件方法)" -#: ../../reference/expressions.rst:1172 +#: ../../reference/expressions.rst:1178 msgid "power" msgstr "power(次方)" -#: ../../reference/expressions.rst:1172 ../../reference/expressions.rst:1207 -#: ../../reference/expressions.rst:1255 ../../reference/expressions.rst:1364 -#: ../../reference/expressions.rst:1391 ../../reference/expressions.rst:1706 +#: ../../reference/expressions.rst:1178 ../../reference/expressions.rst:1213 +#: ../../reference/expressions.rst:1261 ../../reference/expressions.rst:1370 +#: ../../reference/expressions.rst:1397 ../../reference/expressions.rst:1712 msgid "operation" msgstr "operation(操作)" -#: ../../reference/expressions.rst:1172 ../../reference/expressions.rst:1216 -#: ../../reference/expressions.rst:1225 ../../reference/expressions.rst:1233 -#: ../../reference/expressions.rst:1268 ../../reference/expressions.rst:1281 -#: ../../reference/expressions.rst:1290 ../../reference/expressions.rst:1306 -#: ../../reference/expressions.rst:1335 ../../reference/expressions.rst:1348 -#: ../../reference/expressions.rst:1364 ../../reference/expressions.rst:1400 -#: ../../reference/expressions.rst:1408 ../../reference/expressions.rst:1417 -#: ../../reference/expressions.rst:1432 ../../reference/expressions.rst:1671 -#: ../../reference/expressions.rst:1680 ../../reference/expressions.rst:1722 -#: ../../reference/expressions.rst:1727 ../../reference/expressions.rst:1732 -#: ../../reference/expressions.rst:1793 ../../reference/expressions.rst:1911 +#: ../../reference/expressions.rst:1178 ../../reference/expressions.rst:1222 +#: ../../reference/expressions.rst:1231 ../../reference/expressions.rst:1239 +#: ../../reference/expressions.rst:1274 ../../reference/expressions.rst:1287 +#: ../../reference/expressions.rst:1296 ../../reference/expressions.rst:1312 +#: ../../reference/expressions.rst:1341 ../../reference/expressions.rst:1354 +#: ../../reference/expressions.rst:1370 ../../reference/expressions.rst:1406 +#: ../../reference/expressions.rst:1414 ../../reference/expressions.rst:1423 +#: ../../reference/expressions.rst:1438 ../../reference/expressions.rst:1677 +#: ../../reference/expressions.rst:1686 ../../reference/expressions.rst:1728 +#: ../../reference/expressions.rst:1733 ../../reference/expressions.rst:1738 +#: ../../reference/expressions.rst:1800 ../../reference/expressions.rst:1918 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/expressions.rst:1207 +#: ../../reference/expressions.rst:1213 msgid "unary" msgstr "unary(一元)" -#: ../../reference/expressions.rst:1207 ../../reference/expressions.rst:1391 -#: ../../reference/expressions.rst:1400 ../../reference/expressions.rst:1408 -#: ../../reference/expressions.rst:1417 +#: ../../reference/expressions.rst:1213 ../../reference/expressions.rst:1397 +#: ../../reference/expressions.rst:1406 ../../reference/expressions.rst:1414 +#: ../../reference/expressions.rst:1423 msgid "bitwise" msgstr "bitwise(位元)" -#: ../../reference/expressions.rst:1216 +#: ../../reference/expressions.rst:1222 msgid "negation" msgstr "negation(否定)" -#: ../../reference/expressions.rst:1216 +#: ../../reference/expressions.rst:1222 msgid "minus" msgstr "minus(減)" -#: ../../reference/expressions.rst:1216 ../../reference/expressions.rst:1348 +#: ../../reference/expressions.rst:1222 ../../reference/expressions.rst:1354 msgid "- (minus)" msgstr "- (減號)" -#: ../../reference/expressions.rst:1216 ../../reference/expressions.rst:1225 +#: ../../reference/expressions.rst:1222 ../../reference/expressions.rst:1231 msgid "unary operator" msgstr "unary operator(一元運算子)" -#: ../../reference/expressions.rst:1225 +#: ../../reference/expressions.rst:1231 msgid "plus" msgstr "plus(加)" -#: ../../reference/expressions.rst:1225 ../../reference/expressions.rst:1335 +#: ../../reference/expressions.rst:1231 ../../reference/expressions.rst:1341 msgid "+ (plus)" msgstr "+ (加號)" -#: ../../reference/expressions.rst:1233 +#: ../../reference/expressions.rst:1239 msgid "inversion" msgstr "inversion(反轉)" -#: ../../reference/expressions.rst:1233 +#: ../../reference/expressions.rst:1239 msgid "~ (tilde)" msgstr "~ (波浪號)" -#: ../../reference/expressions.rst:1244 +#: ../../reference/expressions.rst:1250 msgid "TypeError" msgstr "TypeError" -#: ../../reference/expressions.rst:1255 ../../reference/expressions.rst:1391 +#: ../../reference/expressions.rst:1261 ../../reference/expressions.rst:1397 msgid "binary" msgstr "binary(二進位)" -#: ../../reference/expressions.rst:1268 +#: ../../reference/expressions.rst:1274 msgid "multiplication" msgstr "multiplication(乘)" -#: ../../reference/expressions.rst:1281 +#: ../../reference/expressions.rst:1287 msgid "matrix multiplication" msgstr "matrix multiplication(矩陣乘法)" -#: ../../reference/expressions.rst:1281 +#: ../../reference/expressions.rst:1287 msgid "@ (at)" msgstr "@ (在)" -#: ../../reference/expressions.rst:1290 +#: ../../reference/expressions.rst:1296 msgid "ZeroDivisionError" msgstr "ZeroDivisionError" -#: ../../reference/expressions.rst:1290 +#: ../../reference/expressions.rst:1296 msgid "division" msgstr "division(除)" -#: ../../reference/expressions.rst:1290 +#: ../../reference/expressions.rst:1296 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../reference/expressions.rst:1290 +#: ../../reference/expressions.rst:1296 msgid "//" msgstr "//" -#: ../../reference/expressions.rst:1306 +#: ../../reference/expressions.rst:1312 msgid "modulo" msgstr "modulo(餘數)" -#: ../../reference/expressions.rst:1306 +#: ../../reference/expressions.rst:1312 msgid "% (percent)" msgstr "% (百分號)" -#: ../../reference/expressions.rst:1335 +#: ../../reference/expressions.rst:1341 msgid "addition" msgstr "addition(加)" -#: ../../reference/expressions.rst:1335 ../../reference/expressions.rst:1348 +#: ../../reference/expressions.rst:1341 ../../reference/expressions.rst:1354 msgid "binary operator" msgstr "binary operator(二元運算子)" -#: ../../reference/expressions.rst:1348 +#: ../../reference/expressions.rst:1354 msgid "subtraction" msgstr "subtraction(減)" -#: ../../reference/expressions.rst:1364 +#: ../../reference/expressions.rst:1370 msgid "shifting" msgstr "shifting(移動)" -#: ../../reference/expressions.rst:1364 +#: ../../reference/expressions.rst:1370 msgid "<<" msgstr "<<" -#: ../../reference/expressions.rst:1364 +#: ../../reference/expressions.rst:1370 msgid ">>" msgstr ">>" -#: ../../reference/expressions.rst:1380 +#: ../../reference/expressions.rst:1386 msgid "ValueError" msgstr "ValueError" -#: ../../reference/expressions.rst:1400 ../../reference/expressions.rst:1727 +#: ../../reference/expressions.rst:1406 ../../reference/expressions.rst:1733 msgid "and" msgstr "and" -#: ../../reference/expressions.rst:1400 +#: ../../reference/expressions.rst:1406 msgid "& (ampersand)" msgstr "& (和號)" -#: ../../reference/expressions.rst:1408 +#: ../../reference/expressions.rst:1414 msgid "xor" msgstr "xor" -#: ../../reference/expressions.rst:1408 +#: ../../reference/expressions.rst:1414 msgid "exclusive" msgstr "exclusive(排外)" -#: ../../reference/expressions.rst:1408 ../../reference/expressions.rst:1417 -#: ../../reference/expressions.rst:1732 +#: ../../reference/expressions.rst:1414 ../../reference/expressions.rst:1423 +#: ../../reference/expressions.rst:1738 msgid "or" msgstr "or" -#: ../../reference/expressions.rst:1408 +#: ../../reference/expressions.rst:1414 msgid "^ (caret)" msgstr "^ (插入符號)" -#: ../../reference/expressions.rst:1417 +#: ../../reference/expressions.rst:1423 msgid "inclusive" msgstr "inclusive(包含)" -#: ../../reference/expressions.rst:1417 +#: ../../reference/expressions.rst:1423 msgid "| (vertical bar)" msgstr "| (垂直線)" -#: ../../reference/expressions.rst:1432 +#: ../../reference/expressions.rst:1438 msgid "comparison" msgstr "comparison(比較)" -#: ../../reference/expressions.rst:1432 +#: ../../reference/expressions.rst:1438 msgid "C" msgstr "C" -#: ../../reference/expressions.rst:1432 +#: ../../reference/expressions.rst:1438 msgid "language" msgstr "language(語言)" -#: ../../reference/expressions.rst:1432 +#: ../../reference/expressions.rst:1438 msgid "< (less)" msgstr "< (小於)" -#: ../../reference/expressions.rst:1432 +#: ../../reference/expressions.rst:1438 msgid "> (greater)" msgstr "> (大於)" -#: ../../reference/expressions.rst:1432 +#: ../../reference/expressions.rst:1438 msgid "<=" msgstr "<=" -#: ../../reference/expressions.rst:1432 +#: ../../reference/expressions.rst:1438 msgid ">=" msgstr ">=" -#: ../../reference/expressions.rst:1432 +#: ../../reference/expressions.rst:1438 msgid "==" msgstr "==" -#: ../../reference/expressions.rst:1432 +#: ../../reference/expressions.rst:1438 msgid "!=" msgstr "!=" -#: ../../reference/expressions.rst:1456 +#: ../../reference/expressions.rst:1462 msgid "chaining" msgstr "chaining(鏈接)" -#: ../../reference/expressions.rst:1456 +#: ../../reference/expressions.rst:1462 msgid "comparisons" msgstr "comparisons(比較)" -#: ../../reference/expressions.rst:1671 +#: ../../reference/expressions.rst:1677 msgid "in" msgstr "in" -#: ../../reference/expressions.rst:1671 +#: ../../reference/expressions.rst:1677 msgid "not in" msgstr "not in" -#: ../../reference/expressions.rst:1671 +#: ../../reference/expressions.rst:1677 msgid "membership" msgstr "membership(成員)" -#: ../../reference/expressions.rst:1671 ../../reference/expressions.rst:1680 +#: ../../reference/expressions.rst:1677 ../../reference/expressions.rst:1686 msgid "test" msgstr "test(測試)" -#: ../../reference/expressions.rst:1680 +#: ../../reference/expressions.rst:1686 msgid "is" msgstr "is" -#: ../../reference/expressions.rst:1680 +#: ../../reference/expressions.rst:1686 msgid "is not" msgstr "is not" -#: ../../reference/expressions.rst:1680 +#: ../../reference/expressions.rst:1686 msgid "identity" msgstr "identity" -#: ../../reference/expressions.rst:1706 +#: ../../reference/expressions.rst:1712 msgid "Conditional" msgstr "Conditional(條件式)" -#: ../../reference/expressions.rst:1706 +#: ../../reference/expressions.rst:1712 msgid "Boolean" msgstr "Boolean(布林)" -#: ../../reference/expressions.rst:1722 +#: ../../reference/expressions.rst:1728 msgid "not" msgstr "not" -#: ../../reference/expressions.rst:1746 +#: ../../reference/expressions.rst:1752 msgid ":= (colon equals)" msgstr ":= (冒號等於)" -#: ../../reference/expressions.rst:1746 +#: ../../reference/expressions.rst:1752 msgid "assignment expression" msgstr "assignment expression(賦值運算式)" -#: ../../reference/expressions.rst:1746 +#: ../../reference/expressions.rst:1752 msgid "walrus operator" msgstr "walrus operator(海象運算子)" -#: ../../reference/expressions.rst:1746 +#: ../../reference/expressions.rst:1752 msgid "named expression" msgstr "named expression(附名運算式)" -#: ../../reference/expressions.rst:1793 +#: ../../reference/expressions.rst:1800 msgid "conditional" msgstr "conditional(條件式)" -#: ../../reference/expressions.rst:1793 +#: ../../reference/expressions.rst:1800 msgid "ternary" msgstr "ternary(三元)" -#: ../../reference/expressions.rst:1793 +#: ../../reference/expressions.rst:1800 msgid "conditional expression" msgstr "conditional expression(條件運算式)" -#: ../../reference/expressions.rst:1793 +#: ../../reference/expressions.rst:1800 msgid "else" msgstr "else" -#: ../../reference/expressions.rst:1819 +#: ../../reference/expressions.rst:1826 msgid "lambda" msgstr "lambda" -#: ../../reference/expressions.rst:1819 +#: ../../reference/expressions.rst:1826 msgid "form" msgstr "form" -#: ../../reference/expressions.rst:1819 +#: ../../reference/expressions.rst:1826 msgid "anonymous" msgstr "anonymous(匿名)" -#: ../../reference/expressions.rst:1819 +#: ../../reference/expressions.rst:1826 msgid "lambda expression" msgstr "lambda expression(lambda 運算式)" -#: ../../reference/expressions.rst:1864 +#: ../../reference/expressions.rst:1871 msgid "iterable" msgstr "iterable(可疊代)" -#: ../../reference/expressions.rst:1864 +#: ../../reference/expressions.rst:1871 msgid "in expression lists" msgstr "於 expression list(運算式串列)" -#: ../../reference/expressions.rst:1876 +#: ../../reference/expressions.rst:1883 msgid "trailing" msgstr "trailing" -#: ../../reference/expressions.rst:1890 +#: ../../reference/expressions.rst:1897 msgid "evaluation" msgstr "evaluation" -#: ../../reference/expressions.rst:1890 +#: ../../reference/expressions.rst:1897 msgid "order" msgstr "order(順序)" -#: ../../reference/expressions.rst:1911 +#: ../../reference/expressions.rst:1918 msgid "precedence" msgstr "precedence(優先順序)" diff --git a/tutorial/errors.po b/tutorial/errors.po index 4b96e3e6cc..bff2d5515a 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -10,7 +10,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: 2023-11-20 00:03+0000\n" "PO-Revision-Date: 2022-10-24 14:54+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -46,9 +46,7 @@ msgid "" "kind of complaint you get while you are still learning Python::" msgstr "" "語法錯誤又稱剖析錯誤 (parsing error),它或許是學習 Python 的過程最常聽見的抱" -"怨:\n" -"\n" -"::" +"怨: ::" #: ../../tutorial/errors.rst:26 msgid "" @@ -80,9 +78,7 @@ msgid "" msgstr "" "即使一段陳述式或運算式使用了正確的語法,嘗試執行時仍可能導致錯誤。執行時檢測" "到的錯誤稱為\\ *例外*\\ ,例外不一定都很嚴重:你很快就能學會在 Python 程式中" -"如何處理它們。不過大多數的例外不會被程式處理,並且會顯示如下的錯誤訊息:\n" -"\n" -"::" +"如何處理它們。不過大多數的例外不會被程式處理,並且會顯示如下的錯誤訊息: ::" #: ../../tutorial/errors.rst:58 msgid "" @@ -140,9 +136,7 @@ msgstr "" "編寫程式處理選定的例外是可行的。以下範例會要求使用者輸入內容,直到有效的整數" "被輸入為止,但它允許使用者中斷程式(使用 :kbd:`Control-C` 或作業系統支援的指" "令);請注意,由使用者產生的程式中斷會引發 :exc:`KeyboardInterrupt` 例外信" -"號。\n" -"\n" -"::" +"號。 ::" #: ../../tutorial/errors.rst:96 msgid "The :keyword:`try` statement works as follows." @@ -179,14 +173,14 @@ msgstr "" msgid "" "If an exception occurs which does not match the exception named in the " "*except clause*, it is passed on to outer :keyword:`try` statements; if no " -"handler is found, it is an *unhandled exception* and execution stops with a " -"message as shown above." +"handler is found, it is an *unhandled exception* and execution stops with an " +"error message." msgstr "" "如果發生的例外未符合 *except 子句* 中的例外名稱,則將其傳遞到外層的 :keyword:" "`try` 陳述式;如果仍無法找到處理者,則它是一個\\ *未處理例外 (unhandled " -"exception)*,執行將停止,並顯示如上所示的訊息。" +"exception)*,執行將停止,並顯示錯誤訊息。" -#: ../../tutorial/errors.rst:114 +#: ../../tutorial/errors.rst:113 msgid "" "A :keyword:`try` statement may have more than one *except clause*, to " "specify handlers for different exceptions. At most one handler will be " @@ -198,11 +192,9 @@ msgstr "" ":keyword:`try` 陳述式可以有不只一個 *except 子句*,為不同的例外指定處理者,而" "最多只有一個處理者會被執行。處理者只處理對應的 try 子句中發生的例外,而不會處" "理同一 :keyword:`!try` 陳述式裡其他處理者內的例外。一個 *except 子句*\\ 可以" -"用一組括號內的 tuple 列舉多個例外,例如:\n" -"\n" -"::" +"用一組括號內的 tuple 列舉多個例外,例如: ::" -#: ../../tutorial/errors.rst:123 +#: ../../tutorial/errors.rst:122 msgid "" "A class in an :keyword:`except` clause is compatible with an exception if it " "is the same class or a base class thereof (but not the other way around --- " @@ -212,11 +204,9 @@ msgstr "" "一個在 :keyword:`except` 子句中的 class(類別)和一個例外是可相容的,只要它與" "例外是同一個 class 或是為其 base class(基底類別);反之則無法成立——列出 " "derived class (衍生類別)的 *except 子句*\\ 並不能與 base class 相容。例如," -"以下程式碼會依序印出 B、C、D:\n" -"\n" -"::" +"以下程式碼會依序印出 B、C、D: ::" -#: ../../tutorial/errors.rst:147 +#: ../../tutorial/errors.rst:146 msgid "" "Note that if the *except clauses* were reversed (with ``except B`` first), " "it would have printed B, B, B --- the first matching *except clause* is " @@ -225,7 +215,7 @@ msgstr "" "請注意,如果 *except 子句*\\ 的順序被反轉(把 ``except B`` 放到第一個),則會" "印出 B、B、B ­­——第一個符合的 *except 子句*\\ 會被觸發。" -#: ../../tutorial/errors.rst:150 +#: ../../tutorial/errors.rst:149 msgid "" "When an exception occurs, it may have associated values, also known as the " "exception's *arguments*. The presence and types of the arguments depend on " @@ -234,7 +224,7 @@ msgstr "" "當例外發生時,它可能有相關聯的值,也就是例外的\\ *引數*\\ 。引數的存在與否及" "它的類型,是取決於例外的類型。" -#: ../../tutorial/errors.rst:154 +#: ../../tutorial/errors.rst:153 msgid "" "The *except clause* may specify a variable after the exception name. The " "variable is bound to the exception instance which typically has an ``args`` " @@ -244,11 +234,9 @@ msgid "" msgstr "" "*except 子句*\\ 可以在例外名稱後面指定一個變數。這個變數被綁定到一個例外實例 " "(instance),其引數通常儲存在 ``args`` 屬性中。為了方便,內建例外型別定義了 :" -"meth:`~object.__str__` 以印出所有引數而不需顯式地取用 ``.args``:\n" -"\n" -"::" +"meth:`~object.__str__` 以印出所有引數而不需顯式地取用 ``.args``: ::" -#: ../../tutorial/errors.rst:177 +#: ../../tutorial/errors.rst:176 msgid "" "The exception's :meth:`~object.__str__` output is printed as the last part " "('detail') of the message for unhandled exceptions." @@ -256,7 +244,7 @@ msgstr "" "例外的 :meth:`~object.__str__` 輸出會被印在未處理例外訊息的最後一部分(「細" "節」)。" -#: ../../tutorial/errors.rst:180 +#: ../../tutorial/errors.rst:179 msgid "" ":exc:`BaseException` is the common base class of all exceptions. One of its " "subclasses, :exc:`Exception`, is the base class of all the non-fatal " @@ -272,7 +260,7 @@ msgstr "" "它們是用來指示程式應該終止。這些例外包括了由 :meth:`sys.exit` 所引發的 :exc:" "`SystemExit`,以及當使用者想要中斷程式時所引發的 :exc:`KeyboardInterrupt`。" -#: ../../tutorial/errors.rst:188 +#: ../../tutorial/errors.rst:187 msgid "" ":exc:`Exception` can be used as a wildcard that catches (almost) everything. " "However, it is good practice to be as specific as possible with the types of " @@ -283,18 +271,16 @@ msgstr "" "較好的做法是盡可能具體地說明我們打算處理的例外類型,並容許任何非預期例外的傳" "遞 (propagate)。" -#: ../../tutorial/errors.rst:193 +#: ../../tutorial/errors.rst:192 msgid "" "The most common pattern for handling :exc:`Exception` is to print or log the " "exception and then re-raise it (allowing a caller to handle the exception as " "well)::" msgstr "" "處理 :exc:`Exception` 的最常見模式,是先將該例外印出或記錄,然後再重新引發它" -"(也允許一個呼叫函式 (caller) 來處理該例外):\n" -"\n" -"::" +"(也允許一個呼叫函式 (caller) 來處理該例外): ::" -#: ../../tutorial/errors.rst:211 +#: ../../tutorial/errors.rst:210 msgid "" "The :keyword:`try` ... :keyword:`except` statement has an optional *else " "clause*, which, when present, must follow all *except clauses*. It is " @@ -303,11 +289,9 @@ msgid "" msgstr "" ":keyword:`try` ... :keyword:`except` 陳述式有一個選擇性的 *else 子句*,使用" "時,該子句必須放在所有 *except 子句*\\ 之後。如果一段程式碼必須被執行,但 " -"*try 子句*\\ 又沒有引發例外時,這個子句很有用。例如:\n" -"\n" -"::" +"*try 子句*\\ 又沒有引發例外時,這個子句很有用。例如: ::" -#: ../../tutorial/errors.rst:225 +#: ../../tutorial/errors.rst:224 msgid "" "The use of the :keyword:`!else` clause is better than adding additional code " "to the :keyword:`try` clause because it avoids accidentally catching an " @@ -318,31 +302,26 @@ msgstr "" "這可以避免意外地捕獲不是由 :keyword:`!try` ... :keyword:`!except` 陳述式保護" "的程式碼所引發的例外。" -#: ../../tutorial/errors.rst:230 +#: ../../tutorial/errors.rst:229 msgid "" "Exception handlers do not handle only exceptions that occur immediately in " "the *try clause*, but also those that occur inside functions that are called " "(even indirectly) in the *try clause*. For example::" msgstr "" "例外的處理者不僅處理 *try 子句*\\ 內立即發生的例外,還處理 *try 子句*\\ 內" -"(即使是間接地)呼叫的函式內部發生的例外。例如:\n" -"\n" -"::" +"(即使是間接地)呼叫的函式內部發生的例外。例如: ::" -#: ../../tutorial/errors.rst:248 +#: ../../tutorial/errors.rst:247 msgid "Raising Exceptions" msgstr "引發例外" -#: ../../tutorial/errors.rst:250 +#: ../../tutorial/errors.rst:249 msgid "" "The :keyword:`raise` statement allows the programmer to force a specified " "exception to occur. For example::" -msgstr "" -":keyword:`raise` 陳述式可讓程式設計師強制引發指定的例外。例如:\n" -"\n" -"::" +msgstr ":keyword:`raise` 陳述式可讓程式設計師強制引發指定的例外。例如: ::" -#: ../../tutorial/errors.rst:258 +#: ../../tutorial/errors.rst:257 msgid "" "The sole argument to :keyword:`raise` indicates the exception to be raised. " "This must be either an exception instance or an exception class (a class " @@ -353,72 +332,58 @@ msgstr "" ":keyword:`raise` 唯一的引數就是要引發的例外。該引數必須是一個例外實例或例外 " "class(衍生自 :class:`BaseException` 的 class,例如 :class:`Exception` 與它" "的 subclass)。如果一個例外 class 被傳遞,它會不含引數地呼叫它的建構函式 " -"(constructor) ,使它被自動建立實例 (implicitly instantiated):\n" -"\n" -"::" +"(constructor) ,使它被自動建立實例 (implicitly instantiated): ::" -#: ../../tutorial/errors.rst:266 +#: ../../tutorial/errors.rst:265 msgid "" "If you need to determine whether an exception was raised but don't intend to " "handle it, a simpler form of the :keyword:`raise` statement allows you to re-" "raise the exception::" msgstr "" "如果你只想判斷是否引發了例外,但並不打算處理它,則可以使用簡單的 :keyword:" -"`raise` 陳述式來重新引發該例外:\n" -"\n" -"::" +"`raise` 陳述式來重新引發該例外: ::" -#: ../../tutorial/errors.rst:285 +#: ../../tutorial/errors.rst:284 msgid "Exception Chaining" msgstr "例外鏈接 (Exception Chaining)" -#: ../../tutorial/errors.rst:287 +#: ../../tutorial/errors.rst:286 msgid "" "If an unhandled exception occurs inside an :keyword:`except` section, it " "will have the exception being handled attached to it and included in the " "error message::" msgstr "" "如果在 :keyword:`except` 段落內部發生了一個未處理的例外,則它會讓這個將要被處" -"理的例外附加在後,並將其包含在錯誤訊息中:\n" -"\n" -"::" +"理的例外附加在後,並將其包含在錯誤訊息中: ::" -#: ../../tutorial/errors.rst:306 +#: ../../tutorial/errors.rst:305 msgid "" "To indicate that an exception is a direct consequence of another, the :" "keyword:`raise` statement allows an optional :keyword:`from` clause::" msgstr "" "為了表明一個例外是另一個例外直接造成的結果,:keyword:`raise` 陳述式容許一個選" -"擇性的 :keyword:`from` 子句:\n" -"\n" -"::" +"擇性的 :keyword:`from` 子句: ::" -#: ../../tutorial/errors.rst:312 +#: ../../tutorial/errors.rst:311 msgid "This can be useful when you are transforming exceptions. For example::" -msgstr "" -"要變換例外時,這種方式很有用。例如:\n" -"\n" -"::" +msgstr "要變換例外時,這種方式很有用。例如: ::" -#: ../../tutorial/errors.rst:333 +#: ../../tutorial/errors.rst:332 msgid "" "It also allows disabling automatic exception chaining using the ``from " "None`` idiom::" -msgstr "" -"它也容許使用慣用語 ``from None`` 來停用自動例外鏈接:\n" -"\n" -"::" +msgstr "它也容許使用慣用語 ``from None`` 來停用自動例外鏈接: ::" -#: ../../tutorial/errors.rst:345 +#: ../../tutorial/errors.rst:344 msgid "" "For more information about chaining mechanics, see :ref:`bltin-exceptions`." msgstr "更多關於鏈接機制的資訊,詳見\\ :ref:`bltin-exceptions`。" -#: ../../tutorial/errors.rst:351 +#: ../../tutorial/errors.rst:350 msgid "User-defined Exceptions" msgstr "使用者自定的例外" -#: ../../tutorial/errors.rst:353 +#: ../../tutorial/errors.rst:352 msgid "" "Programs may name their own exceptions by creating a new exception class " "(see :ref:`tut-classes` for more about Python classes). Exceptions should " @@ -429,7 +394,7 @@ msgstr "" "\\ :ref:`tut-classes`\\ )。不論是直接還是間接地,例外通常應該從 :exc:" "`Exception` class 衍生出來。" -#: ../../tutorial/errors.rst:357 +#: ../../tutorial/errors.rst:356 msgid "" "Exception classes can be defined which do anything any other class can do, " "but are usually kept simple, often only offering a number of attributes that " @@ -439,34 +404,32 @@ msgstr "" "例外 class 可被定義來做任何其他 class 能夠做的事,但通常會讓它維持簡單,只提" "供一些屬性,讓關於錯誤的資訊可被例外的處理者抽取出來。" -#: ../../tutorial/errors.rst:361 +#: ../../tutorial/errors.rst:360 msgid "" "Most exceptions are defined with names that end in \"Error\", similar to the " "naming of the standard exceptions." msgstr "大多數的例外定義,都會以「Error」作為名稱結尾,類似於標準例外的命名。" -#: ../../tutorial/errors.rst:364 +#: ../../tutorial/errors.rst:363 msgid "" "Many standard modules define their own exceptions to report errors that may " "occur in functions they define." msgstr "許多標準模組會定義它們自己的例外,以報告在其定義的函式中發生的錯誤。" -#: ../../tutorial/errors.rst:371 +#: ../../tutorial/errors.rst:370 msgid "Defining Clean-up Actions" msgstr "定義清理動作" -#: ../../tutorial/errors.rst:373 +#: ../../tutorial/errors.rst:372 msgid "" "The :keyword:`try` statement has another optional clause which is intended " "to define clean-up actions that must be executed under all circumstances. " "For example::" msgstr "" ":keyword:`try` 陳述式有另一個選擇性子句,用於定義在所有情況下都必須被執行的清" -"理動作。例如:\n" -"\n" -"::" +"理動作。例如: ::" -#: ../../tutorial/errors.rst:387 +#: ../../tutorial/errors.rst:386 msgid "" "If a :keyword:`finally` clause is present, the :keyword:`!finally` clause " "will execute as the last task before the :keyword:`try` statement completes. " @@ -479,7 +442,7 @@ msgstr "" "外,都會執行 :keyword:`!finally` 子句。以下幾點將探討例外發生時,比較複雜的情" "況:" -#: ../../tutorial/errors.rst:393 +#: ../../tutorial/errors.rst:392 msgid "" "If an exception occurs during execution of the :keyword:`!try` clause, the " "exception may be handled by an :keyword:`except` clause. If the exception is " @@ -490,7 +453,7 @@ msgstr "" "`except` 子句處理。如果該例外沒有被 :keyword:`!except` 子句處理,它會在 :" "keyword:`!finally` 子句執行後被重新引發。" -#: ../../tutorial/errors.rst:399 +#: ../../tutorial/errors.rst:398 msgid "" "An exception could occur during execution of an :keyword:`!except` or :" "keyword:`!else` clause. Again, the exception is re-raised after the :keyword:" @@ -499,7 +462,7 @@ msgstr "" "一個例外可能發生於 :keyword:`!except` 或 :keyword:`!else` 子句的執行過程。同" "樣地,該例外會在 :keyword:`!finally` 子句執行後被重新引發。" -#: ../../tutorial/errors.rst:403 +#: ../../tutorial/errors.rst:402 msgid "" "If the :keyword:`!finally` clause executes a :keyword:`break`, :keyword:" "`continue` or :keyword:`return` statement, exceptions are not re-raised." @@ -507,7 +470,7 @@ msgstr "" "如果 :keyword:`!finally` 子句執行 :keyword:`break`、:keyword:`continue` 或 :" "keyword:`return` 陳述式,則例外不會被重新引發。" -#: ../../tutorial/errors.rst:407 +#: ../../tutorial/errors.rst:406 msgid "" "If the :keyword:`!try` statement reaches a :keyword:`break`, :keyword:" "`continue` or :keyword:`return` statement, the :keyword:`!finally` clause " @@ -518,7 +481,7 @@ msgstr "" "keyword:`return` 陳述式,則 :keyword:`!finally` 子句會在執行 :keyword:`!" "break`、:keyword:`!continue` 或 :keyword:`!return` 陳述式之前先執行。" -#: ../../tutorial/errors.rst:413 +#: ../../tutorial/errors.rst:412 msgid "" "If a :keyword:`!finally` clause includes a :keyword:`!return` statement, the " "returned value will be the one from the :keyword:`!finally` clause's :" @@ -529,21 +492,15 @@ msgstr "" "自 :keyword:`!finally` 子句的 :keyword:`!return` 陳述式的回傳值,而不是來自 :" "keyword:`!try` 子句的 :keyword:`!return` 陳述式的回傳值。" -#: ../../tutorial/errors.rst:419 +#: ../../tutorial/errors.rst:418 msgid "For example::" -msgstr "" -"例如:\n" -"\n" -"::" +msgstr "例如: ::" -#: ../../tutorial/errors.rst:430 +#: ../../tutorial/errors.rst:429 msgid "A more complicated example::" -msgstr "" -"另一個比較複雜的範例:\n" -"\n" -"::" +msgstr "另一個比較複雜的範例: ::" -#: ../../tutorial/errors.rst:455 +#: ../../tutorial/errors.rst:454 msgid "" "As you can see, the :keyword:`finally` clause is executed in any event. " "The :exc:`TypeError` raised by dividing two strings is not handled by the :" @@ -554,7 +511,7 @@ msgstr "" "的 :exc:`TypeError` 沒有被 :keyword:`except` 子句處理,因此會在 :keyword:`!" "finally` 子句執行後被重新引發。" -#: ../../tutorial/errors.rst:460 +#: ../../tutorial/errors.rst:459 msgid "" "In real world applications, the :keyword:`finally` clause is useful for " "releasing external resources (such as files or network connections), " @@ -563,11 +520,11 @@ msgstr "" "在真實應用程式中,:keyword:`finally` 子句對於釋放外部資源(例如檔案或網路連" "線)很有用,無論該資源的使用是否成功。" -#: ../../tutorial/errors.rst:468 +#: ../../tutorial/errors.rst:467 msgid "Predefined Clean-up Actions" msgstr "預定義的清理動作" -#: ../../tutorial/errors.rst:470 +#: ../../tutorial/errors.rst:469 msgid "" "Some objects define standard clean-up actions to be undertaken when the " "object is no longer needed, regardless of whether or not the operation using " @@ -575,11 +532,9 @@ msgid "" "to open a file and print its contents to the screen. ::" msgstr "" "某些物件定義了在物件不再被需要時的標準清理動作,無論使用該物件的作業是成功或" -"失敗。請看以下範例,它嘗試開啟一個檔案,並印出檔案內容至螢幕。\n" -"\n" -"::" +"失敗。請看以下範例,它嘗試開啟一個檔案,並印出檔案內容至螢幕。 ::" -#: ../../tutorial/errors.rst:478 +#: ../../tutorial/errors.rst:477 msgid "" "The problem with this code is that it leaves the file open for an " "indeterminate amount of time after this part of the code has finished " @@ -591,11 +546,9 @@ msgstr "" "這段程式碼的問題在於,執行完該程式碼後,它讓檔案在一段不確定的時間內處於開啟" "狀態。在簡單腳本中這不是問題,但對於較大的應用程式來說可能會是個問題。:" "keyword:`with` 陳述式讓物件(例如檔案)在被使用時,能保證它們總是及時、正確地" -"被清理。\n" -"\n" -"::" +"被清理。 ::" -#: ../../tutorial/errors.rst:488 +#: ../../tutorial/errors.rst:487 msgid "" "After the statement is executed, the file *f* is always closed, even if a " "problem was encountered while processing the lines. Objects which, like " @@ -605,11 +558,11 @@ msgstr "" "陳述式執行完畢後,就算是在處理內容時遇到問題,檔案 *f* 總是會被關閉。和檔案一" "樣,提供預定義清理動作的物件會在說明文件中表明這一點。" -#: ../../tutorial/errors.rst:496 +#: ../../tutorial/errors.rst:495 msgid "Raising and Handling Multiple Unrelated Exceptions" msgstr "引發及處理多個無關的例外" -#: ../../tutorial/errors.rst:498 +#: ../../tutorial/errors.rst:497 msgid "" "There are situations where it is necessary to report several exceptions that " "have occurred. This is often the case in concurrency frameworks, when " @@ -621,7 +574,7 @@ msgstr "" "中經常會出現這種情況,當平行的 (parallel) 某些任務可能已經失效,但還有其他用" "例 (use case) 希望能繼續執行並收集多個例外,而不是只有引發第一個例外時。" -#: ../../tutorial/errors.rst:504 +#: ../../tutorial/errors.rst:503 msgid "" "The builtin :exc:`ExceptionGroup` wraps a list of exception instances so " "that they can be raised together. It is an exception itself, so it can be " @@ -629,11 +582,9 @@ msgid "" msgstr "" "內建的 :exc:`ExceptionGroup` 會包裝一個例外實例 (exception instance) 的 list" "(串列),使得它們可以一起被引發。由於它本身就是一個例外,因此它也可以像任何" -"其他例外一樣被捕獲。\n" -"\n" -"::" +"其他例外一樣被捕獲。 ::" -#: ../../tutorial/errors.rst:530 +#: ../../tutorial/errors.rst:529 msgid "" "By using ``except*`` instead of ``except``, we can selectively handle only " "the exceptions in the group that match a certain type. In the following " @@ -644,11 +595,9 @@ msgstr "" "若使用 ``except*`` 代替 ``except``,我們可以選擇性地只處理該群組中與特定類型" "匹配的例外。在以下範例中,展示了一個巢狀的例外群組 (exception group),每個 " "``except*`` 子句分別從該群組中提取一個特定類型的例外,同時讓所有其他的例外都" -"傳遞到其他子句,最後再被重新引發。\n" -"\n" -"::" +"傳遞到其他子句,最後再被重新引發。 ::" -#: ../../tutorial/errors.rst:573 +#: ../../tutorial/errors.rst:572 msgid "" "Note that the exceptions nested in an exception group must be instances, not " "types. This is because in practice the exceptions would typically be ones " @@ -656,15 +605,13 @@ msgid "" "pattern::" msgstr "" "請注意,被巢套在例外群組中的例外必須是實例,而不是類型。這是因為在實務上,這" -"些例外通常是已經被程式引發並捕獲的例外,類似以下的模式:\n" -"\n" -"::" +"些例外通常是已經被程式引發並捕獲的例外,類似以下的模式: ::" -#: ../../tutorial/errors.rst:593 +#: ../../tutorial/errors.rst:592 msgid "Enriching Exceptions with Notes" msgstr "用註解使例外更詳細" -#: ../../tutorial/errors.rst:595 +#: ../../tutorial/errors.rst:594 msgid "" "When an exception is created in order to be raised, it is usually " "initialized with information that describes the error that has occurred. " @@ -678,17 +625,13 @@ msgstr "" "了當下發生的錯誤。在某些情況,在例外被捕獲之後添加資訊會很有用。為此,例外具" "有一個 ``add_note(note)`` method(方法),它可以接受一個字串並將其添加到例外" "的註解清單中。標準的回溯呈現會在例外之後列出所有的註解,並按照其被添加的順序" -"來排列。\n" -"\n" -"::" +"來排列。 ::" -#: ../../tutorial/errors.rst:616 +#: ../../tutorial/errors.rst:615 msgid "" "For example, when collecting exceptions into an exception group, we may want " "to add context information for the individual errors. In the following each " "exception in the group has a note indicating when this error has occurred. ::" msgstr "" "例如,在將例外收集到例外群組中時,我們可能希望為各個錯誤添加一些上下文的資" -"訊。在以下範例中,群組中的每個例外都有一條註解,指示此錯誤是在何時發生。\n" -"\n" -"::" +"訊。在以下範例中,群組中的每個例外都有一條註解,指示此錯誤是在何時發生。 ::" diff --git a/tutorial/floatingpoint.po b/tutorial/floatingpoint.po index 3b9786296a..531e67b37a 100644 --- a/tutorial/floatingpoint.po +++ b/tutorial/floatingpoint.po @@ -11,7 +11,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: 2023-12-04 00:03+0000\n" "PO-Revision-Date: 2023-06-22 14:43+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -231,15 +231,15 @@ msgid "" "`_ for " "a pleasant summary of how binary floating-point works and the kinds of " "problems commonly encountered in practice. Also see `The Perils of Floating " -"Point `_ for a more complete account of " -"other common surprises." +"Point `_ for a more complete " +"account of other common surprises." msgstr "" "二進位浮點數架構下還有很多這樣的意外。底下的「表示法誤差 (Representation " "Error)」章節,詳細地解釋了「0.1」的問題。`Examples of Floating Point Problems" "(浮點數問題範例) `_\\ 一文提供了二進位浮點數的作用方式與現實中這類常見問題的摘" "錄。如果想要其他常見問題的更完整描述,可以參考 `The Perils of Floating Point" -"(浮點數的風險) `_。" +"(浮點數的風險) `_。" #: ../../tutorial/floatingpoint.rst:156 msgid "" diff --git a/using/configure.po b/using/configure.po index 3ea12f723f..e3a1689fc3 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-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-11-17 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-" @@ -102,40 +102,53 @@ msgid "" "tools used to regenerate them. Search for ``regen-*`` make targets." msgstr "" -#: ../../using/configure.rst:60 +#: ../../using/configure.rst:61 +msgid "configure script" +msgstr "設定腳本" + +#: ../../using/configure.rst:63 msgid "" -"The ``make regen-configure`` command runs `tiran/cpython_autoconf `_ container for reproducible build; see " -"container ``entry.sh`` script. The container is optional, the following " -"command can be run locally, the generated files depend on autoconf and " -"aclocal versions::" +"The ``make regen-configure`` command regenerates the ``aclocal.m4`` file and " +"the ``configure`` script using the ``Tools/build/regen-configure.sh`` shell " +"script which uses an Ubuntu container to get the same tools versions and " +"have a reproducible output." +msgstr "" + +#: ../../using/configure.rst:68 +msgid "The container is optional, the following command can be run locally::" msgstr "" #: ../../using/configure.rst:72 +msgid "" +"The generated files can change depending on the exact ``autoconf-archive``, " +"``aclocal`` and ``pkg-config`` versions." +msgstr "" + +#: ../../using/configure.rst:79 msgid "Configure Options" msgstr "設定選項" -#: ../../using/configure.rst:74 +#: ../../using/configure.rst:81 msgid "List all ``./configure`` script options using::" msgstr "" -#: ../../using/configure.rst:78 +#: ../../using/configure.rst:85 msgid "" "See also the :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution." msgstr "請見 Python 原始碼發行版中的 :file:`Misc/SpecialBuilds.txt`。" -#: ../../using/configure.rst:81 +#: ../../using/configure.rst:88 msgid "General Options" msgstr "一般選項" -#: ../../using/configure.rst:85 +#: ../../using/configure.rst:92 msgid "" "Support loadable extensions in the :mod:`!_sqlite` extension module (default " "is no) of the :mod:`sqlite3` module." msgstr "" -#: ../../using/configure.rst:88 +#: ../../using/configure.rst:95 msgid "" "See the :meth:`sqlite3.Connection.enable_load_extension` method of the :mod:" "`sqlite3` module." @@ -143,33 +156,33 @@ msgstr "" "請見 :mod:`sqlite3` 模組的 :meth:`sqlite3.Connection.enable_load_extension` " "方法。" -#: ../../using/configure.rst:95 +#: ../../using/configure.rst:102 msgid "" "Disable IPv6 support (enabled by default if supported), see the :mod:" "`socket` module." msgstr "停用 IPv6 支援(如果支援的話預設是啟用的),請見 :mod:`socket` 模組。" -#: ../../using/configure.rst:100 +#: ../../using/configure.rst:107 msgid "Define the size in bits of Python :class:`int` digits: 15 or 30 bits." msgstr "" -#: ../../using/configure.rst:102 +#: ../../using/configure.rst:109 msgid "By default, the digit size is 30." msgstr "" -#: ../../using/configure.rst:104 +#: ../../using/configure.rst:111 msgid "Define the ``PYLONG_BITS_IN_DIGIT`` to ``15`` or ``30``." msgstr "將 ``PYLONG_BITS_IN_DIGIT`` 定義為 ``15`` 或 ``30``。" -#: ../../using/configure.rst:106 +#: ../../using/configure.rst:113 msgid "See :data:`sys.int_info.bits_per_digit `." msgstr "參閱 :data:`sys.int_info.bits_per_digit `。" -#: ../../using/configure.rst:110 +#: ../../using/configure.rst:117 msgid "Set the Python executable suffix to *SUFFIX*." msgstr "將 Python 執行檔的後綴設定為 *SUFFIX*。" -#: ../../using/configure.rst:112 +#: ../../using/configure.rst:119 msgid "" "The default suffix is ``.exe`` on Windows and macOS (``python.exe`` " "executable), ``.js`` on Emscripten node, ``.html`` on Emscripten browser, ``." @@ -180,20 +193,20 @@ msgstr "" "Emscripten node 上為 ``.js``、在 Emscripten 瀏覽器為 ``.html``、在 WASI 上為 " "``.wasm``,以及在其他平台為空字串(``python`` 執行檔)。" -#: ../../using/configure.rst:117 +#: ../../using/configure.rst:124 msgid "" "The default suffix on WASM platform is one of ``.js``, ``.html`` or ``." "wasm``." msgstr "在 WASM 平台上預設的後綴是 ``.js``、``.html`` 或 ``.wasm`` 中的一個。" -#: ../../using/configure.rst:123 +#: ../../using/configure.rst:130 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:127 +#: ../../using/configure.rst:134 msgid "" "Default: ``/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/" "etc/zoneinfo``." @@ -201,76 +214,76 @@ msgstr "" "預設值:``/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/" "zoneinfo``。" -#: ../../using/configure.rst:129 +#: ../../using/configure.rst:136 msgid "See :data:`os.pathsep` path separator." msgstr "請見 :data:`os.pathsep` 路徑分隔符號。" -#: ../../using/configure.rst:135 +#: ../../using/configure.rst:142 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:138 +#: ../../using/configure.rst:145 msgid "See :const:`decimal.HAVE_CONTEXTVAR` and the :mod:`contextvars` module." msgstr "請見 :const:`decimal.HAVE_CONTEXTVAR` 與 :mod:`contextvars` 模組。" -#: ../../using/configure.rst:144 +#: ../../using/configure.rst:151 msgid "Override order to check db backends for the :mod:`dbm` module" msgstr "" -#: ../../using/configure.rst:146 +#: ../../using/configure.rst:153 msgid "" "A valid value is a colon (``:``) separated string with the backend names:" msgstr "" -#: ../../using/configure.rst:148 +#: ../../using/configure.rst:155 msgid "``ndbm``;" msgstr "``ndbm``;" -#: ../../using/configure.rst:149 +#: ../../using/configure.rst:156 msgid "``gdbm``;" msgstr "``gdbm``;" -#: ../../using/configure.rst:150 +#: ../../using/configure.rst:157 msgid "``bdb``." msgstr "``bdb``." -#: ../../using/configure.rst:154 +#: ../../using/configure.rst:161 msgid "Disable C locale coercion to a UTF-8 based locale (enabled by default)." msgstr "" -#: ../../using/configure.rst:156 +#: ../../using/configure.rst:163 msgid "Don't define the ``PY_COERCE_C_LOCALE`` macro." msgstr "不要定義 ``PY_COERCE_C_LOCALE`` 巨集。" -#: ../../using/configure.rst:158 +#: ../../using/configure.rst:165 msgid "See :envvar:`PYTHONCOERCECLOCALE` and the :pep:`538`." msgstr "請見 :envvar:`PYTHONCOERCECLOCALE` 與 :pep:`538`。" -#: ../../using/configure.rst:162 +#: ../../using/configure.rst:169 msgid "Disable all freelists except the empty tuple singleton." msgstr "" -#: ../../using/configure.rst:168 +#: ../../using/configure.rst:175 msgid "Python library directory name (default is ``lib``)." msgstr "Python 函式庫目錄名稱(預設為 ``lib`` )。" -#: ../../using/configure.rst:170 +#: ../../using/configure.rst:177 msgid "Fedora and SuSE use ``lib64`` on 64-bit platforms." msgstr "Fedora 和 SuSE 在 64 位元平台上使用 ``lib64``。" -#: ../../using/configure.rst:172 +#: ../../using/configure.rst:179 msgid "See :data:`sys.platlibdir`." msgstr "參閱 :data:`sys.platlibdir`。" -#: ../../using/configure.rst:178 +#: ../../using/configure.rst:185 msgid "" "Directory of wheel packages used by the :mod:`ensurepip` module (none by " "default)." msgstr "" -#: ../../using/configure.rst:181 +#: ../../using/configure.rst:188 msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" @@ -278,110 +291,110 @@ msgid "" "_bundled` package." msgstr "" -#: ../../using/configure.rst:190 +#: ../../using/configure.rst:197 msgid "" "Whether configure should use :program:`pkg-config` to detect build " "dependencies." msgstr "" -#: ../../using/configure.rst:193 +#: ../../using/configure.rst:200 msgid "``check`` (default): :program:`pkg-config` is optional" msgstr "``check`` (預設)::program:`pkg-config` 是可選的" -#: ../../using/configure.rst:194 +#: ../../using/configure.rst:201 msgid "``yes``: :program:`pkg-config` is mandatory" msgstr "``yes``::program:`pkg-config` 是必要的" -#: ../../using/configure.rst:195 +#: ../../using/configure.rst:202 msgid "``no``: configure does not use :program:`pkg-config` even when present" msgstr "``no``:即使存在也不使用 :program:`pkg-config` 來配置" -#: ../../using/configure.rst:201 +#: ../../using/configure.rst:208 msgid "Turn on internal statistics gathering." msgstr "" -#: ../../using/configure.rst:203 +#: ../../using/configure.rst:210 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:207 +#: ../../using/configure.rst:214 msgid "Use ``Tools/scripts/summarize_stats.py`` to read the stats." msgstr "使用 ``Tools/scripts/summarize_stats.py`` 來讀取統計資料。" -#: ../../using/configure.rst:212 +#: ../../using/configure.rst:219 msgid "WebAssembly Options" msgstr "WebAssembly 選項" -#: ../../using/configure.rst:216 +#: ../../using/configure.rst:223 msgid "Set build flavor for ``wasm32-emscripten``." msgstr "" -#: ../../using/configure.rst:218 +#: ../../using/configure.rst:225 msgid "``browser`` (default): preload minimal stdlib, default MEMFS." msgstr "" -#: ../../using/configure.rst:219 +#: ../../using/configure.rst:226 msgid "``node``: NODERAWFS and pthread support." msgstr "``node``:對 NODERAWFS 和 pthread 支援。" -#: ../../using/configure.rst:225 +#: ../../using/configure.rst:232 msgid "Turn on dynamic linking support for WASM." msgstr "" -#: ../../using/configure.rst:227 +#: ../../using/configure.rst:234 msgid "" "Dynamic linking enables ``dlopen``. File size of the executable increases " "due to limited dead code elimination and additional features." msgstr "" -#: ../../using/configure.rst:234 +#: ../../using/configure.rst:241 msgid "Turn on pthreads support for WASM." msgstr "" -#: ../../using/configure.rst:240 +#: ../../using/configure.rst:247 msgid "Install Options" msgstr "安裝選項" -#: ../../using/configure.rst:244 +#: ../../using/configure.rst:251 msgid "" "Install architecture-independent files in PREFIX. On Unix, it defaults to :" "file:`/usr/local`." msgstr "" -#: ../../using/configure.rst:247 +#: ../../using/configure.rst:254 msgid "This value can be retrieved at runtime using :data:`sys.prefix`." msgstr "這個值可以在 runtime 使用 :data:`sys.prefix` 取得。" -#: ../../using/configure.rst:249 +#: ../../using/configure.rst:256 msgid "" "As an example, one can use ``--prefix=\"$HOME/.local/\"`` to install a " "Python in its home directory." msgstr "" -#: ../../using/configure.rst:254 +#: ../../using/configure.rst:261 msgid "" "Install architecture-dependent files in EPREFIX, defaults to :option:`--" "prefix`." msgstr "" -#: ../../using/configure.rst:256 +#: ../../using/configure.rst:263 msgid "This value can be retrieved at runtime using :data:`sys.exec_prefix`." msgstr "這個值可以在 runtime 使用 :data:`sys.exec_prefix` 取得" -#: ../../using/configure.rst:260 +#: ../../using/configure.rst:267 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:267 +#: ../../using/configure.rst:274 msgid "Select the :mod:`ensurepip` command run on Python installation:" msgstr "選擇在 Python 安裝時執行的 :mod:`ensurepip` 命令:" -#: ../../using/configure.rst:269 +#: ../../using/configure.rst:276 msgid "" "``upgrade`` (default): run ``python -m ensurepip --altinstall --upgrade`` " "command." @@ -389,92 +402,92 @@ msgstr "" "``upgrade`` (預設):執行 ``python -m ensurepip --altinstall --upgrade`` 命" "令。" -#: ../../using/configure.rst:271 +#: ../../using/configure.rst:278 msgid "``install``: run ``python -m ensurepip --altinstall`` command;" msgstr "``install``:執行 ``python -m ensurepip --altinstall`` 命令;" -#: ../../using/configure.rst:272 +#: ../../using/configure.rst:279 msgid "``no``: don't run ensurepip;" msgstr "``no``:不要執行 ensurepip;" -#: ../../using/configure.rst:278 +#: ../../using/configure.rst:285 msgid "Performance options" msgstr "" -#: ../../using/configure.rst:280 +#: ../../using/configure.rst:287 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:286 +#: ../../using/configure.rst:293 msgid "" "Enable Profile Guided Optimization (PGO) using :envvar:`PROFILE_TASK` " "(disabled by default)." msgstr "" -#: ../../using/configure.rst:289 +#: ../../using/configure.rst:296 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:292 +#: ../../using/configure.rst:299 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:298 +#: ../../using/configure.rst:305 msgid "Use ``-fno-semantic-interposition`` on GCC." msgstr "在 GCC 上使用 ``-fno-semantic-interposition``。" -#: ../../using/configure.rst:303 +#: ../../using/configure.rst:310 msgid "" "Environment variable used in the Makefile: Python command line arguments for " "the PGO generation task." msgstr "" -#: ../../using/configure.rst:306 +#: ../../using/configure.rst:313 msgid "Default: ``-m test --pgo --timeout=$(TESTTIMEOUT)``." msgstr "預設值:``-m test --pgo --timeout=$(TESTTIMEOUT)``。" -#: ../../using/configure.rst:312 +#: ../../using/configure.rst:319 msgid "Enable Link Time Optimization (LTO) in any build (disabled by default)." msgstr "" -#: ../../using/configure.rst:314 +#: ../../using/configure.rst:321 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:319 +#: ../../using/configure.rst:326 msgid "To use ThinLTO feature, use ``--with-lto=thin`` on Clang." msgstr "" -#: ../../using/configure.rst:322 +#: ../../using/configure.rst:329 msgid "" "Use ThinLTO as the default optimization policy on Clang if the compiler " "accepts the flag." msgstr "" -#: ../../using/configure.rst:327 +#: ../../using/configure.rst:334 msgid "" "Enable usage of the `BOLT post-link binary optimizer `_ (disabled by default)." msgstr "" -#: ../../using/configure.rst:331 +#: ../../using/configure.rst:338 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:335 +#: ../../using/configure.rst:342 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 " @@ -485,7 +498,7 @@ msgid "" "encouraged." msgstr "" -#: ../../using/configure.rst:343 +#: ../../using/configure.rst:350 msgid "" "The :envvar:`!BOLT_INSTRUMENT_FLAGS` and :envvar:`!BOLT_APPLY_FLAGS` :" "program:`configure` variables can be defined to override the default set of " @@ -493,101 +506,101 @@ msgid "" "binaries, respectively." msgstr "" -#: ../../using/configure.rst:352 +#: ../../using/configure.rst:359 msgid "" "Enable computed gotos in evaluation loop (enabled by default on supported " "compilers)." msgstr "" -#: ../../using/configure.rst:357 +#: ../../using/configure.rst:364 msgid "" "Disable the specialized Python memory allocator :ref:`pymalloc ` " "(enabled by default)." msgstr "" -#: ../../using/configure.rst:360 +#: ../../using/configure.rst:367 msgid "See also :envvar:`PYTHONMALLOC` environment variable." msgstr "另請參閱 :envvar:`PYTHONMALLOC` 環境變數。" -#: ../../using/configure.rst:364 +#: ../../using/configure.rst:371 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:367 +#: ../../using/configure.rst:374 msgid "Don't define the ``WITH_DOC_STRINGS`` macro." msgstr "不要定義 ``WITH_DOC_STRINGS`` 巨集。" -#: ../../using/configure.rst:369 +#: ../../using/configure.rst:376 msgid "See the ``PyDoc_STRVAR()`` macro." msgstr "請見 ``PyDoc_STRVAR()`` 巨集。" -#: ../../using/configure.rst:373 +#: ../../using/configure.rst:380 msgid "Enable C-level code profiling with ``gprof`` (disabled by default)." msgstr "" -#: ../../using/configure.rst:377 +#: ../../using/configure.rst:384 msgid "" "Add ``-fstrict-overflow`` to the C compiler flags (by default we add ``-fno-" "strict-overflow`` instead)." msgstr "" -#: ../../using/configure.rst:384 +#: ../../using/configure.rst:391 msgid "Python Debug Build" msgstr "" -#: ../../using/configure.rst:386 +#: ../../using/configure.rst:393 msgid "" "A debug build is Python built with the :option:`--with-pydebug` configure " "option." msgstr "" -#: ../../using/configure.rst:389 +#: ../../using/configure.rst:396 msgid "Effects of a debug build:" msgstr "" -#: ../../using/configure.rst:391 +#: ../../using/configure.rst:398 msgid "" "Display all warnings by default: the list of default warning filters is " "empty in the :mod:`warnings` module." msgstr "" -#: ../../using/configure.rst:393 +#: ../../using/configure.rst:400 msgid "Add ``d`` to :data:`sys.abiflags`." msgstr "新增 ``d`` 到 :data:`sys.abiflags`。" -#: ../../using/configure.rst:394 +#: ../../using/configure.rst:401 msgid "Add :func:`!sys.gettotalrefcount` function." msgstr "新增 :func:`!sys.gettotalrefcount` 函式。" -#: ../../using/configure.rst:395 +#: ../../using/configure.rst:402 msgid "Add :option:`-X showrefcount <-X>` command line option." msgstr "新增 :option:`-X showrefcount <-X>` 命令列選項。" -#: ../../using/configure.rst:396 +#: ../../using/configure.rst:403 msgid "" "Add :option:`-d` command line option and :envvar:`PYTHONDEBUG` environment " "variable to debug the parser." msgstr "" -#: ../../using/configure.rst:398 +#: ../../using/configure.rst:405 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:400 +#: ../../using/configure.rst:407 msgid "" "Install :ref:`debug hooks on memory allocators ` " "to detect buffer overflow and other memory errors." msgstr "" -#: ../../using/configure.rst:402 +#: ../../using/configure.rst:409 msgid "Define ``Py_DEBUG`` and ``Py_REF_DEBUG`` macros." msgstr "定義 ``Py_DEBUG`` 和 ``Py_REF_DEBUG`` 巨集。" -#: ../../using/configure.rst:403 +#: ../../using/configure.rst:410 msgid "" "Add runtime checks: code surrounded by ``#ifdef Py_DEBUG`` and ``#endif``. " "Enable ``assert(...)`` and ``_PyObject_ASSERT(...)`` assertions: don't set " @@ -595,45 +608,45 @@ msgid "" "option). Main runtime checks:" msgstr "" -#: ../../using/configure.rst:408 +#: ../../using/configure.rst:415 msgid "Add sanity checks on the function arguments." msgstr "" -#: ../../using/configure.rst:409 +#: ../../using/configure.rst:416 msgid "" "Unicode and int objects are created with their memory filled with a pattern " "to detect usage of uninitialized objects." msgstr "" -#: ../../using/configure.rst:411 +#: ../../using/configure.rst:418 msgid "" "Ensure that functions which can clear or replace the current exception are " "not called with an exception raised." msgstr "" -#: ../../using/configure.rst:413 +#: ../../using/configure.rst:420 msgid "Check that deallocator functions don't change the current exception." msgstr "" -#: ../../using/configure.rst:414 +#: ../../using/configure.rst:421 msgid "" "The garbage collector (:func:`gc.collect` function) runs some basic checks " "on objects consistency." msgstr "" -#: ../../using/configure.rst:416 +#: ../../using/configure.rst:423 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:419 +#: ../../using/configure.rst:426 msgid "" "See also the :ref:`Python Development Mode ` and the :option:`--" "with-trace-refs` configure option." msgstr "" -#: ../../using/configure.rst:422 +#: ../../using/configure.rst:429 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 :" @@ -641,320 +654,320 @@ msgid "" "incompatibility." msgstr "" -#: ../../using/configure.rst:430 +#: ../../using/configure.rst:437 msgid "Debug options" msgstr "" -#: ../../using/configure.rst:434 +#: ../../using/configure.rst:441 msgid "" ":ref:`Build Python in debug mode `: define the ``Py_DEBUG`` " "macro (disabled by default)." msgstr "" -#: ../../using/configure.rst:439 +#: ../../using/configure.rst:446 msgid "Enable tracing references for debugging purpose (disabled by default)." msgstr "" -#: ../../using/configure.rst:441 +#: ../../using/configure.rst:448 msgid "Effects:" msgstr "" -#: ../../using/configure.rst:443 +#: ../../using/configure.rst:450 msgid "Define the ``Py_TRACE_REFS`` macro." msgstr "定義 ``Py_TRACE_REFS`` 巨集。" -#: ../../using/configure.rst:444 +#: ../../using/configure.rst:451 msgid "Add :func:`!sys.getobjects` function." msgstr "新增 :func:`!sys.getobjects` 函式。" -#: ../../using/configure.rst:445 +#: ../../using/configure.rst:452 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." msgstr "新增 :envvar:`PYTHONDUMPREFS` 環境變數。" -#: ../../using/configure.rst:447 +#: ../../using/configure.rst:454 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:454 +#: ../../using/configure.rst:461 msgid "" "Build with C assertions enabled (default is no): ``assert(...);`` and " "``_PyObject_ASSERT(...);``." msgstr "" -#: ../../using/configure.rst:457 +#: ../../using/configure.rst:464 msgid "" "If set, the ``NDEBUG`` macro is not defined in the :envvar:`OPT` compiler " "variable." msgstr "" -#: ../../using/configure.rst:460 +#: ../../using/configure.rst:467 msgid "" "See also the :option:`--with-pydebug` option (:ref:`debug build `) which also enables assertions." msgstr "" -#: ../../using/configure.rst:467 +#: ../../using/configure.rst:474 msgid "Enable Valgrind support (default is no)." msgstr "啟用 Valgrind 支援(預設不啟用)。" -#: ../../using/configure.rst:471 +#: ../../using/configure.rst:478 msgid "Enable DTrace support (default is no)." msgstr "啟用 DTrace 支援(預設不啟用)。" -#: ../../using/configure.rst:473 +#: ../../using/configure.rst:480 msgid "" "See :ref:`Instrumenting CPython with DTrace and SystemTap `." msgstr "" -#: ../../using/configure.rst:480 +#: ../../using/configure.rst:487 msgid "" "Enable AddressSanitizer memory error detector, ``asan`` (default is no)." msgstr "" -#: ../../using/configure.rst:486 +#: ../../using/configure.rst:493 msgid "" "Enable MemorySanitizer allocation error detector, ``msan`` (default is no)." msgstr "" -#: ../../using/configure.rst:492 +#: ../../using/configure.rst:499 msgid "" "Enable UndefinedBehaviorSanitizer undefined behaviour detector, ``ubsan`` " "(default is no)." msgstr "" -#: ../../using/configure.rst:499 +#: ../../using/configure.rst:506 msgid "Linker options" msgstr "" -#: ../../using/configure.rst:503 +#: ../../using/configure.rst:510 msgid "Enable building a shared Python library: ``libpython`` (default is no)." msgstr "" -#: ../../using/configure.rst:507 +#: ../../using/configure.rst:514 msgid "" "Do not build ``libpythonMAJOR.MINOR.a`` and do not install ``python.o`` " "(built and enabled by default)." msgstr "" -#: ../../using/configure.rst:514 +#: ../../using/configure.rst:521 msgid "Libraries options" msgstr "函式庫選項" -#: ../../using/configure.rst:518 +#: ../../using/configure.rst:525 msgid "Link against additional libraries (default is no)." msgstr "" -#: ../../using/configure.rst:522 +#: ../../using/configure.rst:529 msgid "" "Build the :mod:`!pyexpat` module using an installed ``expat`` library " "(default is no)." msgstr "" -#: ../../using/configure.rst:527 +#: ../../using/configure.rst:534 msgid "" "Build the ``_decimal`` extension module using an installed ``mpdec`` " "library, see the :mod:`decimal` module (default is no)." msgstr "" -#: ../../using/configure.rst:534 +#: ../../using/configure.rst:541 msgid "Use ``editline`` library for backend of the :mod:`readline` module." msgstr "" -#: ../../using/configure.rst:536 +#: ../../using/configure.rst:543 msgid "Define the ``WITH_EDITLINE`` macro." msgstr "定義 ``WITH_EDITLINE`` 巨集。" -#: ../../using/configure.rst:542 +#: ../../using/configure.rst:549 msgid "Don't build the :mod:`readline` module (built by default)." msgstr "" -#: ../../using/configure.rst:544 +#: ../../using/configure.rst:551 msgid "Don't define the ``HAVE_LIBREADLINE`` macro." msgstr "不要定義 ``HAVE_LIBREADLINE`` 巨集。" -#: ../../using/configure.rst:550 +#: ../../using/configure.rst:557 msgid "" "Override ``libm`` math library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:554 +#: ../../using/configure.rst:561 msgid "Override ``libc`` C library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:558 +#: ../../using/configure.rst:565 msgid "Root of the OpenSSL directory." msgstr "" -#: ../../using/configure.rst:564 +#: ../../using/configure.rst:571 msgid "Set runtime library directory (rpath) for OpenSSL libraries:" msgstr "" -#: ../../using/configure.rst:566 +#: ../../using/configure.rst:573 msgid "``no`` (default): don't set rpath;" msgstr "" -#: ../../using/configure.rst:567 +#: ../../using/configure.rst:574 msgid "" "``auto``: auto-detect rpath from :option:`--with-openssl` and ``pkg-config``;" msgstr "" -#: ../../using/configure.rst:569 +#: ../../using/configure.rst:576 msgid "*DIR*: set an explicit rpath." msgstr "" -#: ../../using/configure.rst:575 +#: ../../using/configure.rst:582 msgid "Security Options" msgstr "" -#: ../../using/configure.rst:579 +#: ../../using/configure.rst:586 msgid "Select hash algorithm for use in ``Python/pyhash.c``:" msgstr "" -#: ../../using/configure.rst:581 +#: ../../using/configure.rst:588 msgid "``siphash13`` (default);" msgstr "" -#: ../../using/configure.rst:582 +#: ../../using/configure.rst:589 msgid "``siphash24``;" msgstr "``siphash24``;" -#: ../../using/configure.rst:583 +#: ../../using/configure.rst:590 msgid "``fnv``." msgstr "``fnv``。" -#: ../../using/configure.rst:587 +#: ../../using/configure.rst:594 msgid "``siphash13`` is added and it is the new default." msgstr "" -#: ../../using/configure.rst:592 +#: ../../using/configure.rst:599 msgid "Built-in hash modules:" msgstr "內建雜湊模組:" -#: ../../using/configure.rst:594 +#: ../../using/configure.rst:601 msgid "``md5``;" msgstr "``md5``;" -#: ../../using/configure.rst:595 +#: ../../using/configure.rst:602 msgid "``sha1``;" msgstr "``sha1``;" -#: ../../using/configure.rst:596 +#: ../../using/configure.rst:603 msgid "``sha256``;" msgstr "``sha256``;" -#: ../../using/configure.rst:597 +#: ../../using/configure.rst:604 msgid "``sha512``;" msgstr "``sha512``;" -#: ../../using/configure.rst:598 +#: ../../using/configure.rst:605 msgid "``sha3`` (with shake);" msgstr "" -#: ../../using/configure.rst:599 +#: ../../using/configure.rst:606 msgid "``blake2``." msgstr "``blake2``。" -#: ../../using/configure.rst:605 +#: ../../using/configure.rst:612 msgid "Override the OpenSSL default cipher suites string:" msgstr "" -#: ../../using/configure.rst:607 +#: ../../using/configure.rst:614 msgid "``python`` (default): use Python's preferred selection;" msgstr "" -#: ../../using/configure.rst:608 +#: ../../using/configure.rst:615 msgid "``openssl``: leave OpenSSL's defaults untouched;" msgstr "" -#: ../../using/configure.rst:609 +#: ../../using/configure.rst:616 msgid "*STRING*: use a custom string" msgstr "" -#: ../../using/configure.rst:611 +#: ../../using/configure.rst:618 msgid "See the :mod:`ssl` module." msgstr "請見 :mod:`ssl` 模組。" -#: ../../using/configure.rst:617 +#: ../../using/configure.rst:624 msgid "" "The settings ``python`` and *STRING* also set TLS 1.2 as minimum protocol " "version." msgstr "" -#: ../../using/configure.rst:621 +#: ../../using/configure.rst:628 msgid "macOS Options" msgstr "macOS 選項" -#: ../../using/configure.rst:623 +#: ../../using/configure.rst:630 msgid "See ``Mac/README.rst``." msgstr "參閱 ``Mac/README.rst``。" -#: ../../using/configure.rst:628 +#: ../../using/configure.rst:635 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:634 +#: ../../using/configure.rst:641 msgid "" "Create a Python.framework rather than a traditional Unix install. Optional " "*INSTALLDIR* specifies the installation path (default is no)." msgstr "" -#: ../../using/configure.rst:639 +#: ../../using/configure.rst:646 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:642 +#: ../../using/configure.rst:649 msgid "Options:" msgstr "選項:" -#: ../../using/configure.rst:644 +#: ../../using/configure.rst:651 msgid "``universal2``;" msgstr "``universal2``;" -#: ../../using/configure.rst:645 +#: ../../using/configure.rst:652 msgid "``32-bit``;" msgstr "``32-bit``;" -#: ../../using/configure.rst:646 +#: ../../using/configure.rst:653 msgid "``64-bit``;" msgstr "``64-bit``;" -#: ../../using/configure.rst:647 +#: ../../using/configure.rst:654 msgid "``3-way``;" msgstr "``3-way``;" -#: ../../using/configure.rst:648 +#: ../../using/configure.rst:655 msgid "``intel``;" msgstr "``intel``;" -#: ../../using/configure.rst:649 +#: ../../using/configure.rst:656 msgid "``intel-32``;" msgstr "``intel-32``;" -#: ../../using/configure.rst:650 +#: ../../using/configure.rst:657 msgid "``intel-64``;" msgstr "``intel-64``;" -#: ../../using/configure.rst:651 +#: ../../using/configure.rst:658 msgid "``all``." msgstr "``all``。" -#: ../../using/configure.rst:655 +#: ../../using/configure.rst:662 msgid "" "Specify the name for the python framework on macOS only valid when :option:" "`--enable-framework` is set (default: ``Python``)." msgstr "" -#: ../../using/configure.rst:660 +#: ../../using/configure.rst:667 msgid "Cross Compiling Options" msgstr "" -#: ../../using/configure.rst:662 +#: ../../using/configure.rst:669 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 " @@ -962,95 +975,95 @@ msgid "" "match the version of the cross compiled host Python." msgstr "" -#: ../../using/configure.rst:669 +#: ../../using/configure.rst:676 msgid "" "configure for building on BUILD, usually guessed by :program:`config.guess`." msgstr "" -#: ../../using/configure.rst:673 +#: ../../using/configure.rst:680 msgid "cross-compile to build programs to run on HOST (target platform)" msgstr "" -#: ../../using/configure.rst:677 +#: ../../using/configure.rst:684 msgid "path to build ``python`` binary for cross compiling" msgstr "" -#: ../../using/configure.rst:683 +#: ../../using/configure.rst:690 msgid "An environment variable that points to a file with configure overrides." msgstr "" -#: ../../using/configure.rst:685 +#: ../../using/configure.rst:692 msgid "Example *config.site* file::" msgstr "" -#: ../../using/configure.rst:693 +#: ../../using/configure.rst:700 msgid "Cross compiling example::" msgstr "" -#: ../../using/configure.rst:702 +#: ../../using/configure.rst:709 msgid "Python Build System" msgstr "" -#: ../../using/configure.rst:705 +#: ../../using/configure.rst:712 msgid "Main files of the build system" msgstr "" -#: ../../using/configure.rst:707 +#: ../../using/configure.rst:714 msgid ":file:`configure.ac` => :file:`configure`;" msgstr ":file:`configure.ac` => :file:`configure`\\ ;" -#: ../../using/configure.rst:708 +#: ../../using/configure.rst:715 msgid "" ":file:`Makefile.pre.in` => :file:`Makefile` (created by :file:`configure`);" msgstr "" -#: ../../using/configure.rst:709 +#: ../../using/configure.rst:716 msgid ":file:`pyconfig.h` (created by :file:`configure`);" msgstr ":file:`pyconfig.h` (created by :file:`configure`)\\ ;" -#: ../../using/configure.rst:710 +#: ../../using/configure.rst:717 msgid "" ":file:`Modules/Setup`: C extensions built by the Makefile using :file:" "`Module/makesetup` shell script;" msgstr "" -#: ../../using/configure.rst:714 +#: ../../using/configure.rst:721 msgid "Main build steps" msgstr "主要建置步驟" -#: ../../using/configure.rst:716 +#: ../../using/configure.rst:723 msgid "C files (``.c``) are built as object files (``.o``)." msgstr "" -#: ../../using/configure.rst:717 +#: ../../using/configure.rst:724 msgid "A static ``libpython`` library (``.a``) is created from objects files." msgstr "" -#: ../../using/configure.rst:718 +#: ../../using/configure.rst:725 msgid "" "``python.o`` and the static ``libpython`` library are linked into the final " "``python`` program." msgstr "" -#: ../../using/configure.rst:720 +#: ../../using/configure.rst:727 msgid "C extensions are built by the Makefile (see :file:`Modules/Setup`)." msgstr "" -#: ../../using/configure.rst:723 +#: ../../using/configure.rst:730 msgid "Main Makefile targets" msgstr "主要 Makefile 目標" -#: ../../using/configure.rst:725 +#: ../../using/configure.rst:732 msgid "``make``: Build Python with the standard library." msgstr "" -#: ../../using/configure.rst:726 +#: ../../using/configure.rst:733 msgid "" "``make platform:``: build the ``python`` program, but don't build the " "standard library extension modules." msgstr "" -#: ../../using/configure.rst:728 +#: ../../using/configure.rst:735 msgid "" "``make profile-opt``: build Python using Profile Guided Optimization (PGO). " "You can use the configure :option:`--enable-optimizations` option to make " @@ -1058,53 +1071,53 @@ msgid "" "``make``)." msgstr "" -#: ../../using/configure.rst:732 +#: ../../using/configure.rst:739 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:735 +#: ../../using/configure.rst:742 msgid "``make install``: Build and install Python." msgstr "" -#: ../../using/configure.rst:736 +#: ../../using/configure.rst:743 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:739 +#: ../../using/configure.rst:746 msgid "``make clean``: Remove built files." msgstr "" -#: ../../using/configure.rst:740 +#: ../../using/configure.rst:747 msgid "" "``make distclean``: Same than ``make clean``, but remove also files created " "by the configure script." msgstr "" -#: ../../using/configure.rst:744 +#: ../../using/configure.rst:751 msgid "C extensions" msgstr "C 擴充模組" -#: ../../using/configure.rst:746 +#: ../../using/configure.rst:753 msgid "" "Some C extensions are built as built-in modules, like the ``sys`` module. " "They are built with the ``Py_BUILD_CORE_BUILTIN`` macro defined. Built-in " "modules have no ``__file__`` attribute::" msgstr "" -#: ../../using/configure.rst:758 +#: ../../using/configure.rst:765 msgid "" "Other C extensions are built as dynamic libraries, like the ``_asyncio`` " "module. They are built with the ``Py_BUILD_CORE_MODULE`` macro defined. " "Example on Linux x86-64::" msgstr "" -#: ../../using/configure.rst:768 +#: ../../using/configure.rst:775 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-" @@ -1112,303 +1125,303 @@ msgid "" "dynamic libraries." msgstr "" -#: ../../using/configure.rst:772 +#: ../../using/configure.rst:779 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:776 +#: ../../using/configure.rst:783 msgid "Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined" msgstr "如果定義了 ``Py_BUILD_CORE_MODULE``,則使用 ``Py_EXPORTED_SYMBOL``" -#: ../../using/configure.rst:777 +#: ../../using/configure.rst:784 msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." msgstr "否則使用 ``Py_IMPORTED_SYMBOL``。" -#: ../../using/configure.rst:779 +#: ../../using/configure.rst:786 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:785 +#: ../../using/configure.rst:792 msgid "Compiler and linker flags" msgstr "" -#: ../../using/configure.rst:787 +#: ../../using/configure.rst:794 msgid "" "Options set by the ``./configure`` script and environment variables and used " "by ``Makefile``." msgstr "" -#: ../../using/configure.rst:791 +#: ../../using/configure.rst:798 msgid "Preprocessor flags" msgstr "" -#: ../../using/configure.rst:795 +#: ../../using/configure.rst:802 msgid "" "Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:801 +#: ../../using/configure.rst:808 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:804 ../../using/configure.rst:994 +#: ../../using/configure.rst:811 ../../using/configure.rst:1001 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:814 +#: ../../using/configure.rst:821 msgid "" "Extra preprocessor flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:816 +#: ../../using/configure.rst:823 msgid "" "Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " "$(CPPFLAGS)``." msgstr "" -#: ../../using/configure.rst:821 +#: ../../using/configure.rst:828 msgid "Compiler flags" msgstr "編譯器旗標" -#: ../../using/configure.rst:825 +#: ../../using/configure.rst:832 msgid "C compiler command." msgstr "C 編譯器指令。" -#: ../../using/configure.rst:827 +#: ../../using/configure.rst:834 msgid "Example: ``gcc -pthread``." msgstr "" -#: ../../using/configure.rst:831 +#: ../../using/configure.rst:838 msgid "C++ compiler command." msgstr "C++ 編譯器指令。" -#: ../../using/configure.rst:833 +#: ../../using/configure.rst:840 msgid "Example: ``g++ -pthread``." msgstr "範例:``g++ -pthread``。" -#: ../../using/configure.rst:837 +#: ../../using/configure.rst:844 msgid "C compiler flags." msgstr "C 編譯器旗標。" -#: ../../using/configure.rst:841 +#: ../../using/configure.rst:848 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:845 +#: ../../using/configure.rst:852 msgid "In particular, :envvar:`CFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:847 +#: ../../using/configure.rst:854 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:852 +#: ../../using/configure.rst:859 msgid "" "hardening flags such as ``-Werror`` because distributions cannot control " "whether packages installed by users conform to such heightened standards." msgstr "" -#: ../../using/configure.rst:860 +#: ../../using/configure.rst:867 msgid "" "Options passed to the :mod:`compileall` command line when building PYC files " "in ``make install``. Default: ``-j0``." msgstr "" -#: ../../using/configure.rst:867 +#: ../../using/configure.rst:874 msgid "Extra C compiler flags." msgstr "額外的 C 編譯器旗標。" -#: ../../using/configure.rst:871 +#: ../../using/configure.rst:878 msgid "" "Value of :envvar:`CFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:878 +#: ../../using/configure.rst:885 msgid "" "Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:885 +#: ../../using/configure.rst:892 msgid "Base compiler flags." msgstr "基本編譯器旗標。" -#: ../../using/configure.rst:889 +#: ../../using/configure.rst:896 msgid "Optimization flags." msgstr "最佳化旗標。" -#: ../../using/configure.rst:893 +#: ../../using/configure.rst:900 msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" -#: ../../using/configure.rst:899 +#: ../../using/configure.rst:906 msgid "Compiler flags used to build a shared library." msgstr "" -#: ../../using/configure.rst:901 +#: ../../using/configure.rst:908 msgid "For example, ``-fPIC`` is used on Linux and on BSD." msgstr "例如說 ``-fPIC`` 被使用於 Linux 與 BSD 上。" -#: ../../using/configure.rst:905 +#: ../../using/configure.rst:912 msgid "Extra C flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:907 +#: ../../using/configure.rst:914 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" -#: ../../using/configure.rst:912 +#: ../../using/configure.rst:919 msgid "" "Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``." msgstr "" -#: ../../using/configure.rst:916 +#: ../../using/configure.rst:923 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." msgstr "" -#: ../../using/configure.rst:922 +#: ../../using/configure.rst:929 msgid "C flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:924 +#: ../../using/configure.rst:931 msgid "" "Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``." msgstr "" -#: ../../using/configure.rst:930 +#: ../../using/configure.rst:937 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." msgstr "" -#: ../../using/configure.rst:936 +#: ../../using/configure.rst:943 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" -#: ../../using/configure.rst:939 +#: ../../using/configure.rst:946 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." msgstr "" -#: ../../using/configure.rst:945 +#: ../../using/configure.rst:952 msgid "Purify command. Purify is a memory debugger program." msgstr "" -#: ../../using/configure.rst:947 +#: ../../using/configure.rst:954 msgid "Default: empty string (not used)." msgstr "" -#: ../../using/configure.rst:951 +#: ../../using/configure.rst:958 msgid "Linker flags" msgstr "" -#: ../../using/configure.rst:955 +#: ../../using/configure.rst:962 msgid "" "Linker command used to build programs like ``python`` and ``_testembed``." msgstr "" -#: ../../using/configure.rst:957 +#: ../../using/configure.rst:964 msgid "Default: ``$(PURIFY) $(CC)``." msgstr "" -#: ../../using/configure.rst:961 +#: ../../using/configure.rst:968 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:963 +#: ../../using/configure.rst:970 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:971 +#: ../../using/configure.rst:978 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:975 +#: ../../using/configure.rst:982 msgid "In particular, :envvar:`LDFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:977 +#: ../../using/configure.rst:984 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:984 +#: ../../using/configure.rst:991 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:991 +#: ../../using/configure.rst:998 msgid "" "Linker flags, e.g. :samp:`-L{lib_dir}` if you have libraries in a " "nonstandard directory *lib_dir*." msgstr "" -#: ../../using/configure.rst:1000 +#: ../../using/configure.rst:1007 msgid "" "Linker flags to pass libraries to the linker when linking the Python " "executable." msgstr "" -#: ../../using/configure.rst:1003 +#: ../../using/configure.rst:1010 msgid "Example: ``-lrt``." msgstr "範例:``-lrt``。" -#: ../../using/configure.rst:1007 +#: ../../using/configure.rst:1014 msgid "Command to build a shared library." msgstr "" -#: ../../using/configure.rst:1009 +#: ../../using/configure.rst:1016 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." msgstr "預設值:``@LDSHARED@ $(PY_LDFLAGS)``。" -#: ../../using/configure.rst:1013 +#: ../../using/configure.rst:1020 msgid "Command to build ``libpython`` shared library." msgstr "" -#: ../../using/configure.rst:1015 +#: ../../using/configure.rst:1022 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." msgstr "預設值:``@BLDSHARED@ $(PY_CORE_LDFLAGS)``。" -#: ../../using/configure.rst:1019 +#: ../../using/configure.rst:1026 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``。" -#: ../../using/configure.rst:1023 +#: ../../using/configure.rst:1030 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``。" -#: ../../using/configure.rst:1029 +#: ../../using/configure.rst:1036 msgid "Linker flags used for building the interpreter object files." msgstr "" diff --git a/whatsnew/2.0.po b/whatsnew/2.0.po index a3709bd620..33a04e993e 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: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-11-28 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-" @@ -831,16 +831,17 @@ msgstr "" #: ../../whatsnew/2.0.rst:673 msgid "" "Some of the functions in the :mod:`socket` module are still forgiving in " -"this way. For example, :func:`socket.connect( ('hostname', 25) )` is the " -"correct form, passing a tuple representing an IP address, but :func:`socket." -"connect( 'hostname', 25 )` also works. :func:`socket.connect_ex` and :func:" -"`socket.bind` are similarly easy-going. 2.0alpha1 tightened these functions " -"up, but because the documentation actually used the erroneous multiple " -"argument form, many people wrote code which would break with the stricter " -"checking. GvR backed out the changes in the face of public reaction, so for " -"the :mod:`socket` module, the documentation was fixed and the multiple " -"argument form is simply marked as deprecated; it *will* be tightened up " -"again in a future Python version." +"this way. For example, ``socket.connect( ('hostname', 25) )`` is the " +"correct form, passing a tuple representing an IP address, but ``socket." +"connect('hostname', 25)`` also works. :meth:`socket.connect_ex ` and :meth:`socket.bind ` are " +"similarly easy-going. 2.0alpha1 tightened these functions up, but because " +"the documentation actually used the erroneous multiple argument form, many " +"people wrote code which would break with the stricter checking. GvR backed " +"out the changes in the face of public reaction, so for the :mod:`socket` " +"module, the documentation was fixed and the multiple argument form is simply " +"marked as deprecated; it *will* be tightened up again in a future Python " +"version." msgstr "" #: ../../whatsnew/2.0.rst:684 diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index e2738a5e26..4b46ec6d08 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-20 00:03+0000\n" +"POT-Creation-Date: 2023-12-06 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-" @@ -2235,16 +2235,16 @@ msgstr "" #: ../../whatsnew/2.3.rst:2001 msgid "" -"C extensions that access the :attr:`f_lineno` field of frame objects should " -"instead call ``PyCode_Addr2Line(f->f_code, f->f_lasti)``. This will have the " -"added effect of making the code work as desired under \"python -O\" in " -"earlier versions of Python." +"C extensions that access the :attr:`~frame.f_lineno` field of frame objects " +"should instead call ``PyCode_Addr2Line(f->f_code, f->f_lasti)``. This will " +"have the added effect of making the code work as desired under \"python -O\" " +"in earlier versions of Python." msgstr "" #: ../../whatsnew/2.3.rst:2006 msgid "" "A nifty new feature is that trace functions can now assign to the :attr:" -"`f_lineno` attribute of frame objects, changing the line that will be " +"`~frame.f_lineno` attribute of frame objects, changing the line that will be " "executed next. A ``jump`` command has been added to the :mod:`pdb` debugger " "taking advantage of this new feature. (Implemented by Richie Hindle.)" msgstr "" diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 3343bbc83f..c9699bd110 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-20 00:03+0000\n" +"POT-Creation-Date: 2023-12-04 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-" @@ -1702,8 +1702,8 @@ msgid "" "`update`, :meth:`difference` and :meth:`difference_update`." msgstr "" -#: ../../whatsnew/2.6.rst:1596 ../../whatsnew/2.6.rst:1880 -#: ../../whatsnew/2.6.rst:1901 +#: ../../whatsnew/2.6.rst:1596 ../../whatsnew/2.6.rst:1881 +#: ../../whatsnew/2.6.rst:1902 msgid "(Contributed by Raymond Hettinger.)" msgstr "(由 Raymond Hettinger 所貢獻。)" @@ -1812,12 +1812,13 @@ msgstr "" #: ../../whatsnew/2.6.rst:1679 msgid "" "Instance method objects have new attributes for the object and function " -"comprising the method; the new synonym for :attr:`im_self` is :attr:" -"`__self__`, and :attr:`im_func` is also available as :attr:`__func__`. The " -"old names are still supported in Python 2.6, but are gone in 3.0." +"comprising the method; the new synonym for :attr:`!im_self` is :ref:" +"`__self__ `, and :attr:`!im_func` is also available as :" +"ref:`__func__ `. The old names are still supported in " +"Python 2.6, but are gone in 3.0." msgstr "" -#: ../../whatsnew/2.6.rst:1684 +#: ../../whatsnew/2.6.rst:1685 msgid "" "An obscure change: when you use the :func:`locals` function inside a :" "keyword:`class` statement, the resulting dictionary no longer returns free " @@ -1825,11 +1826,11 @@ msgid "" "keyword:`!class` statement that aren't attributes of the class.)" msgstr "" -#: ../../whatsnew/2.6.rst:1693 +#: ../../whatsnew/2.6.rst:1694 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/2.6.rst:1695 +#: ../../whatsnew/2.6.rst:1696 msgid "" "The :mod:`warnings` module has been rewritten in C. This makes it possible " "to invoke warnings from the parser, and may also make the interpreter's " @@ -1837,7 +1838,7 @@ msgid "" "`1631171`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1700 +#: ../../whatsnew/2.6.rst:1701 msgid "" "Type objects now have a cache of methods that can reduce the work required " "to find the correct method implementation for a particular class; once " @@ -1848,7 +1849,7 @@ msgid "" "updated for Python 2.6 by Kevin Jacobs; :issue:`1700288`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1710 +#: ../../whatsnew/2.6.rst:1711 msgid "" "By default, this change is only applied to types that are included with the " "Python core. Extension modules may not necessarily be compatible with this " @@ -1860,7 +1861,7 @@ msgid "" "interpreter to determine that. See :issue:`1878` for some discussion.)" msgstr "" -#: ../../whatsnew/2.6.rst:1721 +#: ../../whatsnew/2.6.rst:1722 msgid "" "Function calls that use keyword arguments are significantly faster by doing " "a quick pointer comparison, usually saving the time of a full string " @@ -1868,21 +1869,21 @@ msgid "" "implementation by Antoine Pitrou; :issue:`1819`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1726 +#: ../../whatsnew/2.6.rst:1727 msgid "" "All of the functions in the :mod:`struct` module have been rewritten in C, " "thanks to work at the Need For Speed sprint. (Contributed by Raymond " "Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:1730 +#: ../../whatsnew/2.6.rst:1731 msgid "" "Some of the standard built-in types now set a bit in their type objects. " "This speeds up checking whether an object is a subclass of one of these " "types. (Contributed by Neal Norwitz.)" msgstr "" -#: ../../whatsnew/2.6.rst:1734 +#: ../../whatsnew/2.6.rst:1735 msgid "" "Unicode strings now use faster code for detecting whitespace and line " "breaks; this speeds up the :meth:`split` method by about 25% and :meth:" @@ -1890,24 +1891,24 @@ msgid "" "reduced by using pymalloc for the Unicode string's data." msgstr "" -#: ../../whatsnew/2.6.rst:1740 +#: ../../whatsnew/2.6.rst:1741 msgid "" "The ``with`` statement now stores the :meth:`~object.__exit__` method on the " "stack, producing a small speedup. (Implemented by Jeffrey Yasskin.)" msgstr "" -#: ../../whatsnew/2.6.rst:1743 +#: ../../whatsnew/2.6.rst:1744 msgid "" "To reduce memory usage, the garbage collector will now clear internal free " "lists when garbage-collecting the highest generation of objects. This may " "return memory to the operating system sooner." msgstr "" -#: ../../whatsnew/2.6.rst:1752 +#: ../../whatsnew/2.6.rst:1753 msgid "Interpreter Changes" msgstr "" -#: ../../whatsnew/2.6.rst:1754 +#: ../../whatsnew/2.6.rst:1755 msgid "" "Two command-line options have been reserved for use by other Python " "implementations. The :option:`-J` switch has been reserved for use by " @@ -1918,7 +1919,7 @@ msgid "" "the option isn't currently used." msgstr "" -#: ../../whatsnew/2.6.rst:1762 +#: ../../whatsnew/2.6.rst:1763 msgid "" "Python can now be prevented from writing :file:`.pyc` or :file:`.pyo` files " "by supplying the :option:`-B` switch to the Python interpreter, or by " @@ -1929,7 +1930,7 @@ msgid "" "and Georg Brandl.)" msgstr "" -#: ../../whatsnew/2.6.rst:1770 +#: ../../whatsnew/2.6.rst:1771 msgid "" "The encoding used for standard input, output, and standard error can be " "specified by setting the :envvar:`PYTHONIOENCODING` environment variable " @@ -1941,11 +1942,11 @@ msgid "" "\"replace\". (Contributed by Martin von Löwis.)" msgstr "" -#: ../../whatsnew/2.6.rst:1783 +#: ../../whatsnew/2.6.rst:1784 msgid "New and Improved Modules" msgstr "" -#: ../../whatsnew/2.6.rst:1785 +#: ../../whatsnew/2.6.rst:1786 msgid "" "As in every release, Python's standard library received a number of " "enhancements and bug fixes. Here's a partial list of the most notable " @@ -1954,14 +1955,14 @@ msgid "" "the Subversion logs for all the details." msgstr "" -#: ../../whatsnew/2.6.rst:1791 +#: ../../whatsnew/2.6.rst:1792 msgid "" "The :mod:`asyncore` and :mod:`asynchat` modules are being actively " "maintained again, and a number of patches and bugfixes were applied. " "(Maintained by Josiah Carlson; see :issue:`1736190` for one patch.)" msgstr "" -#: ../../whatsnew/2.6.rst:1796 +#: ../../whatsnew/2.6.rst:1797 msgid "" "The :mod:`bsddb` module also has a new maintainer, Jesús Cea Avión, and the " "package is now available as a standalone package. The web page for the " @@ -1971,14 +1972,14 @@ msgid "" "frequent than Python's." msgstr "" -#: ../../whatsnew/2.6.rst:1804 +#: ../../whatsnew/2.6.rst:1805 msgid "" "The :mod:`bsddb.dbshelve` module now uses the highest pickling protocol " "available, instead of restricting itself to protocol 1. (Contributed by W. " "Barnes.)" msgstr "" -#: ../../whatsnew/2.6.rst:1808 +#: ../../whatsnew/2.6.rst:1809 msgid "" "The :mod:`cgi` module will now read variables from the query string of an " "HTTP POST request. This makes it possible to use form actions with URLs " @@ -1986,7 +1987,7 @@ msgid "" "(Contributed by Alexandre Fiori and Nubis; :issue:`1817`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1814 +#: ../../whatsnew/2.6.rst:1815 msgid "" "The :func:`parse_qs` and :func:`parse_qsl` functions have been relocated " "from the :mod:`cgi` module to the :mod:`urlparse` module. The versions still " @@ -1994,43 +1995,43 @@ msgid "" "`PendingDeprecationWarning` messages in 2.6 (:issue:`600362`)." msgstr "" -#: ../../whatsnew/2.6.rst:1820 +#: ../../whatsnew/2.6.rst:1821 msgid "" "The :mod:`cmath` module underwent extensive revision, contributed by Mark " "Dickinson and Christian Heimes. Five new functions were added:" msgstr "" -#: ../../whatsnew/2.6.rst:1824 +#: ../../whatsnew/2.6.rst:1825 msgid "" ":func:`polar` converts a complex number to polar form, returning the modulus " "and argument of the complex number." msgstr "" -#: ../../whatsnew/2.6.rst:1827 +#: ../../whatsnew/2.6.rst:1828 msgid "" ":func:`rect` does the opposite, turning a modulus, argument pair back into " "the corresponding complex number." msgstr "" -#: ../../whatsnew/2.6.rst:1830 +#: ../../whatsnew/2.6.rst:1831 msgid "" ":func:`phase` returns the argument (also called the angle) of a complex " "number." msgstr "" -#: ../../whatsnew/2.6.rst:1833 +#: ../../whatsnew/2.6.rst:1834 msgid "" ":func:`isnan` returns True if either the real or imaginary part of its " "argument is a NaN." msgstr "" -#: ../../whatsnew/2.6.rst:1836 +#: ../../whatsnew/2.6.rst:1837 msgid "" ":func:`isinf` returns True if either the real or imaginary part of its " "argument is infinite." msgstr "" -#: ../../whatsnew/2.6.rst:1839 +#: ../../whatsnew/2.6.rst:1840 msgid "" "The revisions also improved the numerical soundness of the :mod:`cmath` " "module. For all functions, the real and imaginary parts of the results are " @@ -2039,27 +2040,27 @@ msgid "" "`atanh`: and :func:`atan` have also been corrected." msgstr "" -#: ../../whatsnew/2.6.rst:1846 +#: ../../whatsnew/2.6.rst:1847 msgid "" "The tests for the module have been greatly expanded; nearly 2000 new test " "cases exercise the algebraic functions." msgstr "" -#: ../../whatsnew/2.6.rst:1849 +#: ../../whatsnew/2.6.rst:1850 msgid "" "On IEEE 754 platforms, the :mod:`cmath` module now handles IEEE 754 special " "values and floating-point exceptions in a manner consistent with Annex 'G' " "of the C99 standard." msgstr "" -#: ../../whatsnew/2.6.rst:1853 +#: ../../whatsnew/2.6.rst:1854 msgid "" "A new data type in the :mod:`collections` module: ``namedtuple(typename, " "fieldnames)`` is a factory function that creates subclasses of the standard " "tuple whose fields are accessible by name as well as index. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:1875 +#: ../../whatsnew/2.6.rst:1876 msgid "" "Several places in the standard library that returned tuples have been " "modified to return :func:`namedtuple` instances. For example, the :meth:" @@ -2067,7 +2068,7 @@ msgid "" "`digits`, and :attr:`exponent` fields." msgstr "" -#: ../../whatsnew/2.6.rst:1882 +#: ../../whatsnew/2.6.rst:1883 msgid "" "Another change to the :mod:`collections` module is that the :class:`deque` " "type now supports an optional *maxlen* parameter; if supplied, the deque's " @@ -2075,7 +2076,7 @@ msgid "" "to a full deque causes old items to be discarded." msgstr "" -#: ../../whatsnew/2.6.rst:1903 +#: ../../whatsnew/2.6.rst:1904 msgid "" "The :mod:`Cookie` module's :class:`Morsel` objects now support an :attr:" "`httponly` attribute. In some browsers. cookies with this attribute set " @@ -2083,14 +2084,14 @@ msgid "" "Schnell; :issue:`1638033`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1908 +#: ../../whatsnew/2.6.rst:1909 msgid "" "A new window method in the :mod:`curses` module, :meth:`chgat`, changes the " "display attributes for a certain number of characters on a single line. " "(Contributed by Fabian Kreutz.)" msgstr "" -#: ../../whatsnew/2.6.rst:1918 +#: ../../whatsnew/2.6.rst:1919 msgid "" "The :class:`Textbox` class in the :mod:`curses.textpad` module now supports " "editing in insert mode as well as overwrite mode. Insert mode is enabled by " @@ -2098,7 +2099,7 @@ msgid "" "class:`Textbox` instance." msgstr "" -#: ../../whatsnew/2.6.rst:1923 +#: ../../whatsnew/2.6.rst:1924 msgid "" "The :mod:`datetime` module's :meth:`strftime` methods now support a ``%f`` " "format code that expands to the number of microseconds in the object, zero-" @@ -2106,7 +2107,7 @@ msgid "" "`1158`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1928 +#: ../../whatsnew/2.6.rst:1929 msgid "" "The :mod:`decimal` module was updated to version 1.66 of `the General " "Decimal Specification `__. " @@ -2114,26 +2115,26 @@ msgid "" "as :meth:`exp` and :meth:`log10`::" msgstr "" -#: ../../whatsnew/2.6.rst:1940 +#: ../../whatsnew/2.6.rst:1941 msgid "" "The :meth:`as_tuple` method of :class:`Decimal` objects now returns a named " "tuple with :attr:`sign`, :attr:`digits`, and :attr:`exponent` fields." msgstr "" -#: ../../whatsnew/2.6.rst:1943 +#: ../../whatsnew/2.6.rst:1944 msgid "" "(Implemented by Facundo Batista and Mark Dickinson. Named tuple support " "added by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:1946 +#: ../../whatsnew/2.6.rst:1947 msgid "" "The :mod:`difflib` module's :class:`SequenceMatcher` class now returns named " "tuples representing matches, with :attr:`a`, :attr:`b`, and :attr:`size` " "attributes. (Contributed by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:1951 +#: ../../whatsnew/2.6.rst:1952 msgid "" "An optional ``timeout`` parameter, specifying a timeout measured in seconds, " "was added to the :class:`ftplib.FTP` class constructor as well as the :meth:" @@ -2143,7 +2144,7 @@ msgid "" "data has been sent. (Contributed by Phil Schwartz; :issue:`1221598`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1959 +#: ../../whatsnew/2.6.rst:1960 msgid "" "The :func:`reduce` built-in function is also available in the :mod:" "`functools` module. In Python 3.0, the builtin has been dropped and :func:" @@ -2152,7 +2153,7 @@ msgid "" "issue:`1739906`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1965 +#: ../../whatsnew/2.6.rst:1966 msgid "" "When possible, the :mod:`getpass` module will now use :file:`/dev/tty` to " "print a prompt message and read the password, falling back to standard error " @@ -2161,14 +2162,14 @@ msgid "" "P. Smith.)" msgstr "" -#: ../../whatsnew/2.6.rst:1971 +#: ../../whatsnew/2.6.rst:1972 msgid "" "The :func:`glob.glob` function can now return Unicode filenames if a Unicode " "path was used and Unicode filenames are matched within the directory. (:" "issue:`1001604`)" msgstr "" -#: ../../whatsnew/2.6.rst:1975 +#: ../../whatsnew/2.6.rst:1976 msgid "" "A new function in the :mod:`heapq` module, ``merge(iter1, iter2, ...)``, " "takes any number of iterables returning data in sorted order, and returns a " @@ -2176,14 +2177,14 @@ msgid "" "order. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:1983 +#: ../../whatsnew/2.6.rst:1984 msgid "" "Another new function, ``heappushpop(heap, item)``, pushes *item* onto " "*heap*, then pops off and returns the smallest item. This is more efficient " "than making a call to :func:`heappush` and then :func:`heappop`." msgstr "" -#: ../../whatsnew/2.6.rst:1988 +#: ../../whatsnew/2.6.rst:1989 msgid "" ":mod:`heapq` is now implemented to only use less-than comparison, instead of " "the less-than-or-equal comparison it previously used. This makes :mod:" @@ -2191,14 +2192,14 @@ msgid "" "by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:1994 +#: ../../whatsnew/2.6.rst:1995 msgid "" "An optional ``timeout`` parameter, specifying a timeout measured in seconds, " "was added to the :class:`httplib.HTTPConnection` and :class:" "`HTTPSConnection` class constructors. (Added by Facundo Batista.)" msgstr "" -#: ../../whatsnew/2.6.rst:1999 +#: ../../whatsnew/2.6.rst:2000 msgid "" "Most of the :mod:`inspect` module's functions, such as :func:`getmoduleinfo` " "and :func:`getargs`, now return named tuples. In addition to behaving like " @@ -2206,55 +2207,55 @@ msgid "" "attributes. (Contributed by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:2005 +#: ../../whatsnew/2.6.rst:2006 msgid "" "Some new functions in the module include :func:`isgenerator`, :func:" "`isgeneratorfunction`, and :func:`isabstract`." msgstr "" -#: ../../whatsnew/2.6.rst:2009 +#: ../../whatsnew/2.6.rst:2010 msgid "The :mod:`itertools` module gained several new functions." msgstr "" -#: ../../whatsnew/2.6.rst:2011 +#: ../../whatsnew/2.6.rst:2012 msgid "" "``izip_longest(iter1, iter2, ...[, fillvalue])`` makes tuples from each of " "the elements; if some of the iterables are shorter than others, the missing " "values are set to *fillvalue*. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:2018 +#: ../../whatsnew/2.6.rst:2019 msgid "" "``product(iter1, iter2, ..., [repeat=N])`` returns the Cartesian product of " "the supplied iterables, a set of tuples containing every possible " "combination of the elements returned from each iterable. ::" msgstr "" -#: ../../whatsnew/2.6.rst:2027 +#: ../../whatsnew/2.6.rst:2028 msgid "" "The optional *repeat* keyword argument is used for taking the product of an " "iterable or a set of iterables with themselves, repeated *N* times. With a " "single iterable argument, *N*-tuples are returned::" msgstr "" -#: ../../whatsnew/2.6.rst:2036 +#: ../../whatsnew/2.6.rst:2037 msgid "With two iterables, *2N*-tuples are returned. ::" msgstr "" -#: ../../whatsnew/2.6.rst:2044 +#: ../../whatsnew/2.6.rst:2045 msgid "" "``combinations(iterable, r)`` returns sub-sequences of length *r* from the " "elements of *iterable*. ::" msgstr "" -#: ../../whatsnew/2.6.rst:2055 +#: ../../whatsnew/2.6.rst:2056 msgid "" "``permutations(iter[, r])`` returns all the permutations of length *r* of " "the iterable's elements. If *r* is not specified, it will default to the " "number of elements produced by the iterable. ::" msgstr "" -#: ../../whatsnew/2.6.rst:2065 +#: ../../whatsnew/2.6.rst:2066 msgid "" "``itertools.chain(*iterables)`` is an existing function in :mod:`itertools` " "that gained a new constructor in Python 2.6. ``itertools.chain." @@ -2263,11 +2264,11 @@ msgid "" "iterable, then all the elements of the second, and so on. ::" msgstr "" -#: ../../whatsnew/2.6.rst:2075 +#: ../../whatsnew/2.6.rst:2076 msgid "(All contributed by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:2077 +#: ../../whatsnew/2.6.rst:2078 msgid "" "The :mod:`logging` module's :class:`FileHandler` class and its subclasses :" "class:`WatchedFileHandler`, :class:`RotatingFileHandler`, and :class:" @@ -2276,68 +2277,68 @@ msgid "" "the first :meth:`emit` call is made. (Contributed by Vinay Sajip.)" msgstr "" -#: ../../whatsnew/2.6.rst:2084 +#: ../../whatsnew/2.6.rst:2085 msgid "" ":class:`TimedRotatingFileHandler` also has a *utc* constructor parameter. " "If the argument is true, UTC time will be used in determining when midnight " "occurs and in generating filenames; otherwise local time will be used." msgstr "" -#: ../../whatsnew/2.6.rst:2089 +#: ../../whatsnew/2.6.rst:2090 msgid "Several new functions were added to the :mod:`math` module:" msgstr "" -#: ../../whatsnew/2.6.rst:2091 +#: ../../whatsnew/2.6.rst:2092 msgid "" ":func:`~math.isinf` and :func:`~math.isnan` determine whether a given float " "is a (positive or negative) infinity or a NaN (Not a Number), respectively." msgstr "" -#: ../../whatsnew/2.6.rst:2094 +#: ../../whatsnew/2.6.rst:2095 msgid "" ":func:`~math.copysign` copies the sign bit of an IEEE 754 number, returning " "the absolute value of *x* combined with the sign bit of *y*. For example, " "``math.copysign(1, -0.0)`` returns -1.0. (Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:2099 +#: ../../whatsnew/2.6.rst:2100 msgid "" ":func:`~math.factorial` computes the factorial of a number. (Contributed by " "Raymond Hettinger; :issue:`2138`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2102 +#: ../../whatsnew/2.6.rst:2103 msgid "" ":func:`~math.fsum` adds up the stream of numbers from an iterable, and is " "careful to avoid loss of precision through using partial sums. (Contributed " "by Jean Brouwers, Raymond Hettinger, and Mark Dickinson; :issue:`2819`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2107 +#: ../../whatsnew/2.6.rst:2108 msgid "" ":func:`~math.acosh`, :func:`~math.asinh` and :func:`~math.atanh` compute the " "inverse hyperbolic functions." msgstr "" -#: ../../whatsnew/2.6.rst:2110 +#: ../../whatsnew/2.6.rst:2111 msgid ":func:`~math.log1p` returns the natural logarithm of *1+x* (base *e*)." msgstr "" -#: ../../whatsnew/2.6.rst:2113 +#: ../../whatsnew/2.6.rst:2114 msgid "" ":func:`trunc` rounds a number toward zero, returning the closest :class:" "`Integral` that's between the function's argument and zero. Added as part of " "the backport of `PEP 3141's type hierarchy for numbers <#pep-3141>`__." msgstr "" -#: ../../whatsnew/2.6.rst:2118 +#: ../../whatsnew/2.6.rst:2119 msgid "" "The :mod:`math` module has been improved to give more consistent behaviour " "across platforms, especially with respect to handling of floating-point " "exceptions and IEEE 754 special values." msgstr "" -#: ../../whatsnew/2.6.rst:2122 +#: ../../whatsnew/2.6.rst:2123 msgid "" "Whenever possible, the module follows the recommendations of the C99 " "standard about 754's special values. For example, ``sqrt(-1.)`` should now " @@ -2349,11 +2350,11 @@ msgid "" "`OverflowError`. (See :issue:`711019` and :issue:`1640`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2132 +#: ../../whatsnew/2.6.rst:2133 msgid "(Contributed by Christian Heimes and Mark Dickinson.)" msgstr "(由 Christian Heimes 和 Mark Dickinson 所貢獻。)" -#: ../../whatsnew/2.6.rst:2134 +#: ../../whatsnew/2.6.rst:2135 msgid "" ":class:`~mmap.mmap` objects now have a :meth:`rfind` method that searches " "for a substring beginning at the end of the string and searching backwards. " @@ -2361,28 +2362,28 @@ msgid "" "which to stop searching. (Contributed by John Lenton.)" msgstr "" -#: ../../whatsnew/2.6.rst:2140 +#: ../../whatsnew/2.6.rst:2141 msgid "" "The :mod:`operator` module gained a :func:`methodcaller` function that takes " "a name and an optional set of arguments, returning a callable that will call " "the named function on any arguments passed to it. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:2150 +#: ../../whatsnew/2.6.rst:2151 msgid "(Contributed by Georg Brandl, after a suggestion by Gregory Petrosyan.)" msgstr "(經 Gregory Petrosyan 建議後由 Georg Brandl 所貢獻。)" -#: ../../whatsnew/2.6.rst:2152 +#: ../../whatsnew/2.6.rst:2153 msgid "" "The :func:`attrgetter` function now accepts dotted names and performs the " "corresponding attribute lookups::" msgstr "" -#: ../../whatsnew/2.6.rst:2162 +#: ../../whatsnew/2.6.rst:2163 msgid "(Contributed by Georg Brandl, after a suggestion by Barry Warsaw.)" msgstr "(經 Barry Warsaw 建議後由 Georg Brandl 所貢獻。)" -#: ../../whatsnew/2.6.rst:2164 +#: ../../whatsnew/2.6.rst:2165 msgid "" "The :mod:`os` module now wraps several new system calls. ``fchmod(fd, " "mode)`` and ``fchown(fd, uid, gid)`` change the mode and ownership of an " @@ -2390,7 +2391,7 @@ msgid "" "(Contributed by Georg Brandl and Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:2170 +#: ../../whatsnew/2.6.rst:2171 msgid "" ":func:`chflags` and :func:`lchflags` are wrappers for the corresponding " "system calls (where they're available), changing the flags set on a file. " @@ -2400,7 +2401,7 @@ msgid "" "the file. (Contributed by M. Levinson.)" msgstr "" -#: ../../whatsnew/2.6.rst:2178 +#: ../../whatsnew/2.6.rst:2179 msgid "" "``os.closerange(low, high)`` efficiently closes all file descriptors from " "*low* to *high*, ignoring any errors and not including *high* itself. This " @@ -2408,14 +2409,14 @@ msgid "" "processes faster. (Contributed by Georg Brandl; :issue:`1663329`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2183 +#: ../../whatsnew/2.6.rst:2184 msgid "" "The ``os.environ`` object's :meth:`clear` method will now unset the " "environment variables using :func:`os.unsetenv` in addition to clearing the " "object's keys. (Contributed by Martin Horcicka; :issue:`1181`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2187 +#: ../../whatsnew/2.6.rst:2188 msgid "" "The :func:`os.walk` function now has a ``followlinks`` parameter. If set to " "True, it will follow symlinks pointing to directories and visit the " @@ -2424,7 +2425,7 @@ msgid "" "if there's a symlink that points to a parent directory. (:issue:`1273829`)" msgstr "" -#: ../../whatsnew/2.6.rst:2194 +#: ../../whatsnew/2.6.rst:2195 msgid "" "In the :mod:`os.path` module, the :func:`splitext` function has been changed " "to not split on leading period characters. This produces better results when " @@ -2433,7 +2434,7 @@ msgid "" "`1115886`)" msgstr "" -#: ../../whatsnew/2.6.rst:2201 +#: ../../whatsnew/2.6.rst:2202 msgid "" "A new function, ``os.path.relpath(path, start='.')``, returns a relative " "path from the ``start`` path, if it's supplied, or from the current working " @@ -2441,14 +2442,14 @@ msgid "" "issue:`1339796`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2206 +#: ../../whatsnew/2.6.rst:2207 msgid "" "On Windows, :func:`os.path.expandvars` will now expand environment variables " "given 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:2211 +#: ../../whatsnew/2.6.rst:2212 msgid "" "The Python debugger provided by the :mod:`pdb` module gained a new command: " "\"run\" restarts the Python program being debugged and can optionally take " @@ -2456,14 +2457,14 @@ msgid "" "Bernstein; :issue:`1393667`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2216 +#: ../../whatsnew/2.6.rst:2217 msgid "" "The :func:`pdb.post_mortem` function, used to begin debugging a traceback, " "will now use the traceback returned by :func:`sys.exc_info` if no traceback " "is supplied. (Contributed by Facundo Batista; :issue:`1106316`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2221 +#: ../../whatsnew/2.6.rst:2222 msgid "" "The :mod:`pickletools` module now has an :func:`optimize` function that " "takes a string containing a pickle and removes some unused opcodes, " @@ -2471,25 +2472,25 @@ msgid "" "(Contributed by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:2226 +#: ../../whatsnew/2.6.rst:2227 msgid "" "A :func:`get_data` function was added to the :mod:`pkgutil` module that " "returns the contents of resource files included with an installed Python " "package. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:2241 +#: ../../whatsnew/2.6.rst:2242 msgid "(Contributed by Paul Moore; :issue:`2439`.)" msgstr "(由 Paul Moore 貢獻;:issue:`2439`。)" -#: ../../whatsnew/2.6.rst:2243 +#: ../../whatsnew/2.6.rst:2244 msgid "" "The :mod:`pyexpat` module's :class:`Parser` objects now allow setting their :" "attr:`buffer_size` attribute to change the size of the buffer used to hold " "character data. (Contributed by Achim Gaedke; :issue:`1137`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2248 +#: ../../whatsnew/2.6.rst:2249 msgid "" "The :mod:`Queue` module now provides queue variants that retrieve entries in " "different orders. The :class:`PriorityQueue` class stores queued items in a " @@ -2498,7 +2499,7 @@ msgid "" "(Contributed by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:2255 +#: ../../whatsnew/2.6.rst:2256 msgid "" "The :mod:`random` module's :class:`Random` objects can now be pickled on a " "32-bit system and unpickled on a 64-bit system, and vice versa. " @@ -2507,7 +2508,7 @@ msgid "" "(Contributed by Shawn Ligocki; :issue:`1727780`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2262 +#: ../../whatsnew/2.6.rst:2263 msgid "" "The new ``triangular(low, high, mode)`` function returns random numbers " "following a triangular distribution. The returned values are between *low* " @@ -2516,14 +2517,14 @@ msgid "" "der Laan and Raymond Hettinger; :issue:`1681432`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2269 +#: ../../whatsnew/2.6.rst:2270 msgid "" "Long regular expression searches carried out by the :mod:`re` module will " "check for signals being delivered, so time-consuming searches can now be " "interrupted. (Contributed by Josh Hoyt and Ralf Schmitt; :issue:`846388`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2274 +#: ../../whatsnew/2.6.rst:2275 msgid "" "The regular expression module is implemented by compiling bytecodes for a " "tiny regex-specific virtual machine. Untrusted code could create malicious " @@ -2532,14 +2533,14 @@ msgid "" "for Google App Engine; :issue:`3487`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2281 +#: ../../whatsnew/2.6.rst:2282 msgid "" "The :mod:`rlcompleter` module's :meth:`Completer.complete()` method will now " "ignore exceptions triggered while evaluating a name. (Fixed by Lorenz " "Quack; :issue:`2250`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2285 +#: ../../whatsnew/2.6.rst:2286 msgid "" "The :mod:`sched` module's :class:`scheduler` instances now have a read-only :" "attr:`queue` attribute that returns the contents of the scheduler's queue, " @@ -2547,7 +2548,7 @@ msgid "" "action, argument)``. (Contributed by Raymond Hettinger; :issue:`1861`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2291 +#: ../../whatsnew/2.6.rst:2292 msgid "" "The :mod:`select` module now has wrapper functions for the Linux :c:func:`!" "epoll` and BSD :c:func:`!kqueue` system calls. :meth:`modify` method was " @@ -2557,7 +2558,7 @@ msgid "" "Heimes; :issue:`1657`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2299 +#: ../../whatsnew/2.6.rst:2300 msgid "" "The :func:`shutil.copytree` function now has an optional *ignore* argument " "that takes a callable object. This callable will receive each directory " @@ -2565,7 +2566,7 @@ msgid "" "that will be ignored, not copied." msgstr "" -#: ../../whatsnew/2.6.rst:2304 +#: ../../whatsnew/2.6.rst:2305 msgid "" "The :mod:`shutil` module also provides an :func:`ignore_patterns` function " "for use with this new parameter. :func:`ignore_patterns` takes an arbitrary " @@ -2575,11 +2576,11 @@ msgid "" "Emacs backup files, which have names ending with '~'::" msgstr "" -#: ../../whatsnew/2.6.rst:2315 +#: ../../whatsnew/2.6.rst:2316 msgid "(Contributed by Tarek Ziadé; :issue:`2663`.)" msgstr "(由 Tarek Ziadé 貢獻;:issue:`2663`。)" -#: ../../whatsnew/2.6.rst:2317 +#: ../../whatsnew/2.6.rst:2318 msgid "" "Integrating signal handling with GUI handling event loops like those used by " "Tkinter or GTk+ has long been a problem; most software ends up polling, " @@ -2591,7 +2592,7 @@ msgid "" "descriptor." msgstr "" -#: ../../whatsnew/2.6.rst:2327 +#: ../../whatsnew/2.6.rst:2328 msgid "" "Event loops will use this by opening a pipe to create two descriptors, one " "for reading and one for writing. The writable descriptor will be passed to :" @@ -2601,18 +2602,18 @@ msgid "" "loop will be woken up, avoiding the need to poll." msgstr "" -#: ../../whatsnew/2.6.rst:2335 +#: ../../whatsnew/2.6.rst:2336 msgid "(Contributed by Adam Olsen; :issue:`1583`.)" msgstr "(由 Adam Olsen 貢獻;:issue:`1583`。)" -#: ../../whatsnew/2.6.rst:2337 +#: ../../whatsnew/2.6.rst:2338 msgid "" "The :func:`siginterrupt` function is now available from Python code, and " "allows changing whether signals can interrupt system calls or not. " "(Contributed by Ralf Schmitt.)" msgstr "" -#: ../../whatsnew/2.6.rst:2341 +#: ../../whatsnew/2.6.rst:2342 msgid "" "The :func:`setitimer` and :func:`getitimer` functions have also been added " "(where they're available). :func:`setitimer` allows setting interval timers " @@ -2621,7 +2622,7 @@ msgid "" "process+system time. (Contributed by Guilherme Polo; :issue:`2240`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2348 +#: ../../whatsnew/2.6.rst:2349 msgid "" "The :mod:`smtplib` module now supports SMTP over SSL thanks to the addition " "of the :class:`SMTP_SSL` class. This class supports an interface identical " @@ -2631,7 +2632,7 @@ msgid "" "seconds. (Contributed by Facundo Batista.)" msgstr "" -#: ../../whatsnew/2.6.rst:2356 +#: ../../whatsnew/2.6.rst:2357 msgid "" "An implementation of the LMTP protocol (:rfc:`2033`) was also added to the " "module. LMTP is used in place of SMTP when transferring e-mail between " @@ -2639,14 +2640,14 @@ msgid "" "issue:`957003`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2361 +#: ../../whatsnew/2.6.rst:2362 msgid "" ":meth:`SMTP.starttls` now complies with :rfc:`3207` and forgets any " "knowledge obtained from the server not obtained from the TLS negotiation " "itself. (Patch contributed by Bill Fenner; :issue:`829951`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2366 +#: ../../whatsnew/2.6.rst:2367 msgid "" "The :mod:`socket` module now supports TIPC (https://tipc.sourceforge.net/), " "a high-performance non-IP-based protocol designed for use in clustered " @@ -2654,7 +2655,7 @@ msgid "" "Bertogli; :issue:`1646`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2371 +#: ../../whatsnew/2.6.rst:2372 msgid "" "A new function, :func:`create_connection`, takes an address and connects to " "it using an optional timeout value, returning the connected socket object. " @@ -2664,7 +2665,7 @@ msgid "" "make your code work with IPv6." msgstr "" -#: ../../whatsnew/2.6.rst:2379 +#: ../../whatsnew/2.6.rst:2380 msgid "" "The base classes in the :mod:`SocketServer` module now support calling a :" "meth:`handle_timeout` method after a span of inactivity specified by the " @@ -2675,19 +2676,19 @@ msgid "" "`742598`, :issue:`1193577`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2388 +#: ../../whatsnew/2.6.rst:2389 msgid "" "The :mod:`sqlite3` module, maintained by Gerhard Häring, has been updated " "from version 2.3.2 in Python 2.5 to version 2.4.1." msgstr "" -#: ../../whatsnew/2.6.rst:2392 +#: ../../whatsnew/2.6.rst:2393 msgid "" "The :mod:`struct` module now supports the C99 :c:expr:`_Bool` type, using " "the format character ``'?'``. (Contributed by David Remahl.)" msgstr "" -#: ../../whatsnew/2.6.rst:2396 +#: ../../whatsnew/2.6.rst:2397 msgid "" "The :class:`Popen` objects provided by the :mod:`subprocess` module now " "have :meth:`terminate`, :meth:`kill`, and :meth:`send_signal` methods. On " @@ -2696,7 +2697,7 @@ msgid "" "`TerminateProcess`. (Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:2403 +#: ../../whatsnew/2.6.rst:2404 msgid "" "A new variable in the :mod:`sys` module, :attr:`float_info`, is an object " "containing information derived from the :file:`float.h` file about the " @@ -2706,7 +2707,7 @@ msgid "" "several others. (Contributed by Christian Heimes; :issue:`1534`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2411 +#: ../../whatsnew/2.6.rst:2412 msgid "" "Another new variable, :attr:`dont_write_bytecode`, controls whether Python " "writes any :file:`.pyc` or :file:`.pyo` files on importing a module. If this " @@ -2718,7 +2719,7 @@ msgid "" "written or not. (Contributed by Neal Norwitz and Georg Brandl.)" msgstr "" -#: ../../whatsnew/2.6.rst:2422 +#: ../../whatsnew/2.6.rst:2423 msgid "" "Information about the command-line arguments supplied to the Python " "interpreter is available by reading attributes of a named tuple available as " @@ -2727,7 +2728,7 @@ msgid "" "These attributes are all read-only. (Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:2430 +#: ../../whatsnew/2.6.rst:2431 msgid "" "A new function, :func:`getsizeof`, takes a Python object and returns the " "amount of memory used by the object, measured in bytes. Built-in objects " @@ -2736,14 +2737,14 @@ msgid "" "Schuppenies; :issue:`2898`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2437 +#: ../../whatsnew/2.6.rst:2438 msgid "" "It's now possible to determine the current profiler and tracer functions by " "calling :func:`sys.getprofile` and :func:`sys.gettrace`. (Contributed by " "Georg Brandl; :issue:`1648`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2441 +#: ../../whatsnew/2.6.rst:2442 msgid "" "The :mod:`tarfile` module now supports POSIX.1-2001 (pax) tarfiles in " "addition to the POSIX.1-1988 (ustar) and GNU tar formats that were already " @@ -2751,7 +2752,7 @@ msgid "" "to open a file using a different format::" msgstr "" -#: ../../whatsnew/2.6.rst:2449 +#: ../../whatsnew/2.6.rst:2450 msgid "" "The new ``encoding`` and ``errors`` parameters specify an encoding and an " "error handling scheme for character conversions. ``'strict'``, " @@ -2761,7 +2762,7 @@ msgid "" "PAX format supports Unicode filenames, defaulting to UTF-8 encoding.)" msgstr "" -#: ../../whatsnew/2.6.rst:2457 +#: ../../whatsnew/2.6.rst:2458 msgid "" "The :meth:`TarFile.add` method now accepts an ``exclude`` argument that's a " "function that can be used to exclude certain filenames from an archive. The " @@ -2771,18 +2772,18 @@ msgid "" "added directories." msgstr "" -#: ../../whatsnew/2.6.rst:2465 +#: ../../whatsnew/2.6.rst:2466 msgid "(All changes contributed by Lars Gustäbel)." msgstr "" -#: ../../whatsnew/2.6.rst:2467 +#: ../../whatsnew/2.6.rst:2468 msgid "" "An optional ``timeout`` parameter was added to the :class:`telnetlib.Telnet` " "class constructor, specifying a timeout measured in seconds. (Added by " "Facundo Batista.)" msgstr "" -#: ../../whatsnew/2.6.rst:2471 +#: ../../whatsnew/2.6.rst:2472 msgid "" "The :class:`tempfile.NamedTemporaryFile` class usually deletes the temporary " "file it created when the file is closed. This behaviour can now be changed " @@ -2790,7 +2791,7 @@ msgid "" "Miller; :issue:`1537850`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2476 +#: ../../whatsnew/2.6.rst:2477 msgid "" "A new class, :class:`SpooledTemporaryFile`, behaves like a temporary file " "but stores its data in memory until a maximum size is exceeded. On reaching " @@ -2798,7 +2799,7 @@ msgid "" "(Contributed by Dustin J. Mitchell.)" msgstr "" -#: ../../whatsnew/2.6.rst:2481 +#: ../../whatsnew/2.6.rst:2482 msgid "" "The :class:`NamedTemporaryFile` and :class:`SpooledTemporaryFile` classes " "both work as context managers, so you can write ``with tempfile." @@ -2806,7 +2807,7 @@ msgid "" "issue:`2021`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2486 +#: ../../whatsnew/2.6.rst:2487 msgid "" "The :mod:`test.test_support` module gained a number of context managers " "useful for writing tests. :func:`EnvironmentVarGuard` is a context manager " @@ -2814,7 +2815,7 @@ msgid "" "them to their old values." msgstr "" -#: ../../whatsnew/2.6.rst:2492 +#: ../../whatsnew/2.6.rst:2493 msgid "" "Another context manager, :class:`TransientResource`, can surround calls to " "resources that may or may not be available; it will catch and ignore a " @@ -2822,29 +2823,29 @@ msgid "" "certain failures when connecting to an external web site::" msgstr "" -#: ../../whatsnew/2.6.rst:2503 +#: ../../whatsnew/2.6.rst:2504 msgid "" "Finally, :func:`check_warnings` resets the :mod:`warning` module's warning " "filters and returns an object that will record all warning messages " "triggered (:issue:`3781`)::" msgstr "" -#: ../../whatsnew/2.6.rst:2513 +#: ../../whatsnew/2.6.rst:2514 msgid "(Contributed by Brett Cannon.)" msgstr "(由 Brett Cannon 貢獻。)" -#: ../../whatsnew/2.6.rst:2515 +#: ../../whatsnew/2.6.rst:2516 msgid "" "The :mod:`textwrap` module can now preserve existing whitespace at the " "beginnings and ends of the newly created lines by specifying " "``drop_whitespace=False`` as an argument::" msgstr "" -#: ../../whatsnew/2.6.rst:2534 +#: ../../whatsnew/2.6.rst:2535 msgid "(Contributed by Dwayne Bailey; :issue:`1581073`.)" msgstr "(由 Dwayne Bailey 貢獻;:issue:`1581073`。)" -#: ../../whatsnew/2.6.rst:2536 +#: ../../whatsnew/2.6.rst:2537 msgid "" "The :mod:`threading` module API is being changed to use properties such as :" "attr:`daemon` instead of :meth:`setDaemon` and :meth:`isDaemon` methods, and " @@ -2857,14 +2858,14 @@ msgid "" "Peterson.)" msgstr "" -#: ../../whatsnew/2.6.rst:2547 +#: ../../whatsnew/2.6.rst:2548 msgid "" "The :mod:`threading` module's :class:`Thread` objects gained an :attr:" "`ident` property that returns the thread's identifier, a nonzero integer. " "(Contributed by Gregory P. Smith; :issue:`2871`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2552 +#: ../../whatsnew/2.6.rst:2553 msgid "" "The :mod:`timeit` module now accepts callables as well as strings for the " "statement being timed and for the setup code. Two convenience functions were " @@ -2874,62 +2875,62 @@ msgid "" "issue:`1533909`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2561 +#: ../../whatsnew/2.6.rst:2562 msgid "" "The :mod:`Tkinter` module now accepts lists and tuples for options, " "separating the elements by spaces before passing the resulting value to Tcl/" "Tk. (Contributed by Guilherme Polo; :issue:`2906`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2566 +#: ../../whatsnew/2.6.rst:2567 msgid "" "The :mod:`turtle` module for turtle graphics was greatly enhanced by Gregor " "Lingl. New features in the module include:" msgstr "" -#: ../../whatsnew/2.6.rst:2569 +#: ../../whatsnew/2.6.rst:2570 msgid "Better animation of turtle movement and rotation." msgstr "" -#: ../../whatsnew/2.6.rst:2570 +#: ../../whatsnew/2.6.rst:2571 msgid "" "Control over turtle movement using the new :meth:`delay`, :meth:`tracer`, " "and :meth:`speed` methods." msgstr "" -#: ../../whatsnew/2.6.rst:2572 +#: ../../whatsnew/2.6.rst:2573 msgid "" "The ability to set new shapes for the turtle, and to define a new coordinate " "system." msgstr "" -#: ../../whatsnew/2.6.rst:2574 +#: ../../whatsnew/2.6.rst:2575 msgid "Turtles now have an :meth:`undo()` method that can roll back actions." msgstr "" -#: ../../whatsnew/2.6.rst:2575 +#: ../../whatsnew/2.6.rst:2576 msgid "" "Simple support for reacting to input events such as mouse and keyboard " "activity, making it possible to write simple games." msgstr "" -#: ../../whatsnew/2.6.rst:2577 +#: ../../whatsnew/2.6.rst:2578 msgid "" "A :file:`turtle.cfg` file can be used to customize the starting appearance " "of the turtle's screen." msgstr "" -#: ../../whatsnew/2.6.rst:2579 +#: ../../whatsnew/2.6.rst:2580 msgid "" "The module's docstrings can be replaced by new docstrings that have been " "translated into another language." msgstr "" -#: ../../whatsnew/2.6.rst:2582 +#: ../../whatsnew/2.6.rst:2583 msgid "(:issue:`1513695`)" msgstr "" -#: ../../whatsnew/2.6.rst:2584 +#: ../../whatsnew/2.6.rst:2585 msgid "" "An optional ``timeout`` parameter was added to the :func:`urllib.urlopen` " "function and the :class:`urllib.ftpwrapper` class constructor, as well as " @@ -2937,17 +2938,17 @@ msgid "" "measured in seconds. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:2597 +#: ../../whatsnew/2.6.rst:2598 msgid "(Added by Facundo Batista.)" msgstr "" -#: ../../whatsnew/2.6.rst:2599 +#: ../../whatsnew/2.6.rst:2600 msgid "" "The Unicode database provided by the :mod:`unicodedata` module has been " "updated to version 5.1.0. (Updated by Martin von Löwis; :issue:`3811`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2603 +#: ../../whatsnew/2.6.rst:2604 msgid "" "The :mod:`warnings` module's :func:`formatwarning` and :func:`showwarning` " "gained an optional *line* argument that can be used to supply the line of " @@ -2955,14 +2956,14 @@ msgid "" "of the :mod:`warnings` module in C code.)" msgstr "" -#: ../../whatsnew/2.6.rst:2608 +#: ../../whatsnew/2.6.rst:2609 msgid "" "A new function, :func:`catch_warnings`, is a context manager intended for " "testing purposes that lets you temporarily modify the warning filters and " "then restore their original values (:issue:`3781`)." msgstr "" -#: ../../whatsnew/2.6.rst:2612 +#: ../../whatsnew/2.6.rst:2613 msgid "" "The XML-RPC :class:`SimpleXMLRPCServer` and :class:`DocXMLRPCServer` classes " "can now be prevented from immediately opening and binding to their socket by " @@ -2973,7 +2974,7 @@ msgid "" "Peter Parente; :issue:`1599845`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2621 +#: ../../whatsnew/2.6.rst:2622 msgid "" ":class:`SimpleXMLRPCServer` also has a :attr:`_send_traceback_header` " "attribute; if true, the exception and formatted traceback are returned as " @@ -2984,7 +2985,7 @@ msgid "" "Code 2007.)" msgstr "" -#: ../../whatsnew/2.6.rst:2629 +#: ../../whatsnew/2.6.rst:2630 msgid "" "The :mod:`xmlrpclib` module no longer automatically converts :class:" "`datetime.date` and :class:`datetime.time` to the :class:`xmlrpclib." @@ -2996,18 +2997,18 @@ msgid "" "by Riku Lindblad; :issue:`2985`)." msgstr "" -#: ../../whatsnew/2.6.rst:2639 +#: ../../whatsnew/2.6.rst:2640 msgid "" "The :mod:`zipfile` module's :class:`ZipFile` class now has :meth:`extract` " "and :meth:`extractall` methods that will unpack a single file or all the " "files in the archive to the current directory, or to a specified directory::" msgstr "" -#: ../../whatsnew/2.6.rst:2653 +#: ../../whatsnew/2.6.rst:2654 msgid "(Contributed by Alan McIntyre; :issue:`467924`.)" msgstr "(由 Alan McIntyre 貢獻;:issue:`467924`。)" -#: ../../whatsnew/2.6.rst:2655 +#: ../../whatsnew/2.6.rst:2656 msgid "" "The :meth:`open`, :meth:`read` and :meth:`extract` methods can now take " "either a filename or a :class:`ZipInfo` object. This is useful when an " @@ -3015,17 +3016,17 @@ msgid "" "Horler; :issue:`1775025`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2660 +#: ../../whatsnew/2.6.rst:2661 msgid "" "Finally, :mod:`zipfile` now supports using Unicode filenames for archived " "files. (Contributed by Alexey Borzenkov; :issue:`1734346`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2667 +#: ../../whatsnew/2.6.rst:2668 msgid "The :mod:`ast` module" msgstr "" -#: ../../whatsnew/2.6.rst:2669 +#: ../../whatsnew/2.6.rst:2670 msgid "" "The :mod:`ast` module provides an Abstract Syntax Tree representation of " "Python code, and Armin Ronacher contributed a set of helper functions that " @@ -3033,17 +3034,17 @@ msgid "" "packages, code analyzers, and similar tools that process Python code." msgstr "" -#: ../../whatsnew/2.6.rst:2676 +#: ../../whatsnew/2.6.rst:2677 msgid "" "The :func:`parse` function takes an expression and returns an AST. The :func:" "`dump` function outputs a representation of a tree, suitable for debugging::" msgstr "" -#: ../../whatsnew/2.6.rst:2690 +#: ../../whatsnew/2.6.rst:2691 msgid "This outputs a deeply nested tree::" msgstr "" -#: ../../whatsnew/2.6.rst:2723 +#: ../../whatsnew/2.6.rst:2724 msgid "" "The :func:`literal_eval` method takes a string or an AST representing a " "literal expression, parses and evaluates it, and returns the resulting " @@ -3053,18 +3054,18 @@ msgid "" "an :func:`eval` call, :func:`literal_eval` will handle it safely::" msgstr "" -#: ../../whatsnew/2.6.rst:2739 +#: ../../whatsnew/2.6.rst:2740 msgid "" "The module also includes :class:`NodeVisitor` and :class:`NodeTransformer` " "classes for traversing and modifying an AST, and functions for common " "transformations such as changing line numbers." msgstr "" -#: ../../whatsnew/2.6.rst:2747 +#: ../../whatsnew/2.6.rst:2748 msgid "The :mod:`future_builtins` module" msgstr "" -#: ../../whatsnew/2.6.rst:2749 +#: ../../whatsnew/2.6.rst:2750 msgid "" "Python 3.0 makes many changes to the repertoire of built-in functions, and " "most of the changes can't be introduced in the Python 2.x series because " @@ -3073,24 +3074,24 @@ msgid "" "compatible code." msgstr "" -#: ../../whatsnew/2.6.rst:2756 +#: ../../whatsnew/2.6.rst:2757 msgid "The functions in this module currently include:" msgstr "" -#: ../../whatsnew/2.6.rst:2758 +#: ../../whatsnew/2.6.rst:2759 msgid "" "``ascii(obj)``: equivalent to :func:`repr`. In Python 3.0, :func:`repr` " "will return a Unicode string, while :func:`ascii` will return a pure ASCII " "bytestring." msgstr "" -#: ../../whatsnew/2.6.rst:2762 +#: ../../whatsnew/2.6.rst:2763 msgid "" "``filter(predicate, iterable)``, ``map(func, iterable1, ...)``: the 3.0 " "versions return iterators, unlike the 2.x builtins which return lists." msgstr "" -#: ../../whatsnew/2.6.rst:2766 +#: ../../whatsnew/2.6.rst:2767 msgid "" "``hex(value)``, ``oct(value)``: instead of calling the :meth:`__hex__` or :" "meth:`__oct__` methods, these versions will call the :meth:`__index__` " @@ -3098,11 +3099,11 @@ msgid "" "the new ``0o`` notation for its result." msgstr "" -#: ../../whatsnew/2.6.rst:2775 +#: ../../whatsnew/2.6.rst:2776 msgid "The :mod:`json` module: JavaScript Object Notation" msgstr "" -#: ../../whatsnew/2.6.rst:2777 +#: ../../whatsnew/2.6.rst:2778 msgid "" "The new :mod:`json` module supports the encoding and decoding of Python " "types in JSON (Javascript Object Notation). JSON is a lightweight " @@ -3110,34 +3111,34 @@ msgid "" "about JSON, see http://www.json.org." msgstr "" -#: ../../whatsnew/2.6.rst:2782 +#: ../../whatsnew/2.6.rst:2783 msgid "" ":mod:`json` comes with support for decoding and encoding most built-in " "Python types. The following example encodes and decodes a dictionary::" msgstr "" -#: ../../whatsnew/2.6.rst:2793 +#: ../../whatsnew/2.6.rst:2794 msgid "" "It's also possible to write your own decoders and encoders to support more " "types. Pretty-printing of the JSON strings is also supported." msgstr "" -#: ../../whatsnew/2.6.rst:2796 +#: ../../whatsnew/2.6.rst:2797 msgid ":mod:`json` (originally called simplejson) was written by Bob Ippolito." msgstr "" -#: ../../whatsnew/2.6.rst:2803 +#: ../../whatsnew/2.6.rst:2804 msgid "The :mod:`plistlib` module: A Property-List Parser" msgstr "" -#: ../../whatsnew/2.6.rst:2805 +#: ../../whatsnew/2.6.rst:2806 msgid "" "The ``.plist`` format is commonly used on Mac OS X to store basic data types " "(numbers, strings, lists, and dictionaries) by serializing them into an XML-" "based format. It resembles the XML-RPC serialization of data types." msgstr "" -#: ../../whatsnew/2.6.rst:2810 +#: ../../whatsnew/2.6.rst:2811 msgid "" "Despite being primarily used on Mac OS X, the format has nothing Mac-" "specific about it and the Python implementation works on any platform that " @@ -3145,33 +3146,33 @@ msgid "" "standard library." msgstr "" -#: ../../whatsnew/2.6.rst:2815 +#: ../../whatsnew/2.6.rst:2816 msgid "Using the module is simple::" msgstr "" -#: ../../whatsnew/2.6.rst:2842 +#: ../../whatsnew/2.6.rst:2843 msgid "ctypes Enhancements" msgstr "" -#: ../../whatsnew/2.6.rst:2844 +#: ../../whatsnew/2.6.rst:2845 msgid "" "Thomas Heller continued to maintain and enhance the :mod:`ctypes` module." msgstr "" -#: ../../whatsnew/2.6.rst:2847 +#: ../../whatsnew/2.6.rst:2848 msgid "" ":mod:`ctypes` now supports a :class:`c_bool` datatype that represents the " "C99 ``bool`` type. (Contributed by David Remahl; :issue:`1649190`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2851 +#: ../../whatsnew/2.6.rst:2852 msgid "" "The :mod:`ctypes` string, buffer and array types have improved support for " "extended slicing syntax, where various combinations of ``(start, stop, " "step)`` are supplied. (Implemented by Thomas Wouters.)" msgstr "" -#: ../../whatsnew/2.6.rst:2858 +#: ../../whatsnew/2.6.rst:2859 msgid "" "All :mod:`ctypes` data types now support :meth:`from_buffer` and :meth:" "`from_buffer_copy` methods that create a ctypes instance based on a provided " @@ -3179,14 +3180,14 @@ msgid "" "while :meth:`from_buffer` will share the same memory area." msgstr "" -#: ../../whatsnew/2.6.rst:2865 +#: ../../whatsnew/2.6.rst:2866 msgid "" "A new calling convention tells :mod:`ctypes` to clear the ``errno`` or Win32 " "LastError variables at the outset of each wrapped call. (Implemented by " "Thomas Heller; :issue:`1798`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2869 +#: ../../whatsnew/2.6.rst:2870 msgid "" "You can now retrieve the Unix ``errno`` variable after a function call. " "When creating a wrapped function, you can supply ``use_errno=True`` as a " @@ -3195,7 +3196,7 @@ msgid "" "error value." msgstr "" -#: ../../whatsnew/2.6.rst:2875 +#: ../../whatsnew/2.6.rst:2876 msgid "" "The Win32 LastError variable is similarly supported by the :func:`DLL`, :" "func:`OleDLL`, and :func:`WinDLL` functions. You supply " @@ -3203,18 +3204,18 @@ msgid "" "level methods :meth:`set_last_error` and :meth:`get_last_error`." msgstr "" -#: ../../whatsnew/2.6.rst:2881 +#: ../../whatsnew/2.6.rst:2882 msgid "" "The :func:`byref` function, used to retrieve a pointer to a ctypes instance, " "now has an optional *offset* parameter that is a byte count that will be " "added to the returned pointer." msgstr "" -#: ../../whatsnew/2.6.rst:2888 +#: ../../whatsnew/2.6.rst:2889 msgid "Improved SSL Support" msgstr "" -#: ../../whatsnew/2.6.rst:2890 +#: ../../whatsnew/2.6.rst:2891 msgid "" "Bill Janssen made extensive improvements to Python 2.6's support for the " "Secure Sockets Layer by adding a new module, :mod:`ssl`, that's built atop " @@ -3225,7 +3226,7 @@ msgid "" "removed and continues to work, though it will be removed in Python 3.0." msgstr "" -#: ../../whatsnew/2.6.rst:2899 +#: ../../whatsnew/2.6.rst:2900 msgid "" "To use the new module, you must first create a TCP connection in the usual " "way and then pass it to the :func:`ssl.wrap_socket` function. It's possible " @@ -3233,35 +3234,35 @@ msgid "" "by calling the :meth:`getpeercert` method." msgstr "" -#: ../../whatsnew/2.6.rst:2906 +#: ../../whatsnew/2.6.rst:2907 msgid "The documentation for the :mod:`ssl` module." msgstr "" -#: ../../whatsnew/2.6.rst:2911 +#: ../../whatsnew/2.6.rst:2912 msgid "Deprecations and Removals" msgstr "" -#: ../../whatsnew/2.6.rst:2913 ../../whatsnew/2.6.rst:3241 +#: ../../whatsnew/2.6.rst:2914 ../../whatsnew/2.6.rst:3242 msgid "" "String exceptions have been removed. Attempting to use them raises a :exc:" "`TypeError`." msgstr "" -#: ../../whatsnew/2.6.rst:2916 +#: ../../whatsnew/2.6.rst:2917 msgid "" "Changes to the :class:`Exception` interface as dictated by :pep:`352` " "continue to be made. For 2.6, the :attr:`message` attribute is being " "deprecated in favor of the :attr:`args` attribute." msgstr "" -#: ../../whatsnew/2.6.rst:2921 +#: ../../whatsnew/2.6.rst:2922 msgid "" "(3.0-warning mode) Python 3.0 will feature a reorganized standard library " "that will drop many outdated modules and rename others. Python 2.6 running " "in 3.0-warning mode will warn about these modules when they are imported." msgstr "" -#: ../../whatsnew/2.6.rst:2926 +#: ../../whatsnew/2.6.rst:2927 msgid "" "The list of deprecated modules is: :mod:`audiodev`, :mod:`bgenlocations`, :" "mod:`buildtools`, :mod:`bundlebuilder`, :mod:`Canvas`, :mod:`compiler`, :mod:" @@ -3271,59 +3272,59 @@ msgid "" "`statvfs`, :mod:`sunaudiodev`, :mod:`test.testall`, and :mod:`toaiff`." msgstr "" -#: ../../whatsnew/2.6.rst:2951 +#: ../../whatsnew/2.6.rst:2952 msgid "The :mod:`gopherlib` module has been removed." msgstr "" -#: ../../whatsnew/2.6.rst:2953 +#: ../../whatsnew/2.6.rst:2954 msgid "" "The :mod:`MimeWriter` module and :mod:`mimify` module have been deprecated; " "use the :mod:`email` package instead." msgstr "" -#: ../../whatsnew/2.6.rst:2957 +#: ../../whatsnew/2.6.rst:2958 msgid "" "The :mod:`md5` module has been deprecated; use the :mod:`hashlib` module " "instead." msgstr "" -#: ../../whatsnew/2.6.rst:2960 +#: ../../whatsnew/2.6.rst:2961 msgid "" "The :mod:`posixfile` module has been deprecated; :func:`fcntl.lockf` " "provides better locking." msgstr "" -#: ../../whatsnew/2.6.rst:2963 +#: ../../whatsnew/2.6.rst:2964 msgid "" "The :mod:`popen2` module has been deprecated; use the :mod:`subprocess` " "module." msgstr "" -#: ../../whatsnew/2.6.rst:2966 +#: ../../whatsnew/2.6.rst:2967 msgid "The :mod:`rgbimg` module has been removed." msgstr "" -#: ../../whatsnew/2.6.rst:2968 +#: ../../whatsnew/2.6.rst:2969 msgid "" "The :mod:`sets` module has been deprecated; it's better to use the built-in :" "class:`set` and :class:`frozenset` types." msgstr "" -#: ../../whatsnew/2.6.rst:2971 +#: ../../whatsnew/2.6.rst:2972 msgid "" "The :mod:`sha` module has been deprecated; use the :mod:`hashlib` module " "instead." msgstr "" -#: ../../whatsnew/2.6.rst:2979 +#: ../../whatsnew/2.6.rst:2980 msgid "Build and C API Changes" msgstr "" -#: ../../whatsnew/2.6.rst:2981 +#: ../../whatsnew/2.6.rst:2982 msgid "Changes to Python's build process and to the C API include:" msgstr "" -#: ../../whatsnew/2.6.rst:2983 +#: ../../whatsnew/2.6.rst:2984 msgid "" "Python now must be compiled with C89 compilers (after 19 years!). This " "means that the Python source tree has dropped its own implementations of :c:" @@ -3331,14 +3332,14 @@ msgid "" "library." msgstr "" -#: ../../whatsnew/2.6.rst:2988 +#: ../../whatsnew/2.6.rst:2989 msgid "" "Python 2.6 can be built with Microsoft Visual Studio 2008 (version 9.0), and " "this is the new default compiler. See the :file:`PCbuild` directory for the " "build files. (Implemented by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:2993 +#: ../../whatsnew/2.6.rst:2994 msgid "" "On Mac OS X, Python 2.6 can be compiled as a 4-way universal build. The :" "program:`configure` script can take a :option:`!--with-universal-archs=[32-" @@ -3347,21 +3348,21 @@ msgid "" "(Contributed by Ronald Oussoren.)" msgstr "" -#: ../../whatsnew/2.6.rst:3000 +#: ../../whatsnew/2.6.rst:3001 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:3005 +#: ../../whatsnew/2.6.rst:3006 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:3010 +#: ../../whatsnew/2.6.rst:3011 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 " @@ -3376,7 +3377,7 @@ msgid "" "Gregory P. Smith.)" msgstr "" -#: ../../whatsnew/2.6.rst:3023 +#: ../../whatsnew/2.6.rst:3024 msgid "" "Importing modules simultaneously in two different threads no longer " "deadlocks; it will now raise an :exc:`ImportError`. A new API function, :c:" @@ -3386,7 +3387,7 @@ msgid "" "(Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:3031 +#: ../../whatsnew/2.6.rst:3032 msgid "" "Several functions return information about the platform's floating-point " "support. :c:func:`PyFloat_GetMax` returns the maximum representable " @@ -3398,7 +3399,7 @@ msgid "" "by Christian Heimes; :issue:`1534`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3042 +#: ../../whatsnew/2.6.rst:3043 msgid "" "C functions and methods that use :c:func:`PyComplex_AsCComplex` will now " "accept arguments that have a :meth:`__complex__` method. In particular, the " @@ -3407,14 +3408,14 @@ msgid "" "Dickinson; :issue:`1675423`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3049 +#: ../../whatsnew/2.6.rst:3050 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:3054 +#: ../../whatsnew/2.6.rst:3055 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 " @@ -3423,7 +3424,7 @@ msgid "" "(Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:3061 +#: ../../whatsnew/2.6.rst:3062 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:" @@ -3432,14 +3433,14 @@ msgid "" "still available in Python 2.6 for backward compatibility. (:issue:`1629`)" msgstr "" -#: ../../whatsnew/2.6.rst:3070 +#: ../../whatsnew/2.6.rst:3071 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:3074 +#: ../../whatsnew/2.6.rst:3075 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 " @@ -3448,7 +3449,7 @@ msgid "" "``Py_MAXFREELIST`` is always defined." msgstr "" -#: ../../whatsnew/2.6.rst:3081 +#: ../../whatsnew/2.6.rst:3082 msgid "" "A new Makefile target, \"make patchcheck\", prepares the Python source tree " "for making a patch: it fixes trailing whitespace in all modified ``.py`` " @@ -3457,7 +3458,7 @@ msgid "" "(Contributed by Brett Cannon.)" msgstr "" -#: ../../whatsnew/2.6.rst:3088 +#: ../../whatsnew/2.6.rst:3089 msgid "" "Another new target, \"make profile-opt\", compiles a Python binary using " "GCC's profile-guided optimization. It compiles Python with profiling " @@ -3466,17 +3467,17 @@ msgid "" "Smith.)" msgstr "" -#: ../../whatsnew/2.6.rst:3097 +#: ../../whatsnew/2.6.rst:3098 msgid "Port-Specific Changes: Windows" msgstr "" -#: ../../whatsnew/2.6.rst:3099 +#: ../../whatsnew/2.6.rst:3100 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:3102 +#: ../../whatsnew/2.6.rst:3103 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 " @@ -3487,7 +3488,7 @@ msgid "" "Martin von Löwis.)" msgstr "" -#: ../../whatsnew/2.6.rst:3110 +#: ../../whatsnew/2.6.rst:3111 msgid "" "The :mod:`msvcrt` module now supports both the normal and wide char variants " "of the console I/O API. The :func:`getwch` function reads a keypress and " @@ -3496,20 +3497,20 @@ msgid "" "(Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:3117 +#: ../../whatsnew/2.6.rst:3118 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:3121 +#: ../../whatsnew/2.6.rst:3122 msgid "" "The :mod:`socket` module's socket objects now have an :meth:`ioctl` method " "that provides a limited interface to the :c:func:`WSAIoctl` system interface." msgstr "" -#: ../../whatsnew/2.6.rst:3125 +#: ../../whatsnew/2.6.rst:3126 msgid "" "The :mod:`_winreg` module now has a function, :func:" "`ExpandEnvironmentStrings`, that expands environment variable references " @@ -3518,7 +3519,7 @@ msgid "" "`with` statements. (Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:3132 +#: ../../whatsnew/2.6.rst:3133 msgid "" ":mod:`_winreg` also has better support for x64 systems, exposing the :func:" "`DisableReflectionKey`, :func:`EnableReflectionKey`, and :func:" @@ -3526,32 +3527,32 @@ msgid "" "for 32-bit processes running on 64-bit systems. (:issue:`1753245`)" msgstr "" -#: ../../whatsnew/2.6.rst:3138 +#: ../../whatsnew/2.6.rst:3139 msgid "" "The :mod:`msilib` module's :class:`Record` object gained :meth:`GetInteger` " "and :meth:`GetString` methods that return field values as an integer or a " "string. (Contributed by Floris Bruynooghe; :issue:`2125`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3146 +#: ../../whatsnew/2.6.rst:3147 msgid "Port-Specific Changes: Mac OS X" msgstr "" -#: ../../whatsnew/2.6.rst:3148 +#: ../../whatsnew/2.6.rst:3149 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:3153 +#: ../../whatsnew/2.6.rst:3154 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:3157 +#: ../../whatsnew/2.6.rst:3158 msgid "" "Many other Mac OS modules have been deprecated and will be removed in Python " "3.0: :mod:`_builtinSuites`, :mod:`aepack`, :mod:`aetools`, :mod:`aetypes`, :" @@ -3566,11 +3567,11 @@ msgid "" "`terminalcommand`." msgstr "" -#: ../../whatsnew/2.6.rst:3200 +#: ../../whatsnew/2.6.rst:3201 msgid "Port-Specific Changes: IRIX" msgstr "" -#: ../../whatsnew/2.6.rst:3202 +#: ../../whatsnew/2.6.rst:3203 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:" @@ -3581,30 +3582,30 @@ msgid "" "`videoreader`, and :mod:`WAIT`." msgstr "" -#: ../../whatsnew/2.6.rst:3232 +#: ../../whatsnew/2.6.rst:3233 msgid "Porting to Python 2.6" msgstr "" -#: ../../whatsnew/2.6.rst:3234 +#: ../../whatsnew/2.6.rst:3235 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code:" msgstr "" -#: ../../whatsnew/2.6.rst:3237 +#: ../../whatsnew/2.6.rst:3238 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:3244 +#: ../../whatsnew/2.6.rst:3245 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:3249 +#: ../../whatsnew/2.6.rst:3250 msgid "" ":meth:`object.__init__` previously accepted arbitrary arguments and keyword " "arguments, ignoring them. In Python 2.6, this is no longer allowed and will " @@ -3613,7 +3614,7 @@ msgid "" "through using :func:`super`). See :issue:`1683368` for discussion." msgstr "" -#: ../../whatsnew/2.6.rst:3256 +#: ../../whatsnew/2.6.rst:3257 msgid "" "The :class:`Decimal` constructor now accepts leading and trailing whitespace " "when passed a string. Previously it would raise an :exc:`InvalidOperation` " @@ -3622,7 +3623,7 @@ msgid "" "`ConversionSyntax` exception." msgstr "" -#: ../../whatsnew/2.6.rst:3263 +#: ../../whatsnew/2.6.rst:3264 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 " @@ -3630,20 +3631,20 @@ msgid "" "explicitly checks for this case and raises an :exc:`ImportError`." msgstr "" -#: ../../whatsnew/2.6.rst:3269 +#: ../../whatsnew/2.6.rst:3270 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:3273 +#: ../../whatsnew/2.6.rst:3274 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:3277 +#: ../../whatsnew/2.6.rst:3278 msgid "" "The :mod:`socket` module exception :exc:`socket.error` now inherits from :" "exc:`IOError`. Previously it wasn't a subclass of :exc:`StandardError` but " @@ -3651,7 +3652,7 @@ msgid "" "`1706815`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3282 +#: ../../whatsnew/2.6.rst:3283 msgid "" "The :mod:`xmlrpclib` module no longer automatically converts :class:" "`datetime.date` and :class:`datetime.time` to the :class:`xmlrpclib." @@ -3660,32 +3661,32 @@ msgid "" "and :class:`~datetime.time` instances. (:issue:`1330538`)" msgstr "" -#: ../../whatsnew/2.6.rst:3289 +#: ../../whatsnew/2.6.rst:3290 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:3293 +#: ../../whatsnew/2.6.rst:3294 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:3298 +#: ../../whatsnew/2.6.rst:3299 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:3308 +#: ../../whatsnew/2.6.rst:3309 msgid "Acknowledgements" msgstr "致謝" -#: ../../whatsnew/2.6.rst:3310 +#: ../../whatsnew/2.6.rst:3311 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/2.7.po b/whatsnew/2.7.po index 779dd14c01..6686fb3543 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-20 00:03+0000\n" +"POT-Creation-Date: 2023-12-04 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-" @@ -877,18 +877,18 @@ msgstr "" msgid "" "When using ``@classmethod`` and ``@staticmethod`` to wrap methods as class " "or static methods, the wrapper object now exposes the wrapped function as " -"their :attr:`__func__` attribute. (Contributed by Amaury Forgeot d'Arc, " -"after a suggestion by George Sakkis; :issue:`5982`.)" +"their :ref:`__func__ ` attribute. (Contributed by Amaury " +"Forgeot d'Arc, after a suggestion by George Sakkis; :issue:`5982`.)" msgstr "" -#: ../../whatsnew/2.7.rst:867 ../../whatsnew/2.7.rst:2463 +#: ../../whatsnew/2.7.rst:868 ../../whatsnew/2.7.rst:2464 msgid "" "When a restricted set of attributes were set using ``__slots__``, deleting " "an unset attribute would not raise :exc:`AttributeError` as you would " "expect. Fixed by Benjamin Peterson; :issue:`7604`.)" msgstr "" -#: ../../whatsnew/2.7.rst:871 +#: ../../whatsnew/2.7.rst:872 msgid "" "Two new encodings are now supported: \"cp720\", used primarily for Arabic " "text; and \"cp858\", a variant of CP 850 that adds the euro symbol. (CP720 " @@ -896,7 +896,7 @@ msgid "" "`1616979`; CP858 contributed by Tim Hatch in :issue:`8016`.)" msgstr "" -#: ../../whatsnew/2.7.rst:877 +#: ../../whatsnew/2.7.rst:878 msgid "" "The :class:`file` object will now set the :attr:`filename` attribute on the :" "exc:`IOError` exception when trying to open a directory on POSIX platforms " @@ -905,7 +905,7 @@ msgid "" "to catch and report the error (fixed by Stefan Krah; :issue:`5677`)." msgstr "" -#: ../../whatsnew/2.7.rst:884 +#: ../../whatsnew/2.7.rst:885 msgid "" "The Python tokenizer now translates line endings itself, so the :func:" "`compile` built-in function now accepts code using any line-ending " @@ -913,7 +913,7 @@ msgid "" "newline." msgstr "" -#: ../../whatsnew/2.7.rst:889 +#: ../../whatsnew/2.7.rst:890 msgid "" "Extra parentheses in function definitions are illegal in Python 3.x, meaning " "that you get a syntax error from ``def f((x)): pass``. In Python3-warning " @@ -921,25 +921,25 @@ msgid "" "Lingard; :issue:`7362`.)" msgstr "" -#: ../../whatsnew/2.7.rst:894 +#: ../../whatsnew/2.7.rst:895 msgid "" "It's now possible to create weak references to old-style class objects. New-" "style classes were always weak-referenceable. (Fixed by Antoine Pitrou; :" "issue:`8268`.)" msgstr "" -#: ../../whatsnew/2.7.rst:898 +#: ../../whatsnew/2.7.rst:899 msgid "" "When a module object is garbage-collected, the module's dictionary is now " "only cleared if no one else is holding a reference to the dictionary (:issue:" "`7140`)." msgstr "" -#: ../../whatsnew/2.7.rst:907 +#: ../../whatsnew/2.7.rst:908 msgid "Interpreter Changes" msgstr "" -#: ../../whatsnew/2.7.rst:909 +#: ../../whatsnew/2.7.rst:910 msgid "" "A new environment variable, :envvar:`PYTHONWARNINGS`, allows controlling " "warnings. It should be set to a string containing warning settings, " @@ -947,7 +947,7 @@ msgid "" "(Contributed by Brian Curtin; :issue:`7301`.)" msgstr "" -#: ../../whatsnew/2.7.rst:915 +#: ../../whatsnew/2.7.rst:916 msgid "" "For example, the following setting will print warnings every time they " "occur, but turn warnings from the :mod:`Cookie` module into an error. (The " @@ -955,22 +955,22 @@ msgid "" "systems and shells.)" msgstr "" -#: ../../whatsnew/2.7.rst:928 +#: ../../whatsnew/2.7.rst:929 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/2.7.rst:930 +#: ../../whatsnew/2.7.rst:931 msgid "Several performance enhancements have been added:" msgstr "" -#: ../../whatsnew/2.7.rst:932 +#: ../../whatsnew/2.7.rst:933 msgid "" "A new opcode was added to perform the initial setup for :keyword:`with` " "statements, looking up the :meth:`~object.__enter__` and :meth:`~object." "__exit__` methods. (Contributed by Benjamin Peterson.)" msgstr "" -#: ../../whatsnew/2.7.rst:936 +#: ../../whatsnew/2.7.rst:937 msgid "" "The garbage collector now performs better for one common usage pattern: when " "many objects are being allocated without deallocating any of them. This " @@ -983,7 +983,7 @@ msgid "" "implemented by Antoine Pitrou; :issue:`4074`.)" msgstr "" -#: ../../whatsnew/2.7.rst:947 +#: ../../whatsnew/2.7.rst:948 msgid "" "The garbage collector tries to avoid tracking simple containers which can't " "be part of a cycle. In Python 2.7, this is now true for tuples and dicts " @@ -994,7 +994,7 @@ msgid "" "Pitrou; :issue:`4688`.)" msgstr "" -#: ../../whatsnew/2.7.rst:956 +#: ../../whatsnew/2.7.rst:957 msgid "" "Long integers are now stored internally either in base ``2**15`` or in base " "``2**30``, the base being determined at build time. Previously, they were " @@ -1006,7 +1006,7 @@ msgid "" "override this default." msgstr "" -#: ../../whatsnew/2.7.rst:965 +#: ../../whatsnew/2.7.rst:966 msgid "" "Apart from the performance improvements this change should be invisible to " "end users, with one exception: for testing and debugging purposes there's a " @@ -1015,18 +1015,18 @@ msgid "" "of the C type used to store each digit::" msgstr "" -#: ../../whatsnew/2.7.rst:976 +#: ../../whatsnew/2.7.rst:977 msgid "(Contributed by Mark Dickinson; :issue:`4258`.)" msgstr "(由 Mark Dickinson 貢獻;:issue:`4258`。)" -#: ../../whatsnew/2.7.rst:978 +#: ../../whatsnew/2.7.rst:979 msgid "" "Another set of changes made long objects a few bytes smaller: 2 bytes " "smaller on 32-bit systems and 6 bytes on 64-bit. (Contributed by Mark " "Dickinson; :issue:`5260`.)" msgstr "" -#: ../../whatsnew/2.7.rst:982 +#: ../../whatsnew/2.7.rst:983 msgid "" "The division algorithm for long integers has been made faster by tightening " "the inner loop, doing shifts instead of multiplications, and fixing an " @@ -1036,7 +1036,7 @@ msgid "" "faster (initial patch by Gregory Smith; :issue:`1087418`)." msgstr "" -#: ../../whatsnew/2.7.rst:991 +#: ../../whatsnew/2.7.rst:992 msgid "" "The implementation of ``%`` checks for the left-side operand being a Python " "string and special-cases it; this results in a 1--3% performance increase " @@ -1044,21 +1044,21 @@ msgid "" "libraries. (Implemented by Collin Winter; :issue:`5176`.)" msgstr "" -#: ../../whatsnew/2.7.rst:997 +#: ../../whatsnew/2.7.rst:998 msgid "" "List comprehensions with an ``if`` condition are compiled into faster " "bytecode. (Patch by Antoine Pitrou, back-ported to 2.7 by Jeffrey Yasskin; :" "issue:`4715`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1001 +#: ../../whatsnew/2.7.rst:1002 msgid "" "Converting an integer or long integer to a decimal string was made faster by " "special-casing base 10 instead of using a generalized conversion function " "that supports arbitrary bases. (Patch by Gawain Bolton; :issue:`6713`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1006 +#: ../../whatsnew/2.7.rst:1007 msgid "" "The :meth:`split`, :meth:`replace`, :meth:`rindex`, :meth:`rpartition`, and :" "meth:`rsplit` methods of string-like types (strings, Unicode strings, and :" @@ -1067,24 +1067,24 @@ msgid "" "10. (Added by Florent Xicluna; :issue:`7462` and :issue:`7622`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1013 +#: ../../whatsnew/2.7.rst:1014 msgid "" "The :mod:`pickle` and :mod:`cPickle` modules now automatically intern the " "strings used for attribute names, reducing memory usage of the objects " "resulting from unpickling. (Contributed by Jake McGuire; :issue:`5084`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1018 +#: ../../whatsnew/2.7.rst:1019 msgid "" "The :mod:`cPickle` module now special-cases dictionaries, nearly halving the " "time required to pickle them. (Contributed by Collin Winter; :issue:`5670`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1025 +#: ../../whatsnew/2.7.rst:1026 msgid "New and Improved Modules" msgstr "" -#: ../../whatsnew/2.7.rst:1027 +#: ../../whatsnew/2.7.rst:1028 msgid "" "As in every release, Python's standard library received a number of " "enhancements and bug fixes. Here's a partial list of the most notable " @@ -1093,7 +1093,7 @@ msgid "" "the Subversion logs for all the details." msgstr "" -#: ../../whatsnew/2.7.rst:1033 +#: ../../whatsnew/2.7.rst:1034 msgid "" "The :mod:`bdb` module's base debugging class :class:`~bdb.Bdb` gained a " "feature for skipping modules. The constructor now takes an iterable " @@ -1103,14 +1103,14 @@ msgid "" "`5142`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1041 +#: ../../whatsnew/2.7.rst:1042 msgid "" "The :mod:`binascii` module now supports the buffer API, so it can be used " "with :class:`memoryview` instances and other similar buffer objects. " "(Backported from 3.x by Florent Xicluna; :issue:`7703`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1045 +#: ../../whatsnew/2.7.rst:1046 msgid "" "Updated module: the :mod:`bsddb` module has been updated from 4.7.2devel9 to " "version 4.8.4 of `the pybsddb package ``, ``>=``) between fractions and " "complex numbers now raise a :exc:`TypeError`. This fixes an oversight, " "making the :class:`~fractions.Fraction` match the other numeric types." msgstr "" -#: ../../whatsnew/2.7.rst:1258 +#: ../../whatsnew/2.7.rst:1259 msgid "" "New class: :class:`~ftplib.FTP_TLS` in the :mod:`ftplib` module provides " "secure FTP connections using TLS encapsulation of authentication as well as " @@ -1346,14 +1346,14 @@ msgid "" "issue:`2054`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1264 +#: ../../whatsnew/2.7.rst:1265 msgid "" "The :meth:`~ftplib.FTP.storbinary` method for binary uploads can now restart " "uploads thanks to an added *rest* parameter (patch by Pablo Mouzo; :issue:" "`6845`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1268 +#: ../../whatsnew/2.7.rst:1269 msgid "" "New class decorator: :func:`~functools.total_ordering` in the :mod:" "`functools` module takes a class that defines an :meth:`__eq__` method and " @@ -1363,7 +1363,7 @@ msgid "" "define ordered classes. (Added by Raymond Hettinger; :issue:`5479`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1276 +#: ../../whatsnew/2.7.rst:1277 msgid "" "New function: :func:`~functools.cmp_to_key` will take an old-style " "comparison function that expects two arguments and return a new callable " @@ -1373,14 +1373,14 @@ msgid "" "Hettinger.)" msgstr "" -#: ../../whatsnew/2.7.rst:1283 +#: ../../whatsnew/2.7.rst:1284 msgid "" "New function: the :mod:`gc` module's :func:`~gc.is_tracked` returns true if " "a given instance is tracked by the garbage collector, false otherwise. " "(Contributed by Antoine Pitrou; :issue:`4688`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1287 +#: ../../whatsnew/2.7.rst:1288 msgid "" "The :mod:`gzip` module's :class:`~gzip.GzipFile` now supports the context " "management protocol, so you can write ``with gzip.GzipFile(...) as f:`` " @@ -1392,14 +1392,14 @@ msgid "" "(Contributed by Jacques Frechet; :issue:`4272`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1297 +#: ../../whatsnew/2.7.rst:1298 msgid "" "Files in gzip format can be padded with trailing zero bytes; the :mod:`gzip` " "module will now consume these trailing bytes. (Fixed by Tadek Pietraszek " "and Brian Curtin; :issue:`2846`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1301 +#: ../../whatsnew/2.7.rst:1302 msgid "" "New attribute: the :mod:`hashlib` module now has an :attr:`~hashlib.hashlib." "algorithms` attribute containing a tuple naming the supported algorithms. In " @@ -1407,14 +1407,14 @@ msgid "" "'sha256', 'sha384', 'sha512')``. (Contributed by Carl Chenet; :issue:`7418`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1307 +#: ../../whatsnew/2.7.rst:1308 msgid "" "The default :class:`~httplib.HTTPResponse` class used by the :mod:`httplib` " "module now supports buffering, resulting in much faster reading of HTTP " "responses. (Contributed by Kristján Valur Jónsson; :issue:`4879`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1311 +#: ../../whatsnew/2.7.rst:1312 msgid "" "The :class:`~httplib.HTTPConnection` and :class:`~httplib.HTTPSConnection` " "classes now support a *source_address* parameter, a ``(host, port)`` 2-tuple " @@ -1422,7 +1422,7 @@ msgid "" "by Eldon Ziegler; :issue:`3972`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1316 +#: ../../whatsnew/2.7.rst:1317 msgid "" "The :mod:`ihooks` module now supports relative imports. Note that :mod:" "`ihooks` is an older module for customizing imports, superseded by the :mod:" @@ -1430,13 +1430,13 @@ msgid "" "Schemenauer.)" msgstr "" -#: ../../whatsnew/2.7.rst:1323 +#: ../../whatsnew/2.7.rst:1324 msgid "" "The :mod:`imaplib` module now supports IPv6 addresses. (Contributed by Derek " "Morr; :issue:`1655`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1326 +#: ../../whatsnew/2.7.rst:1327 msgid "" "New function: the :mod:`inspect` module's :func:`~inspect.getcallargs` takes " "a callable and its positional and keyword arguments, and figures out which " @@ -1444,11 +1444,11 @@ msgid "" "dictionary mapping argument names to their values. For example::" msgstr "" -#: ../../whatsnew/2.7.rst:1344 +#: ../../whatsnew/2.7.rst:1345 msgid "Contributed by George Sakkis; :issue:`3135`." msgstr "" -#: ../../whatsnew/2.7.rst:1346 +#: ../../whatsnew/2.7.rst:1347 msgid "" "Updated module: The :mod:`io` library has been upgraded to the version " "shipped with Python 3.1. For 3.1, the I/O library was entirely rewritten in " @@ -1456,14 +1456,14 @@ msgid "" "original Python version was renamed to the :mod:`_pyio` module." msgstr "" -#: ../../whatsnew/2.7.rst:1351 +#: ../../whatsnew/2.7.rst:1352 msgid "" "One minor resulting change: the :class:`io.TextIOBase` class now has an :" "attr:`errors` attribute giving the error setting used for encoding and " "decoding errors (one of ``'strict'``, ``'replace'``, ``'ignore'``)." msgstr "" -#: ../../whatsnew/2.7.rst:1356 +#: ../../whatsnew/2.7.rst:1357 msgid "" "The :class:`io.FileIO` class now raises an :exc:`OSError` when passed an " "invalid file descriptor. (Implemented by Benjamin Peterson; :issue:" @@ -1472,14 +1472,14 @@ msgid "" "file. (Fixed by Pascal Chambon; :issue:`6939`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1362 +#: ../../whatsnew/2.7.rst:1363 msgid "" "New function: ``itertools.compress(data, selectors)`` takes two iterators. " "Elements of *data* are returned if the corresponding value in *selectors* is " "true::" msgstr "" -#: ../../whatsnew/2.7.rst:1371 +#: ../../whatsnew/2.7.rst:1372 msgid "" "New function: ``itertools.combinations_with_replacement(iter, r)`` returns " "all the possible *r*-length combinations of elements from the iterable " @@ -1487,13 +1487,13 @@ msgid "" "repeated in the generated combinations::" msgstr "" -#: ../../whatsnew/2.7.rst:1380 +#: ../../whatsnew/2.7.rst:1381 msgid "" "Note that elements are treated as unique depending on their position in the " "input, not their actual values." msgstr "" -#: ../../whatsnew/2.7.rst:1383 +#: ../../whatsnew/2.7.rst:1384 msgid "" "The :func:`itertools.count` function now has a *step* argument that allows " "incrementing by values other than 1. :func:`~itertools.count` also now " @@ -1502,7 +1502,7 @@ msgid "" "issue:`5032`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1389 +#: ../../whatsnew/2.7.rst:1390 msgid "" ":func:`itertools.combinations` and :func:`itertools.product` previously " "raised :exc:`ValueError` for values of *r* larger than the input iterable. " @@ -1510,14 +1510,14 @@ msgid "" "iterator. (Fixed by Raymond Hettinger; :issue:`4816`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1394 +#: ../../whatsnew/2.7.rst:1395 msgid "" "Updated module: The :mod:`json` module was upgraded to version 2.0.9 of the " "simplejson package, which includes a C extension that makes encoding and " "decoding faster. (Contributed by Bob Ippolito; :issue:`4136`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1399 +#: ../../whatsnew/2.7.rst:1400 msgid "" "To support the new :class:`collections.OrderedDict` type, :func:`json.load` " "now has an optional *object_pairs_hook* parameter that will be called with " @@ -1525,7 +1525,7 @@ msgid "" "Hettinger; :issue:`5381`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1404 +#: ../../whatsnew/2.7.rst:1405 msgid "" "The :mod:`mailbox` module's :class:`~mailbox.Maildir` class now records the " "timestamp on the directories it reads, and only re-reads them if the " @@ -1534,7 +1534,7 @@ msgid "" "Pitrou; :issue:`1607951`, :issue:`6896`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1410 +#: ../../whatsnew/2.7.rst:1411 msgid "" "New functions: the :mod:`math` module gained :func:`~math.erf` and :func:" "`~math.erfc` for the error function and the complementary error function, :" @@ -1545,7 +1545,7 @@ msgid "" "`3366`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1418 +#: ../../whatsnew/2.7.rst:1419 msgid "" "The :mod:`multiprocessing` module's :class:`Manager*` classes can now be " "passed a callable that will be called whenever a subprocess is started, " @@ -1553,7 +1553,7 @@ msgid "" "(Contributed by lekma; :issue:`5585`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1424 +#: ../../whatsnew/2.7.rst:1425 msgid "" "The :class:`~multiprocessing.Pool` class, which controls a pool of worker " "processes, now has an optional *maxtasksperchild* parameter. Worker " @@ -1563,13 +1563,13 @@ msgid "" "worker to become very large. (Contributed by Charles Cazabon; :issue:`6963`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1432 +#: ../../whatsnew/2.7.rst:1433 msgid "" "The :mod:`nntplib` module now supports IPv6 addresses. (Contributed by Derek " "Morr; :issue:`1664`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1435 +#: ../../whatsnew/2.7.rst:1436 msgid "" "New functions: the :mod:`os` module wraps the following POSIX system calls: :" "func:`~os.getresgid` and :func:`~os.getresuid`, which return the real, " @@ -1580,14 +1580,14 @@ msgid "" "`6508`. Support for initgroups added by Jean-Paul Calderone; :issue:`7333`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1445 +#: ../../whatsnew/2.7.rst:1446 msgid "" "The :func:`os.fork` function now re-initializes the import lock in the child " "process; this fixes problems on Solaris when :func:`~os.fork` is called from " "a thread. (Fixed by Zsolt Cserna; :issue:`7242`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1449 +#: ../../whatsnew/2.7.rst:1450 msgid "" "In the :mod:`os.path` module, the :func:`~os.path.normpath` and :func:`~os." "path.abspath` functions now preserve Unicode; if their input path is a " @@ -1596,21 +1596,21 @@ msgid "" "fixed by Ezio Melotti in :issue:`3426`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1455 +#: ../../whatsnew/2.7.rst:1456 msgid "" "The :mod:`pydoc` module now has help for the various symbols that Python " "uses. You can now do ``help('<<')`` or ``help('@')``, for example. " "(Contributed by David Laban; :issue:`4739`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1459 +#: ../../whatsnew/2.7.rst:1460 msgid "" "The :mod:`re` module's :func:`~re.split`, :func:`~re.sub`, and :func:`~re." "subn` now accept an optional *flags* argument, for consistency with the " "other functions in the module. (Added by Gregory P. Smith.)" msgstr "" -#: ../../whatsnew/2.7.rst:1463 +#: ../../whatsnew/2.7.rst:1464 msgid "" "New function: :func:`~runpy.run_path` in the :mod:`runpy` module will " "execute the code at a provided *path* argument. *path* can be the path of a " @@ -1625,7 +1625,7 @@ msgid "" "processes an explicit path name. (Added by Nick Coghlan; :issue:`6816`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1477 +#: ../../whatsnew/2.7.rst:1478 msgid "" "New function: in the :mod:`shutil` module, :func:`~shutil.make_archive` " "takes a filename, archive type (zip or tar-format), and a directory path, " @@ -1633,7 +1633,7 @@ msgid "" "Ziadé.)" msgstr "" -#: ../../whatsnew/2.7.rst:1482 +#: ../../whatsnew/2.7.rst:1483 msgid "" ":mod:`shutil`'s :func:`~shutil.copyfile` and :func:`~shutil.copytree` " "functions now raise a :exc:`~shutil.SpecialFileError` exception when asked " @@ -1642,7 +1642,7 @@ msgid "" "indefinitely. (Fixed by Antoine Pitrou; :issue:`3002`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1488 +#: ../../whatsnew/2.7.rst:1489 msgid "" "The :mod:`signal` module no longer re-installs the signal handler unless " "this is truly necessary, which fixes a bug that could make it impossible to " @@ -1650,7 +1650,7 @@ msgid "" "`8354`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1493 +#: ../../whatsnew/2.7.rst:1494 msgid "" "New functions: in the :mod:`site` module, three new functions return various " "site- and user-specific paths. :func:`~site.getsitepackages` returns a list " @@ -1661,7 +1661,7 @@ msgid "" "store data. (Contributed by Tarek Ziadé; :issue:`6693`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1504 +#: ../../whatsnew/2.7.rst:1505 msgid "" "The :mod:`site` module now reports exceptions occurring when the :mod:" "`sitecustomize` module is imported, and will no longer catch and swallow " @@ -1669,14 +1669,14 @@ msgid "" "`3137`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1509 +#: ../../whatsnew/2.7.rst:1510 msgid "" "The :func:`~socket.create_connection` function gained a *source_address* " "parameter, a ``(host, port)`` 2-tuple giving the source address that will be " "used for the connection. (Contributed by Eldon Ziegler; :issue:`3972`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1514 +#: ../../whatsnew/2.7.rst:1515 msgid "" "The :meth:`~socket.socket.recv_into` and :meth:`~socket.socket." "recvfrom_into` methods will now write into objects that support the buffer " @@ -1684,7 +1684,7 @@ msgid "" "(Implemented by Antoine Pitrou; :issue:`8104`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1519 +#: ../../whatsnew/2.7.rst:1520 msgid "" "The :mod:`SocketServer` module's :class:`~SocketServer.TCPServer` class now " "supports socket timeouts and disabling the Nagle algorithm. The :attr:" @@ -1699,7 +1699,7 @@ msgid "" "Jónsson; :issue:`6192` and :issue:`6267`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1531 +#: ../../whatsnew/2.7.rst:1532 msgid "" "Updated module: the :mod:`sqlite3` module has been updated to version 2.6.0 " "of the `pysqlite package `__. Version " @@ -1710,7 +1710,7 @@ msgid "" "Häring.)" msgstr "" -#: ../../whatsnew/2.7.rst:1538 +#: ../../whatsnew/2.7.rst:1539 msgid "" "The :mod:`ssl` module's :class:`~ssl.SSLSocket` objects now support the " "buffer API, which fixed a test suite failure (fix by Antoine Pitrou; :issue:" @@ -1719,7 +1719,7 @@ msgid "" "that trigger an SSL renegotiation (fix by Antoine Pitrou; :issue:`8222`)." msgstr "" -#: ../../whatsnew/2.7.rst:1545 +#: ../../whatsnew/2.7.rst:1546 msgid "" "The :func:`ssl.wrap_socket` constructor function now takes a *ciphers* " "argument that's a string listing the encryption algorithms to be allowed; " @@ -1728,7 +1728,7 @@ msgid "" "Pitrou; :issue:`8322`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1552 +#: ../../whatsnew/2.7.rst:1553 msgid "" "Another change makes the extension load all of OpenSSL's ciphers and digest " "algorithms so that they're all available. Some SSL certificates couldn't be " @@ -1736,7 +1736,7 @@ msgid "" "Kosata, and fixed by Antoine Pitrou; :issue:`8484`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1558 +#: ../../whatsnew/2.7.rst:1559 msgid "" "The version of OpenSSL being used is now available as the module attributes :" "const:`ssl.OPENSSL_VERSION` (a string), :const:`ssl.OPENSSL_VERSION_INFO` (a " @@ -1744,7 +1744,7 @@ msgid "" "Antoine Pitrou; :issue:`8321`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1564 +#: ../../whatsnew/2.7.rst:1565 msgid "" "The :mod:`struct` module will no longer silently ignore overflow errors when " "a value is too large for a particular integer format code (one of " @@ -1755,7 +1755,7 @@ msgid "" "(Changed by Mark Dickinson; :issue:`8300`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1573 +#: ../../whatsnew/2.7.rst:1574 msgid "" "New function: the :mod:`subprocess` module's :func:`~subprocess." "check_output` runs a command with a specified set of arguments and returns " @@ -1763,18 +1763,18 @@ msgid "" "raises a :exc:`~subprocess.CalledProcessError` exception otherwise." msgstr "" -#: ../../whatsnew/2.7.rst:1588 +#: ../../whatsnew/2.7.rst:1589 msgid "(Contributed by Gregory P. Smith.)" msgstr "(由 Gregory P. Smith 所貢獻。)" -#: ../../whatsnew/2.7.rst:1590 +#: ../../whatsnew/2.7.rst:1591 msgid "" "The :mod:`subprocess` module will now retry its internal system calls on " "receiving an :const:`EINTR` signal. (Reported by several people; final " "patch by Gregory P. Smith in :issue:`1068268`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1594 +#: ../../whatsnew/2.7.rst:1595 msgid "" "New function: :func:`~symtable.Symbol.is_declared_global` in the :mod:" "`symtable` module returns true for variables that are explicitly declared to " @@ -1782,21 +1782,21 @@ msgid "" "Hylton.)" msgstr "" -#: ../../whatsnew/2.7.rst:1599 ../../whatsnew/2.7.rst:2497 +#: ../../whatsnew/2.7.rst:1600 ../../whatsnew/2.7.rst:2498 msgid "" "The :mod:`syslog` module will now use the value of ``sys.argv[0]`` as the " "identifier instead of the previous default value of ``'python'``. (Changed " "by Sean Reifschneider; :issue:`8451`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1603 +#: ../../whatsnew/2.7.rst:1604 msgid "" "The ``sys.version_info`` value is now a named tuple, with attributes named :" "attr:`major`, :attr:`minor`, :attr:`micro`, :attr:`releaselevel`, and :attr:" "`serial`. (Contributed by Ross Light; :issue:`4285`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1608 +#: ../../whatsnew/2.7.rst:1609 msgid "" ":func:`sys.getwindowsversion` also returns a named tuple, with attributes " "named :attr:`major`, :attr:`minor`, :attr:`build`, :attr:`platform`, :attr:" @@ -1805,7 +1805,7 @@ msgid "" "issue:`7766`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1614 ../../whatsnew/2.7.rst:2501 +#: ../../whatsnew/2.7.rst:1615 ../../whatsnew/2.7.rst:2502 msgid "" "The :mod:`tarfile` module's default error handling has changed, to no longer " "suppress fatal errors. The default error level was previously 0, which " @@ -1815,7 +1815,7 @@ msgid "" "there's an error. (Changed by Lars Gustäbel; :issue:`7357`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1622 +#: ../../whatsnew/2.7.rst:1623 msgid "" ":mod:`tarfile` now supports filtering the :class:`~tarfile.TarInfo` objects " "being added to a tar file. When you call :meth:`~tarfile.TarFile.add`, you " @@ -1829,7 +1829,7 @@ msgid "" "issue:`7232`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1634 +#: ../../whatsnew/2.7.rst:1635 msgid "" "The :meth:`~threading.Event.wait` method of the :class:`threading.Event` " "class now returns the internal flag on exit. This means the method will " @@ -1839,7 +1839,7 @@ msgid "" "Tim Lesher; :issue:`1674032`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1641 +#: ../../whatsnew/2.7.rst:1642 msgid "" "The Unicode database provided by the :mod:`unicodedata` module is now used " "internally to determine which characters are numeric, whitespace, or " @@ -1849,7 +1849,7 @@ msgid "" "Florent Xicluna; :issue:`8024`)." msgstr "" -#: ../../whatsnew/2.7.rst:1649 ../../whatsnew/2.7.rst:2509 +#: ../../whatsnew/2.7.rst:1650 ../../whatsnew/2.7.rst:2510 msgid "" "The :mod:`urlparse` module's :func:`~urlparse.urlsplit` now handles unknown " "URL schemes in a fashion compliant with :rfc:`3986`: if the URL is of the " @@ -1859,23 +1859,23 @@ msgid "" "For example, Python 2.6.4 or 2.5 will return the following:" msgstr "" -#: ../../whatsnew/2.7.rst:1664 ../../whatsnew/2.7.rst:2524 +#: ../../whatsnew/2.7.rst:1665 ../../whatsnew/2.7.rst:2525 msgid "Python 2.7 (and Python 2.6.5) will return:" msgstr "" -#: ../../whatsnew/2.7.rst:1673 ../../whatsnew/2.7.rst:2533 +#: ../../whatsnew/2.7.rst:1674 ../../whatsnew/2.7.rst:2534 msgid "" "(Python 2.7 actually produces slightly different output, since it returns a " "named tuple instead of a standard tuple.)" msgstr "" -#: ../../whatsnew/2.7.rst:1676 +#: ../../whatsnew/2.7.rst:1677 msgid "" "The :mod:`urlparse` module also supports IPv6 literal addresses as defined " "by :rfc:`2732` (contributed by Senthil Kumaran; :issue:`2987`)." msgstr "" -#: ../../whatsnew/2.7.rst:1686 +#: ../../whatsnew/2.7.rst:1687 msgid "" "New class: the :class:`~weakref.WeakSet` class in the :mod:`weakref` module " "is a set that only holds weak references to its elements; elements will be " @@ -1884,7 +1884,7 @@ msgid "" "Michael Foord.)" msgstr "" -#: ../../whatsnew/2.7.rst:1692 ../../whatsnew/2.7.rst:2487 +#: ../../whatsnew/2.7.rst:1693 ../../whatsnew/2.7.rst:2488 msgid "" "The ElementTree library, :mod:`xml.etree`, no longer escapes ampersands and " "angle brackets when outputting an XML processing instruction (which looks " @@ -1892,7 +1892,7 @@ msgid "" "````). (Patch by Neil Muller; :issue:`2746`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1698 +#: ../../whatsnew/2.7.rst:1699 msgid "" "The XML-RPC client and server, provided by the :mod:`xmlrpclib` and :mod:" "`SimpleXMLRPCServer` modules, have improved performance by supporting " @@ -1903,14 +1903,14 @@ msgid "" "(Contributed by Kristján Valur Jónsson; :issue:`6267`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1707 +#: ../../whatsnew/2.7.rst:1708 msgid "" "The :mod:`zipfile` module's :class:`~zipfile.ZipFile` now supports the " "context management protocol, so you can write ``with zipfile.ZipFile(...) as " "f:``. (Contributed by Brian Curtin; :issue:`5511`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1711 +#: ../../whatsnew/2.7.rst:1712 msgid "" ":mod:`zipfile` now also supports archiving empty directories and extracts " "them correctly. (Fixed by Kuba Wieczorek; :issue:`4710`.) Reading files out " @@ -1919,14 +1919,14 @@ msgid "" "Aides; :issue:`7610`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1717 +#: ../../whatsnew/2.7.rst:1718 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:1721 +#: ../../whatsnew/2.7.rst:1722 msgid "" "The :meth:`~zipfile.ZipFile.writestr` method now has an optional " "*compress_type* parameter that lets you override the default compression " @@ -1934,11 +1934,11 @@ msgid "" "by Ronald Oussoren; :issue:`6003`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1734 +#: ../../whatsnew/2.7.rst:1735 msgid "New module: importlib" msgstr "" -#: ../../whatsnew/2.7.rst:1736 +#: ../../whatsnew/2.7.rst:1737 msgid "" "Python 3.1 includes the :mod:`importlib` package, a re-implementation of the " "logic underlying Python's :keyword:`import` statement. :mod:`importlib` is " @@ -1949,7 +1949,7 @@ msgid "" "import_module`." msgstr "" -#: ../../whatsnew/2.7.rst:1744 +#: ../../whatsnew/2.7.rst:1745 msgid "" "``import_module(name, package=None)`` imports a module. *name* is a string " "containing the module or package's name. It's possible to do relative " @@ -1960,24 +1960,24 @@ msgid "" "imported module into ``sys.modules`` and returns the module object." msgstr "" -#: ../../whatsnew/2.7.rst:1753 +#: ../../whatsnew/2.7.rst:1754 msgid "Here are some examples::" msgstr "" "以下是一些範例:\n" "\n" "::" -#: ../../whatsnew/2.7.rst:1764 +#: ../../whatsnew/2.7.rst:1765 msgid "" ":mod:`importlib` was implemented by Brett Cannon and introduced in Python " "3.1." msgstr "" -#: ../../whatsnew/2.7.rst:1769 +#: ../../whatsnew/2.7.rst:1770 msgid "New module: sysconfig" msgstr "" -#: ../../whatsnew/2.7.rst:1771 +#: ../../whatsnew/2.7.rst:1772 msgid "" "The :mod:`sysconfig` module has been pulled out of the Distutils package, " "becoming a new top-level module in its own right. :mod:`sysconfig` provides " @@ -1986,42 +1986,42 @@ msgid "" "running from its source directory." msgstr "" -#: ../../whatsnew/2.7.rst:1778 +#: ../../whatsnew/2.7.rst:1779 msgid "Some of the functions in the module are:" msgstr "" -#: ../../whatsnew/2.7.rst:1780 +#: ../../whatsnew/2.7.rst:1781 msgid "" ":func:`~sysconfig.get_config_var` returns variables from Python's Makefile " "and the :file:`pyconfig.h` file." msgstr "" -#: ../../whatsnew/2.7.rst:1782 +#: ../../whatsnew/2.7.rst:1783 msgid "" ":func:`~sysconfig.get_config_vars` returns a dictionary containing all of " "the configuration variables." msgstr "" -#: ../../whatsnew/2.7.rst:1784 +#: ../../whatsnew/2.7.rst:1785 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:1787 +#: ../../whatsnew/2.7.rst:1788 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:1790 +#: ../../whatsnew/2.7.rst:1791 msgid "" "Consult the :mod:`sysconfig` documentation for more details and for a " "complete list of functions." msgstr "" -#: ../../whatsnew/2.7.rst:1793 +#: ../../whatsnew/2.7.rst:1794 msgid "" "The Distutils package and :mod:`sysconfig` are now maintained by Tarek " "Ziadé, who has also started a Distutils2 package (source repository at " @@ -2029,11 +2029,11 @@ msgid "" "of Distutils." msgstr "" -#: ../../whatsnew/2.7.rst:1800 +#: ../../whatsnew/2.7.rst:1801 msgid "ttk: Themed Widgets for Tk" msgstr "" -#: ../../whatsnew/2.7.rst:1802 +#: ../../whatsnew/2.7.rst:1803 msgid "" "Tcl/Tk 8.5 includes a set of themed widgets that re-implement basic Tk " "widgets but have a more customizable appearance and can therefore more " @@ -2042,7 +2042,7 @@ msgid "" "added to Tcl/Tck release 8.5." msgstr "" -#: ../../whatsnew/2.7.rst:1808 +#: ../../whatsnew/2.7.rst:1809 msgid "" "To learn more, read the :mod:`ttk` module documentation. You may also wish " "to read the Tcl/Tk manual page describing the Ttk theme engine, available at " @@ -2051,7 +2051,7 @@ msgid "" "wikis/Screenshots.wiki." msgstr "" -#: ../../whatsnew/2.7.rst:1815 +#: ../../whatsnew/2.7.rst:1816 msgid "" "The :mod:`ttk` module was written by Guilherme Polo and added in :issue:" "`2983`. An alternate version called ``Tile.py``, written by Martin Franklin " @@ -2059,11 +2059,11 @@ msgid "" "but the authors argued that Guilherme Polo's work was more comprehensive." msgstr "" -#: ../../whatsnew/2.7.rst:1825 +#: ../../whatsnew/2.7.rst:1826 msgid "Updated module: unittest" msgstr "" -#: ../../whatsnew/2.7.rst:1827 +#: ../../whatsnew/2.7.rst:1828 msgid "" "The :mod:`unittest` module was greatly enhanced; many new features were " "added. Most of these features were implemented by Michael Foord, unless " @@ -2072,7 +2072,7 @@ msgid "" "`unittest2` package, from https://pypi.org/project/unittest2." msgstr "" -#: ../../whatsnew/2.7.rst:1834 +#: ../../whatsnew/2.7.rst:1835 msgid "" "When used from the command line, the module can automatically discover " "tests. It's not as fancy as `py.test `__ or `nose " @@ -2082,17 +2082,17 @@ msgid "" "files named ``test*.py``::" msgstr "" -#: ../../whatsnew/2.7.rst:1843 +#: ../../whatsnew/2.7.rst:1844 msgid "" "Consult the :mod:`unittest` module documentation for more details. " "(Developed in :issue:`6001`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1846 +#: ../../whatsnew/2.7.rst:1847 msgid "The :func:`~unittest.main` function supports some other new options:" msgstr "" -#: ../../whatsnew/2.7.rst:1848 +#: ../../whatsnew/2.7.rst:1849 msgid "" ":option:`-b ` or :option:`!--buffer` will buffer the standard " "output and standard error streams during each test. If the test passes, any " @@ -2100,7 +2100,7 @@ msgid "" "displayed." msgstr "" -#: ../../whatsnew/2.7.rst:1853 +#: ../../whatsnew/2.7.rst:1854 msgid "" ":option:`-c ` or :option:`!--catch` will cause the control-C " "interrupt to be handled more gracefully. Instead of interrupting the test " @@ -2109,7 +2109,7 @@ msgid "" "impatient, a second press of control-C will cause an immediate interruption." msgstr "" -#: ../../whatsnew/2.7.rst:1860 +#: ../../whatsnew/2.7.rst:1861 msgid "" "This control-C handler tries to avoid causing problems when the code being " "tested or the tests being run have defined a signal handler of their own, by " @@ -2119,7 +2119,7 @@ msgid "" "disabled." msgstr "" -#: ../../whatsnew/2.7.rst:1867 +#: ../../whatsnew/2.7.rst:1868 msgid "" ":option:`-f ` or :option:`!--failfast` makes test execution " "stop immediately when a test fails instead of continuing to execute further " @@ -2127,20 +2127,20 @@ msgid "" "`8074`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1872 +#: ../../whatsnew/2.7.rst:1873 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:1876 +#: ../../whatsnew/2.7.rst:1877 msgid "" "Test cases can raise the :exc:`~unittest.SkipTest` exception to skip a test " "(:issue:`1034053`)." msgstr "" -#: ../../whatsnew/2.7.rst:1879 +#: ../../whatsnew/2.7.rst:1880 msgid "" "The error messages for :meth:`~unittest.TestCase.assertEqual`, :meth:" "`~unittest.TestCase.assertTrue`, and :meth:`~unittest.TestCase.assertFalse` " @@ -2151,18 +2151,18 @@ msgid "" "`5663`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1886 +#: ../../whatsnew/2.7.rst:1887 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:1893 +#: ../../whatsnew/2.7.rst:1894 msgid "(Implemented by Antoine Pitrou; :issue:`4444`.)" msgstr "(由 Antoine Pitrou 實作;:issue:`4444`。)" -#: ../../whatsnew/2.7.rst:1897 +#: ../../whatsnew/2.7.rst:1898 msgid "" "Module- and class-level setup and teardown fixtures are now supported. " "Modules can contain :func:`~unittest.setUpModule` and :func:`~unittest." @@ -2173,7 +2173,7 @@ msgid "" "case in a different module or class." msgstr "" -#: ../../whatsnew/2.7.rst:1905 +#: ../../whatsnew/2.7.rst:1906 msgid "" "The methods :meth:`~unittest.TestCase.addCleanup` and :meth:`~unittest." "TestCase.doCleanups` were added. :meth:`~unittest.TestCase.addCleanup` lets " @@ -2183,7 +2183,7 @@ msgid "" "simpler resource allocation and deallocation during tests (:issue:`5679`)." msgstr "" -#: ../../whatsnew/2.7.rst:1913 +#: ../../whatsnew/2.7.rst:1914 msgid "" "A number of new methods were added that provide more specialized tests. " "Many of these methods were written by Google engineers for use in their test " @@ -2191,21 +2191,21 @@ msgid "" "Python's version of :mod:`unittest`." msgstr "" -#: ../../whatsnew/2.7.rst:1918 +#: ../../whatsnew/2.7.rst:1919 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:1921 +#: ../../whatsnew/2.7.rst:1922 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:1925 +#: ../../whatsnew/2.7.rst:1926 msgid "" ":meth:`~unittest.TestCase.assertIsInstance` and :meth:`~unittest.TestCase." "assertNotIsInstance` check whether the resulting object is an instance of a " @@ -2213,14 +2213,14 @@ msgid "" "issue:`7031`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1930 +#: ../../whatsnew/2.7.rst:1931 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:1934 +#: ../../whatsnew/2.7.rst:1935 msgid "" ":meth:`~unittest.TestCase.assertMultiLineEqual` compares two strings, and if " "they're not equal, displays a helpful comparison that highlights the " @@ -2228,7 +2228,7 @@ msgid "" "Unicode strings are compared with :meth:`~unittest.TestCase.assertEqual`." msgstr "" -#: ../../whatsnew/2.7.rst:1939 +#: ../../whatsnew/2.7.rst:1940 msgid "" ":meth:`~unittest.TestCase.assertRegexpMatches` and :meth:`~unittest.TestCase." "assertNotRegexpMatches` checks whether the first argument is a string " @@ -2236,32 +2236,32 @@ msgid "" "argument (:issue:`8038`)." msgstr "" -#: ../../whatsnew/2.7.rst:1944 +#: ../../whatsnew/2.7.rst:1945 msgid "" ":meth:`~unittest.TestCase.assertRaisesRegexp` checks whether a particular " "exception is raised, and then also checks that the string representation of " "the exception matches the provided regular expression." msgstr "" -#: ../../whatsnew/2.7.rst:1948 +#: ../../whatsnew/2.7.rst:1949 msgid "" ":meth:`~unittest.TestCase.assertIn` and :meth:`~unittest.TestCase." "assertNotIn` tests whether *first* is or is not in *second*." msgstr "" -#: ../../whatsnew/2.7.rst:1951 +#: ../../whatsnew/2.7.rst:1952 msgid "" ":meth:`~unittest.TestCase.assertItemsEqual` tests whether two provided " "sequences contain the same elements." msgstr "" -#: ../../whatsnew/2.7.rst:1954 +#: ../../whatsnew/2.7.rst:1955 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:1957 +#: ../../whatsnew/2.7.rst:1958 msgid "" "Similarly, :meth:`~unittest.TestCase.assertListEqual` and :meth:`~unittest." "TestCase.assertTupleEqual` compare the specified types and explain any " @@ -2272,7 +2272,7 @@ msgid "" "both sequences are of a particular type." msgstr "" -#: ../../whatsnew/2.7.rst:1965 +#: ../../whatsnew/2.7.rst:1966 msgid "" ":meth:`~unittest.TestCase.assertDictEqual` compares two dictionaries and " "reports the differences; it's now used by default when you compare two " @@ -2281,7 +2281,7 @@ msgid "" "in *first* are found in *second*." msgstr "" -#: ../../whatsnew/2.7.rst:1970 +#: ../../whatsnew/2.7.rst:1971 msgid "" ":meth:`~unittest.TestCase.assertAlmostEqual` and :meth:`~unittest.TestCase." "assertNotAlmostEqual` test whether *first* and *second* are approximately " @@ -2290,14 +2290,14 @@ msgid "" "require the difference to be smaller than a supplied *delta* value." msgstr "" -#: ../../whatsnew/2.7.rst:1976 +#: ../../whatsnew/2.7.rst:1977 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:1980 +#: ../../whatsnew/2.7.rst:1981 msgid "" "A new hook lets you extend the :meth:`~unittest.TestCase.assertEqual` method " "to handle new data types. The :meth:`~unittest.TestCase." @@ -2309,7 +2309,7 @@ msgid "" "sequence comparison methods do." msgstr "" -#: ../../whatsnew/2.7.rst:1989 +#: ../../whatsnew/2.7.rst:1990 msgid "" ":func:`unittest.main` now takes an optional ``exit`` argument. If false, :" "func:`~unittest.main` doesn't call :func:`sys.exit`, allowing :func:" @@ -2317,7 +2317,7 @@ msgid "" "by J. Pablo Fernández; :issue:`3379`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1994 +#: ../../whatsnew/2.7.rst:1995 msgid "" ":class:`~unittest.TestResult` has new :meth:`~unittest.TestResult." "startTestRun` and :meth:`~unittest.TestResult.stopTestRun` methods that are " @@ -2325,7 +2325,7 @@ msgid "" "Collins; :issue:`5728`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1998 +#: ../../whatsnew/2.7.rst:1999 msgid "" "With all these changes, the :file:`unittest.py` was becoming awkwardly " "large, so the module was turned into a package and the code split into " @@ -2333,7 +2333,7 @@ msgid "" "imported or used." msgstr "" -#: ../../whatsnew/2.7.rst:2006 +#: ../../whatsnew/2.7.rst:2007 msgid "" "https://web.archive.org/web/20210619163128/http://www.voidspace.org.uk/" "python/articles/unittest2.shtml" @@ -2341,37 +2341,37 @@ msgstr "" "https://web.archive.org/web/20210619163128/http://www.voidspace.org.uk/" "python/articles/unittest2.shtml" -#: ../../whatsnew/2.7.rst:2006 +#: ../../whatsnew/2.7.rst:2007 msgid "" "Describes the new features, how to use them, and the rationale for various " "design decisions. (By Michael Foord.)" msgstr "" -#: ../../whatsnew/2.7.rst:2012 +#: ../../whatsnew/2.7.rst:2013 msgid "Updated module: ElementTree 1.3" msgstr "" -#: ../../whatsnew/2.7.rst:2014 +#: ../../whatsnew/2.7.rst:2015 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:2017 +#: ../../whatsnew/2.7.rst:2018 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:2024 +#: ../../whatsnew/2.7.rst:2025 msgid "" "Errors in parsing XML now raise a :exc:`ParseError` exception, whose " "instances have a :attr:`position` attribute containing a (*line*, *column*) " "tuple giving the location of the problem." msgstr "" -#: ../../whatsnew/2.7.rst:2028 +#: ../../whatsnew/2.7.rst:2029 msgid "" "ElementTree's code for converting trees to a string has been significantly " "reworked, making it roughly twice as fast in many cases. The :meth:" @@ -2385,7 +2385,7 @@ msgid "" "to do more extensive rearrangement to remove a single element." msgstr "" -#: ../../whatsnew/2.7.rst:2040 +#: ../../whatsnew/2.7.rst:2041 msgid "" "Namespace handling has also been improved. All ``xmlns:`` " "declarations are now output on the root element, not scattered throughout " @@ -2395,7 +2395,7 @@ msgid "" "the true/false *xml_declaration* parameter to suppress the XML declaration." msgstr "" -#: ../../whatsnew/2.7.rst:2048 +#: ../../whatsnew/2.7.rst:2049 msgid "" "New :class:`~xml.etree.ElementTree.Element` method: :meth:`~xml.etree." "ElementTree.Element.extend` appends the items from a sequence to the " @@ -2403,7 +2403,7 @@ msgid "" "to move children from one element to another::" msgstr "" -#: ../../whatsnew/2.7.rst:2065 +#: ../../whatsnew/2.7.rst:2066 msgid "" "New :class:`Element` method: :meth:`~xml.etree.ElementTree.Element.iter` " "yields the children of the element as a generator. It's also possible to " @@ -2412,13 +2412,13 @@ msgid "" "`getchildren` which constructs and returns a list of children." msgstr "" -#: ../../whatsnew/2.7.rst:2072 +#: ../../whatsnew/2.7.rst:2073 msgid "" "New :class:`Element` method: :meth:`~xml.etree.ElementTree.Element.itertext` " "yields all chunks of text that are descendants of the element. For example::" msgstr "" -#: ../../whatsnew/2.7.rst:2083 +#: ../../whatsnew/2.7.rst:2084 msgid "" "Deprecated: using an element as a Boolean (i.e., ``if elem:``) would return " "true if the element had any children, or false if there were no children. " @@ -2428,7 +2428,7 @@ msgid "" "number of children, or ``elem is not None``." msgstr "" -#: ../../whatsnew/2.7.rst:2091 +#: ../../whatsnew/2.7.rst:2092 msgid "" "Fredrik Lundh develops ElementTree and produced the 1.3 version; you can " "read his article describing 1.3 at https://web.archive.org/" @@ -2437,15 +2437,15 @@ msgid "" "python-dev and in :issue:`6472`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2101 +#: ../../whatsnew/2.7.rst:2102 msgid "Build and C API Changes" msgstr "" -#: ../../whatsnew/2.7.rst:2103 +#: ../../whatsnew/2.7.rst:2104 msgid "Changes to Python's build process and to the C API include:" msgstr "" -#: ../../whatsnew/2.7.rst:2105 +#: ../../whatsnew/2.7.rst:2106 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:2180 +#: ../../whatsnew/2.7.rst:2181 msgid "" "New macros: the Python header files now define the following macros: :c:" "macro:`Py_ISALNUM`, :c:macro:`Py_ISALPHA`, :c:macro:`Py_ISDIGIT`, :c:macro:" @@ -2564,7 +2564,7 @@ msgid "" "Eric Smith; :issue:`5793`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2198 +#: ../../whatsnew/2.7.rst:2199 msgid "" "Removed function: :c:func:`!PyEval_CallObject` is now only available as a " "macro. A function version was being kept around to preserve ABI linking " @@ -2572,7 +2572,7 @@ msgid "" "(Removed by Antoine Pitrou; :issue:`8276`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2203 +#: ../../whatsnew/2.7.rst:2204 msgid "" "New format codes: the :c:func:`!PyString_FromFormat`, :c:func:`!" "PyString_FromFormatV`, and :c:func:`PyErr_Format` functions now accept " @@ -2580,7 +2580,7 @@ msgid "" "types. (Contributed by Mark Dickinson; :issue:`7228`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2209 +#: ../../whatsnew/2.7.rst:2210 msgid "" "The complicated interaction between threads and process forking has been " "changed. Previously, the child process created by :func:`os.fork` might " @@ -2592,7 +2592,7 @@ msgid "" "replicated, and the child process would no longer be able to perform imports." msgstr "" -#: ../../whatsnew/2.7.rst:2219 +#: ../../whatsnew/2.7.rst:2220 msgid "" "Python 2.7 acquires the import lock before performing an :func:`os.fork`, " "and will also clean up any locks created using the :mod:`threading` module. " @@ -2600,38 +2600,38 @@ msgid "" "themselves, will not benefit from this clean-up." msgstr "" -#: ../../whatsnew/2.7.rst:2225 +#: ../../whatsnew/2.7.rst:2226 msgid "(Fixed by Thomas Wouters; :issue:`1590864`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2227 +#: ../../whatsnew/2.7.rst:2228 msgid "" "The :c:func:`Py_Finalize` function now calls the internal :func:`threading." "_shutdown` function; this prevents some exceptions from being raised when an " "interpreter shuts down. (Patch by Adam Olsen; :issue:`1722344`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2232 +#: ../../whatsnew/2.7.rst:2233 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:2238 +#: ../../whatsnew/2.7.rst:2239 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:2242 +#: ../../whatsnew/2.7.rst:2243 msgid "" "New configure option: the :option:`!--with-system-expat` switch allows " "building the :mod:`pyexpat` module to use the system Expat library. " "(Contributed by Arfrever Frehtes Taifersar Arahesis; :issue:`7609`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2246 +#: ../../whatsnew/2.7.rst:2247 msgid "" "New configure option: the :option:`!--with-valgrind` option will now disable " "the pymalloc allocator, which is difficult for the Valgrind memory-error " @@ -2640,14 +2640,14 @@ msgid "" "issue:`2422`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2253 +#: ../../whatsnew/2.7.rst:2254 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:2258 +#: ../../whatsnew/2.7.rst:2259 msgid "" "The :program:`configure` script now checks for floating-point rounding bugs " "on certain 32-bit Intel chips and defines a :c:macro:`X87_DOUBLE_ROUNDING` " @@ -2656,30 +2656,30 @@ msgid "" "`2937`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2264 +#: ../../whatsnew/2.7.rst:2265 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:2268 +#: ../../whatsnew/2.7.rst:2269 msgid "" "The build process now creates the necessary files for pkg-config support. " "(Contributed by Clinton Roy; :issue:`3585`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2271 +#: ../../whatsnew/2.7.rst:2272 msgid "" "The build process now supports Subversion 1.7. (Contributed by Arfrever " "Frehtes Taifersar Arahesis; :issue:`6094`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2278 +#: ../../whatsnew/2.7.rst:2279 msgid "Capsules" msgstr "" -#: ../../whatsnew/2.7.rst:2280 +#: ../../whatsnew/2.7.rst:2281 msgid "" "Python 3.1 adds a new C datatype, :c:type:`PyCapsule`, for providing a C API " "to an extension module. A capsule is essentially the holder of a C ``void " @@ -2691,7 +2691,7 @@ msgid "" "module's various API functions." msgstr "" -#: ../../whatsnew/2.7.rst:2289 +#: ../../whatsnew/2.7.rst:2290 msgid "" "There is an existing data type already used for this, :c:type:`!PyCObject`, " "but it doesn't provide type safety. Evil code written in pure Python could " @@ -2701,7 +2701,7 @@ msgid "" "name:" msgstr "" -#: ../../whatsnew/2.7.rst:2307 +#: ../../whatsnew/2.7.rst:2308 msgid "" "You are assured that ``vtable`` points to whatever you're expecting. If a " "different capsule was passed in, :c:func:`PyCapsule_IsValid` would detect " @@ -2709,7 +2709,7 @@ msgid "" "more information on using these objects." msgstr "" -#: ../../whatsnew/2.7.rst:2312 +#: ../../whatsnew/2.7.rst:2313 msgid "" "Python 2.7 now uses capsules internally to provide various extension-module " "APIs, but the :c:func:`!PyCObject_AsVoidPtr` was modified to handle " @@ -2718,17 +2718,17 @@ msgid "" "exc:`PendingDeprecationWarning`, which is silent by default." msgstr "" -#: ../../whatsnew/2.7.rst:2319 +#: ../../whatsnew/2.7.rst:2320 msgid "" "Implemented in Python 3.1 and backported to 2.7 by Larry Hastings; discussed " "in :issue:`5630`." msgstr "" -#: ../../whatsnew/2.7.rst:2326 +#: ../../whatsnew/2.7.rst:2327 msgid "Port-Specific Changes: Windows" msgstr "" -#: ../../whatsnew/2.7.rst:2328 +#: ../../whatsnew/2.7.rst:2329 msgid "" "The :mod:`msvcrt` module now contains some constants from the :file:" "`crtassem.h` header file: :data:`CRT_ASSEMBLY_VERSION`, :data:" @@ -2736,7 +2736,7 @@ msgid "" "(Contributed by David Cournapeau; :issue:`4365`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2335 +#: ../../whatsnew/2.7.rst:2336 msgid "" "The :mod:`_winreg` module for accessing the registry now implements the :" "func:`~_winreg.CreateKeyEx` and :func:`~_winreg.DeleteKeyEx` functions, " @@ -2746,14 +2746,14 @@ msgid "" "tested and documented. (Implemented by Brian Curtin: :issue:`7347`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2343 +#: ../../whatsnew/2.7.rst:2344 msgid "" "The new :c:func:`_beginthreadex` API is used to start threads, and the " "native thread-local storage functions are now used. (Contributed by Kristján " "Valur Jónsson; :issue:`3582`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2347 +#: ../../whatsnew/2.7.rst:2348 msgid "" "The :func:`os.kill` function now works on Windows. The signal value can be " "the constants :const:`CTRL_C_EVENT`, :const:`CTRL_BREAK_EVENT`, or any " @@ -2763,23 +2763,23 @@ msgid "" "`1220212`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2354 +#: ../../whatsnew/2.7.rst:2355 msgid "" "The :func:`os.listdir` function now correctly fails for an empty path. " "(Fixed by Hirokazu Yamamoto; :issue:`5913`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2357 +#: ../../whatsnew/2.7.rst:2358 msgid "" "The :mod:`mimelib` module will now read the MIME database from the Windows " "registry when initializing. (Patch by Gabriel Genellina; :issue:`4969`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2364 +#: ../../whatsnew/2.7.rst:2365 msgid "Port-Specific Changes: Mac OS X" msgstr "" -#: ../../whatsnew/2.7.rst:2366 +#: ../../whatsnew/2.7.rst:2367 msgid "" "The path ``/Library/Python/2.7/site-packages`` is now appended to ``sys." "path``, in order to share added packages between the system installation and " @@ -2787,7 +2787,7 @@ msgid "" "issue:`4865`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2373 +#: ../../whatsnew/2.7.rst:2374 msgid "" "As of 2.7.13, this change was removed. ``/Library/Python/2.7/site-" "packages``, the site-packages directory used by the Apple-supplied system " @@ -2799,23 +2799,23 @@ msgid "" "Pythons. (:issue:`28440`)" msgstr "" -#: ../../whatsnew/2.7.rst:2384 +#: ../../whatsnew/2.7.rst:2385 msgid "Port-Specific Changes: FreeBSD" msgstr "" -#: ../../whatsnew/2.7.rst:2386 +#: ../../whatsnew/2.7.rst:2387 msgid "" -"FreeBSD 7.1's :const:`SO_SETFIB` constant, used with :func:`~socket." -"getsockopt`/:func:`~socket.setsockopt` to select an alternate routing table, " -"is now available in the :mod:`socket` module. (Added by Kyle VanderBeek; :" -"issue:`8235`.)" +"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:2392 +#: ../../whatsnew/2.7.rst:2393 msgid "Other Changes and Fixes" msgstr "" -#: ../../whatsnew/2.7.rst:2394 +#: ../../whatsnew/2.7.rst:2395 msgid "" "Two benchmark scripts, :file:`iobench` and :file:`ccbench`, were added to " "the :file:`Tools` directory. :file:`iobench` measures the speed of the " @@ -2825,13 +2825,13 @@ msgid "" "bandwidth when performing several tasks using a varying number of threads." msgstr "" -#: ../../whatsnew/2.7.rst:2402 +#: ../../whatsnew/2.7.rst:2403 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:2406 +#: ../../whatsnew/2.7.rst:2407 msgid "" "When importing a module from a :file:`.pyc` or :file:`.pyo` file with an " "existing :file:`.py` counterpart, the :attr:`co_filename` attributes of the " @@ -2841,7 +2841,7 @@ msgid "" "Calderone; :issue:`1180193`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2413 +#: ../../whatsnew/2.7.rst:2414 msgid "" "The :file:`regrtest.py` script now takes a :option:`!--randseed=` switch " "that takes an integer that will be used as the random seed for the :option:" @@ -2849,7 +2849,7 @@ msgid "" "also reports the seed that was used (Added by Collin Winter.)" msgstr "" -#: ../../whatsnew/2.7.rst:2419 +#: ../../whatsnew/2.7.rst:2420 msgid "" "Another :file:`regrtest.py` switch is :option:`!-j`, which takes an integer " "specifying how many tests run in parallel. This allows reducing the total " @@ -2860,31 +2860,31 @@ msgid "" "they fail. (Added by Antoine Pitrou; :issue:`7312`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2428 +#: ../../whatsnew/2.7.rst:2429 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:2436 +#: ../../whatsnew/2.7.rst:2437 msgid "Porting to Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2438 +#: ../../whatsnew/2.7.rst:2439 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code:" msgstr "" -#: ../../whatsnew/2.7.rst:2441 +#: ../../whatsnew/2.7.rst:2442 msgid "" "The :func:`range` function processes its arguments more consistently; it " "will now call :meth:`__int__` on non-float, non-integer arguments that are " "supplied to it. (Fixed by Alexander Belopolsky; :issue:`1533`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2446 +#: ../../whatsnew/2.7.rst:2447 msgid "" "The string :meth:`format` method changed the default precision used for " "floating-point and complex numbers from 6 decimal places to 12, which " @@ -2892,7 +2892,7 @@ msgid "" "`5920`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2451 +#: ../../whatsnew/2.7.rst:2452 msgid "" "Because of an optimization for the :keyword:`with` statement, the special " "methods :meth:`~object.__enter__` and :meth:`~object.__exit__` must belong " @@ -2901,7 +2901,7 @@ msgid "" "C extension types. (:issue:`6101`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2457 +#: ../../whatsnew/2.7.rst:2458 msgid "" "Due to a bug in Python 2.6, the *exc_value* parameter to :meth:`~object." "__exit__` methods was often the string representation of the exception, not " @@ -2909,11 +2909,11 @@ msgid "" "expected. (Fixed by Florent Xicluna; :issue:`7853`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2467 +#: ../../whatsnew/2.7.rst:2468 msgid "In the standard library:" msgstr "" -#: ../../whatsnew/2.7.rst:2469 +#: ../../whatsnew/2.7.rst:2470 msgid "" "Operations with :class:`~datetime.datetime` instances that resulted in a " "year falling outside the supported range didn't always raise :exc:" @@ -2922,7 +2922,7 @@ msgid "" "Alexander Belopolsky; :issue:`7150`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2475 +#: ../../whatsnew/2.7.rst:2476 msgid "" "When using :class:`~decimal.Decimal` instances with a string's :meth:" "`format` method, the default alignment was previously left-alignment. This " @@ -2930,7 +2930,7 @@ msgid "" "programs. (Changed by Mark Dickinson; :issue:`6857`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2481 +#: ../../whatsnew/2.7.rst:2482 msgid "" "Comparisons involving a signaling NaN value (or ``sNAN``) now signal :const:" "`~decimal.InvalidOperation` instead of silently returning a true or false " @@ -2938,36 +2938,36 @@ msgid "" "are now hashable. (Fixed by Mark Dickinson; :issue:`7279`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2493 +#: ../../whatsnew/2.7.rst:2494 msgid "" "The :meth:`~StringIO.StringIO.readline` method of :class:`~StringIO." "StringIO` objects now does nothing when a negative length is requested, as " "other file-like objects do. (:issue:`7348`)." msgstr "" -#: ../../whatsnew/2.7.rst:2536 +#: ../../whatsnew/2.7.rst:2537 msgid "For C extensions:" msgstr "" -#: ../../whatsnew/2.7.rst:2538 +#: ../../whatsnew/2.7.rst:2539 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:2542 +#: ../../whatsnew/2.7.rst:2543 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:2546 +#: ../../whatsnew/2.7.rst:2547 msgid "For applications that embed Python:" msgstr "" -#: ../../whatsnew/2.7.rst:2548 +#: ../../whatsnew/2.7.rst:2549 msgid "" "The :c:func:`PySys_SetArgvEx` function was added, letting applications close " "a security hole when the existing :c:func:`PySys_SetArgv` function was " @@ -2976,11 +2976,11 @@ msgid "" "with *updatepath* set to false." msgstr "" -#: ../../whatsnew/2.7.rst:2561 +#: ../../whatsnew/2.7.rst:2562 msgid "New Features Added to Python 2.7 Maintenance Releases" msgstr "" -#: ../../whatsnew/2.7.rst:2563 +#: ../../whatsnew/2.7.rst:2564 msgid "" "New features may be added to Python 2.7 maintenance releases when the " "situation genuinely calls for it. Any such additions must go through the " @@ -2989,25 +2989,25 @@ msgid "" "Python 3, or else by publishing it on the Python Package Index." msgstr "" -#: ../../whatsnew/2.7.rst:2569 +#: ../../whatsnew/2.7.rst:2570 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:2575 +#: ../../whatsnew/2.7.rst:2576 msgid "Two new environment variables for debug mode" msgstr "" -#: ../../whatsnew/2.7.rst:2577 +#: ../../whatsnew/2.7.rst:2578 msgid "" "In debug mode, the ``[xxx refs]`` statistic is not written by default, the :" "envvar:`PYTHONSHOWREFCOUNT` environment variable now must also be set. " "(Contributed by Victor Stinner; :issue:`31733`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2581 +#: ../../whatsnew/2.7.rst:2582 msgid "" "When Python is compiled with ``COUNT_ALLOC`` defined, allocation counts are " "no longer dumped by default anymore: the :envvar:`PYTHONSHOWALLOCCOUNT` " @@ -3016,11 +3016,11 @@ msgid "" "issue:`31692`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2590 +#: ../../whatsnew/2.7.rst:2591 msgid "PEP 434: IDLE Enhancement Exception for All Branches" msgstr "" -#: ../../whatsnew/2.7.rst:2592 +#: ../../whatsnew/2.7.rst:2593 msgid "" ":pep:`434` describes a general exemption for changes made to the IDLE " "development environment shipped along with Python. This exemption makes it " @@ -3028,62 +3028,62 @@ msgid "" "experience across all supported versions of Python 2 and 3." msgstr "" -#: ../../whatsnew/2.7.rst:2597 +#: ../../whatsnew/2.7.rst:2598 msgid "" "For details of any IDLE changes, refer to the NEWS file for the specific " "release." msgstr "" -#: ../../whatsnew/2.7.rst:2602 +#: ../../whatsnew/2.7.rst:2603 msgid "PEP 466: Network Security Enhancements for Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2604 +#: ../../whatsnew/2.7.rst:2605 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:2608 +#: ../../whatsnew/2.7.rst:2609 msgid ":pep:`466` related features added in Python 2.7.7:" msgstr "" -#: ../../whatsnew/2.7.rst:2610 +#: ../../whatsnew/2.7.rst:2611 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:2614 +#: ../../whatsnew/2.7.rst:2615 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:2617 +#: ../../whatsnew/2.7.rst:2618 msgid ":pep:`466` related features added in Python 2.7.8:" msgstr "" -#: ../../whatsnew/2.7.rst:2619 +#: ../../whatsnew/2.7.rst:2620 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:2623 +#: ../../whatsnew/2.7.rst:2624 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:2626 +#: ../../whatsnew/2.7.rst:2627 msgid ":pep:`466` related features added in Python 2.7.9:" msgstr "" -#: ../../whatsnew/2.7.rst:2628 +#: ../../whatsnew/2.7.rst:2629 msgid "" "Most of Python 3.4's :mod:`ssl` module was backported. This means :mod:`ssl` " "now supports Server Name Indication, TLS1.x settings, access to the platform " @@ -3091,20 +3091,20 @@ msgid "" "(Contributed by Alex Gaynor and David Reid; :issue:`21308`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2633 +#: ../../whatsnew/2.7.rst:2634 msgid "" "Refer to the \"Version added: 2.7.9\" notes in the module documentation for " "specific details." msgstr "" -#: ../../whatsnew/2.7.rst:2636 +#: ../../whatsnew/2.7.rst:2637 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:2640 +#: ../../whatsnew/2.7.rst:2641 msgid "" ":data:`hashlib.algorithms_guaranteed` and :data:`hashlib." "algorithms_available` were backported from Python 3 to make it easier for " @@ -3112,22 +3112,22 @@ msgid "" "(Contributed by Alex Gaynor in :issue:`21307`)" msgstr "" -#: ../../whatsnew/2.7.rst:2647 +#: ../../whatsnew/2.7.rst:2648 msgid "PEP 477: Backport ensurepip (PEP 453) to Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2649 +#: ../../whatsnew/2.7.rst:2650 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:2655 +#: ../../whatsnew/2.7.rst:2656 msgid "Bootstrapping pip By Default" msgstr "" -#: ../../whatsnew/2.7.rst:2657 +#: ../../whatsnew/2.7.rst:2658 msgid "" "The new :mod:`ensurepip` module (defined in :pep:`453`) provides a standard " "cross-platform mechanism to bootstrap the pip installer into Python " @@ -3137,14 +3137,14 @@ msgid "" "the release candidate." msgstr "" -#: ../../whatsnew/2.7.rst:2664 +#: ../../whatsnew/2.7.rst:2665 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:2668 +#: ../../whatsnew/2.7.rst:2669 msgid "" "For CPython :ref:`source builds on POSIX systems `, " "the ``make install`` and ``make altinstall`` commands do not bootstrap " @@ -3152,7 +3152,7 @@ msgid "" "options, and overridden through Makefile options." msgstr "" -#: ../../whatsnew/2.7.rst:2673 +#: ../../whatsnew/2.7.rst:2674 msgid "" "On Windows and Mac OS X, the CPython installers now default to installing " "``pip`` along with CPython itself (users may opt out of installing it during " @@ -3162,7 +3162,7 @@ msgid "" "Windows as ``py -m pip``." msgstr "" -#: ../../whatsnew/2.7.rst:2680 +#: ../../whatsnew/2.7.rst:2681 msgid "" "As `discussed in the PEP`__, platform packagers may choose not to install " "these commands by default, as long as, when invoked, they provide clear and " @@ -3170,11 +3170,11 @@ msgid "" "system package manager)." msgstr "" -#: ../../whatsnew/2.7.rst:2689 +#: ../../whatsnew/2.7.rst:2690 msgid "Documentation Changes" msgstr "" -#: ../../whatsnew/2.7.rst:2691 +#: ../../whatsnew/2.7.rst:2692 msgid "" "As part of this change, the :ref:`installing-index` and :ref:`distributing-" "index` sections of the documentation have been completely redesigned as " @@ -3184,29 +3184,29 @@ msgid "" "of the individual projects." msgstr "" -#: ../../whatsnew/2.7.rst:2699 +#: ../../whatsnew/2.7.rst:2700 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:2706 +#: ../../whatsnew/2.7.rst:2707 msgid ":pep:`453` -- Explicit bootstrapping of pip in Python installations" msgstr "" -#: ../../whatsnew/2.7.rst:2706 +#: ../../whatsnew/2.7.rst:2707 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:2710 +#: ../../whatsnew/2.7.rst:2711 msgid "" "PEP 476: Enabling certificate verification by default for stdlib http clients" msgstr "" -#: ../../whatsnew/2.7.rst:2712 +#: ../../whatsnew/2.7.rst:2713 msgid "" ":pep:`476` updated :mod:`httplib` and modules which use it, such as :mod:" "`urllib2` and :mod:`xmlrpclib`, to now verify that the server presents a " @@ -3216,17 +3216,17 @@ msgid "" "in the Python 2.7.9 release." msgstr "" -#: ../../whatsnew/2.7.rst:2719 +#: ../../whatsnew/2.7.rst:2720 msgid "" "For applications which require the old previous behavior, they can pass an " "alternate context::" msgstr "" -#: ../../whatsnew/2.7.rst:2736 +#: ../../whatsnew/2.7.rst:2737 msgid "PEP 493: HTTPS verification migration tools for Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2738 +#: ../../whatsnew/2.7.rst:2739 msgid "" ":pep:`493` provides additional migration tools to support a more incremental " "infrastructure upgrade process for environments containing applications and " @@ -3235,14 +3235,14 @@ msgid "" "were made in the Python 2.7.12 release." msgstr "" -#: ../../whatsnew/2.7.rst:2744 +#: ../../whatsnew/2.7.rst:2745 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:2748 +#: ../../whatsnew/2.7.rst:2749 msgid "" "For applications and services which can't be modified at all, the new " "``PYTHONHTTPSVERIFY`` environment variable may be set to ``0`` to revert an " @@ -3250,18 +3250,18 @@ msgid "" "2.7.8 and earlier." msgstr "" -#: ../../whatsnew/2.7.rst:2753 +#: ../../whatsnew/2.7.rst:2754 msgid "" "For cases where the connection establishment code can't be modified, but the " "overall application can be, the new :func:`ssl._https_verify_certificates` " "function can be used to adjust the default behaviour at runtime." msgstr "" -#: ../../whatsnew/2.7.rst:2759 +#: ../../whatsnew/2.7.rst:2760 msgid "New ``make regen-all`` build target" msgstr "" -#: ../../whatsnew/2.7.rst:2761 +#: ../../whatsnew/2.7.rst:2762 msgid "" "To simplify cross-compilation, and to ensure that CPython can reliably be " "compiled without requiring an existing version of Python to already be " @@ -3269,43 +3269,43 @@ msgid "" "recompile generated files based on file modification times." msgstr "" -#: ../../whatsnew/2.7.rst:2766 +#: ../../whatsnew/2.7.rst:2767 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:2770 +#: ../../whatsnew/2.7.rst:2771 msgid "" "More selective regeneration targets are also defined - see :source:`Makefile." "pre.in` for details." msgstr "" -#: ../../whatsnew/2.7.rst:2773 ../../whatsnew/2.7.rst:2786 +#: ../../whatsnew/2.7.rst:2774 ../../whatsnew/2.7.rst:2787 msgid "(Contributed by Victor Stinner in :issue:`23404`.)" msgstr "(由 Victor Stinner 於 :issue:`23404` 中貢獻。)" -#: ../../whatsnew/2.7.rst:2779 +#: ../../whatsnew/2.7.rst:2780 msgid "Removal of ``make touch`` build target" msgstr "" -#: ../../whatsnew/2.7.rst:2781 +#: ../../whatsnew/2.7.rst:2782 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:2784 +#: ../../whatsnew/2.7.rst:2785 msgid "It has been replaced by the new ``make regen-all`` target." msgstr "" -#: ../../whatsnew/2.7.rst:2795 +#: ../../whatsnew/2.7.rst:2796 msgid "Acknowledgements" msgstr "致謝" -#: ../../whatsnew/2.7.rst:2797 +#: ../../whatsnew/2.7.rst:2798 msgid "" "The author would like to thank the following people for offering " "suggestions, corrections and assistance with various drafts of this article: " diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index 1f2d4fac77..d87e8dbae5 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-12-06 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:2042 +#: ../../whatsnew/3.10.rst:92 ../../whatsnew/3.10.rst:2043 msgid "New Features" msgstr "新功能" @@ -387,11 +387,11 @@ msgstr "" #: ../../whatsnew/3.10.rst:402 msgid "" -"The ``f_lineno`` attribute of frame objects will always contain the expected " -"line number." -msgstr "影格 (frame) 物件的 ``f_lineno`` 屬性總會包含預期的列號。" +"The :attr:`~frame.f_lineno` attribute of frame objects will always contain " +"the expected line number." +msgstr "影格 (frame) 物件的 :attr:`~frame.f_lineno` 屬性總會包含預期的列號。" -#: ../../whatsnew/3.10.rst:404 +#: ../../whatsnew/3.10.rst:405 msgid "" "The ``co_lnotab`` attribute of code objects is deprecated and will be " "removed in 3.12. Code that needs to convert from offset to line number " @@ -400,11 +400,11 @@ msgstr "" "程式碼物件的 ``co_lnotab`` 屬性已棄用,並將在 3.12 中刪除。需要從偏移量轉換為" "列號的程式碼應使用新的 ``co_lines()`` 方法。" -#: ../../whatsnew/3.10.rst:408 +#: ../../whatsnew/3.10.rst:409 msgid "PEP 634: Structural Pattern Matching" msgstr "PEP 634:結構模式匹配" -#: ../../whatsnew/3.10.rst:410 +#: ../../whatsnew/3.10.rst:411 msgid "" "Structural pattern matching has been added in the form of a *match " "statement* and *case statements* of patterns with associated actions. " @@ -418,15 +418,15 @@ msgstr "" "(primitive data types) 以及類別實例組成。模式匹配使程式能夠從複雜的資料型別中" "提取資訊,在資料結構上進行分支,並根據不同形式的資料應用特定的操作。" -#: ../../whatsnew/3.10.rst:418 +#: ../../whatsnew/3.10.rst:419 msgid "Syntax and operations" msgstr "語法和操作" -#: ../../whatsnew/3.10.rst:420 +#: ../../whatsnew/3.10.rst:421 msgid "The generic syntax of pattern matching is::" msgstr "模式匹配的通用語法是:" -#: ../../whatsnew/3.10.rst:432 +#: ../../whatsnew/3.10.rst:433 msgid "" "A match statement takes an expression and compares its value to successive " "patterns given as one or more case blocks. Specifically, pattern matching " @@ -435,25 +435,25 @@ msgstr "" "match 陳述式採用一個運算式,並將其值與作為一個或多個 case 區塊給出的連續模式" "進行比較。具體來說,模式匹配是透過以下方式進行操作:" -#: ../../whatsnew/3.10.rst:436 +#: ../../whatsnew/3.10.rst:437 msgid "using data with type and shape (the ``subject``)" msgstr "使用具有型態 (type) 和特徵 (shape) 的資料 (主語 ``subject``)" -#: ../../whatsnew/3.10.rst:437 +#: ../../whatsnew/3.10.rst:438 msgid "evaluating the ``subject`` in the ``match`` statement" msgstr "``match`` 陳述式中 ``subject`` 的求值 (evaluating)" -#: ../../whatsnew/3.10.rst:438 +#: ../../whatsnew/3.10.rst:439 msgid "" "comparing the subject with each pattern in a ``case`` statement from top to " "bottom until a match is confirmed." msgstr "從上到下將主語與 ``case`` 陳述式中的每個模式進行比較,直到確認匹配。" -#: ../../whatsnew/3.10.rst:440 +#: ../../whatsnew/3.10.rst:441 msgid "executing the action associated with the pattern of the confirmed match" msgstr "執行與已確認匹配模式對應的操作" -#: ../../whatsnew/3.10.rst:442 +#: ../../whatsnew/3.10.rst:443 msgid "" "If an exact match is not confirmed, the last case, a wildcard ``_``, if " "provided, will be used as the matching case. If an exact match is not " @@ -464,11 +464,11 @@ msgstr "" "到的情況。如未有任何匹配且不存在萬用字元的 case,則整個 match 區塊會是個無操" "作 (no-op)。" -#: ../../whatsnew/3.10.rst:448 +#: ../../whatsnew/3.10.rst:449 msgid "Declarative approach" msgstr "宣告式方法 (Declarative approach)" -#: ../../whatsnew/3.10.rst:450 +#: ../../whatsnew/3.10.rst:451 msgid "" "Readers may be aware of pattern matching through the simple example of " "matching a subject (data object) to a literal (pattern) with the switch " @@ -480,7 +480,7 @@ msgstr "" "式將主語(資料物件)與字面值 (literal)(模式)進行匹配的簡單範例來了解模式匹" "配。 switch 語句通常用於將物件/運算式與包含字面值的 case 陳述式進行比較。" -#: ../../whatsnew/3.10.rst:456 +#: ../../whatsnew/3.10.rst:457 msgid "" "More powerful examples of pattern matching can be found in languages such as " "Scala and Elixir. With structural pattern matching, the approach is " @@ -490,7 +490,7 @@ msgstr "" "更強大的模式匹配範例可以在 Scala 和 Elixir 等語言中找到。對於結構模式匹配,該" "方法是「宣告式的 (declarative)」,並且明確地說明了資料匹配的條件(模式)。" -#: ../../whatsnew/3.10.rst:460 +#: ../../whatsnew/3.10.rst:461 msgid "" "While an \"imperative\" series of instructions using nested \"if\" " "statements could be used to accomplish something similar to structural " @@ -507,11 +507,11 @@ msgstr "" "模式匹配可以用其最簡單的形式達成,將變數與 case 陳述式中的字面值進行比較,但" "它對 Python 的真正價值在於它對主語的型態和特徵的處理。" -#: ../../whatsnew/3.10.rst:469 +#: ../../whatsnew/3.10.rst:470 msgid "Simple pattern: match to a literal" msgstr "簡單模式:與字面值匹配" -#: ../../whatsnew/3.10.rst:471 +#: ../../whatsnew/3.10.rst:472 msgid "" "Let's look at this example as pattern matching in its simplest form: a " "value, the subject, being matched to several literals, the patterns. In the " @@ -523,7 +523,7 @@ msgstr "" "配。在下面的範例中,``status`` 是匹配陳述式的主語。這些模式是每個 case 陳述" "式,其中文字表示請求狀態程式碼。與案例相關的操作在匹配後執行:" -#: ../../whatsnew/3.10.rst:488 +#: ../../whatsnew/3.10.rst:489 msgid "" "If the above function is passed a ``status`` of 418, \"I'm a teapot\" is " "returned. If the above function is passed a ``status`` of 500, the case " @@ -537,22 +537,22 @@ msgstr "" "傳 \"Something's wrong with the internet\"。請注意最後一個區塊:變數名稱 " "``_`` 充當 *萬用字元* 並確保主語始終匹配。``_`` 的使用是可選的。" -#: ../../whatsnew/3.10.rst:495 +#: ../../whatsnew/3.10.rst:496 msgid "" "You can combine several literals in a single pattern using ``|`` (\"or\")::" msgstr "你可以使用 ``|`` (\"or\") 將多個字面值組合在一個模式中:" -#: ../../whatsnew/3.10.rst:501 +#: ../../whatsnew/3.10.rst:502 msgid "Behavior without the wildcard" msgstr "沒有萬用字元 (wildcard) 的行為" -#: ../../whatsnew/3.10.rst:503 +#: ../../whatsnew/3.10.rst:504 msgid "" "If we modify the above example by removing the last case block, the example " "becomes::" msgstr "如果我們透過刪除最後一個 case 區塊來修改上面的範例,則範例將變為:" -#: ../../whatsnew/3.10.rst:515 +#: ../../whatsnew/3.10.rst:516 msgid "" "Without the use of ``_`` in a case statement, a match may not exist. If no " "match exists, the behavior is a no-op. For example, if ``status`` of 500 is " @@ -561,11 +561,11 @@ msgstr "" "如果在 case 陳述式中不使用 ``_``,則可能不存在匹配項目。如果不存在匹配項目," "則該行為是無操作 (no-op)。例如,如果 ``status`` 為 500,則不會有任何操作。" -#: ../../whatsnew/3.10.rst:520 +#: ../../whatsnew/3.10.rst:521 msgid "Patterns with a literal and variable" msgstr "具有字面值和變數的模式" -#: ../../whatsnew/3.10.rst:522 +#: ../../whatsnew/3.10.rst:523 msgid "" "Patterns can look like unpacking assignments, and a pattern may be used to " "bind variables. In this example, a data point can be unpacked to its x-" @@ -574,7 +574,7 @@ msgstr "" "模式看起來就像解包賦值 (unpacking assignment),並且模式可用於繫結 (bind) 變" "數。在此範例中,可以將資料點解包為其 x 坐標和 y 坐標:" -#: ../../whatsnew/3.10.rst:539 +#: ../../whatsnew/3.10.rst:540 msgid "" "The first pattern has two literals, ``(0, 0)``, and may be thought of as an " "extension of the literal pattern shown above. The next two patterns combine " @@ -587,11 +587,11 @@ msgstr "" "(``point``)的值。第四個模式捕獲兩個值,這使得它在概念上類似於解包賦值 " "``(x, y) = point``。" -#: ../../whatsnew/3.10.rst:546 +#: ../../whatsnew/3.10.rst:547 msgid "Patterns and classes" msgstr "模式和類別" -#: ../../whatsnew/3.10.rst:548 +#: ../../whatsnew/3.10.rst:549 msgid "" "If you are using classes to structure your data, you can use as a pattern " "the class name followed by an argument list resembling a constructor. This " @@ -600,11 +600,11 @@ msgstr "" "如果你使用類別來建構資料,則可以用類別名稱與後面的引數列表組合成的建構函式作" "為模式。該模式能夠將類別屬性捕獲到變數中:" -#: ../../whatsnew/3.10.rst:570 +#: ../../whatsnew/3.10.rst:571 msgid "Patterns with positional parameters" msgstr "具有位置參數的模式" -#: ../../whatsnew/3.10.rst:572 +#: ../../whatsnew/3.10.rst:573 msgid "" "You can use positional parameters with some builtin classes that provide an " "ordering for their attributes (e.g. dataclasses). You can also define a " @@ -618,11 +618,11 @@ msgstr "" "置。如果它被設定為 (\"x\", \"y\"),則以下模式都是等效的(且都將 ``y`` 屬性繫" "結到 ``var`` 變數):" -#: ../../whatsnew/3.10.rst:584 +#: ../../whatsnew/3.10.rst:585 msgid "Nested patterns" msgstr "巢狀模式" -#: ../../whatsnew/3.10.rst:586 +#: ../../whatsnew/3.10.rst:587 msgid "" "Patterns can be arbitrarily nested. For example, if our data is a short " "list of points, it could be matched like this::" @@ -630,11 +630,11 @@ msgstr "" "模式可以任意巢套。例如,如果我們的資料是一個簡短的座標點列表,則可以這樣匹" "配:" -#: ../../whatsnew/3.10.rst:602 +#: ../../whatsnew/3.10.rst:603 msgid "Complex patterns and the wildcard" msgstr "複雜模式和萬用字元" -#: ../../whatsnew/3.10.rst:604 +#: ../../whatsnew/3.10.rst:605 msgid "" "To this point, the examples have used ``_`` alone in the last case " "statement. A wildcard can be used in more complex patterns, such as " @@ -643,7 +643,7 @@ msgstr "" "到目前為止,範例在最後一個 case 陳述式中單獨使用了 ``_``。萬用字元可以用在更" "複雜的模式中,像是 ``('error', code, _)``。例如" -#: ../../whatsnew/3.10.rst:614 +#: ../../whatsnew/3.10.rst:615 msgid "" "In the above case, ``test_variable`` will match for ('error', code, 100) and " "('error', code, 800)." @@ -651,11 +651,11 @@ msgstr "" "在上述情況下,值像是 ('error', code, 100) 和 ('error', code, 800) 的 " "``test_variable`` 將會成功匹配。" -#: ../../whatsnew/3.10.rst:618 +#: ../../whatsnew/3.10.rst:619 msgid "Guard" msgstr "Guard" -#: ../../whatsnew/3.10.rst:620 +#: ../../whatsnew/3.10.rst:621 msgid "" "We can add an ``if`` clause to a pattern, known as a \"guard\". If the " "guard is false, ``match`` goes on to try the next case block. Note that " @@ -665,15 +665,15 @@ msgstr "" "則 ``match`` 會繼續嘗試下一個 case 區塊。請注意,值的捕獲發生在 guard 的求值 " "(evaluate) 之前:" -#: ../../whatsnew/3.10.rst:631 +#: ../../whatsnew/3.10.rst:632 msgid "Other Key Features" msgstr "其他主要功能" -#: ../../whatsnew/3.10.rst:633 +#: ../../whatsnew/3.10.rst:634 msgid "Several other key features:" msgstr "其他幾個主要功能:" -#: ../../whatsnew/3.10.rst:635 +#: ../../whatsnew/3.10.rst:636 msgid "" "Like unpacking assignments, tuple and list patterns have exactly the same " "meaning and actually match arbitrary sequences. Technically, the subject " @@ -685,7 +685,7 @@ msgstr "" "列。從技術上來說,主語必須是一個序列。因此,一個重要的例外是模式不會去匹配疊" "代器。另外,為了防止常常出錯,序列模式也不會去匹配字串。" -#: ../../whatsnew/3.10.rst:641 +#: ../../whatsnew/3.10.rst:642 msgid "" "Sequence patterns support wildcards: ``[x, y, *rest]`` and ``(x, y, *rest)`` " "work similar to wildcards in unpacking assignments. The name after ``*`` " @@ -696,7 +696,7 @@ msgstr "" "用字元類似。 ``*`` 後面的名稱也可能是 ``_``,因此 ``(x, y, *_)`` 會匹配至少兩" "個項目的序列,且不繫結其餘項目。" -#: ../../whatsnew/3.10.rst:646 +#: ../../whatsnew/3.10.rst:647 msgid "" "Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the " "``\"bandwidth\"`` and ``\"latency\"`` values from a dict. Unlike sequence " @@ -707,11 +707,11 @@ msgstr "" "``\"bandwidth\"`` 和 ``\"latency\"`` 值。與序列模式不同,額外的鍵將被忽略。也" "支援萬用字元 ``**rest``。(但是 ``**_`` 是多餘的,所以是不允許的。)" -#: ../../whatsnew/3.10.rst:651 +#: ../../whatsnew/3.10.rst:652 msgid "Subpatterns may be captured using the ``as`` keyword::" msgstr "可以使用 ``as`` 關鍵字捕獲子模式:" -#: ../../whatsnew/3.10.rst:655 +#: ../../whatsnew/3.10.rst:656 msgid "" "This binds x1, y1, x2, y2 like you would expect without the ``as`` clause, " "and p2 to the entire second item of the subject." @@ -719,7 +719,7 @@ msgstr "" "這將繫結 x1、y1、x2、y2,如同沒有 ``as`` 子句的情況下所預期的,並將 p2 繫結到" "主語的整個第二項目。" -#: ../../whatsnew/3.10.rst:658 +#: ../../whatsnew/3.10.rst:659 msgid "" "Most literals are compared by equality. However, the singletons ``True``, " "``False`` and ``None`` are compared by identity." @@ -727,7 +727,7 @@ msgstr "" "大多數字面值都是通過相等進行比較的。然而,單例 ``True``、``False`` 和 " "``None`` 是按標識值 (identity) 來進行比較的。" -#: ../../whatsnew/3.10.rst:661 +#: ../../whatsnew/3.10.rst:662 msgid "" "Named constants may be used in patterns. These named constants must be " "dotted names to prevent the constant from being interpreted as a capture " @@ -736,7 +736,7 @@ msgstr "" "附名常數 (named constant) 可以在模式中使用。這些附名常數必須有帶有點的名稱 " "(dotted name),以防止常數被直譯為捕獲的變數:" -#: ../../whatsnew/3.10.rst:680 +#: ../../whatsnew/3.10.rst:681 msgid "" "For the full specification see :pep:`634`. Motivation and rationale are in :" "pep:`635`, and a longer tutorial is in :pep:`636`." @@ -744,11 +744,11 @@ msgstr "" "有關完整規範,請參閱 :pep:`634`。動機和基本原理位於 :pep:`635` 中,較完整的教" "學位於 :pep:`636` 中。" -#: ../../whatsnew/3.10.rst:687 +#: ../../whatsnew/3.10.rst:688 msgid "Optional ``EncodingWarning`` and ``encoding=\"locale\"`` option" msgstr "可選的 ``EncodingWarning`` 和 ``encoding=\"locale\"`` 選項" -#: ../../whatsnew/3.10.rst:689 +#: ../../whatsnew/3.10.rst:690 msgid "" "The default encoding of :class:`TextIOWrapper` and :func:`open` is platform " "and locale dependent. Since UTF-8 is used on most Unix platforms, omitting " @@ -759,7 +759,7 @@ msgstr "" "多數 Unix 平台都使用 UTF-8,因此在打開 UTF-8 檔案(例如 JSON、YAML、TOML、" "Markdown)時省略 ``encoding`` 選項是個常見的 bug,例如:" -#: ../../whatsnew/3.10.rst:698 +#: ../../whatsnew/3.10.rst:699 msgid "" "To find this type of bug, an optional ``EncodingWarning`` is added. It is " "emitted when :data:`sys.flags.warn_default_encoding ` is true and " @@ -769,7 +769,7 @@ msgstr "" "warn_default_encoding ` 為 true 且使用特定於語言環境的預設編碼時," "會發出該信號。" -#: ../../whatsnew/3.10.rst:702 +#: ../../whatsnew/3.10.rst:703 msgid "" "``-X warn_default_encoding`` option and :envvar:`PYTHONWARNDEFAULTENCODING` " "are added to enable the warning." @@ -777,25 +777,25 @@ msgstr "" "新增 ``-X warn_default_encoding`` 選項和 :envvar:`PYTHONWARNDEFAULTENCODING` " "來啟用警告。" -#: ../../whatsnew/3.10.rst:705 +#: ../../whatsnew/3.10.rst:706 msgid "See :ref:`io-text-encoding` for more information." msgstr "更多資訊請見 :ref:`io-text-encoding`\\ 。" -#: ../../whatsnew/3.10.rst:710 +#: ../../whatsnew/3.10.rst:711 msgid "New Features Related to Type Hints" msgstr "與型別提示相關的新功能" -#: ../../whatsnew/3.10.rst:712 +#: ../../whatsnew/3.10.rst:713 msgid "" "This section covers major changes affecting :pep:`484` type hints and the :" "mod:`typing` module." msgstr "本節介紹影響 :pep:`484` 型別提示和 :mod:`typing` 模組的主要更改。" -#: ../../whatsnew/3.10.rst:717 +#: ../../whatsnew/3.10.rst:718 msgid "PEP 604: New Type Union Operator" msgstr "PEP 604:新型聯集運算子" -#: ../../whatsnew/3.10.rst:719 +#: ../../whatsnew/3.10.rst:720 msgid "" "A new type union operator was introduced which enables the syntax ``X | Y``. " "This provides a cleaner way of expressing 'either type X or type Y' instead " @@ -805,7 +805,7 @@ msgstr "" "別提示中更清晰的方式來表達「型別 X 或型別 Y」,來取代使用 :data:`typing." "Union`。" -#: ../../whatsnew/3.10.rst:723 +#: ../../whatsnew/3.10.rst:724 msgid "" "In previous versions of Python, to apply a type hint for functions accepting " "arguments of multiple types, :data:`typing.Union` was used::" @@ -813,22 +813,22 @@ msgstr "" "在以前版本的 Python 中,要使用接受多種型別參數之型別提示的函式,要使用 :data:" "`typing.Union`:" -#: ../../whatsnew/3.10.rst:730 +#: ../../whatsnew/3.10.rst:731 msgid "Type hints can now be written in a more succinct manner::" msgstr "現在可以用更簡潔的方式編寫型別提示:" -#: ../../whatsnew/3.10.rst:736 +#: ../../whatsnew/3.10.rst:737 msgid "" "This new syntax is also accepted as the second argument to :func:" "`isinstance` and :func:`issubclass`::" msgstr "" "這種新語法也接受作為 :func:`isinstance` 和 :func:`issubclass` 的第二個引數:" -#: ../../whatsnew/3.10.rst:742 +#: ../../whatsnew/3.10.rst:743 msgid "See :ref:`types-union` and :pep:`604` for more details." msgstr "更多資訊請見 :ref:`types-union` 與 :pep:`604`\\ 。" -#: ../../whatsnew/3.10.rst:744 +#: ../../whatsnew/3.10.rst:745 msgid "" "(Contributed by Maggie Moss and Philippe Prados in :issue:`41428`, with " "additions by Yurii Karabas and Serhiy Storchaka in :issue:`44490`.)" @@ -836,11 +836,11 @@ msgstr "" "(由 Maggie Moss 和 Philippe Prados 在 :issue:`41428` 中貢獻,由 Yurii " "Karabas 和 Serhiy Storchaka 在 :issue:`44490` 中補充。)" -#: ../../whatsnew/3.10.rst:749 +#: ../../whatsnew/3.10.rst:750 msgid "PEP 612: Parameter Specification Variables" msgstr "PEP 612:參數規範變數" -#: ../../whatsnew/3.10.rst:751 +#: ../../whatsnew/3.10.rst:752 msgid "" "Two new options to improve the information provided to static type checkers " "for :pep:`484`\\ 's ``Callable`` have been added to the :mod:`typing` module." @@ -848,7 +848,7 @@ msgstr "" ":mod:`typing` 模組中新增了兩個新選項,用於改進為 :pep:`484` ``Callable`` 的靜" "態型別檢查器 (static type checker) 所提供的資訊。" -#: ../../whatsnew/3.10.rst:754 +#: ../../whatsnew/3.10.rst:755 msgid "" "The first is the parameter specification variable. They are used to forward " "the parameter types of one callable to another callable -- a pattern " @@ -861,7 +861,7 @@ msgstr "" "用範例可以在 :class:`typing.ParamSpec` 中找到。在過去是沒有簡單的方法可以如此" "精確地來為參數型別的依賴關係做型別註釋。" -#: ../../whatsnew/3.10.rst:760 +#: ../../whatsnew/3.10.rst:761 msgid "" "The second option is the new ``Concatenate`` operator. It's used in " "conjunction with parameter specification variables to type annotate a higher " @@ -872,7 +872,7 @@ msgstr "" "階、會新增或刪除另一個可呼叫物件參數的可呼叫物件進行型別註釋。使用範例可以" "在 :class:`typing.Concatenate` 中找到。" -#: ../../whatsnew/3.10.rst:765 +#: ../../whatsnew/3.10.rst:766 msgid "" "See :class:`typing.Callable`, :class:`typing.ParamSpec`, :class:`typing." "Concatenate`, :class:`typing.ParamSpecArgs`, :class:`typing." @@ -882,7 +882,7 @@ msgstr "" "Concatenate`、:class:`typing.ParamSpecArgs`、:class:`typing.ParamSpecKwargs` " "和 :pep:`612` 以了解更多詳情。" -#: ../../whatsnew/3.10.rst:769 +#: ../../whatsnew/3.10.rst:770 msgid "" "(Contributed by Ken Jin in :issue:`41559`, with minor enhancements by Jelle " "Zijlstra in :issue:`43783`. PEP written by Mark Mendoza.)" @@ -890,11 +890,11 @@ msgstr "" "(由 Ken Jin 在 :issue:`41559` 中貢獻、Jelle Zijlstra 在 :issue:`43783` 中進" "行了小幅改進。PEP 由 Mark Mendoza 編寫。)" -#: ../../whatsnew/3.10.rst:774 +#: ../../whatsnew/3.10.rst:775 msgid "PEP 613: TypeAlias" msgstr "PEP 613:型別別名 (TypeAlias)" -#: ../../whatsnew/3.10.rst:776 +#: ../../whatsnew/3.10.rst:777 msgid "" ":pep:`484` introduced the concept of type aliases, only requiring them to be " "top-level unannotated assignments. This simplicity sometimes made it " @@ -906,7 +906,7 @@ msgstr "" "賦值 (top-level unannotated assignments)。這種簡單性有時使型別檢查器難以區分" "型別別名和普通賦值,尤其是在涉及傳遞參照 (reference) 或無效型別時。比較如下:" -#: ../../whatsnew/3.10.rst:784 +#: ../../whatsnew/3.10.rst:785 msgid "" "Now the :mod:`typing` module has a special value :data:`TypeAlias` which " "lets you declare type aliases more explicitly::" @@ -914,19 +914,19 @@ msgstr "" "現在 :mod:`typing` 模組有一個特殊值 :data:`TypeAlias`,它可以讓你更明確地宣告" "型別別名:" -#: ../../whatsnew/3.10.rst:790 +#: ../../whatsnew/3.10.rst:791 msgid "See :pep:`613` for more details." msgstr "更多資訊請見 :pep:`613`\\ 。" -#: ../../whatsnew/3.10.rst:792 +#: ../../whatsnew/3.10.rst:793 msgid "(Contributed by Mikhail Golubev in :issue:`41923`.)" msgstr "(由 Mikhail Golubev 在 :issue:`41923` 中貢獻。)" -#: ../../whatsnew/3.10.rst:795 +#: ../../whatsnew/3.10.rst:796 msgid "PEP 647: User-Defined Type Guards" msgstr "PEP 647:使用者定義的型別防護" -#: ../../whatsnew/3.10.rst:797 +#: ../../whatsnew/3.10.rst:798 msgid "" ":data:`TypeGuard` has been added to the :mod:`typing` module to annotate " "type guard functions and improve information provided to static type " @@ -937,7 +937,7 @@ msgstr "" "護函式並改進在型別窄縮 (type narrowing) 期間提供給靜態型別檢查器的資訊。有關" "更多資訊,請參閱 :data:`TypeGuard` 的文件和 :pep:`647`。" -#: ../../whatsnew/3.10.rst:802 +#: ../../whatsnew/3.10.rst:803 msgid "" "(Contributed by Ken Jin and Guido van Rossum in :issue:`43766`. PEP written " "by Eric Traut.)" @@ -945,11 +945,11 @@ msgstr "" "(由 Ken Jin 和 Guido van Rossum 在 :issue:`43766` 中貢獻。PEP 由 Eric Traut " "編寫。)" -#: ../../whatsnew/3.10.rst:806 +#: ../../whatsnew/3.10.rst:807 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/3.10.rst:808 +#: ../../whatsnew/3.10.rst:809 msgid "" "The :class:`int` type has a new method :meth:`int.bit_count`, returning the " "number of ones in the binary expansion of a given integer, also known as the " @@ -959,7 +959,7 @@ msgstr "" "式中 1 的數量,也稱為總體計數 (population count)。(由 Niklas Fiekas 在 :" "issue:`29882` 中貢獻。)" -#: ../../whatsnew/3.10.rst:812 +#: ../../whatsnew/3.10.rst:813 msgid "" "The views returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:`dict." "items` now all have a ``mapping`` attribute that gives a :class:`types." @@ -971,7 +971,7 @@ msgstr "" "MappingProxyType` 包裝原始的字典物件。(由 Dennis Sweeney 在 :issue:`40890` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:817 +#: ../../whatsnew/3.10.rst:818 msgid "" ":pep:`618`: The :func:`zip` function now has an optional ``strict`` flag, " "used to require that all the iterables have an equal length." @@ -979,7 +979,7 @@ msgstr "" ":pep:`618`::func:`zip` 函式現在有一個可選的 ``strict`` 旗標,用於要求所有可" "疊代物件具有相同的長度。" -#: ../../whatsnew/3.10.rst:820 +#: ../../whatsnew/3.10.rst:821 msgid "" "Builtin and extension functions that take integer arguments no longer " "accept :class:`~decimal.Decimal`\\ s, :class:`~fractions.Fraction`\\ s and " @@ -992,7 +992,7 @@ msgstr "" "meth:`~object.__int__` 方法,但沒有 :meth:`~object.__index__` 方法)。(由 " "Serhiy Storchaka 在 :issue:`37999` 中貢獻。)" -#: ../../whatsnew/3.10.rst:827 +#: ../../whatsnew/3.10.rst:828 msgid "" "If :func:`object.__ipow__` returns :const:`NotImplemented`, the operator " "will correctly fall back to :func:`object.__pow__` and :func:`object." @@ -1002,7 +1002,7 @@ msgstr "" "正確回退到 :func:`object.__pow__` 和 :func:`object.__rpow__` 。(由 Alex " "Shkop 在 :issue:`38302` 中貢獻。)" -#: ../../whatsnew/3.10.rst:831 +#: ../../whatsnew/3.10.rst:832 msgid "" "Assignment expressions can now be used unparenthesized within set literals " "and set comprehensions, as well as in sequence indexes (but not slices)." @@ -1010,7 +1010,7 @@ msgstr "" "現在可以在集合字面值 (set literals) 和集合綜合運算 (set comprehensions) 以及" "序列索引(但不能是切片)中使用不帶括號的賦值運算式 (assignment expressions)。" -#: ../../whatsnew/3.10.rst:834 +#: ../../whatsnew/3.10.rst:835 msgid "" "Functions have a new ``__builtins__`` attribute which is used to look for " "builtin symbols when a function is executed, instead of looking into " @@ -1023,7 +1023,7 @@ msgstr "" "存在,則屬性會以此做初始化,否則從當前內建物件 (builtins) 初始化。(由 Mark " "Shannon 在 :issue:`42990` 中貢獻。)" -#: ../../whatsnew/3.10.rst:840 +#: ../../whatsnew/3.10.rst:841 msgid "" "Two new builtin functions -- :func:`aiter` and :func:`anext` have been added " "to provide asynchronous counterparts to :func:`iter` and :func:`next`, " @@ -1034,7 +1034,7 @@ msgstr "" "func:`next` 提供非同步的對應函式。(由 Joshua Bronson、Daniel Pope 和 Justin " "Wang 在 :issue:`31861` 中貢獻。)" -#: ../../whatsnew/3.10.rst:845 +#: ../../whatsnew/3.10.rst:846 msgid "" "Static methods (:func:`@staticmethod `) and class methods (:" "func:`@classmethod `) now inherit the method attributes " @@ -1049,7 +1049,7 @@ msgstr "" "的 ``__wrapped__`` 屬性。此外,靜態方法現在可以像是常規函式般呼叫。(由 " "Victor Stinner 在 :issue:`43682` 中貢獻。)" -#: ../../whatsnew/3.10.rst:852 +#: ../../whatsnew/3.10.rst:853 msgid "" "Annotations for complex targets (everything beside ``simple name`` targets " "defined by :pep:`526`) no longer cause any runtime effects with ``from " @@ -1060,7 +1060,7 @@ msgstr "" "使用 ``from __future__ import comments`` 造成任何執行環境 (runtime) 影響。" "(由 Batuhan Taskaya 在 :issue:`42737` 中貢獻。)" -#: ../../whatsnew/3.10.rst:856 +#: ../../whatsnew/3.10.rst:857 msgid "" "Class and module objects now lazy-create empty annotations dicts on demand. " "The annotations dicts are stored in the object’s ``__dict__`` for backwards " @@ -1073,7 +1073,7 @@ msgstr "" "改進了 ``__annotations__`` 使用方式的最佳實踐方法;有關更多資訊,請參閱 :ref:" "`annotations-howto`。(由 Larry Hastings 在 :issue:`43901` 中貢獻。)" -#: ../../whatsnew/3.10.rst:863 +#: ../../whatsnew/3.10.rst:864 msgid "" "Annotations consist of ``yield``, ``yield from``, ``await`` or named " "expressions are now forbidden under ``from __future__ import annotations`` " @@ -1084,7 +1084,7 @@ msgstr "" "__future__ import comments`` 下被禁止,因為它們有些不預期的行為。(由 " "Batuhan Taskaya 在 :issue:`42725` 中貢獻。)" -#: ../../whatsnew/3.10.rst:868 +#: ../../whatsnew/3.10.rst:869 msgid "" "Usage of unbound variables, ``super()`` and other expressions that might " "alter the processing of symbol table as annotations are now rendered " @@ -1095,7 +1095,7 @@ msgstr "" "(symbol table) 的運算式,現在在 ``from __future__ import comments`` 下變得無" "效。(由 Batuhan Taskaya 在 :issue:`42725` 中貢獻。)" -#: ../../whatsnew/3.10.rst:873 +#: ../../whatsnew/3.10.rst:874 msgid "" "Hashes of NaN values of both :class:`float` type and :class:`decimal." "Decimal` type now depend on object identity. Formerly, they always hashed to " @@ -1110,7 +1110,7 @@ msgstr "" "collision),可能導致潛在的二次方執行環境行為 (quadratic runtime behavior)。" "(由 Raymond Hettinger 在 :issue:`43475` 中貢獻。)" -#: ../../whatsnew/3.10.rst:880 +#: ../../whatsnew/3.10.rst:881 msgid "" "A :exc:`SyntaxError` (instead of a :exc:`NameError`) will be raised when " "deleting the :const:`__debug__` constant. (Contributed by Donghee Na in :" @@ -1119,7 +1119,7 @@ msgstr "" "刪除 :const:`__debug__` 常數時將引發 :exc:`SyntaxError` (而不是 :exc:" "`NameError`)。(由 Donghee Na 在 :issue:`45000` 中貢獻。)" -#: ../../whatsnew/3.10.rst:883 +#: ../../whatsnew/3.10.rst:884 msgid "" ":exc:`SyntaxError` exceptions now have ``end_lineno`` and ``end_offset`` " "attributes. They will be ``None`` if not determined. (Contributed by Pablo " @@ -1128,23 +1128,23 @@ msgstr "" ":exc:`SyntaxError` 例外現在具有 ``end_lineno`` 和 ``end_offset`` 屬性。如果未" "被決定,它們將會是 ``None``。(由 Pablo Galindo 在 :issue:`43914` 中貢獻。)" -#: ../../whatsnew/3.10.rst:888 +#: ../../whatsnew/3.10.rst:889 msgid "New Modules" msgstr "新模組" -#: ../../whatsnew/3.10.rst:890 +#: ../../whatsnew/3.10.rst:891 msgid "None." msgstr "無。" -#: ../../whatsnew/3.10.rst:894 +#: ../../whatsnew/3.10.rst:895 msgid "Improved Modules" msgstr "改進的模組" -#: ../../whatsnew/3.10.rst:897 +#: ../../whatsnew/3.10.rst:898 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.10.rst:899 +#: ../../whatsnew/3.10.rst:900 msgid "" "Add missing :meth:`~asyncio.events.AbstractEventLoop." "connect_accepted_socket` method. (Contributed by Alex Grönholm in :issue:" @@ -1153,11 +1153,11 @@ msgstr "" "新增缺少的 :meth:`~asyncio.events.AbstractEventLoop.connect_accepted_socket` " "方法。(由 Alex Grönholm 在 :issue:`41332` 中貢獻。)" -#: ../../whatsnew/3.10.rst:904 +#: ../../whatsnew/3.10.rst:905 msgid "argparse" msgstr "argparse" -#: ../../whatsnew/3.10.rst:906 +#: ../../whatsnew/3.10.rst:907 msgid "" "Misleading phrase \"optional arguments\" was replaced with \"options\" in " "argparse help. Some tests might require adaptation if they rely on exact " @@ -1167,11 +1167,11 @@ msgstr "" "(options)」。某些依賴於精確輸出匹配的測試可能需要進行調整。(由 Raymond " "Hettinger 在 :issue:`9694` 中貢獻。)" -#: ../../whatsnew/3.10.rst:910 +#: ../../whatsnew/3.10.rst:911 msgid "array" msgstr "array" -#: ../../whatsnew/3.10.rst:912 +#: ../../whatsnew/3.10.rst:913 msgid "" "The :meth:`~array.array.index` method of :class:`array.array` now has " "optional *start* and *stop* parameters. (Contributed by Anders Lorentsen and " @@ -1181,11 +1181,11 @@ msgstr "" "*start* 和 *stop* 參數。(由 Anders Lorentsen 和 Zackery Spytz 在 :issue:" "`31956` 中貢獻。)" -#: ../../whatsnew/3.10.rst:917 +#: ../../whatsnew/3.10.rst:918 msgid "asynchat, asyncore, smtpd" msgstr "asynchat, asyncore, smtpd" -#: ../../whatsnew/3.10.rst:918 +#: ../../whatsnew/3.10.rst:919 msgid "" "These modules have been marked as deprecated in their module documentation " "since Python 3.6. An import-time :class:`DeprecationWarning` has now been " @@ -1194,11 +1194,11 @@ msgstr "" "自 Python 3.6 起,這些模組在其文件中被標記為已棄用。引入時的 :class:" "`DeprecationWarning` 現已新增到這三個模組中。" -#: ../../whatsnew/3.10.rst:923 +#: ../../whatsnew/3.10.rst:924 msgid "base64" msgstr "base64" -#: ../../whatsnew/3.10.rst:925 +#: ../../whatsnew/3.10.rst:926 msgid "" "Add :func:`base64.b32hexencode` and :func:`base64.b32hexdecode` to support " "the Base32 Encoding with Extended Hex Alphabet." @@ -1206,11 +1206,11 @@ msgstr "" "新增 :func:`base64.b32hexencode` 和 :func:`base64.b32hexdecode` 以支援擴充十" "六進位字母的 Base32 編碼 (Base32 Encoding with Extended Hex Alphabet)。" -#: ../../whatsnew/3.10.rst:929 +#: ../../whatsnew/3.10.rst:930 msgid "bdb" msgstr "bdb" -#: ../../whatsnew/3.10.rst:931 +#: ../../whatsnew/3.10.rst:932 msgid "" "Add :meth:`~bdb.Breakpoint.clearBreakpoints` to reset all set breakpoints. " "(Contributed by Irit Katriel in :issue:`24160`.)" @@ -1218,11 +1218,11 @@ msgstr "" "新增 :meth:`~bdb.Breakpoint.clearBreakpoints` 來重置所有設定的斷點。(由 " "Irit Katriel 在 :issue:`24160` 中貢獻。)" -#: ../../whatsnew/3.10.rst:935 +#: ../../whatsnew/3.10.rst:936 msgid "bisect" msgstr "bisect" -#: ../../whatsnew/3.10.rst:937 +#: ../../whatsnew/3.10.rst:938 msgid "" "Added the possibility of providing a *key* function to the APIs in the :mod:" "`bisect` module. (Contributed by Raymond Hettinger in :issue:`4356`.)" @@ -1230,11 +1230,11 @@ msgstr "" "新增向 :mod:`bisect` 模組 API 提供 *key* 函式的可能性。(由 Raymond " "Hettinger 在 :issue:`4356` 中貢獻。)" -#: ../../whatsnew/3.10.rst:941 +#: ../../whatsnew/3.10.rst:942 msgid "codecs" msgstr "codecs" -#: ../../whatsnew/3.10.rst:943 +#: ../../whatsnew/3.10.rst:944 msgid "" "Add a :func:`codecs.unregister` function to unregister a codec search " "function. (Contributed by Hai Shi in :issue:`41842`.)" @@ -1242,11 +1242,11 @@ msgstr "" "新增 :func:`codecs.unregister` 函式來取消註冊 (unregister) 一個編解碼器的搜索" "功能。 (Hai Shi 在 :issue:`41842` 中貢獻。)" -#: ../../whatsnew/3.10.rst:947 +#: ../../whatsnew/3.10.rst:948 msgid "collections.abc" msgstr "collections.abc" -#: ../../whatsnew/3.10.rst:949 +#: ../../whatsnew/3.10.rst:950 msgid "" "The ``__args__`` of the :ref:`parameterized generic ` " "for :class:`collections.abc.Callable` are now consistent with :data:`typing." @@ -1272,11 +1272,11 @@ msgstr "" "Callable` 參數化可能會引發 :exc:`TypeError`,而在 Python 3.9 中該參數可能會無" "引發例外地傳遞。(由 Ken Jin 在 :issue:`42195` 中貢獻。)" -#: ../../whatsnew/3.10.rst:962 +#: ../../whatsnew/3.10.rst:963 msgid "contextlib" msgstr "contextlib" -#: ../../whatsnew/3.10.rst:964 +#: ../../whatsnew/3.10.rst:965 msgid "" "Add a :func:`contextlib.aclosing` context manager to safely close async " "generators and objects representing asynchronously released resources. " @@ -1286,7 +1286,7 @@ msgstr "" "步釋放資源的物件。(由 Joongi Kim 和 John Belmonte 在 :issue:`41229` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:968 +#: ../../whatsnew/3.10.rst:969 msgid "" "Add asynchronous context manager support to :func:`contextlib.nullcontext`. " "(Contributed by Tom Gringauz in :issue:`41543`.)" @@ -1294,7 +1294,7 @@ msgstr "" "向 :func:`contextlib.nullcontext` 新增非同步情境管理器支援。(由 Tom " "Gringauz 在 :issue:`41543` 中貢獻。)" -#: ../../whatsnew/3.10.rst:971 +#: ../../whatsnew/3.10.rst:972 msgid "" "Add :class:`AsyncContextDecorator`, for supporting usage of async context " "managers as decorators." @@ -1302,11 +1302,11 @@ msgstr "" "新增 :class:`AsyncContextDecorator`,用於支援將非同步情境管理器作為裝飾器使" "用。" -#: ../../whatsnew/3.10.rst:975 +#: ../../whatsnew/3.10.rst:976 msgid "curses" msgstr "curses" -#: ../../whatsnew/3.10.rst:977 +#: ../../whatsnew/3.10.rst:978 msgid "" "The extended color functions added in ncurses 6.1 will be used transparently " "by :func:`curses.color_content`, :func:`curses.init_color`, :func:`curses." @@ -1321,7 +1321,7 @@ msgstr "" "ncurses 函式庫是否支援擴充顏色。 (由 Jeffrey Kintscher 和 Hans Petter " "Jansson 在 :issue:`36982` 中貢獻。)" -#: ../../whatsnew/3.10.rst:984 +#: ../../whatsnew/3.10.rst:985 msgid "" "The ``BUTTON5_*`` constants are now exposed in the :mod:`curses` module if " "they are provided by the underlying curses library. (Contributed by Zackery " @@ -1330,15 +1330,15 @@ msgstr "" "如果 ``BUTTON5_*`` 常數是由底層 :mod:`curses` 函式庫提供的,那麼它們現在會在 " "curses 模組中公開。(由 Zackery Spytz 在 :issue:`39273` 中貢獻。)" -#: ../../whatsnew/3.10.rst:989 +#: ../../whatsnew/3.10.rst:990 msgid "dataclasses" msgstr "dataclasses" -#: ../../whatsnew/3.10.rst:992 +#: ../../whatsnew/3.10.rst:993 msgid "__slots__" msgstr "__slots__" -#: ../../whatsnew/3.10.rst:994 +#: ../../whatsnew/3.10.rst:995 msgid "" "Added ``slots`` parameter in :func:`dataclasses.dataclass` decorator. " "(Contributed by Yurii Karabas in :issue:`42269`)" @@ -1346,11 +1346,11 @@ msgstr "" "在 :func:`dataclasses.dataclass` 裝飾器中新增了 ``slots`` 參數。(由 Yurii " "Karabas 在 :issue:`42269` 中貢獻)" -#: ../../whatsnew/3.10.rst:998 +#: ../../whatsnew/3.10.rst:999 msgid "Keyword-only fields" msgstr "僅限關鍵字欄位 (Keyword-only fields)" -#: ../../whatsnew/3.10.rst:1000 +#: ../../whatsnew/3.10.rst:1001 msgid "" "dataclasses now supports fields that are keyword-only in the generated " "__init__ method. There are a number of ways of specifying keyword-only " @@ -1359,21 +1359,21 @@ msgstr "" "dataclasses 現在支援在產生的 __init__ 方法中包含僅限關鍵字的欄位。有多種方法" "可以指定僅限關鍵字欄位。" -#: ../../whatsnew/3.10.rst:1004 +#: ../../whatsnew/3.10.rst:1005 msgid "You can say that every field is keyword-only:" msgstr "你可以說每個欄位都是關鍵字:" -#: ../../whatsnew/3.10.rst:1015 +#: ../../whatsnew/3.10.rst:1016 msgid "" "Both ``name`` and ``birthday`` are keyword-only parameters to the generated " "__init__ method." msgstr "``name`` 和 ``birthday`` 都是產生的 __init__ 方法的僅限關鍵字參數。" -#: ../../whatsnew/3.10.rst:1018 +#: ../../whatsnew/3.10.rst:1019 msgid "You can specify keyword-only on a per-field basis:" msgstr "你可以在每個欄位的基礎上指定僅限關鍵字:" -#: ../../whatsnew/3.10.rst:1029 +#: ../../whatsnew/3.10.rst:1030 msgid "" "Here only ``birthday`` is keyword-only. If you set ``kw_only`` on " "individual fields, be aware that there are rules about re-ordering fields " @@ -1384,7 +1384,7 @@ msgstr "" "意,由於僅限關鍵字欄位需要遵循非僅限關鍵字欄位,因此會有欄位重新排序的相關規" "則。詳細資訊請參閱完整的 dataclasses 文件。" -#: ../../whatsnew/3.10.rst:1034 +#: ../../whatsnew/3.10.rst:1035 msgid "" "You can also specify that all fields following a KW_ONLY marker are keyword-" "only. This will probably be the most common usage:" @@ -1392,7 +1392,7 @@ msgstr "" "你還可以指定 KW_ONLY 標記後面的所有欄位均為僅限關鍵字欄位。這可能是最常見的用" "法:" -#: ../../whatsnew/3.10.rst:1049 +#: ../../whatsnew/3.10.rst:1050 msgid "" "Here, ``z`` and ``t`` are keyword-only parameters, while ``x`` and ``y`` are " "not. (Contributed by Eric V. Smith in :issue:`43532`.)" @@ -1400,11 +1400,11 @@ msgstr "" "這裡的 ``z`` 和 ``t`` 是僅限關鍵字參數,而 ``x`` 和 ``y`` 則不是。(由 Eric " "V. Smith 在 :issue:`43532` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1056 +#: ../../whatsnew/3.10.rst:1057 msgid "distutils" msgstr "distutils" -#: ../../whatsnew/3.10.rst:1058 +#: ../../whatsnew/3.10.rst:1059 msgid "" "The entire ``distutils`` package is deprecated, to be removed in Python " "3.12. Its functionality for specifying package builds has already been " @@ -1423,7 +1423,7 @@ msgstr "" "遷移任何其他地方的計畫,且使用其他功能的應用程式應該開始規劃如何取得程式碼的" "私有副本。請參閱 :pep:`632` 的討論。" -#: ../../whatsnew/3.10.rst:1068 +#: ../../whatsnew/3.10.rst:1069 msgid "" "The ``bdist_wininst`` command deprecated in Python 3.8 has been removed. The " "``bdist_wheel`` command is now recommended to distribute binary packages on " @@ -1433,12 +1433,12 @@ msgstr "" "``bdist_wheel`` 命令來在 Windows 上發布二進位套件。(由 Victor Stinner 在 :" "issue:`42802` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1074 +#: ../../whatsnew/3.10.rst:1075 msgid "doctest" msgstr "doctest" -#: ../../whatsnew/3.10.rst:1076 ../../whatsnew/3.10.rst:1211 -#: ../../whatsnew/3.10.rst:1238 ../../whatsnew/3.10.rst:1337 +#: ../../whatsnew/3.10.rst:1077 ../../whatsnew/3.10.rst:1212 +#: ../../whatsnew/3.10.rst:1239 ../../whatsnew/3.10.rst:1338 msgid "" "When a module does not define ``__loader__``, fall back to ``__spec__." "loader``. (Contributed by Brett Cannon in :issue:`42133`.)" @@ -1446,11 +1446,11 @@ msgstr "" "當模組未定義 ``__loader__`` 時,回退到 ``__spec__.loader`` 。(由 Brett " "Cannon 在 :issue:`42133` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1080 +#: ../../whatsnew/3.10.rst:1081 msgid "encodings" msgstr "encodings" -#: ../../whatsnew/3.10.rst:1082 +#: ../../whatsnew/3.10.rst:1083 msgid "" ":func:`encodings.normalize_encoding` now ignores non-ASCII characters. " "(Contributed by Hai Shi in :issue:`39337`.)" @@ -1458,11 +1458,11 @@ msgstr "" ":func:`encodings.normalize_encoding` 現在會忽略非 ASCII 字元。(Hai Shi 在 :" "issue:`39337` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1086 +#: ../../whatsnew/3.10.rst:1087 msgid "enum" msgstr "enum" -#: ../../whatsnew/3.10.rst:1088 +#: ../../whatsnew/3.10.rst:1089 msgid "" ":class:`Enum` :func:`__repr__` now returns ``enum_name.member_name`` and :" "func:`__str__` now returns ``member_name``. Stdlib enums available as " @@ -1474,7 +1474,7 @@ msgstr "" "``module_name.member_name`` 的 :func:`repr`。(由 Ethan Furman 在 :issue:" "`40066` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1093 +#: ../../whatsnew/3.10.rst:1094 msgid "" "Add :class:`enum.StrEnum` for enums where all members are strings. " "(Contributed by Ethan Furman in :issue:`41816`.)" @@ -1482,11 +1482,11 @@ msgstr "" "新增 :class:`enum.StrEnum`,為所有成員都是字串的列舉。(由 Ethan Furman 在 :" "issue:`41816` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1097 +#: ../../whatsnew/3.10.rst:1098 msgid "fileinput" msgstr "fileinput" -#: ../../whatsnew/3.10.rst:1099 +#: ../../whatsnew/3.10.rst:1100 msgid "" "Add *encoding* and *errors* parameters in :func:`fileinput.input` and :class:" "`fileinput.FileInput`. (Contributed by Inada Naoki in :issue:`43712`.)" @@ -1494,7 +1494,7 @@ msgstr "" "在 :func:`fileinput.input` 和 :class:`fileinput.FileInput` 中新增 *encoding* " "和 *errors* 參數。(由 Inada Naoki 在 :issue:`43712` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1103 +#: ../../whatsnew/3.10.rst:1104 msgid "" ":func:`fileinput.hook_compressed` now returns :class:`TextIOWrapper` object " "when *mode* is \"r\" and file is compressed, like uncompressed files. " @@ -1504,11 +1504,11 @@ msgstr "" "會回傳 :class:`TextIOWrapper` 物件(和未壓縮檔案一樣)。(由 Inada Naoki 在 :" "issue:`5758` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1108 +#: ../../whatsnew/3.10.rst:1109 msgid "faulthandler" msgstr "faulthandler" -#: ../../whatsnew/3.10.rst:1110 +#: ../../whatsnew/3.10.rst:1111 msgid "" "The :mod:`faulthandler` module now detects if a fatal error occurs during a " "garbage collector collection. (Contributed by Victor Stinner in :issue:" @@ -1517,11 +1517,11 @@ msgstr "" ":mod:`faulthandler` 模組現在可以檢測垃圾收集器 (garbage collector) 在收集期間" "是否發生嚴重錯誤。(由 Victor Stinner 在 :issue:`44466` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1115 +#: ../../whatsnew/3.10.rst:1116 msgid "gc" msgstr "gc" -#: ../../whatsnew/3.10.rst:1117 +#: ../../whatsnew/3.10.rst:1118 msgid "" "Add audit hooks for :func:`gc.get_objects`, :func:`gc.get_referrers` and :" "func:`gc.get_referents`. (Contributed by Pablo Galindo in :issue:`43439`.)" @@ -1530,11 +1530,11 @@ msgstr "" "get_referents` 新增稽核掛鉤 (audit hooks)。(由 Pablo Galindo 在 :issue:" "`43439` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1121 +#: ../../whatsnew/3.10.rst:1122 msgid "glob" msgstr "glob" -#: ../../whatsnew/3.10.rst:1123 +#: ../../whatsnew/3.10.rst:1124 msgid "" "Add the *root_dir* and *dir_fd* parameters in :func:`~glob.glob` and :func:" "`~glob.iglob` which allow to specify the root directory for searching. " @@ -1543,11 +1543,11 @@ msgstr "" "在 :func:`~glob.glob` 和 :func:`~glob.iglob` 中新增 *root_dir* 和 *dir_fd* 參" "數,允許指定搜索的根目錄。(由 Serhiy Storchaka 在 :issue:`38144` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1128 +#: ../../whatsnew/3.10.rst:1129 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.10.rst:1130 +#: ../../whatsnew/3.10.rst:1131 msgid "" "The hashlib module requires OpenSSL 1.1.1 or newer. (Contributed by " "Christian Heimes in :pep:`644` and :issue:`43669`.)" @@ -1555,7 +1555,7 @@ msgstr "" "hashlib 模組需要 OpenSSL 1.1.1 或更高版本。(由 Christian Heimes 在 :pep:" "`644` 和 :issue:`43669` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1133 +#: ../../whatsnew/3.10.rst:1134 msgid "" "The hashlib module has preliminary support for OpenSSL 3.0.0. (Contributed " "by Christian Heimes in :issue:`38820` and other issues.)" @@ -1563,7 +1563,7 @@ msgstr "" "hashlib 模組初步支援 OpenSSL 3.0.0。(由 Christian Heimes 在 :issue:`38820` " "和其他問題中貢獻。)" -#: ../../whatsnew/3.10.rst:1136 +#: ../../whatsnew/3.10.rst:1137 msgid "" "The pure-Python fallback of :func:`~hashlib.pbkdf2_hmac` is deprecated. In " "the future PBKDF2-HMAC will only be available when Python has been built " @@ -1573,11 +1573,11 @@ msgstr "" "支援的建置 Python 中才能夠使用 PBKDF2-HMAC。(由 Christian Heimes 在 :issue:" "`43880` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1142 +#: ../../whatsnew/3.10.rst:1143 msgid "hmac" msgstr "hmac" -#: ../../whatsnew/3.10.rst:1144 +#: ../../whatsnew/3.10.rst:1145 msgid "" "The hmac module now uses OpenSSL's HMAC implementation internally. " "(Contributed by Christian Heimes in :issue:`40645`.)" @@ -1585,11 +1585,11 @@ msgstr "" "hmac 模組現在在內部使用 OpenSSL 的 HMAC 實作。 (由 Christian Heimes 在 :" "issue:`40645` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1148 +#: ../../whatsnew/3.10.rst:1149 msgid "IDLE and idlelib" msgstr "IDLE 和 idlelib" -#: ../../whatsnew/3.10.rst:1150 +#: ../../whatsnew/3.10.rst:1151 msgid "" "Make IDLE invoke :func:`sys.excepthook` (when started without '-n'). User " "hooks were previously ignored. (Contributed by Ken Hilton in :issue:" @@ -1599,7 +1599,7 @@ msgstr "" "掛鉤 (user hooks) 在以前是被忽略的。(由 Ken Hilton 在 :issue:`43008` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1154 +#: ../../whatsnew/3.10.rst:1155 msgid "" "Rearrange the settings dialog. Split the General tab into Windows and Shell/" "Ed tabs. Move help sources, which extend the Help menu, to the Extensions " @@ -1615,11 +1615,11 @@ msgstr "" "獻。)將縮排空間設定從 Font 分頁移至新的 Windows 分頁。(由 Mark Roseman 和 " "Terry Jan Reedy 在 :issue:`33962` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1162 +#: ../../whatsnew/3.10.rst:1163 msgid "The changes above were backported to a 3.9 maintenance release." msgstr "上述更改已向後移植到 3.9 維護版本。" -#: ../../whatsnew/3.10.rst:1164 +#: ../../whatsnew/3.10.rst:1165 msgid "" "Add a Shell sidebar. Move the primary prompt ('>>>') to the sidebar. Add " "secondary prompts ('...') to the sidebar. Left click and optional drag " @@ -1635,7 +1635,7 @@ msgstr "" "prompts)」的情境選單,這會將側邊欄中提示字元與所選文字並排,此選項也會出現在" "文字的情境選單上。(由 Tal Einat 在 :issue:`37903` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1173 +#: ../../whatsnew/3.10.rst:1174 msgid "" "Use spaces instead of tabs to indent interactive code. This makes " "interactive code entries 'look right'. Making this feasible was a major " @@ -1646,7 +1646,7 @@ msgstr "" "起來正確」。新增 shell 側邊欄的主要動機是實現這一點。(由 Terry Jan Reedy " "在 :issue:`37892` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1178 +#: ../../whatsnew/3.10.rst:1179 msgid "" "Highlight the new :ref:`soft keywords ` :keyword:`match`, :" "keyword:`case `, and :keyword:`_ ` in pattern-" @@ -1659,11 +1659,11 @@ msgstr "" "`。然而這種突顯並不完美,並且在某些罕見的情況下會出錯,包" "括 ``case`` 模式中的一些 ``_``。(由 Tal Einat 在 :issue:`44010` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1184 +#: ../../whatsnew/3.10.rst:1185 msgid "New in 3.10 maintenance releases." msgstr "3.10 維護版本中的新增功能。" -#: ../../whatsnew/3.10.rst:1186 +#: ../../whatsnew/3.10.rst:1187 msgid "" "Apply syntax highlighting to ``.pyi`` files. (Contributed by Alex Waygood " "and Terry Jan Reedy in :issue:`45447`.)" @@ -1671,7 +1671,7 @@ msgstr "" "將語法突顯 (syntax highlighting) 應用於 ``.pyi`` 檔案。(由 Alex Waygood 和 " "Terry Jan Reedy 在 :issue:`45447` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1189 +#: ../../whatsnew/3.10.rst:1190 msgid "" "Include prompts when saving Shell with inputs and outputs. (Contributed by " "Terry Jan Reedy in :gh:`95191`.)" @@ -1679,11 +1679,11 @@ msgstr "" "保存帶有輸入和輸出的 Shell 時,會包含提示字元。(由 Terry Jan Reedy 在 :gh:" "`95191` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1193 +#: ../../whatsnew/3.10.rst:1194 msgid "importlib.metadata" msgstr "importlib.metadata" -#: ../../whatsnew/3.10.rst:1195 +#: ../../whatsnew/3.10.rst:1196 msgid "" "Feature parity with ``importlib_metadata`` 4.6 (`history `_)." @@ -1691,7 +1691,7 @@ msgstr "" "與 ``importlib_metadata`` 4.6 功能相同(`歷史 `_)。" -#: ../../whatsnew/3.10.rst:1198 +#: ../../whatsnew/3.10.rst:1199 msgid "" ":ref:`importlib.metadata entry points ` now provide a nicer " "experience for selecting entry points by group and name through a new :class:" @@ -1702,7 +1702,7 @@ msgstr "" "`importlib.metadata.EntryPoints` 類別提供了以群組和名稱選擇入口點的更好體驗。" "有關棄用與用法的更多資訊,請參閱文件中的相容性說明。" -#: ../../whatsnew/3.10.rst:1204 +#: ../../whatsnew/3.10.rst:1205 msgid "" "Added :func:`importlib.metadata.packages_distributions` for resolving top-" "level Python modules and packages to their :class:`importlib.metadata." @@ -1711,11 +1711,11 @@ msgstr "" "新增了 :func:`importlib.metadata.packages_distributions` 用於將頂階 Python 模" "組和套件解析出 :class:`importlib.metadata.Distribution`。" -#: ../../whatsnew/3.10.rst:1209 +#: ../../whatsnew/3.10.rst:1210 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.10.rst:1214 +#: ../../whatsnew/3.10.rst:1215 msgid "" "Add :func:`inspect.get_annotations`, which safely computes the annotations " "defined on an object. It works around the quirks of accessing the " @@ -1743,11 +1743,11 @@ msgstr "" "著 :func:`inspect.signature` 和 :func:`inspect.Signature.from_callable` 現在" "也可以取消字串化註釋。(由 Larry Hastings 在 :issue:`43817` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1230 +#: ../../whatsnew/3.10.rst:1231 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.10.rst:1232 +#: ../../whatsnew/3.10.rst:1233 msgid "" "Add :func:`itertools.pairwise()`. (Contributed by Raymond Hettinger in :" "issue:`38200`.)" @@ -1755,15 +1755,15 @@ msgstr "" "新增 :func:`itertools.pairwise()`。(由 Raymond Hettinger 在 :issue:`38200` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:1236 +#: ../../whatsnew/3.10.rst:1237 msgid "linecache" msgstr "linecache" -#: ../../whatsnew/3.10.rst:1242 +#: ../../whatsnew/3.10.rst:1243 msgid "os" msgstr "os" -#: ../../whatsnew/3.10.rst:1244 +#: ../../whatsnew/3.10.rst:1245 msgid "" "Add :func:`os.cpu_count()` support for VxWorks RTOS. (Contributed by Peixing " "Xin in :issue:`41440`.)" @@ -1771,7 +1771,7 @@ msgstr "" "為 VxWorks RTOS 新增 :func:`os.cpu_count()` 支援。(由 Peixing Xin 在 :issue:" "`41440` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1247 +#: ../../whatsnew/3.10.rst:1248 msgid "" "Add a new function :func:`os.eventfd` and related helpers to wrap the " "``eventfd2`` syscall on Linux. (Contributed by Christian Heimes in :issue:" @@ -1780,7 +1780,7 @@ msgstr "" "新增函式 :func:`os.eventfd` 和相關幫助程式來包裝 Linux 上的 ``eventfd2`` 系統" "呼叫。 (由 Christian Heimes 在 :issue:`41001` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1251 +#: ../../whatsnew/3.10.rst:1252 msgid "" "Add :func:`os.splice()` that allows to move data between two file " "descriptors without copying between kernel address space and user address " @@ -1792,7 +1792,7 @@ msgstr "" "address space) 之間進行複製,其中檔案描述器之一必須是個 pipe。(由 Pablo " "Galindo 在 :issue:`41625` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1256 +#: ../../whatsnew/3.10.rst:1257 msgid "" "Add :const:`~os.O_EVTONLY`, :const:`~os.O_FSYNC`, :const:`~os.O_SYMLINK` " "and :const:`~os.O_NOFOLLOW_ANY` for macOS. (Contributed by Donghee Na in :" @@ -1802,11 +1802,11 @@ msgstr "" "O_SYMLINK` 和 :const:`~os.O_NOFOLLOW_ANY`。(由 Donghee Na 在 :issue:`43106` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:1261 +#: ../../whatsnew/3.10.rst:1262 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.10.rst:1263 +#: ../../whatsnew/3.10.rst:1264 msgid "" ":func:`os.path.realpath` now accepts a *strict* keyword-only argument. When " "set to ``True``, :exc:`OSError` is raised if a path doesn't exist or a " @@ -1816,11 +1816,11 @@ msgstr "" "``True`` 時,如果路徑不存在或遇到符號鏈接循環 (symlink loop),則會引發 :exc:" "`OSError`。(由 Barney Gale 在 :issue:`43757` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1269 +#: ../../whatsnew/3.10.rst:1270 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.10.rst:1271 +#: ../../whatsnew/3.10.rst:1272 msgid "" "Add slice support to :attr:`PurePath.parents `. " "(Contributed by Joshua Cannon in :issue:`35498`.)" @@ -1828,7 +1828,7 @@ msgstr "" "新增 :attr:`PurePath.parents ` 對於切片的支援。 " "(由 Joshua Cannon 在 :issue:`35498` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1274 +#: ../../whatsnew/3.10.rst:1275 msgid "" "Add negative indexing support to :attr:`PurePath.parents `. (Contributed by Yaroslav Pankovych in :issue:`21041`.)" @@ -1836,7 +1836,7 @@ msgstr "" "向 :attr:`PurePath.parents ` 新增負索引支援。(由 " "Yaroslav Pankovych 在 :issue:`21041` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1278 +#: ../../whatsnew/3.10.rst:1279 msgid "" "Add :meth:`Path.hardlink_to ` method that " "supersedes :meth:`~pathlib.Path.link_to`. The new method has the same " @@ -1847,7 +1847,7 @@ msgstr "" "Path.hardlink_to>` 方法。新方法與 :meth:`~pathlib.Path.symlink_to` 具有相同的" "引數順序。(由 Barney Gale 在 :issue:`39950` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1283 +#: ../../whatsnew/3.10.rst:1284 msgid "" ":meth:`pathlib.Path.stat` and :meth:`~pathlib.Path.chmod` now accept a " "*follow_symlinks* keyword-only argument for consistency with corresponding " @@ -1858,11 +1858,11 @@ msgstr "" "*follow_symlinks* 僅限關鍵字引數,以與 :mod:`os` 模組中的相應函式保持一致。" "(由 Barney Gale 在 :issue:`39906` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1289 +#: ../../whatsnew/3.10.rst:1290 msgid "platform" msgstr "platform" -#: ../../whatsnew/3.10.rst:1291 +#: ../../whatsnew/3.10.rst:1292 msgid "" "Add :func:`platform.freedesktop_os_release()` to retrieve operation system " "identification from `freedesktop.org os-release `\\ 包含已棄用功能的列表。(由 Christian Heimes 在 :issue:`43880` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:1372 +#: ../../whatsnew/3.10.rst:1373 msgid "" "The ssl module now has more secure default settings. Ciphers without forward " "secrecy or SHA-1 MAC are disabled by default. Security level 2 prohibits " @@ -2034,7 +2034,7 @@ msgstr "" "`~ssl.SSLContext` 預設為最低協議版本 TLS 1.2。設定基於 Hynek Schlawack 的研" "究。 (由 Christian Heimes 在 :issue:`43998` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1379 +#: ../../whatsnew/3.10.rst:1380 msgid "" "The deprecated protocols SSL 3.0, TLS 1.0, and TLS 1.1 are no longer " "officially supported. Python does not block them actively. However OpenSSL " @@ -2045,7 +2045,7 @@ msgstr "" "們。然而,OpenSSL 建置選項、發行版配置、發行商補丁和密碼套件可能會阻止交握的" "成功。" -#: ../../whatsnew/3.10.rst:1384 +#: ../../whatsnew/3.10.rst:1385 msgid "" "Add a *timeout* parameter to the :func:`ssl.get_server_certificate` " "function. (Contributed by Zackery Spytz in :issue:`31870`.)" @@ -2053,7 +2053,7 @@ msgstr "" "向 :func:`ssl.get_server_certificate` 函式新增 *timeout* 參數。(由 Zackery " "Spytz 在 :issue:`31870` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1387 +#: ../../whatsnew/3.10.rst:1388 msgid "" "The ssl module uses heap-types and multi-phase initialization. (Contributed " "by Christian Heimes in :issue:`42333`.)" @@ -2061,7 +2061,7 @@ msgstr "" "ssl 模組使用堆疊類型 (heap-types) 和多階段初始化 (multi-phase " "initialization)。(由 Christian Heimes 在 :issue:`42333` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1390 +#: ../../whatsnew/3.10.rst:1391 msgid "" "A new verify flag :const:`~ssl.VERIFY_X509_PARTIAL_CHAIN` has been added. " "(Contributed by l0x in :issue:`40849`.)" @@ -2069,11 +2069,11 @@ msgstr "" "新增驗證旗標 :const:`~ssl.VERIFY_X509_PARTIAL_CHAIN`。(由 l0x 在 :issue:" "`40849` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1394 +#: ../../whatsnew/3.10.rst:1395 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.10.rst:1396 +#: ../../whatsnew/3.10.rst:1397 msgid "" "Add audit events for :func:`~sqlite3.connect/handle`, :meth:`~sqlite3." "Connection.enable_load_extension`, and :meth:`~sqlite3.Connection." @@ -2083,11 +2083,11 @@ msgstr "" "enable_load_extension` 和 :meth:`~sqlite3.Connection.load_extension` 的稽核事" "件。(由 Erlend E. Aasland 在 :issue:`43762` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1402 +#: ../../whatsnew/3.10.rst:1403 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.10.rst:1404 +#: ../../whatsnew/3.10.rst:1405 msgid "" "Add :data:`sys.orig_argv` attribute: the list of the original command line " "arguments passed to the Python executable. (Contributed by Victor Stinner " @@ -2096,7 +2096,7 @@ msgstr "" "新增 :data:`sys.orig_argv` 屬性:傳遞給 Python 可執行檔案的原始命令列引數列" "表。(由 Victor Stinner 在 :issue:`23427` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1408 +#: ../../whatsnew/3.10.rst:1409 msgid "" "Add :data:`sys.stdlib_module_names`, containing the list of the standard " "library module names. (Contributed by Victor Stinner in :issue:`42955`.)" @@ -2104,11 +2104,11 @@ msgstr "" "新增 :data:`sys.stdlib_module_names`,其中包含標準函式庫模組的名稱列表。 " "(由 Victor Stinner 在 :issue:`42955` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1413 +#: ../../whatsnew/3.10.rst:1414 msgid "_thread" msgstr "_thread" -#: ../../whatsnew/3.10.rst:1415 +#: ../../whatsnew/3.10.rst:1416 msgid "" ":func:`_thread.interrupt_main` now takes an optional signal number to " "simulate (the default is still :const:`signal.SIGINT`). (Contributed by " @@ -2118,11 +2118,11 @@ msgstr "" "然是 :const:`signal.SIGINT`)。 (由 Antoine Pitrou 在 :issue:`43356` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1420 +#: ../../whatsnew/3.10.rst:1421 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.10.rst:1422 +#: ../../whatsnew/3.10.rst:1423 msgid "" "Add :func:`threading.gettrace` and :func:`threading.getprofile` to retrieve " "the functions set by :func:`threading.settrace` and :func:`threading." @@ -2132,7 +2132,7 @@ msgstr "" "func:`threading.settrace` 和 :func:`threading.setprofile` 設定的函式。(由 " "Mario Corchero 在 :issue:`42251` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1427 +#: ../../whatsnew/3.10.rst:1428 msgid "" "Add :data:`threading.__excepthook__` to allow retrieving the original value " "of :func:`threading.excepthook` in case it is set to a broken or a different " @@ -2142,11 +2142,11 @@ msgstr "" "excepthook` 的原始值,以防它被設定為損壞或不同的值。(由 Mario Corchero 在 :" "issue:`42308` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1433 +#: ../../whatsnew/3.10.rst:1434 msgid "traceback" msgstr "traceback" -#: ../../whatsnew/3.10.rst:1435 +#: ../../whatsnew/3.10.rst:1436 msgid "" "The :func:`~traceback.format_exception`, :func:`~traceback." "format_exception_only`, and :func:`~traceback.print_exception` functions can " @@ -2158,11 +2158,11 @@ msgstr "" "外物件作為僅限位置引數。(由 Zackery Spytz 和 Matthias Bussonnier 在 :issue:" "`26389` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1442 +#: ../../whatsnew/3.10.rst:1443 msgid "types" msgstr "types" -#: ../../whatsnew/3.10.rst:1444 +#: ../../whatsnew/3.10.rst:1445 msgid "" "Reintroduce the :data:`types.EllipsisType`, :data:`types.NoneType` and :data:" "`types.NotImplementedType` classes, providing a new set of types readily " @@ -2173,15 +2173,15 @@ msgstr "" "NotImplementedType` 類別,提供一組易於型別檢查器直譯的新型別。(由 Bas van " "Beek 在 :issue:`41810` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1450 +#: ../../whatsnew/3.10.rst:1451 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.10.rst:1452 +#: ../../whatsnew/3.10.rst:1453 msgid "For major changes, see :ref:`new-feat-related-type-hints`." msgstr "有關重大更改,請參閱\\ :ref:`new-feat-related-type-hints`。" -#: ../../whatsnew/3.10.rst:1454 +#: ../../whatsnew/3.10.rst:1455 msgid "" "The behavior of :class:`typing.Literal` was changed to conform with :pep:" "`586` and to match the behavior of static type checkers specified in the PEP." @@ -2189,16 +2189,16 @@ msgstr "" ":class:`typing.Literal` 的行為已更改為符合 :pep:`586` 並匹配 PEP 中指定的靜態" "型別檢查器的行為。" -#: ../../whatsnew/3.10.rst:1457 +#: ../../whatsnew/3.10.rst:1458 msgid "``Literal`` now de-duplicates parameters." msgstr "``Literal`` 現在可以刪除重複參數。" -#: ../../whatsnew/3.10.rst:1458 +#: ../../whatsnew/3.10.rst:1459 msgid "" "Equality comparisons between ``Literal`` objects are now order independent." msgstr "``Literal`` 物件之間的相等性比較現在與順序無關。" -#: ../../whatsnew/3.10.rst:1459 +#: ../../whatsnew/3.10.rst:1460 msgid "" "``Literal`` comparisons now respect types. For example, ``Literal[0] == " "Literal[False]`` previously evaluated to ``True``. It is now ``False``. To " @@ -2209,7 +2209,7 @@ msgstr "" "Literal[False]`` 先前之求值為 ``True``,但現在它是 ``False``。為了支援此更" "改,內部使用的型別快取現在支援了型別的辨認。" -#: ../../whatsnew/3.10.rst:1463 +#: ../../whatsnew/3.10.rst:1464 msgid "" "``Literal`` objects will now raise a :exc:`TypeError` exception during " "equality comparisons if any of their parameters are not :term:`hashable`. " @@ -2220,11 +2220,11 @@ msgstr "" "在將在相等性比較期間引發 :exc:`TypeError` 例外。請注意,使用不可雜湊的參數宣" "告 ``Literal`` 不會引發錯誤:" -#: ../../whatsnew/3.10.rst:1475 +#: ../../whatsnew/3.10.rst:1476 msgid "(Contributed by Yurii Karabas in :issue:`42345`.)" msgstr "(由 Yurii Karabas 在 :issue:`42345` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1477 +#: ../../whatsnew/3.10.rst:1478 msgid "" "Add new function :func:`typing.is_typeddict` to introspect if an annotation " "is a :class:`typing.TypedDict`. (Contributed by Patrick Reader in :issue:" @@ -2233,7 +2233,7 @@ msgstr "" "新增函式 :func:`typing.is_typeddict` 來自我審查 (introspect) 註釋是否為 :" "class:`typing.TypedDict`。(由 Patrick Reader 在 :issue:`41792` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1481 +#: ../../whatsnew/3.10.rst:1482 msgid "" "Subclasses of ``typing.Protocol`` which only have data variables declared " "will now raise a ``TypeError`` when checked with ``isinstance`` unless they " @@ -2248,7 +2248,7 @@ msgstr "" "該使用 :func:`runtime_checkable` 裝飾器來裝飾其子類別。(由 Yurii Karabas " "在 :issue:`38908` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1489 +#: ../../whatsnew/3.10.rst:1490 msgid "" "Importing from the ``typing.io`` and ``typing.re`` submodules will now emit :" "exc:`DeprecationWarning`. These submodules have been deprecated since " @@ -2261,11 +2261,11 @@ msgstr "" "Python 中刪除。屬於這些子模組的任何內容都應該直接從 :mod:`typing` 引入。 " "(由 Sebastian Rittau 在 :issue:`38291` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1497 +#: ../../whatsnew/3.10.rst:1498 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.10.rst:1499 +#: ../../whatsnew/3.10.rst:1500 msgid "" "Add new method :meth:`~unittest.TestCase.assertNoLogs` to complement the " "existing :meth:`~unittest.TestCase.assertLogs`. (Contributed by Kit Yan Choi " @@ -2275,11 +2275,11 @@ msgstr "" "`~unittest.TestCase.assertLogs`。(由 Kit Yan Choi 在 :issue:`39385` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1504 +#: ../../whatsnew/3.10.rst:1505 msgid "urllib.parse" msgstr "urllib.parse" -#: ../../whatsnew/3.10.rst:1506 +#: ../../whatsnew/3.10.rst:1507 msgid "" "Python versions earlier than Python 3.10 allowed using both ``;`` and ``&`` " "as query parameter separators in :func:`urllib.parse.parse_qs` and :func:" @@ -2299,11 +2299,11 @@ msgstr "" "訊,請參閱各自的文件。(由 Adam Goldschmidt、Senthil Kumaran 和 Ken Jin 在 :" "issue:`42967` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1517 +#: ../../whatsnew/3.10.rst:1518 msgid "xml" msgstr "xml" -#: ../../whatsnew/3.10.rst:1519 +#: ../../whatsnew/3.10.rst:1520 msgid "" "Add a :class:`~xml.sax.handler.LexicalHandler` class to the :mod:`xml.sax." "handler` module. (Contributed by Jonathan Gossage and Zackery Spytz in :" @@ -2312,11 +2312,11 @@ msgstr "" "新增 :class:`~xml.sax.handler.LexicalHandler` 類別到 :mod:`xml.sax.handler` " "模組。(由 Jonathan Gossage 和 Zackery Spytz 在 :issue:`35018` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1524 +#: ../../whatsnew/3.10.rst:1525 msgid "zipimport" msgstr "zipimport" -#: ../../whatsnew/3.10.rst:1525 +#: ../../whatsnew/3.10.rst:1526 msgid "" "Add methods related to :pep:`451`: :meth:`~zipimport.zipimporter." "find_spec`, :meth:`zipimport.zipimporter.create_module`, and :meth:" @@ -2327,7 +2327,7 @@ msgstr "" "meth:`zipimport.zipimporter.create_module` 和 :meth:`zipimport.zipimporter." "exec_module`。(由 Brett Cannon 在 :issue:`42131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1530 +#: ../../whatsnew/3.10.rst:1531 msgid "" "Add :meth:`~zipimport.zipimporter.invalidate_caches` method. (Contributed by " "Desmond Cheong in :issue:`14678`.)" @@ -2335,11 +2335,11 @@ msgstr "" "新增 :meth:`~zipimport.zipimporter.invalidate_caches` 方法。(由 Desmond " "Cheong 在 :issue:`14678` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1535 +#: ../../whatsnew/3.10.rst:1536 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.10.rst:1537 +#: ../../whatsnew/3.10.rst:1538 msgid "" "Constructors :func:`str`, :func:`bytes` and :func:`bytearray` are now faster " "(around 30--40% for small objects). (Contributed by Serhiy Storchaka in :" @@ -2348,7 +2348,7 @@ msgstr "" "建構函式 :func:`str`、:func:`bytes` 和 :func:`bytearray` 現在更快了(對於小型" "物件大約快了 30--40%)。(由 Serhiy Storchaka 在 :issue:`41334` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1541 +#: ../../whatsnew/3.10.rst:1542 msgid "" "The :mod:`runpy` module now imports fewer modules. The ``python3 -m module-" "name`` command startup time is 1.4x faster in average. On Linux, ``python3 -" @@ -2361,7 +2361,7 @@ msgstr "" "引入 69 個模組,而在 Python 3.10 上僅引入 51 個模組 (-18)。(由 Victor " "Stinner 在 :issue:`41006` 和 :issue:`41718` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1547 +#: ../../whatsnew/3.10.rst:1548 msgid "" "The ``LOAD_ATTR`` instruction now uses new \"per opcode cache\" mechanism. " "It is about 36% faster now for regular attributes and 44% faster for slots. " @@ -2374,7 +2374,7 @@ msgstr "" "Yury Selivanov 在 :issue:`42093` 中以及 Guido van Rossum 在 :issue:`42927` 中" "貢獻,基於最初在 PyPy 和 MicroPython 中實作的想法。)" -#: ../../whatsnew/3.10.rst:1553 +#: ../../whatsnew/3.10.rst:1554 msgid "" "When building Python with :option:`--enable-optimizations` now ``-fno-" "semantic-interposition`` is added to both the compile and link line. This " @@ -2391,7 +2391,7 @@ msgstr "" "linux-8-2-brings-faster-python-3-8-run-speeds/>`_ 以了解詳情。(由 Victor " "Stinner 和 Pablo Galindo 在 :issue:`38980` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1561 +#: ../../whatsnew/3.10.rst:1562 msgid "" "Use a new output buffer management code for :mod:`bz2` / :mod:`lzma` / :mod:" "`zlib` modules, and add ``.readall()`` function to ``_compression." @@ -2406,7 +2406,7 @@ msgstr "" "``GzipFile.read(-1)`` 速度提高了 1.11x ~ 1.18x。(由 Ma Lin 於 :issue:" "`41486` 貢獻、由 Gregory P. Smith 審閱)" -#: ../../whatsnew/3.10.rst:1567 +#: ../../whatsnew/3.10.rst:1568 msgid "" "When using stringized annotations, annotations dicts for functions are no " "longer created when the function is created. Instead, they are stored as a " @@ -2420,7 +2420,7 @@ msgstr "" "最佳化將定義帶有註釋的函式所需的 CPU 時間減少了一半。(由 Yurii Karabas 和 " "Inada Naoki 在 :issue:`42202` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1574 +#: ../../whatsnew/3.10.rst:1575 msgid "" "Substring search functions such as ``str1 in str2`` and ``str2.find(str1)`` " "now sometimes use Crochemore & Perrin's \"Two-Way\" string searching " @@ -2431,7 +2431,7 @@ msgstr "" "用 Crochemore & Perrin 的「雙向」字串搜索演算法來避免作用於長字串上時發生二次" "方行為 (quadratic behavior)。(由 Dennis Sweeney 在 :issue:`41972` 中貢獻)" -#: ../../whatsnew/3.10.rst:1579 +#: ../../whatsnew/3.10.rst:1580 msgid "" "Add micro-optimizations to ``_PyType_Lookup()`` to improve type attribute " "cache lookup performance in the common case of cache hits. This makes the " @@ -2442,7 +2442,7 @@ msgstr "" "查找性能。這使得直譯器平均速度提高了 1.04 倍。(由 Dino Viehland 在 :issue:" "`43452` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1583 +#: ../../whatsnew/3.10.rst:1584 msgid "" "The following built-in functions now support the faster :pep:`590` " "vectorcall calling convention: :func:`map`, :func:`filter`, :func:" @@ -2455,7 +2455,7 @@ msgstr "" "Na 和 Jeroen Demeyer 在 :issue:`43575`、:issue:`43287`、:issue:`41922`、:" "issue:`41873` 和 :issue:`41870` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1587 +#: ../../whatsnew/3.10.rst:1588 msgid "" ":class:`BZ2File` performance is improved by removing internal ``RLock``. " "This makes :class:`BZ2File` thread unsafe in the face of multiple " @@ -2467,11 +2467,11 @@ msgstr "" "`BZ2File` 在面對多個同時的讀取器或寫入器時執行緒不安全,就像 :mod:`gzip` 和 :" "mod:`lzma` 中的等效類別一樣。(由 Inada Naoki 在 :issue:`43785` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1595 ../../whatsnew/3.10.rst:2201 +#: ../../whatsnew/3.10.rst:1596 ../../whatsnew/3.10.rst:2202 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.10.rst:1597 +#: ../../whatsnew/3.10.rst:1598 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -2491,7 +2491,7 @@ msgstr "" "其中之一,則會引發棄用警告。在未來的版本中,它將被變更為語法警告,最後成為為" "語法錯誤。(由 Serhiy Storchaka 在 :issue:`43833` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1608 +#: ../../whatsnew/3.10.rst:1609 msgid "" "Starting in this release, there will be a concerted effort to begin cleaning " "up old import semantics that were kept for Python 2.7 compatibility. " @@ -2517,7 +2517,7 @@ msgstr "" "類別和方法)。將酌情引發 :exc:`ImportWarning` 和/或 :exc:" "`DeprecationWarning` 以幫助識別在此轉換期間需要更新的程式碼。" -#: ../../whatsnew/3.10.rst:1625 +#: ../../whatsnew/3.10.rst:1626 msgid "" "The entire ``distutils`` namespace is deprecated, to be removed in Python " "3.12. Refer to the :ref:`module changes ` section for " @@ -2526,7 +2526,7 @@ msgstr "" "整個 ``distutils`` 命名空間已棄用,將在 Python 3.12 中刪除。請參閱\\ :ref:`模" "組更改 ` 以獲取更多資訊。" -#: ../../whatsnew/3.10.rst:1629 +#: ../../whatsnew/3.10.rst:1630 msgid "" "Non-integer arguments to :func:`random.randrange` are deprecated. The :exc:" "`ValueError` is deprecated in favor of a :exc:`TypeError`. (Contributed by " @@ -2536,7 +2536,7 @@ msgstr "" "代之的是 :exc:`TypeError`。(由 Serhiy Storchaka 和 Raymond Hettinger 在 :" "issue:`37319` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1633 +#: ../../whatsnew/3.10.rst:1634 msgid "" "The various ``load_module()`` methods of :mod:`importlib` have been " "documented as deprecated since Python 3.6, but will now also trigger a :exc:" @@ -2547,7 +2547,7 @@ msgstr "" "用,但現在也會觸發 :exc:`DeprecationWarning`。請改用 :meth:`~importlib.abc." "Loader.exec_module`。(由 Brett Cannon 在 :issue:`26131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1639 +#: ../../whatsnew/3.10.rst:1640 msgid "" ":meth:`zimport.zipimporter.load_module` has been deprecated in preference " "for :meth:`~zipimport.zipimporter.exec_module`. (Contributed by Brett Cannon " @@ -2556,7 +2556,7 @@ msgstr "" ":meth:`zimport.zipimporter.load_module` 已被棄用,請用 :meth:`~zipimport." "zipimporter.exec_module`。(由 Brett Cannon 在 :issue:`26131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1643 +#: ../../whatsnew/3.10.rst:1644 msgid "" "The use of :meth:`~importlib.abc.Loader.load_module` by the import system " "now triggers an :exc:`ImportWarning` as :meth:`~importlib.abc.Loader." @@ -2566,7 +2566,7 @@ msgstr "" "`ImportWarning`,因為 :meth:`~importlib.abc.Loader.exec_module` 是當前首選。" "(由 Brett Cannon 在 :issue:`26131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1648 +#: ../../whatsnew/3.10.rst:1649 msgid "" "The use of :meth:`!importlib.abc.MetaPathFinder.find_module` and :meth:`!" "importlib.abc.PathEntryFinder.find_module` by the import system now trigger " @@ -2582,7 +2582,7 @@ msgstr "" "util.spec_from_loader` 來幫助移植。(由 Brett Cannon 在 :issue:`42134` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1657 +#: ../../whatsnew/3.10.rst:1658 msgid "" "The use of :meth:`!importlib.abc.PathEntryFinder.find_loader` by the import " "system now triggers an :exc:`ImportWarning` as :meth:`importlib.abc." @@ -2595,7 +2595,7 @@ msgstr "" "首選。你可以使用 :func:`importlib.util.spec_from_loader` 來幫助移植。(由 " "Brett Cannon 在 :issue:`43672` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1663 +#: ../../whatsnew/3.10.rst:1664 msgid "" "The various implementations of :meth:`!importlib.abc.MetaPathFinder." "find_module` ( :meth:`!importlib.machinery.BuiltinImporter.find_module`, :" @@ -2620,7 +2620,7 @@ msgstr "" "發 :exc:`DeprecationWarning` 並計劃在 Python 3.12 中刪除(之前它們已在 " "Python 3.4 中被記錄為已棄用)。(由 Brett Cannon 在 :issue:`42135` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1678 +#: ../../whatsnew/3.10.rst:1679 msgid "" ":class:`!importlib.abc.Finder` is deprecated (including its sole method, :" "meth:`!find_module`). Both :class:`importlib.abc.MetaPathFinder` and :class:" @@ -2633,7 +2633,7 @@ msgstr "" "abc.PathEntryFinder` 都不再從該類別繼承。使用者應該根據需求來選擇其一以繼承。" "(由 Brett Cannon 在 :issue:`42135` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1685 +#: ../../whatsnew/3.10.rst:1686 msgid "" "The deprecations of :mod:`!imp`, :func:`!importlib.find_loader`, :func:`!" "importlib.util.set_package_wrapper`, :func:`!importlib.util." @@ -2650,7 +2650,7 @@ msgstr "" "過去版本的 Python 中引發 :exc:`DeprecationWarning`) 。(由 Brett Cannon 在 :" "issue:`43720` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1695 +#: ../../whatsnew/3.10.rst:1696 msgid "" "The import system now uses the ``__spec__`` attribute on modules before " "falling back on :meth:`!module_repr` for a module's ``__repr__()`` method. " @@ -2661,7 +2661,7 @@ msgstr "" "module_repr` 作為模組的 ``__repr__()`` 方法。計劃在 Python 3.12 中刪除 " "``module_repr()`` 的使用。(由 Brett Cannon 在 :issue:`42137` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1701 +#: ../../whatsnew/3.10.rst:1702 msgid "" ":meth:`!importlib.abc.Loader.module_repr`, :meth:`!importlib.machinery." "FrozenLoader.module_repr`, and :meth:`!importlib.machinery.BuiltinLoader." @@ -2673,7 +2673,7 @@ msgstr "" "module_repr` 已棄用並計劃在 Python 3.12 中刪除。(由 Brett Cannon 在 :issue:" "`42136` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1707 +#: ../../whatsnew/3.10.rst:1708 msgid "" "``sqlite3.OptimizedUnicode`` has been undocumented and obsolete since Python " "3.3, when it was made an alias to :class:`str`. It is now deprecated, " @@ -2684,7 +2684,7 @@ msgstr "" "它被用作 :class:`str` 的別名。它現已被棄用,並計劃在 Python 3.12 中刪除。" "(由 Erlend E. Aasland 在 :issue:`42264` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1712 +#: ../../whatsnew/3.10.rst:1713 msgid "" "The undocumented built-in function ``sqlite3.enable_shared_cache`` is now " "deprecated, scheduled for removal in Python 3.12. Its use is strongly " @@ -2699,49 +2699,49 @@ msgstr "" "使用共享快取,請使用 ``cache=shared`` 查詢參數以 URI 模式打開資料庫。(由 " "Erlend E. Aasland 在 :issue:`24464` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1720 +#: ../../whatsnew/3.10.rst:1721 msgid "The following ``threading`` methods are now deprecated:" msgstr "以下 ``threading`` 方法現已棄用:" -#: ../../whatsnew/3.10.rst:1722 +#: ../../whatsnew/3.10.rst:1723 msgid "``threading.currentThread`` => :func:`threading.current_thread`" msgstr "``threading.currentThread`` => :func:`threading.current_thread`" -#: ../../whatsnew/3.10.rst:1724 +#: ../../whatsnew/3.10.rst:1725 msgid "``threading.activeCount`` => :func:`threading.active_count`" msgstr "``threading.activeCount`` => :func:`threading.active_count`" -#: ../../whatsnew/3.10.rst:1726 +#: ../../whatsnew/3.10.rst:1727 msgid "" "``threading.Condition.notifyAll`` => :meth:`threading.Condition.notify_all`" msgstr "" "``threading.Condition.notifyAll`` => :meth:`threading.Condition.notify_all`" -#: ../../whatsnew/3.10.rst:1729 +#: ../../whatsnew/3.10.rst:1730 msgid "``threading.Event.isSet`` => :meth:`threading.Event.is_set`" msgstr "``threading.Event.isSet`` => :meth:`threading.Event.is_set`" -#: ../../whatsnew/3.10.rst:1731 +#: ../../whatsnew/3.10.rst:1732 msgid "``threading.Thread.setName`` => :attr:`threading.Thread.name`" msgstr "``threading.Thread.setName`` => :attr:`threading.Thread.name`" -#: ../../whatsnew/3.10.rst:1733 +#: ../../whatsnew/3.10.rst:1734 msgid "``threading.thread.getName`` => :attr:`threading.Thread.name`" msgstr "``threading.thread.getName`` => :attr:`threading.Thread.name`" -#: ../../whatsnew/3.10.rst:1735 +#: ../../whatsnew/3.10.rst:1736 msgid "``threading.Thread.isDaemon`` => :attr:`threading.Thread.daemon`" msgstr "``threading.Thread.isDaemon`` => :attr:`threading.Thread.daemon`" -#: ../../whatsnew/3.10.rst:1737 +#: ../../whatsnew/3.10.rst:1738 msgid "``threading.Thread.setDaemon`` => :attr:`threading.Thread.daemon`" msgstr "``threading.Thread.setDaemon`` => :attr:`threading.Thread.daemon`" -#: ../../whatsnew/3.10.rst:1739 +#: ../../whatsnew/3.10.rst:1740 msgid "(Contributed by Jelle Zijlstra in :gh:`87889`.)" msgstr "(由 Jelle Zijlstra 在 :gh:`87889` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1741 +#: ../../whatsnew/3.10.rst:1742 msgid "" ":meth:`pathlib.Path.link_to` is deprecated and slated for removal in Python " "3.12. Use :meth:`pathlib.Path.hardlink_to` instead. (Contributed by Barney " @@ -2750,7 +2750,7 @@ msgstr "" ":meth:`pathlib.Path.link_to` 已棄用並計劃在 Python 3.12 中刪除。請改用 :meth:" "`pathlib.Path.hardlink_to`。(由 Barney Gale 在 :issue:`39950` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1745 +#: ../../whatsnew/3.10.rst:1746 msgid "" "``cgi.log()`` is deprecated and slated for removal in Python 3.12. " "(Contributed by Inada Naoki in :issue:`41139`.)" @@ -2758,7 +2758,7 @@ msgstr "" "``cgi.log()`` 已棄用並計劃在 Python 3.12 中刪除。(由 Inada Naoki 在 :issue:" "`41139` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1748 +#: ../../whatsnew/3.10.rst:1749 msgid "" "The following :mod:`ssl` features have been deprecated since Python 3.6, " "Python 3.7, or OpenSSL 1.1.0 and will be removed in 3.11:" @@ -2766,7 +2766,7 @@ msgstr "" "自 Python 3.6、Python 3.7 或 OpenSSL 1.1.0 起,以下 :mod:`ssl` 功能已被棄用," "並將在 3.11 中刪除:" -#: ../../whatsnew/3.10.rst:1751 +#: ../../whatsnew/3.10.rst:1752 msgid "" ":data:`~ssl.OP_NO_SSLv2`, :data:`~ssl.OP_NO_SSLv3`, :data:`~ssl." "OP_NO_TLSv1`, :data:`~ssl.OP_NO_TLSv1_1`, :data:`~ssl.OP_NO_TLSv1_2`, and :" @@ -2778,7 +2778,7 @@ msgstr "" "data:`~ssl.OP_NO_TLSv1_3` 已被替換為 :attr:`sslSSLContext.minimum_version` " "和 :attr:`sslSSLContext.maximum_version`。" -#: ../../whatsnew/3.10.rst:1757 +#: ../../whatsnew/3.10.rst:1758 msgid "" ":data:`~ssl.PROTOCOL_SSLv2`, :data:`~ssl.PROTOCOL_SSLv3`, :data:`~ssl." "PROTOCOL_SSLv23`, :data:`~ssl.PROTOCOL_TLSv1`, :data:`~ssl." @@ -2792,20 +2792,20 @@ msgstr "" "PROTOCOL_TLS` 已棄用,取而代之的是 :const:`~ssl.PROTOCOL_TLS_CLIENT` 和 :" "const:`~ssl.PROTOCOL_TLS_SERVER`" -#: ../../whatsnew/3.10.rst:1763 +#: ../../whatsnew/3.10.rst:1764 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:1765 +#: ../../whatsnew/3.10.rst:1766 msgid ":func:`~ssl.match_hostname`" msgstr ":func:`~ssl.match_hostname`" -#: ../../whatsnew/3.10.rst:1767 +#: ../../whatsnew/3.10.rst:1768 msgid ":func:`~ssl.RAND_pseudo_bytes`, :func:`~ssl.RAND_egd`" msgstr ":func:`~ssl.RAND_pseudo_bytes`, :func:`~ssl.RAND_egd`" -#: ../../whatsnew/3.10.rst:1769 +#: ../../whatsnew/3.10.rst:1770 msgid "" "NPN features like :meth:`ssl.SSLSocket.selected_npn_protocol` and :meth:`ssl." "SSLContext.set_npn_protocols` are replaced by ALPN." @@ -2813,7 +2813,7 @@ msgstr "" "NPN 功能如 :meth:`ssl.SSLSocket.selected_npn_protocol` 和 :meth:`ssl." "SSLContext.set_npn_protocols` 已被 ALPN 取代。" -#: ../../whatsnew/3.10.rst:1772 +#: ../../whatsnew/3.10.rst:1773 msgid "" "The threading debug (:envvar:`PYTHONTHREADDEBUG` environment variable) is " "deprecated in Python 3.10 and will be removed in Python 3.12. This feature " @@ -2824,7 +2824,7 @@ msgstr "" "將在 Python 3.12 中刪除。此功能需要一個 :ref:`Python 的除錯用建置版本 `。(由 Victor Stinner 在 :issue:`44584` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1777 +#: ../../whatsnew/3.10.rst:1778 msgid "" "Importing from the ``typing.io`` and ``typing.re`` submodules will now emit :" "exc:`DeprecationWarning`. These submodules will be removed in a future " @@ -2837,11 +2837,11 @@ msgstr "" "的任何內容都應該直接從 :mod:`typing` 引入。(由 Sebastian Rittau 在 :issue:" "`38291` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1786 ../../whatsnew/3.10.rst:2209 +#: ../../whatsnew/3.10.rst:1787 ../../whatsnew/3.10.rst:2210 msgid "Removed" msgstr "已刪除" -#: ../../whatsnew/3.10.rst:1788 +#: ../../whatsnew/3.10.rst:1789 msgid "" "Removed special methods ``__int__``, ``__float__``, ``__floordiv__``, " "``__mod__``, ``__divmod__``, ``__rfloordiv__``, ``__rmod__`` and " @@ -2853,7 +2853,7 @@ msgstr "" "``__rmod__`` 和 ``__rdivmod__`` 。它們都會引發 :exc:`TypeError`。(由 Serhiy " "Storchaka 在 :issue:`41974` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1794 +#: ../../whatsnew/3.10.rst:1795 msgid "" "The ``ParserBase.error()`` method from the private and undocumented " "``_markupbase`` module has been removed. :class:`html.parser.HTMLParser` is " @@ -2866,7 +2866,7 @@ msgstr "" "``error()`` 實作已在 Python 3.5 中刪除。(由 Berker Peksag 在 :issue:`31844` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:1800 +#: ../../whatsnew/3.10.rst:1801 msgid "" "Removed the ``unicodedata.ucnhash_CAPI`` attribute which was an internal " "PyCapsule object. The related private ``_PyUnicode_Name_CAPI`` structure was " @@ -2877,7 +2877,7 @@ msgstr "" "私有 ``_PyUnicode_Name_CAPI`` 結構已移至內部 C API。(由 Victor Stinner 在 :" "issue:`42157` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1805 +#: ../../whatsnew/3.10.rst:1806 msgid "" "Removed the ``parser`` module, which was deprecated in 3.9 due to the switch " "to the new PEG parser, as well as all the C source and header files that " @@ -2888,7 +2888,7 @@ msgstr "" "析器使用的所有 C 原始碼和標頭檔也已被刪除,包括 ``node.h``、``parser.h``、" "``graminit.h`` 和 ``grammar.h``。" -#: ../../whatsnew/3.10.rst:1810 +#: ../../whatsnew/3.10.rst:1811 msgid "" "Removed the Public C API functions ``PyParser_SimpleParseStringFlags``, " "``PyParser_SimpleParseStringFlagsFilename``, " @@ -2900,7 +2900,7 @@ msgstr "" "``PyParser_SimpleParseFileFlags`` 和 ``PyNode_Compile``,這些函式由於切換到新" "的 PEG 剖析器而在 3.9 中被棄用。" -#: ../../whatsnew/3.10.rst:1815 +#: ../../whatsnew/3.10.rst:1816 msgid "" "Removed the ``formatter`` module, which was deprecated in Python 3.4. It is " "somewhat obsolete, little used, and not tested. It was originally scheduled " @@ -2913,7 +2913,7 @@ msgstr "" "Python 2.7 EOL 之後。現有使用者應該將他們使用的任何類別複製到他們的程式碼中。" "(由 Donghee Na 和 Terry J. Reedy 在 :issue:`42299` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1822 +#: ../../whatsnew/3.10.rst:1823 msgid "" "Removed the :c:func:`!PyModule_GetWarningsModule` function that was useless " "now due to the :mod:`!_warnings` module was converted to a builtin module in " @@ -2923,7 +2923,7 @@ msgstr "" "`!_warnings` 模組在 2.6 中已轉換為內建模組。(由 Hai Shi 在 :issue:`42599` 中" "貢獻。)" -#: ../../whatsnew/3.10.rst:1826 +#: ../../whatsnew/3.10.rst:1827 msgid "" "Remove deprecated aliases to :ref:`collections-abstract-base-classes` from " "the :mod:`collections` module. (Contributed by Victor Stinner in :issue:" @@ -2932,7 +2932,7 @@ msgstr "" "從 :mod:`collections` 模組中刪除已棄用的、對 :ref:`collections-abstract-base-" "classes` 的別名。(由 Victor Stinner 在 :issue:`37324` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1830 +#: ../../whatsnew/3.10.rst:1831 msgid "" "The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ 's :" "doc:`high-level API <../library/asyncio-api-index>` following deprecation in " @@ -2941,11 +2941,11 @@ msgstr "" "在 Python 3.8 中棄用後,``loop`` 參數已從大多數 :mod:`asyncio` 的\\ :doc:`高" "階 API <../library/asyncio-api-index>` 中刪除。這一變化的背後動機是多方面的:" -#: ../../whatsnew/3.10.rst:1834 +#: ../../whatsnew/3.10.rst:1835 msgid "This simplifies the high-level API." msgstr "這簡化了高階 API。" -#: ../../whatsnew/3.10.rst:1835 +#: ../../whatsnew/3.10.rst:1836 msgid "" "The functions in the high-level API have been implicitly getting the current " "thread's running event loop since Python 3.7. There isn't a need to pass " @@ -2954,13 +2954,13 @@ msgstr "" "自 Python 3.7 以來,高階 API 中的函式一直隱式獲取當前執行緒正在運行的事件循" "環。在大多數正常用例中,不需要將事件循環傳遞給 API。" -#: ../../whatsnew/3.10.rst:1838 +#: ../../whatsnew/3.10.rst:1839 msgid "" "Event loop passing is error-prone especially when dealing with loops running " "in different threads." msgstr "事件循環的傳遞很容易出錯,尤其是在處理在不同執行緒中運行的循環時。" -#: ../../whatsnew/3.10.rst:1841 +#: ../../whatsnew/3.10.rst:1842 msgid "" "Note that the low-level API will still accept ``loop``. See :ref:`changes-" "python-api` for examples of how to replace existing code." @@ -2968,7 +2968,7 @@ msgstr "" "請注意,低階 API 仍會接受 ``loop``。有關如何替換現有程式碼的範例,請參閱 :" "ref:`changes-python-api`。" -#: ../../whatsnew/3.10.rst:1844 ../../whatsnew/3.10.rst:1916 +#: ../../whatsnew/3.10.rst:1845 ../../whatsnew/3.10.rst:1917 msgid "" "(Contributed by Yurii Karabas, Andrew Svetlov, Yury Selivanov and Kyle " "Stanley in :issue:`42392`.)" @@ -2976,21 +2976,21 @@ msgstr "" "(由 Yurii Karabas、Andrew Svetlov、Yury Selivanov 和 Kyle Stanley 在 :issue:" "`42392` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1849 ../../whatsnew/3.10.rst:2136 +#: ../../whatsnew/3.10.rst:1850 ../../whatsnew/3.10.rst:2137 msgid "Porting to Python 3.10" msgstr "移植到 Python 3.10" -#: ../../whatsnew/3.10.rst:1851 +#: ../../whatsnew/3.10.rst:1852 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "本節列出了前面描述的更改以及可能需要更改程式碼的其他錯誤修復。" -#: ../../whatsnew/3.10.rst:1856 +#: ../../whatsnew/3.10.rst:1857 msgid "Changes in the Python syntax" msgstr "Python 語法的變化" -#: ../../whatsnew/3.10.rst:1858 +#: ../../whatsnew/3.10.rst:1859 msgid "" "Deprecation warning is now emitted when compiling previously valid syntax if " "the numeric literal is immediately followed by a keyword (like in ``0in " @@ -3004,11 +3004,11 @@ msgstr "" "要消除警告並使程式碼與未來版本相容,只需在數字字面值和以下關鍵字之間新增一個" "空格即可。(由 Serhiy Storchaka 在 :issue:`43833` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1869 +#: ../../whatsnew/3.10.rst:1870 msgid "Changes in the Python API" msgstr "Python API 的變化" -#: ../../whatsnew/3.10.rst:1871 +#: ../../whatsnew/3.10.rst:1872 msgid "" "The *etype* parameters of the :func:`~traceback.format_exception`, :func:" "`~traceback.format_exception_only`, and :func:`~traceback.print_exception` " @@ -3020,7 +3020,7 @@ msgstr "" "print_exception` 函式的 *etype* 參數已重命名為 *exc*。(由 Zackery Spytz 和 " "Matthias Bussonnier 在 :issue:`26389` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1877 +#: ../../whatsnew/3.10.rst:1878 msgid "" ":mod:`atexit`: At Python exit, if a callback registered with :func:`atexit." "register` fails, its exception is now logged. Previously, only some " @@ -3031,7 +3031,7 @@ msgstr "" "回呼 (callback) 失敗,該例外現在會被記錄下來。在以前只記錄一些例外,並且最後" "一個例外總是被默默地忽略。(由 Victor Stinner 在 :issue:`42639` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1883 +#: ../../whatsnew/3.10.rst:1884 msgid "" ":class:`collections.abc.Callable` generic now flattens type parameters, " "similar to what :data:`typing.Callable` currently does. This means that " @@ -3051,7 +3051,7 @@ msgstr "" "可能會引發 :exc:`TypeError`,而在 Python 3.9 中,該參數可能已被默默地傳遞。" "(由 Ken Jin 在 :issue:`42195` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1893 +#: ../../whatsnew/3.10.rst:1894 msgid "" ":meth:`socket.htons` and :meth:`socket.ntohs` now raise :exc:`OverflowError` " "instead of :exc:`DeprecationWarning` if the given parameter will not fit in " @@ -3063,7 +3063,7 @@ msgstr "" "是 :exc:`DeprecationWarning`。(由 Erlend E. Aasland 在 :issue:`42393` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1898 +#: ../../whatsnew/3.10.rst:1899 msgid "" "The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ 's :" "doc:`high-level API <../library/asyncio-api-index>` following deprecation in " @@ -3072,21 +3072,21 @@ msgstr "" "在 Python 3.8 中棄用後,``loop`` 參數已從大多數 :mod:`asyncio` 的\\ :doc:`高" "階 API <../library/asyncio-api-index>` 中刪除。" -#: ../../whatsnew/3.10.rst:1902 +#: ../../whatsnew/3.10.rst:1903 msgid "A coroutine that currently looks like this::" msgstr "" "目前如下所示的協程:\n" "\n" "::" -#: ../../whatsnew/3.10.rst:1907 +#: ../../whatsnew/3.10.rst:1908 msgid "Should be replaced with this::" msgstr "" "應替換為:\n" "\n" "::" -#: ../../whatsnew/3.10.rst:1912 +#: ../../whatsnew/3.10.rst:1913 msgid "" "If ``foo()`` was specifically designed *not* to run in the current thread's " "running event loop (e.g. running in another thread's event loop), consider " @@ -3095,7 +3095,7 @@ msgstr "" "如果 ``foo()`` 被專門設計為 *不* 在當前執行緒的事件循環中運行(例如在另一個執" "行緒的事件循環中運行),請考慮改用 :func:`asyncio.run_coroutine_threadsafe`。" -#: ../../whatsnew/3.10.rst:1919 +#: ../../whatsnew/3.10.rst:1920 msgid "" "The :data:`types.FunctionType` constructor now inherits the current builtins " "if the *globals* dictionary has no ``\"__builtins__\"`` key, rather than " @@ -3111,11 +3111,11 @@ msgstr "" "function(...): ...`` 定義函式不受影響,全域變數不能用此語法覆蓋:它也繼承當前" "的內建物件。 (由 Victor Stinner 在 :issue:`42990` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1928 +#: ../../whatsnew/3.10.rst:1929 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.10.rst:1930 +#: ../../whatsnew/3.10.rst:1931 msgid "" "The C API functions ``PyParser_SimpleParseStringFlags``, " "``PyParser_SimpleParseStringFlagsFilename``, " @@ -3128,7 +3128,7 @@ msgstr "" "``PyParser_SimpleParseFileFlags``、``PyNode_Compile`` 和被這些函式使用的型別 " "``struct _node`` 被刪除。" -#: ../../whatsnew/3.10.rst:1936 +#: ../../whatsnew/3.10.rst:1937 msgid "" "Source should be now be compiled directly to a code object using, for " "example, :c:func:`Py_CompileString`. The resulting code object can then be " @@ -3138,11 +3138,11 @@ msgstr "" "件。然後可以(例如透過 :c:func:`PyEval_EvalCode`)為產生的程式碼物件求值 " "(evaluated)。" -#: ../../whatsnew/3.10.rst:1940 +#: ../../whatsnew/3.10.rst:1941 msgid "Specifically:" msgstr "具體來說:" -#: ../../whatsnew/3.10.rst:1942 +#: ../../whatsnew/3.10.rst:1943 msgid "" "A call to ``PyParser_SimpleParseStringFlags`` followed by ``PyNode_Compile`` " "can be replaced by calling :c:func:`Py_CompileString`." @@ -3150,7 +3150,7 @@ msgstr "" "後跟有 ``PyNode_Compile`` 呼叫的 ``PyParser_SimpleParseStringFlags`` 呼叫,可" "以替換為呼叫 :c:func:`Py_CompileString`。" -#: ../../whatsnew/3.10.rst:1945 +#: ../../whatsnew/3.10.rst:1946 msgid "" "There is no direct replacement for ``PyParser_SimpleParseFileFlags``. To " "compile code from a ``FILE *`` argument, you will need to read the file in C " @@ -3159,7 +3159,7 @@ msgstr "" "沒有 ``PyParser_SimpleParseFileFlags`` 的直接替代品。要從 ``FILE *`` 引數編譯" "程式碼,你需要用 C 讀取檔案並將結果緩衝區傳遞給 :c:func:`Py_CompileString`。" -#: ../../whatsnew/3.10.rst:1949 +#: ../../whatsnew/3.10.rst:1950 msgid "" "To compile a file given a ``char *`` filename, explicitly open the file, " "read it and compile the result. One way to do this is using the :py:mod:`io` " @@ -3172,26 +3172,27 @@ msgstr "" "`PyObject_CallMethod`、:c:func:`PyBytes_AsString` 和 :c:func:" "`Py_CompileString`,如下所示。(宣告和錯誤處理在此被省略。):" -#: ../../whatsnew/3.10.rst:1962 +#: ../../whatsnew/3.10.rst:1963 msgid "" -"For ``FrameObject`` objects, the ``f_lasti`` member now represents a " -"wordcode offset instead of a simple offset into the bytecode string. This " -"means that this number needs to be multiplied by 2 to be used with APIs that " -"expect a byte offset instead (like :c:func:`PyCode_Addr2Line` for example). " -"Notice as well that the ``f_lasti`` member of ``FrameObject`` objects is not " -"considered stable: please use :c:func:`PyFrame_GetLineNumber` instead." +"For ``FrameObject`` objects, the :attr:`~frame.f_lasti` member now " +"represents a wordcode offset instead of a simple offset into the bytecode " +"string. This means that this number needs to be multiplied by 2 to be used " +"with APIs that expect a byte offset instead (like :c:func:`PyCode_Addr2Line` " +"for example). Notice as well that the :attr:`!f_lasti` member of " +"``FrameObject`` objects is not considered stable: please use :c:func:" +"`PyFrame_GetLineNumber` instead." msgstr "" -"對於 ``FrameObject`` 物件,``f_lasti`` 成員現在表示了字碼偏移量 (wordcode " -"offset),而不是位元組碼字串的簡單偏移量。這意味著這個數字需要乘以 2 才能與需" -"要位元組偏移量的 API 一起使用(例如 :c:func:`PyCode_Addr2Line`)。還要注意," -"``FrameObject`` 物件的 ``f_lasti`` 成員不被認為是穩定的:請改用 :c:func:" -"`PyFrame_GetLineNumber`。" +"對於 ``FrameObject`` 物件,:attr:`~frame.f_lasti` 成員現在表示了字碼偏移量 " +"(wordcode offset),而不是位元組碼字串的簡單偏移量。這意味著這個數字需要乘以 " +"2 才能與需要位元組偏移量的 API 一起使用(例如 :c:func:`PyCode_Addr2Line`)。" +"還要注意,``FrameObject`` 物件的 :attr:`!f_lasti` 成員不被認為是穩定的:請改" +"用 :c:func:`PyFrame_GetLineNumber`。" -#: ../../whatsnew/3.10.rst:1970 +#: ../../whatsnew/3.10.rst:1971 msgid "CPython bytecode changes" msgstr "CPython 位元組碼更改" -#: ../../whatsnew/3.10.rst:1972 +#: ../../whatsnew/3.10.rst:1973 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 " @@ -3200,11 +3201,11 @@ msgstr "" "``MAKE_FUNCTION`` 指令現在接受字典或字串元組作為函式的註釋。(由 Yurii " "Karabas 和 Inada Naoki 在 :issue:`42202` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1977 +#: ../../whatsnew/3.10.rst:1978 msgid "Build Changes" msgstr "建置變更" -#: ../../whatsnew/3.10.rst:1979 +#: ../../whatsnew/3.10.rst:1980 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`.)" @@ -3212,7 +3213,7 @@ msgstr "" ":pep:`644`:Python 現在需要 OpenSSL 1.1.1 或更高版本。不再支援 OpenSSL " "1.0.2。(由 Christian Heimes 在 :issue:`43669` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1983 +#: ../../whatsnew/3.10.rst:1984 msgid "" "The C99 functions :c:func:`snprintf` and :c:func:`vsnprintf` are now " "required to build Python. (Contributed by Victor Stinner in :issue:`36020`.)" @@ -3220,7 +3221,7 @@ msgstr "" "現在需要 C99 函式 :c:func:`snprintf` 和 :c:func:`vsnprintf` 來建置 Python。 " "(由 Victor Stinner 在 :issue:`36020` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1987 +#: ../../whatsnew/3.10.rst:1988 msgid "" ":mod:`sqlite3` requires SQLite 3.7.15 or higher. (Contributed by Sergey " "Fedoseev and Erlend E. Aasland in :issue:`40744` and :issue:`40810`.)" @@ -3228,7 +3229,7 @@ msgstr "" ":mod:`sqlite3` 需要 SQLite 3.7.15 或更新版本。(由 Sergey Fedoseev 和 Erlend " "E. Aasland 在 :issue:`40744` 和 :issue:`40810` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1990 +#: ../../whatsnew/3.10.rst:1991 msgid "" "The :mod:`atexit` module must now always be built as a built-in module. " "(Contributed by Victor Stinner in :issue:`42639`.)" @@ -3236,7 +3237,7 @@ msgstr "" ":mod:`atexit` 模組現在必須都被建置為內建模組。(由 Victor Stinner 在 :issue:" "`42639` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1993 +#: ../../whatsnew/3.10.rst:1994 msgid "" "Add :option:`--disable-test-modules` option to the ``configure`` script: " "don't build nor install test modules. (Contributed by Xavier de Gaye, Thomas " @@ -3246,7 +3247,7 @@ msgstr "" "不安裝測試模組。(由 Xavier de Gaye、Thomas Petazzoni 和 Peixing Xin 在 :" "issue:`27640` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1997 +#: ../../whatsnew/3.10.rst:1998 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 " @@ -3259,7 +3260,7 @@ msgstr "" "``setuptools`` 和 ``pip`` wheel 套件:如果兩者都存在,則使用這些 wheel 套件而" "不是 ensurepip 捆綁的 wheel 套件。" -#: ../../whatsnew/3.10.rst:2003 +#: ../../whatsnew/3.10.rst:2004 msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" @@ -3270,11 +3271,11 @@ msgstr "" "share/python-wheels/`` 目錄中安裝 wheel 套件,並且不安裝 ``ensurepip." "_bundled`` 套件。" -#: ../../whatsnew/3.10.rst:2008 +#: ../../whatsnew/3.10.rst:2009 msgid "(Contributed by Victor Stinner in :issue:`42856`.)" msgstr "(由 Victor Stinner 在 :issue:`42856` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2010 +#: ../../whatsnew/3.10.rst:2011 msgid "" "Add a new :option:`configure --without-static-libpython option <--without-" "static-libpython>` to not build the ``libpythonMAJOR.MINOR.a`` static " @@ -3284,11 +3285,11 @@ msgstr "" "libpython>` 以不建置 ``libpythonMAJOR.MINOR.a`` 靜態函式庫且不安裝 ``python." "o`` 目標檔案。" -#: ../../whatsnew/3.10.rst:2014 +#: ../../whatsnew/3.10.rst:2015 msgid "(Contributed by Victor Stinner in :issue:`43103`.)" msgstr "(由 Victor Stinner 在 :issue:`43103` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2016 +#: ../../whatsnew/3.10.rst:2017 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 " @@ -3301,7 +3302,7 @@ msgstr "" "includes`` 和 ``--with-tcltk-libs`` 配置選項顯式指定這些位置。(由 Manolis " "Stamatogiannakis 在 :issue:`42603` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2022 +#: ../../whatsnew/3.10.rst:2023 msgid "" "Add :option:`--with-openssl-rpath` option to ``configure`` script. The " "option simplifies building Python with a custom OpenSSL installation, e.g. " @@ -3313,15 +3314,15 @@ msgstr "" "openssl=/path/to/openssl --with-openssl-rpath=auto``。(由 Christian Heimes " "在 :issue:`43466` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2029 +#: ../../whatsnew/3.10.rst:2030 msgid "C API Changes" msgstr "C API 變更" -#: ../../whatsnew/3.10.rst:2032 +#: ../../whatsnew/3.10.rst:2033 msgid "PEP 652: Maintaining the Stable ABI" msgstr "PEP 652:維護穩定 ABI" -#: ../../whatsnew/3.10.rst:2034 +#: ../../whatsnew/3.10.rst:2035 msgid "" "The Stable ABI (Application Binary Interface) for extension modules or " "embedding Python is now explicitly defined. :ref:`stable` describes C API " @@ -3331,11 +3332,11 @@ msgstr "" "用於擴充模組或嵌入 Python 的穩定 ABI(應用程式二進位介面)現已明確定義。 :" "ref:`stable` 描述了 C API 和 ABI 穩定性保證以及使用穩定 ABI 的最佳實踐。" -#: ../../whatsnew/3.10.rst:2039 +#: ../../whatsnew/3.10.rst:2040 msgid "(Contributed by Petr Viktorin in :pep:`652` and :issue:`43795`.)" msgstr "(由 Petr Viktorin 在 :pep:`652` 和 :issue:`43795` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2044 +#: ../../whatsnew/3.10.rst:2045 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 " @@ -3345,7 +3346,7 @@ msgstr "" "果可能是 ``int`` 子類別的實例。(由 Serhiy Storchaka 在 :issue:`40792` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:2048 +#: ../../whatsnew/3.10.rst:2049 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 " @@ -3355,7 +3356,7 @@ msgstr "" "遞給 Python 可執行檔案的原始命令列參數列表。(由 Victor Stinner 在 :issue:" "`23427` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2053 +#: ../../whatsnew/3.10.rst:2054 msgid "" "The :c:func:`PyDateTime_DATE_GET_TZINFO` and :c:func:" "`PyDateTime_TIME_GET_TZINFO` macros have been added for accessing the " @@ -3367,7 +3368,7 @@ msgstr "" "class:`datetime.time` 物件的 ``tzinfo`` 屬性。(由 Zackery Spytz 在 :issue:" "`30155` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2059 +#: ../../whatsnew/3.10.rst:2060 msgid "" "Add a :c:func:`PyCodec_Unregister` function to unregister a codec search " "function. (Contributed by Hai Shi in :issue:`41842`.)" @@ -3375,7 +3376,7 @@ msgstr "" "新增 :c:func:`PyCodec_Unregister` 函式來取消註冊編解碼器搜索函式。(由 Hai " "Shi 在 :issue:`41842` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2063 +#: ../../whatsnew/3.10.rst:2064 msgid "" "The :c:func:`PyIter_Send` function was added to allow sending value into " "iterator without raising ``StopIteration`` exception. (Contributed by " @@ -3384,7 +3385,7 @@ msgstr "" "新增了 :c:func:`PyIter_Send` 函式,以允許將值發送到疊代器中,而不會引發 " "``StopIteration`` 例外。(由 Vladimir Matveev 在 :issue:`41756` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2067 +#: ../../whatsnew/3.10.rst:2068 msgid "" "Add :c:func:`PyUnicode_AsUTF8AndSize` to the limited C API. (Contributed by " "Alex Gaynor in :issue:`41784`.)" @@ -3392,7 +3393,7 @@ msgstr "" "將 :c:func:`PyUnicode_AsUTF8AndSize` 新增到受限 C API (limited C API) 中。" "(由 Alex Gaynor 在 :issue:`41784` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2070 +#: ../../whatsnew/3.10.rst:2071 msgid "" "Add :c:func:`PyModule_AddObjectRef` function: similar to :c:func:" "`PyModule_AddObject` but don't steal a reference to the value on success. " @@ -3402,7 +3403,7 @@ msgstr "" "`PyModule_AddObject` 但成功時不竊取對值的參照。(由 Victor Stinner 在 :issue:" "`1635741` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2075 +#: ../../whatsnew/3.10.rst:2076 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 " @@ -3411,7 +3412,7 @@ msgstr "" "新增 :c:func:`Py_NewRef` 和 :c:func:`Py_XNewRef` 函式來增加物件的參照計數並回" "傳物件。 (由 Victor Stinner 在 :issue:`42262` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2079 +#: ../../whatsnew/3.10.rst:2080 msgid "" "The :c:func:`PyType_FromSpecWithBases` and :c:func:" "`PyType_FromModuleAndSpec` functions now accept a single class as the " @@ -3421,7 +3422,7 @@ msgstr "" "現在接受單個類別作為 *bases* 引數。(由 Serhiy Storchaka 在 :issue:`42423` 中" "貢獻。)" -#: ../../whatsnew/3.10.rst:2083 +#: ../../whatsnew/3.10.rst:2084 msgid "" "The :c:func:`PyType_FromModuleAndSpec` function now accepts NULL ``tp_doc`` " "slot. (Contributed by Hai Shi in :issue:`41832`.)" @@ -3429,7 +3430,7 @@ msgstr "" ":c:func:`PyType_FromModuleAndSpec` 函式現在接受 NULL ``tp_doc`` 槽位。(由 " "Hai Shi 在 :issue:`41832` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2087 +#: ../../whatsnew/3.10.rst:2088 msgid "" "The :c:func:`PyType_GetSlot` function can accept :ref:`static types `. (Contributed by Hai Shi and Petr Viktorin in :issue:`41073`.)" @@ -3437,7 +3438,7 @@ msgstr "" ":c:func:`PyType_GetSlot` 函式可以接受\\ :ref:`靜態型別 (static type) `。(由 Hai Shi 和 Petr Viktorin 在 :issue:`41073` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2091 +#: ../../whatsnew/3.10.rst:2092 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. " @@ -3446,7 +3447,7 @@ msgstr "" "向 C-API 新增 :c:func:`PySet_CheckExact` 函式,以檢查物件是否是 :class:`set` " "的實例而不是子型別的實例。(由 Pablo Galindo 在 :issue:`43277` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2095 +#: ../../whatsnew/3.10.rst:2096 msgid "" "Add :c:func:`PyErr_SetInterruptEx` which allows passing a signal number to " "simulate. (Contributed by Antoine Pitrou in :issue:`43356`.)" @@ -3454,7 +3455,7 @@ msgstr "" "新增 :c:func:`PyErr_SetInterruptEx`,它允許傳遞信號編號來進行模擬。 (由 " "Antoine Pitrou 在 :issue:`43356` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2099 +#: ../../whatsnew/3.10.rst:2100 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, " @@ -3474,7 +3475,7 @@ msgstr "" "C API 成為可能,因為自 Python 3.8 以來,:c:type:`PyObject` 結構在發布和除錯模" "式下是相同的(請參閱:issue:`36465`)。" -#: ../../whatsnew/3.10.rst:2109 +#: ../../whatsnew/3.10.rst:2110 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 :" @@ -3483,7 +3484,7 @@ msgstr "" ":option:`--with-trace-refs` 特殊建置(``Py_TRACE_REFS`` 巨集)仍不支援受限 C " "API。(由 Victor Stinner 在 :issue:`43688` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2113 +#: ../../whatsnew/3.10.rst:2114 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:" @@ -3498,7 +3499,7 @@ msgstr "" "``True`` 單例或 ``False`` 單例。(由 Victor Stinner 在 :issue:`43753` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:2120 +#: ../../whatsnew/3.10.rst:2121 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 " @@ -3509,7 +3510,7 @@ msgstr "" "`PyGC_Disable()`、:c:func:`PyGC_IsEnabled()`。這些函式使得能夠從 C 程式碼啟" "用、停用和查詢垃圾收集器的狀態,而無需引入 :mod:`gc` 模組。" -#: ../../whatsnew/3.10.rst:2127 +#: ../../whatsnew/3.10.rst:2128 msgid "" "Add a new :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` type flag to disallow " "creating type instances. (Contributed by Victor Stinner in :issue:`43916`.)" @@ -3517,7 +3518,7 @@ msgstr "" "新增 :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` 型別旗標以禁止建立型別實" "例。(由 Victor Stinner 在 :issue:`43916` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2131 +#: ../../whatsnew/3.10.rst:2132 msgid "" "Add a new :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` type flag for creating " "immutable type objects: type attributes cannot be set nor deleted. " @@ -3527,7 +3528,7 @@ msgstr "" "設定或刪除型別屬性。(由 Victor Stinner 和 Erlend E. Aasland 在 :issue:" "`43908` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2138 +#: ../../whatsnew/3.10.rst:2139 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 ``#``: " @@ -3540,7 +3541,7 @@ msgstr "" "``u#``、``y#``、``z#``、``U#`` 和 ``Z#``。請參閱 :ref:`arg-parsing` 和 :pep:" "`353`。(由 Victor Stinner 在 :issue:`40943` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2144 +#: ../../whatsnew/3.10.rst:2145 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, " @@ -3552,11 +3553,11 @@ msgstr "" "new_refcnt)`` :參見 :c:func:`Py_SET_REFCNT()` (自 Python 3.9 起可用)。為了" "向後相容,可以使用該巨集:" -#: ../../whatsnew/3.10.rst:2153 +#: ../../whatsnew/3.10.rst:2154 msgid "(Contributed by Victor Stinner in :issue:`39573`.)" msgstr "(由 Victor Stinner 在 :issue:`39573` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2155 +#: ../../whatsnew/3.10.rst:2156 msgid "" "Calling :c:func:`PyDict_GetItem` without :term:`GIL` held had been allowed " "for historical reason. It is no longer allowed. (Contributed by Victor " @@ -3566,7 +3567,7 @@ msgstr "" "`PyDict_GetItem` 是被允許的。目前已被禁止。(由 Victor Stinner 在 :issue:" "`40839` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2159 +#: ../../whatsnew/3.10.rst:2160 msgid "" "``PyUnicode_FromUnicode(NULL, size)`` and " "``PyUnicode_FromStringAndSize(NULL, size)`` raise ``DeprecationWarning`` " @@ -3578,7 +3579,7 @@ msgstr "" "分配沒有初始資料的 Unicode 物件。(由 Inada Naoki 在 :issue:`36346` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:2164 +#: ../../whatsnew/3.10.rst:2165 msgid "" "The private ``_PyUnicode_Name_CAPI`` structure of the PyCapsule API " "``unicodedata.ucnhash_CAPI`` has been moved to the internal C API. " @@ -3587,7 +3588,7 @@ msgstr "" "PyCapsule API ``unicodedata.ucnhash_CAPI`` 的私有 ``_PyUnicode_Name_CAPI`` 結" "構已移至內部 C API。(由 Victor Stinner 在 :issue:`42157` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2168 +#: ../../whatsnew/3.10.rst:2169 msgid "" ":c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:" "func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome` and :c:func:" @@ -3602,7 +3603,7 @@ msgstr "" "`Py_GetProgramName` 現在會回傳 ``NULL``。使用新的 :ref:`init-config` API 來獲" "取 :ref:`init-path-config`。(由 Victor Stinner 在 :issue:`42260` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2175 +#: ../../whatsnew/3.10.rst:2176 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 " @@ -3617,7 +3618,7 @@ msgstr "" "現編譯器錯誤。它可以防止如 ``if (PyList_SET_ITEM (a, b, c) < 0) ...`` 測試之" "類的錯誤。(由 Zackery Spytz 和 Victor Stinner 在 :issue:`30459` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2182 +#: ../../whatsnew/3.10.rst:2183 msgid "" "The non-limited API files ``odictobject.h``, ``parser_interface.h``, " "``picklebufobject.h``, ``pyarena.h``, ``pyctype.h``, ``pydebug.h``, ``pyfpe." @@ -3633,7 +3634,7 @@ msgstr "" "``Python.h`` 中引入;請參閱 :ref:`api-includes`。如果直接引入它們,請考慮改為" "引入 ``Python.h``。(由 Nicholas Sim 在 :issue:`35134` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2190 +#: ../../whatsnew/3.10.rst:2191 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 " @@ -3646,7 +3647,7 @@ msgstr "" "了 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE`。(由 Victor Stinner 和 Erlend E. " "Aasland 在 :issue:`35134` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2196 +#: ../../whatsnew/3.10.rst:2197 msgid "" "The undocumented function ``Py_FrozenMain`` has been removed from the " "limited API. The function is mainly useful for custom builds of Python. " @@ -3655,7 +3656,7 @@ msgstr "" "未以說明文件記錄的函式 ``Py_FrozenMain`` 已從受限 API 中刪除。該函式主要用於 " "Python 的自定義建置。(由 Petr Viktorin 在 :issue:`26241` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2203 +#: ../../whatsnew/3.10.rst:2204 msgid "" "The ``PyUnicode_InternImmortal()`` function is now deprecated and will be " "removed in Python 3.12: use :c:func:`PyUnicode_InternInPlace` instead. " @@ -3665,7 +3666,7 @@ msgstr "" "用 :c:func:`PyUnicode_InternInPlace`。(由 Victor Stinner 在 :issue:`41692` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:2211 +#: ../../whatsnew/3.10.rst:2212 msgid "" "Removed ``Py_UNICODE_str*`` functions manipulating ``Py_UNICODE*`` strings. " "(Contributed by Inada Naoki in :issue:`41123`.)" @@ -3673,7 +3674,7 @@ msgstr "" "刪除了操作 ``Py_UNICODE*`` 字串的 ``Py_UNICODE_str*`` 函式。(由 Inada Naoki " "在 :issue:`41123` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2214 +#: ../../whatsnew/3.10.rst:2215 msgid "" "``Py_UNICODE_strlen``: use :c:func:`PyUnicode_GetLength` or :c:macro:" "`PyUnicode_GET_LENGTH`" @@ -3681,7 +3682,7 @@ msgstr "" "``Py_UNICODE_strlen``:使用 :c:func:`PyUnicode_GetLength` 或 :c:macro:" "`PyUnicode_GET_LENGTH`" -#: ../../whatsnew/3.10.rst:2216 +#: ../../whatsnew/3.10.rst:2217 msgid "" "``Py_UNICODE_strcat``: use :c:func:`PyUnicode_CopyCharacters` or :c:func:" "`PyUnicode_FromFormat`" @@ -3689,7 +3690,7 @@ msgstr "" "``Py_UNICODE_strcat``:使用 :c:func:`PyUnicode_CopyCharacters` 或 :c:func:" "`PyUnicode_FromFormat`" -#: ../../whatsnew/3.10.rst:2218 +#: ../../whatsnew/3.10.rst:2219 msgid "" "``Py_UNICODE_strcpy``, ``Py_UNICODE_strncpy``: use :c:func:" "`PyUnicode_CopyCharacters` or :c:func:`PyUnicode_Substring`" @@ -3697,15 +3698,15 @@ msgstr "" "``Py_UNICODE_strcpy``、``Py_UNICODE_strncpy``:使用 :c:func:" "`PyUnicode_CopyCharacters` 或 :c:func:`PyUnicode_Substring`" -#: ../../whatsnew/3.10.rst:2220 +#: ../../whatsnew/3.10.rst:2221 msgid "``Py_UNICODE_strcmp``: use :c:func:`PyUnicode_Compare`" msgstr "``Py_UNICODE_strcmp``:使用 :c:func:`PyUnicode_Compare`" -#: ../../whatsnew/3.10.rst:2221 +#: ../../whatsnew/3.10.rst:2222 msgid "``Py_UNICODE_strncmp``: use :c:func:`PyUnicode_Tailmatch`" msgstr "``Py_UNICODE_strncmp``:使用 :c:func:`PyUnicode_Tailmatch`" -#: ../../whatsnew/3.10.rst:2222 +#: ../../whatsnew/3.10.rst:2223 msgid "" "``Py_UNICODE_strchr``, ``Py_UNICODE_strrchr``: use :c:func:" "`PyUnicode_FindChar`" @@ -3713,7 +3714,7 @@ msgstr "" "``Py_UNICODE_strchr``、``Py_UNICODE_strrchr``:使用 :c:func:" "`PyUnicode_FindChar`" -#: ../../whatsnew/3.10.rst:2225 +#: ../../whatsnew/3.10.rst:2226 msgid "" "Removed ``PyUnicode_GetMax()``. Please migrate to new (:pep:`393`) APIs. " "(Contributed by Inada Naoki in :issue:`41103`.)" @@ -3721,7 +3722,7 @@ msgstr "" "刪除了 ``PyUnicode_GetMax()``。請改用新的 (:pep:`393`) API。(由 Inada Naoki " "在 :issue:`41103` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2228 +#: ../../whatsnew/3.10.rst:2229 msgid "" "Removed ``PyLong_FromUnicode()``. Please migrate to :c:func:" "`PyLong_FromUnicodeObject`. (Contributed by Inada Naoki in :issue:`41103`.)" @@ -3729,7 +3730,7 @@ msgstr "" "刪除了 ``PyLong_FromUnicode()``。請改用 :c:func:`PyLong_FromUnicodeObject`。" "(由 Inada Naoki 在 :issue:`41103` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2231 +#: ../../whatsnew/3.10.rst:2232 msgid "" "Removed ``PyUnicode_AsUnicodeCopy()``. Please use :c:func:" "`PyUnicode_AsUCS4Copy` or :c:func:`PyUnicode_AsWideCharString` (Contributed " @@ -3739,7 +3740,7 @@ msgstr "" "或 :c:func:`PyUnicode_AsWideCharString` (由 Inada Naoki 在 :issue:`41103` 中" "貢獻。)" -#: ../../whatsnew/3.10.rst:2235 +#: ../../whatsnew/3.10.rst:2236 msgid "" "Removed ``_Py_CheckRecursionLimit`` variable: it has been replaced by " "``ceval.recursion_limit`` of the :c:type:`PyInterpreterState` structure. " @@ -3749,7 +3750,7 @@ msgstr "" "結構的 ``ceval.recursion_limit`` 取代。(由 Victor Stinner 在 :issue:`41834` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:2239 +#: ../../whatsnew/3.10.rst:2240 msgid "" "Removed undocumented macros ``Py_ALLOW_RECURSION`` and " "``Py_END_ALLOW_RECURSION`` and the ``recursion_critical`` field of the :c:" @@ -3760,7 +3761,7 @@ msgstr "" "``Py_END_ALLOW_RECURSION`` 以及 :c:type:`PyInterpreterState` 結構的 " "``recursion_ritic`` 欄位。(由 Serhiy Storchaka 在 :issue:`41936` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2244 +#: ../../whatsnew/3.10.rst:2245 msgid "" "Removed the undocumented ``PyOS_InitInterrupts()`` function. Initializing " "Python already implicitly installs signal handlers: see :c:member:`PyConfig." @@ -3770,7 +3771,7 @@ msgstr "" "式安裝信號處理程式:請參閱 :c:member:`PyConfig.install_signal_handlers`。" "(由 Victor Stinner 在 :issue:`41713` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2249 +#: ../../whatsnew/3.10.rst:2250 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 " @@ -3781,35 +3782,35 @@ msgstr "" "(``mod_ty`` 類型)。該函式已被排除在受限 C API 之外 (:pep:`384`)。(由 " "Victor Stinner 在 :issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2254 +#: ../../whatsnew/3.10.rst:2255 msgid "Remove the ``symtable.h`` header file and the undocumented functions:" msgstr "刪除 ``symtable.h`` 標頭檔和未被說明文件記錄的函式:" -#: ../../whatsnew/3.10.rst:2256 +#: ../../whatsnew/3.10.rst:2257 msgid "``PyST_GetScope()``" msgstr "``PyST_GetScope()``" -#: ../../whatsnew/3.10.rst:2257 +#: ../../whatsnew/3.10.rst:2258 msgid "``PySymtable_Build()``" msgstr "``PySymtable_Build()``" -#: ../../whatsnew/3.10.rst:2258 +#: ../../whatsnew/3.10.rst:2259 msgid "``PySymtable_BuildObject()``" msgstr "``PySymtable_BuildObject()``" -#: ../../whatsnew/3.10.rst:2259 +#: ../../whatsnew/3.10.rst:2260 msgid "``PySymtable_Free()``" msgstr "``PySymtable_Free()``" -#: ../../whatsnew/3.10.rst:2260 +#: ../../whatsnew/3.10.rst:2261 msgid "``Py_SymtableString()``" msgstr "``Py_SymtableString()``" -#: ../../whatsnew/3.10.rst:2261 +#: ../../whatsnew/3.10.rst:2262 msgid "``Py_SymtableStringObject()``" msgstr "``Py_SymtableStringObject()``" -#: ../../whatsnew/3.10.rst:2263 +#: ../../whatsnew/3.10.rst:2264 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 " @@ -3818,7 +3819,7 @@ msgstr "" "``Py_SymtableString()`` 函式錯誤地成為穩定 ABI 的一部分,但它因為 ``symtable." "h`` 標頭檔被排除在受限 C API 之外而無法使用。" -#: ../../whatsnew/3.10.rst:2267 +#: ../../whatsnew/3.10.rst:2268 msgid "" "Use Python :mod:`symtable` module instead. (Contributed by Victor Stinner " "in :issue:`43244`.)" @@ -3826,7 +3827,7 @@ msgstr "" "請改用 Python :mod:`symtable` 模組。(由 Victor Stinner 在 :issue:`43244` 中" "貢獻。)" -#: ../../whatsnew/3.10.rst:2270 +#: ../../whatsnew/3.10.rst:2271 msgid "" "Remove :c:func:`PyOS_ReadlineFunctionPointer` from the limited C API headers " "and from ``python3.dll``, the library that provides the stable ABI on " @@ -3837,7 +3838,7 @@ msgstr "" "刪除 :c:func:`PyOS_ReadlineFunctionPointer`。由於該函式採用 FILE* 引數,因此" "無法保證其 ABI 穩定性。(由 Petr Viktorin 在 :issue:`43868` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2276 +#: ../../whatsnew/3.10.rst:2277 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 " @@ -3853,54 +3854,54 @@ msgstr "" "Windows ```` 標頭使用的 ``Yield`` 有名稱衝突。請改用 Python :mod:" "`ast` 模組。(由 Victor Stinner 在 :issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2284 +#: ../../whatsnew/3.10.rst:2285 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:2287 +#: ../../whatsnew/3.10.rst:2288 msgid "``PyAST_Compile()``" msgstr "``PyAST_Compile()``" -#: ../../whatsnew/3.10.rst:2288 +#: ../../whatsnew/3.10.rst:2289 msgid "``PyAST_CompileEx()``" msgstr "``PyAST_CompileEx()``" -#: ../../whatsnew/3.10.rst:2289 +#: ../../whatsnew/3.10.rst:2290 msgid "``PyAST_CompileObject()``" msgstr "``PyAST_CompileObject()``" -#: ../../whatsnew/3.10.rst:2290 +#: ../../whatsnew/3.10.rst:2291 msgid "``PyFuture_FromAST()``" msgstr "``PyFuture_FromAST()``" -#: ../../whatsnew/3.10.rst:2291 +#: ../../whatsnew/3.10.rst:2292 msgid "``PyFuture_FromASTObject()``" msgstr "``PyFuture_FromASTObject()``" -#: ../../whatsnew/3.10.rst:2292 +#: ../../whatsnew/3.10.rst:2293 msgid "``PyParser_ASTFromFile()``" msgstr "``PyParser_ASTFromFile()``" -#: ../../whatsnew/3.10.rst:2293 +#: ../../whatsnew/3.10.rst:2294 msgid "``PyParser_ASTFromFileObject()``" msgstr "``PyParser_ASTFromFileObject()``" -#: ../../whatsnew/3.10.rst:2294 +#: ../../whatsnew/3.10.rst:2295 msgid "``PyParser_ASTFromFilename()``" msgstr "``PyParser_ASTFromFilename()``" -#: ../../whatsnew/3.10.rst:2295 +#: ../../whatsnew/3.10.rst:2296 msgid "``PyParser_ASTFromString()``" msgstr "``PyParser_ASTFromString()``" -#: ../../whatsnew/3.10.rst:2296 +#: ../../whatsnew/3.10.rst:2297 msgid "``PyParser_ASTFromStringObject()``" msgstr "``PyParser_ASTFromStringObject()``" -#: ../../whatsnew/3.10.rst:2298 +#: ../../whatsnew/3.10.rst:2299 msgid "" "These functions were undocumented and excluded from the limited C API. " "(Contributed by Victor Stinner in :issue:`43244`.)" @@ -3908,27 +3909,27 @@ msgstr "" "這些函式沒有文件記錄,並且被排除在受限 C API 之外。(由 Victor Stinner 在 :" "issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2301 +#: ../../whatsnew/3.10.rst:2302 msgid "Remove the ``pyarena.h`` header file with functions:" msgstr "刪除包含以下函式的 ``pyarena.h`` 標頭檔:" -#: ../../whatsnew/3.10.rst:2303 +#: ../../whatsnew/3.10.rst:2304 msgid "``PyArena_New()``" msgstr "``PyArena_New()``" -#: ../../whatsnew/3.10.rst:2304 +#: ../../whatsnew/3.10.rst:2305 msgid "``PyArena_Free()``" msgstr "``PyArena_Free()``" -#: ../../whatsnew/3.10.rst:2305 +#: ../../whatsnew/3.10.rst:2306 msgid "``PyArena_Malloc()``" msgstr "``PyArena_Malloc()``" -#: ../../whatsnew/3.10.rst:2306 +#: ../../whatsnew/3.10.rst:2307 msgid "``PyArena_AddPyObject()``" msgstr "``PyArena_AddPyObject()``" -#: ../../whatsnew/3.10.rst:2308 +#: ../../whatsnew/3.10.rst:2309 msgid "" "These functions were undocumented, excluded from the limited C API, and were " "only used internally by the compiler. (Contributed by Victor Stinner in :" @@ -3937,7 +3938,7 @@ msgstr "" "這些函式沒有文件記錄、被排除在受限 C API 之外,並僅被編譯器於內部使用。(由 " "Victor Stinner 在 :issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2312 +#: ../../whatsnew/3.10.rst:2313 msgid "" "The ``PyThreadState.use_tracing`` member has been removed to optimize " "Python. (Contributed by Mark Shannon in :issue:`43760`.)" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 78decf315a..a8f8c4adbb 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-28 00:03+0000\n" +"POT-Creation-Date: 2023-12-06 00:03+0000\n" "PO-Revision-Date: 2023-05-28 18:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2931,7 +2931,7 @@ msgstr "" "刪除 :opcode:`!COPY_DICT_WITHOUT_KEYS`、:opcode:`!GEN_START`、:opcode:`!" "POP_BLOCK`、:opcode:`!SETUP_FINALLY` 和 :opcode:`!YIELD_FROM`。" -#: ../../whatsnew/3.11.rst:1693 ../../whatsnew/3.11.rst:2565 +#: ../../whatsnew/3.11.rst:1693 ../../whatsnew/3.11.rst:2566 msgid "Deprecated" msgstr "已棄用" @@ -3351,7 +3351,7 @@ msgstr "" ":meth:`~!unittest.TestProgram.usageExit` 被標記為已棄用,即將在 3.13 中移除" "(由 Carlos Damázio 在 :gh:`67048` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1872 ../../whatsnew/3.11.rst:2593 +#: ../../whatsnew/3.11.rst:1872 ../../whatsnew/3.11.rst:2594 msgid "Pending Removal in Python 3.12" msgstr "Python 3.12 中待決議的移除項目" @@ -3619,7 +3619,7 @@ msgstr ":meth:`.assertNotRegex`" msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.11.rst:1935 ../../whatsnew/3.11.rst:2619 +#: ../../whatsnew/3.11.rst:1935 ../../whatsnew/3.11.rst:2620 msgid "Removed" msgstr "已移除" @@ -4675,42 +4675,43 @@ msgstr "``f_valuestack``:已移除。" #: ../../whatsnew/3.11.rst:2460 msgid "" -"The Python frame object is now created lazily. A side effect is that the " -"``f_back`` member must not be accessed directly, since its value is now also " -"computed lazily. The :c:func:`PyFrame_GetBack` function must be called " -"instead." +"The Python frame object is now created lazily. A side effect is that the :" +"attr:`~frame.f_back` member must not be accessed directly, since its value " +"is now also computed lazily. The :c:func:`PyFrame_GetBack` function must be " +"called instead." msgstr "" -"Python 幀物件的建立現為惰性的 (lazily),一個副作用是 ``f_back`` 成員不能被直" -"接存取,因為其職的計算也是惰性的,要改呼叫 :c:func:`PyFrame_GetBack`。" +"Python 幀物件的建立現為惰性的 (lazily),一個副作用是 :attr:`~frame.f_back` 成" +"員不能被直接存取,因為其職的計算也是惰性的,要改呼叫 :c:func:" +"`PyFrame_GetBack`。" -#: ../../whatsnew/3.11.rst:2465 +#: ../../whatsnew/3.11.rst:2466 msgid "" -"Debuggers that accessed the ``f_locals`` directly *must* call :c:func:" -"`PyFrame_GetLocals` instead. They no longer need to call :c:func:" +"Debuggers that accessed the :attr:`~frame.f_locals` directly *must* call :c:" +"func:`PyFrame_GetLocals` instead. They no longer need to call :c:func:" "`PyFrame_FastToLocalsWithError` or :c:func:`PyFrame_LocalsToFast`, in fact " "they should not call those functions. The necessary updating of the frame is " "now managed by the virtual machine." msgstr "" -"直接存取 ``f_locals`` 的除錯器\\ *必須*\\ 改為呼叫 :c:func:" +"直接存取 :attr:`~frame.f_locals` 的除錯器\\ *必須*\\ 改為呼叫 :c:func:" "`PyFrame_GetLocals`。他們不再需要呼叫 :c:func:" "`PyFrame_FastToLocalsWithError` 或 :c:func:`PyFrame_LocalsToFast`,事實上他們" "不應該呼叫這些函式。框架的必要更新現在由虛擬機管理。" -#: ../../whatsnew/3.11.rst:2471 +#: ../../whatsnew/3.11.rst:2472 msgid "Code defining ``PyFrame_GetCode()`` on Python 3.8 and older::" msgstr "" "``PyFrame_GetCode()`` 在 Python 3.8 以前的程式定義:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2481 +#: ../../whatsnew/3.11.rst:2482 msgid "Code defining ``PyFrame_GetBack()`` on Python 3.8 and older::" msgstr "" "``PyFrame_GetBack()`` 在 Python 3.8 以前的程式定義:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2491 +#: ../../whatsnew/3.11.rst:2492 msgid "" "Or use the `pythoncapi_compat project `__ to get these two functions on older Python versions." @@ -4718,11 +4719,11 @@ msgstr "" "或是使用 `pythoncap_compat 計畫 `__\\ 來在舊版 Python 函式中取得這兩個函式。" -#: ../../whatsnew/3.11.rst:2495 +#: ../../whatsnew/3.11.rst:2496 msgid "Changes of the :c:type:`PyThreadState` structure members:" msgstr ":c:type:`PyThreadState` 結構成員的改動:" -#: ../../whatsnew/3.11.rst:2497 +#: ../../whatsnew/3.11.rst:2498 msgid "" "``frame``: removed, use :c:func:`PyThreadState_GetFrame` (function added to " "Python 3.9 by :issue:`40429`). Warning: the function returns a :term:`strong " @@ -4732,7 +4733,7 @@ msgstr "" "於 Python 3.9 新增的函式)。警告:會回傳 :term:`strong reference` 的函式必須" "呼叫 :c:func:`Py_XDECREF`。" -#: ../../whatsnew/3.11.rst:2501 +#: ../../whatsnew/3.11.rst:2502 msgid "" "``tracing``: changed, use :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` (functions added to Python 3.11 by :issue:" @@ -4742,7 +4743,7 @@ msgstr "" "`PyThreadState_LeaveTracing`\\ (:issue:`43760` 於 Python 3.11 中新增的函" "式)。" -#: ../../whatsnew/3.11.rst:2504 +#: ../../whatsnew/3.11.rst:2505 msgid "" "``recursion_depth``: removed, use ``(tstate->recursion_limit - tstate-" ">recursion_remaining)`` instead." @@ -4750,18 +4751,18 @@ msgstr "" "``recursion_depth``:已移除,請改用 ``(tstate->recursion_limit - tstate-" ">recursion_remaining)``。" -#: ../../whatsnew/3.11.rst:2506 +#: ../../whatsnew/3.11.rst:2507 msgid "``stackcheck_counter``: removed." msgstr "``stackcheck_counter``:已移除。" -#: ../../whatsnew/3.11.rst:2508 +#: ../../whatsnew/3.11.rst:2509 msgid "Code defining ``PyThreadState_GetFrame()`` on Python 3.8 and older::" msgstr "" "``PyThreadState_GetFrame()`` 在 Python 3.8 以前的程式定義:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2518 +#: ../../whatsnew/3.11.rst:2519 msgid "" "Code defining ``PyThreadState_EnterTracing()`` and " "``PyThreadState_LeaveTracing()`` on Python 3.10 and older::" @@ -4771,7 +4772,7 @@ msgstr "" "\n" "::" -#: ../../whatsnew/3.11.rst:2544 +#: ../../whatsnew/3.11.rst:2545 msgid "" "Or use `the pythoncapi-compat project `__ to get these functions on old Python functions." @@ -4779,13 +4780,13 @@ msgstr "" "或是使用 `pythoncap-compat 計畫 `__\\ 來在舊版 Python 函式中取得它們。" -#: ../../whatsnew/3.11.rst:2548 +#: ../../whatsnew/3.11.rst:2549 msgid "" "Distributors are encouraged to build Python with the optimized Blake2 " "library `libb2`_." msgstr "鼓勵發布者們使用最佳化過的 Blake2 函式庫 `libb2`_ 來建置 Python。" -#: ../../whatsnew/3.11.rst:2551 +#: ../../whatsnew/3.11.rst:2552 msgid "" "The :c:member:`PyConfig.module_search_paths_set` field must now be set to 1 " "for initialization to use :c:member:`PyConfig.module_search_paths` to " @@ -4796,7 +4797,7 @@ msgstr "" "`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須被設為 " "1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` 的值。" -#: ../../whatsnew/3.11.rst:2556 +#: ../../whatsnew/3.11.rst:2557 msgid "" ":c:func:`PyConfig_Read` no longer calculates the initial search path, and " "will not fill any values into :c:member:`PyConfig.module_search_paths`. To " @@ -4809,60 +4810,60 @@ msgstr "" "初始化並使用 :c:func:`PySys_GetObject` 以取得 :data:`sys.path` 作為 Python 列" "表物件並直接修改它。" -#: ../../whatsnew/3.11.rst:2567 +#: ../../whatsnew/3.11.rst:2568 msgid "" "Deprecate the following functions to configure the Python initialization:" msgstr "棄用以下用來配置 Python 初始化的函式:" -#: ../../whatsnew/3.11.rst:2569 +#: ../../whatsnew/3.11.rst:2570 msgid ":c:func:`!PySys_AddWarnOptionUnicode`" msgstr "" -#: ../../whatsnew/3.11.rst:2570 +#: ../../whatsnew/3.11.rst:2571 msgid ":c:func:`!PySys_AddWarnOption`" msgstr "" -#: ../../whatsnew/3.11.rst:2571 +#: ../../whatsnew/3.11.rst:2572 msgid ":c:func:`!PySys_AddXOption`" msgstr "" -#: ../../whatsnew/3.11.rst:2572 +#: ../../whatsnew/3.11.rst:2573 msgid ":c:func:`!PySys_HasWarnOptions`" msgstr "" -#: ../../whatsnew/3.11.rst:2573 +#: ../../whatsnew/3.11.rst:2574 msgid ":c:func:`!PySys_SetArgvEx`" msgstr "" -#: ../../whatsnew/3.11.rst:2574 +#: ../../whatsnew/3.11.rst:2575 msgid ":c:func:`!PySys_SetArgv`" msgstr "" -#: ../../whatsnew/3.11.rst:2575 +#: ../../whatsnew/3.11.rst:2576 msgid ":c:func:`!PySys_SetPath`" msgstr "" -#: ../../whatsnew/3.11.rst:2576 +#: ../../whatsnew/3.11.rst:2577 msgid ":c:func:`!Py_SetPath`" msgstr "" -#: ../../whatsnew/3.11.rst:2577 +#: ../../whatsnew/3.11.rst:2578 msgid ":c:func:`!Py_SetProgramName`" msgstr "" -#: ../../whatsnew/3.11.rst:2578 +#: ../../whatsnew/3.11.rst:2579 msgid ":c:func:`!Py_SetPythonHome`" msgstr "" -#: ../../whatsnew/3.11.rst:2579 +#: ../../whatsnew/3.11.rst:2580 msgid ":c:func:`!Py_SetStandardStreamEncoding`" msgstr "" -#: ../../whatsnew/3.11.rst:2580 +#: ../../whatsnew/3.11.rst:2581 msgid ":c:func:`!_Py_SetProgramFullPath`" msgstr "" -#: ../../whatsnew/3.11.rst:2582 +#: ../../whatsnew/3.11.rst:2583 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration ` instead (:pep:`587`). (Contributed by Victor " @@ -4871,7 +4872,7 @@ msgstr "" "請改用 :ref:`Python 初始化配置 `\\ 中新的 :c:type:`PyConfig` " "API。(由 Victor Stinner 於 :gh:`88279` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2586 +#: ../../whatsnew/3.11.rst:2587 msgid "" "Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. Use :c:" "func:`PyObject_Hash` instead. (Contributed by Inada Naoki in :issue:`46864`.)" @@ -4879,111 +4880,111 @@ msgstr "" "棄用 :c:type:`PyBytesObject` 中的 ``ob_shash`` 成員。請改用 :c:func:" "`PyObject_Hash`。(由 Inada Naoki 於 :issue:`46864` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2595 +#: ../../whatsnew/3.11.rst:2596 msgid "" "The following C APIs have been deprecated in earlier Python releases, and " "will be removed in Python 3.12." msgstr "以下 C API 已於先前 Python 發布版本中棄用,並將於 Python 3.12 中移除。" -#: ../../whatsnew/3.11.rst:2598 +#: ../../whatsnew/3.11.rst:2599 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr "" -#: ../../whatsnew/3.11.rst:2599 +#: ../../whatsnew/3.11.rst:2600 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr "" -#: ../../whatsnew/3.11.rst:2600 +#: ../../whatsnew/3.11.rst:2601 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr "" -#: ../../whatsnew/3.11.rst:2601 +#: ../../whatsnew/3.11.rst:2602 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr "" -#: ../../whatsnew/3.11.rst:2602 +#: ../../whatsnew/3.11.rst:2603 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr "" -#: ../../whatsnew/3.11.rst:2603 +#: ../../whatsnew/3.11.rst:2604 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr "" -#: ../../whatsnew/3.11.rst:2604 +#: ../../whatsnew/3.11.rst:2605 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr "" -#: ../../whatsnew/3.11.rst:2605 +#: ../../whatsnew/3.11.rst:2606 msgid ":c:func:`!PyUnicode_GetSize`" msgstr "" -#: ../../whatsnew/3.11.rst:2606 +#: ../../whatsnew/3.11.rst:2607 msgid ":c:func:`PyUnicode_IS_COMPACT`" msgstr ":c:func:`PyUnicode_IS_COMPACT`" -#: ../../whatsnew/3.11.rst:2607 +#: ../../whatsnew/3.11.rst:2608 msgid ":c:func:`PyUnicode_IS_READY`" msgstr ":c:func:`PyUnicode_IS_READY`" -#: ../../whatsnew/3.11.rst:2608 +#: ../../whatsnew/3.11.rst:2609 msgid ":c:func:`PyUnicode_READY`" msgstr ":c:func:`PyUnicode_READY`" -#: ../../whatsnew/3.11.rst:2609 +#: ../../whatsnew/3.11.rst:2610 msgid ":c:func:`!PyUnicode_WSTR_LENGTH`" msgstr "" -#: ../../whatsnew/3.11.rst:2610 +#: ../../whatsnew/3.11.rst:2611 msgid ":c:func:`!_PyUnicode_AsUnicode`" msgstr "" -#: ../../whatsnew/3.11.rst:2611 +#: ../../whatsnew/3.11.rst:2612 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr "" -#: ../../whatsnew/3.11.rst:2612 +#: ../../whatsnew/3.11.rst:2613 msgid ":c:type:`PyUnicodeObject`" msgstr ":c:type:`PyUnicodeObject`" -#: ../../whatsnew/3.11.rst:2613 +#: ../../whatsnew/3.11.rst:2614 msgid ":c:func:`!PyUnicode_InternImmortal`" msgstr "" -#: ../../whatsnew/3.11.rst:2621 +#: ../../whatsnew/3.11.rst:2622 msgid "" ":c:func:`!PyFrame_BlockSetup` and :c:func:`!PyFrame_BlockPop` have been " "removed. (Contributed by Mark Shannon in :issue:`40222`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2625 +#: ../../whatsnew/3.11.rst:2626 msgid "Remove the following math macros using the ``errno`` variable:" msgstr "移除以下使用到 ``errno`` 變數的數學巨集:" -#: ../../whatsnew/3.11.rst:2627 +#: ../../whatsnew/3.11.rst:2628 msgid "``Py_ADJUST_ERANGE1()``" msgstr "``Py_ADJUST_ERANGE1()``" -#: ../../whatsnew/3.11.rst:2628 +#: ../../whatsnew/3.11.rst:2629 msgid "``Py_ADJUST_ERANGE2()``" msgstr "``Py_ADJUST_ERANGE2()``" -#: ../../whatsnew/3.11.rst:2629 +#: ../../whatsnew/3.11.rst:2630 msgid "``Py_OVERFLOWED()``" msgstr "``Py_OVERFLOWED()``" -#: ../../whatsnew/3.11.rst:2630 +#: ../../whatsnew/3.11.rst:2631 msgid "``Py_SET_ERANGE_IF_OVERFLOW()``" msgstr "``Py_SET_ERANGE_IF_OVERFLOW()``" -#: ../../whatsnew/3.11.rst:2631 +#: ../../whatsnew/3.11.rst:2632 msgid "``Py_SET_ERRNO_ON_MATH_ERROR()``" msgstr "``Py_SET_ERRNO_ON_MATH_ERROR()``" -#: ../../whatsnew/3.11.rst:2633 +#: ../../whatsnew/3.11.rst:2634 msgid "(Contributed by Victor Stinner in :issue:`45412`.)" msgstr "(由 Victor Stinner 於 :issue:`45412` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2635 +#: ../../whatsnew/3.11.rst:2636 msgid "" "Remove ``Py_UNICODE_COPY()`` and ``Py_UNICODE_FILL()`` macros, deprecated " "since Python 3.3. Use ``PyUnicode_CopyCharacters()`` or ``memcpy()`` " @@ -4995,7 +4996,7 @@ msgstr "" "和 ``PyUnicode_Fill()`` 函式。(由 Victor Stinner 於 :issue:`41123` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:2640 +#: ../../whatsnew/3.11.rst:2641 msgid "" "Remove the ``pystrhex.h`` header file. It only contains private functions. C " "extensions should only include the main ```` header file. " @@ -5004,7 +5005,7 @@ msgstr "" "移除 ``pystrhex.h`` 標頭檔案。它只有包含私有函式。C 的擴充應該只要引入主要的 " "```` 標頭檔案。(由 Victor Stinner 於 :issue:`45434` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2644 +#: ../../whatsnew/3.11.rst:2645 msgid "" "Remove the ``Py_FORCE_DOUBLE()`` macro. It was used by the " "``Py_IS_INFINITY()`` macro. (Contributed by Victor Stinner in :issue:" @@ -5013,41 +5014,41 @@ msgstr "" "移除 ``Py_FORCE_DOUBLE()`` 巨集。它先前被用於 ``Py_IS_INFINITY()`` 巨集。" "(由 Victor Stinner 於 :issue:`45440` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2648 +#: ../../whatsnew/3.11.rst:2649 msgid "" "The following items are no longer available when :c:macro:`Py_LIMITED_API` " "is defined:" msgstr "當 :c:macro:`Py_LIMITED_API` 有被定義時,以下項目將無法被取得:" -#: ../../whatsnew/3.11.rst:2651 +#: ../../whatsnew/3.11.rst:2652 msgid ":c:func:`PyMarshal_WriteLongToFile`" msgstr ":c:func:`PyMarshal_WriteLongToFile`" -#: ../../whatsnew/3.11.rst:2652 +#: ../../whatsnew/3.11.rst:2653 msgid ":c:func:`PyMarshal_WriteObjectToFile`" msgstr ":c:func:`PyMarshal_WriteObjectToFile`" -#: ../../whatsnew/3.11.rst:2653 +#: ../../whatsnew/3.11.rst:2654 msgid ":c:func:`PyMarshal_ReadObjectFromString`" msgstr ":c:func:`PyMarshal_ReadObjectFromString`" -#: ../../whatsnew/3.11.rst:2654 +#: ../../whatsnew/3.11.rst:2655 msgid ":c:func:`PyMarshal_WriteObjectToString`" msgstr ":c:func:`PyMarshal_WriteObjectToString`" -#: ../../whatsnew/3.11.rst:2655 +#: ../../whatsnew/3.11.rst:2656 msgid "the ``Py_MARSHAL_VERSION`` macro" msgstr "``Py_MARSHAL_VERSION`` 巨集" -#: ../../whatsnew/3.11.rst:2657 +#: ../../whatsnew/3.11.rst:2658 msgid "These are not part of the :ref:`limited API `." msgstr "" -#: ../../whatsnew/3.11.rst:2659 +#: ../../whatsnew/3.11.rst:2660 msgid "(Contributed by Victor Stinner in :issue:`45474`.)" msgstr "(由 Victor Stinner 於 :issue:`45474` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2661 +#: ../../whatsnew/3.11.rst:2662 msgid "" "Exclude :c:func:`PyWeakref_GET_OBJECT` from the limited C API. It never " "worked since the :c:type:`PyWeakReference` structure is opaque in the " @@ -5057,7 +5058,7 @@ msgstr "" "`PyWeakReference` 結構在受限 C API 中過於晦澀而從未運作。(由 Victor Stinner " "於 :issue:`35134` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2666 +#: ../../whatsnew/3.11.rst:2667 msgid "" "Remove the ``PyHeapType_GET_MEMBERS()`` macro. It was exposed in the public " "C API by mistake, it must only be used by Python internally. Use the " @@ -5068,7 +5069,7 @@ msgstr "" "該只能被 Python 內部所使用。請改用 ``PyTypeObject.tp_members``。(由 Victor " "Stinner 於 :issue:`40170` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2671 +#: ../../whatsnew/3.11.rst:2672 msgid "" "Remove the ``HAVE_PY_SET_53BIT_PRECISION`` macro (moved to the internal C " "API). (Contributed by Victor Stinner in :issue:`45412`.)" @@ -5076,7 +5077,7 @@ msgstr "" "移除 ``HAVE_PY_SET_53BIT_PRECISION`` 巨集(移動至內部 C API)。(由 Victor " "Stinner 於 :issue:`45412` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2677 +#: ../../whatsnew/3.11.rst:2678 msgid "" "Remove the :c:type:`Py_UNICODE` encoder APIs, as they have been deprecated " "since Python 3.3, are little used and are inefficient relative to the " @@ -5085,63 +5086,63 @@ msgstr "" "移除 :c:type:`Py_UNICODE` 編碼器 API,它們自從 Python 3.3 就被棄用,非常少用" "且和推薦的替代方案已無太大關聯。" -#: ../../whatsnew/3.11.rst:2682 +#: ../../whatsnew/3.11.rst:2683 msgid "The removed functions are:" msgstr "被移除的函式為:" -#: ../../whatsnew/3.11.rst:2684 +#: ../../whatsnew/3.11.rst:2685 msgid ":func:`!PyUnicode_Encode`" msgstr ":func:`!PyUnicode_Encode`" -#: ../../whatsnew/3.11.rst:2685 +#: ../../whatsnew/3.11.rst:2686 msgid ":func:`!PyUnicode_EncodeASCII`" msgstr ":func:`!PyUnicode_EncodeASCII`" -#: ../../whatsnew/3.11.rst:2686 +#: ../../whatsnew/3.11.rst:2687 msgid ":func:`!PyUnicode_EncodeLatin1`" msgstr ":func:`!PyUnicode_EncodeLatin1`" -#: ../../whatsnew/3.11.rst:2687 +#: ../../whatsnew/3.11.rst:2688 msgid ":func:`!PyUnicode_EncodeUTF7`" msgstr ":func:`!PyUnicode_EncodeUTF7`" -#: ../../whatsnew/3.11.rst:2688 +#: ../../whatsnew/3.11.rst:2689 msgid ":func:`!PyUnicode_EncodeUTF8`" msgstr ":func:`!PyUnicode_EncodeUTF8`" -#: ../../whatsnew/3.11.rst:2689 +#: ../../whatsnew/3.11.rst:2690 msgid ":func:`!PyUnicode_EncodeUTF16`" msgstr ":func:`!PyUnicode_EncodeUTF16`" -#: ../../whatsnew/3.11.rst:2690 +#: ../../whatsnew/3.11.rst:2691 msgid ":func:`!PyUnicode_EncodeUTF32`" msgstr ":func:`!PyUnicode_EncodeUTF32`" -#: ../../whatsnew/3.11.rst:2691 +#: ../../whatsnew/3.11.rst:2692 msgid ":func:`!PyUnicode_EncodeUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2692 +#: ../../whatsnew/3.11.rst:2693 msgid ":func:`!PyUnicode_EncodeRawUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeRawUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2693 +#: ../../whatsnew/3.11.rst:2694 msgid ":func:`!PyUnicode_EncodeCharmap`" msgstr ":func:`!PyUnicode_EncodeCharmap`" -#: ../../whatsnew/3.11.rst:2694 +#: ../../whatsnew/3.11.rst:2695 msgid ":func:`!PyUnicode_TranslateCharmap`" msgstr ":func:`!PyUnicode_TranslateCharmap`" -#: ../../whatsnew/3.11.rst:2695 +#: ../../whatsnew/3.11.rst:2696 msgid ":func:`!PyUnicode_EncodeDecimal`" msgstr ":func:`!PyUnicode_EncodeDecimal`" -#: ../../whatsnew/3.11.rst:2696 +#: ../../whatsnew/3.11.rst:2697 msgid ":func:`!PyUnicode_TransformDecimalToASCII`" msgstr ":func:`!PyUnicode_TransformDecimalToASCII`" -#: ../../whatsnew/3.11.rst:2698 +#: ../../whatsnew/3.11.rst:2699 msgid "" "See :pep:`624` for details and :pep:`migration guidance <624#alternative-" "apis>`. (Contributed by Inada Naoki in :issue:`44029`.)" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 1da29c8b92..424ca1636d 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-01 00:03+0000\n" +"POT-Creation-Date: 2023-12-04 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -257,7 +257,7 @@ msgid "" "`_." msgstr "" -#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1931 +#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1942 msgid "New Features" msgstr "新增特性" @@ -1098,18 +1098,18 @@ msgstr "" msgid "" ":func:`shutil.rmtree` now accepts a new argument *onexc* which is an error " "handler like *onerror* but which expects an exception instance rather than a " -"*(typ, val, tb)* triplet. *onerror* is deprecated and will be removed in " -"Python 3.14. (Contributed by Irit Katriel in :gh:`102828`.)" +"*(typ, val, tb)* triplet. *onerror* is deprecated. (Contributed by Irit " +"Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:845 +#: ../../whatsnew/3.12.rst:844 msgid "" ":func:`shutil.which` now consults the *PATHEXT* environment variable to find " "matches within *PATH* on Windows even when the given *cmd* includes a " "directory component. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:850 +#: ../../whatsnew/3.12.rst:849 msgid "" ":func:`shutil.which` will call ``NeedCurrentDirectoryForExePathW`` when " "querying for executables on Windows to determine if the current working " @@ -1117,18 +1117,18 @@ msgid "" "Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:855 +#: ../../whatsnew/3.12.rst:854 msgid "" ":func:`shutil.which` will return a path matching the *cmd* with a component " "from ``PATHEXT`` prior to a direct match elsewhere in the search path on " "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:861 ../../whatsnew/3.12.rst:1651 +#: ../../whatsnew/3.12.rst:860 ../../whatsnew/3.12.rst:1654 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.12.rst:863 +#: ../../whatsnew/3.12.rst:862 msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" @@ -1136,7 +1136,7 @@ msgstr "" "新增\\ :ref:`命令列介面 `。(由 Erlend E. Aasland 於 :gh:" "`77617` 中貢獻。)" -#: ../../whatsnew/3.12.rst:866 +#: ../../whatsnew/3.12.rst:865 msgid "" "Add the :attr:`sqlite3.Connection.autocommit` attribute to :class:`sqlite3." "Connection` and the *autocommit* parameter to :func:`sqlite3.connect` to " @@ -1144,43 +1144,43 @@ msgid "" "control-autocommit>`. (Contributed by Erlend E. Aasland in :gh:`83638`.)" msgstr "" -#: ../../whatsnew/3.12.rst:873 +#: ../../whatsnew/3.12.rst:872 msgid "" "Add *entrypoint* keyword-only parameter to :meth:`sqlite3.Connection." "load_extension`, for overriding the SQLite extension entry point. " "(Contributed by Erlend E. Aasland in :gh:`103015`.)" msgstr "" -#: ../../whatsnew/3.12.rst:878 +#: ../../whatsnew/3.12.rst:877 msgid "" "Add :meth:`sqlite3.Connection.getconfig` and :meth:`sqlite3.Connection." "setconfig` to :class:`sqlite3.Connection` to make configuration changes to a " "database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" msgstr "" -#: ../../whatsnew/3.12.rst:884 +#: ../../whatsnew/3.12.rst:883 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.12.rst:886 +#: ../../whatsnew/3.12.rst:885 msgid "" "Extend :func:`statistics.correlation` to include as a ``ranked`` method for " "computing the Spearman correlation of ranked data. (Contributed by Raymond " "Hettinger in :gh:`95861`.)" msgstr "" -#: ../../whatsnew/3.12.rst:891 +#: ../../whatsnew/3.12.rst:890 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.12.rst:893 +#: ../../whatsnew/3.12.rst:892 msgid "" "Add the :mod:`sys.monitoring` namespace to expose the new :ref:`PEP 669 " "` monitoring API. (Contributed by Mark Shannon in :gh:" "`103082`.)" msgstr "" -#: ../../whatsnew/3.12.rst:897 +#: ../../whatsnew/3.12.rst:896 msgid "" "Add :func:`sys.activate_stack_trampoline` and :func:`sys." "deactivate_stack_trampoline` for activating and deactivating stack profiler " @@ -1190,7 +1190,7 @@ msgid "" "Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:906 +#: ../../whatsnew/3.12.rst:905 msgid "" "Add :data:`sys.last_exc` which holds the last unhandled exception that was " "raised (for post-mortem debugging use cases). Deprecate the three fields " @@ -1199,14 +1199,14 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:912 ../../whatsnew/3.12.rst:1839 +#: ../../whatsnew/3.12.rst:911 ../../whatsnew/3.12.rst:1850 msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " "by Irit Katriel in :gh:`103176`.)" msgstr "" -#: ../../whatsnew/3.12.rst:916 +#: ../../whatsnew/3.12.rst:915 msgid "" ":func:`sys.setrecursionlimit` and :func:`sys.getrecursionlimit`. The " "recursion limit now applies only to Python code. Builtin functions do not " @@ -1214,27 +1214,27 @@ msgid "" "prevents recursion from causing a virtual machine crash." msgstr "" -#: ../../whatsnew/3.12.rst:922 +#: ../../whatsnew/3.12.rst:921 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.12.rst:924 +#: ../../whatsnew/3.12.rst:923 msgid "" "The :class:`tempfile.NamedTemporaryFile` function has a new optional " "parameter *delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)" msgstr "" -#: ../../whatsnew/3.12.rst:926 +#: ../../whatsnew/3.12.rst:925 msgid "" ":func:`tempfile.mkdtemp` now always returns an absolute path, even if the " "argument provided to the *dir* parameter is a relative path." msgstr "" -#: ../../whatsnew/3.12.rst:932 +#: ../../whatsnew/3.12.rst:931 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.12.rst:934 +#: ../../whatsnew/3.12.rst:933 msgid "" "Add :func:`threading.settrace_all_threads` and :func:`threading." "setprofile_all_threads` that allow to set tracing and profiling functions in " @@ -1242,11 +1242,11 @@ msgid "" "Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:940 +#: ../../whatsnew/3.12.rst:939 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.12.rst:942 +#: ../../whatsnew/3.12.rst:941 msgid "" "``tkinter.Canvas.coords()`` now flattens its arguments. It now accepts not " "only coordinates as separate arguments (``x1, y1, x2, y2, ...``) and a " @@ -1256,11 +1256,11 @@ msgid "" "in :gh:`94473`.)" msgstr "" -#: ../../whatsnew/3.12.rst:951 +#: ../../whatsnew/3.12.rst:950 msgid "tokenize" msgstr "tokenize" -#: ../../whatsnew/3.12.rst:953 +#: ../../whatsnew/3.12.rst:952 msgid "" "The :mod:`tokenize` module includes the changes introduced in :pep:`701`. " "(Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" @@ -1268,22 +1268,22 @@ msgid "" "to the :mod:`tokenize` module." msgstr "" -#: ../../whatsnew/3.12.rst:959 +#: ../../whatsnew/3.12.rst:958 msgid "types" msgstr "types" -#: ../../whatsnew/3.12.rst:961 +#: ../../whatsnew/3.12.rst:960 msgid "" "Add :func:`types.get_original_bases` to allow for further introspection of :" "ref:`user-defined-generics` when subclassed. (Contributed by James Hilton-" "Balfe and Alex Waygood in :gh:`101827`.)" msgstr "" -#: ../../whatsnew/3.12.rst:966 +#: ../../whatsnew/3.12.rst:965 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.12.rst:968 +#: ../../whatsnew/3.12.rst:967 msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" @@ -1296,7 +1296,7 @@ msgid "" "affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" msgstr "" -#: ../../whatsnew/3.12.rst:979 +#: ../../whatsnew/3.12.rst:978 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 " @@ -1304,13 +1304,13 @@ msgid "" "on :func:`isinstance` checks comparing objects to the protocol. For example::" msgstr "" -#: ../../whatsnew/3.12.rst:1001 +#: ../../whatsnew/3.12.rst:1000 msgid "" "This change was made in order to speed up ``isinstance()`` checks against " "runtime-checkable protocols." msgstr "" -#: ../../whatsnew/3.12.rst:1004 +#: ../../whatsnew/3.12.rst:1003 msgid "" "The performance profile of :func:`isinstance` checks against :func:`runtime-" "checkable protocols ` has changed significantly. " @@ -1321,71 +1321,71 @@ msgid "" "in :gh:`74690` and :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1012 +#: ../../whatsnew/3.12.rst:1011 msgid "" "All :data:`typing.TypedDict` and :data:`typing.NamedTuple` classes now have " "the ``__orig_bases__`` attribute. (Contributed by Adrian Garcia Badaracco " "in :gh:`103699`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1016 +#: ../../whatsnew/3.12.rst:1015 msgid "" "Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`. " "(Contributed by Erik De Bonte in :gh:`99957`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1020 +#: ../../whatsnew/3.12.rst:1019 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.12.rst:1022 +#: ../../whatsnew/3.12.rst:1021 msgid "" "The Unicode database has been updated to version 15.0.0. (Contributed by " "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:1026 ../../whatsnew/3.12.rst:1692 +#: ../../whatsnew/3.12.rst:1025 ../../whatsnew/3.12.rst:1695 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.12.rst:1028 +#: ../../whatsnew/3.12.rst:1027 msgid "" "Add a ``--durations`` command line option, showing the N slowest test cases::" msgstr "" -#: ../../whatsnew/3.12.rst:1044 +#: ../../whatsnew/3.12.rst:1043 msgid "(Contributed by Giampaolo Rodola in :gh:`48330`)" msgstr "" -#: ../../whatsnew/3.12.rst:1047 +#: ../../whatsnew/3.12.rst:1046 msgid "uuid" msgstr "uuid" -#: ../../whatsnew/3.12.rst:1049 +#: ../../whatsnew/3.12.rst:1048 msgid "" "Add a :ref:`command-line interface `. (Contributed by Adam Chhina " "in :gh:`88597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1054 +#: ../../whatsnew/3.12.rst:1053 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.12.rst:1056 +#: ../../whatsnew/3.12.rst:1055 msgid "" "Remove ``wstr`` and ``wstr_length`` members from Unicode objects. It reduces " "object size by 8 or 16 bytes on 64bit platform. (:pep:`623`) (Contributed by " "Inada Naoki in :gh:`92536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1060 +#: ../../whatsnew/3.12.rst:1059 msgid "" "Add experimental support for using the BOLT binary optimizer in the build " "process, which improves performance by 1-5%. (Contributed by Kevin " "Modzelewski in :gh:`90536` and tuned by Donghee Na in :gh:`101525`)" msgstr "" -#: ../../whatsnew/3.12.rst:1064 +#: ../../whatsnew/3.12.rst:1063 msgid "" "Speed up the regular expression substitution (functions :func:`re.sub` and :" "func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " @@ -1393,13 +1393,13 @@ msgid "" "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1069 +#: ../../whatsnew/3.12.rst:1068 msgid "" "Speed up :class:`asyncio.Task` creation by deferring expensive string " "formatting. (Contributed by Itamar Oren in :gh:`103793`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1072 +#: ../../whatsnew/3.12.rst:1071 msgid "" "The :func:`tokenize.tokenize` and :func:`tokenize.generate_tokens` functions " "are up to 64% faster as a side effect of the changes required to cover :pep:" @@ -1407,18 +1407,18 @@ msgid "" "Pablo Galindo in :gh:`102856`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1077 +#: ../../whatsnew/3.12.rst:1076 msgid "" "Speed up :func:`super` method calls and attribute loads via the new :opcode:" "`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " "Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1083 +#: ../../whatsnew/3.12.rst:1082 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.12.rst:1085 +#: ../../whatsnew/3.12.rst:1084 msgid "" "Remove the :opcode:`!LOAD_METHOD` instruction. It has been merged into :" "opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" @@ -1426,62 +1426,62 @@ msgid "" "by Ken Jin in :gh:`93429`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1090 +#: ../../whatsnew/3.12.rst:1089 msgid "" "Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" "JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" "`102859`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1093 +#: ../../whatsnew/3.12.rst:1092 msgid "" "Remove the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" "gh:`92925`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1096 +#: ../../whatsnew/3.12.rst:1095 msgid "" "Add the :opcode:`BINARY_SLICE` and :opcode:`STORE_SLICE` instructions. " "(Contributed by Mark Shannon in :gh:`94163`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1099 +#: ../../whatsnew/3.12.rst:1098 msgid "" "Add the :opcode:`CALL_INTRINSIC_1` instructions. (Contributed by Mark " "Shannon in :gh:`99005`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1102 +#: ../../whatsnew/3.12.rst:1101 msgid "" "Add the :opcode:`CALL_INTRINSIC_2` instruction. (Contributed by Irit Katriel " "in :gh:`101799`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1105 +#: ../../whatsnew/3.12.rst:1104 msgid "" "Add the :opcode:`CLEANUP_THROW` instruction. (Contributed by Brandt Bucher " "in :gh:`90997`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1108 +#: ../../whatsnew/3.12.rst:1107 msgid "" "Add the :opcode:`!END_SEND` instruction. (Contributed by Mark Shannon in :gh:" "`103082`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1111 +#: ../../whatsnew/3.12.rst:1110 msgid "" "Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " "implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1114 +#: ../../whatsnew/3.12.rst:1113 msgid "" "Add the :opcode:`LOAD_FAST_CHECK` instruction. (Contributed by Dennis " "Sweeney in :gh:`93143`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1117 +#: ../../whatsnew/3.12.rst:1116 msgid "" "Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" "`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " @@ -1490,48 +1490,48 @@ msgid "" "`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1123 +#: ../../whatsnew/3.12.rst:1122 msgid "" "Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " "and Vladimir Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1126 +#: ../../whatsnew/3.12.rst:1125 msgid "" "Add the :opcode:`RETURN_CONST` instruction. (Contributed by Wenyang Wang in :" "gh:`101632`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1129 +#: ../../whatsnew/3.12.rst:1128 msgid "Demos and Tools" msgstr "" -#: ../../whatsnew/3.12.rst:1131 +#: ../../whatsnew/3.12.rst:1130 msgid "" "Remove the ``Tools/demo/`` directory which contained old demo scripts. A " "copy can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97681`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1136 +#: ../../whatsnew/3.12.rst:1135 msgid "" "Remove outdated example scripts of the ``Tools/scripts/`` directory. A copy " "can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1143 ../../whatsnew/3.12.rst:2233 +#: ../../whatsnew/3.12.rst:1142 ../../whatsnew/3.12.rst:2244 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.12.rst:1145 +#: ../../whatsnew/3.12.rst:1144 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " "(Contributed by Nikita Sobolev in :gh:`92248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1150 +#: ../../whatsnew/3.12.rst:1149 msgid "" ":mod:`ast`: The following :mod:`ast` features have been deprecated in " "documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " @@ -1539,37 +1539,37 @@ msgid "" "Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1154 ../../whatsnew/3.12.rst:1386 +#: ../../whatsnew/3.12.rst:1153 ../../whatsnew/3.12.rst:1386 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../whatsnew/3.12.rst:1155 ../../whatsnew/3.12.rst:1387 +#: ../../whatsnew/3.12.rst:1154 ../../whatsnew/3.12.rst:1387 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../whatsnew/3.12.rst:1156 ../../whatsnew/3.12.rst:1388 +#: ../../whatsnew/3.12.rst:1155 ../../whatsnew/3.12.rst:1388 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../whatsnew/3.12.rst:1157 ../../whatsnew/3.12.rst:1389 +#: ../../whatsnew/3.12.rst:1156 ../../whatsnew/3.12.rst:1389 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../whatsnew/3.12.rst:1158 ../../whatsnew/3.12.rst:1390 +#: ../../whatsnew/3.12.rst:1157 ../../whatsnew/3.12.rst:1390 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../whatsnew/3.12.rst:1160 +#: ../../whatsnew/3.12.rst:1159 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1163 ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1162 ../../whatsnew/3.12.rst:1392 msgid ":mod:`asyncio`:" msgstr ":mod:`asyncio`:" -#: ../../whatsnew/3.12.rst:1165 +#: ../../whatsnew/3.12.rst:1164 msgid "" "The child watcher classes :class:`asyncio.MultiLoopChildWatcher`, :class:" "`asyncio.FastChildWatcher`, :class:`asyncio.AbstractChildWatcher` and :class:" @@ -1577,7 +1577,7 @@ msgid "" "3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1171 +#: ../../whatsnew/3.12.rst:1170 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -1585,7 +1585,7 @@ msgid "" "removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1177 +#: ../../whatsnew/3.12.rst:1176 msgid "" "The :meth:`~asyncio.get_event_loop` method of the default event loop policy " "now emits a :exc:`DeprecationWarning` if there is no current event loop set " @@ -1593,14 +1593,14 @@ msgid "" "Rossum in :gh:`100160`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1182 +#: ../../whatsnew/3.12.rst:1181 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " "are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." "FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1186 +#: ../../whatsnew/3.12.rst:1185 msgid "" ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " "Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " @@ -1608,7 +1608,7 @@ msgid "" "abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1191 +#: ../../whatsnew/3.12.rst:1190 msgid "" ":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." "utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " @@ -1618,47 +1618,47 @@ msgid "" "set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1199 +#: ../../whatsnew/3.12.rst:1198 msgid "" ":mod:`email`: Deprecate the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1202 +#: ../../whatsnew/3.12.rst:1201 msgid "" ":mod:`importlib.abc`: Deprecated the following classes, scheduled for " "removal in Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1205 ../../whatsnew/3.12.rst:1409 +#: ../../whatsnew/3.12.rst:1204 ../../whatsnew/3.12.rst:1409 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../whatsnew/3.12.rst:1206 ../../whatsnew/3.12.rst:1410 +#: ../../whatsnew/3.12.rst:1205 ../../whatsnew/3.12.rst:1410 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1207 ../../whatsnew/3.12.rst:1411 +#: ../../whatsnew/3.12.rst:1206 ../../whatsnew/3.12.rst:1411 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1209 +#: ../../whatsnew/3.12.rst:1208 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "請改用 :mod:`importlib.resources.abc` 類別:" -#: ../../whatsnew/3.12.rst:1211 +#: ../../whatsnew/3.12.rst:1210 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1212 +#: ../../whatsnew/3.12.rst:1211 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1214 +#: ../../whatsnew/3.12.rst:1213 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 於 :gh:`93963` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1216 +#: ../../whatsnew/3.12.rst:1215 msgid "" ":mod:`itertools`: Deprecate the support for copy, deepcopy, and pickle " "operations, which is undocumented, inefficient, historically buggy, and " @@ -1667,7 +1667,7 @@ msgid "" "`101588`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1222 +#: ../../whatsnew/3.12.rst:1221 msgid "" ":mod:`multiprocessing`: In Python 3.14, the default :mod:`multiprocessing` " "start method will change to a safer one on Linux, BSDs, and other non-macOS " @@ -1679,14 +1679,14 @@ msgid "" "methods `." msgstr "" -#: ../../whatsnew/3.12.rst:1232 +#: ../../whatsnew/3.12.rst:1231 msgid "" ":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " "are deprecated and will be removed in Python 3.14; use :func:`importlib.util." "find_spec` instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1237 +#: ../../whatsnew/3.12.rst:1236 msgid "" ":mod:`pty`: The module has two undocumented ``master_open()`` and " "``slave_open()`` functions that have been deprecated since Python 2 but only " @@ -1694,11 +1694,11 @@ msgid "" "(Contributed by Soumendra Ganguly and Gregory P. Smith in :gh:`85984`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1242 +#: ../../whatsnew/3.12.rst:1241 msgid ":mod:`os`:" msgstr ":mod:`os`:" -#: ../../whatsnew/3.12.rst:1244 +#: ../../whatsnew/3.12.rst:1243 msgid "" "The ``st_ctime`` fields return by :func:`os.stat` and :func:`os.lstat` on " "Windows are deprecated. In a future release, they will contain the last " @@ -1707,7 +1707,7 @@ msgid "" "``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1250 +#: ../../whatsnew/3.12.rst:1249 msgid "" "On POSIX platforms, :func:`os.fork` can now raise a :exc:" "`DeprecationWarning` when it can detect being called from a multithreaded " @@ -1720,32 +1720,35 @@ msgid "" "longstanding platform compatibility problem to developers." msgstr "" -#: ../../whatsnew/3.12.rst:1260 +#: ../../whatsnew/3.12.rst:1259 msgid "" "When this warning appears due to usage of :mod:`multiprocessing` or :mod:" "`concurrent.futures` the fix is to use a different :mod:`multiprocessing` " "start method such as ``\"spawn\"`` or ``\"forkserver\"``." msgstr "" -#: ../../whatsnew/3.12.rst:1264 +#: ../../whatsnew/3.12.rst:1263 +#, fuzzy msgid "" -":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " -"and will be removed in Python 3.14. Use *onexc* instead. (Contributed by " -"Irit Katriel in :gh:`102828`.)" +":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is " +"deprecated; use *onexc* instead. (Contributed by Irit Katriel in :gh:" +"`102828`.)" msgstr "" +"``_PyErr_ChainExceptions`` 已棄用,請改用 ``_PyErr_ChainExceptions1``。(由 " +"Irit Katriel 於 :gh:`102192` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1267 +#: ../../whatsnew/3.12.rst:1266 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" -#: ../../whatsnew/3.12.rst:1269 +#: ../../whatsnew/3.12.rst:1268 msgid "" ":ref:`default adapters and converters ` are now " "deprecated. Instead, use the :ref:`sqlite3-adapter-converter-recipes` and " "tailor them to your needs. (Contributed by Erlend E. Aasland in :gh:`90016`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1275 +#: ../../whatsnew/3.12.rst:1274 msgid "" "In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " "when :ref:`named placeholders ` are used together with " @@ -1755,28 +1758,29 @@ msgid "" "Erlend E. Aasland in :gh:`101698`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1282 +#: ../../whatsnew/3.12.rst:1281 msgid "" ":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." "last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " "(Contributed by Irit Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1286 +#: ../../whatsnew/3.12.rst:1285 msgid "" ":mod:`tarfile`: Extracting tar archives without specifying *filter* is " "deprecated until Python 3.14, when ``'data'`` filter will become the " "default. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1290 +#: ../../whatsnew/3.12.rst:1289 msgid ":mod:`typing`:" msgstr "" -#: ../../whatsnew/3.12.rst:1292 +#: ../../whatsnew/3.12.rst:1291 msgid "" -":class:`typing.Hashable` and :class:`typing.Sized` aliases for :class:" -"`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:gh:`94309`.)" +":class:`typing.Hashable` and :class:`typing.Sized`, aliases for :class:" +"`collections.abc.Hashable` and :class:`collections.abc.Sized` respectively, " +"are deprecated. (:gh:`94309`.)" msgstr "" #: ../../whatsnew/3.12.rst:1295 @@ -1972,7 +1976,7 @@ msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" msgstr "" -#: ../../whatsnew/3.12.rst:1376 ../../whatsnew/3.12.rst:2320 +#: ../../whatsnew/3.12.rst:1376 ../../whatsnew/3.12.rst:2331 msgid "Pending Removal in Python 3.14" msgstr "Python 3.14 中待決議的移除項目" @@ -2085,7 +2089,7 @@ msgstr "" msgid "The ``co_lnotab`` attribute of code objects." msgstr "" -#: ../../whatsnew/3.12.rst:1436 ../../whatsnew/3.12.rst:2357 +#: ../../whatsnew/3.12.rst:1436 ../../whatsnew/3.12.rst:2368 msgid "Pending Removal in Python 3.15" msgstr "Python 3.15 中待決議的移除項目" @@ -2098,7 +2102,7 @@ msgstr "" msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1447 ../../whatsnew/3.12.rst:2375 +#: ../../whatsnew/3.12.rst:1447 ../../whatsnew/3.12.rst:2386 msgid "Pending Removal in Future Versions" msgstr "未來版本中待決議的移除項目" @@ -2128,7 +2132,7 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1467 ../../whatsnew/3.12.rst:2407 +#: ../../whatsnew/3.12.rst:1467 ../../whatsnew/3.12.rst:2418 msgid "Removed" msgstr "已移除" @@ -2466,35 +2470,39 @@ msgid "" "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1642 +#: ../../whatsnew/3.12.rst:1643 +msgid "smtpd" +msgstr "" + +#: ../../whatsnew/3.12.rst:1645 msgid "" -"``smtpd``: The module has been removed according to the schedule in :pep:" +"The ``smtpd`` module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI " "module or any other :mod:`asyncio`-based server instead. (Contributed by " "Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1653 +#: ../../whatsnew/3.12.rst:1656 msgid "" "The following undocumented :mod:`sqlite3` features, deprecated in Python " "3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1656 +#: ../../whatsnew/3.12.rst:1659 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1657 +#: ../../whatsnew/3.12.rst:1660 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1659 +#: ../../whatsnew/3.12.rst:1662 msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" -#: ../../whatsnew/3.12.rst:1662 +#: ../../whatsnew/3.12.rst:1665 msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " @@ -2502,22 +2510,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1667 +#: ../../whatsnew/3.12.rst:1670 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1670 +#: ../../whatsnew/3.12.rst:1673 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.12.rst:1672 +#: ../../whatsnew/3.12.rst:1675 msgid "" "Remove :mod:`ssl`'s :func:`!ssl.RAND_pseudo_bytes` function, deprecated in " "Python 3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. " "(Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1676 +#: ../../whatsnew/3.12.rst:1679 msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " @@ -2525,7 +2533,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1682 +#: ../../whatsnew/3.12.rst:1685 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -2536,189 +2544,189 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1694 +#: ../../whatsnew/3.12.rst:1697 msgid "Remove many long-deprecated :mod:`unittest` features:" msgstr "" -#: ../../whatsnew/3.12.rst:1698 +#: ../../whatsnew/3.12.rst:1701 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1701 +#: ../../whatsnew/3.12.rst:1704 msgid "Deprecated alias" msgstr "已棄用的別名" -#: ../../whatsnew/3.12.rst:1701 +#: ../../whatsnew/3.12.rst:1704 msgid "Method Name" msgstr "方法名稱" -#: ../../whatsnew/3.12.rst:1701 +#: ../../whatsnew/3.12.rst:1704 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1703 +#: ../../whatsnew/3.12.rst:1706 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1703 ../../whatsnew/3.12.rst:1710 +#: ../../whatsnew/3.12.rst:1706 ../../whatsnew/3.12.rst:1713 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1703 ../../whatsnew/3.12.rst:1704 -#: ../../whatsnew/3.12.rst:1705 ../../whatsnew/3.12.rst:1706 -#: ../../whatsnew/3.12.rst:1707 ../../whatsnew/3.12.rst:1708 -#: ../../whatsnew/3.12.rst:1709 +#: ../../whatsnew/3.12.rst:1706 ../../whatsnew/3.12.rst:1707 +#: ../../whatsnew/3.12.rst:1708 ../../whatsnew/3.12.rst:1709 +#: ../../whatsnew/3.12.rst:1710 ../../whatsnew/3.12.rst:1711 +#: ../../whatsnew/3.12.rst:1712 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1704 +#: ../../whatsnew/3.12.rst:1707 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1704 +#: ../../whatsnew/3.12.rst:1707 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1705 +#: ../../whatsnew/3.12.rst:1708 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1705 ../../whatsnew/3.12.rst:1711 +#: ../../whatsnew/3.12.rst:1708 ../../whatsnew/3.12.rst:1714 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1706 +#: ../../whatsnew/3.12.rst:1709 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1706 ../../whatsnew/3.12.rst:1712 +#: ../../whatsnew/3.12.rst:1709 ../../whatsnew/3.12.rst:1715 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1707 +#: ../../whatsnew/3.12.rst:1710 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1707 ../../whatsnew/3.12.rst:1713 +#: ../../whatsnew/3.12.rst:1710 ../../whatsnew/3.12.rst:1716 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1708 +#: ../../whatsnew/3.12.rst:1711 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1708 ../../whatsnew/3.12.rst:1714 +#: ../../whatsnew/3.12.rst:1711 ../../whatsnew/3.12.rst:1717 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1709 +#: ../../whatsnew/3.12.rst:1712 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1709 +#: ../../whatsnew/3.12.rst:1712 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1710 +#: ../../whatsnew/3.12.rst:1713 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1710 ../../whatsnew/3.12.rst:1711 -#: ../../whatsnew/3.12.rst:1712 ../../whatsnew/3.12.rst:1713 -#: ../../whatsnew/3.12.rst:1714 ../../whatsnew/3.12.rst:1715 -#: ../../whatsnew/3.12.rst:1716 +#: ../../whatsnew/3.12.rst:1713 ../../whatsnew/3.12.rst:1714 +#: ../../whatsnew/3.12.rst:1715 ../../whatsnew/3.12.rst:1716 +#: ../../whatsnew/3.12.rst:1717 ../../whatsnew/3.12.rst:1718 +#: ../../whatsnew/3.12.rst:1719 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1711 +#: ../../whatsnew/3.12.rst:1714 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1712 +#: ../../whatsnew/3.12.rst:1715 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1713 +#: ../../whatsnew/3.12.rst:1716 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1714 +#: ../../whatsnew/3.12.rst:1717 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1715 +#: ../../whatsnew/3.12.rst:1718 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1715 +#: ../../whatsnew/3.12.rst:1718 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1716 +#: ../../whatsnew/3.12.rst:1719 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1716 +#: ../../whatsnew/3.12.rst:1719 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1717 +#: ../../whatsnew/3.12.rst:1720 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1717 +#: ../../whatsnew/3.12.rst:1720 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1717 +#: ../../whatsnew/3.12.rst:1720 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1720 +#: ../../whatsnew/3.12.rst:1723 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1723 +#: ../../whatsnew/3.12.rst:1726 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1726 +#: ../../whatsnew/3.12.rst:1729 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1730 +#: ../../whatsnew/3.12.rst:1733 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1733 +#: ../../whatsnew/3.12.rst:1736 msgid "(Contributed by Serhiy Storchaka in :gh:`89325`.)" msgstr "(由 Serhiy Storchaka 於 :gh:`89325` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1736 +#: ../../whatsnew/3.12.rst:1739 msgid "webbrowser" msgstr "webbrowser" -#: ../../whatsnew/3.12.rst:1738 +#: ../../whatsnew/3.12.rst:1741 msgid "" "Remove support for obsolete browsers from :mod:`webbrowser`. The removed " "browsers include: Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, " "Firebird, and Firefox versions 35 and below (:gh:`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1743 +#: ../../whatsnew/3.12.rst:1746 msgid "xml.etree.ElementTree" msgstr "xml.etree.ElementTree" -#: ../../whatsnew/3.12.rst:1745 +#: ../../whatsnew/3.12.rst:1748 msgid "" "Remove the ``ElementTree.Element.copy()`` method of the pure Python " "implementation, deprecated in Python 3.10, use the :func:`copy.copy` " @@ -2727,22 +2735,22 @@ msgid "" "Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1752 +#: ../../whatsnew/3.12.rst:1755 msgid "zipimport" msgstr "zipimport" -#: ../../whatsnew/3.12.rst:1754 +#: ../../whatsnew/3.12.rst:1757 msgid "" "Remove :mod:`zipimport`'s ``find_loader()`` and ``find_module()`` methods, " "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1760 +#: ../../whatsnew/3.12.rst:1763 msgid "Others" msgstr "其他" -#: ../../whatsnew/3.12.rst:1762 +#: ../../whatsnew/3.12.rst:1765 msgid "" "Remove the ``suspicious`` rule from the documentation :file:`Makefile` and :" "file:`Doc/tools/rstlint.py`, both in favor of `sphinx-lint `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -2987,84 +3011,84 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1941 +#: ../../whatsnew/3.12.rst:1952 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1943 +#: ../../whatsnew/3.12.rst:1954 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1944 +#: ../../whatsnew/3.12.rst:1955 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1946 +#: ../../whatsnew/3.12.rst:1957 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1948 +#: ../../whatsnew/3.12.rst:1959 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1949 +#: ../../whatsnew/3.12.rst:1960 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1950 +#: ../../whatsnew/3.12.rst:1961 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1952 +#: ../../whatsnew/3.12.rst:1963 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1955 +#: ../../whatsnew/3.12.rst:1966 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1957 +#: ../../whatsnew/3.12.rst:1968 msgid "" ":pep:`697`: Add an API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1960 +#: ../../whatsnew/3.12.rst:1971 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." msgstr "" -#: ../../whatsnew/3.12.rst:1962 +#: ../../whatsnew/3.12.rst:1973 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1964 +#: ../../whatsnew/3.12.rst:1975 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " "to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" -#: ../../whatsnew/3.12.rst:1967 +#: ../../whatsnew/3.12.rst:1978 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1970 +#: ../../whatsnew/3.12.rst:1981 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1972 +#: ../../whatsnew/3.12.rst:1983 msgid "" "Add the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -3072,29 +3096,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1977 +#: ../../whatsnew/3.12.rst:1988 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1981 +#: ../../whatsnew/3.12.rst:1992 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" -#: ../../whatsnew/3.12.rst:1982 +#: ../../whatsnew/3.12.rst:1993 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1983 +#: ../../whatsnew/3.12.rst:1994 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1984 +#: ../../whatsnew/3.12.rst:1995 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1986 +#: ../../whatsnew/3.12.rst:1997 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " @@ -3105,7 +3129,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1994 +#: ../../whatsnew/3.12.rst:2005 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -3113,32 +3137,32 @@ msgid "" "using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1999 +#: ../../whatsnew/3.12.rst:2010 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:2003 +#: ../../whatsnew/3.12.rst:2014 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:2004 +#: ../../whatsnew/3.12.rst:2015 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:2005 +#: ../../whatsnew/3.12.rst:2016 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -#: ../../whatsnew/3.12.rst:2007 +#: ../../whatsnew/3.12.rst:2018 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2011 +#: ../../whatsnew/3.12.rst:2022 msgid "" "Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -3146,14 +3170,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2017 +#: ../../whatsnew/3.12.rst:2028 msgid "" "Add new function :c:func:`PyFunction_SetVectorcall` to the C API which sets " "the vectorcall field of a given :c:type:`PyFunctionObject`. (Contributed by " "Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2021 +#: ../../whatsnew/3.12.rst:2032 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -3162,28 +3186,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2027 +#: ../../whatsnew/3.12.rst:2038 msgid "" "Add :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2031 +#: ../../whatsnew/3.12.rst:2042 msgid "" "Add :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Oren in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2036 +#: ../../whatsnew/3.12.rst:2047 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2040 +#: ../../whatsnew/3.12.rst:2051 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -3193,14 +3217,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2048 +#: ../../whatsnew/3.12.rst:2059 msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2052 +#: ../../whatsnew/3.12.rst:2063 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -3208,71 +3232,71 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2057 +#: ../../whatsnew/3.12.rst:2068 msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:2063 +#: ../../whatsnew/3.12.rst:2074 msgid "" ":pep:`683`: Introduce *Immortal Objects*, which allows objects to bypass " "reference counts, and related changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:2066 +#: ../../whatsnew/3.12.rst:2077 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:2067 +#: ../../whatsnew/3.12.rst:2078 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:2068 +#: ../../whatsnew/3.12.rst:2079 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:2069 +#: ../../whatsnew/3.12.rst:2080 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:2070 +#: ../../whatsnew/3.12.rst:2081 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:2071 +#: ../../whatsnew/3.12.rst:2082 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:2072 +#: ../../whatsnew/3.12.rst:2083 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:2073 +#: ../../whatsnew/3.12.rst:2084 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:2074 +#: ../../whatsnew/3.12.rst:2085 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:2077 +#: ../../whatsnew/3.12.rst:2088 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:2076 +#: ../../whatsnew/3.12.rst:2087 msgid "" "objects that have been interned. This is now needed for :file:`refleak.py` " "to correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:2079 +#: ../../whatsnew/3.12.rst:2090 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2081 +#: ../../whatsnew/3.12.rst:2092 msgid "" ":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function and :" "c:type:`PyInterpreterConfig`, which may be used to create sub-interpreters " @@ -3280,27 +3304,27 @@ msgid "" "(Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2087 +#: ../../whatsnew/3.12.rst:2098 msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2095 +#: ../../whatsnew/3.12.rst:2106 msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" -#: ../../whatsnew/3.12.rst:2098 +#: ../../whatsnew/3.12.rst:2109 msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" -#: ../../whatsnew/3.12.rst:2102 +#: ../../whatsnew/3.12.rst:2113 msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -3309,7 +3333,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:2109 +#: ../../whatsnew/3.12.rst:2120 msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " @@ -3317,13 +3341,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:2114 +#: ../../whatsnew/3.12.rst:2125 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:2118 +#: ../../whatsnew/3.12.rst:2129 msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " @@ -3332,7 +3356,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2124 +#: ../../whatsnew/3.12.rst:2135 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -3341,13 +3365,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2130 +#: ../../whatsnew/3.12.rst:2141 msgid "" "Fix wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2134 +#: ../../whatsnew/3.12.rst:2145 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -3361,7 +3385,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:2146 +#: ../../whatsnew/3.12.rst:2157 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -3369,7 +3393,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2151 +#: ../../whatsnew/3.12.rst:2162 msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " @@ -3377,7 +3401,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2156 +#: ../../whatsnew/3.12.rst:2167 msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " @@ -3385,7 +3409,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2161 +#: ../../whatsnew/3.12.rst:2172 msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " @@ -3393,25 +3417,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:2166 +#: ../../whatsnew/3.12.rst:2177 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:2169 +#: ../../whatsnew/3.12.rst:2180 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:2170 +#: ../../whatsnew/3.12.rst:2181 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:2171 +#: ../../whatsnew/3.12.rst:2182 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:2173 +#: ../../whatsnew/3.12.rst:2184 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " @@ -3419,14 +3443,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:2178 +#: ../../whatsnew/3.12.rst:2189 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" -#: ../../whatsnew/3.12.rst:2182 +#: ../../whatsnew/3.12.rst:2193 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -3435,17 +3459,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:2189 +#: ../../whatsnew/3.12.rst:2200 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:2191 +#: ../../whatsnew/3.12.rst:2202 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:2193 +#: ../../whatsnew/3.12.rst:2204 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -3453,20 +3477,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:2198 +#: ../../whatsnew/3.12.rst:2209 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:2202 +#: ../../whatsnew/3.12.rst:2213 msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" -#: ../../whatsnew/3.12.rst:2205 +#: ../../whatsnew/3.12.rst:2216 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -3474,14 +3498,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:2210 +#: ../../whatsnew/3.12.rst:2221 msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" -#: ../../whatsnew/3.12.rst:2214 +#: ../../whatsnew/3.12.rst:2225 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -3492,15 +3516,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:2222 +#: ../../whatsnew/3.12.rst:2233 msgid ":c:func:`PyUnstable_Long_IsCompact`" msgstr ":c:func:`PyUnstable_Long_IsCompact`" -#: ../../whatsnew/3.12.rst:2223 +#: ../../whatsnew/3.12.rst:2234 msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr ":c:func:`PyUnstable_Long_CompactValue`" -#: ../../whatsnew/3.12.rst:2225 +#: ../../whatsnew/3.12.rst:2236 msgid "" "Custom allocators, set via :c:func:`PyMem_SetAllocator`, are now required to " "be thread-safe, regardless of memory domain. Allocators that don't have " @@ -3509,7 +3533,7 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:2235 +#: ../../whatsnew/3.12.rst:2246 msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -3518,76 +3542,76 @@ msgid "" "PEP by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.12.rst:2240 +#: ../../whatsnew/3.12.rst:2251 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:2242 ../../whatsnew/3.12.rst:2327 +#: ../../whatsnew/3.12.rst:2253 ../../whatsnew/3.12.rst:2338 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr ":c:var:`Py_DebugFlag`: 請改用 :c:member:`PyConfig.parser_debug`" -#: ../../whatsnew/3.12.rst:2243 ../../whatsnew/3.12.rst:2328 +#: ../../whatsnew/3.12.rst:2254 ../../whatsnew/3.12.rst:2339 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr ":c:var:`Py_VerboseFlag`: 請改用 :c:member:`PyConfig.verbose`" -#: ../../whatsnew/3.12.rst:2244 ../../whatsnew/3.12.rst:2329 +#: ../../whatsnew/3.12.rst:2255 ../../whatsnew/3.12.rst:2340 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr ":c:var:`Py_QuietFlag`: 請改用 :c:member:`PyConfig.quiet`" -#: ../../whatsnew/3.12.rst:2245 ../../whatsnew/3.12.rst:2330 +#: ../../whatsnew/3.12.rst:2256 ../../whatsnew/3.12.rst:2341 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr ":c:var:`Py_InteractiveFlag`: 請改用 :c:member:`PyConfig.interactive`" -#: ../../whatsnew/3.12.rst:2246 ../../whatsnew/3.12.rst:2331 +#: ../../whatsnew/3.12.rst:2257 ../../whatsnew/3.12.rst:2342 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr ":c:var:`Py_InspectFlag`: 請改用 :c:member:`PyConfig.inspect`" -#: ../../whatsnew/3.12.rst:2247 ../../whatsnew/3.12.rst:2332 +#: ../../whatsnew/3.12.rst:2258 ../../whatsnew/3.12.rst:2343 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" ":c:var:`Py_OptimizeFlag`: 請改用 :c:member:`PyConfig.optimization_level`" -#: ../../whatsnew/3.12.rst:2248 ../../whatsnew/3.12.rst:2333 +#: ../../whatsnew/3.12.rst:2259 ../../whatsnew/3.12.rst:2344 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr ":c:var:`Py_NoSiteFlag`: 請改用 :c:member:`PyConfig.site_import`" -#: ../../whatsnew/3.12.rst:2249 ../../whatsnew/3.12.rst:2334 +#: ../../whatsnew/3.12.rst:2260 ../../whatsnew/3.12.rst:2345 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" ":c:var:`Py_BytesWarningFlag`: 請改用 :c:member:`PyConfig.bytes_warning`" -#: ../../whatsnew/3.12.rst:2250 ../../whatsnew/3.12.rst:2335 +#: ../../whatsnew/3.12.rst:2261 ../../whatsnew/3.12.rst:2346 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" ":c:var:`Py_FrozenFlag`: 請改用 :c:member:`PyConfig.pathconfig_warnings`" -#: ../../whatsnew/3.12.rst:2251 ../../whatsnew/3.12.rst:2336 +#: ../../whatsnew/3.12.rst:2262 ../../whatsnew/3.12.rst:2347 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" ":c:var:`Py_IgnoreEnvironmentFlag`: 請改用 :c:member:`PyConfig." "use_environment`" -#: ../../whatsnew/3.12.rst:2252 ../../whatsnew/3.12.rst:2337 +#: ../../whatsnew/3.12.rst:2263 ../../whatsnew/3.12.rst:2348 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" ":c:var:`Py_DontWriteBytecodeFlag`: 請改用 :c:member:`PyConfig.write_bytecode`" -#: ../../whatsnew/3.12.rst:2253 ../../whatsnew/3.12.rst:2338 +#: ../../whatsnew/3.12.rst:2264 ../../whatsnew/3.12.rst:2349 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" ":c:var:`Py_NoUserSiteDirectory`: 請改用 :c:member:`PyConfig." "user_site_directory`" -#: ../../whatsnew/3.12.rst:2254 ../../whatsnew/3.12.rst:2339 +#: ../../whatsnew/3.12.rst:2265 ../../whatsnew/3.12.rst:2350 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" ":c:var:`Py_UnbufferedStdioFlag`: 請改用 :c:member:`PyConfig.buffered_stdio`" -#: ../../whatsnew/3.12.rst:2255 ../../whatsnew/3.12.rst:2340 +#: ../../whatsnew/3.12.rst:2266 ../../whatsnew/3.12.rst:2351 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" @@ -3595,11 +3619,11 @@ msgstr "" ":c:var:`Py_HashRandomizationFlag`: 請改用 :c:member:`PyConfig.use_hash_seed` " "和 :c:member:`PyConfig.hash_seed`" -#: ../../whatsnew/3.12.rst:2257 ../../whatsnew/3.12.rst:2342 +#: ../../whatsnew/3.12.rst:2268 ../../whatsnew/3.12.rst:2353 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr ":c:var:`Py_IsolatedFlag`: 請改用 :c:member:`PyConfig.isolated`" -#: ../../whatsnew/3.12.rst:2258 ../../whatsnew/3.12.rst:2343 +#: ../../whatsnew/3.12.rst:2269 ../../whatsnew/3.12.rst:2354 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" @@ -3607,7 +3631,7 @@ msgstr "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: 請改用 :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" -#: ../../whatsnew/3.12.rst:2259 ../../whatsnew/3.12.rst:2344 +#: ../../whatsnew/3.12.rst:2270 ../../whatsnew/3.12.rst:2355 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" @@ -3615,7 +3639,7 @@ msgstr "" ":c:var:`Py_LegacyWindowsStdioFlag`: 請改用 :c:member:`PyConfig." "legacy_windows_stdio`" -#: ../../whatsnew/3.12.rst:2260 ../../whatsnew/3.12.rst:2345 +#: ../../whatsnew/3.12.rst:2271 ../../whatsnew/3.12.rst:2356 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" @@ -3623,7 +3647,7 @@ msgstr "" ":c:var:`!Py_FileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." "filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2261 ../../whatsnew/3.12.rst:2346 +#: ../../whatsnew/3.12.rst:2272 ../../whatsnew/3.12.rst:2357 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" @@ -3631,7 +3655,7 @@ msgstr "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." "filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2262 ../../whatsnew/3.12.rst:2347 +#: ../../whatsnew/3.12.rst:2273 ../../whatsnew/3.12.rst:2358 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" @@ -3639,7 +3663,7 @@ msgstr "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: 請改用 :c:member:`PyConfig." "filesystem_errors`" -#: ../../whatsnew/3.12.rst:2263 ../../whatsnew/3.12.rst:2348 +#: ../../whatsnew/3.12.rst:2274 ../../whatsnew/3.12.rst:2359 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" @@ -3647,7 +3671,7 @@ msgstr "" ":c:var:`!Py_UTF8Mode`: 請改用 :c:member:`PyPreConfig.utf8_mode`\\ (參見 :c:" "func:`Py_PreInitialize`)" -#: ../../whatsnew/3.12.rst:2265 +#: ../../whatsnew/3.12.rst:2276 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" @@ -3655,25 +3679,25 @@ msgstr "" ":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" "(由 Victor Stinner 於 :gh:`77782` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2269 +#: ../../whatsnew/3.12.rst:2280 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases is deprecated and will be disabled in Python 3.14. (:gh:`95388`)" msgstr "" -#: ../../whatsnew/3.12.rst:2272 +#: ../../whatsnew/3.12.rst:2283 msgid "" "The :file:`structmember.h` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr ":file:`structmember.h` 標頭已棄用,但仍可使用,且還沒有移除它的計畫。" -#: ../../whatsnew/3.12.rst:2275 +#: ../../whatsnew/3.12.rst:2286 msgid "" "Its contents are now available just by including :file:`Python.h`, with a " "``Py`` prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:2278 +#: ../../whatsnew/3.12.rst:2289 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" @@ -3681,13 +3705,13 @@ msgstr "" ":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` 和 :c:func:" "`PyMember_SetOne`" -#: ../../whatsnew/3.12.rst:2280 +#: ../../whatsnew/3.12.rst:2291 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:2282 +#: ../../whatsnew/3.12.rst:2293 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" @@ -3695,23 +3719,23 @@ msgstr "" ":c:macro:`Py_READONLY`\\ (先前為 ``READONLY``)和 :c:macro:" "`Py_AUDIT_READ`\\ (先前全大寫)旗標" -#: ../../whatsnew/3.12.rst:2285 +#: ../../whatsnew/3.12.rst:2296 msgid "Several items are not exposed from :file:`Python.h`:" msgstr "數個項目不再從 :file:`Python.h` 中公開:" -#: ../../whatsnew/3.12.rst:2287 +#: ../../whatsnew/3.12.rst:2298 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr ":c:macro:`T_OBJECT`\\ (請改用 :c:macro:`Py_T_OBJECT_EX`)" -#: ../../whatsnew/3.12.rst:2288 +#: ../../whatsnew/3.12.rst:2299 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr ":c:macro:`T_NONE`\\ (先前未記錄於文件上,且相當古怪)" -#: ../../whatsnew/3.12.rst:2289 +#: ../../whatsnew/3.12.rst:2300 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "不做任何事的巨集 ``WRITE_RESTRICTED``。" -#: ../../whatsnew/3.12.rst:2290 +#: ../../whatsnew/3.12.rst:2301 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." @@ -3719,33 +3743,33 @@ msgstr "" "``RESTRICTED`` 和 ``READ_RESTRICTED`` 這兩個巨集,相當於 :c:macro:" "`Py_AUDIT_READ`。" -#: ../../whatsnew/3.12.rst:2292 +#: ../../whatsnew/3.12.rst:2303 msgid "" "In some configurations, ```` is not included from :file:`Python." "h`. It should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2295 +#: ../../whatsnew/3.12.rst:2306 msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" -#: ../../whatsnew/3.12.rst:2300 +#: ../../whatsnew/3.12.rst:2311 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2303 +#: ../../whatsnew/3.12.rst:2314 msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2308 +#: ../../whatsnew/3.12.rst:2319 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." @@ -3753,7 +3777,7 @@ msgstr "" ":c:func:`!PyErr_Display` 已棄用,請改用 :c:func:`PyErr_DisplayException`。" "(由 Irit Katriel 於 :gh:`102755` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2311 +#: ../../whatsnew/3.12.rst:2322 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" @@ -3761,56 +3785,56 @@ msgstr "" "``_PyErr_ChainExceptions`` 已棄用,請改用 ``_PyErr_ChainExceptions1``。(由 " "Irit Katriel 於 :gh:`102192` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2314 +#: ../../whatsnew/3.12.rst:2325 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" -#: ../../whatsnew/3.12.rst:2322 +#: ../../whatsnew/3.12.rst:2333 msgid "" "The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " "(:pep:`699`; :gh:`101193`)." msgstr "" -#: ../../whatsnew/3.12.rst:2325 +#: ../../whatsnew/3.12.rst:2336 msgid "Global configuration variables:" msgstr "" -#: ../../whatsnew/3.12.rst:2350 +#: ../../whatsnew/3.12.rst:2361 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead." msgstr "" ":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" -#: ../../whatsnew/3.12.rst:2353 +#: ../../whatsnew/3.12.rst:2364 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases (:gh:`95388`)." msgstr "" -#: ../../whatsnew/3.12.rst:2359 +#: ../../whatsnew/3.12.rst:2370 msgid "" ":c:func:`PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule`" msgstr "" ":c:func:`PyImport_ImportModuleNoBlock`:請改用 :c:func:" "`PyImport_ImportModule`" -#: ../../whatsnew/3.12.rst:2360 +#: ../../whatsnew/3.12.rst:2371 msgid ":c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t`" msgstr ":c:type:`!Py_UNICODE_WIDE` 型別:請改用 :c:type:`wchar_t`" -#: ../../whatsnew/3.12.rst:2361 +#: ../../whatsnew/3.12.rst:2372 msgid ":c:type:`Py_UNICODE` type: use :c:type:`wchar_t`" msgstr ":c:type:`Py_UNICODE` 型別:請改用 :c:type:`wchar_t`" -#: ../../whatsnew/3.12.rst:2362 +#: ../../whatsnew/3.12.rst:2373 msgid "Python initialization functions:" msgstr "Python 初始化函式:" -#: ../../whatsnew/3.12.rst:2364 +#: ../../whatsnew/3.12.rst:2375 msgid "" ":c:func:`PySys_ResetWarnOptions`: clear :data:`sys.warnoptions` and :data:`!" "warnings.filters`" @@ -3818,27 +3842,27 @@ msgstr "" ":c:func:`PySys_ResetWarnOptions`:清除 :data:`sys.warnoptions` 和 :data:`!" "warnings.filters`" -#: ../../whatsnew/3.12.rst:2366 +#: ../../whatsnew/3.12.rst:2377 msgid ":c:func:`Py_GetExecPrefix`: get :data:`sys.exec_prefix`" msgstr ":c:func:`Py_GetExecPrefix`:取得 :data:`sys.exec_prefix`" -#: ../../whatsnew/3.12.rst:2367 +#: ../../whatsnew/3.12.rst:2378 msgid ":c:func:`Py_GetPath`: get :data:`sys.path`" msgstr ":c:func:`Py_GetPath`:取得 :data:`sys.path`" -#: ../../whatsnew/3.12.rst:2368 +#: ../../whatsnew/3.12.rst:2379 msgid ":c:func:`Py_GetPrefix`: get :data:`sys.prefix`" msgstr ":c:func:`Py_GetPrefix`:取得 :data:`sys.prefix`" -#: ../../whatsnew/3.12.rst:2369 +#: ../../whatsnew/3.12.rst:2380 msgid ":c:func:`Py_GetProgramFullPath`: get :data:`sys.executable`" msgstr ":c:func:`Py_GetProgramFullPath`:取得 :data:`sys.executable`" -#: ../../whatsnew/3.12.rst:2370 +#: ../../whatsnew/3.12.rst:2381 msgid ":c:func:`Py_GetProgramName`: get :data:`sys.executable`" msgstr ":c:func:`Py_GetProgramName`:取得 :data:`sys.executable`" -#: ../../whatsnew/3.12.rst:2371 +#: ../../whatsnew/3.12.rst:2382 msgid "" ":c:func:`Py_GetPythonHome`: get :c:member:`PyConfig.home` or the :envvar:" "`PYTHONHOME` environment variable" @@ -3846,41 +3870,41 @@ msgstr "" ":c:func:`Py_GetPythonHome`:取得 :c:member:`PyConfig.home` 或 :envvar:" "`PYTHONHOME` 環境變數" -#: ../../whatsnew/3.12.rst:2377 +#: ../../whatsnew/3.12.rst:2388 msgid "" "The following APIs are deprecated and will be removed, although there is " "currently no date scheduled for their removal." msgstr "以下 API 已棄用,且將會被移除,雖目前尚未定下移除日期。" -#: ../../whatsnew/3.12.rst:2380 +#: ../../whatsnew/3.12.rst:2391 msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: unneeded since Python 3.8" msgstr ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`:自 Python 3.8 起不再需要" -#: ../../whatsnew/3.12.rst:2381 +#: ../../whatsnew/3.12.rst:2392 msgid ":c:func:`PyErr_Fetch`: use :c:func:`PyErr_GetRaisedException`" msgstr ":c:func:`PyErr_Fetch`:請改用 :c:func:`PyErr_GetRaisedException`" -#: ../../whatsnew/3.12.rst:2382 +#: ../../whatsnew/3.12.rst:2393 msgid "" ":c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException`" msgstr "" ":c:func:`PyErr_NormalizeException`:請改用 :c:func:`PyErr_GetRaisedException`" -#: ../../whatsnew/3.12.rst:2383 +#: ../../whatsnew/3.12.rst:2394 msgid ":c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException`" msgstr ":c:func:`PyErr_Restore`:請改用 :c:func:`PyErr_SetRaisedException`" -#: ../../whatsnew/3.12.rst:2384 +#: ../../whatsnew/3.12.rst:2395 msgid "" ":c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject`" msgstr "" ":c:func:`PyModule_GetFilename`:請改用 :c:func:`PyModule_GetFilenameObject`" -#: ../../whatsnew/3.12.rst:2385 +#: ../../whatsnew/3.12.rst:2396 msgid ":c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child`" msgstr ":c:func:`PyOS_AfterFork`:請改用 :c:func:`PyOS_AfterFork_Child`" -#: ../../whatsnew/3.12.rst:2386 +#: ../../whatsnew/3.12.rst:2397 msgid "" ":c:func:`PySlice_GetIndicesEx`: use :c:func:`PySlice_Unpack` and :c:func:" "`PySlice_AdjustIndices`" @@ -3888,141 +3912,125 @@ msgstr "" ":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` 和 :c:func:" "`PySlice_AdjustIndices`" -#: ../../whatsnew/3.12.rst:2387 +#: ../../whatsnew/3.12.rst:2398 msgid ":c:func:`!PyUnicode_AsDecodedObject`: use :c:func:`PyCodec_Decode`" msgstr ":c:func:`!PyUnicode_AsDecodedObject`:請改用 :c:func:`PyCodec_Decode`" -#: ../../whatsnew/3.12.rst:2388 +#: ../../whatsnew/3.12.rst:2399 msgid ":c:func:`!PyUnicode_AsDecodedUnicode`: use :c:func:`PyCodec_Decode`" msgstr ":c:func:`!PyUnicode_AsDecodedUnicode`:請改用 :c:func:`PyCodec_Decode`" -#: ../../whatsnew/3.12.rst:2389 +#: ../../whatsnew/3.12.rst:2400 msgid ":c:func:`!PyUnicode_AsEncodedObject`: use :c:func:`PyCodec_Encode`" msgstr ":c:func:`!PyUnicode_AsEncodedObject`:請改用 :c:func:`PyCodec_Encode`" -#: ../../whatsnew/3.12.rst:2390 +#: ../../whatsnew/3.12.rst:2401 msgid ":c:func:`!PyUnicode_AsEncodedUnicode`: use :c:func:`PyCodec_Encode`" msgstr ":c:func:`!PyUnicode_AsEncodedUnicode`:請改用 :c:func:`PyCodec_Encode`" -#: ../../whatsnew/3.12.rst:2391 +#: ../../whatsnew/3.12.rst:2402 msgid ":c:func:`PyUnicode_READY`: unneeded since Python 3.12" msgstr ":c:func:`PyUnicode_READY`:自 Python 3.12 起不再需要" -#: ../../whatsnew/3.12.rst:2392 +#: ../../whatsnew/3.12.rst:2403 msgid ":c:func:`!PyErr_Display`: use :c:func:`PyErr_DisplayException`" msgstr ":c:func:`!PyErr_Display`:請改用 :c:func:`PyErr_DisplayException`" -#: ../../whatsnew/3.12.rst:2393 +#: ../../whatsnew/3.12.rst:2404 msgid ":c:func:`!_PyErr_ChainExceptions`: use ``_PyErr_ChainExceptions1``" msgstr ":c:func:`!_PyErr_ChainExceptions`:請改用 ``_PyErr_ChainExceptions1``" -#: ../../whatsnew/3.12.rst:2394 +#: ../../whatsnew/3.12.rst:2405 msgid "" ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " "instead" msgstr "" ":c:member:`!PyBytesObject.ob_shash` 成員:請改用 :c:func:`PyObject_Hash`" -#: ../../whatsnew/3.12.rst:2396 +#: ../../whatsnew/3.12.rst:2407 msgid ":c:member:`!PyDictObject.ma_version_tag` member" msgstr ":c:member:`!PyDictObject.ma_version_tag` 成員" -#: ../../whatsnew/3.12.rst:2397 +#: ../../whatsnew/3.12.rst:2408 msgid "Thread Local Storage (TLS) API:" msgstr "" -#: ../../whatsnew/3.12.rst:2399 +#: ../../whatsnew/3.12.rst:2410 msgid ":c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc`" msgstr ":c:func:`PyThread_create_key`:請改用 :c:func:`PyThread_tss_alloc`" -#: ../../whatsnew/3.12.rst:2400 +#: ../../whatsnew/3.12.rst:2411 msgid ":c:func:`PyThread_delete_key`: use :c:func:`PyThread_tss_free`" msgstr ":c:func:`PyThread_delete_key`:請改用 :c:func:`PyThread_tss_free`" -#: ../../whatsnew/3.12.rst:2401 +#: ../../whatsnew/3.12.rst:2412 msgid ":c:func:`PyThread_set_key_value`: use :c:func:`PyThread_tss_set`" msgstr ":c:func:`PyThread_set_key_value`:請改用 :c:func:`PyThread_tss_set`" -#: ../../whatsnew/3.12.rst:2402 +#: ../../whatsnew/3.12.rst:2413 msgid ":c:func:`PyThread_get_key_value`: use :c:func:`PyThread_tss_get`" msgstr ":c:func:`PyThread_get_key_value`:請改用 :c:func:`PyThread_tss_get`" -#: ../../whatsnew/3.12.rst:2403 +#: ../../whatsnew/3.12.rst:2414 msgid ":c:func:`PyThread_delete_key_value`: use :c:func:`PyThread_tss_delete`" msgstr "" ":c:func:`PyThread_delete_key_value`:請改用 :c:func:`PyThread_tss_delete`" -#: ../../whatsnew/3.12.rst:2404 +#: ../../whatsnew/3.12.rst:2415 msgid ":c:func:`PyThread_ReInitTLS`: unneeded since Python 3.7" msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要" -#: ../../whatsnew/3.12.rst:2409 +#: ../../whatsnew/3.12.rst:2420 msgid "" "Remove the :file:`token.h` header file. There was never any public tokenizer " "C API. The :file:`token.h` header file was only designed to be used by " "Python internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2414 +#: ../../whatsnew/3.12.rst:2425 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2416 +#: ../../whatsnew/3.12.rst:2427 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2417 +#: ../../whatsnew/3.12.rst:2428 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2418 +#: ../../whatsnew/3.12.rst:2429 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2419 +#: ../../whatsnew/3.12.rst:2430 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2420 +#: ../../whatsnew/3.12.rst:2431 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2421 +#: ../../whatsnew/3.12.rst:2432 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2422 +#: ../../whatsnew/3.12.rst:2433 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2423 +#: ../../whatsnew/3.12.rst:2434 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2424 +#: ../../whatsnew/3.12.rst:2435 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2426 +#: ../../whatsnew/3.12.rst:2437 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" "移除 ``PyUnicode_InternImmortal()`` 函式巨集。(由 Victor Stinner 於 :gh:" "`85858` 中貢獻。)" - -#: ../../whatsnew/3.12.rst:2429 -msgid "" -"Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " -"(Contributed by Nikita Sobolev in :gh:`99482`.)" -msgstr "" -"移除數個標準函式庫模組與測試中的 ``Jython`` 相容性修補程式。(由 Nikita " -"Sobolev 於 :gh:`99482` 中貢獻。)" - -#: ../../whatsnew/3.12.rst:2432 -msgid "" -"Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" -"`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" -msgstr "" -"移除 :mod:`ctypes` 模組中的 ``_use_broken_old_ctypes_structure_semantics_`` " -"旗標。(由 Nikita Sobolev 於 :gh:`99285` 中貢獻。)" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index 05160bd208..6677affcfa 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-22 00:03+0000\n" +"POT-Creation-Date: 2023-12-06 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" @@ -2827,7 +2827,7 @@ msgstr "" msgid "" "The format of the ``co_lnotab`` attribute of code objects changed to support " "a negative line number delta. By default, Python does not emit bytecode with " -"a negative line number delta. Functions using ``frame.f_lineno``, " +"a negative line number delta. Functions using :attr:`frame.f_lineno`, " "``PyFrame_GetLineNumber()`` or ``PyCode_Addr2Line()`` are not affected. " "Functions directly decoding ``co_lnotab`` should be updated to use a signed " "8-bit integer type for the line number delta, but this is only required to " diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 573273daac..49623ba010 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-27 00:03+0000\n" +"POT-Creation-Date: 2023-12-06 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-" @@ -2706,9 +2706,9 @@ msgstr "" #: ../../whatsnew/3.7.rst:1892 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 " -"``f_trace_lines`` and ``f_trace_opcodes`` attributes on the frame being " -"traced. (Contributed by Nick Coghlan in :issue:`31344`.)" +"the ``opcode`` events from the interpreter by setting the corresponding new :" +"attr:`~frame.f_trace_lines` and :attr:`~frame.f_trace_opcodes` attributes on " +"the frame being traced. (Contributed by Nick Coghlan in :issue:`31344`.)" msgstr "" #: ../../whatsnew/3.7.rst:1897